diff --git a/ChangeLog b/ChangeLog index 1b6378a..333b7f9 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,4 +1,13 @@ +2016-04-30 Martin A. Brown + * bumping version to tldp-0.7.12 + * adding ChangeLog (this file) + * cosmetic changes; deduplication of test data, copyright in many files + * add contrib/debian-release.sh + * put version number in tldp/__init__.py + * generate specfile after tagging, using contrib/rpm-release.py + * Debian packaging issues larger addressed + 2016-04-21 Martin A. Brown * bumping version to tldp-0.7.7 * Debian packaging attempt #1, created build with 'native' source format diff --git a/LICENSE b/LICENSE index fd44f73..88a9a4a 100644 --- a/LICENSE +++ b/LICENSE @@ -1,3 +1,5 @@ +Copyright (c) 2016, Linux Documentation Project + Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, diff --git a/README.rst b/README.rst index 9d40271..6d4b2ad 100644 --- a/README.rst +++ b/README.rst @@ -338,9 +338,11 @@ called ldp-docbook-{xsl,dsssl}. There aren't any such packages for RPM (yet). Supported Python versions ------------------------- -This package was built and used against Python-2.7.8 (OpenSUS) and -Python-2.7.6 (Ubuntu). It has been tested (success for test suite) against -Python-3.4.1 and lightly used against Python-3.4.1. +This package was developed against Python-2.7.8 and Python-3.4.1 (on +OpenSUSE). It has been used on Python-2.7.6 (Ubuntu-14.04) and Python-3.4.2 and Python-2.7.9 (on Debian 8). + +Continuous Integration testing information and coverage can be reviewed at +`this project's Travis CI page `_. Installation @@ -351,25 +353,39 @@ requires a large number of other packages, most of which are outside of the Python ecosystem. There's room for improvement here, but here are a few tidbits. -Build an RPM::: +Build an RPM:: python setup.py sdist && rpmbuild -ta ./dist/python-tldp-${VERSION}.tar.gz -There's a file, `contrib/tldp.spec`, which makes a few changes to the -setuptools stock-generated specfile. Specifically, the package gets named -`python-tldp` instead of `tldp` and the configuration file is marked -`%config(noreplace)`. +There's a generated file, `contrib/tldp.spec`, which makes a few changes to the +setuptools stock-generated specfile. It adds the dependencies, marks the +configuration file as %config(noreplace), adds a manpage and names the binary +package `python-tldp`. -I know less about packaging for Debian. Relying on python-stdeb yields a -working and usable Debian package which has been tested out on an Ubuntu -14.04.3 system. +Build a DEB:: -Build a DEB::: +Check to see if the package is available from upstream. It may be included in +the Debian repositories already:: + + apt-cache search tldp + +The quick and dirty way is as follows:: python setup.py --command-packages=stdeb.command bdist_deb -I have not tried installing the package in a virtualenv or with pip. If you -try that, please let me know any problems you encounter. +But, there is also a `debian` directory. If you are working straight from the +git checkout, you should be able to generate an installable (unsigned) Debian +package with:: + + bash contrib/debian-release.sh -us -uc + +Install using pip: + +Unknown. Because the tool relies so heavily on system-installed non-Python +tools, I have not bothered to try installing the package using pip. It should +work equivalently as well as running the program straight from a checkout. +If you learn anything here or have suggestions, for me, please feel free to +send them along. Links diff --git a/contrib/rpm-release.py b/contrib/rpm-release.py index 841e302..4190139 100644 --- a/contrib/rpm-release.py +++ b/contrib/rpm-release.py @@ -10,7 +10,7 @@ import sys opd = os.path.dirname opj = os.path.join -sys.path.append(opd(opd(__file__))) +sys.path.insert(0, opd(opd(__file__))) from tldp import VERSION fin = open(opj(opd(__file__), 'tldp.spec.in')) diff --git a/contrib/tldp.spec b/contrib/tldp.spec index adf70a1..5d21496 100644 --- a/contrib/tldp.spec +++ b/contrib/tldp.spec @@ -1,8 +1,8 @@ %define sourcename tldp %define name python-tldp -%define version 0.7.10 -%define unmangled_version 0.7.10 -%define unmangled_version 0.7.10 +%define version 0.7.12 +%define unmangled_version 0.7.12 +%define unmangled_version 0.7.12 %define release 1 Summary: automatic publishing tool for DocBook, Linuxdoc and Asciidoc diff --git a/debian/changelog b/debian/changelog index bcc58b7..c111865 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,4 +1,4 @@ -tldp (0.7.10-1) unstable; urgency=low +tldp (0.7.12-1) unstable; urgency=low * Initial release (Closes: #822181) diff --git a/debian/clean b/debian/clean new file mode 100644 index 0000000..fd7860d --- /dev/null +++ b/debian/clean @@ -0,0 +1,2 @@ +tldp.egg-info/ +docs/_build/ diff --git a/debian/control b/debian/control index 37159d4..09567fe 100644 --- a/debian/control +++ b/debian/control @@ -34,8 +34,20 @@ Package: python3-tldp Architecture: all Depends: ${misc:Depends}, ${python3:Depends}, - python3, - python3-networkx + fop, + jing, + xsltproc, + docbook, + docbook5-xml, + docbook-xsl-ns, + htmldoc, + html2text, + sgml2x, + asciidoc, + linuxdoc-tools-latex, + linuxdoc-tools-text, + ldp-docbook-xsl, + ldp-docbook-dsssl Description: automatic publishing tool for DocBook, Linuxdoc and Asciidoc The Linux Documentation Project (TLDP) stores hundreds of documents in DocBook SGML, DocBook XML, Linuxdoc and Asciidoc formats. This tool diff --git a/debian/copyright b/debian/copyright index 6fe2cc5..aacd4a7 100644 --- a/debian/copyright +++ b/debian/copyright @@ -7,18 +7,18 @@ Files: * Copyright: 2016 Linux Documentation Project License: MIT -# Files: extras/dsssl/* extras/css/* -# Copyright: 2000-2003 - Greg Ferguson (gferg@metalab.unc.edu) -# License: GPL-2.0+ -# -Files: extras/dsssl/* extras/xsl/* extras/css/* +Files: extras/dsssl/ldp.dsl +Copyright: 2000-2003 - Greg Ferguson (gferg@metalab.unc.edu) +License: GPL-2.0+ + +Files: extras/xsl/tldp-*.xsl extras/css/style.css Copyright: 2000-2002 - David Horton (dhorton@speakeasy.net) License: GFDL-1.2 -# Files: tests/sample-documents/Docbook-4.2-WHYNOT/images/* tests/sample-documents/DocBookSGML-Larger/images/bullet.png tests/sample-documents/Linuxdoc-Larger/images/* -# Copyright: Copyright (C) 2011-2012 O'Reilly Media -# License: MIT -# +Files: tests/sample-documents/DocBook-4.2-WHYNOT/images/* tests/sample-documents/DocBookSGML-Larger/images/bullet.png +Copyright: Copyright (C) 2011-2012 O'Reilly Media +License: MIT + Files: extras/collateindex.pl Copyright: 1997-2001 Norman Walsh License: MIT @@ -42,23 +42,30 @@ License: MIT TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -# License: GPL-2.0+ -# This package is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2 of the License, or -# (at your option) any later version. -# . -# This package is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# . -# You should have received a copy of the GNU General Public License -# along with this program. If not, see -# . -# On Debian systems, the complete text of the GNU General -# Public License version 2 can be found in "/usr/share/common-licenses/GPL-2". -# +License: GPL-2.0+ + This package is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + . + This package is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + . + You should have received a copy of the GNU General Public License + along with this program. If not, see + . + On Debian systems, the complete text of the GNU General + Public License version 2 can be found in "/usr/share/common-licenses/GPL-2". + License: GFDL-1.2 + Permission is granted to copy, distribute and/or modify this document + under the terms of the GNU Free Documentation License, Version 1.2 + or any later version published by the Free Software Foundation; + with no Invariant Sections, no Front-Cover Texts, and no Back-Cover Texts. + A copy of the license is included in the section entitled "GNU + Free Documentation License". + . On Debian systems, the complete text of the GFDL-1.2 can be found in /usr/share/common-licenses/GFDL-1.2 diff --git a/debian/python3-tldp.lintian-overrides b/debian/python3-tldp.lintian-overrides deleted file mode 100644 index d2f22d7..0000000 --- a/debian/python3-tldp.lintian-overrides +++ /dev/null @@ -1 +0,0 @@ -library-package-name-for-application diff --git a/debian/rules b/debian/rules index e4ea5a0..7b8f796 100755 --- a/debian/rules +++ b/debian/rules @@ -7,13 +7,5 @@ export PYBUILD_NAME=tldp override_dh_installman: (cd docs && \ - sphinx-build \ - -b man -D today="$(BUILD_DATE)" \ - -d _build/doctrees . _build/man) + sphinx-build -b man -d _build/doctrees . _build/man) dh_installman docs/_build/man/ldptool.1 - -override_dh_clean: - (cd docs && \ - rm -rf -- ./_build) - rm -rf -- ./$(PYBUILD_NAME).egg-info - dh_clean diff --git a/debian/upstream/metadata b/debian/upstream/metadata new file mode 100644 index 0000000..45a4737 --- /dev/null +++ b/debian/upstream/metadata @@ -0,0 +1,4 @@ +Bug-Database: https://github.com/tLDP/LDP/issues +Contact: discuss@en.tldp.org +Name: python-tldp +Repository: https://github.com/tLDP/LDP diff --git a/tests/example.py b/tests/example.py index 7393eb1..17c6edc 100644 --- a/tests/example.py +++ b/tests/example.py @@ -1,3 +1,6 @@ +# -*- coding: utf8 -*- +# +# Copyright (c) 2016 Linux Documentation Project from __future__ import absolute_import, division, print_function from __future__ import unicode_literals @@ -23,57 +26,39 @@ def load_content(ex): ex_linuxdoc = Namespace( - doctype=tldp.doctypes.linuxdoc.Linuxdoc, - filename=opj(sampledocs, 'linuxdoc-simple.sgml'), - ) + doctype=tldp.doctypes.linuxdoc.Linuxdoc, + filename=opj(sampledocs, 'linuxdoc-simple.sgml'),) ex_docbooksgml = Namespace( - doctype=tldp.doctypes.docbooksgml.DocbookSGML, - filename=opj(sampledocs, 'docbooksgml-simple.sgml'), - ) + doctype=tldp.doctypes.docbooksgml.DocbookSGML, + filename=opj(sampledocs, 'docbooksgml-simple.sgml'),) ex_docbook4xml = Namespace( - doctype=tldp.doctypes.docbook4xml.Docbook4XML, - filename=opj(sampledocs, 'docbook4xml-simple.xml'), - ) + doctype=tldp.doctypes.docbook4xml.Docbook4XML, + filename=opj(sampledocs, 'docbook4xml-simple.xml'),) ex_docbook5xml = Namespace( - doctype=tldp.doctypes.docbook5xml.Docbook5XML, - filename=opj(sampledocs, 'docbook5xml-simple.xml'), - ) + doctype=tldp.doctypes.docbook5xml.Docbook5XML, + filename=opj(sampledocs, 'docbook5xml-simple.xml'),) ex_asciidoc = Namespace( - doctype=tldp.doctypes.asciidoc.Asciidoc, - filename=opj(sampledocs, 'asciidoc-complete.txt'), - ) -# -# ex_rst = Namespace( -# doctype=tldp.doctypes.rst.RestructuredText, -# filename=opj(sampledocs, 'restructuredtext-simple.rst'), -# ) -# -# ex_markdown = Namespace( -# doctype=tldp.doctypes.markdown.Markdown, -# filename=opj(sampledocs, 'markdown-simple.md'), -# ) + doctype=tldp.doctypes.asciidoc.Asciidoc, + filename=opj(sampledocs, 'asciidoc-complete.txt'),) ex_linuxdoc_dir = Namespace( - doctype=tldp.doctypes.linuxdoc.Linuxdoc, - filename=opj(sampledocs, 'Linuxdoc-Larger', - 'Linuxdoc-Larger.sgml'), - ) + doctype=tldp.doctypes.linuxdoc.Linuxdoc, + filename=opj(sampledocs, 'Linuxdoc-Larger', + 'Linuxdoc-Larger.sgml'),) ex_docbook4xml_dir = Namespace( - doctype=tldp.doctypes.docbook4xml.Docbook4XML, - filename=opj(sampledocs, 'DocBook-4.2-WHYNOT', - 'DocBook-4.2-WHYNOT.xml'), - ) + doctype=tldp.doctypes.docbook4xml.Docbook4XML, + filename=opj(sampledocs, 'DocBook-4.2-WHYNOT', + 'DocBook-4.2-WHYNOT.xml'),) ex_docbooksgml_dir = Namespace( - doctype=tldp.doctypes.docbooksgml.DocbookSGML, - filename=opj(sampledocs, 'DocBookSGML-Larger', - 'DocBookSGML-Larger.sgml'), - ) + doctype=tldp.doctypes.docbooksgml.DocbookSGML, + filename=opj(sampledocs, 'DocBookSGML-Larger', + 'DocBookSGML-Larger.sgml'),) # -- a bit ugly, but grab each dict sources = [y for x, y in locals().items() if x.startswith('ex_')] @@ -81,18 +66,14 @@ sources = [y for x, y in locals().items() if x.startswith('ex_')] for ex in sources: load_content(ex) - unknown_doctype = Namespace( - doctype=None, - filename=opj(sampledocs, 'Unknown-Doctype.xqf'), - ) + doctype=None, + filename=opj(sampledocs, 'Unknown-Doctype.xqf'),) broken_docbook4xml = Namespace( - doctype=tldp.doctypes.docbook4xml.Docbook4XML, - filename=opj(sampledocs, 'docbook4xml-broken.xml'), - ) + doctype=tldp.doctypes.docbook4xml.Docbook4XML, + filename=opj(sampledocs, 'docbook4xml-broken.xml'),) + load_content(broken_docbook4xml) - - # -- end of file diff --git a/tests/long_driver.py b/tests/long_driver.py index 57ba54a..37a8ccb 100644 --- a/tests/long_driver.py +++ b/tests/long_driver.py @@ -1,3 +1,6 @@ +# -*- coding: utf8 -*- +# +# Copyright (c) 2016 Linux Documentation Project from __future__ import absolute_import, division, print_function diff --git a/tests/long_inventory.py b/tests/long_inventory.py index 0020ca0..a2659d8 100644 --- a/tests/long_inventory.py +++ b/tests/long_inventory.py @@ -1,3 +1,6 @@ +# -*- coding: utf8 -*- +# +# Copyright (c) 2016 Linux Documentation Project from __future__ import absolute_import, division, print_function diff --git a/tests/sample-documents/Bad-Dir-Multiple-Doctypes/Bad-Dir-Multiple-Doctypes.sgml b/tests/sample-documents/Bad-Dir-Multiple-Doctypes/Bad-Dir-Multiple-Doctypes.sgml index 5789d23..a9b7e0f 100644 --- a/tests/sample-documents/Bad-Dir-Multiple-Doctypes/Bad-Dir-Multiple-Doctypes.sgml +++ b/tests/sample-documents/Bad-Dir-Multiple-Doctypes/Bad-Dir-Multiple-Doctypes.sgml @@ -1,7 +1,7 @@
- T + Bad Dir Multiple Doctypes (DocBook SGML 4.1) A B diff --git a/tests/sample-documents/Bad-Dir-Multiple-Doctypes/Bad-Dir-Multiple-Doctypes.xml b/tests/sample-documents/Bad-Dir-Multiple-Doctypes/Bad-Dir-Multiple-Doctypes.xml index 9b87ba2..8a559c6 100644 --- a/tests/sample-documents/Bad-Dir-Multiple-Doctypes/Bad-Dir-Multiple-Doctypes.xml +++ b/tests/sample-documents/Bad-Dir-Multiple-Doctypes/Bad-Dir-Multiple-Doctypes.xml @@ -1,5 +1,5 @@
- Simple article + Bad Dir Multiple Doctypes (DocBook XML 5.0) This is a ridiculously terse article.
diff --git a/tests/sample-documents/Linuxdoc-Larger/Linuxdoc-Larger.sgml b/tests/sample-documents/Linuxdoc-Larger/Linuxdoc-Larger.sgml index 3bdcda4..b1fda29 100644 --- a/tests/sample-documents/Linuxdoc-Larger/Linuxdoc-Larger.sgml +++ b/tests/sample-documents/Linuxdoc-Larger/Linuxdoc-Larger.sgml @@ -1,7 +1,7 @@
-B -<author>A +<title>Linuxdoc Larger Document +<author>Another Author <date>2016-02-11 <abstract> abstract </abstract> <toc> diff --git a/tests/sample-documents/markdown-simple.md b/tests/sample-documents/markdown-simple.md deleted file mode 100644 index a002559..0000000 --- a/tests/sample-documents/markdown-simple.md +++ /dev/null @@ -1 +0,0 @@ -No content. diff --git a/tests/sample-documents/restructuredtext-simple.rst b/tests/sample-documents/restructuredtext-simple.rst deleted file mode 100644 index a002559..0000000 --- a/tests/sample-documents/restructuredtext-simple.rst +++ /dev/null @@ -1 +0,0 @@ -No content. diff --git a/tests/test_cascadingconfig.py b/tests/test_cascadingconfig.py index 80c3911..dc44a94 100644 --- a/tests/test_cascadingconfig.py +++ b/tests/test_cascadingconfig.py @@ -1,3 +1,6 @@ +# -*- coding: utf8 -*- +# +# Copyright (c) 2016 Linux Documentation Project from __future__ import absolute_import, division, print_function from __future__ import unicode_literals @@ -80,14 +83,13 @@ class CascadingConfigBasicTest(CCTestTools): ap.add_argument('--size', default=9, type=int) c = Namespace( - tag='tag', - argparser=ap, - argv=''.split(), - env=dict(), - cfg='', - exp_config=Namespace(size=9), - exp_args=[], - ) + tag='tag', + argparser=ap, + argv=''.split(), + env=dict(), + cfg='', + exp_config=Namespace(size=9), + exp_args=[],) cc = CascadingConfig(c.tag, c.argparser, argv=c.argv, env=c.env) config, args = cc.parse() @@ -99,14 +101,13 @@ class CascadingConfigBasicTest(CCTestTools): ap.add_argument('--size', default=9, type=int) c = Namespace( - tag='tag', - argparser=ap, - argv=''.split(), - env=dict(), - cfg='[tag]\nsize = 8', - exp_config=Namespace(size=8), - exp_args=[], - ) + tag='tag', + argparser=ap, + argv=''.split(), + env=dict(), + cfg='[tag]\nsize = 8', + exp_config=Namespace(size=8), + exp_args=[],) self.writeconfig(c) c.env.setdefault('TAG_CONFIGFILE', c.configfile) @@ -122,14 +123,13 @@ class CascadingConfigBasicTest(CCTestTools): import logging logging.getLogger().setLevel(logging.DEBUG) c = Namespace( - tag='tag', - argparser=ap, - argv=''.split(), - env=dict(), - cfg='[tag]\nsize = 8', - exp_config=Namespace(size=8), - exp_args=[], - ) + tag='tag', + argparser=ap, + argv=''.split(), + env=dict(), + cfg='[tag]\nsize = 8', + exp_config=Namespace(size=8), + exp_args=[],) self.writeconfig(c) c.argv.extend(['--configfile', c.configfile]) cc = CascadingConfig(c.tag, c.argparser, argv=c.argv, env=c.env) @@ -144,14 +144,13 @@ class CascadingConfigBasicTest(CCTestTools): import logging logging.getLogger().setLevel(logging.DEBUG) c = Namespace( - tag='tag', - argparser=ap, - argv=''.split(), - env=dict(TAG_SIZE=7, ), - cfg='[tag]\nsize = 8', - exp_config=Namespace(size=7), - exp_args=[], - ) + tag='tag', + argparser=ap, + argv=''.split(), + env=dict(TAG_SIZE=7, ), + cfg='[tag]\nsize = 8', + exp_config=Namespace(size=7), + exp_args=[],) self.writeconfig(c) c.argv.extend(['--configfile', c.configfile]) cc = CascadingConfig(c.tag, c.argparser, argv=c.argv, env=c.env) @@ -166,14 +165,13 @@ class CascadingConfigBasicTest(CCTestTools): import logging logging.getLogger().setLevel(logging.DEBUG) c = Namespace( - tag='tag', - argparser=ap, - argv='--size 6'.split(), - env=dict(TAG_SIZE=7, ), - cfg='[tag]\nsize = 8', - exp_config=Namespace(size=6), - exp_args=[], - ) + tag='tag', + argparser=ap, + argv='--size 6'.split(), + env=dict(TAG_SIZE=7, ), + cfg='[tag]\nsize = 8', + exp_config=Namespace(size=6), + exp_args=[],) self.writeconfig(c) c.argv.extend(['--configfile', c.configfile]) cc = CascadingConfig(c.tag, c.argparser, argv=c.argv, env=c.env) @@ -185,14 +183,13 @@ class CascadingConfigBasicTest(CCTestTools): ap.add_argument('--source', default='', action='append', type=str) c = Namespace( - tag='tag', - argparser=ap, - argv=''.split(), - env=dict(), - cfg='', - exp_config=Namespace(source=''), - exp_args=[], - ) + tag='tag', + argparser=ap, + argv=''.split(), + env=dict(), + cfg='', + exp_config=Namespace(source=''), + exp_args=[],) cc = CascadingConfig(c.tag, c.argparser, argv=c.argv, env=c.env) config, args = cc.parse() self.assertEqual(c.exp_config, config) @@ -203,14 +200,13 @@ class CascadingConfigBasicTest(CCTestTools): ap.add_argument('--source', default='', action='append', type=str) c = Namespace( - tag='tag', - argparser=ap, - argv='--source /some/path'.split(), - env=dict(), - cfg='', - exp_config=Namespace(source=['/some/path']), - exp_args=[], - ) + tag='tag', + argparser=ap, + argv='--source /some/path'.split(), + env=dict(), + cfg='', + exp_config=Namespace(source=['/some/path']), + exp_args=[],) cc = CascadingConfig(c.tag, c.argparser, argv=c.argv, env=c.env) config, args = cc.parse() self.assertEqual(c.exp_config, config) diff --git a/tests/test_config.py b/tests/test_config.py index bd92092..cf0bbb4 100644 --- a/tests/test_config.py +++ b/tests/test_config.py @@ -1,3 +1,6 @@ +# -*- coding: utf8 -*- +# +# Copyright (c) 2016 Linux Documentation Project from __future__ import absolute_import, division, print_function from __future__ import unicode_literals diff --git a/tests/test_driver.py b/tests/test_driver.py index e760ee9..e047646 100644 --- a/tests/test_driver.py +++ b/tests/test_driver.py @@ -1,3 +1,6 @@ +# -*- coding: utf8 -*- +# +# Copyright (c) 2016 Linux Documentation Project from __future__ import absolute_import, division, print_function from __future__ import unicode_literals diff --git a/tests/test_inventory.py b/tests/test_inventory.py index 2d911e5..5c03ad9 100644 --- a/tests/test_inventory.py +++ b/tests/test_inventory.py @@ -1,3 +1,6 @@ +# -*- coding: utf8 -*- +# +# Copyright (c) 2016 Linux Documentation Project from __future__ import absolute_import, division, print_function from __future__ import unicode_literals diff --git a/tests/test_outputs.py b/tests/test_outputs.py index 2332bb5..7e28c0c 100644 --- a/tests/test_outputs.py +++ b/tests/test_outputs.py @@ -1,3 +1,6 @@ +# -*- coding: utf8 -*- +# +# Copyright (c) 2016 Linux Documentation Project from __future__ import absolute_import, division, print_function from __future__ import unicode_literals @@ -38,7 +41,7 @@ class TestOutputCollection(TestToolsFilesystem): def test_file_in_output_collection(self): reldir, absdir = self.adddir('collection') - self.addfile('collection', __file__, stem='non-directory') + self.addfile('collection', __file__, stem='non-directory') oc = OutputCollection(absdir) self.assertEqual(0, len(oc)) diff --git a/tests/test_sources.py b/tests/test_sources.py index c8d0286..1db3dbb 100644 --- a/tests/test_sources.py +++ b/tests/test_sources.py @@ -1,3 +1,6 @@ +# -*- coding: utf8 -*- +# +# Copyright (c) 2016 Linux Documentation Project from __future__ import absolute_import, division, print_function from __future__ import unicode_literals diff --git a/tests/test_typeguesser.py b/tests/test_typeguesser.py index 2a7de80..5b9eaa0 100644 --- a/tests/test_typeguesser.py +++ b/tests/test_typeguesser.py @@ -1,3 +1,6 @@ +# -*- coding: utf8 -*- +# +# Copyright (c) 2016 Linux Documentation Project from __future__ import absolute_import, division, print_function from __future__ import unicode_literals diff --git a/tests/test_utils.py b/tests/test_utils.py index bf88c24..d5b0236 100644 --- a/tests/test_utils.py +++ b/tests/test_utils.py @@ -1,3 +1,6 @@ +# -*- coding: utf8 -*- +# +# Copyright (c) 2016 Linux Documentation Project from __future__ import absolute_import, division, print_function from __future__ import unicode_literals @@ -61,6 +64,7 @@ class Test_arg_isstr(unittest.TestCase): self.assertEqual('s', arg_isstr('s')) self.assertEqual(None, arg_isstr(7)) + class Test_arg_isloglevel(unittest.TestCase): def test_arg_isloglevel_integer(self): diff --git a/tests/tldptesttools.py b/tests/tldptesttools.py index 81ff993..fe738c8 100644 --- a/tests/tldptesttools.py +++ b/tests/tldptesttools.py @@ -1,9 +1,11 @@ +# -*- coding: utf8 -*- +# +# Copyright (c) 2016 Linux Documentation Project from __future__ import absolute_import, division, print_function from __future__ import unicode_literals import os -import time import codecs import random import shutil @@ -102,7 +104,7 @@ class CCTestTools(unittest.TestCase): tf = ntf(prefix=case.tag, suffix='.cfg', dir=self.tempdir, delete=False) tf.close() with codecs.open(tf.name, 'w', encoding='utf-8') as f: - f.write(case.cfg) + f.write(case.cfg) case.configfile = tf.name diff --git a/tldp/__init__.py b/tldp/__init__.py index 84627d7..3b16759 100644 --- a/tldp/__init__.py +++ b/tldp/__init__.py @@ -1,4 +1,6 @@ # -*- coding: utf8 -*- +# +# Copyright (c) 2016 Linux Documentation Project from __future__ import absolute_import @@ -7,4 +9,4 @@ import tldp.outputs import tldp.sources import tldp.inventory -VERSION="0.7.10" +VERSION = "0.7.12" diff --git a/tldp/cascadingconfig.py b/tldp/cascadingconfig.py index 2bcd4fa..034b4d5 100644 --- a/tldp/cascadingconfig.py +++ b/tldp/cascadingconfig.py @@ -1,5 +1,7 @@ #! /usr/bin/python # -*- coding: utf8 -*- +# +# Copyright (c) 2016 Linux Documentation Project from __future__ import absolute_import, division, print_function from __future__ import unicode_literals diff --git a/tldp/config.py b/tldp/config.py index 9b6bde8..2428de9 100644 --- a/tldp/config.py +++ b/tldp/config.py @@ -1,5 +1,7 @@ #! /usr/bin/python # -*- coding: utf8 -*- +# +# Copyright (c) 2016 Linux Documentation Project from __future__ import absolute_import, division, print_function from __future__ import unicode_literals diff --git a/tldp/doctypes/__init__.py b/tldp/doctypes/__init__.py index 5a41441..3e458b5 100644 --- a/tldp/doctypes/__init__.py +++ b/tldp/doctypes/__init__.py @@ -1,7 +1,11 @@ -# from .rst import RestructuredText -# from .markdown import Markdown -from .asciidoc import Asciidoc -from .linuxdoc import Linuxdoc -from .docbooksgml import DocbookSGML -from .docbook4xml import Docbook4XML -from .docbook5xml import Docbook5XML +# -*- coding: utf8 -*- +# +# Copyright (c) 2016 Linux Documentation Project + +from __future__ import absolute_import + +from tldp.doctypes.asciidoc import Asciidoc +from tldp.doctypes.linuxdoc import Linuxdoc +from tldp.doctypes.docbooksgml import DocbookSGML +from tldp.doctypes.docbook4xml import Docbook4XML +from tldp.doctypes.docbook5xml import Docbook5XML diff --git a/tldp/doctypes/asciidoc.py b/tldp/doctypes/asciidoc.py index 4846174..6e1af4f 100644 --- a/tldp/doctypes/asciidoc.py +++ b/tldp/doctypes/asciidoc.py @@ -1,5 +1,7 @@ #! /usr/bin/python # -*- coding: utf8 -*- +# +# Copyright (c) 2016 Linux Documentation Project from __future__ import absolute_import, division, print_function from __future__ import unicode_literals diff --git a/tldp/doctypes/common.py b/tldp/doctypes/common.py index 7262637..bdc477a 100644 --- a/tldp/doctypes/common.py +++ b/tldp/doctypes/common.py @@ -1,5 +1,7 @@ #! /usr/bin/python # -*- coding: utf8 -*- +# +# Copyright (c) 2016 Linux Documentation Project from __future__ import absolute_import, division, print_function from __future__ import unicode_literals diff --git a/tldp/doctypes/docbook4xml.py b/tldp/doctypes/docbook4xml.py index 41914d6..69f0609 100644 --- a/tldp/doctypes/docbook4xml.py +++ b/tldp/doctypes/docbook4xml.py @@ -1,5 +1,7 @@ #! /usr/bin/python # -*- coding: utf8 -*- +# +# Copyright (c) 2016 Linux Documentation Project from __future__ import absolute_import, division, print_function from __future__ import unicode_literals diff --git a/tldp/doctypes/docbook5xml.py b/tldp/doctypes/docbook5xml.py index 2705107..2b7130e 100644 --- a/tldp/doctypes/docbook5xml.py +++ b/tldp/doctypes/docbook5xml.py @@ -1,5 +1,7 @@ #! /usr/bin/python # -*- coding: utf8 -*- +# +# Copyright (c) 2016 Linux Documentation Project from __future__ import absolute_import, division, print_function from __future__ import unicode_literals diff --git a/tldp/doctypes/docbooksgml.py b/tldp/doctypes/docbooksgml.py index 1ef1c53..e706d51 100644 --- a/tldp/doctypes/docbooksgml.py +++ b/tldp/doctypes/docbooksgml.py @@ -1,5 +1,7 @@ #! /usr/bin/python # -*- coding: utf8 -*- +# +# Copyright (c) 2016 Linux Documentation Project from __future__ import absolute_import, division, print_function from __future__ import unicode_literals diff --git a/tldp/doctypes/example.py b/tldp/doctypes/example.py index 7726a13..e3cf153 100644 --- a/tldp/doctypes/example.py +++ b/tldp/doctypes/example.py @@ -1,5 +1,7 @@ #! /usr/bin/python # -*- coding: utf8 -*- +# +# Copyright (c) 2016 Linux Documentation Project from __future__ import absolute_import, division, print_function from __future__ import unicode_literals diff --git a/tldp/doctypes/linuxdoc.py b/tldp/doctypes/linuxdoc.py index 4f5c833..72bdf7c 100644 --- a/tldp/doctypes/linuxdoc.py +++ b/tldp/doctypes/linuxdoc.py @@ -1,5 +1,7 @@ #! /usr/bin/python # -*- coding: utf8 -*- +# +# Copyright (c) 2016 Linux Documentation Project from __future__ import absolute_import, division, print_function from __future__ import unicode_literals diff --git a/tldp/doctypes/markdown.py b/tldp/doctypes/markdown.py index d9bf839..730e9b5 100644 --- a/tldp/doctypes/markdown.py +++ b/tldp/doctypes/markdown.py @@ -1,5 +1,7 @@ #! /usr/bin/python # -*- coding: utf8 -*- +# +# Copyright (c) 2016 Linux Documentation Project from __future__ import absolute_import, division, print_function from __future__ import unicode_literals diff --git a/tldp/doctypes/rst.py b/tldp/doctypes/rst.py index f844144..d11ae41 100644 --- a/tldp/doctypes/rst.py +++ b/tldp/doctypes/rst.py @@ -1,5 +1,7 @@ #! /usr/bin/python # -*- coding: utf8 -*- +# +# Copyright (c) 2016 Linux Documentation Project from __future__ import absolute_import, division, print_function from __future__ import unicode_literals diff --git a/tldp/driver.py b/tldp/driver.py index f81ce8d..f60d25e 100644 --- a/tldp/driver.py +++ b/tldp/driver.py @@ -1,5 +1,7 @@ #! /usr/bin/python # -*- coding: utf8 -*- +# +# Copyright (c) 2016 Linux Documentation Project from __future__ import absolute_import, division, print_function from __future__ import unicode_literals @@ -31,7 +33,7 @@ signal.signal(signal.SIGPIPE, signal.SIG_DFL) signal.signal(signal.SIGINT, signal.SIG_DFL) logformat = '%(levelname)-9s %(name)s %(filename)s#%(lineno)s ' \ - + '%(funcName)s %(message)s' + + '%(funcName)s %(message)s' logging.basicConfig(stream=sys.stderr, format=logformat, level=logging.ERROR) logger = logging.getLogger(__name__) @@ -109,7 +111,7 @@ def summary(config, *args, **kwargs): width.doctype = max([len(x.__name__) for x in knowndoctypes]) width.status = max([len(x) for x in status_types]) width.count = len(str(len(inv.source.keys()))) - print('By Document Status (STATUS)', '---------------------------', + print('By Document Status (STATUS)', '---------------------------', sep='\n', file=file) for status in status_types: count = len(getattr(inv, status, 0)) @@ -129,7 +131,7 @@ def summary(config, *args, **kwargs): if abbrev: s = s + ', and %d more ...' % (len(abbrev)) print(s, file=file) - print('', 'By Document Type (DOCTYPE)', '--------------------------', + print('', 'By Document Type (DOCTYPE)', '--------------------------', sep='\n', file=file) summarybytype = collections.defaultdict(list) for doc in inv.source.values(): @@ -274,7 +276,7 @@ def docbuild(config, docs, **kwargs): for x, source in enumerate(docs, 1): working = source.working runner = source.doctype(source=source, output=working, config=config) - status = 'progress, %d failures, %d successes' + status = 'progress, %d failures, %d successes' status = status % (result.count(False), result.count(True),) logger.info("%s (%d of %d) initiating build [%s]", source.stem, x, len(docs), status) diff --git a/tldp/inventory.py b/tldp/inventory.py index 1d15b98..96ed8bb 100644 --- a/tldp/inventory.py +++ b/tldp/inventory.py @@ -1,5 +1,7 @@ #! /usr/bin/python # -*- coding: utf8 -*- +# +# Copyright (c) 2016 Linux Documentation Project from __future__ import absolute_import, division, print_function from __future__ import unicode_literals @@ -71,8 +73,7 @@ class Inventory(object): len(self.orphan), len(self.new), len(self.stale), - len(self.broken), - ) + len(self.broken),) def __init__(self, pubdir, sourcedirs): '''construct an Inventory diff --git a/tldp/ldpcollection.py b/tldp/ldpcollection.py index d47facc..74127f3 100644 --- a/tldp/ldpcollection.py +++ b/tldp/ldpcollection.py @@ -1,5 +1,7 @@ #! /usr/bin/python # -*- coding: utf8 -*- +# +# Copyright (c) 2016 Linux Documentation Project from __future__ import absolute_import, division, print_function diff --git a/tldp/outputs.py b/tldp/outputs.py index 39fd321..37a90c6 100644 --- a/tldp/outputs.py +++ b/tldp/outputs.py @@ -1,5 +1,7 @@ #! /usr/bin/python # -*- coding: utf8 -*- +# +# Copyright (c) 2016 Linux Documentation Project from __future__ import absolute_import, division, print_function from __future__ import unicode_literals @@ -11,7 +13,7 @@ import codecs import logging from tldp.ldpcollection import LDPDocumentCollection -from tldp.utils import logdir, statfiles +from tldp.utils import logdir logger = logging.getLogger(__name__) diff --git a/tldp/sources.py b/tldp/sources.py index 5cf27b3..90846d0 100644 --- a/tldp/sources.py +++ b/tldp/sources.py @@ -1,5 +1,7 @@ #! /usr/bin/python # -*- coding: utf8 -*- +# +# Copyright (c) 2016 Linux Documentation Project from __future__ import absolute_import, division, print_function from __future__ import unicode_literals diff --git a/tldp/typeguesser.py b/tldp/typeguesser.py index e4bd800..99d09ad 100644 --- a/tldp/typeguesser.py +++ b/tldp/typeguesser.py @@ -1,5 +1,7 @@ #! /usr/bin/python # -*- coding: utf8 -*- +# +# Copyright (c) 2016 Linux Documentation Project from __future__ import absolute_import, division, print_function diff --git a/tldp/utils.py b/tldp/utils.py index 6340a05..3682ab9 100644 --- a/tldp/utils.py +++ b/tldp/utils.py @@ -1,5 +1,7 @@ #! /usr/bin/python # -*- coding: utf8 -*- +# +# Copyright (c) 2016 Linux Documentation Project from __future__ import absolute_import, division, print_function from __future__ import unicode_literals @@ -9,7 +11,6 @@ import time import errno import codecs import hashlib -import operator import subprocess import functools from functools import wraps @@ -285,6 +286,7 @@ def md5files(name, relative=None): '''get all of the MD5s for files from here downtree''' return fileinfo(name, relative=relative, func=md5file) + def statfiles(name, relative=None): ''' >>> statfiles('./docs/x509').keys() @@ -296,6 +298,7 @@ def statfiles(name, relative=None): ''' return fileinfo(name, relative=relative, func=statfile) + def fileinfo(name, relative=None, func=statfile): '''return a dict() with keys being filenames and posix.stat_result values