summaryrefslogtreecommitdiff
path: root/sphinx
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
commit9e16a98b5b8542935b312b1732a416a214de2ece (patch)
tree9d3c4309165d753ddc2f1dfdc00c47f2717e515e /sphinx
parent32755834c34b03e35b900b091822012b62ebfbf6 (diff)
downloadsphinx-9e16a98b5b8542935b312b1732a416a214de2ece.tar.gz
Make "make check" happy.
Diffstat (limited to 'sphinx')
-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
6 files changed, 33 insertions, 25 deletions
diff --git a/sphinx/environment.py b/sphinx/environment.py
index c8e7cd28..eb591242 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 a9efb0f1..d07ab465 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 d835391e..8424d12c 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 d3cf18c5..a25c0466 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 5f9462be..20854af3 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 9deb184b..841a5ba1 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.