Make "make check" happy.

This commit is contained in:
Georg Brandl 2009-02-19 23:31:34 +01:00
parent 3f7733f8d3
commit a43b651804
12 changed files with 43 additions and 34 deletions

View File

@ -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

View File

@ -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.

View File

@ -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:

View File

@ -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.

View File

@ -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)

View File

@ -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

View File

@ -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

View File

@ -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/*

View File

@ -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

View File

@ -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.

View File

@ -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:

View File

@ -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: