summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGeorg Brandl <georg@python.org>2009-02-19 23:31:34 +0100
committerGeorg Brandl <georg@python.org>2009-02-19 23:31:34 +0100
commita43b6518049cb9610509291f18e19b902f15bab3 (patch)
tree9d3c4309165d753ddc2f1dfdc00c47f2717e515e
parent3f7733f8d303b10b5a72ea0a52508c63a1eb6034 (diff)
downloadsphinx-git-a43b6518049cb9610509291f18e19b902f15bab3.tar.gz
Make "make check" happy.
-rw-r--r--doc/config.rst4
-rw-r--r--doc/faq.rst2
-rw-r--r--doc/templating.rst2
-rw-r--r--doc/theming.rst2
-rw-r--r--sphinx/environment.py38
-rw-r--r--sphinx/ext/autodoc.py4
-rw-r--r--sphinx/jinja2glue.py3
-rw-r--r--sphinx/quickstart.py5
-rw-r--r--sphinx/util/__init__.py3
-rw-r--r--sphinx/writers/latex.py5
-rw-r--r--tests/test_autodoc.py3
-rwxr-xr-xutils/check_sources.py6
12 files changed, 43 insertions, 34 deletions
diff --git a/doc/config.rst b/doc/config.rst
index cc313d75e..8bb2db6c9 100644
--- a/doc/config.rst
+++ b/doc/config.rst
@@ -160,7 +160,7 @@ General configuration
"""
.. versionadded:: 0.6
-
+
.. confval:: default_role
.. index:: default; role
@@ -302,7 +302,7 @@ Project information
.. versionadded:: 0.6
-
+
.. _html-options:
Options for HTML output
diff --git a/doc/faq.rst b/doc/faq.rst
index 7e5cffd5f..a43e9c728 100644
--- a/doc/faq.rst
+++ b/doc/faq.rst
@@ -17,7 +17,7 @@ How do I...
... write my own extension?
See the :ref:`extension tutorial <exttut>`.
-
+
... use Sphinx with Epydoc?
There's a third-party extension providing an `api role`_ which refers to
Epydoc's API docs for a given identifier.
diff --git a/doc/templating.rst b/doc/templating.rst
index bccdd689c..61657547d 100644
--- a/doc/templating.rst
+++ b/doc/templating.rst
@@ -342,7 +342,7 @@ in the future.
In addition to these values, there are also all **theme options** available
(prefixed by ``theme_``), as well as the values given by the user in
:confval:`html_context`.
-
+
In documents that are created from source files (as opposed to
automatically-generated files like the module index, or documents that already
are in HTML form), these variables are also available:
diff --git a/doc/theming.rst b/doc/theming.rst
index 7c3ae7090..4696df5af 100644
--- a/doc/theming.rst
+++ b/doc/theming.rst
@@ -178,7 +178,7 @@ templating to put the color options into the stylesheet. When a documentation
is built with the default theme, the output directory will contain a
``_static/default.css`` file where all template tags have been processed.
-
+
.. [1] It is not an executable Python file, as opposed to :file:`conf.py`,
because that would pose an unnecessary security risk if themes are
shared.
diff --git a/sphinx/environment.py b/sphinx/environment.py
index c8e7cd283..eb591242d 100644
--- a/sphinx/environment.py
+++ b/sphinx/environment.py
@@ -995,11 +995,10 @@ class BuildEnvironment:
subnode.parent.remove(subnode)
elif isinstance(subnode, nodes.reference):
- # Identify the toc entry pointing to the current document.
- if subnode['refuri'] == docname and not subnode['anchorname']:
+ # identify the toc entry pointing to the current document
+ if subnode['refuri'] == docname and \
+ not subnode['anchorname']:
# tag the whole branch as 'current'
- # (We can't use traverse here as 'ascend' un-intuitively
- # implies 'siblings'.)
p = subnode
while p:
p['classes'].append('current')
@@ -1012,13 +1011,15 @@ class BuildEnvironment:
for (title, ref) in refs:
try:
if url_re.match(ref):
- reference = nodes.reference('', '', refuri=ref, anchorname='',
+ reference = nodes.reference('', '',
+ refuri=ref, anchorname='',
*[nodes.Text(title)])
para = addnodes.compact_paragraph('', '', reference)
item = nodes.list_item('', para)
toc = nodes.bullet_list('', item)
elif ref == 'self':
- # 'self' refers to the document from which this toctree originates.
+ # 'self' refers to the document from which this
+ # toctree originates
ref = toctreenode['parent']
if not title:
title = self.titles[ref].astext()
@@ -1028,13 +1029,15 @@ class BuildEnvironment:
*[nodes.Text(title)])
para = addnodes.compact_paragraph('', '', reference)
item = nodes.list_item('', para)
- # Don't show subitems.
+ # don't show subitems
toc = nodes.bullet_list('', item)
else:
toc = self.tocs[ref].deepcopy()
if title and toc.children and len(toc.children) == 1:
- for refnode in toc.children[0].traverse(nodes.reference):
- if refnode['refuri'] == ref and not refnode['anchorname']:
+ child = toc.children[0]
+ for refnode in child.traverse(nodes.reference):
+ if refnode['refuri'] == ref and \
+ not refnode['anchorname']:
refnode.children = [nodes.Text(title)]
if not toc.children:
# empty toc means: no titles will show up in the toctree
@@ -1090,7 +1093,8 @@ class BuildEnvironment:
# prune the tree to maxdepth and replace titles, also set level classes
_walk_depth(newnode, 1, prune and maxdepth or 0)
- # set the target paths in the toctrees (they are not known at TOC generation time)
+ # set the target paths in the toctrees (they are not known at TOC
+ # generation time)
for refnode in newnode.traverse(nodes.reference):
if not url_re.match(refnode['refuri']):
refnode['refuri'] = builder.get_relative_uri(
@@ -1121,19 +1125,19 @@ class BuildEnvironment:
docname, labelid = self.anonlabels.get(target, ('',''))
sectname = node.astext()
if not docname:
- self.warn(fromdocname, 'undefined label: %s' % target,
- node.line)
+ self.warn(fromdocname, 'undefined label: %s' %
+ target, node.line)
else:
# reference to the named label; the final node will
# contain the section name after the label
docname, labelid, sectname = self.labels.get(target,
('','',''))
if not docname:
- self.warn(fromdocname,
- 'undefined label: %s' % target +
- ' -- if you don\'t give a link caption '
- 'the label must precede a section header.',
- node.line)
+ self.warn(
+ fromdocname,
+ 'undefined label: %s' % target + ' -- if you '
+ 'don\'t give a link caption the label must '
+ 'precede a section header.', node.line)
if docname:
newnode = nodes.reference('', '')
innernode = nodes.emphasis(sectname, sectname)
diff --git a/sphinx/ext/autodoc.py b/sphinx/ext/autodoc.py
index a9efb0f1c..d07ab4657 100644
--- a/sphinx/ext/autodoc.py
+++ b/sphinx/ext/autodoc.py
@@ -982,8 +982,8 @@ class AutoDirective(Directive):
most of the work to one of the Documenters, which it selects through its
*_registry* dictionary.
- The *_special_attrgetters* attribute is used to customize ``getattr()`` calls
- that the Documenters make; its entries are of the form ``type:
+ The *_special_attrgetters* attribute is used to customize ``getattr()``
+ calls that the Documenters make; its entries are of the form ``type:
getattr_function``.
Note: When importing an object, all items along the import chain are
diff --git a/sphinx/jinja2glue.py b/sphinx/jinja2glue.py
index d835391e5..8424d12c1 100644
--- a/sphinx/jinja2glue.py
+++ b/sphinx/jinja2glue.py
@@ -13,7 +13,8 @@ import codecs
from os import path
from pprint import pformat
-from jinja2 import FileSystemLoader, BaseLoader, TemplateNotFound, contextfunction
+from jinja2 import FileSystemLoader, BaseLoader, TemplateNotFound, \
+ contextfunction
from jinja2.sandbox import SandboxedEnvironment
from sphinx.util import mtimes_of_files
diff --git a/sphinx/quickstart.py b/sphinx/quickstart.py
index d3cf18c5f..a25c04661 100644
--- a/sphinx/quickstart.py
+++ b/sphinx/quickstart.py
@@ -38,7 +38,7 @@ QUICKSTART_CONF = '''\
import sys, os
-# If your extensions (or modules documented by autodoc) are in another directory,
+# If extensions (or modules to document with autodoc) are in another directory,
# add these directories to sys.path here. If the directory is relative to the
# documentation root, use os.path.abspath to make it absolute, like shown here.
#sys.path.append(os.path.abspath('.'))
@@ -277,7 +277,8 @@ help:
\t@echo " latex to make LaTeX files, you can set PAPER=a4 or PAPER=letter"
\t@echo " changes to make an overview of all changed/added/deprecated items"
\t@echo " linkcheck to check all external links for integrity"
-\t@echo " doctest to run all doctests embedded in the documentation (if enabled)"
+\t@echo " doctest to run all doctests embedded in the documentation \
+(if enabled)"
clean:
\t-rm -rf %(rbuilddir)s/*
diff --git a/sphinx/util/__init__.py b/sphinx/util/__init__.py
index 5f9462bed..20854af35 100644
--- a/sphinx/util/__init__.py
+++ b/sphinx/util/__init__.py
@@ -407,7 +407,8 @@ def _new_traverse(self, condition=None,
return self._all_traverse()
elif isinstance(condition, (types.ClassType, type)):
return self._fast_traverse(condition)
- return self._old_traverse(condition, include_self, descend, siblings, ascend)
+ return self._old_traverse(condition, include_self,
+ descend, siblings, ascend)
import docutils.nodes
docutils.nodes.Node._old_traverse = docutils.nodes.Node.traverse
diff --git a/sphinx/writers/latex.py b/sphinx/writers/latex.py
index 9deb184b6..841a5ba14 100644
--- a/sphinx/writers/latex.py
+++ b/sphinx/writers/latex.py
@@ -584,8 +584,9 @@ class LaTeXTranslator(nodes.NodeVisitor):
def visit_table(self, node):
if self.table:
- raise UnsupportedError('%s:%s: nested tables are not yet implemented.' %
- (self.curfilestack[-1], node.line or ''))
+ raise UnsupportedError(
+ '%s:%s: nested tables are not yet implemented.' %
+ (self.curfilestack[-1], node.line or ''))
self.table = Table()
self.tablebody = []
# Redirect body output until table is finished.
diff --git a/tests/test_autodoc.py b/tests/test_autodoc.py
index d1da44396..25d833a29 100644
--- a/tests/test_autodoc.py
+++ b/tests/test_autodoc.py
@@ -401,7 +401,8 @@ def test_generate():
options.members = ALL
assert_result_contains('.. class:: Class', 'module', 'test_autodoc')
try:
- assert_result_contains('.. exception:: CustomEx', 'module', 'test_autodoc')
+ assert_result_contains('.. exception:: CustomEx',
+ 'module', 'test_autodoc')
except AssertionError:
pass
else:
diff --git a/utils/check_sources.py b/utils/check_sources.py
index 8a115c71a..361fcfc14 100755
--- a/utils/check_sources.py
+++ b/utils/check_sources.py
@@ -64,9 +64,9 @@ def check_style_and_encoding(fn, lines):
encoding = co.group(1)
if line.strip().startswith('#'):
continue
- m = not_ix_re.search(line)
- if m:
- yield lno+1, '"' + m.group() + '"'
+ #m = not_ix_re.search(line)
+ #if m:
+ # yield lno+1, '"' + m.group() + '"'
if is_const_re.search(line):
yield lno+1, 'using == None/True/False'
try: