diff options
author | Georg Brandl <georg@python.org> | 2009-01-10 21:23:39 +0100 |
---|---|---|
committer | Georg Brandl <georg@python.org> | 2009-01-10 21:23:39 +0100 |
commit | b068e9180365a5d74d4fb02b003d7a05f99ffac3 (patch) | |
tree | c092aa25daf519398c0d6cc84f85a568cf26440e /sphinx/directives/other.py | |
parent | d0e0acaaa1278627d70f7bbb7d823c79d3546b58 (diff) | |
download | sphinx-git-b068e9180365a5d74d4fb02b003d7a05f99ffac3.tar.gz |
Reformat to EOL80.
Diffstat (limited to 'sphinx/directives/other.py')
-rw-r--r-- | sphinx/directives/other.py | 36 |
1 files changed, 20 insertions, 16 deletions
diff --git a/sphinx/directives/other.py b/sphinx/directives/other.py index cbf548bec..18e18fd92 100644 --- a/sphinx/directives/other.py +++ b/sphinx/directives/other.py @@ -18,7 +18,7 @@ from sphinx.util import patfilter, ws_re, caption_ref_re, docname_join from sphinx.util.compat import make_admonition -# ------ the TOC tree --------------------------------------------------------------- +# ------ the TOC tree ---------------------------------------------------------- def toctree_directive(name, arguments, options, content, lineno, content_offset, block_text, state, state_machine): @@ -50,7 +50,8 @@ def toctree_directive(name, arguments, options, content, lineno, docname = docname_join(env.docname, docname) if docname not in env.found_docs: ret.append(state.document.reporter.warning( - 'toctree references unknown document %r' % docname, line=lineno)) + 'toctree references unknown document %r' % docname, + line=lineno)) else: includefiles.append(docname) else: @@ -61,8 +62,8 @@ def toctree_directive(name, arguments, options, content, lineno, includefiles.append(docname) if not docnames: ret.append(state.document.reporter.warning( - 'toctree glob pattern %r didn\'t match any documents' % entry, - line=lineno)) + 'toctree glob pattern %r didn\'t match any documents' + % entry, line=lineno)) subnode = addnodes.toctree() subnode['includefiles'] = includefiles subnode['includetitles'] = includetitles @@ -78,7 +79,7 @@ toctree_directive.options = {'maxdepth': int, 'glob': directives.flag, directives.register_directive('toctree', toctree_directive) -# ------ section metadata ---------------------------------------------------------- +# ------ section metadata ------------------------------------------------------ def module_directive(name, arguments, options, content, lineno, content_offset, block_text, state, state_machine): @@ -101,7 +102,8 @@ def module_directive(name, arguments, options, content, lineno, node += nodes.emphasis('', _('Platforms: ')) node += nodes.Text(options['platform'], options['platform']) ret.append(node) - # the synopsis isn't printed; in fact, it is only used in the modindex currently + # the synopsis isn't printed; in fact, it is only used in the + # modindex currently if not noindex: indextext = _('%s (module)') % modname inode = addnodes.index(entries=[('single', indextext, @@ -172,7 +174,7 @@ program_directive.arguments = (1, 0, 1) directives.register_directive('program', program_directive) -# ------ index markup -------------------------------------------------------------- +# ------ index markup ---------------------------------------------------------- indextypes = [ 'single', 'pair', 'triple', @@ -214,7 +216,7 @@ def index_directive(name, arguments, options, content, lineno, index_directive.arguments = (1, 0, 1) directives.register_directive('index', index_directive) -# ------ versionadded/versionchanged ----------------------------------------------- +# ------ versionadded/versionchanged ------------------------------------------- def version_directive(name, arguments, options, content, lineno, content_offset, block_text, state, state_machine): @@ -241,7 +243,7 @@ directives.register_directive('versionadded', version_directive) directives.register_directive('versionchanged', version_directive) -# ------ see also ------------------------------------------------------------------ +# ------ see also -------------------------------------------------------------- def seealso_directive(name, arguments, options, content, lineno, content_offset, block_text, state, state_machine): @@ -261,7 +263,7 @@ seealso_directive.arguments = (0, 1, 1) directives.register_directive('seealso', seealso_directive) -# ------ production list (for the reference) --------------------------------------- +# ------ production list (for the reference) ----------------------------------- token_re = re.compile('`([a-z_]+)`') @@ -317,7 +319,7 @@ productionlist_directive.arguments = (1, 0, 1) directives.register_directive('productionlist', productionlist_directive) -# ------ glossary directive --------------------------------------------------------- +# ------ glossary directive ---------------------------------------------------- def glossary_directive(name, arguments, options, content, lineno, content_offset, block_text, state, state_machine): @@ -354,7 +356,7 @@ glossary_directive.arguments = (0, 0, 0) directives.register_directive('glossary', glossary_directive) -# ------ miscellaneous markup ------------------------------------------------------- +# ------ miscellaneous markup -------------------------------------------------- def centered_directive(name, arguments, options, content, lineno, content_offset, block_text, state, state_machine): @@ -373,7 +375,8 @@ def acks_directive(name, arguments, options, content, lineno, content_offset, block_text, state, state_machine): node = addnodes.acks() state.nested_parse(content, content_offset, node) - if len(node.children) != 1 or not isinstance(node.children[0], nodes.bullet_list): + if len(node.children) != 1 or not isinstance(node.children[0], + nodes.bullet_list): return [state.document.reporter.warning('.. acks content is not a list', line=lineno)] return [node] @@ -388,9 +391,10 @@ def hlist_directive(name, arguments, options, content, lineno, ncolumns = options.get('columns', 2) node = nodes.paragraph() state.nested_parse(content, content_offset, node) - if len(node.children) != 1 or not isinstance(node.children[0], nodes.bullet_list): - return [state.document.reporter.warning('.. hlist content is not a list', - line=lineno)] + if len(node.children) != 1 or not isinstance(node.children[0], + nodes.bullet_list): + return [state.document.reporter.warning( + '.. hlist content is not a list', line=lineno)] fulllist = node.children[0] # create a hlist node where the items are distributed npercol, nmore = divmod(len(fulllist), ncolumns) |