From 501c2d13e66842a57d1ca4a8ccb3dc2b8bba79d1 Mon Sep 17 00:00:00 2001 From: Georg Brandl Date: Sun, 2 Mar 2014 08:40:48 +0100 Subject: [PATCH] Fix long lines. --- doc/extdev/markupapi.rst | 4 ++-- doc/intl.rst | 2 +- sphinx/builders/gettext.py | 3 ++- sphinx/make_mode.py | 21 ++++++++++++++------- sphinx/util/nodes.py | 3 ++- utils/check_sources.py | 2 +- 6 files changed, 22 insertions(+), 13 deletions(-) diff --git a/doc/extdev/markupapi.rst b/doc/extdev/markupapi.rst index 3c09687eb..577a39e0d 100644 --- a/doc/extdev/markupapi.rst +++ b/doc/extdev/markupapi.rst @@ -55,7 +55,7 @@ using :meth:`.Sphinx.add_directive` or :meth:`.Sphinx.add_directive_to_domain`. .. attribute:: arguments The arguments given to the directive, as a list. - + .. attribute:: options The options given to the directive, as a dictionary mapping option names @@ -82,7 +82,7 @@ using :meth:`.Sphinx.add_directive` or :meth:`.Sphinx.add_directive_to_domain`. Internal offset of the directive content. Used when calling ``nested_parse`` (see below). - + .. attribute:: block_text The string containing the entire directive. diff --git a/doc/intl.rst b/doc/intl.rst index 6f74deb0e..3363dc50f 100644 --- a/doc/intl.rst +++ b/doc/intl.rst @@ -294,5 +294,5 @@ There is `sphinx translation page`_ for Sphinx-1.2 documentation. .. _`transifex-client`: https://pypi.python.org/pypi/transifex-client .. _`sphinx-intl`: https://pypi.python.org/pypi/sphinx-intl .. _Transifex: https://www.transifex.com/ -.. _`sphinx translation page`: https://www.transifex.com/projects/p/sphinx-doc-1_2_0/ +.. _`sphinx translation page`: https://www.transifex.com/projects/p/sphinx-doc-1_2_0/ .. _`Transifex Client v0.8 — Transifex documentation`: http://help.transifex.com/features/client/index.html diff --git a/sphinx/builders/gettext.py b/sphinx/builders/gettext.py index bf43f9b4a..250bef8cf 100644 --- a/sphinx/builders/gettext.py +++ b/sphinx/builders/gettext.py @@ -56,7 +56,8 @@ class Catalog(object): def add(self, msg, origin): if not hasattr(origin, 'uid'): - # Nodes that are replicated like todo don't have a uid, however i18n is also unnecessary. + # Nodes that are replicated like todo don't have a uid, + # however i18n is also unnecessary. return if msg not in self.metadata: # faster lookup in hash self.messages.append(msg) diff --git a/sphinx/make_mode.py b/sphinx/make_mode.py index 0ab3f3aa5..bdd9f79b6 100644 --- a/sphinx/make_mode.py +++ b/sphinx/make_mode.py @@ -49,7 +49,8 @@ BUILDERS = [ ("", "xml", "to make Docutils-native XML files"), ("", "pseudoxml", "to make pseudoxml-XML files for display purposes"), ("", "linkcheck", "to check all external links for integrity"), - ("", "doctest", "to run all doctests embedded in the documentation (if enabled)"), + ("", "doctest", "to run all doctests embedded in the documentation " + "(if enabled)"), ("", "coverage", "to run coverage check of the documentation (if enabled)"), ] @@ -97,7 +98,8 @@ class Make(object): if self.run_generic_build('singlehtml') > 0: return 1 print - print 'Build finished. The HTML page is in %s.' % self.builddir_join('singlehtml') + print 'Build finished. The HTML page is in %s.' % \ + self.builddir_join('singlehtml') def build_pickle(self): if self.run_generic_build('pickle') > 0: @@ -126,7 +128,8 @@ class Make(object): '.qhcp project file in %s, like this:') % self.builddir_join('qthelp') print '$ qcollectiongenerator %s.qhcp' % self.builddir_join('qthelp', proj_name) print 'To view the help file:' - print '$ assistant -collectionFile %s.qhc' % self.builddir_join('qthelp', proj_name) + print '$ assistant -collectionFile %s.qhc' % \ + self.builddir_join('qthelp', proj_name) def build_devhelp(self): if self.run_generic_build('devhelp') > 0: @@ -172,7 +175,8 @@ class Make(object): def build_texinfo(self): if self.run_generic_build('texinfo') > 0: return 1 - print "Build finished; the Texinfo files are in %s." % self.builddir_join('texinfo') + print "Build finished; the Texinfo files are in %s." % \ + self.builddir_join('texinfo') if os.name == 'posix': print "Run `make' in that directory to run these through makeinfo" print "(use `make info' here to do that automatically)." @@ -187,13 +191,15 @@ class Make(object): if self.run_generic_build('gettext', doctreedir=dtdir) > 0: return 1 print - print 'Build finished. The message catalogs are in %s.' % self.builddir_join('gettext') + print 'Build finished. The message catalogs are in %s.' % \ + self.builddir_join('gettext') def build_changes(self): if self.run_generic_build('changes') > 0: return 1 print - print 'Build finished. The overview file is in %s.' % self.builddir_join('changes') + print 'Build finished. The overview file is in %s.' % \ + self.builddir_join('changes') def build_linkcheck(self): res = self.run_generic_build('linkcheck') @@ -226,7 +232,8 @@ class Make(object): if self.run_generic_build('pseudoxml') > 0: return 1 print - print 'Build finished. The pseudo-XML files are in %s.' % self.builddir_join('pseudoxml') + print 'Build finished. The pseudo-XML files are in %s.' % \ + self.builddir_join('pseudoxml') def run_generic_build(self, builder, doctreedir=None): # compatibility with old Makefile diff --git a/sphinx/util/nodes.py b/sphinx/util/nodes.py index 1be70da45..1a923d116 100644 --- a/sphinx/util/nodes.py +++ b/sphinx/util/nodes.py @@ -58,7 +58,8 @@ def extract_messages(doctree): # this issue was filed to Docutils tracker: # sf.net/tracker/?func=detail&aid=3599485&group_id=38414&atid=422032 # sourceforge.net/p/docutils/patches/108/ - if isinstance(node, (nodes.caption, nodes.title, nodes.rubric)) and not node.source: + if isinstance(node, (nodes.caption, nodes.title, nodes.rubric)) \ + and not node.source: node.source = find_source_node(node) node.line = 0 #need fix docutils to get `node.line` diff --git a/utils/check_sources.py b/utils/check_sources.py index 52f23e1f4..7bbd0a79b 100755 --- a/utils/check_sources.py +++ b/utils/check_sources.py @@ -62,7 +62,7 @@ if sys.version_info < (3, 0): def check_style_and_encoding(fn, lines): encoding = 'ascii' for lno, line in enumerate(lines): - if len(line) > 81: + if len(line) > 90: yield lno+1, "line too long" if lno < 2: co = coding_re.search(line)