summaryrefslogtreecommitdiff
path: root/sphinx
diff options
context:
space:
mode:
Diffstat (limited to 'sphinx')
-rw-r--r--sphinx/__init__.py4
-rw-r--r--sphinx/application.py29
-rw-r--r--sphinx/builder.py28
-rw-r--r--sphinx/builders/__init__.py27
-rw-r--r--sphinx/builders/changes.py9
-rw-r--r--sphinx/builders/devhelp.py132
-rw-r--r--sphinx/builders/epub.py441
-rw-r--r--sphinx/builders/html.py540
-rw-r--r--sphinx/builders/latex.py28
-rw-r--r--sphinx/builders/linkcheck.py2
-rw-r--r--sphinx/builders/text.py2
-rw-r--r--sphinx/config.py29
-rw-r--r--sphinx/directives/code.py14
-rw-r--r--sphinx/directives/other.py12
-rw-r--r--sphinx/environment.py60
-rw-r--r--sphinx/errors.py4
-rw-r--r--sphinx/ext/autodoc.py84
-rw-r--r--sphinx/ext/autosummary/__init__.py338
-rw-r--r--sphinx/ext/autosummary/generate.py406
-rw-r--r--sphinx/ext/autosummary/templates/autosummary/base.rst6
-rw-r--r--sphinx/ext/autosummary/templates/autosummary/class.rst30
-rw-r--r--sphinx/ext/autosummary/templates/autosummary/module.rst37
-rw-r--r--sphinx/ext/autosummary/templates/module39
-rw-r--r--sphinx/ext/extlinks.py59
-rw-r--r--sphinx/ext/graphviz.py92
-rw-r--r--sphinx/ext/ifconfig.py3
-rw-r--r--sphinx/ext/pngmath.py2
-rw-r--r--sphinx/ext/todo.py15
-rw-r--r--sphinx/highlighting.py13
-rw-r--r--sphinx/jinja2glue.py2
-rw-r--r--sphinx/locale/cs/LC_MESSAGES/sphinx.js2
-rw-r--r--sphinx/locale/cs/LC_MESSAGES/sphinx.mobin7816 -> 7926 bytes
-rw-r--r--sphinx/locale/cs/LC_MESSAGES/sphinx.po74
-rw-r--r--sphinx/locale/de/LC_MESSAGES/sphinx.mobin8240 -> 8276 bytes
-rw-r--r--sphinx/locale/de/LC_MESSAGES/sphinx.po78
-rw-r--r--sphinx/locale/es/LC_MESSAGES/sphinx.js2
-rw-r--r--sphinx/locale/es/LC_MESSAGES/sphinx.mobin6809 -> 6919 bytes
-rw-r--r--sphinx/locale/es/LC_MESSAGES/sphinx.po74
-rw-r--r--sphinx/locale/fi/LC_MESSAGES/sphinx.js2
-rw-r--r--sphinx/locale/fi/LC_MESSAGES/sphinx.mobin7537 -> 7599 bytes
-rw-r--r--sphinx/locale/fi/LC_MESSAGES/sphinx.po76
-rw-r--r--sphinx/locale/fr/LC_MESSAGES/sphinx.js2
-rw-r--r--sphinx/locale/fr/LC_MESSAGES/sphinx.mobin7516 -> 7626 bytes
-rw-r--r--sphinx/locale/fr/LC_MESSAGES/sphinx.po74
-rw-r--r--sphinx/locale/it/LC_MESSAGES/sphinx.js2
-rw-r--r--sphinx/locale/it/LC_MESSAGES/sphinx.mobin8136 -> 8243 bytes
-rw-r--r--sphinx/locale/it/LC_MESSAGES/sphinx.po74
-rw-r--r--sphinx/locale/ja/LC_MESSAGES/sphinx.js2
-rw-r--r--sphinx/locale/ja/LC_MESSAGES/sphinx.mobin7537 -> 7647 bytes
-rw-r--r--sphinx/locale/ja/LC_MESSAGES/sphinx.po74
-rw-r--r--sphinx/locale/nl/LC_MESSAGES/sphinx.mobin8159 -> 8159 bytes
-rw-r--r--sphinx/locale/pl/LC_MESSAGES/sphinx.js2
-rw-r--r--sphinx/locale/pl/LC_MESSAGES/sphinx.mobin7174 -> 8291 bytes
-rw-r--r--sphinx/locale/pl/LC_MESSAGES/sphinx.po174
-rw-r--r--sphinx/locale/pt_BR/LC_MESSAGES/sphinx.js2
-rw-r--r--sphinx/locale/pt_BR/LC_MESSAGES/sphinx.mobin7472 -> 7582 bytes
-rw-r--r--sphinx/locale/pt_BR/LC_MESSAGES/sphinx.po74
-rw-r--r--sphinx/locale/ru/LC_MESSAGES/sphinx.js2
-rw-r--r--sphinx/locale/ru/LC_MESSAGES/sphinx.mobin10120 -> 10230 bytes
-rw-r--r--sphinx/locale/ru/LC_MESSAGES/sphinx.po74
-rw-r--r--sphinx/locale/sl/LC_MESSAGES/sphinx.js2
-rw-r--r--sphinx/locale/sl/LC_MESSAGES/sphinx.mobin7208 -> 8046 bytes
-rw-r--r--sphinx/locale/sl/LC_MESSAGES/sphinx.po136
-rw-r--r--sphinx/locale/sphinx.pot76
-rw-r--r--sphinx/locale/uk_UA/LC_MESSAGES/sphinx.js2
-rw-r--r--sphinx/locale/uk_UA/LC_MESSAGES/sphinx.mobin9801 -> 9911 bytes
-rw-r--r--sphinx/locale/uk_UA/LC_MESSAGES/sphinx.po74
-rw-r--r--sphinx/locale/zh_CN/LC_MESSAGES/sphinx.js1
-rw-r--r--sphinx/locale/zh_CN/LC_MESSAGES/sphinx.mobin0 -> 7657 bytes
-rw-r--r--sphinx/locale/zh_CN/LC_MESSAGES/sphinx.po604
-rw-r--r--sphinx/locale/zh_TW/LC_MESSAGES/sphinx.js2
-rw-r--r--sphinx/locale/zh_TW/LC_MESSAGES/sphinx.mobin7560 -> 7732 bytes
-rw-r--r--sphinx/locale/zh_TW/LC_MESSAGES/sphinx.po74
-rw-r--r--sphinx/pycode/__init__.py43
-rw-r--r--sphinx/pycode/pgen2/parse.c4730
-rw-r--r--sphinx/pycode/pgen2/parse.pyx33
-rw-r--r--sphinx/quickstart.py168
-rw-r--r--sphinx/roles.py26
-rw-r--r--sphinx/search.py36
-rw-r--r--sphinx/setup_command.py56
-rw-r--r--sphinx/texinputs/sphinxhowto.cls (renamed from sphinx/texinputs/howto.cls)21
-rw-r--r--sphinx/texinputs/sphinxmanual.cls (renamed from sphinx/texinputs/manual.cls)24
-rw-r--r--sphinx/themes/agogo/layout.html91
-rw-r--r--sphinx/themes/agogo/static/agogo.css_t392
-rw-r--r--sphinx/themes/agogo/static/bgfooter.pngbin0 -> 434 bytes
-rw-r--r--sphinx/themes/agogo/static/bgtop.pngbin0 -> 430 bytes
-rw-r--r--sphinx/themes/agogo/theme.conf19
-rw-r--r--sphinx/themes/basic/defindex.html9
-rw-r--r--sphinx/themes/basic/genindex-single.html46
-rw-r--r--sphinx/themes/basic/genindex-split.html11
-rw-r--r--sphinx/themes/basic/genindex.html52
-rw-r--r--sphinx/themes/basic/globaltoc.html13
-rw-r--r--sphinx/themes/basic/layout.html118
-rw-r--r--sphinx/themes/basic/localtoc.html13
-rw-r--r--sphinx/themes/basic/modindex.html14
-rw-r--r--sphinx/themes/basic/page.html9
-rw-r--r--sphinx/themes/basic/relations.html19
-rw-r--r--sphinx/themes/basic/search.html9
-rw-r--r--sphinx/themes/basic/searchbox.html24
-rw-r--r--sphinx/themes/basic/sourcelink.html16
-rw-r--r--sphinx/themes/basic/static/basic.css32
-rw-r--r--sphinx/themes/basic/static/doctools.js26
-rw-r--r--sphinx/themes/basic/static/searchtools.js24
-rw-r--r--sphinx/themes/basic/static/underscore.js16
-rw-r--r--sphinx/themes/default/static/default.css_t21
-rw-r--r--sphinx/themes/default/theme.conf1
-rw-r--r--sphinx/themes/epub/layout.html16
-rw-r--r--sphinx/themes/epub/static/epub.css464
-rw-r--r--sphinx/themes/epub/theme.conf4
-rw-r--r--sphinx/themes/haiku/layout.html68
-rw-r--r--sphinx/themes/haiku/static/alert_info_32.pngbin0 -> 1168 bytes
-rw-r--r--sphinx/themes/haiku/static/alert_warning_32.pngbin0 -> 1060 bytes
-rw-r--r--sphinx/themes/haiku/static/bg-page.pngbin0 -> 164 bytes
-rw-r--r--sphinx/themes/haiku/static/bullet_orange.pngbin0 -> 365 bytes
-rw-r--r--sphinx/themes/haiku/static/haiku.css_t359
-rw-r--r--sphinx/themes/haiku/theme.conf12
-rw-r--r--sphinx/themes/nature/static/nature.css_t235
-rw-r--r--sphinx/themes/nature/theme.conf4
-rw-r--r--sphinx/themes/scrolls/artwork/logo.svg107
-rw-r--r--sphinx/themes/scrolls/layout.html42
-rw-r--r--sphinx/themes/scrolls/static/darkmetal.pngbin0 -> 44361 bytes
-rw-r--r--sphinx/themes/scrolls/static/headerbg.pngbin0 -> 298 bytes
-rw-r--r--sphinx/themes/scrolls/static/logo.pngbin0 -> 11078 bytes
-rw-r--r--sphinx/themes/scrolls/static/metal.pngbin0 -> 21543 bytes
-rw-r--r--sphinx/themes/scrolls/static/navigation.pngbin0 -> 217 bytes
-rw-r--r--sphinx/themes/scrolls/static/print.css5
-rw-r--r--sphinx/themes/scrolls/static/scrolls.css_t414
-rw-r--r--sphinx/themes/scrolls/static/theme_extras.js26
-rw-r--r--sphinx/themes/scrolls/static/watermark.pngbin0 -> 107625 bytes
-rw-r--r--sphinx/themes/scrolls/static/watermark_blur.pngbin0 -> 14470 bytes
-rw-r--r--sphinx/themes/scrolls/theme.conf11
-rw-r--r--sphinx/themes/sphinxdoc/layout.html9
-rw-r--r--sphinx/themes/sphinxdoc/static/sphinxdoc.css13
-rw-r--r--sphinx/themes/traditional/static/traditional.css23
-rw-r--r--sphinx/theming.py2
-rw-r--r--sphinx/util/__init__.py488
-rw-r--r--sphinx/util/matching.py83
-rw-r--r--sphinx/util/nodes.py111
-rw-r--r--sphinx/util/osutil.py130
-rw-r--r--sphinx/util/pycompat.py11
-rw-r--r--sphinx/writers/html.py8
-rw-r--r--sphinx/writers/latex.py25
-rw-r--r--sphinx/writers/text.py2
143 files changed, 9594 insertions, 3512 deletions
diff --git a/sphinx/__init__.py b/sphinx/__init__.py
index 6a55c9b8..31726e4b 100644
--- a/sphinx/__init__.py
+++ b/sphinx/__init__.py
@@ -12,8 +12,8 @@
import sys
from os import path
-__version__ = '0.6.4'
-__released__ = '0.6.4' # used when Sphinx builds its own docs
+__version__ = '1.0'
+__released__ = '1.0 (hg)' # used when Sphinx builds its own docs
package_dir = path.abspath(path.dirname(__file__))
diff --git a/sphinx/application.py b/sphinx/application.py
index 3817009f..636d436c 100644
--- a/sphinx/application.py
+++ b/sphinx/application.py
@@ -22,7 +22,8 @@ from docutils.parsers.rst import directives, roles
import sphinx
from sphinx.roles import xfileref_role, innernodetypes
from sphinx.config import Config
-from sphinx.errors import SphinxError, SphinxWarning, ExtensionError
+from sphinx.errors import SphinxError, SphinxWarning, ExtensionError, \
+ VersionRequirementError
from sphinx.builders import BUILTIN_BUILDERS
from sphinx.directives import GenericDesc, Target, additional_xref_types
from sphinx.environment import SphinxStandaloneReader
@@ -109,6 +110,13 @@ class Sphinx(object):
# now that we know all config values, collect them from conf.py
self.config.init_values()
+ # check the Sphinx version if requested
+ if self.config.needs_sphinx and \
+ self.config.needs_sphinx > sphinx.__version__[:3]:
+ raise VersionRequirementError(
+ 'This project needs at least Sphinx v%s and therefore cannot '
+ 'be built with this version.' % self.config.needs_sphinx)
+
if buildername is None:
print >>status, 'No builder selected, using default: html'
buildername = 'html'
@@ -178,9 +186,21 @@ class Sphinx(object):
self.warn('extension %r has no setup() function; is it really '
'a Sphinx extension module?' % extension)
else:
- mod.setup(self)
+ try:
+ mod.setup(self)
+ except VersionRequirementError, err:
+ # add the extension name to the version required
+ raise VersionRequirementError(
+ 'The %s extension used by this project needs at least '
+ 'Sphinx v%s; it therefore cannot be built with this '
+ 'version.' % (extension, err))
self._extensions[extension] = mod
+ def require_sphinx(self, version):
+ # check the Sphinx version if requested
+ if version > sphinx.__version__[:3]:
+ raise VersionRequirementError(version)
+
def import_object(self, objname, source=None):
"""Import an object from a 'module.name' string."""
try:
@@ -330,6 +350,11 @@ class Sphinx(object):
StandaloneHTMLBuilder.script_files.append(
posixpath.join('_static', filename))
+ def add_stylesheet(self, filename):
+ from sphinx.builders.html import StandaloneHTMLBuilder
+ StandaloneHTMLBuilder.css_files.append(
+ posixpath.join('_static', filename))
+
def add_lexer(self, alias, lexer):
from sphinx.highlighting import lexers
if lexers is None:
diff --git a/sphinx/builder.py b/sphinx/builder.py
deleted file mode 100644
index 2625ec8a..00000000
--- a/sphinx/builder.py
+++ /dev/null
@@ -1,28 +0,0 @@
-# -*- coding: utf-8 -*-
-"""
- sphinx.builder
- ~~~~~~~~~~~~~~
-
- .. warning::
-
- This module is only kept for API compatibility; new code should
- import these classes directly from the sphinx.builders package.
-
- :copyright: Copyright 2007-2010 by the Sphinx team, see AUTHORS.
- :license: BSD, see LICENSE for details.
-"""
-
-import warnings
-
-from sphinx.builders import Builder
-from sphinx.builders.text import TextBuilder
-from sphinx.builders.html import StandaloneHTMLBuilder, WebHTMLBuilder, \
- PickleHTMLBuilder, JSONHTMLBuilder
-from sphinx.builders.latex import LaTeXBuilder
-from sphinx.builders.changes import ChangesBuilder
-from sphinx.builders.htmlhelp import HTMLHelpBuilder
-from sphinx.builders.linkcheck import CheckExternalLinksBuilder
-
-warnings.warn('The sphinx.builder module is deprecated; please import '
- 'builders from the respective sphinx.builders submodules.',
- DeprecationWarning, stacklevel=2)
diff --git a/sphinx/builders/__init__.py b/sphinx/builders/__init__.py
index 5d75a886..32236a66 100644
--- a/sphinx/builders/__init__.py
+++ b/sphinx/builders/__init__.py
@@ -16,8 +16,8 @@ from os import path
from docutils import nodes
from sphinx import package_dir, locale
-from sphinx.util import SEP, ENOENT, relative_uri
from sphinx.environment import BuildEnvironment
+from sphinx.util.osutil import SEP, ENOENT, relative_uri
from sphinx.util.console import bold, purple, darkgreen, term_width_line
# side effect: registers roles and directives
@@ -380,15 +380,18 @@ class Builder(object):
BUILTIN_BUILDERS = {
- 'html': ('html', 'StandaloneHTMLBuilder'),
- 'dirhtml': ('html', 'DirectoryHTMLBuilder'),
- 'pickle': ('html', 'PickleHTMLBuilder'),
- 'json': ('html', 'JSONHTMLBuilder'),
- 'web': ('html', 'PickleHTMLBuilder'),
- 'htmlhelp': ('htmlhelp', 'HTMLHelpBuilder'),
- 'qthelp': ('qthelp', 'QtHelpBuilder'),
- 'latex': ('latex', 'LaTeXBuilder'),
- 'text': ('text', 'TextBuilder'),
- 'changes': ('changes', 'ChangesBuilder'),
- 'linkcheck': ('linkcheck', 'CheckExternalLinksBuilder'),
+ 'html': ('html', 'StandaloneHTMLBuilder'),
+ 'dirhtml': ('html', 'DirectoryHTMLBuilder'),
+ 'singlehtml': ('html', 'SingleFileHTMLBuilder'),
+ 'pickle': ('html', 'PickleHTMLBuilder'),
+ 'json': ('html', 'JSONHTMLBuilder'),
+ 'web': ('html', 'PickleHTMLBuilder'),
+ 'htmlhelp': ('htmlhelp', 'HTMLHelpBuilder'),
+ 'devhelp': ('devhelp', 'DevhelpBuilder'),
+ 'qthelp': ('qthelp', 'QtHelpBuilder'),
+ 'epub': ('epub', 'EpubBuilder'),
+ 'latex': ('latex', 'LaTeXBuilder'),
+ 'text': ('text', 'TextBuilder'),
+ 'changes': ('changes', 'ChangesBuilder'),
+ 'linkcheck': ('linkcheck', 'CheckExternalLinksBuilder'),
}
diff --git a/sphinx/builders/changes.py b/sphinx/builders/changes.py
index 1844354a..0571246a 100644
--- a/sphinx/builders/changes.py
+++ b/sphinx/builders/changes.py
@@ -14,9 +14,10 @@ from os import path
from cgi import escape
from sphinx import package_dir
-from sphinx.util import ensuredir, os_path, copy_static_entry
+from sphinx.util import copy_static_entry
from sphinx.theming import Theme
from sphinx.builders import Builder
+from sphinx.util.osutil import ensuredir, os_path
from sphinx.util.console import bold
@@ -93,6 +94,7 @@ class ChangesBuilder(Builder):
'libchanges': sorted(libchanges.iteritems()),
'apichanges': sorted(apichanges),
'otherchanges': sorted(otherchanges.iteritems()),
+ 'show_copyright': self.config.html_show_copyright,
'show_sphinx': self.config.html_show_sphinx,
}
f = codecs.open(path.join(self.outdir, 'index.html'), 'w', 'utf8')
@@ -138,11 +140,10 @@ class ChangesBuilder(Builder):
self.theme.get_options({}).iteritems())
copy_static_entry(path.join(package_dir, 'themes', 'default',
'static', 'default.css_t'),
- path.join(self.outdir, 'default.css_t'),
- self, themectx)
+ self.outdir, self, themectx)
copy_static_entry(path.join(package_dir, 'themes', 'basic',
'static', 'basic.css'),
- path.join(self.outdir, 'basic.css'), self)
+ self.outdir, self)
def hl(self, text, version):
text = escape(text)
diff --git a/sphinx/builders/devhelp.py b/sphinx/builders/devhelp.py
new file mode 100644
index 00000000..d7acf764
--- /dev/null
+++ b/sphinx/builders/devhelp.py
@@ -0,0 +1,132 @@
+# -*- coding: utf-8 -*-
+"""
+ sphinx.builders.devhelp
+ ~~~~~~~~~~~~~~~~~~~~~~~
+
+ Build HTML documentation and Devhelp_ support files.
+
+ .. _Devhelp: http://live.gnome.org/devhelp
+
+ :copyright: Copyright 2007-2010 by the Sphinx team, see AUTHORS.
+ :license: BSD, see LICENSE for details.
+"""
+
+import os
+import cgi
+import sys
+from os import path
+
+from docutils import nodes
+
+from sphinx import addnodes
+from sphinx.builders.html import StandaloneHTMLBuilder
+
+try:
+ import xml.etree.ElementTree as etree
+except ImportError:
+ try:
+ import lxml.etree as etree
+ except ImportError:
+ try:
+ import elementtree.ElementTree as etree
+ except ImportError:
+ import cElementTree.ElemenTree as etree
+
+try:
+ import gzip
+ def comp_open(filename, mode='rb'):
+ return gzip.open(filename + '.gz', mode)
+except ImportError:
+ def comp_open(filename, mode='rb'):
+ return open(filename, mode)
+
+
+class DevhelpBuilder(StandaloneHTMLBuilder):
+ """
+ Builder that also outputs GNOME Devhelp file.
+
+ """
+ name = 'devhelp'
+
+ # don't copy the reST source
+ copysource = False
+ supported_image_types = ['image/png', 'image/gif', 'image/jpeg']
+
+ # don't add links
+ add_permalinks = False
+ # don't add sidebar etc.
+ embedded = True
+
+ def init(self):
+ StandaloneHTMLBuilder.init(self)
+ self.out_suffix = '.html'
+
+ def handle_finish(self):
+ self.build_devhelp(self.outdir, self.config.devhelp_basename)
+
+ def build_devhelp(self, outdir, outname):
+ self.info('dumping devhelp index...')
+
+ # Basic info
+ root = etree.Element('book',
+ title=self.config.html_title,
+ name=self.config.project,
+ link="index.html",
+ version=self.config.version)
+ tree = etree.ElementTree(root)
+
+ # TOC
+ chapters = etree.SubElement(root, 'chapters')
+
+ tocdoc = self.env.get_and_resolve_doctree(
+ self.config.master_doc, self, prune_toctrees=False)
+
+ def write_toc(node, parent):
+ if isinstance(node, addnodes.compact_paragraph) or \
+ isinstance(node, nodes.bullet_list):
+ for subnode in node:
+ write_toc(subnode, parent)
+ elif isinstance(node, nodes.list_item):
+ item = etree.SubElement(parent, 'sub')
+ for subnode in node:
+ write_toc(subnode, item)
+ elif isinstance(node, nodes.reference):
+ parent.attrib['link'] = node['refuri']
+ parent.attrib['name'] = node.astext().encode('utf-8')
+
+ def istoctree(node):
+ return isinstance(node, addnodes.compact_paragraph) and \
+ node.has_key('toctree')
+
+ for node in tocdoc.traverse(istoctree):
+ write_toc(node, chapters)
+
+ # Index
+ functions = etree.SubElement(root, 'functions')
+ index = self.env.create_index(self)
+
+ def write_index(title, refs, subitems):
+ if len(refs) == 0:
+ pass
+ elif len(refs) == 1:
+ etree.SubElement(functions, 'function',
+ name=title, link=refs[0])
+ else:
+ for i, ref in enumerate(refs):
+ etree.SubElement(functions, 'function',
+ name="%s [%d]" % (title, i), link=ref)
+
+ if subitems:
+ for subitem in subitems:
+ write_index(subitem[0], subitem[1], [])
+
+ for (key, group) in index:
+ for title, (refs, subitems) in group:
+ write_index(title, refs, subitems)
+
+ # Dump the XML file
+ f = comp_open(path.join(outdir, outname + '.devhelp'), 'w')
+ try:
+ tree.write(f)
+ finally:
+ f.close()
diff --git a/sphinx/builders/epub.py b/sphinx/builders/epub.py
new file mode 100644
index 00000000..9767391e
--- /dev/null
+++ b/sphinx/builders/epub.py
@@ -0,0 +1,441 @@
+# -*- coding: utf-8 -*-
+"""
+ sphinx.builders.epub
+ ~~~~~~~~~~~~~~~~~~~~
+
+ Build epub files.
+ Originally derived from qthelp.py.
+
+ :copyright: Copyright 2007-2010 by the Sphinx team, see AUTHORS.
+ :license: BSD, see LICENSE for details.
+"""
+
+import os
+import codecs
+from os import path
+import zipfile
+
+from docutils import nodes
+from docutils.transforms import Transform
+
+from sphinx.builders.html import StandaloneHTMLBuilder
+from sphinx.util.osutil import EEXIST
+
+
+# (Fragment) templates from which the metainfo files content.opf, toc.ncx,
+# mimetype, and META-INF/container.xml are created.
+# This template section also defines strings that are embedded in the html
+# output but that may be customized by (re-)setting module attributes,
+# e.g. from conf.py.
+
+_mimetype_template = 'application/epub+zip' # no EOL!
+
+_container_template = u'''\
+<?xml version="1.0" encoding="UTF-8"?>
+<container version="1.0"
+ xmlns="urn:oasis:names:tc:opendocument:xmlns:container">
+ <rootfiles>
+ <rootfile full-path="content.opf"
+ media-type="application/oebps-package+xml"/>
+ </rootfiles>
+</container>
+'''
+
+_toc_template = u'''\
+<?xml version="1.0"?>
+<ncx version="2005-1" xmlns="http://www.daisy.org/z3986/2005/ncx/">
+ <head>
+ <meta name="dtb:uid" content="%(uid)s"/>
+ <meta name="dtb:depth" content="%(level)d"/>
+ <meta name="dtb:totalPageCount" content="0"/>
+ <meta name="dtb:maxPageNumber" content="0"/>
+ </head>
+ <docTitle>
+ <text>%(title)s</text>
+ </docTitle>
+ <navMap>
+%(navpoints)s
+ </navMap>
+</ncx>
+'''
+
+_navpoint_template = u'''\
+%(indent)s <navPoint id="%(navpoint)s" playOrder="%(playorder)d">
+%(indent)s <navLabel>
+%(indent)s <text>%(text)s</text>
+%(indent)s </navLabel>
+%(indent)s <content src="%(refuri)s" />
+%(indent)s </navPoint>'''
+
+_navpoint_indent = ' '
+_navPoint_template = 'navPoint%d'
+
+_content_template = u'''\
+<?xml version="1.0" encoding="UTF-8"?>
+<package xmlns="http://www.idpf.org/2007/opf" version="2.0"
+ unique-identifier="%(uid)s">
+ <metadata xmlns:opf="http://www.idpf.org/2007/opf"
+ xmlns:dc="http://purl.org/dc/elements/1.1/">
+ <dc:language>%(lang)s</dc:language>
+ <dc:title>%(title)s</dc:title>
+ <dc:creator opf:role="aut">%(author)s</dc:creator>
+ <dc:publisher>%(publisher)s</dc:publisher>
+ <dc:rights>%(copyright)s</dc:rights>
+ <dc:identifier id="%(uid)s" opf:scheme="%(scheme)s">%(id)s</dc:identifier>
+ </metadata>
+ <manifest>
+ <item id="ncx" href="toc.ncx" media-type="application/x-dtbncx+xml" />
+%(files)s
+ </manifest>
+ <spine toc="ncx">
+%(spine)s
+ </spine>
+</package>
+'''
+
+_file_template = u'''\
+ <item id="%(id)s"
+ href="%(href)s"
+ media-type="%(media_type)s" />'''
+
+_spine_template = u'''\
+ <itemref idref="%(idref)s" />'''
+
+_toctree_template = u'toctree-l%d'
+
+_link_target_template = u' [%(uri)s]'
+
+_css_link_target_class = u'link-target'
+
+_media_types = {
+ '.html': 'application/xhtml+xml',
+ '.css': 'text/css',
+ '.png': 'image/png',
+ '.gif': 'image/gif',
+ '.svg': 'image/svg+xml',
+ '.jpg': 'image/jpeg',
+ '.jpeg': 'image/jpeg',
+ '.otf': 'application/x-font-otf',
+ '.ttf': 'application/x-font-ttf',
+}
+
+
+# The transform to show link targets
+
+class VisibleLinksTransform(Transform):
+ """
+ Add the link target of referances to the text, unless it is already
+ present in the description.
+ """
+
+ # This transform must run after the references transforms
+ default_priority = 680
+
+ def apply(self):
+ for ref in self.document.traverse(nodes.reference):
+ uri = ref.get('refuri', '')
+ if ( uri.startswith('http:') or uri.startswith('https:') or \
+ uri.startswith('ftp:') ) and uri not in ref.astext():
+ uri = _link_target_template % {'uri': uri}
+ if uri:
+ idx = ref.parent.index(ref) + 1
+ link = nodes.inline(uri, uri)
+ link['classes'].append(_css_link_target_class)
+ ref.parent.insert(idx, link)
+
+
+# The epub publisher
+
+class EpubBuilder(StandaloneHTMLBuilder):
+ """Builder that outputs epub files.
+
+ It creates the metainfo files container.opf, toc.ncx, mimetype, and
+ META-INF/container.xml. Afterwards, all necessary files are zipped to an
+ epub file.
+ """
+ name = 'epub'
+
+ # don't copy the reST source
+ copysource = False
+ supported_image_types = ['image/svg+xml', 'image/png', 'image/gif',
+ 'image/jpeg']
+
+ # don't add links
+ add_permalinks = False
+ # don't add sidebar etc.
+ embedded = True
+
+ def init(self):
+ StandaloneHTMLBuilder.init(self)
+ # the output files for epub must be .html only
+ self.out_suffix = '.html'
+ self.playorder = 0
+ self.app.add_transform(VisibleLinksTransform)
+
+ def get_theme_config(self):
+ return self.config.epub_theme, {}
+
+ # generic support functions
+ def make_id(self, name):
+ """Replace all characters not allowed for (X)HTML ids."""
+ return name.replace('/', '_').replace(' ', '')
+
+ def esc(self, name):
+ """Replace all characters not allowed in text an attribute values."""
+ # Like cgi.escape, but also replace apostrophe
+ name = name.replace('&', '&amp;')
+ name = name.replace('<', '&lt;')
+ name = name.replace('>', '&gt;')
+ name = name.replace('"', '&quot;')
+ name = name.replace('\'', '&apos;')
+ return name
+
+ def get_refnodes(self, doctree, result):
+ """Collect section titles, their depth in the toc and the refuri."""
+ # XXX: is there a better way than checking the attribute
+ # toctree-l[1-8] on the parent node?
+ if isinstance(doctree, nodes.reference):
+ classes = doctree.parent.attributes['classes']
+ level = 1
+ for l in range(8, 0, -1): # or range(1, 8)?
+ if (_toctree_template % l) in classes:
+ level = l
+ result.append({
+ 'level': level,
+ 'refuri': self.esc(doctree['refuri']),
+ 'text': self.esc(doctree.astext())
+ })
+ else:
+ for elem in doctree.children:
+ result = self.get_refnodes(elem, result)
+ return result
+
+ def get_toc(self):
+ """Get the total table of contents, containg the master_doc
+ and pre and post files not managed by sphinx.
+ """
+ doctree = self.env.get_and_resolve_doctree(self.config.master_doc,
+ self, prune_toctrees=False)
+ self.refnodes = self.get_refnodes(doctree, [])
+ self.refnodes.insert(0, {
+ 'level': 1,
+ 'refuri': self.esc(self.config.master_doc + '.html'),
+ 'text': self.esc(self.env.titles[self.config.master_doc].astext())
+ })
+ for file, text in reversed(self.config.epub_pre_files):
+ self.refnodes.insert(0, {
+ 'level': 1,
+ 'refuri': self.esc(file + '.html'),
+ 'text': self.esc(text)
+ })
+ for file, text in self.config.epub_post_files:
+ self.refnodes.append({
+ 'level': 1,
+ 'refuri': self.esc(file + '.html'),
+ 'text': self.esc(text)
+ })
+
+
+ # Finish by building the epub file
+ def handle_finish(self):
+ """Create the metainfo files and finally the epub."""
+ self.get_toc()
+ self.build_mimetype(self.outdir, 'mimetype')
+ self.build_container(self.outdir, 'META-INF/container.xml')
+ self.build_content(self.outdir, 'content.opf')
+ self.build_toc(self.outdir, 'toc.ncx')
+ self.build_epub(self.outdir, self.config.epub_basename + '.epub')
+
+ def build_mimetype(self, outdir, outname):
+ """Write the metainfo file mimetype."""
+ self.info('writing %s file...' % outname)
+ f = codecs.open(path.join(outdir, outname), 'w', 'utf-8')
+ try:
+ f.write(_mimetype_template)
+ finally:
+ f.close()
+
+ def build_container(self, outdir, outname):
+ """Write the metainfo file META-INF/cointainer.xml."""
+ self.info('writing %s file...' % outname)
+ fn = path.join(outdir, outname)
+ try:
+ os.mkdir(path.dirname(fn))
+ except OSError, err:
+ if err.errno != EEXIST:
+ raise
+ f = codecs.open(path.join(outdir, outname), 'w', 'utf-8')
+ try:
+ f.write(_container_template)
+ finally:
+ f.close()
+
+ def content_metadata(self, files, spine):
+ """Create a dictionary with all metadata for the content.opf
+ file properly escaped.
+ """
+ metadata = {}
+ metadata['title'] = self.esc(self.config.epub_title)
+ metadata['author'] = self.esc(self.config.epub_author)
+ metadata['uid'] = self.esc(self.config.epub_uid)
+ metadata['lang'] = self.esc(self.config.epub_language)
+ metadata['publisher'] = self.esc(self.config.epub_publisher)
+ metadata['copyright'] = self.esc(self.config.epub_copyright)
+ metadata['scheme'] = self.esc(self.config.epub_scheme)
+ metadata['id'] = self.esc(self.config.epub_identifier)
+ metadata['files'] = files
+ metadata['spine'] = spine
+ return metadata
+
+ def build_content(self, outdir, outname):
+ """Write the metainfo file content.opf It contains bibliographic data,
+ a file list and the spine (the reading order).
+ """
+ self.info('writing %s file...' % outname)
+
+ # files
+ if not outdir.endswith(os.sep):
+ outdir += os.sep
+ olen = len(outdir)
+ projectfiles = []
+ self.files = []
+ self.ignored_files = ['.buildinfo',
+ 'mimetype', 'content.opf', 'toc.ncx', 'META-INF/container.xml',
+ self.config.epub_basename + '.epub'] + \
+ self.config.epub_exclude_files
+ for root, dirs, files in os.walk(outdir):
+ for fn in files:
+ filename = path.join(root, fn)[olen:]
+ if filename in self.ignored_files:
+ continue
+ ext = path.splitext(filename)[-1]
+ if ext not in _media_types:
+ self.warn('unknown mimetype for %s, ignoring' % filename)
+ continue
+ projectfiles.append(_file_template % {
+ 'href': self.esc(filename),
+ 'id': self.esc(self.make_id(filename)),
+ 'media_type': self.esc(_media_types[ext])
+ })
+ self.files.append(filename)
+ projectfiles = '\n'.join(projectfiles)
+
+ # spine
+ spine = []
+ for item in self.refnodes:
+ if '#' in item['refuri']:
+ continue
+ if item['refuri'] in self.ignored_files:
+ continue
+ spine.append(_spine_template % {
+ 'idref': self.esc(self.make_id(item['refuri']))
+ })
+ spine = '\n'.join(spine)
+
+ # write the project file
+ f = codecs.open(path.join(outdir, outname), 'w', 'utf-8')
+ try:
+ f.write(_content_template % \
+ self.content_metadata(projectfiles, spine))
+ finally:
+ f.close()
+
+ def new_navpoint(self, node, level, incr=True):
+ """Create a new entry in the toc from the node at given level."""
+ # XXX Modifies the node
+ if incr:
+ self.playorder += 1
+ node['indent'] = _navpoint_indent * level
+ node['navpoint'] = self.esc(_navPoint_template % self.playorder)
+ node['playorder'] = self.playorder
+ return _navpoint_template % node
+
+ def insert_subnav(self, node, subnav):
+ """Insert nested navpoints for given node.
+ The node and subnav are already rendered to text.
+ """
+ nlist = node.rsplit('\n', 1)
+ nlist.insert(-1, subnav)
+ return '\n'.join(nlist)
+
+ def build_navpoints(self, nodes):
+ """Create the toc navigation structure.
+
+ Subelements of a node are nested inside the navpoint.
+ For nested nodes the parent node is reinserted in the subnav.
+ """
+ navstack = []
+ navlist = []
+ level = 1
+ lastnode = None
+ for node in nodes:
+ file = node['refuri'].split('#')[0]
+ if file in self.ignored_files:
+ continue
+ if node['level'] > self.config.epub_tocdepth:
+ continue
+ if node['level'] == level:
+ navlist.append(self.new_navpoint(node, level))
+ elif node['level'] == level + 1:
+ navstack.append(navlist)
+ navlist = []
+ level += 1
+ if lastnode:
+ # Insert starting point in subtoc with same playOrder
+ navlist.append(self.new_navpoint(lastnode, level, False))
+ navlist.append(self.new_navpoint(node, level))
+ else:
+ while node['level'] < level:
+ subnav = '\n'.join(navlist)
+ navlist = navstack.pop()
+ navlist[-1] = self.insert_subnav(navlist[-1], subnav)
+ level -= 1
+ navlist.append(self.new_navpoint(node, level))
+ lastnode = node
+ while level != 1:
+ subnav = '\n'.join(navlist)
+ navlist = navstack.pop()
+ navlist[-1] = self.insert_subnav(navlist[-1], subnav)
+ level -= 1
+ return '\n'.join(navlist)
+
+ def toc_metadata(self, level, navpoints):
+ """Create a dictionary with all metadata for the toc.ncx
+ file properly escaped.
+ """
+ metadata = {}
+ metadata['uid'] = self.config.epub_uid
+ metadata['title'] = self.config.epub_title
+ metadata['level'] = level
+ metadata['navpoints'] = navpoints
+ return metadata
+
+ def build_toc(self, outdir, outname):
+ """Write the metainfo file toc.ncx."""
+ self.info('writing %s file...' % outname)
+
+ navpoints = self.build_navpoints(self.refnodes)
+ level = max(item['level'] for item in self.refnodes)
+ level = min(level, self.config.epub_tocdepth)
+ f = codecs.open(path.join(outdir, outname), 'w', 'utf-8')
+ try:
+ f.write(_toc_template % self.toc_metadata(level, navpoints))
+ finally:
+ f.close()
+
+ def build_epub(self, outdir, outname):
+ """Write the epub file.
+
+ It is a zip file with the mimetype file stored uncompressed
+ as the first entry.
+ """
+ self.info('writing %s file...' % outname)
+ projectfiles = ['META-INF/container.xml', 'content.opf', 'toc.ncx'] \
+ + self.files
+ epub = zipfile.ZipFile(path.join(outdir, outname), 'w', \
+ zipfile.ZIP_DEFLATED)
+ epub.write(path.join(outdir, 'mimetype'), 'mimetype', \
+ zipfile.ZIP_STORED)
+ for file in projectfiles:
+ epub.write(path.join(outdir, file), file, zipfile.ZIP_DEFLATED)
+ epub.close()
diff --git a/sphinx/builders/html.py b/sphinx/builders/html.py
index 04f07070..ab3e5544 100644
--- a/sphinx/builders/html.py
+++ b/sphinx/builders/html.py
@@ -22,20 +22,24 @@ except ImportError:
from docutils import nodes
from docutils.io import DocTreeInput, StringOutput
-from docutils.core import publish_parts
+from docutils.core import Publisher
from docutils.utils import new_document
from docutils.frontend import OptionParser
from docutils.readers.doctree import Reader as DoctreeReader
from sphinx import package_dir, __version__
-from sphinx.util import SEP, os_path, relative_uri, ensuredir, \
- movefile, ustrftime, copy_static_entry, copyfile
+from sphinx.util import copy_static_entry
+from sphinx.util.osutil import SEP, os_path, relative_uri, ensuredir, \
+ movefile, ustrftime, copyfile
+from sphinx.util.nodes import inline_all_toctrees
+from sphinx.util.matching import patmatch, compile_matchers
+from sphinx.util.pycompat import any
from sphinx.errors import SphinxError
from sphinx.search import js_index
from sphinx.theming import Theme
from sphinx.builders import Builder, ENV_PICKLE_FILENAME
from sphinx.highlighting import PygmentsBridge
-from sphinx.util.console import bold
+from sphinx.util.console import bold, darkgreen
from sphinx.writers.html import HTMLWriter, HTMLTranslator, \
SmartyPantsHTMLTranslator
@@ -70,7 +74,16 @@ class StandaloneHTMLBuilder(Builder):
embedded = False # for things like HTML help or Qt help: suppresses sidebar
# This is a class attribute because it is mutated by Sphinx.add_javascript.
- script_files = ['_static/jquery.js', '_static/doctools.js']
+ script_files = ['_static/jquery.js', '_static/underscore.js',
+ '_static/doctools.js']
+ # Dito for this one.
+ css_files = []
+
+ default_sidebars = ['localtoc.html', 'relations.html',
+ 'sourcelink.html', 'searchbox.html']
+
+ # cached publisher object for snippets
+ _publisher = None
def init(self):
# a hash of all config values that, if changed, cause a full rebuild
@@ -96,9 +109,14 @@ class StandaloneHTMLBuilder(Builder):
if path.isfile(jsfile):
self.script_files.append('_static/translations.js')
+ def get_theme_config(self):
+ return self.config.html_theme, self.config.html_theme_options
+
def init_templates(self):
Theme.init_themes(self)
- self.theme = Theme(self.config.html_theme)
+ themename, themeoptions = self.get_theme_config()
+ self.theme = Theme(themename)
+ self.theme_options = themeoptions.copy()
self.create_template_bridge()
self.templates.init(self, self.theme)
@@ -110,7 +128,8 @@ class StandaloneHTMLBuilder(Builder):
style = self.theme.get_confstr('theme', 'pygments_style', 'none')
else:
style = 'sphinx'
- self.highlighter = PygmentsBridge('html', style)
+ self.highlighter = PygmentsBridge('html', style,
+ self.config.trim_doctest_flags)
def init_translator_class(self):
if self.config.html_translator_class:
@@ -179,13 +198,24 @@ class StandaloneHTMLBuilder(Builder):
"""Utility: Render a lone doctree node."""
doc = new_document('<partial node>')
doc.append(node)
- return publish_parts(
- doc,
- source_class=DocTreeInput,
- reader=DoctreeReader(),
- writer=HTMLWriter(self),
- settings_overrides={'output_encoding': 'unicode'}
- )
+
+ if self._publisher is None:
+ self._publisher = Publisher(
+ source_class = DocTreeInput,
+ destination_class=StringOutput)
+ self._publisher.set_components('standalone',
+ 'restructuredtext', 'pseudoxml')
+
+ pub = self._publisher
+
+ pub.reader = DoctreeReader()
+ pub.writer = HTMLWriter(self)
+ pub.process_programmatic_settings(
+ None, {'output_encoding': 'unicode'}, None)
+ pub.set_source(doc, None)
+ pub.set_destination(None, None)
+ pub.publish()
+ return pub.writer.parts
def prepare_writing(self, docnames):
from sphinx.search import IndexBuilder
@@ -243,11 +273,13 @@ class StandaloneHTMLBuilder(Builder):
use_opensearch = self.config.html_use_opensearch,
docstitle = self.config.html_title,
shorttitle = self.config.html_short_title,
+ show_copyright = self.config.html_show_copyright,
show_sphinx = self.config.html_show_sphinx,
has_source = self.config.html_copy_source,
show_source = self.config.html_show_sourcelink,
file_suffix = self.out_suffix,
script_files = self.script_files,
+ css_files = self.css_files,
sphinx_version = __version__,
style = stylename,
rellinks = rellinks,
@@ -259,8 +291,7 @@ class StandaloneHTMLBuilder(Builder):
if self.theme:
self.globalcontext.update(
('theme_' + key, val) for (key, val) in
- self.theme.get_options(
- self.config.html_theme_options).iteritems())
+ self.theme.get_options(self.theme_options).iteritems())
self.globalcontext.update(self.config.html_context)
def get_doc_context(self, docname, body, metatags):
@@ -352,127 +383,12 @@ class StandaloneHTMLBuilder(Builder):
self.info(bold('writing additional files...'), nonl=1)
# the global general index
-
if self.config.html_use_index:
- # the total count of lines for each index letter, used to distribute
- # the entries into two columns
- genindex = self.env.create_index(self)
- indexcounts = []
- for _, entries in genindex:
- indexcounts.append(sum(1 + len(subitems)
- for _, (_, subitems) in entries))
-
- genindexcontext = dict(
- genindexentries = genindex,
- genindexcounts = indexcounts,
- split_index = self.config.html_split_index,
- )
- self.info(' genindex', nonl=1)
-
- if self.config.html_split_index:
- self.handle_page('genindex', genindexcontext,
- 'genindex-split.html')
- self.handle_page('genindex-all', genindexcontext,
- 'genindex.html')
- for (key, entries), count in zip(genindex, indexcounts):
- ctx = {'key': key, 'entries': entries, 'count': count,
- 'genindexentries': genindex}
- self.handle_page('genindex-' + key, ctx,
- 'genindex-single.html')
- else:
- self.handle_page('genindex', genindexcontext, 'genindex.html')
+ self.write_genindex()
# the global module index
-
if self.config.html_use_modindex and self.env.modules:
- # the sorted list of all modules, for the global module index
- modules = sorted(((mn, (self.get_relative_uri('modindex', fn) +
- '#module-' + mn, sy, pl, dep))
- for (mn, (fn, sy, pl, dep)) in
- self.env.modules.iteritems()),
- key=lambda x: x[0].lower())
- # collect all platforms
- platforms = set()
- # sort out collapsable modules
- modindexentries = []
- letters = []
- pmn = ''
- num_toplevels = 0
- num_collapsables = 0
- cg = 0 # collapse group
- fl = '' # first letter
- for mn, (fn, sy, pl, dep) in modules:
- pl = pl and pl.split(', ') or []
- platforms.update(pl)
-
- ignore = self.env.config['modindex_common_prefix']
- ignore = sorted(ignore, key=len, reverse=True)
- for i in ignore:
- if mn.startswith(i):
- mn = mn[len(i):]
- stripped = i
- break
- else:
- stripped = ''
-
- # we stripped the whole module name
- if not mn:
- continue
-
- if fl != mn[0].lower() and mn[0] != '_':
- # heading
- letter = mn[0].upper()
- if letter not in letters:
- modindexentries.append(['', False, 0, False,
- letter, '', [], False, ''])
- letters.append(letter)
- tn = mn.split('.')[0]
- if tn != mn:
- # submodule
- if pmn == tn:
- # first submodule - make parent collapsable
- modindexentries[-1][1] = True
- num_collapsables += 1
- elif not pmn.startswith(tn):
- # submodule without parent in list, add dummy entry
- cg += 1
- modindexentries.append([tn, True, cg, False, '', '',
- [], False, stripped])
- else:
- num_toplevels += 1
- cg += 1
- modindexentries.append([mn, False, cg, (tn != mn), fn, sy, pl,
- dep, stripped])
- pmn = mn
- fl = mn[0].lower()
- platforms = sorted(platforms)
-
- # apply heuristics when to collapse modindex at page load:
- # only collapse if number of toplevel modules is larger than
- # number of submodules
- collapse = len(modules) - num_toplevels < num_toplevels
-
- # As some parts of the module names may have been stripped, those
- # names have changed, thus it is necessary to sort the entries.
- if ignore:
- def sorthelper(entry):
- name = entry[0]
- if name == '':
- # heading
- name = entry[4]
- return name.lower()
-
- modindexentries.sort(key=sorthelper)
- letters.sort()
-
- modindexcontext = dict(
- modindexentries = modindexentries,
- platforms = platforms,
- letters = letters,
- collapse_modindex = collapse,
- )
- self.info(' modindex', nonl=1)
- self.handle_page('modindex', modindexcontext, 'modindex.html')
+ self.write_modindex()
# the search page
if self.name != 'htmlhelp':
@@ -491,6 +407,134 @@ class StandaloneHTMLBuilder(Builder):
self.info()
+ self.copy_image_files()
+ self.copy_download_files()
+ self.copy_static_files()
+ self.write_buildinfo()
+
+ # dump the search index
+ self.handle_finish()
+
+ def write_genindex(self):
+ # the total count of lines for each index letter, used to distribute
+ # the entries into two columns
+ genindex = self.env.create_index(self)
+ indexcounts = []
+ for _, entries in genindex:
+ indexcounts.append(sum(1 + len(subitems)
+ for _, (_, subitems) in entries))
+
+ genindexcontext = dict(
+ genindexentries = genindex,
+ genindexcounts = indexcounts,
+ split_index = self.config.html_split_index,
+ )
+ self.info(' genindex', nonl=1)
+
+ if self.config.html_split_index:
+ self.handle_page('genindex', genindexcontext,
+ 'genindex-split.html')
+ self.handle_page('genindex-all', genindexcontext,
+ 'genindex.html')
+ for (key, entries), count in zip(genindex, indexcounts):
+ ctx = {'key': key, 'entries': entries, 'count': count,
+ 'genindexentries': genindex}
+ self.handle_page('genindex-' + key, ctx,
+ 'genindex-single.html')
+ else:
+ self.handle_page('genindex', genindexcontext, 'genindex.html')
+
+ def write_modindex(self):
+ # the sorted list of all modules, for the global module index
+ modules = sorted(((mn, (self.get_relative_uri('modindex', fn) +
+ '#module-' + mn, sy, pl, dep))
+ for (mn, (fn, sy, pl, dep)) in
+ self.env.modules.iteritems()),
+ key=lambda x: x[0].lower())
+ # collect all platforms
+ platforms = set()
+ # sort out collapsable modules
+ modindexentries = []
+ letters = []
+ pmn = ''
+ num_toplevels = 0
+ num_collapsables = 0
+ cg = 0 # collapse group
+ fl = '' # first letter
+ for mn, (fn, sy, pl, dep) in modules:
+ pl = pl and pl.split(', ') or []
+ platforms.update(pl)
+
+ ignore = self.env.config['modindex_common_prefix']
+ ignore = sorted(ignore, key=len, reverse=True)
+ for i in ignore:
+ if mn.startswith(i):
+ mn = mn[len(i):]
+ stripped = i
+ break
+ else:
+ stripped = ''
+
+ # we stripped the whole module name
+ if not mn:
+ continue
+
+ if fl != mn[0].lower() and mn[0] != '_':
+ # heading
+ letter = mn[0].upper()
+ if letter not in letters:
+ modindexentries.append(['', False, 0, False,
+ letter, '', [], False, ''])
+ letters.append(letter)
+ tn = mn.split('.')[0]
+ if tn != mn:
+ # submodule
+ if pmn == tn:
+ # first submodule - make parent collapsable
+ modindexentries[-1][1] = True
+ num_collapsables += 1
+ elif not pmn.startswith(tn):
+ # submodule without parent in list, add dummy entry
+ cg += 1
+ modindexentries.append([tn, True, cg, False, '', '',
+ [], False, stripped])
+ else:
+ num_toplevels += 1
+ cg += 1
+ modindexentries.append([mn, False, cg, (tn != mn), fn, sy, pl,
+ dep, stripped])
+ pmn = mn
+ fl = mn[0].lower()
+ platforms = sorted(platforms)
+
+ # apply heuristics when to collapse modindex at page load:
+ # only collapse if number of toplevel modules is larger than
+ # number of submodules
+ collapse = len(modules) - num_toplevels < num_toplevels
+
+ # As some parts of the module names may have been stripped, those
+ # names have changed, thus it is necessary to sort the entries.
+ if ignore:
+ def sorthelper(entry):
+ name = entry[0]
+ if name == '':
+ # heading
+ name = entry[4]
+ return name.lower()
+
+ modindexentries.sort(key=sorthelper)
+ letters.sort()
+
+ modindexcontext = dict(
+ modindexentries = modindexentries,
+ platforms = platforms,
+ letters = letters,
+ collapse_modindex = collapse,
+ )
+ self.info(' modindex', nonl=1)
+ self.handle_page('modindex', modindexcontext, 'modindex.html')
+
+ def copy_image_files(self):
# copy image files
if self.images:
self.info(bold('copying images...'), nonl=True)
@@ -505,6 +549,7 @@ class StandaloneHTMLBuilder(Builder):
(path.join(self.srcdir, src), err))
self.info()
+ def copy_download_files(self):
# copy downloadable files
if self.env.dlfiles:
self.info(bold('copying downloadable files...'), nonl=True)
@@ -519,6 +564,7 @@ class StandaloneHTMLBuilder(Builder):
(path.join(self.srcdir, src), err))
self.info()
+ def copy_static_files(self):
# copy static files
self.info(bold('copying static files... '), nonl=True)
ensuredir(path.join(self.outdir, '_static'))
@@ -533,31 +579,42 @@ class StandaloneHTMLBuilder(Builder):
if path.isfile(jsfile):
copyfile(jsfile, path.join(self.outdir, '_static',
'translations.js'))
- # then, copy over all user-supplied static files
+ # then, copy over theme-supplied static files
if self.theme:
- staticdirnames = [path.join(themepath, 'static')
- for themepath in self.theme.get_dirchain()[::-1]]
- else:
- staticdirnames = []
- staticdirnames += [path.join(self.confdir, spath)
- for spath in self.config.html_static_path]
- for staticdirname in staticdirnames:
- if not path.isdir(staticdirname):
- self.warn('static directory %r does not exist' % staticdirname)
+ themeentries = [path.join(themepath, 'static')
+ for themepath in self.theme.get_dirchain()[::-1]]
+ for entry in themeentries:
+ copy_static_entry(entry, path.join(self.outdir, '_static'),
+ self, self.globalcontext)
+ # then, copy over all user-supplied static files
+ staticentries = [path.join(self.confdir, spath)
+ for spath in self.config.html_static_path]
+ matchers = compile_matchers(
+ self.config.exclude_patterns +
+ ['**/' + d for d in self.config.exclude_dirnames]
+ )
+ for entry in staticentries:
+ if not path.exists(entry):
+ self.warn('html_static_path entry %r does not exist' % entry)
continue
- for filename in os.listdir(staticdirname):
- if filename.startswith('.'):
- continue
- fullname = path.join(staticdirname, filename)
- targetname = path.join(self.outdir, '_static', filename)
- copy_static_entry(fullname, targetname, self,
- self.globalcontext)
- # last, copy logo file (handled differently)
+ copy_static_entry(entry, path.join(self.outdir, '_static'), self,
+ self.globalcontext, exclude_matchers=matchers)
+ # copy logo and favicon files if not already in static path
if self.config.html_logo:
logobase = path.basename(self.config.html_logo)
- copyfile(path.join(self.confdir, self.config.html_logo),
- path.join(self.outdir, '_static', logobase))
+ logotarget = path.join(self.outdir, '_static', logobase)
+ if not path.isfile(logotarget):
+ copyfile(path.join(self.confdir, self.config.html_logo),
+ logotarget)
+ if self.config.html_favicon:
+ iconbase = path.basename(self.config.html_favicon)
+ icontarget = path.join(self.outdir, '_static', iconbase)
+ if not path.isfile(icontarget):
+ copyfile(path.join(self.confdir, self.config.html_favicon),
+ icontarget)
+ self.info('done')
+ def write_buildinfo(self):
# write build info file
fp = open(path.join(self.outdir, '.buildinfo'), 'w')
try:
@@ -569,11 +626,6 @@ class StandaloneHTMLBuilder(Builder):
finally:
fp.close()
- self.info('done')
-
- # dump the search index
- self.handle_finish()
-
def cleanup(self):
# clean up theme stuff
if self.theme:
@@ -630,6 +682,36 @@ class StandaloneHTMLBuilder(Builder):
def get_outfilename(self, pagename):
return path.join(self.outdir, os_path(pagename) + self.out_suffix)
+ def add_sidebars(self, pagename, ctx):
+ def has_wildcard(pattern):
+ return any(char in pattern for char in '*?[')
+ sidebars = None
+ matched = None
+ customsidebar = None
+ for pattern, patsidebars in self.config.html_sidebars.iteritems():
+ if patmatch(pagename, pattern):
+ if matched:
+ if has_wildcard(pattern):
+ # warn if both patterns contain wildcards
+ if has_wildcard(matched):
+ self.warn('page %s matches two patterns in '
+ 'html_sidebars: %r and %r' %
+ (pagename, matched, pattern))
+ # else the already matched pattern is more specific
+ # than the present one, because it contains no wildcard
+ continue
+ matched = pattern
+ sidebars = patsidebars
+ if sidebars is None:
+ # keep defaults
+ pass
+ elif isinstance(sidebars, basestring):
+ # 0.x compatible mode: insert custom sidebar before searchbox
+ customsidebar = sidebars
+ sidebars = None
+ ctx['sidebars'] = sidebars
+ ctx['customsidebar'] = customsidebar
+
# --------- these are overwritten by the serialization builder
def get_target_uri(self, docname, typ=None):
@@ -649,8 +731,9 @@ class StandaloneHTMLBuilder(Builder):
return uri
ctx['pathto'] = pathto
ctx['hasdoc'] = lambda name: name in self.env.all_docs
- ctx['customsidebar'] = self.config.html_sidebars.get(pagename)
+ ctx['encoding'] = encoding = self.config.html_output_encoding
ctx['toctree'] = lambda **kw: self._get_local_toctree(pagename, **kw)
+ self.add_sidebars(pagename, ctx)
ctx.update(addctx)
self.app.emit('html-page-context', pagename, templatename,
@@ -669,7 +752,7 @@ class StandaloneHTMLBuilder(Builder):
# outfilename's path is in general different from self.outdir
ensuredir(path.dirname(outfilename))
try:
- f = codecs.open(outfilename, 'w', 'utf-8')
+ f = codecs.open(outfilename, 'w', encoding)
try:
f.write(output)
finally:
@@ -684,19 +767,10 @@ class StandaloneHTMLBuilder(Builder):
copyfile(self.env.doc2path(pagename), source_name)
def handle_finish(self):
- self.info(bold('dumping search index... '), nonl=True)
- self.indexer.prune(self.env.all_docs)
- searchindexfn = path.join(self.outdir, self.searchindex_filename)
- # first write to a temporary file, so that if dumping fails,
- # the existing index won't be overwritten
- f = open(searchindexfn + '.tmp', 'wb')
- try:
- self.indexer.dump(f, self.indexer_format)
- finally:
- f.close()
- movefile(searchindexfn + '.tmp', searchindexfn)
- self.info('done')
+ self.dump_search_index()
+ self.dump_inventory()
+ def dump_inventory(self):
self.info(bold('dumping object inventory... '), nonl=True)
f = open(path.join(self.outdir, INVENTORY_FILENAME), 'w')
try:
@@ -712,6 +786,20 @@ class StandaloneHTMLBuilder(Builder):
f.close()
self.info('done')
+ def dump_search_index(self):
+ self.info(bold('dumping search index... '), nonl=True)
+ self.indexer.prune(self.env.all_docs)
+ searchindexfn = path.join(self.outdir, self.searchindex_filename)
+ # first write to a temporary file, so that if dumping fails,
+ # the existing index won't be overwritten
+ f = open(searchindexfn + '.tmp', 'wb')
+ try:
+ self.indexer.dump(f, self.indexer_format)
+ finally:
+ f.close()
+ movefile(searchindexfn + '.tmp', searchindexfn)
+ self.info('done')
+
class DirectoryHTMLBuilder(StandaloneHTMLBuilder):
"""
@@ -739,6 +827,110 @@ class DirectoryHTMLBuilder(StandaloneHTMLBuilder):
return outfilename
+class SingleFileHTMLBuilder(StandaloneHTMLBuilder):
+ """
+ A StandaloneHTMLBuilder subclass that puts the whole document tree on one
+ HTML page.
+ """
+ name = 'singlehtml'
+ copysource = False
+
+ def get_outdated_docs(self):
+ return 'all documents'
+
+ def get_target_uri(self, docname, typ=None):
+ if docname in self.env.all_docs:
+ # all references are on the same page...
+ return self.config.master_doc + self.out_suffix + \
+ '#document-' + docname
+ else:
+ # chances are this is a html_additional_page
+ return docname + self.out_suffix
+
+ def get_relative_uri(self, from_, to, typ=None):
+ # ignore source
+ return self.get_target_uri(to, typ)
+
+ def fix_refuris(self, tree):
+ # fix refuris with double anchor
+ fname = self.config.master_doc + self.out_suffix
+ for refnode in tree.traverse(nodes.reference):
+ if 'refuri' not in refnode:
+ continue
+ refuri = refnode['refuri']
+ hashindex = refuri.find('#')
+ if hashindex < 0:
+ continue
+ hashindex = refuri.find('#', hashindex+1)
+ if hashindex >= 0:
+ refnode['refuri'] = fname + refuri[hashindex:]
+
+ def assemble_doctree(self):
+ master = self.config.master_doc
+ tree = self.env.get_doctree(master)
+ tree = inline_all_toctrees(self, set(), master, tree, darkgreen)
+ tree['docname'] = master
+ self.env.resolve_references(tree, master, self)
+ self.fix_refuris(tree)
+ return tree
+
+ def get_doc_context(self, docname, body, metatags):
+ # no relation links...
+ toc = self.env.get_toctree_for(self.config.master_doc, self, False)
+ self.fix_refuris(toc)
+ toc = self.render_partial(toc)['fragment']
+ return dict(
+ parents = [],
+ prev = None,
+ next = None,
+ docstitle = None,
+ title = self.config.html_title,
+ meta = None,
+ body = body,
+ metatags = metatags,
+ rellinks = [],
+ sourcename = '',
+ toc = toc,
+ display_toc = True,
+ )
+
+ def write(self, *ignored):
+ docnames = self.env.all_docs
+
+ self.info(bold('preparing documents... '), nonl=True)
+ self.prepare_writing(docnames)
+ self.info('done')
+
+ self.info(bold('assembling single document... '), nonl=True)
+ doctree = self.assemble_doctree()
+ self.info()
+ self.info(bold('writing... '), nonl=True)
+ self.write_doc(self.config.master_doc, doctree)
+ self.info('done')
+
+ def finish(self):
+ # no indices or search pages are supported
+ self.info(bold('writing additional files...'), nonl=1)
+
+ # additional pages from conf.py
+ for pagename, template in self.config.html_additional_pages.items():
+ self.info(' '+pagename, nonl=1)
+ self.handle_page(pagename, {}, template)
+
+ if self.config.html_use_opensearch:
+ self.info(' opensearch', nonl=1)
+ fn = path.join(self.outdir, '_static', 'opensearch.xml')
+ self.handle_page('opensearch', {}, 'opensearch.xml', outfilename=fn)
+
+ self.info()
+
+ self.copy_image_files()
+ self.copy_download_files()
+ self.copy_static_files()
+ self.write_buildinfo()
+ self.dump_inventory()
+
+
class SerializingHTMLBuilder(StandaloneHTMLBuilder):
"""
An abstract builder that serializes the generated HTML.
@@ -772,9 +964,7 @@ class SerializingHTMLBuilder(StandaloneHTMLBuilder):
def handle_page(self, pagename, ctx, templatename='page.html',
outfilename=None, event_arg=None):
ctx['current_page_name'] = pagename
- sidebarfile = self.config.html_sidebars.get(pagename)
- if sidebarfile:
- ctx['customsidebar'] = sidebarfile
+ self.add_sidebars(pagename, ctx)
if not outfilename:
outfilename = path.join(self.outdir,
diff --git a/sphinx/builders/latex.py b/sphinx/builders/latex.py
index 751bf28c..21771327 100644
--- a/sphinx/builders/latex.py
+++ b/sphinx/builders/latex.py
@@ -18,9 +18,11 @@ from docutils.utils import new_document
from docutils.frontend import OptionParser
from sphinx import package_dir, addnodes
-from sphinx.util import SEP, texescape, copyfile
+from sphinx.util import texescape
from sphinx.builders import Builder
from sphinx.environment import NoUri
+from sphinx.util.nodes import inline_all_toctrees
+from sphinx.util.osutil import SEP, copyfile
from sphinx.util.console import bold, darkgreen
from sphinx.writers.latex import LaTeXWriter
@@ -114,27 +116,6 @@ class LaTeXBuilder(Builder):
def assemble_doctree(self, indexfile, toctree_only, appendices):
self.docnames = set([indexfile] + appendices)
self.info(darkgreen(indexfile) + " ", nonl=1)
- def process_tree(docname, tree):
- tree = tree.deepcopy()
- for toctreenode in tree.traverse(addnodes.toctree):
- newnodes = []
- includefiles = map(str, toctreenode['includefiles'])
- for includefile in includefiles:
- try:
- self.info(darkgreen(includefile) + " ", nonl=1)
- subtree = process_tree(
- includefile, self.env.get_doctree(includefile))
- self.docnames.add(includefile)
- except Exception:
- self.warn('toctree contains ref to nonexisting '
- 'file %r' % includefile,
- self.env.doc2path(docname))
- else:
- sof = addnodes.start_of_file(docname=includefile)
- sof.children = subtree.children
- newnodes.append(sof)
- toctreenode.parent.replace(toctreenode, newnodes)
- return tree
tree = self.env.get_doctree(indexfile)
tree['docname'] = indexfile
if toctree_only:
@@ -148,7 +129,8 @@ class LaTeXBuilder(Builder):
for node in tree.traverse(addnodes.toctree):
new_sect += node
tree = new_tree
- largetree = process_tree(indexfile, tree)
+ largetree = inline_all_toctrees(self, self.docnames, indexfile, tree,
+ darkgreen)
largetree['docname'] = indexfile
for docname in appendices:
appendix = self.env.get_doctree(docname)
diff --git a/sphinx/builders/linkcheck.py b/sphinx/builders/linkcheck.py
index 300a13a1..3f9f16d9 100644
--- a/sphinx/builders/linkcheck.py
+++ b/sphinx/builders/linkcheck.py
@@ -70,6 +70,8 @@ class CheckExternalLinksBuilder(Builder):
lineno = node.line
if uri[0:5] == 'http:' or uri[0:6] == 'https:':
+ if lineno:
+ self.info('(line %3d) ' % lineno, nonl=1)
self.info(uri, nonl=1)
if uri in self.broken:
diff --git a/sphinx/builders/text.py b/sphinx/builders/text.py
index d8451371..092a1d97 100644
--- a/sphinx/builders/text.py
+++ b/sphinx/builders/text.py
@@ -14,8 +14,8 @@ from os import path
from docutils.io import StringOutput
-from sphinx.util import ensuredir, os_path
from sphinx.builders import Builder
+from sphinx.util.osutil import ensuredir, os_path
from sphinx.writers.text import TextWriter
diff --git a/sphinx/config.py b/sphinx/config.py
index 4cd51492..b81958df 100644
--- a/sphinx/config.py
+++ b/sphinx/config.py
@@ -13,8 +13,8 @@ import os
import re
from os import path
-from sphinx.util import make_filename
from sphinx.errors import ConfigError
+from sphinx.util.osutil import make_filename
nonascii_re = re.compile(r'[\x80-\xff]')
@@ -42,8 +42,9 @@ class Config(object):
master_doc = ('contents', 'env'),
source_suffix = ('.rst', 'env'),
source_encoding = ('utf-8-sig', 'env'),
+ exclude_patterns = ([], 'env'),
+ # the next three are all deprecated now
unused_docs = ([], 'env'),
- exclude_dirs = ([], 'env'),
exclude_trees = ([], 'env'),
exclude_dirnames = ([], 'env'),
default_role = (None, 'env'),
@@ -58,6 +59,8 @@ class Config(object):
keep_warnings = (False, 'env'),
modindex_common_prefix = ([], 'html'),
rst_epilog = (None, 'env'),
+ trim_doctest_flags = (True, 'env'),
+ needs_sphinx = (None, None),
# HTML options
html_theme = ('default', 'html'),
@@ -86,8 +89,10 @@ class Config(object):
html_use_opensearch = ('', 'html'),
html_file_suffix = (None, 'html'),
html_link_suffix = (None, 'html'),
+ html_show_copyright = (True, 'html'),
html_show_sphinx = (True, 'html'),
html_context = ({}, 'html'),
+ html_output_encoding = ('utf-8', 'html'),
# HTML help only options
htmlhelp_basename = (lambda self: make_filename(self.project), None),
@@ -95,6 +100,25 @@ class Config(object):
# Qt help only options
qthelp_basename = (lambda self: make_filename(self.project), None),
+ # Devhelp only options
+ devhelp_basename = (lambda self: make_filename(self.project), None),
+
+ # Epub options
+ epub_basename = (lambda self: make_filename(self.project), None),
+ epub_theme = ('epub', 'html'),
+ epub_title = (lambda self: self.html_title, 'html'),
+ epub_author = ('unknown', 'html'),
+ epub_language = (lambda self: self.language or 'en', 'html'),
+ epub_publisher = ('unknown', 'html'),
+ epub_copyright = (lambda self: self.copyright, 'html'),
+ epub_identifier = ('unknown', 'html'),
+ epub_scheme = ('unknown', 'html'),
+ epub_uid = ('unknown', 'env'),
+ epub_pre_files = ([], 'env'),
+ epub_post_files = ([], 'env'),
+ epub_exclude_files = ([], 'env'),
+ epub_tocdepth = (3, 'env'),
+
# LaTeX options
latex_documents = ([], None),
latex_logo = (None, None),
@@ -107,6 +131,7 @@ class Config(object):
latex_font_size = ('10pt', None),
latex_elements = ({}, None),
latex_additional_files = ([], None),
+ latex_docclass = ({}, None),
# now deprecated - use latex_elements
latex_preamble = ('', None),
)
diff --git a/sphinx/directives/code.py b/sphinx/directives/code.py
index f5a8f8af..5f2fd51e 100644
--- a/sphinx/directives/code.py
+++ b/sphinx/directives/code.py
@@ -81,12 +81,15 @@ class LiteralInclude(Directive):
final_argument_whitespace = False
option_spec = {
'linenos': directives.flag,
+ 'tab-width': int,
'language': directives.unchanged_required,
'encoding': directives.encoding,
'pyobject': directives.unchanged_required,
'lines': directives.unchanged_required,
'start-after': directives.unchanged_required,
'end-before': directives.unchanged_required,
+ 'prepend': directives.unchanged_required,
+ 'append': directives.unchanged_required,
}
def run(self):
@@ -150,7 +153,9 @@ class LiteralInclude(Directive):
lines = [lines[i] for i in linelist]
startafter = self.options.get('start-after')
- endbefore = self.options.get('end-before')
+ endbefore = self.options.get('end-before')
+ prepend = self.options.get('prepend')
+ append = self.options.get('append')
if startafter is not None or endbefore is not None:
use = not startafter
res = []
@@ -164,7 +169,14 @@ class LiteralInclude(Directive):
res.append(line)
lines = res
+ if prepend:
+ lines.insert(0, prepend + '\n')
+ if append:
+ lines.append(append + '\n')
+
text = ''.join(lines)
+ if self.options.get('tab-width'):
+ text = text.expandtabs(self.options['tab-width'])
retnode = nodes.literal_block(text, text, source=fn)
retnode.line = 1
if self.options.get('language', ''):
diff --git a/sphinx/directives/other.py b/sphinx/directives/other.py
index b11d6b2a..4b82f4ab 100644
--- a/sphinx/directives/other.py
+++ b/sphinx/directives/other.py
@@ -14,8 +14,10 @@ from docutils.parsers.rst import directives
from sphinx import addnodes
from sphinx.locale import pairindextypes
-from sphinx.util import patfilter, ws_re, caption_ref_re, url_re, docname_join
+from sphinx.util import ws_re, url_re, docname_join
+from sphinx.util.nodes import explicit_title_re
from sphinx.util.compat import Directive, directive_dwim, make_admonition
+from sphinx.util.matching import patfilter
class TocTree(Directive):
@@ -33,6 +35,7 @@ class TocTree(Directive):
'glob': directives.flag,
'hidden': directives.flag,
'numbered': directives.flag,
+ 'titlesonly': directives.flag,
}
def run(self):
@@ -54,7 +57,7 @@ class TocTree(Directive):
continue
if not glob:
# look for explicit titles ("Some Title <document>")
- m = caption_ref_re.match(entry)
+ m = explicit_title_re.match(entry)
if m:
ref = m.group(2)
title = m.group(1)
@@ -97,7 +100,10 @@ class TocTree(Directive):
subnode['glob'] = glob
subnode['hidden'] = 'hidden' in self.options
subnode['numbered'] = 'numbered' in self.options
- ret.append(subnode)
+ subnode['titlesonly'] = 'titlesonly' in self.options
+ wrappernode = nodes.compound(classes=['toctree-wrapper'])
+ wrappernode.append(subnode)
+ ret.append(wrappernode)
return ret
diff --git a/sphinx/environment.py b/sphinx/environment.py
index 88e9f99d..dddcd436 100644
--- a/sphinx/environment.py
+++ b/sphinx/environment.py
@@ -12,12 +12,10 @@
import re
import os
import time
-import heapq
import types
import codecs
import imghdr
import string
-import difflib
import cPickle as pickle
from os import path
from glob import glob
@@ -36,8 +34,11 @@ from docutils.transforms import Transform
from docutils.transforms.parts import ContentsFilter
from sphinx import addnodes
-from sphinx.util import movefile, get_matching_docs, SEP, ustrftime, \
- docname_join, FilenameUniqDict, url_re, clean_astext
+from sphinx.util import url_re, get_matching_docs, docname_join, \
+ FilenameUniqDict
+from sphinx.util.nodes import clean_astext
+from sphinx.util.osutil import movefile, SEP, ustrftime
+from sphinx.util.matching import compile_matchers
from sphinx.errors import SphinxError
from sphinx.directives import additional_xref_types
@@ -395,14 +396,15 @@ class BuildEnvironment:
"""
Find all source files in the source dir and put them in self.found_docs.
"""
- exclude_dirs = [d.replace(SEP, path.sep) for d in config.exclude_dirs]
- exclude_trees = [d.replace(SEP, path.sep) for d in config.exclude_trees]
+ matchers = compile_matchers(
+ config.exclude_patterns[:] +
+ config.exclude_trees +
+ [d + config.source_suffix for d in config.unused_docs] +
+ ['**/' + d for d in config.exclude_dirnames] +
+ ['**/_sources']
+ )
self.found_docs = set(get_matching_docs(
- self.srcdir, config.source_suffix,
- exclude_docs=set(config.unused_docs),
- exclude_dirs=exclude_dirs,
- exclude_trees=exclude_trees,
- exclude_dirnames=['_sources'] + config.exclude_dirnames))
+ self.srcdir, config.source_suffix, exclude_matchers=matchers))
def get_outdated_files(self, config_changed):
"""
@@ -757,6 +759,7 @@ class BuildEnvironment:
def process_metadata(self, docname, doctree):
"""
Process the docinfo part of the doctree as metadata.
+ Keep processing minimal -- just return what docutils says.
"""
self.metadata[docname] = md = {}
try:
@@ -768,10 +771,12 @@ class BuildEnvironment:
# nothing to see here
return
for node in docinfo:
- if node.__class__ is nodes.author:
- # handled specially by docutils
- md['author'] = node.astext()
- elif node.__class__ is nodes.field:
+ # nodes are multiply inherited...
+ if isinstance(node, nodes.authors):
+ md['authors'] = [author.astext() for author in node]
+ elif isinstance(node, nodes.TextElement): # e.g. author
+ md[node.__class__.__name__] = node.astext()
+ else:
name, body = node
md[name.astext()] = body.astext()
del doctree[0]
@@ -1131,6 +1136,8 @@ class BuildEnvironment:
return entries
maxdepth = maxdepth or toctree.get('maxdepth', -1)
+ if not titles_only and toctree.get('titlesonly', False):
+ titles_only = True
# NOTE: previously, this was separate=True, but that leads to artificial
# separation when two or more toctree entries form a logical unit, so
@@ -1168,6 +1175,7 @@ class BuildEnvironment:
typ = node['reftype']
target = node['reftarget']
+ refdoc = node.get('refdoc', fromdocname)
try:
if typ == 'ref':
@@ -1177,7 +1185,7 @@ class BuildEnvironment:
docname, labelid = self.anonlabels.get(target, ('',''))
sectname = node.astext()
if not docname:
- self.warn(node['refdoc'], 'undefined label: %s' %
+ self.warn(refdoc, 'undefined label: %s' %
target, node.line)
else:
# reference to the named label; the final node will
@@ -1185,8 +1193,7 @@ class BuildEnvironment:
docname, labelid, sectname = self.labels.get(target,
('','',''))
if not docname:
- self.warn(
- node['refdoc'],
+ self.warn(refdoc,
'undefined label: %s' % target + ' -- if you '
'don\'t give a link caption the label must '
'precede a section header.', node.line)
@@ -1212,10 +1219,10 @@ class BuildEnvironment:
elif typ == 'doc':
# directly reference to document by source name;
# can be absolute or relative
- docname = docname_join(node['refdoc'], target)
+ docname = docname_join(refdoc, target)
if docname not in self.all_docs:
- self.warn(node['refdoc'],
- 'unknown document: %s' % docname, node.line)
+ self.warn(refdoc, 'unknown document: %s' % docname,
+ node.line)
newnode = contnode
else:
if node['refcaption']:
@@ -1232,8 +1239,7 @@ class BuildEnvironment:
# keywords are referenced by named labels
docname, labelid, _ = self.labels.get(target, ('','',''))
if not docname:
- #self.warn(node['refdoc'],
- # 'unknown keyword: %s' % target)
+ #self.warn(refdoc, 'unknown keyword: %s' % target)
newnode = contnode
else:
newnode = nodes.reference('', '')
@@ -1262,12 +1268,11 @@ class BuildEnvironment:
('', ''))
if not docname:
if typ == 'term':
- self.warn(node['refdoc'],
+ self.warn(refdoc,
'term not in glossary: %s' % target,
node.line)
elif typ == 'citation':
- self.warn(node['refdoc'],
- 'citation not found: %s' % target,
+ self.warn(refdoc, 'citation not found: %s' % target,
node.line)
newnode = contnode
else:
@@ -1287,9 +1292,6 @@ class BuildEnvironment:
'missing-reference', self, node, contnode)
if not newnode:
newnode = contnode
- elif docname == fromdocname:
- # don't link to self
- newnode = contnode
else:
newnode = nodes.reference('', '')
newnode['refuri'] = builder.get_relative_uri(
diff --git a/sphinx/errors.py b/sphinx/errors.py
index 4e62b1af..4738f0cc 100644
--- a/sphinx/errors.py
+++ b/sphinx/errors.py
@@ -50,3 +50,7 @@ class ConfigError(SphinxError):
class ThemeError(SphinxError):
category = 'Theme error'
+
+
+class VersionRequirementError(SphinxError):
+ category = 'Sphinx version error'
diff --git a/sphinx/ext/autodoc.py b/sphinx/ext/autodoc.py
index ec0a993b..1be4a705 100644
--- a/sphinx/ext/autodoc.py
+++ b/sphinx/ext/autodoc.py
@@ -20,9 +20,10 @@ from docutils import nodes
from docutils.utils import assemble_option_dict
from docutils.statemachine import ViewList
-from sphinx.util import rpartition, nested_parse_with_titles, force_decode
+from sphinx.util import rpartition, force_decode
from sphinx.pycode import ModuleAnalyzer, PycodeError
from sphinx.application import ExtensionError
+from sphinx.util.nodes import nested_parse_with_titles
from sphinx.util.compat import Directive
from sphinx.util.inspect import isdescriptor, safe_getmembers, safe_getattr
from sphinx.util.docstrings import prepare_docstring
@@ -72,6 +73,7 @@ class Options(dict):
ALL = object()
+INSTANCEATTR = object()
def members_option(arg):
"""Used to convert the :members: option to auto directives."""
@@ -355,6 +357,16 @@ class Documenter(object):
"""
return None
+ def format_name(self):
+ """
+ Format the name of *self.object*. This normally should be something
+ that can be parsed by the generated directive, but doesn't need to be
+ (Sphinx will display it unparsed then).
+ """
+ # normally the name doesn't contain the module (except for module
+ # directives of course)
+ return '.'.join(self.objpath) or self.modname
+
def format_signature(self):
"""
Format the signature (arguments and return annotation) of the object.
@@ -388,11 +400,8 @@ class Documenter(object):
def add_directive_header(self, sig):
"""Add the directive header and options to the generated content."""
directive = getattr(self, 'directivetype', self.objtype)
- # the name to put into the generated directive -- doesn't contain
- # the module (except for module directive of course)
- name_in_directive = '.'.join(self.objpath) or self.modname
- self.add_line(u'.. %s:: %s%s' % (directive, name_in_directive, sig),
- '<autodoc>')
+ name = self.format_name()
+ self.add_line(u'.. %s:: %s%s' % (directive, name, sig), '<autodoc>')
if self.options.noindex:
self.add_line(u' :noindex:', '<autodoc>')
if self.objpath:
@@ -472,19 +481,30 @@ class Documenter(object):
self.directive.warn('missing attribute %s in object %s'
% (mname, self.fullname))
return False, ret
- elif self.options.inherited_members:
+
+ if self.options.inherited_members:
# safe_getmembers() uses dir() which pulls in members from all
# base classes
- return False, safe_getmembers(self.object)
+ members = safe_getmembers(self.object)
else:
# __dict__ contains only the members directly defined in
# the class (but get them via getattr anyway, to e.g. get
# unbound method objects instead of function objects);
# using keys() because apparently there are objects for which
# __dict__ changes while getting attributes
- return False, sorted([
- (mname, self.get_attr(self.object, mname, None))
- for mname in self.get_attr(self.object, '__dict__').keys()])
+ obj_dict = self.get_attr(self.object, '__dict__')
+ members = [(mname, self.get_attr(self.object, mname, None))
+ for mname in obj_dict.keys()]
+ membernames = set(m[0] for m in members)
+ # add instance attributes from the analyzer
+ if self.analyzer:
+ attr_docs = self.analyzer.find_attr_docs()
+ namespace = '.'.join(self.objpath)
+ for item in attr_docs.iteritems():
+ if item[0][0] == namespace:
+ if item[0][1] not in membernames:
+ members.append((item[0][1], INSTANCEATTR))
+ return False, sorted(members)
def filter_members(self, members, want_all):
"""
@@ -1028,6 +1048,34 @@ class AttributeDocumenter(ClassLevelDocumenter):
pass
+class InstanceAttributeDocumenter(AttributeDocumenter):
+ """
+ Specialized Documenter subclass for attributes that cannot be imported
+ because they are instance attributes (e.g. assigned in __init__).
+ """
+ objtype = 'instanceattribute'
+ directivetype = 'attribute'
+ member_order = 60
+
+ # must be higher than AttributeDocumenter
+ priority = 11
+
+ @classmethod
+ def can_document_member(cls, member, membername, isattr, parent):
+ """This documents only INSTANCEATTR members."""
+ return isattr and (member is INSTANCEATTR)
+
+ def import_object(self):
+ """Never import anything."""
+ # disguise as an attribute
+ self.objtype = 'attribute'
+ return True
+
+ def add_content(self, more_content, no_docstring=False):
+ """Never try to get a docstring from the object."""
+ AttributeDocumenter.add_content(self, more_content, no_docstring=True)
+
+
class AutoDirective(Directive):
"""
The AutoDirective class is used for all autodoc directives. It dispatches
@@ -1049,6 +1097,10 @@ class AutoDirective(Directive):
# a registry of type -> getattr function
_special_attrgetters = {}
+ # flags that can be given in autodoc_default_flags
+ _default_flags = set(['members', 'undoc-members', 'inherited-members',
+ 'show-inheritance'])
+
# standard docutils directive settings
has_content = True
required_arguments = 1
@@ -1071,6 +1123,14 @@ class AutoDirective(Directive):
# find out what documenter to call
objtype = self.name[4:]
doc_class = self._registry[objtype]
+ # add default flags
+ for flag in self._default_flags:
+ if flag not in doc_class.option_spec:
+ continue
+ negated = self.options.pop('no-' + flag, 'not given') is None
+ if flag in self.env.config.autodoc_default_flags and \
+ not negated:
+ self.options[flag] = None
# process the options with the selected documenter's option_spec
self.genopt = Options(assemble_option_dict(
self.options.items(), doc_class.option_spec))
@@ -1124,9 +1184,11 @@ def setup(app):
app.add_autodocumenter(FunctionDocumenter)
app.add_autodocumenter(MethodDocumenter)
app.add_autodocumenter(AttributeDocumenter)
+ app.add_autodocumenter(InstanceAttributeDocumenter)
app.add_config_value('autoclass_content', 'class', True)
app.add_config_value('autodoc_member_order', 'alphabetic', True)
+ app.add_config_value('autodoc_default_flags', [], True)
app.add_event('autodoc-process-docstring')
app.add_event('autodoc-process-signature')
app.add_event('autodoc-skip-member')
diff --git a/sphinx/ext/autosummary/__init__.py b/sphinx/ext/autosummary/__init__.py
index 0d750589..90d8599e 100644
--- a/sphinx/ext/autosummary/__init__.py
+++ b/sphinx/ext/autosummary/__init__.py
@@ -58,14 +58,12 @@ import re
import sys
import inspect
import posixpath
-from os import path
from docutils.parsers.rst import directives
from docutils.statemachine import ViewList
from docutils import nodes
from sphinx import addnodes, roles
-from sphinx.util import patfilter
from sphinx.util.compat import Directive
@@ -101,13 +99,63 @@ def autosummary_toc_visit_html(self, node):
"""Hide autosummary toctree list in HTML output."""
raise nodes.SkipNode
-def autosummary_toc_visit_latex(self, node):
- """Show autosummary toctree (= put the referenced pages here) in Latex."""
+def autosummary_noop(self, node):
pass
-def autosummary_noop(self, node):
+
+# -- autosummary_table node ----------------------------------------------------
+
+class autosummary_table(nodes.comment):
pass
+def autosummary_table_visit_html(self, node):
+ """Make the first column of the table non-breaking."""
+ try:
+ tbody = node[0][0][-1]
+ for row in tbody:
+ col1_entry = row[0]
+ par = col1_entry[0]
+ for j, subnode in enumerate(list(par)):
+ if isinstance(subnode, nodes.Text):
+ new_text = unicode(subnode.astext())
+ new_text = new_text.replace(u" ", u"\u00a0")
+ par[j] = nodes.Text(new_text)
+ except IndexError:
+ pass
+
+
+# -- autodoc integration -------------------------------------------------------
+
+try:
+ ismemberdescriptor = inspect.ismemberdescriptor
+ isgetsetdescriptor = inspect.isgetsetdescriptor
+except AttributeError:
+ def ismemberdescriptor(obj):
+ return False
+ isgetsetdescriptor = ismemberdescriptor
+
+def get_documenter(obj):
+ """
+ Get an autodoc.Documenter class suitable for documenting the given object
+ """
+ import sphinx.ext.autodoc as autodoc
+
+ if inspect.isclass(obj):
+ if issubclass(obj, Exception):
+ return autodoc.ExceptionDocumenter
+ return autodoc.ClassDocumenter
+ elif inspect.ismodule(obj):
+ return autodoc.ModuleDocumenter
+ elif inspect.ismethod(obj) or inspect.ismethoddescriptor(obj):
+ return autodoc.MethodDocumenter
+ elif (ismemberdescriptor(obj) or isgetsetdescriptor(obj)
+ or inspect.isdatadescriptor(obj)):
+ return autodoc.AttributeDocumenter
+ elif inspect.isroutine(obj):
+ return autodoc.FunctionDocumenter
+ else:
+ return autodoc.DataDocumenter
+
# -- .. autosummary:: ----------------------------------------------------------
@@ -125,35 +173,38 @@ class Autosummary(Directive):
option_spec = {
'toctree': directives.unchanged,
'nosignatures': directives.flag,
+ 'template': directives.unchanged,
}
- def run(self):
- names = []
- names += [x.strip() for x in self.content if x.strip()]
+ def warn(self, msg):
+ self.warnings.append(self.state.document.reporter.warning(
+ msg, line=self.lineno))
- table, warnings, real_names = get_autosummary(
- names, self.state, 'nosignatures' in self.options)
- node = table
+ def run(self):
+ self.env = env = self.state.document.settings.env
+ self.genopt = {}
+ self.warnings = []
- env = self.state.document.settings.env
- suffix = env.config.source_suffix
- all_docnames = env.found_docs.copy()
- dirname = posixpath.dirname(env.docname)
+ names = [x.strip().split()[0] for x in self.content
+ if x.strip() and re.search(r'^[~a-zA-Z_]', x.strip()[0])]
+ items = self.get_items(names)
+ nodes = self.get_table(items)
if 'toctree' in self.options:
+ suffix = env.config.source_suffix
+ all_docnames = env.found_docs.copy()
+ dirname = posixpath.dirname(env.docname)
+
tree_prefix = self.options['toctree'].strip()
docnames = []
- for name in names:
- name = real_names.get(name, name)
-
- docname = posixpath.join(tree_prefix, name)
+ for name, sig, summary, real_name in items:
+ docname = posixpath.join(tree_prefix, real_name)
if docname.endswith(suffix):
docname = docname[:-len(suffix)]
docname = posixpath.normpath(posixpath.join(dirname, docname))
if docname not in env.found_docs:
- warnings.append(self.state.document.reporter.warning(
- 'toctree references unknown document %r' % docname,
- line=self.lineno))
+ self.warn('toctree references unknown document %r'
+ % docname)
docnames.append(docname)
tocnode = addnodes.toctree()
@@ -163,63 +214,167 @@ class Autosummary(Directive):
tocnode['glob'] = None
tocnode = autosummary_toc('', '', tocnode)
- return warnings + [node] + [tocnode]
- else:
- return warnings + [node]
+ nodes.append(tocnode)
+ return self.warnings + nodes
-def get_autosummary(names, state, no_signatures=False):
- """
- Generate a proper table node for autosummary:: directive.
+ def get_items(self, names):
+ """
+ Try to import the given names, and return a list of
+ ``[(name, signature, summary_string, real_name), ...]``.
+ """
+ env = self.state.document.settings.env
+
+ prefixes = ['']
+ if env.currmodule:
+ prefixes.insert(0, env.currmodule)
+
+ items = []
+
+ max_item_chars = 50
+
+ for name in names:
+ display_name = name
+ if name.startswith('~'):
+ name = name[1:]
+ display_name = name.split('.')[-1]
+
+ try:
+ obj, real_name = import_by_name(name, prefixes=prefixes)
+ except ImportError:
+ self.warn('failed to import %s' % name)
+ items.append((name, '', '', name))
+ continue
+
+ # NB. using real_name here is important, since Documenters
+ # handle module prefixes slightly differently
+ documenter = get_documenter(obj)(self, real_name)
+ if not documenter.parse_name():
+ self.warn('failed to parse name %s' % real_name)
+ items.append((display_name, '', '', real_name))
+ continue
+ if not documenter.import_object():
+ self.warn('failed to import object %s' % real_name)
+ items.append((display_name, '', '', real_name))
+ continue
+
+ # -- Grab the signature
+
+ sig = documenter.format_signature()
+ if not sig:
+ sig = ''
+ else:
+ max_chars = max(10, max_item_chars - len(display_name))
+ sig = mangle_signature(sig, max_chars=max_chars)
+ sig = sig.replace('*', r'\*')
+
+ # -- Grab the summary
+
+ doc = list(documenter.process_doc(documenter.get_doc()))
+
+ while doc and not doc[0].strip():
+ doc.pop(0)
+ m = re.search(r"^([A-Z][^A-Z]*?\.\s)", " ".join(doc).strip())
+ if m:
+ summary = m.group(1).strip()
+ elif doc:
+ summary = doc[0].strip()
+ else:
+ summary = ''
+
+ items.append((display_name, sig, summary, real_name))
+
+ return items
+
+ def get_table(self, items):
+ """
+ Generate a proper list of table nodes for autosummary:: directive.
+
+ *items* is a list produced by :meth:`get_items`.
+ """
+ table_spec = addnodes.tabular_col_spec()
+ table_spec['spec'] = 'LL'
+
+ table = autosummary_table('')
+ real_table = nodes.table('')
+ table.append(real_table)
+ group = nodes.tgroup('', cols=2)
+ real_table.append(group)
+ group.append(nodes.colspec('', colwidth=10))
+ group.append(nodes.colspec('', colwidth=90))
+ body = nodes.tbody('')
+ group.append(body)
+
+ def append_row(*column_texts):
+ row = nodes.row('')
+ for text in column_texts:
+ node = nodes.paragraph('')
+ vl = ViewList()
+ vl.append(text, '<autosummary>')
+ self.state.nested_parse(vl, 0, node)
+ try:
+ if isinstance(node[0], nodes.paragraph):
+ node = node[0]
+ except IndexError:
+ pass
+ row.append(nodes.entry('', node))
+ body.append(row)
+
+ for name, sig, summary, real_name in items:
+ qualifier = 'obj'
+ if 'nosignatures' not in self.options:
+ col1 = ':%s:`%s <%s>`\ %s' % (qualifier, name, real_name, sig)
+ else:
+ col1 = ':%s:`%s <%s>`' % (qualifier, name, real_name)
+ col2 = summary
+ append_row(col1, col2)
+
+ return [table_spec, table]
+
+def mangle_signature(sig, max_chars=30):
+ """Reformat a function signature to a more compact form."""
+ sig = re.sub(r"^\((.*)\)$", r"\1", sig) + ", "
+ r = re.compile(r"(?P<name>[a-zA-Z0-9_*]+)(?P<default>=.*?)?, ")
+ items = r.findall(sig)
- *names* is a list of names of Python objects to be imported and added to the
- table. *document* is the Docutils document object.
+ args = [name for name, default in items if not default]
+ opts = [name for name, default in items if default]
+ sig = limited_join(", ", args, max_chars=max_chars-2)
+ if opts:
+ if not sig:
+ sig = "[%s]" % limited_join(", ", opts, max_chars=max_chars-4)
+ elif len(sig) < max_chars - 4 - 2 - 3:
+ sig += "[, %s]" % limited_join(", ", opts,
+ max_chars=max_chars-len(sig)-4-2)
+
+ return u"(%s)" % sig
+
+def limited_join(sep, items, max_chars=30, overflow_marker="..."):
"""
- document = state.document
-
- real_names = {}
- warnings = []
-
- prefixes = ['']
- prefixes.insert(0, document.settings.env.currmodule)
-
- table = nodes.table('')
- group = nodes.tgroup('', cols=2)
- table.append(group)
- group.append(nodes.colspec('', colwidth=30))
- group.append(nodes.colspec('', colwidth=70))
- body = nodes.tbody('')
- group.append(body)
-
- def append_row(*column_texts):
- row = nodes.row('')
- for text in column_texts:
- node = nodes.paragraph('')
- vl = ViewList()
- vl.append(text, '<autosummary>')
- state.nested_parse(vl, 0, node)
- row.append(nodes.entry('', node))
- body.append(row)
-
- for name in names:
- try:
- obj, real_name = import_by_name(name, prefixes=prefixes)
- except ImportError:
- warnings.append(document.reporter.warning(
- 'failed to import %s' % name))
- append_row(':obj:`%s`' % name, '')
- continue
+ Join a number of strings to one, limiting the length to *max_chars*.
- real_names[name] = real_name
+ If the string overflows this limit, replace the last fitting item by
+ *overflow_marker*.
+
+ Returns: joined_string
+ """
+ full_str = sep.join(items)
+ if len(full_str) < max_chars:
+ return full_str
+
+ n_chars = 0
+ n_items = 0
+ for j, item in enumerate(items):
+ n_chars += len(item) + len(sep)
+ if n_chars < max_chars - len(overflow_marker):
+ n_items += 1
+ else:
+ break
- title = ''
- qualifier = 'obj'
- col1 = ':'+qualifier+':`%s <%s>`' % (name, real_name)
- col2 = title
- append_row(col1, col2)
+ return sep.join(list(items[:n_items]) + [overflow_marker])
- return table, warnings, real_names
+# -- Importing items -----------------------------------------------------------
def import_by_name(name, prefixes=[None]):
"""
@@ -241,14 +396,16 @@ def import_by_name(name, prefixes=[None]):
def _import_by_name(name):
"""Import a Python object given its full name."""
try:
- # try first interpret `name` as MODNAME.OBJ
name_parts = name.split('.')
- try:
- modname = '.'.join(name_parts[:-1])
- __import__(modname)
- return getattr(sys.modules[modname], name_parts[-1])
- except (ImportError, IndexError, AttributeError):
- pass
+
+ # try first interpret `name` as MODNAME.OBJ
+ modname = '.'.join(name_parts[:-1])
+ if modname:
+ try:
+ __import__(modname)
+ return getattr(sys.modules[modname], name_parts[-1])
+ except (ImportError, IndexError, AttributeError):
+ pass
# ... then as MODNAME, MODNAME.OBJ1, MODNAME.OBJ1.OBJ2, ...
last_j = 0
@@ -301,16 +458,25 @@ def autolink_role(typ, rawtext, etext, lineno, inliner,
def process_generate_options(app):
genfiles = app.config.autosummary_generate
+
+ ext = app.config.source_suffix
+
+ if genfiles and not hasattr(genfiles, '__len__'):
+ env = app.builder.env
+ genfiles = [x + ext for x in env.found_docs
+ if os.path.isfile(env.doc2path(x))]
+
if not genfiles:
return
+
from sphinx.ext.autosummary.generate import generate_autosummary_docs
- ext = app.config.source_suffix
- genfiles = [path.join(app.srcdir, genfile +
- (not genfile.endswith(ext) and ext or ''))
+ genfiles = [genfile + (not genfile.endswith(ext) and ext or '')
for genfile in genfiles]
- generate_autosummary_docs(genfiles, warn=app.warn, info=app.info,
- suffix=ext)
+
+ generate_autosummary_docs(genfiles, builder=app.builder,
+ warn=app.warn, info=app.info, suffix=ext,
+ base_path=app.srcdir)
def setup(app):
@@ -318,7 +484,11 @@ def setup(app):
app.setup_extension('sphinx.ext.autodoc')
app.add_node(autosummary_toc,
html=(autosummary_toc_visit_html, autosummary_noop),
- latex=(autosummary_toc_visit_latex, autosummary_noop),
+ latex=(autosummary_noop, autosummary_noop),
+ text=(autosummary_noop, autosummary_noop))
+ app.add_node(autosummary_table,
+ html=(autosummary_table_visit_html, autosummary_noop),
+ latex=(autosummary_noop, autosummary_noop),
text=(autosummary_noop, autosummary_noop))
app.add_directive('autosummary', Autosummary)
app.add_role('autolink', autolink_role)
diff --git a/sphinx/ext/autosummary/generate.py b/sphinx/ext/autosummary/generate.py
index 26cf1a7c..66a124d2 100644
--- a/sphinx/ext/autosummary/generate.py
+++ b/sphinx/ext/autosummary/generate.py
@@ -20,219 +20,289 @@
import os
import re
import sys
-import getopt
-import inspect
+import pydoc
+import optparse
-from jinja2 import Environment, PackageLoader
+from jinja2 import FileSystemLoader, TemplateNotFound
+from jinja2.sandbox import SandboxedEnvironment
-from sphinx.ext.autosummary import import_by_name
-from sphinx.util import ensuredir
+from sphinx.ext.autosummary import import_by_name, get_documenter
+from sphinx.jinja2glue import BuiltinTemplateLoader
+from sphinx.util.osutil import ensuredir
-# create our own templating environment, for module template only
-env = Environment(loader=PackageLoader('sphinx.ext.autosummary', 'templates'))
+def main(argv=sys.argv):
+ usage = """%prog [OPTIONS] SOURCEFILE ..."""
+ p = optparse.OptionParser(usage.strip())
+ p.add_option("-o", "--output-dir", action="store", type="string",
+ dest="output_dir", default=None,
+ help="Directory to place all output in")
+ p.add_option("-s", "--suffix", action="store", type="string",
+ dest="suffix", default="rst",
+ help="Default suffix for files (default: %default)")
+ p.add_option("-t", "--templates", action="store", type="string",
+ dest="templates", default=None,
+ help="Custom template directory (default: %default)")
+ options, args = p.parse_args(argv[1:])
+
+ if len(args) < 1:
+ p.error('no input files given')
+ generate_autosummary_docs(args, options.output_dir,
+ "." + options.suffix,
+ template_dir=options.templates)
def _simple_info(msg):
print msg
def _simple_warn(msg):
- print >>sys.stderr, 'WARNING: ' + msg
+ print >> sys.stderr, 'WARNING: ' + msg
+
+# -- Generating output ---------------------------------------------------------
+
+def generate_autosummary_docs(sources, output_dir=None, suffix='.rst',
+ warn=_simple_warn, info=_simple_info,
+ base_path=None, builder=None, template_dir=None):
+
+ showed_sources = list(sorted(sources))
+ if len(showed_sources) > 20:
+ showed_sources = showed_sources[:10] + ['...'] + showed_sources[-10:]
+ info('[autosummary] generating autosummary for: %s' %
+ ', '.join(showed_sources))
-def generate_autosummary_docs(sources, output_dir=None, suffix=None,
- warn=_simple_warn, info=_simple_info):
- info('generating autosummary for: %s' % ', '.join(sources))
if output_dir:
- info('writing to %s' % output_dir)
+ info('[autosummary] writing to %s' % output_dir)
+
+ if base_path is not None:
+ sources = [os.path.join(base_path, filename) for filename in sources]
+
+ # create our own templating environment
+ template_dirs = [os.path.join(os.path.dirname(__file__), 'templates')]
+ if builder is not None:
+ # allow the user to override the templates
+ template_loader = BuiltinTemplateLoader()
+ template_loader.init(builder, dirs=template_dirs)
+ else:
+ if template_dir:
+ template_dirs.insert(0, template_dir)
+ template_loader = FileSystemLoader(template_dirs)
+ template_env = SandboxedEnvironment(loader=template_loader)
+
# read
- names = {}
- for name, loc in get_documented(sources).items():
- for (filename, sec_title, keyword, toctree) in loc:
- if toctree is not None:
- path = os.path.join(os.path.dirname(filename), toctree)
- names[name] = os.path.abspath(path)
+ items = find_autosummary_in_files(sources)
+
+ # remove possible duplicates
+ items = dict([(item, True) for item in items]).keys()
+
+ # keep track of new files
+ new_files = []
# write
- for name, path in sorted(names.items()):
- path = output_dir or path
+ for name, path, template_name in sorted(items):
+ if path is None:
+ # The corresponding autosummary:: directive did not have
+ # a :toctree: option
+ continue
+
+ path = output_dir or os.path.abspath(path)
ensuredir(path)
try:
obj, name = import_by_name(name)
except ImportError, e:
- warn('failed to import %r: %s' % (name, e))
+ warn('[autosummary] failed to import %r: %s' % (name, e))
continue
- fn = os.path.join(path, name + (suffix or '.rst'))
+ fn = os.path.join(path, name + suffix)
+
# skip it if it exists
if os.path.isfile(fn):
continue
+ new_files.append(fn)
+
f = open(fn, 'w')
try:
- if inspect.ismodule(obj):
- # XXX replace this with autodoc's API?
- tmpl = env.get_template('module')
- functions = [getattr(obj, item).__name__
- for item in dir(obj)
- if inspect.isfunction(getattr(obj, item))]
- classes = [getattr(obj, item).__name__
- for item in dir(obj)
- if inspect.isclass(getattr(obj, item))
- and not issubclass(getattr(obj, item), Exception)]
- exceptions = [getattr(obj, item).__name__
- for item in dir(obj)
- if inspect.isclass(getattr(obj, item))
- and issubclass(getattr(obj, item), Exception)]
- rendered = tmpl.render(name=name,
- underline='='*len(name),
- functions=functions,
- classes=classes,
- exceptions=exceptions,
- len_functions=len(functions),
- len_classes=len(classes),
- len_exceptions=len(exceptions))
- f.write(rendered)
+ doc = get_documenter(obj)
+
+ if template_name is not None:
+ template = template_env.get_template(template_name)
else:
- f.write('%s\n%s\n\n' % (name, '='*len(name)))
-
- if inspect.isclass(obj):
- if issubclass(obj, Exception):
- f.write(format_modulemember(name, 'autoexception'))
- else:
- f.write(format_modulemember(name, 'autoclass'))
- elif inspect.ismethod(obj) or inspect.ismethoddescriptor(obj):
- f.write(format_classmember(name, 'automethod'))
- elif callable(obj):
- f.write(format_modulemember(name, 'autofunction'))
- elif hasattr(obj, '__get__'):
- f.write(format_classmember(name, 'autoattribute'))
- else:
- f.write(format_modulemember(name, 'autofunction'))
- finally:
- f.close()
+ try:
+ template = template_env.get_template('autosummary/%s.rst'
+ % doc.objtype)
+ except TemplateNotFound:
+ template = template_env.get_template('autosummary/base.rst')
+
+ def get_members(obj, typ, include_public=[]):
+ items = [
+ name for name in dir(obj)
+ if get_documenter(getattr(obj, name)).objtype == typ
+ ]
+ public = [x for x in items
+ if x in include_public or not x.startswith('_')]
+ return public, items
+
+ ns = {}
+
+ if doc.objtype == 'module':
+ ns['members'] = dir(obj)
+ ns['functions'], ns['all_functions'] = \
+ get_members(obj, 'function')
+ ns['classes'], ns['all_classes'] = \
+ get_members(obj, 'class')
+ ns['exceptions'], ns['all_exceptions'] = \
+ get_members(obj, 'exception')
+ elif doc.objtype == 'class':
+ ns['members'] = dir(obj)
+ ns['methods'], ns['all_methods'] = \
+ get_members(obj, 'method', ['__init__'])
+ ns['attributes'], ns['all_attributes'] = \
+ get_members(obj, 'attribute')
+
+ parts = name.split('.')
+ if doc.objtype in ('method', 'attribute'):
+ mod_name = '.'.join(parts[:-2])
+ cls_name = parts[-2]
+ obj_name = '.'.join(parts[-2:])
+ ns['class'] = cls_name
+ else:
+ mod_name, obj_name = '.'.join(parts[:-1]), parts[-1]
+ ns['fullname'] = name
+ ns['module'] = mod_name
+ ns['objname'] = obj_name
+ ns['name'] = parts[-1]
-def format_modulemember(name, directive):
- parts = name.split('.')
- mod, name = '.'.join(parts[:-1]), parts[-1]
- return '.. currentmodule:: %s\n\n.. %s:: %s\n' % (mod, directive, name)
+ ns['objtype'] = doc.objtype
+ ns['underline'] = len(name) * '='
+ rendered = template.render(**ns)
+ f.write(rendered)
+ finally:
+ f.close()
-def format_classmember(name, directive):
- parts = name.split('.')
- mod, name = '.'.join(parts[:-2]), '.'.join(parts[-2:])
- return '.. currentmodule:: %s\n\n.. %s:: %s\n' % (mod, directive, name)
+ # descend recursively to new files
+ if new_files:
+ generate_autosummary_docs(new_files, output_dir=output_dir,
+ suffix=suffix, warn=warn, info=info,
+ base_path=base_path, builder=builder,
+ template_dir=template_dir)
-title_underline_re = re.compile('^[-=*_^#]{3,}\s*$')
-autodoc_re = re.compile(r'.. auto(function|method|attribute|class|exception'
- '|module)::\s*([A-Za-z0-9_.]+)\s*$')
-autosummary_re = re.compile(r'^\.\.\s+autosummary::\s*')
-module_re = re.compile(r'^\.\.\s+(current)?module::\s*([a-zA-Z0-9_.]+)\s*$')
-autosummary_item_re = re.compile(r'^\s+([_a-zA-Z][a-zA-Z0-9_.]*)\s*')
-toctree_arg_re = re.compile(r'^\s+:toctree:\s*(.*?)\s*$')
+# -- Finding documented entries in files ---------------------------------------
-def get_documented(filenames):
+def find_autosummary_in_files(filenames):
"""
- Find out what items are documented in the given filenames.
-
- Returns a dict of list of (filename, title, keyword, toctree) Keys are
- documented names of objects. The value is a list of locations where the
- object was documented. Each location is a tuple of filename, the current
- section title, the name of the directive, and the value of the :toctree:
- argument (if present) of the directive.
+ Find out what items are documented in source/*.rst.
+ See `find_autosummary_in_lines`.
"""
-
- documented = {}
-
+ documented = []
for filename in filenames:
- current_title = []
- last_line = None
- toctree = None
- current_module = None
- in_autosummary = False
-
f = open(filename, 'r')
- for line in f:
- try:
- if in_autosummary:
- m = toctree_arg_re.match(line)
- if m:
- toctree = m.group(1)
- continue
-
- if line.strip().startswith(':'):
- continue # skip options
-
- m = autosummary_item_re.match(line)
-
- if m:
- name = m.group(1).strip()
- if current_module and \
- not name.startswith(current_module + '.'):
- name = '%s.%s' % (current_module, name)
- documented.setdefault(name, []).append(
- (filename, current_title, 'autosummary', toctree))
- continue
- if line.strip() == '':
- continue
- in_autosummary = False
-
- m = autosummary_re.match(line)
- if m:
- in_autosummary = True
- continue
-
- m = autodoc_re.search(line)
- if m:
- name = m.group(2).strip()
- # XXX look in newer generate.py
- if current_module and \
- not name.startswith(current_module + '.'):
- name = '%s.%s' % (current_module, name)
- if m.group(1) == 'module':
- current_module = name
- documented.setdefault(name, []).append(
- (filename, current_title, 'auto' + m.group(1), None))
- continue
-
- m = title_underline_re.match(line)
- if m and last_line:
- current_title = last_line.strip()
- continue
-
- m = module_re.match(line)
- if m:
- current_module = m.group(2)
- continue
- finally:
- last_line = line
+ lines = f.read().splitlines()
+ documented.extend(find_autosummary_in_lines(lines, filename=filename))
+ f.close()
return documented
-
-def main(argv=sys.argv):
- usage = 'usage: %s [-o output_dir] [-s suffix] sourcefile ...' % sys.argv[0]
+def find_autosummary_in_docstring(name, module=None, filename=None):
+ """
+ Find out what items are documented in the given object's docstring.
+ See `find_autosummary_in_lines`.
+ """
try:
- opts, args = getopt.getopt(argv[1:], 'o:s:')
- except getopt.error:
- print >>sys.stderr, usage
- return 1
-
- output_dir = None
- suffix = None
- for opt, val in opts:
- if opt == '-o':
- output_dir = val
- elif opt == '-s':
- suffix = val
+ obj, real_name = import_by_name(name)
+ lines = pydoc.getdoc(obj).splitlines()
+ return find_autosummary_in_lines(lines, module=name, filename=filename)
+ except AttributeError:
+ pass
+ except ImportError, e:
+ print "Failed to import '%s': %s" % (name, e)
+ return []
+
+def find_autosummary_in_lines(lines, module=None, filename=None):
+ """
+ Find out what items appear in autosummary:: directives in the given lines.
+
+ Returns a list of (name, toctree, template) where *name* is a name
+ of an object and *toctree* the :toctree: path of the corresponding
+ autosummary directive (relative to the root of the file name), and
+ *template* the value of the :template: option. *toctree* and
+ *template* ``None`` if the directive does not have the
+ corresponding options set.
+ """
+ autosummary_re = re.compile(r'^\s*\.\.\s+autosummary::\s*')
+ automodule_re = re.compile(
+ r'^\s*\.\.\s+automodule::\s*([A-Za-z0-9_.]+)\s*$')
+ module_re = re.compile(
+ r'^\s*\.\.\s+(current)?module::\s*([a-zA-Z0-9_.]+)\s*$')
+ autosummary_item_re = re.compile(r'^\s+(~?[_a-zA-Z][a-zA-Z0-9_.]*)\s*.*?')
+ toctree_arg_re = re.compile(r'^\s+:toctree:\s*(.*?)\s*$')
+ template_arg_re = re.compile(r'^\s+:template:\s*(.*?)\s*$')
+
+ documented = []
+
+ toctree = None
+ template = None
+ current_module = module
+ in_autosummary = False
+
+ for line in lines:
+ if in_autosummary:
+ m = toctree_arg_re.match(line)
+ if m:
+ toctree = m.group(1)
+ if filename:
+ toctree = os.path.join(os.path.dirname(filename),
+ toctree)
+ continue
+
+ m = template_arg_re.match(line)
+ if m:
+ template = m.group(1).strip()
+ continue
+
+ if line.strip().startswith(':'):
+ continue # skip options
+
+ m = autosummary_item_re.match(line)
+ if m:
+ name = m.group(1).strip()
+ if name.startswith('~'):
+ name = name[1:]
+ if current_module and \
+ not name.startswith(current_module + '.'):
+ name = "%s.%s" % (current_module, name)
+ documented.append((name, toctree, template))
+ continue
+
+ if not line.strip():
+ continue
+
+ in_autosummary = False
+
+ m = autosummary_re.match(line)
+ if m:
+ in_autosummary = True
+ toctree = None
+ template = None
+ continue
- if len(args) < 1:
- print >>sys.stderr, usage
- return 1
+ m = automodule_re.search(line)
+ if m:
+ current_module = m.group(1).strip()
+ # recurse into the automodule docstring
+ documented.extend(find_autosummary_in_docstring(
+ current_module, filename=filename))
+ continue
+
+ m = module_re.match(line)
+ if m:
+ current_module = m.group(2)
+ continue
- generate_autosummary_docs(args, output_dir, suffix)
+ return documented
if __name__ == '__main__':
- main(sys.argv)
+ main()
diff --git a/sphinx/ext/autosummary/templates/autosummary/base.rst b/sphinx/ext/autosummary/templates/autosummary/base.rst
new file mode 100644
index 00000000..21a0ccd8
--- /dev/null
+++ b/sphinx/ext/autosummary/templates/autosummary/base.rst
@@ -0,0 +1,6 @@
+{{ fullname }}
+{{ underline }}
+
+.. currentmodule:: {{ module }}
+
+.. auto{{ objtype }}:: {{ objname }}
diff --git a/sphinx/ext/autosummary/templates/autosummary/class.rst b/sphinx/ext/autosummary/templates/autosummary/class.rst
new file mode 100644
index 00000000..40494dad
--- /dev/null
+++ b/sphinx/ext/autosummary/templates/autosummary/class.rst
@@ -0,0 +1,30 @@
+{{ fullname }}
+{{ underline }}
+
+.. currentmodule:: {{ module }}
+
+.. autoclass:: {{ objname }}
+
+ {% block methods %}
+ .. automethod:: __init__
+
+ {% if methods %}
+ .. rubric:: Methods
+
+ .. autosummary::
+ {% for item in methods %}
+ ~{{ name }}.{{ item }}
+ {%- endfor %}
+ {% endif %}
+ {% endblock %}
+
+ {% block attributes %}
+ {% if attributes %}
+ .. rubric:: Attributes
+
+ .. autosummary::
+ {% for item in attributes %}
+ ~{{ name }}.{{ item }}
+ {%- endfor %}
+ {% endif %}
+ {% endblock %}
diff --git a/sphinx/ext/autosummary/templates/autosummary/module.rst b/sphinx/ext/autosummary/templates/autosummary/module.rst
new file mode 100644
index 00000000..c14456ba
--- /dev/null
+++ b/sphinx/ext/autosummary/templates/autosummary/module.rst
@@ -0,0 +1,37 @@
+{{ fullname }}
+{{ underline }}
+
+.. automodule:: {{ fullname }}
+
+ {% block functions %}
+ {% if functions %}
+ .. rubric:: Functions
+
+ .. autosummary::
+ {% for item in functions %}
+ {{ item }}
+ {%- endfor %}
+ {% endif %}
+ {% endblock %}
+
+ {% block classes %}
+ {% if classes %}
+ .. rubric:: Classes
+
+ .. autosummary::
+ {% for item in classes %}
+ {{ item }}
+ {%- endfor %}
+ {% endif %}
+ {% endblock %}
+
+ {% block exceptions %}
+ {% if exceptions %}
+ .. rubric:: Exceptions
+
+ .. autosummary::
+ {% for item in exceptions %}
+ {{ item }}
+ {%- endfor %}
+ {% endif %}
+ {% endblock %}
diff --git a/sphinx/ext/autosummary/templates/module b/sphinx/ext/autosummary/templates/module
deleted file mode 100644
index 0cbc8266..00000000
--- a/sphinx/ext/autosummary/templates/module
+++ /dev/null
@@ -1,39 +0,0 @@
-:mod:`{{name}}`
-======{{ underline }}=
-
-
-.. automodule:: {{name}}
-
-{% if len_functions > 0 %}
-Functions
-----------
-{% for item in functions %}
-.. autofunction:: {{item}}
-{% endfor %}
-{% endif %}
-
-{% if len_classes > 0 %}
-Classes
---------
-{% for item in classes %}
-.. autoclass:: {{item}}
- :show-inheritance:
- :members:
- :inherited-members:
- :undoc-members:
-
-{% endfor %}
-{% endif %}
-
-{% if len_exceptions > 0 %}
-Exceptions
-------------
-{% for item in exceptions %}
-.. autoclass:: {{item}}
- :show-inheritance:
- :members:
- :inherited-members:
- :undoc-members:
-
-{% endfor %}
-{% endif %}
diff --git a/sphinx/ext/extlinks.py b/sphinx/ext/extlinks.py
new file mode 100644
index 00000000..36f4d697
--- /dev/null
+++ b/sphinx/ext/extlinks.py
@@ -0,0 +1,59 @@
+# -*- coding: utf-8 -*-
+"""
+ sphinx.ext.extlinks
+ ~~~~~~~~~~~~~~~~~~~
+
+ Extension to save typing and prevent hard-coding of base URLs in the reST
+ files.
+
+ This adds a new config value called ``extlinks`` that is created like this::
+
+ extlinks = {'exmpl': ('http://example.com/%s.html', prefix), ...}
+
+ Now you can use e.g. :exmpl:`foo` in your documents. This will create a
+ link to ``http://example.com/foo.html``. The link caption depends on the
+ *prefix* value given:
+
+ - If it is ``None``, the caption will be the full URL.
+ - If it is a string (empty or not), the caption will be the prefix prepended
+ to the role content.
+
+ You can also give an explicit caption, e.g. :exmpl:`Foo <foo>`.
+
+ :copyright: Copyright 2007-2010 by the Sphinx team, see AUTHORS.
+ :license: BSD, see LICENSE for details.
+"""
+
+from docutils import nodes, utils
+
+from sphinx.util.nodes import split_explicit_title
+
+
+def make_link_role(base_url, prefix):
+ def role(typ, rawtext, text, lineno, inliner, options={}, content=[]):
+ text = utils.unescape(text)
+ has_explicit_title, title, part = split_explicit_title(text)
+ try:
+ full_url = base_url % part
+ except (TypeError, ValueError):
+ env = inliner.document.settings.env
+ env.warn(env.docname, 'unable to expand %s extlink with base '
+ 'URL %r, please make sure the base contains \'%%s\' '
+ 'exactly once' % (typ, base_url))
+ full_url = base_url + part
+ if not has_explicit_title:
+ if prefix is None:
+ title = full_url
+ else:
+ title = prefix + part
+ pnode = nodes.reference(title, title, refuri=full_url)
+ return [pnode], []
+ return role
+
+def setup_link_roles(app):
+ for name, (base_url, prefix) in app.config.extlinks.iteritems():
+ app.add_role(name, make_link_role(base_url, prefix))
+
+def setup(app):
+ app.add_config_value('extlinks', {}, 'env')
+ app.connect('builder-inited', setup_link_roles)
diff --git a/sphinx/ext/graphviz.py b/sphinx/ext/graphviz.py
index b7cf93d2..106de7a6 100644
--- a/sphinx/ext/graphviz.py
+++ b/sphinx/ext/graphviz.py
@@ -13,6 +13,7 @@
import re
import posixpath
from os import path
+from math import ceil
from subprocess import Popen, PIPE
try:
from hashlib import sha1 as sha
@@ -20,13 +21,15 @@ except ImportError:
from sha import sha
from docutils import nodes
+from docutils.parsers.rst import directives
from sphinx.errors import SphinxError
-from sphinx.util import ensuredir, ENOENT, EPIPE
+from sphinx.util.osutil import ensuredir, ENOENT, EPIPE
from sphinx.util.compat import Directive
mapname_re = re.compile(r'<map id="(.*?)"')
+svg_dim_re = re.compile(r'<svg\swidth="(\d+)pt"\sheight="(\d+)pt"', re.M)
class GraphvizError(SphinxError):
@@ -45,7 +48,9 @@ class Graphviz(Directive):
required_arguments = 0
optional_arguments = 0
final_argument_whitespace = False
- option_spec = {}
+ option_spec = {
+ 'alt': directives.unchanged,
+ }
def run(self):
dotcode = '\n'.join(self.content)
@@ -56,6 +61,8 @@ class Graphviz(Directive):
node = graphviz()
node['code'] = dotcode
node['options'] = []
+ if 'alt' in self.options:
+ node['alt'] = self.options['alt']
return [node]
@@ -67,13 +74,17 @@ class GraphvizSimple(Directive):
required_arguments = 1
optional_arguments = 0
final_argument_whitespace = False
- option_spec = {}
+ option_spec = {
+ 'alt': directives.unchanged,
+ }
def run(self):
node = graphviz()
node['code'] = '%s %s {\n%s\n}\n' % \
(self.name, self.arguments[0], '\n'.join(self.content))
node['options'] = []
+ if 'alt' in self.options:
+ node['alt'] = self.options['alt']
return [node]
@@ -139,10 +150,45 @@ def render_dot(self, code, options, format, prefix='graphviz'):
return relfn, outfn
+def get_svg_tag(svgref, svgfile, imgcls=None):
+ # Webkit can't figure out svg dimensions when using object tag
+ # so we need to get it from the svg file
+ fp = open(svgfile, 'r')
+ try:
+ for line in fp:
+ match = svg_dim_re.match(line)
+ if match:
+ dimensions = match.groups()
+ break
+ else:
+ dimensions = None
+ finally:
+ fp.close()
+
+ # We need this hack to make WebKit show our object tag properly
+ def pt2px(x):
+ return int(ceil((96.0/72.0) * float(x)))
+
+ if dimensions:
+ style = ' width="%s" height="%s"' % tuple(map(pt2px, dimensions))
+ else:
+ style = ''
+
+ # The object tag works fine on Firefox and WebKit
+ # Besides it's a hack, this strategy does not mess with templates.
+ imgcss = imgcls and ' class="%s"' % imgcls or ''
+ return '<object type="image/svg+xml" data="%s"%s%s/>\n' % \
+ (svgref, imgcss, style)
+
+
def render_dot_html(self, node, code, options, prefix='graphviz',
imgcls=None, alt=None):
+ format = self.builder.config.graphviz_output_format
try:
- fname, outfn = render_dot(self, code, options, 'png', prefix)
+ if format not in ('png', 'svg'):
+ raise GraphvizError("graphviz_output_format must be one of 'png', "
+ "'svg', but is %r" % format)
+ fname, outfn = render_dot(self, code, options, format, prefix)
except GraphvizError, exc:
self.builder.warn('dot code %r: ' % code + str(exc))
raise nodes.SkipNode
@@ -151,24 +197,29 @@ def render_dot_html(self, node, code, options, prefix='graphviz',
if fname is None:
self.body.append(self.encode(code))
else:
- mapfile = open(outfn + '.map', 'rb')
- try:
- imgmap = mapfile.readlines()
- finally:
- mapfile.close()
- imgcss = imgcls and 'class="%s"' % imgcls or ''
if alt is None:
- alt = self.encode(code).strip()
- if len(imgmap) == 2:
- # nothing in image map (the lines are <map> and </map>)
- self.body.append('<img src="%s" alt="%s" %s/>\n' %
- (fname, alt, imgcss))
+ alt = node.get('alt', self.encode(code).strip())
+ if format == 'svg':
+ svgtag = get_svg_tag(fname, outfn, imgcls)
+ self.body.append(svgtag)
else:
- # has a map: get the name of the map and connect the parts
- mapname = mapname_re.match(imgmap[0]).group(1)
- self.body.append('<img src="%s" alt="%s" usemap="#%s" %s/>\n' %
- (fname, alt, mapname, imgcss))
- self.body.extend(imgmap)
+ mapfile = open(outfn + '.map', 'rb')
+ try:
+ imgmap = mapfile.readlines()
+ finally:
+ mapfile.close()
+ imgcss = imgcls and 'class="%s"' % imgcls or ''
+ if len(imgmap) == 2:
+ # nothing in image map (the lines are <map> and </map>)
+ self.body.append('<img src="%s" alt="%s" %s/>\n' %
+ (fname, alt, imgcss))
+ else:
+ # has a map: get the name of the map and connect the parts
+ mapname = mapname_re.match(imgmap[0]).group(1)
+ self.body.append('<img src="%s" alt="%s" usemap="#%s" %s/>\n' %
+ (fname, alt, mapname, imgcss))
+ self.body.extend(imgmap)
+
self.body.append('</p>\n')
raise nodes.SkipNode
@@ -201,3 +252,4 @@ def setup(app):
app.add_directive('digraph', GraphvizSimple)
app.add_config_value('graphviz_dot', 'dot', 'html')
app.add_config_value('graphviz_dot_args', [], 'html')
+ app.add_config_value('graphviz_output_format', 'png', 'html')
diff --git a/sphinx/ext/ifconfig.py b/sphinx/ext/ifconfig.py
index 8129a8e1..cdb6e2c3 100644
--- a/sphinx/ext/ifconfig.py
+++ b/sphinx/ext/ifconfig.py
@@ -41,7 +41,8 @@ class IfConfig(Directive):
node.document = self.state.document
node.line = self.lineno
node['expr'] = self.arguments[0]
- self.state.nested_parse(self.content, self.content_offset, node)
+ self.state.nested_parse(self.content, self.content_offset,
+ node, match_titles=1)
return [node]
diff --git a/sphinx/ext/pngmath.py b/sphinx/ext/pngmath.py
index c64379e6..93fa301d 100644
--- a/sphinx/ext/pngmath.py
+++ b/sphinx/ext/pngmath.py
@@ -23,8 +23,8 @@ except ImportError:
from docutils import nodes
from sphinx.errors import SphinxError
-from sphinx.util import ensuredir, ENOENT
from sphinx.util.png import read_png_depth, write_png_depth
+from sphinx.util.osutil import ensuredir, ENOENT
from sphinx.ext.mathbase import setup_math as mathbase_setup, wrap_displaymath
class MathExtError(SphinxError):
diff --git a/sphinx/ext/todo.py b/sphinx/ext/todo.py
index 95246af3..33ae8901 100644
--- a/sphinx/ext/todo.py
+++ b/sphinx/ext/todo.py
@@ -105,16 +105,17 @@ def process_todo_nodes(app, doctree, fromdocname):
content = []
for todo_info in env.todo_all_todos:
- para = nodes.paragraph()
+ para = nodes.paragraph(classes=['todo-source'])
filename = env.doc2path(todo_info['docname'], base=None)
- description = (
- _('(The original entry is located in %s, line %d and '
- 'can be found ') % (filename, todo_info['lineno']))
- para += nodes.Text(description, description)
+ description = _('(The <<original entry>> is located in '
+ ' %s, line %d.)') % (filename, todo_info['lineno'])
+ desc1 = description[:description.find('<<')]
+ desc2 = description[description.find('>>')+2:]
+ para += nodes.Text(desc1, desc1)
# Create a reference
newnode = nodes.reference('', '')
- innernode = nodes.emphasis(_('here'), _('here'))
+ innernode = nodes.emphasis(_('original entry'), _('original entry'))
newnode['refdocname'] = todo_info['docname']
try:
newnode['refuri'] = app.builder.get_relative_uri(
@@ -125,7 +126,7 @@ def process_todo_nodes(app, doctree, fromdocname):
pass
newnode.append(innernode)
para += newnode
- para += nodes.Text('.)', '.)')
+ para += nodes.Text(desc2, desc2)
# (Recursively) resolve references in the todo content
todo_entry = todo_info['todo']
diff --git a/sphinx/highlighting.py b/sphinx/highlighting.py
index 3de96880..8300bd32 100644
--- a/sphinx/highlighting.py
+++ b/sphinx/highlighting.py
@@ -83,6 +83,7 @@ _LATEX_STYLES = r'''
\newcommand\PYGZrb{]}
'''
+doctestopt_re = re.compile(r'#\s*doctest:.+$', re.MULTILINE)
parsing_exceptions = (SyntaxError, UnicodeEncodeError)
if sys.version_info < (2, 5):
@@ -97,7 +98,8 @@ class PygmentsBridge(object):
html_formatter = HtmlFormatter
latex_formatter = LatexFormatter
- def __init__(self, dest='html', stylename='sphinx'):
+ def __init__(self, dest='html', stylename='sphinx',
+ trim_doctest_flags=False):
self.dest = dest
if not pygments:
return
@@ -111,6 +113,7 @@ class PygmentsBridge(object):
stylename)
else:
style = get_style_by_name(stylename)
+ self.trim_doctest_flags = trim_doctest_flags
if dest == 'html':
self.fmter = {False: self.html_formatter(style=style),
True: self.html_formatter(style=style, linenos=True)}
@@ -175,6 +178,8 @@ class PygmentsBridge(object):
source = source.decode()
if not pygments:
return self.unhighlighted(source)
+
+ # find out which lexer to use
if lang in ('py', 'python'):
if source.startswith('>>>'):
# interactive session
@@ -199,6 +204,12 @@ class PygmentsBridge(object):
else:
lexer = lexers[lang] = get_lexer_by_name(lang)
lexer.add_filter('raiseonerror')
+
+ # trim doctest options if wanted
+ if isinstance(lexer, PythonConsoleLexer) and self.trim_doctest_flags:
+ source = doctestopt_re.sub('', source)
+
+ # highlight via Pygments
try:
if self.dest == 'html':
return highlight(source, lexer, self.fmter[bool(linenos)])
diff --git a/sphinx/jinja2glue.py b/sphinx/jinja2glue.py
index baeb7c33..cb992487 100644
--- a/sphinx/jinja2glue.py
+++ b/sphinx/jinja2glue.py
@@ -17,8 +17,8 @@ from jinja2 import FileSystemLoader, BaseLoader, TemplateNotFound, \
from jinja2.utils import open_if_exists
from jinja2.sandbox import SandboxedEnvironment
-from sphinx.util import mtimes_of_files
from sphinx.application import TemplateBridge
+from sphinx.util.osutil import mtimes_of_files
def _tobool(val):
diff --git a/sphinx/locale/cs/LC_MESSAGES/sphinx.js b/sphinx/locale/cs/LC_MESSAGES/sphinx.js
index 42fa9abd..d36ff3a6 100644
--- a/sphinx/locale/cs/LC_MESSAGES/sphinx.js
+++ b/sphinx/locale/cs/LC_MESSAGES/sphinx.js
@@ -1 +1 @@
-Documentation.addTranslations({"locale": "cs", "plural_expr": "(n%10==1 && n%100!=11 ? 0 : n%10>=2 && n%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2)", "messages": {"module, in ": "modul, v", "Preparing search...": "P\u0159ipravuji vyhled\u00e1v\u00e1n\u00ed....", "Your search did not match any documents. Please make sure that all words are spelled correctly and that you've selected enough categories.": "Nenalezli jsme \u017e\u00e1dn\u00fd dokument. Ujist\u011bte se pros\u00edm, \u017ee v\u0161echna slova jsou spr\u00e1vn\u011b a \u017ee jste vybral dostatek kategori\u00ed.", "Search finished, found %s page(s) matching the search query.": "Vyhled\u00e1v\u00e1n\u00ed skon\u010dilo, nalezeno %s stran.", ", in ": ", v", "Permalink to this headline": "Trval\u00fd odkaz na tento nadpis", "Searching": "Hled\u00e1m", "Permalink to this definition": "Trval\u00fd odkaz na tuto definici", "Hide Search Matches": "Skr\u00fdt v\u00fdsledky vyhled\u00e1v\u00e1n\u00ed", "Search Results": "V\u00fdsledky hled\u00e1n\u00ed"}}); \ No newline at end of file
+Documentation.addTranslations({"locale": "cs", "plural_expr": "(n%10==1 && n%100!=11 ? 0 : n%10>=2 && n%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2)", "messages": {"Search Results": "V\u00fdsledky hled\u00e1n\u00ed", "Preparing search...": "P\u0159ipravuji vyhled\u00e1v\u00e1n\u00ed....", "Your search did not match any documents. Please make sure that all words are spelled correctly and that you've selected enough categories.": "Nenalezli jsme \u017e\u00e1dn\u00fd dokument. Ujist\u011bte se pros\u00edm, \u017ee v\u0161echna slova jsou spr\u00e1vn\u011b a \u017ee jste vybral dostatek kategori\u00ed.", "Search finished, found %s page(s) matching the search query.": "Vyhled\u00e1v\u00e1n\u00ed skon\u010dilo, nalezeno %s stran.", ", in ": ", v", "Permalink to this headline": "Trval\u00fd odkaz na tento nadpis", "Searching": "Hled\u00e1m", "Permalink to this definition": "Trval\u00fd odkaz na tuto definici", "module, in ": "modul, v", "Hide Search Matches": "Skr\u00fdt v\u00fdsledky vyhled\u00e1v\u00e1n\u00ed"}}); \ No newline at end of file
diff --git a/sphinx/locale/cs/LC_MESSAGES/sphinx.mo b/sphinx/locale/cs/LC_MESSAGES/sphinx.mo
index 36056ac7..93ec36d7 100644
--- a/sphinx/locale/cs/LC_MESSAGES/sphinx.mo
+++ b/sphinx/locale/cs/LC_MESSAGES/sphinx.mo
Binary files differ
diff --git a/sphinx/locale/cs/LC_MESSAGES/sphinx.po b/sphinx/locale/cs/LC_MESSAGES/sphinx.po
index c0557111..500bf1cc 100644
--- a/sphinx/locale/cs/LC_MESSAGES/sphinx.po
+++ b/sphinx/locale/cs/LC_MESSAGES/sphinx.po
@@ -8,7 +8,7 @@ msgstr ""
"Project-Id-Version: Sphinx 0.5\n"
"Report-Msgid-Bugs-To: EMAIL@ADDRESS\n"
"POT-Creation-Date: 2008-11-27 18:39+0100\n"
-"PO-Revision-Date: 2009-08-06 22:48+0200\n"
+"PO-Revision-Date: 2009-08-06 23:04+0200\n"
"Last-Translator: Pavel Kosina <pavel.kosina@gmail.com>\n"
"Language-Team: Pavel Kosina <pavel.kosina@gmail.com>\n"
"Plural-Forms: nplurals=3; plural=(n%10==1 && n%100!=11 ? 0 : n%10>=2 && "
@@ -18,7 +18,7 @@ msgstr ""
"Content-Transfer-Encoding: 8bit\n"
"Generated-By: Babel 0.9.4\n"
-#: sphinx/environment.py:103 sphinx/writers/latex.py:182
+#: sphinx/environment.py:103 sphinx/writers/latex.py:184
#, python-format
msgid "%B %d, %Y"
msgstr "%d.%m.%Y"
@@ -27,12 +27,12 @@ msgstr "%d.%m.%Y"
#: sphinx/themes/basic/genindex-split.html:2
#: sphinx/themes/basic/genindex-split.html:5
#: sphinx/themes/basic/genindex.html:2 sphinx/themes/basic/genindex.html:5
-#: sphinx/themes/basic/genindex.html:48 sphinx/themes/basic/layout.html:131
-#: sphinx/writers/latex.py:188
+#: sphinx/themes/basic/genindex.html:48 sphinx/themes/basic/layout.html:134
+#: sphinx/writers/latex.py:190
msgid "Index"
msgstr "Index"
-#: sphinx/environment.py:325 sphinx/writers/latex.py:187
+#: sphinx/environment.py:325 sphinx/writers/latex.py:189
msgid "Module Index"
msgstr "Rejstřík modulů "
@@ -58,34 +58,34 @@ msgstr "Vestavěné funkce "
msgid "Module level"
msgstr "Úroveň modulů"
-#: sphinx/builders/html.py:205
+#: sphinx/builders/html.py:222
#, python-format
msgid "%b %d, %Y"
msgstr "%d.%m.%Y"
-#: sphinx/builders/html.py:224 sphinx/themes/basic/defindex.html:21
+#: sphinx/builders/html.py:241 sphinx/themes/basic/defindex.html:21
msgid "General Index"
msgstr "Rejstřík indexů"
-#: sphinx/builders/html.py:224
+#: sphinx/builders/html.py:241
msgid "index"
msgstr "index"
-#: sphinx/builders/html.py:226 sphinx/builders/htmlhelp.py:219
+#: sphinx/builders/html.py:243 sphinx/builders/htmlhelp.py:219
#: sphinx/builders/qthelp.py:133 sphinx/themes/basic/defindex.html:19
#: sphinx/themes/basic/modindex.html:2 sphinx/themes/basic/modindex.html:13
msgid "Global Module Index"
msgstr "Celkový rejstřík modulů"
-#: sphinx/builders/html.py:227
+#: sphinx/builders/html.py:244
msgid "modules"
msgstr "moduly"
-#: sphinx/builders/html.py:281
+#: sphinx/builders/html.py:300
msgid "next"
msgstr "další"
-#: sphinx/builders/html.py:290
+#: sphinx/builders/html.py:309
msgid "previous"
msgstr "předchozí"
@@ -209,37 +209,37 @@ msgstr "%s (C proměnná)"
msgid "%scommand line option; %s"
msgstr "%s parametry příkazového řádku; %s"
-#: sphinx/directives/other.py:138
+#: sphinx/directives/other.py:140
msgid "Platforms: "
msgstr "Platformy: "
-#: sphinx/directives/other.py:144
+#: sphinx/directives/other.py:146
#, python-format
msgid "%s (module)"
msgstr "%s (module)"
-#: sphinx/directives/other.py:193
+#: sphinx/directives/other.py:195
msgid "Section author: "
msgstr "Autor sekce: "
-#: sphinx/directives/other.py:195
+#: sphinx/directives/other.py:197
msgid "Module author: "
msgstr "Autor modulu: "
-#: sphinx/directives/other.py:197
+#: sphinx/directives/other.py:199
msgid "Author: "
msgstr "Autor: "
-#: sphinx/directives/other.py:317
+#: sphinx/directives/other.py:319
msgid "See also"
msgstr "Viz také"
-#: sphinx/ext/autodoc.py:883
+#: sphinx/ext/autodoc.py:889
#, python-format
msgid " Bases: %s"
msgstr ""
-#: sphinx/ext/autodoc.py:916
+#: sphinx/ext/autodoc.py:922
#, python-format
msgid "alias of :class:`%s`"
msgstr ""
@@ -433,40 +433,40 @@ msgstr "hledej"
msgid "Enter search terms or a module, class or function name."
msgstr "Zadej jméno modulu, třídy nebo funkce."
-#: sphinx/themes/basic/layout.html:119
+#: sphinx/themes/basic/layout.html:122
#, python-format
msgid "Search within %(docstitle)s"
msgstr "Hledání uvnitř %(docstitle)s"
-#: sphinx/themes/basic/layout.html:128
+#: sphinx/themes/basic/layout.html:131
msgid "About these documents"
msgstr "O těchto dokumentech"
-#: sphinx/themes/basic/layout.html:134 sphinx/themes/basic/search.html:2
+#: sphinx/themes/basic/layout.html:137 sphinx/themes/basic/search.html:2
#: sphinx/themes/basic/search.html:5
msgid "Search"
msgstr "Hledání"
-#: sphinx/themes/basic/layout.html:137
+#: sphinx/themes/basic/layout.html:140
msgid "Copyright"
msgstr "Veškerá práva vyhrazena"
-#: sphinx/themes/basic/layout.html:183
+#: sphinx/themes/basic/layout.html:187
#, python-format
msgid "&copy; <a href=\"%(path)s\">Copyright</a> %(copyright)s."
msgstr "&copy; <a href=\"%(path)s\">Copyright</a> %(copyright)s."
-#: sphinx/themes/basic/layout.html:185
+#: sphinx/themes/basic/layout.html:189
#, python-format
msgid "&copy; Copyright %(copyright)s."
msgstr "&copy; Copyright %(copyright)s."
-#: sphinx/themes/basic/layout.html:188
+#: sphinx/themes/basic/layout.html:193
#, python-format
msgid "Last updated on %(last_updated)s."
msgstr "Aktualizováno dne %(last_updated)s."
-#: sphinx/themes/basic/layout.html:191
+#: sphinx/themes/basic/layout.html:196
#, python-format
msgid ""
"Created using <a href=\"http://sphinx.pocoo.org/\">Sphinx</a> "
@@ -507,7 +507,7 @@ msgid "search"
msgstr "hledej"
#: sphinx/themes/basic/search.html:25
-#: sphinx/themes/basic/static/searchtools.js:453
+#: sphinx/themes/basic/static/searchtools.js:462
msgid "Search Results"
msgstr "Výsledky hledání"
@@ -564,15 +564,15 @@ msgstr "Hledám"
msgid "Preparing search..."
msgstr "Připravuji vyhledávání...."
-#: sphinx/themes/basic/static/searchtools.js:338
+#: sphinx/themes/basic/static/searchtools.js:347
msgid "module, in "
msgstr "modul, v"
-#: sphinx/themes/basic/static/searchtools.js:347
+#: sphinx/themes/basic/static/searchtools.js:356
msgid ", in "
msgstr ", v"
-#: sphinx/themes/basic/static/searchtools.js:455
+#: sphinx/themes/basic/static/searchtools.js:464
msgid ""
"Your search did not match any documents. Please make sure that all words "
"are spelled correctly and that you've selected enough categories."
@@ -580,24 +580,24 @@ msgstr ""
"Nenalezli jsme žádný dokument. Ujistěte se prosím, že všechna slova jsou "
"správně a že jste vybral dostatek kategorií."
-#: sphinx/themes/basic/static/searchtools.js:457
+#: sphinx/themes/basic/static/searchtools.js:466
#, python-format
msgid "Search finished, found %s page(s) matching the search query."
msgstr "Vyhledávání skončilo, nalezeno %s stran."
-#: sphinx/writers/latex.py:185
+#: sphinx/writers/latex.py:187
msgid "Release"
msgstr "Vydání"
-#: sphinx/writers/latex.py:571
+#: sphinx/writers/latex.py:578
msgid "Footnotes"
msgstr ""
-#: sphinx/writers/latex.py:639
+#: sphinx/writers/latex.py:646
msgid "continued from previous page"
msgstr ""
-#: sphinx/writers/latex.py:644
+#: sphinx/writers/latex.py:651
#, fuzzy
msgid "Continued on next page"
msgstr "Plný index na jedné stránce"
diff --git a/sphinx/locale/de/LC_MESSAGES/sphinx.mo b/sphinx/locale/de/LC_MESSAGES/sphinx.mo
index a8905259..65932481 100644
--- a/sphinx/locale/de/LC_MESSAGES/sphinx.mo
+++ b/sphinx/locale/de/LC_MESSAGES/sphinx.mo
Binary files differ
diff --git a/sphinx/locale/de/LC_MESSAGES/sphinx.po b/sphinx/locale/de/LC_MESSAGES/sphinx.po
index a054b142..9483de79 100644
--- a/sphinx/locale/de/LC_MESSAGES/sphinx.po
+++ b/sphinx/locale/de/LC_MESSAGES/sphinx.po
@@ -7,7 +7,7 @@ msgstr ""
"Project-Id-Version: PROJECT VERSION\n"
"Report-Msgid-Bugs-To: EMAIL@ADDRESS\n"
"POT-Creation-Date: 2008-08-07 21:40+0200\n"
-"PO-Revision-Date: 2009-08-06 22:49+0200\n"
+"PO-Revision-Date: 2009-08-06 23:04+0200\n"
"Last-Translator: Horst Gutmann <zerok@zerokspot.com>\n"
"Language-Team: de <LL@li.org>\n"
"Plural-Forms: nplurals=2; plural=(n != 1)\n"
@@ -16,7 +16,7 @@ msgstr ""
"Content-Transfer-Encoding: 8bit\n"
"Generated-By: Babel 0.9.4\n"
-#: sphinx/environment.py:103 sphinx/writers/latex.py:182
+#: sphinx/environment.py:103 sphinx/writers/latex.py:184
#, python-format
msgid "%B %d, %Y"
msgstr "%d. %m. %Y"
@@ -25,12 +25,12 @@ msgstr "%d. %m. %Y"
#: sphinx/themes/basic/genindex-split.html:2
#: sphinx/themes/basic/genindex-split.html:5
#: sphinx/themes/basic/genindex.html:2 sphinx/themes/basic/genindex.html:5
-#: sphinx/themes/basic/genindex.html:48 sphinx/themes/basic/layout.html:131
-#: sphinx/writers/latex.py:188
+#: sphinx/themes/basic/genindex.html:48 sphinx/themes/basic/layout.html:134
+#: sphinx/writers/latex.py:190
msgid "Index"
msgstr "Stichwortverzeichnis"
-#: sphinx/environment.py:325 sphinx/writers/latex.py:187
+#: sphinx/environment.py:325 sphinx/writers/latex.py:189
msgid "Module Index"
msgstr "Modulindex"
@@ -56,34 +56,34 @@ msgstr "Builtins"
msgid "Module level"
msgstr "Modulebene"
-#: sphinx/builders/html.py:205
+#: sphinx/builders/html.py:222
#, python-format
msgid "%b %d, %Y"
msgstr "%d. %m. %Y"
-#: sphinx/builders/html.py:224 sphinx/themes/basic/defindex.html:21
+#: sphinx/builders/html.py:241 sphinx/themes/basic/defindex.html:21
msgid "General Index"
msgstr "Allgemeiner Index"
-#: sphinx/builders/html.py:224
+#: sphinx/builders/html.py:241
msgid "index"
msgstr "Index"
-#: sphinx/builders/html.py:226 sphinx/builders/htmlhelp.py:219
+#: sphinx/builders/html.py:243 sphinx/builders/htmlhelp.py:219
#: sphinx/builders/qthelp.py:133 sphinx/themes/basic/defindex.html:19
#: sphinx/themes/basic/modindex.html:2 sphinx/themes/basic/modindex.html:13
msgid "Global Module Index"
msgstr "Globaler Modulindex"
-#: sphinx/builders/html.py:227
+#: sphinx/builders/html.py:244
msgid "modules"
msgstr "Module"
-#: sphinx/builders/html.py:281
+#: sphinx/builders/html.py:300
msgid "next"
msgstr "weiter"
-#: sphinx/builders/html.py:290
+#: sphinx/builders/html.py:309
msgid "previous"
msgstr "zurück"
@@ -206,37 +206,37 @@ msgstr "%s (C-Variable)"
msgid "%scommand line option; %s"
msgstr "%sKommandozeilenoption; %s"
-#: sphinx/directives/other.py:138
+#: sphinx/directives/other.py:140
msgid "Platforms: "
msgstr "Plattformen: "
-#: sphinx/directives/other.py:144
+#: sphinx/directives/other.py:146
#, python-format
msgid "%s (module)"
msgstr "%s (Modul)"
-#: sphinx/directives/other.py:193
+#: sphinx/directives/other.py:195
msgid "Section author: "
msgstr "Autor des Abschnitts: "
-#: sphinx/directives/other.py:195
+#: sphinx/directives/other.py:197
msgid "Module author: "
msgstr "Autor des Moduls: "
-#: sphinx/directives/other.py:197
+#: sphinx/directives/other.py:199
msgid "Author: "
msgstr "Autor: "
-#: sphinx/directives/other.py:317
+#: sphinx/directives/other.py:319
msgid "See also"
msgstr "Siehe auch"
-#: sphinx/ext/autodoc.py:883
+#: sphinx/ext/autodoc.py:889
#, python-format
msgid " Bases: %s"
msgstr " Basisklassen: %s"
-#: sphinx/ext/autodoc.py:916
+#: sphinx/ext/autodoc.py:922
#, python-format
msgid "alias of :class:`%s`"
msgstr "Alias von :class:`%s`"
@@ -248,7 +248,7 @@ msgstr "Zu tun"
#: sphinx/ext/todo.py:99
#, python-format
msgid "(The original entry is located in %s, line %d and can be found "
-msgstr "(Der ursprüngliche Eintrag steht in %s, Zeile %s, siehe "
+msgstr "(Der ursprüngliche Eintrag steht in %s, Zeile %d, siehe "
#: sphinx/ext/todo.py:105
msgid "here"
@@ -431,40 +431,40 @@ msgstr ""
"Geben Sie Suchbegriffe oder einen Modul-, Klassen- oder Funktionsnamen "
"ein."
-#: sphinx/themes/basic/layout.html:119
+#: sphinx/themes/basic/layout.html:122
#, python-format
msgid "Search within %(docstitle)s"
msgstr "Suche in %(docstitle)s"
-#: sphinx/themes/basic/layout.html:128
+#: sphinx/themes/basic/layout.html:131
msgid "About these documents"
msgstr "Über diese Dokumentation"
-#: sphinx/themes/basic/layout.html:134 sphinx/themes/basic/search.html:2
+#: sphinx/themes/basic/layout.html:137 sphinx/themes/basic/search.html:2
#: sphinx/themes/basic/search.html:5
msgid "Search"
msgstr "Suche"
-#: sphinx/themes/basic/layout.html:137
+#: sphinx/themes/basic/layout.html:140
msgid "Copyright"
msgstr "Copyright"
-#: sphinx/themes/basic/layout.html:183
+#: sphinx/themes/basic/layout.html:187
#, python-format
msgid "&copy; <a href=\"%(path)s\">Copyright</a> %(copyright)s."
msgstr "&copy; <a href=\"%(path)s\">Copyright</a> %(copyright)s."
-#: sphinx/themes/basic/layout.html:185
+#: sphinx/themes/basic/layout.html:189
#, python-format
msgid "&copy; Copyright %(copyright)s."
msgstr "&copy; Copyright %(copyright)s."
-#: sphinx/themes/basic/layout.html:188
+#: sphinx/themes/basic/layout.html:193
#, python-format
msgid "Last updated on %(last_updated)s."
msgstr "Zuletzt aktualisiert am %(last_updated)s."
-#: sphinx/themes/basic/layout.html:191
+#: sphinx/themes/basic/layout.html:196
#, python-format
msgid ""
"Created using <a href=\"http://sphinx.pocoo.org/\">Sphinx</a> "
@@ -506,7 +506,7 @@ msgid "search"
msgstr "suchen"
#: sphinx/themes/basic/search.html:25
-#: sphinx/themes/basic/static/searchtools.js:453
+#: sphinx/themes/basic/static/searchtools.js:462
msgid "Search Results"
msgstr "Suchergebnisse"
@@ -563,15 +563,15 @@ msgstr "Suche..."
msgid "Preparing search..."
msgstr "Suche wird vorbereitet..."
-#: sphinx/themes/basic/static/searchtools.js:338
+#: sphinx/themes/basic/static/searchtools.js:347
msgid "module, in "
msgstr "Modul, in "
-#: sphinx/themes/basic/static/searchtools.js:347
+#: sphinx/themes/basic/static/searchtools.js:356
msgid ", in "
msgstr ", in "
-#: sphinx/themes/basic/static/searchtools.js:455
+#: sphinx/themes/basic/static/searchtools.js:464
msgid ""
"Your search did not match any documents. Please make sure that all words "
"are spelled correctly and that you've selected enough categories."
@@ -579,24 +579,24 @@ msgstr ""
"Es wurden keine zutreffenden Dokumente gefunden. Haben Sie alle "
"Suchbegriffe richtig geschrieben und genügend Kategorien ausgewählt?"
-#: sphinx/themes/basic/static/searchtools.js:457
+#: sphinx/themes/basic/static/searchtools.js:466
#, python-format
msgid "Search finished, found %s page(s) matching the search query."
msgstr "Suche beendet, %s zutreffende Seite(n) gefunden."
-#: sphinx/writers/latex.py:185
+#: sphinx/writers/latex.py:187
msgid "Release"
msgstr "Release"
-#: sphinx/writers/latex.py:571
+#: sphinx/writers/latex.py:578
msgid "Footnotes"
-msgstr "Fußnoten"
+msgstr ""
-#: sphinx/writers/latex.py:639
+#: sphinx/writers/latex.py:646
msgid "continued from previous page"
msgstr "Fortsetzung der vorherigen Seite"
-#: sphinx/writers/latex.py:644
+#: sphinx/writers/latex.py:651
msgid "Continued on next page"
msgstr "Fortsetzung auf der nächsten Seite"
diff --git a/sphinx/locale/es/LC_MESSAGES/sphinx.js b/sphinx/locale/es/LC_MESSAGES/sphinx.js
index a8e2fd62..f43c642a 100644
--- a/sphinx/locale/es/LC_MESSAGES/sphinx.js
+++ b/sphinx/locale/es/LC_MESSAGES/sphinx.js
@@ -1 +1 @@
-Documentation.addTranslations({"locale": "es", "plural_expr": "(n != 1)", "messages": {"module, in ": "m\u00f3dulo", "Preparing search...": "Preparando la b\u00fasqueda", "Your search did not match any documents. Please make sure that all words are spelled correctly and that you've selected enough categories.": "La b\u00fasqueda no dio ning\u00fan resultado. Por favor aseg\u00farese que escribi\u00f3 todas las palabras correctamente y que ha seleccionado suficientes categor\u00edas", "Search finished, found %s page(s) matching the search query.": "B\u00fasqueda finalizada, se han encontrado %s p\u00e1gina(s) que concuerdan con su consulta", ", in ": "", "Permalink to this headline": "Enlazar permanentemente con este t\u00edtulo", "Searching": "Buscando", "Permalink to this definition": "Enlazar permanentemente con esta definici\u00f3n", "Hide Search Matches": "Coincidencias de la b\u00fasqueda", "Search Results": "Resultados de la b\u00fasqueda"}}); \ No newline at end of file
+Documentation.addTranslations({"locale": "es", "plural_expr": "(n != 1)", "messages": {"Search Results": "Resultados de la b\u00fasqueda", "Preparing search...": "Preparando la b\u00fasqueda", "Your search did not match any documents. Please make sure that all words are spelled correctly and that you've selected enough categories.": "La b\u00fasqueda no dio ning\u00fan resultado. Por favor aseg\u00farese que escribi\u00f3 todas las palabras correctamente y que ha seleccionado suficientes categor\u00edas", "Search finished, found %s page(s) matching the search query.": "B\u00fasqueda finalizada, se han encontrado %s p\u00e1gina(s) que concuerdan con su consulta", ", in ": "", "Permalink to this headline": "Enlazar permanentemente con este t\u00edtulo", "Searching": "Buscando", "Permalink to this definition": "Enlazar permanentemente con esta definici\u00f3n", "module, in ": "m\u00f3dulo", "Hide Search Matches": "Coincidencias de la b\u00fasqueda"}}); \ No newline at end of file
diff --git a/sphinx/locale/es/LC_MESSAGES/sphinx.mo b/sphinx/locale/es/LC_MESSAGES/sphinx.mo
index 092bbf01..c63cad23 100644
--- a/sphinx/locale/es/LC_MESSAGES/sphinx.mo
+++ b/sphinx/locale/es/LC_MESSAGES/sphinx.mo
Binary files differ
diff --git a/sphinx/locale/es/LC_MESSAGES/sphinx.po b/sphinx/locale/es/LC_MESSAGES/sphinx.po
index b7718a10..d73327cf 100644
--- a/sphinx/locale/es/LC_MESSAGES/sphinx.po
+++ b/sphinx/locale/es/LC_MESSAGES/sphinx.po
@@ -8,7 +8,7 @@ msgstr ""
"Project-Id-Version: Sphinx 0.5\n"
"Report-Msgid-Bugs-To: guillem@torroja.dmt.upm.es\n"
"POT-Creation-Date: 2008-09-11 23:58+0200\n"
-"PO-Revision-Date: 2009-08-06 22:48+0200\n"
+"PO-Revision-Date: 2009-08-06 23:04+0200\n"
"Last-Translator: Guillem Borrell <guillem@torroja.dmt.upm.es>\n"
"Language-Team: es <LL@li.org>\n"
"Plural-Forms: nplurals=2; plural=(n != 1)\n"
@@ -17,7 +17,7 @@ msgstr ""
"Content-Transfer-Encoding: 8bit\n"
"Generated-By: Babel 0.9.4\n"
-#: sphinx/environment.py:103 sphinx/writers/latex.py:182
+#: sphinx/environment.py:103 sphinx/writers/latex.py:184
#, fuzzy, python-format
msgid "%B %d, %Y"
msgstr "%d de %B de %Y"
@@ -26,12 +26,12 @@ msgstr "%d de %B de %Y"
#: sphinx/themes/basic/genindex-split.html:2
#: sphinx/themes/basic/genindex-split.html:5
#: sphinx/themes/basic/genindex.html:2 sphinx/themes/basic/genindex.html:5
-#: sphinx/themes/basic/genindex.html:48 sphinx/themes/basic/layout.html:131
-#: sphinx/writers/latex.py:188
+#: sphinx/themes/basic/genindex.html:48 sphinx/themes/basic/layout.html:134
+#: sphinx/writers/latex.py:190
msgid "Index"
msgstr "Índice"
-#: sphinx/environment.py:325 sphinx/writers/latex.py:187
+#: sphinx/environment.py:325 sphinx/writers/latex.py:189
msgid "Module Index"
msgstr "Índice de Módulos"
@@ -59,34 +59,34 @@ msgstr "Funciones de base"
msgid "Module level"
msgstr "Módulos"
-#: sphinx/builders/html.py:205
+#: sphinx/builders/html.py:222
#, python-format
msgid "%b %d, %Y"
msgstr "%d %b, %Y"
-#: sphinx/builders/html.py:224 sphinx/themes/basic/defindex.html:21
+#: sphinx/builders/html.py:241 sphinx/themes/basic/defindex.html:21
msgid "General Index"
msgstr "Índice General"
-#: sphinx/builders/html.py:224
+#: sphinx/builders/html.py:241
msgid "index"
msgstr "índice"
-#: sphinx/builders/html.py:226 sphinx/builders/htmlhelp.py:219
+#: sphinx/builders/html.py:243 sphinx/builders/htmlhelp.py:219
#: sphinx/builders/qthelp.py:133 sphinx/themes/basic/defindex.html:19
#: sphinx/themes/basic/modindex.html:2 sphinx/themes/basic/modindex.html:13
msgid "Global Module Index"
msgstr "Índice Global de Módulos"
-#: sphinx/builders/html.py:227
+#: sphinx/builders/html.py:244
msgid "modules"
msgstr "módulos"
-#: sphinx/builders/html.py:281
+#: sphinx/builders/html.py:300
msgid "next"
msgstr "siguiente"
-#: sphinx/builders/html.py:290
+#: sphinx/builders/html.py:309
msgid "previous"
msgstr "anterior"
@@ -211,37 +211,37 @@ msgstr "%s (variable C)"
msgid "%scommand line option; %s"
msgstr "%sOpciones en línea de comandos; %s"
-#: sphinx/directives/other.py:138
+#: sphinx/directives/other.py:140
msgid "Platforms: "
msgstr "Plataformas:"
-#: sphinx/directives/other.py:144
+#: sphinx/directives/other.py:146
#, python-format
msgid "%s (module)"
msgstr "%s (módulo)"
-#: sphinx/directives/other.py:193
+#: sphinx/directives/other.py:195
msgid "Section author: "
msgstr "Autor de la sección"
-#: sphinx/directives/other.py:195
+#: sphinx/directives/other.py:197
msgid "Module author: "
msgstr "Autor del módulo"
-#: sphinx/directives/other.py:197
+#: sphinx/directives/other.py:199
msgid "Author: "
msgstr "Autor:"
-#: sphinx/directives/other.py:317
+#: sphinx/directives/other.py:319
msgid "See also"
msgstr "Ver también"
-#: sphinx/ext/autodoc.py:883
+#: sphinx/ext/autodoc.py:889
#, python-format
msgid " Bases: %s"
msgstr ""
-#: sphinx/ext/autodoc.py:916
+#: sphinx/ext/autodoc.py:922
#, python-format
msgid "alias of :class:`%s`"
msgstr ""
@@ -436,40 +436,40 @@ msgstr "Ir a"
msgid "Enter search terms or a module, class or function name."
msgstr "Introducir en nombre de un módulo, clase o función"
-#: sphinx/themes/basic/layout.html:119
+#: sphinx/themes/basic/layout.html:122
#, python-format
msgid "Search within %(docstitle)s"
msgstr "Buscar en %(docstitle)s"
-#: sphinx/themes/basic/layout.html:128
+#: sphinx/themes/basic/layout.html:131
msgid "About these documents"
msgstr "Sobre este documento"
-#: sphinx/themes/basic/layout.html:134 sphinx/themes/basic/search.html:2
+#: sphinx/themes/basic/layout.html:137 sphinx/themes/basic/search.html:2
#: sphinx/themes/basic/search.html:5
msgid "Search"
msgstr "Búsqueda"
-#: sphinx/themes/basic/layout.html:137
+#: sphinx/themes/basic/layout.html:140
msgid "Copyright"
msgstr "Copyright"
-#: sphinx/themes/basic/layout.html:183
+#: sphinx/themes/basic/layout.html:187
#, python-format
msgid "&copy; <a href=\"%(path)s\">Copyright</a> %(copyright)s."
msgstr "&copy; <a href=\\\"%(path)s\\\">Copyright</a> %(copyright)s."
-#: sphinx/themes/basic/layout.html:185
+#: sphinx/themes/basic/layout.html:189
#, python-format
msgid "&copy; Copyright %(copyright)s."
msgstr "&copy; Copyright %(copyright)s."
-#: sphinx/themes/basic/layout.html:188
+#: sphinx/themes/basic/layout.html:193
#, python-format
msgid "Last updated on %(last_updated)s."
msgstr "Actualizado por última vez en %(last_updated)s."
-#: sphinx/themes/basic/layout.html:191
+#: sphinx/themes/basic/layout.html:196
#, python-format
msgid ""
"Created using <a href=\"http://sphinx.pocoo.org/\">Sphinx</a> "
@@ -511,7 +511,7 @@ msgid "search"
msgstr "buscar"
#: sphinx/themes/basic/search.html:25
-#: sphinx/themes/basic/static/searchtools.js:453
+#: sphinx/themes/basic/static/searchtools.js:462
msgid "Search Results"
msgstr "Resultados de la búsqueda"
@@ -569,16 +569,16 @@ msgstr "Buscando"
msgid "Preparing search..."
msgstr "Preparando la búsqueda"
-#: sphinx/themes/basic/static/searchtools.js:338
+#: sphinx/themes/basic/static/searchtools.js:347
#, fuzzy
msgid "module, in "
msgstr "módulo"
-#: sphinx/themes/basic/static/searchtools.js:347
+#: sphinx/themes/basic/static/searchtools.js:356
msgid ", in "
msgstr ""
-#: sphinx/themes/basic/static/searchtools.js:455
+#: sphinx/themes/basic/static/searchtools.js:464
msgid ""
"Your search did not match any documents. Please make sure that all words "
"are spelled correctly and that you've selected enough categories."
@@ -587,27 +587,27 @@ msgstr ""
"todas las palabras correctamente y que ha seleccionado suficientes "
"categorías"
-#: sphinx/themes/basic/static/searchtools.js:457
+#: sphinx/themes/basic/static/searchtools.js:466
#, python-format
msgid "Search finished, found %s page(s) matching the search query."
msgstr ""
"Búsqueda finalizada, se han encontrado %s página(s) que concuerdan con su"
" consulta"
-#: sphinx/writers/latex.py:185
+#: sphinx/writers/latex.py:187
#, fuzzy
msgid "Release"
msgstr "Versión"
-#: sphinx/writers/latex.py:571
+#: sphinx/writers/latex.py:578
msgid "Footnotes"
msgstr ""
-#: sphinx/writers/latex.py:639
+#: sphinx/writers/latex.py:646
msgid "continued from previous page"
msgstr ""
-#: sphinx/writers/latex.py:644
+#: sphinx/writers/latex.py:651
#, fuzzy
msgid "Continued on next page"
msgstr "Índice completo en una página"
diff --git a/sphinx/locale/fi/LC_MESSAGES/sphinx.js b/sphinx/locale/fi/LC_MESSAGES/sphinx.js
index f654e7e1..82f02c29 100644
--- a/sphinx/locale/fi/LC_MESSAGES/sphinx.js
+++ b/sphinx/locale/fi/LC_MESSAGES/sphinx.js
@@ -1 +1 @@
-Documentation.addTranslations({"locale": "fi", "plural_expr": "(n != 1)", "messages": {"module, in ": "", "Preparing search...": "Valmistellaan etsint\u00e4\u00e4...", "Your search did not match any documents. Please make sure that all words are spelled correctly and that you've selected enough categories.": "Ei l\u00f6ytynyt yht\u00e4\u00e4n. Tarkista hakuehdot, sanahaku, ei sen osia", "Search finished, found %s page(s) matching the search query.": "Etsint\u00e4 tehty, l\u00f6ydetty %s sivu(a).", ", in ": "", "Permalink to this headline": "", "Searching": "Etsit\u00e4\u00e4n", "Permalink to this definition": "", "Hide Search Matches": "Piilota l\u00f6ydetyt", "Search Results": "Etsinn\u00e4n tulos"}}); \ No newline at end of file
+Documentation.addTranslations({"locale": "fi", "plural_expr": "(n != 1)", "messages": {"Search Results": "Etsinn\u00e4n tulos", "Preparing search...": "Valmistellaan etsint\u00e4\u00e4...", "Your search did not match any documents. Please make sure that all words are spelled correctly and that you've selected enough categories.": "Ei l\u00f6ytynyt yht\u00e4\u00e4n. Tarkista hakuehdot, sanahaku, ei sen osia", "Search finished, found %s page(s) matching the search query.": "Etsint\u00e4 tehty, l\u00f6ydetty %s sivu(a).", ", in ": "", "Permalink to this headline": "", "Searching": "Etsit\u00e4\u00e4n", "Permalink to this definition": "", "module, in ": "", "Hide Search Matches": "Piilota l\u00f6ydetyt"}}); \ No newline at end of file
diff --git a/sphinx/locale/fi/LC_MESSAGES/sphinx.mo b/sphinx/locale/fi/LC_MESSAGES/sphinx.mo
index 44d19f8c..5e47dcba 100644
--- a/sphinx/locale/fi/LC_MESSAGES/sphinx.mo
+++ b/sphinx/locale/fi/LC_MESSAGES/sphinx.mo
Binary files differ
diff --git a/sphinx/locale/fi/LC_MESSAGES/sphinx.po b/sphinx/locale/fi/LC_MESSAGES/sphinx.po
index 922cb1f7..97cdace1 100644
--- a/sphinx/locale/fi/LC_MESSAGES/sphinx.po
+++ b/sphinx/locale/fi/LC_MESSAGES/sphinx.po
@@ -8,7 +8,7 @@ msgstr ""
"Project-Id-Version: Sphinx 0.6\n"
"Report-Msgid-Bugs-To: sphinx@awot.fi\n"
"POT-Creation-Date: 2009-01-24 18:39+0000\n"
-"PO-Revision-Date: 2009-08-06 22:48+0200\n"
+"PO-Revision-Date: 2009-08-06 23:04+0200\n"
"Last-Translator: Jukka Inkeri <sphinx@awot.fi>\n"
"Language-Team: fi <sphinx@awot.fi>\n"
"Plural-Forms: nplurals=2; plural=(n != 1)\n"
@@ -17,7 +17,7 @@ msgstr ""
"Content-Transfer-Encoding: 8bit\n"
"Generated-By: Babel 0.9.4\n"
-#: sphinx/environment.py:103 sphinx/writers/latex.py:182
+#: sphinx/environment.py:103 sphinx/writers/latex.py:184
#, python-format
msgid "%B %d, %Y"
msgstr "%d.%m.%Y"
@@ -26,12 +26,12 @@ msgstr "%d.%m.%Y"
#: sphinx/themes/basic/genindex-split.html:2
#: sphinx/themes/basic/genindex-split.html:5
#: sphinx/themes/basic/genindex.html:2 sphinx/themes/basic/genindex.html:5
-#: sphinx/themes/basic/genindex.html:48 sphinx/themes/basic/layout.html:131
-#: sphinx/writers/latex.py:188
+#: sphinx/themes/basic/genindex.html:48 sphinx/themes/basic/layout.html:134
+#: sphinx/writers/latex.py:190
msgid "Index"
msgstr "Sisällysluettelo"
-#: sphinx/environment.py:325 sphinx/writers/latex.py:187
+#: sphinx/environment.py:325 sphinx/writers/latex.py:189
msgid "Module Index"
msgstr "Moduuli sisällysluettelo"
@@ -57,34 +57,34 @@ msgstr ""
msgid "Module level"
msgstr "Moduulitaso"
-#: sphinx/builders/html.py:205
+#: sphinx/builders/html.py:222
#, python-format
msgid "%b %d, %Y"
msgstr "%d.%m.%Y"
-#: sphinx/builders/html.py:224 sphinx/themes/basic/defindex.html:21
+#: sphinx/builders/html.py:241 sphinx/themes/basic/defindex.html:21
msgid "General Index"
msgstr "Yleinen sisällysluettelo"
-#: sphinx/builders/html.py:224
+#: sphinx/builders/html.py:241
msgid "index"
msgstr "hakemisto"
-#: sphinx/builders/html.py:226 sphinx/builders/htmlhelp.py:219
+#: sphinx/builders/html.py:243 sphinx/builders/htmlhelp.py:219
#: sphinx/builders/qthelp.py:133 sphinx/themes/basic/defindex.html:19
#: sphinx/themes/basic/modindex.html:2 sphinx/themes/basic/modindex.html:13
msgid "Global Module Index"
msgstr "Yleinen moduulien sisällysluettelo"
-#: sphinx/builders/html.py:227
+#: sphinx/builders/html.py:244
msgid "modules"
msgstr "moduulit"
-#: sphinx/builders/html.py:281
+#: sphinx/builders/html.py:300
msgid "next"
msgstr ">"
-#: sphinx/builders/html.py:290
+#: sphinx/builders/html.py:309
msgid "previous"
msgstr "<"
@@ -207,37 +207,37 @@ msgstr ""
msgid "%scommand line option; %s"
msgstr ""
-#: sphinx/directives/other.py:138
+#: sphinx/directives/other.py:140
msgid "Platforms: "
msgstr "Ympäristö"
-#: sphinx/directives/other.py:144
+#: sphinx/directives/other.py:146
#, python-format
msgid "%s (module)"
msgstr "%s (moduuli)"
-#: sphinx/directives/other.py:193
+#: sphinx/directives/other.py:195
msgid "Section author: "
msgstr "Luvun kirjoittaja: "
-#: sphinx/directives/other.py:195
+#: sphinx/directives/other.py:197
msgid "Module author: "
msgstr "Moduulin kirjoittaja: "
-#: sphinx/directives/other.py:197
+#: sphinx/directives/other.py:199
msgid "Author: "
msgstr "Tekijä: "
-#: sphinx/directives/other.py:317
+#: sphinx/directives/other.py:319
msgid "See also"
msgstr "Katso myös"
-#: sphinx/ext/autodoc.py:883
+#: sphinx/ext/autodoc.py:889
#, python-format
msgid " Bases: %s"
msgstr ""
-#: sphinx/ext/autodoc.py:916
+#: sphinx/ext/autodoc.py:922
#, python-format
msgid "alias of :class:`%s`"
msgstr ""
@@ -430,40 +430,40 @@ msgstr "Siirry"
msgid "Enter search terms or a module, class or function name."
msgstr "Anna etsittävä termi tai moduuli, luokka tai funktio"
-#: sphinx/themes/basic/layout.html:119
+#: sphinx/themes/basic/layout.html:122
#, python-format
msgid "Search within %(docstitle)s"
msgstr ""
-#: sphinx/themes/basic/layout.html:128
+#: sphinx/themes/basic/layout.html:131
msgid "About these documents"
msgstr "Tietoja tästä documentistä"
-#: sphinx/themes/basic/layout.html:134 sphinx/themes/basic/search.html:2
+#: sphinx/themes/basic/layout.html:137 sphinx/themes/basic/search.html:2
#: sphinx/themes/basic/search.html:5
msgid "Search"
msgstr "Etsi"
-#: sphinx/themes/basic/layout.html:137
+#: sphinx/themes/basic/layout.html:140
msgid "Copyright"
msgstr ""
-#: sphinx/themes/basic/layout.html:183
+#: sphinx/themes/basic/layout.html:187
#, python-format
msgid "&copy; <a href=\"%(path)s\">Copyright</a> %(copyright)s."
msgstr ""
-#: sphinx/themes/basic/layout.html:185
+#: sphinx/themes/basic/layout.html:189
#, python-format
msgid "&copy; Copyright %(copyright)s."
msgstr ""
-#: sphinx/themes/basic/layout.html:188
+#: sphinx/themes/basic/layout.html:193
#, python-format
msgid "Last updated on %(last_updated)s."
msgstr ""
-#: sphinx/themes/basic/layout.html:191
+#: sphinx/themes/basic/layout.html:196
#, python-format
msgid ""
"Created using <a href=\"http://sphinx.pocoo.org/\">Sphinx</a> "
@@ -498,7 +498,7 @@ msgid "search"
msgstr "etsi"
#: sphinx/themes/basic/search.html:25
-#: sphinx/themes/basic/static/searchtools.js:453
+#: sphinx/themes/basic/static/searchtools.js:462
msgid "Search Results"
msgstr "Etsinnän tulos"
@@ -555,38 +555,38 @@ msgstr "Etsitään"
msgid "Preparing search..."
msgstr "Valmistellaan etsintää..."
-#: sphinx/themes/basic/static/searchtools.js:338
+#: sphinx/themes/basic/static/searchtools.js:347
msgid "module, in "
msgstr ""
-#: sphinx/themes/basic/static/searchtools.js:347
+#: sphinx/themes/basic/static/searchtools.js:356
msgid ", in "
msgstr ""
-#: sphinx/themes/basic/static/searchtools.js:455
+#: sphinx/themes/basic/static/searchtools.js:464
msgid ""
"Your search did not match any documents. Please make sure that all words "
"are spelled correctly and that you've selected enough categories."
msgstr "Ei löytynyt yhtään. Tarkista hakuehdot, sanahaku, ei sen osia"
-#: sphinx/themes/basic/static/searchtools.js:457
+#: sphinx/themes/basic/static/searchtools.js:466
#, python-format
msgid "Search finished, found %s page(s) matching the search query."
msgstr "Etsintä tehty, löydetty %s sivu(a)."
-#: sphinx/writers/latex.py:185
+#: sphinx/writers/latex.py:187
msgid "Release"
msgstr ""
-#: sphinx/writers/latex.py:571
+#: sphinx/writers/latex.py:578
msgid "Footnotes"
msgstr ""
-#: sphinx/writers/latex.py:639
+#: sphinx/writers/latex.py:646
msgid "continued from previous page"
msgstr ""
-#: sphinx/writers/latex.py:644
+#: sphinx/writers/latex.py:651
#, fuzzy
msgid "Continued on next page"
msgstr "Hakemisto yhtenä luettelona"
@@ -594,7 +594,7 @@ msgstr "Hakemisto yhtenä luettelona"
#: sphinx/writers/text.py:166
#, fuzzy, python-format
msgid "Platform: %s"
-msgstr "Ympäristö"
+msgstr "Ympäristö: %s"
#: sphinx/writers/text.py:428
msgid "[image]"
diff --git a/sphinx/locale/fr/LC_MESSAGES/sphinx.js b/sphinx/locale/fr/LC_MESSAGES/sphinx.js
index ebe9e351..430ad87b 100644
--- a/sphinx/locale/fr/LC_MESSAGES/sphinx.js
+++ b/sphinx/locale/fr/LC_MESSAGES/sphinx.js
@@ -1 +1 @@
-Documentation.addTranslations({"locale": "fr", "plural_expr": "(n > 1)", "messages": {"module, in ": "module, dans", "Preparing search...": "Pr\u00e9paration de la recherche...", "Your search did not match any documents. Please make sure that all words are spelled correctly and that you've selected enough categories.": "Votre recherche ne correspond \u00e0 aucun document. V\u00e9rifiez l'orthographe des termes de recherche et que vous avez s\u00e9lectionn\u00e9 suffisamment de cat\u00e9gories.", "Search finished, found %s page(s) matching the search query.": "La recherche est termin\u00e9e, %s page(s) correspond(ent) \u00e0 la requ\u00eate.", ", in ": ", dans", "Permalink to this headline": "Lien permanent vers ce titre", "Searching": "En cours de recherche", "Permalink to this definition": "Lien permanent vers cette d\u00e9finition", "Hide Search Matches": "Cacher les r\u00e9sultats de la recherche", "Search Results": "R\u00e9sultats de la recherche"}}); \ No newline at end of file
+Documentation.addTranslations({"locale": "fr", "plural_expr": "(n > 1)", "messages": {"Search Results": "R\u00e9sultats de la recherche", "Preparing search...": "Pr\u00e9paration de la recherche...", "Your search did not match any documents. Please make sure that all words are spelled correctly and that you've selected enough categories.": "Votre recherche ne correspond \u00e0 aucun document. V\u00e9rifiez l'orthographe des termes de recherche et que vous avez s\u00e9lectionn\u00e9 suffisamment de cat\u00e9gories.", "Search finished, found %s page(s) matching the search query.": "La recherche est termin\u00e9e, %s page(s) correspond(ent) \u00e0 la requ\u00eate.", ", in ": ", dans", "Permalink to this headline": "Lien permanent vers ce titre", "Searching": "En cours de recherche", "Permalink to this definition": "Lien permanent vers cette d\u00e9finition", "module, in ": "module, dans", "Hide Search Matches": "Cacher les r\u00e9sultats de la recherche"}}); \ No newline at end of file
diff --git a/sphinx/locale/fr/LC_MESSAGES/sphinx.mo b/sphinx/locale/fr/LC_MESSAGES/sphinx.mo
index fa97bbd1..d6c051de 100644
--- a/sphinx/locale/fr/LC_MESSAGES/sphinx.mo
+++ b/sphinx/locale/fr/LC_MESSAGES/sphinx.mo
Binary files differ
diff --git a/sphinx/locale/fr/LC_MESSAGES/sphinx.po b/sphinx/locale/fr/LC_MESSAGES/sphinx.po
index a8960ada..fb1f1984 100644
--- a/sphinx/locale/fr/LC_MESSAGES/sphinx.po
+++ b/sphinx/locale/fr/LC_MESSAGES/sphinx.po
@@ -9,7 +9,7 @@ msgstr ""
"Project-Id-Version: Sphinx 0.5\n"
"Report-Msgid-Bugs-To: larlet@gmail.com\n"
"POT-Creation-Date: 2008-08-08 12:39+0000\n"
-"PO-Revision-Date: 2009-08-06 22:48+0200\n"
+"PO-Revision-Date: 2009-08-06 23:04+0200\n"
"Last-Translator: Sébastien Douche <sdouche@gmail.com>\n"
"Language-Team: French Translation Team <sphinx-dev@googlegroups.com>\n"
"Plural-Forms: nplurals=2; plural=(n > 1)\n"
@@ -18,7 +18,7 @@ msgstr ""
"Content-Transfer-Encoding: 8bit\n"
"Generated-By: Babel 0.9.4\n"
-#: sphinx/environment.py:103 sphinx/writers/latex.py:182
+#: sphinx/environment.py:103 sphinx/writers/latex.py:184
#, python-format
msgid "%B %d, %Y"
msgstr "%d %B %Y"
@@ -27,12 +27,12 @@ msgstr "%d %B %Y"
#: sphinx/themes/basic/genindex-split.html:2
#: sphinx/themes/basic/genindex-split.html:5
#: sphinx/themes/basic/genindex.html:2 sphinx/themes/basic/genindex.html:5
-#: sphinx/themes/basic/genindex.html:48 sphinx/themes/basic/layout.html:131
-#: sphinx/writers/latex.py:188
+#: sphinx/themes/basic/genindex.html:48 sphinx/themes/basic/layout.html:134
+#: sphinx/writers/latex.py:190
msgid "Index"
msgstr "Index"
-#: sphinx/environment.py:325 sphinx/writers/latex.py:187
+#: sphinx/environment.py:325 sphinx/writers/latex.py:189
msgid "Module Index"
msgstr "Index du module"
@@ -58,34 +58,34 @@ msgstr "Fonctions de base"
msgid "Module level"
msgstr "Module"
-#: sphinx/builders/html.py:205
+#: sphinx/builders/html.py:222
#, python-format
msgid "%b %d, %Y"
msgstr "%d %b %Y"
-#: sphinx/builders/html.py:224 sphinx/themes/basic/defindex.html:21
+#: sphinx/builders/html.py:241 sphinx/themes/basic/defindex.html:21
msgid "General Index"
msgstr "Index général"
-#: sphinx/builders/html.py:224
+#: sphinx/builders/html.py:241
msgid "index"
msgstr "index"
-#: sphinx/builders/html.py:226 sphinx/builders/htmlhelp.py:219
+#: sphinx/builders/html.py:243 sphinx/builders/htmlhelp.py:219
#: sphinx/builders/qthelp.py:133 sphinx/themes/basic/defindex.html:19
#: sphinx/themes/basic/modindex.html:2 sphinx/themes/basic/modindex.html:13
msgid "Global Module Index"
msgstr "Index général des modules"
-#: sphinx/builders/html.py:227
+#: sphinx/builders/html.py:244
msgid "modules"
msgstr "modules"
-#: sphinx/builders/html.py:281
+#: sphinx/builders/html.py:300
msgid "next"
msgstr "suivant"
-#: sphinx/builders/html.py:290
+#: sphinx/builders/html.py:309
msgid "previous"
msgstr "précédent"
@@ -209,37 +209,37 @@ msgstr "%s (variable C)"
msgid "%scommand line option; %s"
msgstr "%soption de ligne de commande; %s"
-#: sphinx/directives/other.py:138
+#: sphinx/directives/other.py:140
msgid "Platforms: "
msgstr "Plateformes : "
-#: sphinx/directives/other.py:144
+#: sphinx/directives/other.py:146
#, python-format
msgid "%s (module)"
msgstr "%s (module)"
-#: sphinx/directives/other.py:193
+#: sphinx/directives/other.py:195
msgid "Section author: "
msgstr "Auteur de la section : "
-#: sphinx/directives/other.py:195
+#: sphinx/directives/other.py:197
msgid "Module author: "
msgstr "Auteur du module : "
-#: sphinx/directives/other.py:197
+#: sphinx/directives/other.py:199
msgid "Author: "
msgstr "Auteur : "
-#: sphinx/directives/other.py:317
+#: sphinx/directives/other.py:319
msgid "See also"
msgstr "Voir aussi"
-#: sphinx/ext/autodoc.py:883
+#: sphinx/ext/autodoc.py:889
#, python-format
msgid " Bases: %s"
msgstr ""
-#: sphinx/ext/autodoc.py:916
+#: sphinx/ext/autodoc.py:922
#, python-format
msgid "alias of :class:`%s`"
msgstr ""
@@ -433,40 +433,40 @@ msgstr "Go"
msgid "Enter search terms or a module, class or function name."
msgstr "Saisissez un nom de module, classe ou fonction."
-#: sphinx/themes/basic/layout.html:119
+#: sphinx/themes/basic/layout.html:122
#, python-format
msgid "Search within %(docstitle)s"
msgstr "Recherchez dans %(docstitle)s"
-#: sphinx/themes/basic/layout.html:128
+#: sphinx/themes/basic/layout.html:131
msgid "About these documents"
msgstr "À propos de ces documents"
-#: sphinx/themes/basic/layout.html:134 sphinx/themes/basic/search.html:2
+#: sphinx/themes/basic/layout.html:137 sphinx/themes/basic/search.html:2
#: sphinx/themes/basic/search.html:5
msgid "Search"
msgstr "Recherche"
-#: sphinx/themes/basic/layout.html:137
+#: sphinx/themes/basic/layout.html:140
msgid "Copyright"
msgstr "Copyright"
-#: sphinx/themes/basic/layout.html:183
+#: sphinx/themes/basic/layout.html:187
#, python-format
msgid "&copy; <a href=\"%(path)s\">Copyright</a> %(copyright)s."
msgstr "&copy; <a href=\"%(path)s\">Copyright</a> %(copyright)s."
-#: sphinx/themes/basic/layout.html:185
+#: sphinx/themes/basic/layout.html:189
#, python-format
msgid "&copy; Copyright %(copyright)s."
msgstr "&copy; Copyright %(copyright)s."
-#: sphinx/themes/basic/layout.html:188
+#: sphinx/themes/basic/layout.html:193
#, python-format
msgid "Last updated on %(last_updated)s."
msgstr "Mis à jour le %(last_updated)s."
-#: sphinx/themes/basic/layout.html:191
+#: sphinx/themes/basic/layout.html:196
#, python-format
msgid ""
"Created using <a href=\"http://sphinx.pocoo.org/\">Sphinx</a> "
@@ -511,7 +511,7 @@ msgid "search"
msgstr "rechercher"
#: sphinx/themes/basic/search.html:25
-#: sphinx/themes/basic/static/searchtools.js:453
+#: sphinx/themes/basic/static/searchtools.js:462
msgid "Search Results"
msgstr "Résultats de la recherche"
@@ -568,15 +568,15 @@ msgstr "En cours de recherche"
msgid "Preparing search..."
msgstr "Préparation de la recherche..."
-#: sphinx/themes/basic/static/searchtools.js:338
+#: sphinx/themes/basic/static/searchtools.js:347
msgid "module, in "
msgstr "module, dans"
-#: sphinx/themes/basic/static/searchtools.js:347
+#: sphinx/themes/basic/static/searchtools.js:356
msgid ", in "
msgstr ", dans"
-#: sphinx/themes/basic/static/searchtools.js:455
+#: sphinx/themes/basic/static/searchtools.js:464
msgid ""
"Your search did not match any documents. Please make sure that all words "
"are spelled correctly and that you've selected enough categories."
@@ -585,24 +585,24 @@ msgstr ""
"des termes de recherche et que vous avez sélectionné suffisamment de "
"catégories."
-#: sphinx/themes/basic/static/searchtools.js:457
+#: sphinx/themes/basic/static/searchtools.js:466
#, python-format
msgid "Search finished, found %s page(s) matching the search query."
msgstr "La recherche est terminée, %s page(s) correspond(ent) à la requête."
-#: sphinx/writers/latex.py:185
+#: sphinx/writers/latex.py:187
msgid "Release"
msgstr "Version"
-#: sphinx/writers/latex.py:571
+#: sphinx/writers/latex.py:578
msgid "Footnotes"
msgstr ""
-#: sphinx/writers/latex.py:639
+#: sphinx/writers/latex.py:646
msgid "continued from previous page"
msgstr ""
-#: sphinx/writers/latex.py:644
+#: sphinx/writers/latex.py:651
#, fuzzy
msgid "Continued on next page"
msgstr "Index complet sur une seule page"
diff --git a/sphinx/locale/it/LC_MESSAGES/sphinx.js b/sphinx/locale/it/LC_MESSAGES/sphinx.js
index 91a939a6..9120c41e 100644
--- a/sphinx/locale/it/LC_MESSAGES/sphinx.js
+++ b/sphinx/locale/it/LC_MESSAGES/sphinx.js
@@ -1 +1 @@
-Documentation.addTranslations({"locale": "it", "plural_expr": "(n != 1)", "messages": {"module, in ": "modulo, in", "Preparing search...": "Preparazione della ricerca", "Your search did not match any documents. Please make sure that all words are spelled correctly and that you've selected enough categories.": "La tua ricerca non ha trovato alcun risultato. Controlla la correttezza dei termini di ricerca e di avere selezionato un numero sufficiente di categorie", "Search finished, found %s page(s) matching the search query.": "Ricerca terminata, trovate %s pagine corrispondenti alla ricerca.", ", in ": ", in ", "Permalink to this headline": "link permanente per questa intestazione", "Searching": "Ricerca in corso", "Permalink to this definition": "link permanente per questa definizione", "Hide Search Matches": "Nascondi i risultati della ricerca", "Search Results": "Risultati della ricerca"}}); \ No newline at end of file
+Documentation.addTranslations({"locale": "it", "plural_expr": "(n != 1)", "messages": {"Search Results": "Risultati della ricerca", "Preparing search...": "Preparazione della ricerca", "Your search did not match any documents. Please make sure that all words are spelled correctly and that you've selected enough categories.": "La tua ricerca non ha trovato alcun risultato. Controlla la correttezza dei termini di ricerca e di avere selezionato un numero sufficiente di categorie", "Search finished, found %s page(s) matching the search query.": "Ricerca terminata, trovate %s pagine corrispondenti alla ricerca.", ", in ": ", in ", "Permalink to this headline": "link permanente per questa intestazione", "Searching": "Ricerca in corso", "Permalink to this definition": "link permanente per questa definizione", "module, in ": "modulo, in", "Hide Search Matches": "Nascondi i risultati della ricerca"}}); \ No newline at end of file
diff --git a/sphinx/locale/it/LC_MESSAGES/sphinx.mo b/sphinx/locale/it/LC_MESSAGES/sphinx.mo
index 0644a1b2..20e25ac7 100644
--- a/sphinx/locale/it/LC_MESSAGES/sphinx.mo
+++ b/sphinx/locale/it/LC_MESSAGES/sphinx.mo
Binary files differ
diff --git a/sphinx/locale/it/LC_MESSAGES/sphinx.po b/sphinx/locale/it/LC_MESSAGES/sphinx.po
index f0e981c9..ec240872 100644
--- a/sphinx/locale/it/LC_MESSAGES/sphinx.po
+++ b/sphinx/locale/it/LC_MESSAGES/sphinx.po
@@ -7,7 +7,7 @@ msgstr ""
"Project-Id-Version: Sphinx 0.5\n"
"Report-Msgid-Bugs-To: EMAIL@ADDRESS\n"
"POT-Creation-Date: 2008-11-27 18:39+0100\n"
-"PO-Revision-Date: 2009-08-06 22:48+0200\n"
+"PO-Revision-Date: 2009-08-06 23:04+0200\n"
"Last-Translator: Sandro Dentella <sandro@e-den.it>\n"
"Language-Team: <sphinx-dev@googlegroups.com>\n"
"Plural-Forms: nplurals=2; plural=(n != 1)\n"
@@ -16,7 +16,7 @@ msgstr ""
"Content-Transfer-Encoding: 8bit\n"
"Generated-By: Babel 0.9.4\n"
-#: sphinx/environment.py:103 sphinx/writers/latex.py:182
+#: sphinx/environment.py:103 sphinx/writers/latex.py:184
#, python-format
msgid "%B %d, %Y"
msgstr "%d %B %Y"
@@ -25,12 +25,12 @@ msgstr "%d %B %Y"
#: sphinx/themes/basic/genindex-split.html:2
#: sphinx/themes/basic/genindex-split.html:5
#: sphinx/themes/basic/genindex.html:2 sphinx/themes/basic/genindex.html:5
-#: sphinx/themes/basic/genindex.html:48 sphinx/themes/basic/layout.html:131
-#: sphinx/writers/latex.py:188
+#: sphinx/themes/basic/genindex.html:48 sphinx/themes/basic/layout.html:134
+#: sphinx/writers/latex.py:190
msgid "Index"
msgstr "Indice"
-#: sphinx/environment.py:325 sphinx/writers/latex.py:187
+#: sphinx/environment.py:325 sphinx/writers/latex.py:189
msgid "Module Index"
msgstr "Indice dei Moduli"
@@ -56,34 +56,34 @@ msgstr "Builtin"
msgid "Module level"
msgstr "Modulo"
-#: sphinx/builders/html.py:205
+#: sphinx/builders/html.py:222
#, python-format
msgid "%b %d, %Y"
msgstr "%d/%b/%Y"
-#: sphinx/builders/html.py:224 sphinx/themes/basic/defindex.html:21
+#: sphinx/builders/html.py:241 sphinx/themes/basic/defindex.html:21
msgid "General Index"
msgstr "Indice generale"
-#: sphinx/builders/html.py:224
+#: sphinx/builders/html.py:241
msgid "index"
msgstr "indice"
-#: sphinx/builders/html.py:226 sphinx/builders/htmlhelp.py:219
+#: sphinx/builders/html.py:243 sphinx/builders/htmlhelp.py:219
#: sphinx/builders/qthelp.py:133 sphinx/themes/basic/defindex.html:19
#: sphinx/themes/basic/modindex.html:2 sphinx/themes/basic/modindex.html:13
msgid "Global Module Index"
msgstr "Indice dei moduli"
-#: sphinx/builders/html.py:227
+#: sphinx/builders/html.py:244
msgid "modules"
msgstr "moduli"
-#: sphinx/builders/html.py:281
+#: sphinx/builders/html.py:300
msgid "next"
msgstr "successivo"
-#: sphinx/builders/html.py:290
+#: sphinx/builders/html.py:309
msgid "previous"
msgstr "precedente"
@@ -206,37 +206,37 @@ msgstr "%s (variabile C)"
msgid "%scommand line option; %s"
msgstr "%sopzione di linea di comando; %s"
-#: sphinx/directives/other.py:138
+#: sphinx/directives/other.py:140
msgid "Platforms: "
msgstr "Piattaforme:"
-#: sphinx/directives/other.py:144
+#: sphinx/directives/other.py:146
#, python-format
msgid "%s (module)"
msgstr "%s (modulo)"
-#: sphinx/directives/other.py:193
+#: sphinx/directives/other.py:195
msgid "Section author: "
msgstr "Autore della sezione"
-#: sphinx/directives/other.py:195
+#: sphinx/directives/other.py:197
msgid "Module author: "
msgstr "Autore del modulo"
-#: sphinx/directives/other.py:197
+#: sphinx/directives/other.py:199
msgid "Author: "
msgstr "Autore: "
-#: sphinx/directives/other.py:317
+#: sphinx/directives/other.py:319
msgid "See also"
msgstr "Vedi anche"
-#: sphinx/ext/autodoc.py:883
+#: sphinx/ext/autodoc.py:889
#, python-format
msgid " Bases: %s"
msgstr ""
-#: sphinx/ext/autodoc.py:916
+#: sphinx/ext/autodoc.py:922
#, python-format
msgid "alias of :class:`%s`"
msgstr "alias per :class:`%s`"
@@ -429,40 +429,40 @@ msgstr "Vai"
msgid "Enter search terms or a module, class or function name."
msgstr "Inserisci un termine di ricerca un modulo, classe o nome di funzione"
-#: sphinx/themes/basic/layout.html:119
+#: sphinx/themes/basic/layout.html:122
#, python-format
msgid "Search within %(docstitle)s"
msgstr "Cerca in %(docstitle)s"
-#: sphinx/themes/basic/layout.html:128
+#: sphinx/themes/basic/layout.html:131
msgid "About these documents"
msgstr "A proposito di questi documenti"
-#: sphinx/themes/basic/layout.html:134 sphinx/themes/basic/search.html:2
+#: sphinx/themes/basic/layout.html:137 sphinx/themes/basic/search.html:2
#: sphinx/themes/basic/search.html:5
msgid "Search"
msgstr "Cerca"
-#: sphinx/themes/basic/layout.html:137
+#: sphinx/themes/basic/layout.html:140
msgid "Copyright"
msgstr "Copyright"
-#: sphinx/themes/basic/layout.html:183
+#: sphinx/themes/basic/layout.html:187
#, python-format
msgid "&copy; <a href=\"%(path)s\">Copyright</a> %(copyright)s."
msgstr "&copy; <a href=\"%(path)s\">Copyright</a> %(copyright)s."
-#: sphinx/themes/basic/layout.html:185
+#: sphinx/themes/basic/layout.html:189
#, python-format
msgid "&copy; Copyright %(copyright)s."
msgstr "&copy; Copyright %(copyright)s."
-#: sphinx/themes/basic/layout.html:188
+#: sphinx/themes/basic/layout.html:193
#, python-format
msgid "Last updated on %(last_updated)s."
msgstr "Ultimo aggiornamento %(last_updated)s."
-#: sphinx/themes/basic/layout.html:191
+#: sphinx/themes/basic/layout.html:196
#, python-format
msgid ""
"Created using <a href=\"http://sphinx.pocoo.org/\">Sphinx</a> "
@@ -505,7 +505,7 @@ msgid "search"
msgstr "cerca"
#: sphinx/themes/basic/search.html:25
-#: sphinx/themes/basic/static/searchtools.js:453
+#: sphinx/themes/basic/static/searchtools.js:462
msgid "Search Results"
msgstr "Risultati della ricerca"
@@ -562,15 +562,15 @@ msgstr "Ricerca in corso"
msgid "Preparing search..."
msgstr "Preparazione della ricerca"
-#: sphinx/themes/basic/static/searchtools.js:338
+#: sphinx/themes/basic/static/searchtools.js:347
msgid "module, in "
msgstr "modulo, in"
-#: sphinx/themes/basic/static/searchtools.js:347
+#: sphinx/themes/basic/static/searchtools.js:356
msgid ", in "
msgstr ", in "
-#: sphinx/themes/basic/static/searchtools.js:455
+#: sphinx/themes/basic/static/searchtools.js:464
msgid ""
"Your search did not match any documents. Please make sure that all words "
"are spelled correctly and that you've selected enough categories."
@@ -579,24 +579,24 @@ msgstr ""
"dei termini di ricerca e di avere selezionato un numero sufficiente di "
"categorie"
-#: sphinx/themes/basic/static/searchtools.js:457
+#: sphinx/themes/basic/static/searchtools.js:466
#, python-format
msgid "Search finished, found %s page(s) matching the search query."
msgstr "Ricerca terminata, trovate %s pagine corrispondenti alla ricerca."
-#: sphinx/writers/latex.py:185
+#: sphinx/writers/latex.py:187
msgid "Release"
msgstr "Release"
-#: sphinx/writers/latex.py:571
+#: sphinx/writers/latex.py:578
msgid "Footnotes"
msgstr ""
-#: sphinx/writers/latex.py:639
+#: sphinx/writers/latex.py:646
msgid "continued from previous page"
msgstr ""
-#: sphinx/writers/latex.py:644
+#: sphinx/writers/latex.py:651
#, fuzzy
msgid "Continued on next page"
msgstr "Indice completo in una pagina"
diff --git a/sphinx/locale/ja/LC_MESSAGES/sphinx.js b/sphinx/locale/ja/LC_MESSAGES/sphinx.js
index c87bbc2b..5a0f9ac6 100644
--- a/sphinx/locale/ja/LC_MESSAGES/sphinx.js
+++ b/sphinx/locale/ja/LC_MESSAGES/sphinx.js
@@ -1 +1 @@
-Documentation.addTranslations({"locale": "ja", "plural_expr": "0", "messages": {"module, in ": "\u30e2\u30b8\u30e5\u30fc\u30eb", "Preparing search...": "\u691c\u7d22\u306e\u6e96\u5099\u4e2d...", "Your search did not match any documents. Please make sure that all words are spelled correctly and that you've selected enough categories.": "\u691c\u7d22\u6761\u4ef6\u306b\u4e00\u81f4\u3059\u308b\u30c9\u30ad\u30e5\u30e1\u30f3\u30c8\u306f\u3042\u308a\u307e\u305b\u3093\u3067\u3057\u305f\u3002\u691c\u7d22\u3057\u305f\u3044\u8a00\u8449\u3092\u6b63\u3057\u3044\u3064\u3065\u308a\u3067\u5165\u529b\u3057\u3066\u3044\u308b\u304b\u78ba\u8a8d\u3057\u3066\u304f\u3060\u3055\u3044\u3002\u307e\u305f\u3001\u6b63\u3057\u3044\u30ab\u30c6\u30b4\u30ea\u306e\u691c\u7d22\u3092\u884c\u3063\u3066\u3044\u308b\u304b\u78ba\u8a8d\u3057\u3066\u304f\u3060\u3055\u3044\u3002", "Search finished, found %s page(s) matching the search query.": "\u691c\u7d22\u304c\u7d42\u4e86\u3057\u3001\u6761\u4ef6\u306b\u4e00\u81f4\u3059\u308b\u30da\u30fc\u30b8\u304c %s \u500b\u307f\u3064\u304b\u308a\u307e\u3057\u305f\u3002", ", in ": "", "Permalink to this headline": "\u3053\u306e\u30d8\u30c3\u30c9\u30e9\u30a4\u30f3\u3078\u306e\u30d1\u30fc\u30de\u30ea\u30f3\u30af", "Searching": "\u691c\u7d22\u4e2d", "Permalink to this definition": "\u3053\u306e\u5b9a\u7fa9\u3078\u306e\u30d1\u30fc\u30de\u30ea\u30f3\u30af", "Hide Search Matches": "\u691c\u7d22\u7d50\u679c\u3092\u96a0\u3059", "Search Results": "\u691c\u7d22\u7d50\u679c"}}); \ No newline at end of file
+Documentation.addTranslations({"locale": "ja", "plural_expr": "0", "messages": {"Search Results": "\u691c\u7d22\u7d50\u679c", "Preparing search...": "\u691c\u7d22\u306e\u6e96\u5099\u4e2d...", "Your search did not match any documents. Please make sure that all words are spelled correctly and that you've selected enough categories.": "\u691c\u7d22\u6761\u4ef6\u306b\u4e00\u81f4\u3059\u308b\u30c9\u30ad\u30e5\u30e1\u30f3\u30c8\u306f\u3042\u308a\u307e\u305b\u3093\u3067\u3057\u305f\u3002\u691c\u7d22\u3057\u305f\u3044\u8a00\u8449\u3092\u6b63\u3057\u3044\u3064\u3065\u308a\u3067\u5165\u529b\u3057\u3066\u3044\u308b\u304b\u78ba\u8a8d\u3057\u3066\u304f\u3060\u3055\u3044\u3002\u307e\u305f\u3001\u6b63\u3057\u3044\u30ab\u30c6\u30b4\u30ea\u306e\u691c\u7d22\u3092\u884c\u3063\u3066\u3044\u308b\u304b\u78ba\u8a8d\u3057\u3066\u304f\u3060\u3055\u3044\u3002", "Search finished, found %s page(s) matching the search query.": "\u691c\u7d22\u304c\u7d42\u4e86\u3057\u3001\u6761\u4ef6\u306b\u4e00\u81f4\u3059\u308b\u30da\u30fc\u30b8\u304c %s \u500b\u307f\u3064\u304b\u308a\u307e\u3057\u305f\u3002", ", in ": "", "Permalink to this headline": "\u3053\u306e\u30d8\u30c3\u30c9\u30e9\u30a4\u30f3\u3078\u306e\u30d1\u30fc\u30de\u30ea\u30f3\u30af", "Searching": "\u691c\u7d22\u4e2d", "Permalink to this definition": "\u3053\u306e\u5b9a\u7fa9\u3078\u306e\u30d1\u30fc\u30de\u30ea\u30f3\u30af", "module, in ": "\u30e2\u30b8\u30e5\u30fc\u30eb", "Hide Search Matches": "\u691c\u7d22\u7d50\u679c\u3092\u96a0\u3059"}}); \ No newline at end of file
diff --git a/sphinx/locale/ja/LC_MESSAGES/sphinx.mo b/sphinx/locale/ja/LC_MESSAGES/sphinx.mo
index 7c0a169b..28f8ee0c 100644
--- a/sphinx/locale/ja/LC_MESSAGES/sphinx.mo
+++ b/sphinx/locale/ja/LC_MESSAGES/sphinx.mo
Binary files differ
diff --git a/sphinx/locale/ja/LC_MESSAGES/sphinx.po b/sphinx/locale/ja/LC_MESSAGES/sphinx.po
index afaedfdc..3b0ce0f0 100644
--- a/sphinx/locale/ja/LC_MESSAGES/sphinx.po
+++ b/sphinx/locale/ja/LC_MESSAGES/sphinx.po
@@ -8,7 +8,7 @@ msgstr ""
"Project-Id-Version: Sphinx 0.5\n"
"Report-Msgid-Bugs-To: EMAIL@ADDRESS\n"
"POT-Creation-Date: 2008-09-11 23:58+0200\n"
-"PO-Revision-Date: 2009-08-06 22:48+0200\n"
+"PO-Revision-Date: 2009-08-06 23:04+0200\n"
"Last-Translator: Yasushi MASUDA <whosaysni@gmail.com>\n"
"Language-Team: ja <LL@li.org>\n"
"Plural-Forms: nplurals=1; plural=0\n"
@@ -17,7 +17,7 @@ msgstr ""
"Content-Transfer-Encoding: 8bit\n"
"Generated-By: Babel 0.9.4\n"
-#: sphinx/environment.py:103 sphinx/writers/latex.py:182
+#: sphinx/environment.py:103 sphinx/writers/latex.py:184
#, python-format
msgid "%B %d, %Y"
msgstr "%Y 年 %m 月 %d 日"
@@ -26,12 +26,12 @@ msgstr "%Y 年 %m 月 %d 日"
#: sphinx/themes/basic/genindex-split.html:2
#: sphinx/themes/basic/genindex-split.html:5
#: sphinx/themes/basic/genindex.html:2 sphinx/themes/basic/genindex.html:5
-#: sphinx/themes/basic/genindex.html:48 sphinx/themes/basic/layout.html:131
-#: sphinx/writers/latex.py:188
+#: sphinx/themes/basic/genindex.html:48 sphinx/themes/basic/layout.html:134
+#: sphinx/writers/latex.py:190
msgid "Index"
msgstr "索引"
-#: sphinx/environment.py:325 sphinx/writers/latex.py:187
+#: sphinx/environment.py:325 sphinx/writers/latex.py:189
msgid "Module Index"
msgstr "モジュール索引"
@@ -57,34 +57,34 @@ msgstr "組み込み"
msgid "Module level"
msgstr "モジュールレベル"
-#: sphinx/builders/html.py:205
+#: sphinx/builders/html.py:222
#, python-format
msgid "%b %d, %Y"
msgstr "%Y 年 %m 月 %d 日"
-#: sphinx/builders/html.py:224 sphinx/themes/basic/defindex.html:21
+#: sphinx/builders/html.py:241 sphinx/themes/basic/defindex.html:21
msgid "General Index"
msgstr "総合索引"
-#: sphinx/builders/html.py:224
+#: sphinx/builders/html.py:241
msgid "index"
msgstr "索引"
-#: sphinx/builders/html.py:226 sphinx/builders/htmlhelp.py:219
+#: sphinx/builders/html.py:243 sphinx/builders/htmlhelp.py:219
#: sphinx/builders/qthelp.py:133 sphinx/themes/basic/defindex.html:19
#: sphinx/themes/basic/modindex.html:2 sphinx/themes/basic/modindex.html:13
msgid "Global Module Index"
msgstr "モジュール総索引"
-#: sphinx/builders/html.py:227
+#: sphinx/builders/html.py:244
msgid "modules"
msgstr "モジュール"
-#: sphinx/builders/html.py:281
+#: sphinx/builders/html.py:300
msgid "next"
msgstr "次へ"
-#: sphinx/builders/html.py:290
+#: sphinx/builders/html.py:309
msgid "previous"
msgstr "前へ"
@@ -208,37 +208,37 @@ msgstr "%s (C の変数)"
msgid "%scommand line option; %s"
msgstr "%sコマンドラインオプション; %s"
-#: sphinx/directives/other.py:138
+#: sphinx/directives/other.py:140
msgid "Platforms: "
msgstr "プラットフォーム: "
-#: sphinx/directives/other.py:144
+#: sphinx/directives/other.py:146
#, python-format
msgid "%s (module)"
msgstr "%s (モジュール)"
-#: sphinx/directives/other.py:193
+#: sphinx/directives/other.py:195
msgid "Section author: "
msgstr "この節の作者: "
-#: sphinx/directives/other.py:195
+#: sphinx/directives/other.py:197
msgid "Module author: "
msgstr "モジュールの作者: "
-#: sphinx/directives/other.py:197
+#: sphinx/directives/other.py:199
msgid "Author: "
msgstr "作者: "
-#: sphinx/directives/other.py:317
+#: sphinx/directives/other.py:319
msgid "See also"
msgstr "参考"
-#: sphinx/ext/autodoc.py:883
+#: sphinx/ext/autodoc.py:889
#, python-format
msgid " Bases: %s"
msgstr ""
-#: sphinx/ext/autodoc.py:916
+#: sphinx/ext/autodoc.py:922
#, python-format
msgid "alias of :class:`%s`"
msgstr ""
@@ -432,40 +432,40 @@ msgstr "検索"
msgid "Enter search terms or a module, class or function name."
msgstr "モジュール、クラス、または関数名を入力してください"
-#: sphinx/themes/basic/layout.html:119
+#: sphinx/themes/basic/layout.html:122
#, python-format
msgid "Search within %(docstitle)s"
msgstr "%(docstitle)s 内を検索"
-#: sphinx/themes/basic/layout.html:128
+#: sphinx/themes/basic/layout.html:131
msgid "About these documents"
msgstr "このドキュメントについて"
-#: sphinx/themes/basic/layout.html:134 sphinx/themes/basic/search.html:2
+#: sphinx/themes/basic/layout.html:137 sphinx/themes/basic/search.html:2
#: sphinx/themes/basic/search.html:5
msgid "Search"
msgstr "検索"
-#: sphinx/themes/basic/layout.html:137
+#: sphinx/themes/basic/layout.html:140
msgid "Copyright"
msgstr "著作権"
-#: sphinx/themes/basic/layout.html:183
+#: sphinx/themes/basic/layout.html:187
#, python-format
msgid "&copy; <a href=\"%(path)s\">Copyright</a> %(copyright)s."
msgstr "&copy; <a href=\"%(path)s\">Copyright</a> %(copyright)s."
-#: sphinx/themes/basic/layout.html:185
+#: sphinx/themes/basic/layout.html:189
#, python-format
msgid "&copy; Copyright %(copyright)s."
msgstr "&copy; Copyright %(copyright)s."
-#: sphinx/themes/basic/layout.html:188
+#: sphinx/themes/basic/layout.html:193
#, python-format
msgid "Last updated on %(last_updated)s."
msgstr "最終更新: %(last_updated)s"
-#: sphinx/themes/basic/layout.html:191
+#: sphinx/themes/basic/layout.html:196
#, python-format
msgid ""
"Created using <a href=\"http://sphinx.pocoo.org/\">Sphinx</a> "
@@ -503,7 +503,7 @@ msgid "search"
msgstr "検索"
#: sphinx/themes/basic/search.html:25
-#: sphinx/themes/basic/static/searchtools.js:453
+#: sphinx/themes/basic/static/searchtools.js:462
msgid "Search Results"
msgstr "検索結果"
@@ -560,39 +560,39 @@ msgstr "検索中"
msgid "Preparing search..."
msgstr "検索の準備中..."
-#: sphinx/themes/basic/static/searchtools.js:338
+#: sphinx/themes/basic/static/searchtools.js:347
#, fuzzy
msgid "module, in "
msgstr "モジュール"
-#: sphinx/themes/basic/static/searchtools.js:347
+#: sphinx/themes/basic/static/searchtools.js:356
msgid ", in "
msgstr ""
-#: sphinx/themes/basic/static/searchtools.js:455
+#: sphinx/themes/basic/static/searchtools.js:464
msgid ""
"Your search did not match any documents. Please make sure that all words "
"are spelled correctly and that you've selected enough categories."
msgstr "検索条件に一致するドキュメントはありませんでした。検索したい言葉を正しいつづりで入力しているか確認してください。また、正しいカテゴリの検索を行っているか確認してください。"
-#: sphinx/themes/basic/static/searchtools.js:457
+#: sphinx/themes/basic/static/searchtools.js:466
#, python-format
msgid "Search finished, found %s page(s) matching the search query."
msgstr "検索が終了し、条件に一致するページが %s 個みつかりました。"
-#: sphinx/writers/latex.py:185
+#: sphinx/writers/latex.py:187
msgid "Release"
msgstr "リリース"
-#: sphinx/writers/latex.py:571
+#: sphinx/writers/latex.py:578
msgid "Footnotes"
msgstr ""
-#: sphinx/writers/latex.py:639
+#: sphinx/writers/latex.py:646
msgid "continued from previous page"
msgstr ""
-#: sphinx/writers/latex.py:644
+#: sphinx/writers/latex.py:651
#, fuzzy
msgid "Continued on next page"
msgstr "総索引"
diff --git a/sphinx/locale/nl/LC_MESSAGES/sphinx.mo b/sphinx/locale/nl/LC_MESSAGES/sphinx.mo
index b9be8617..9d9dd4d4 100644
--- a/sphinx/locale/nl/LC_MESSAGES/sphinx.mo
+++ b/sphinx/locale/nl/LC_MESSAGES/sphinx.mo
Binary files differ
diff --git a/sphinx/locale/pl/LC_MESSAGES/sphinx.js b/sphinx/locale/pl/LC_MESSAGES/sphinx.js
index ce79a179..60e0f269 100644
--- a/sphinx/locale/pl/LC_MESSAGES/sphinx.js
+++ b/sphinx/locale/pl/LC_MESSAGES/sphinx.js
@@ -1 +1 @@
-Documentation.addTranslations({"locale": "pl", "plural_expr": "(n==1 ? 0 : n%10>=2 && n%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2)", "messages": {"module, in ": "modu\u0142", "Preparing search...": "Przygotowanie wyszukiwania...", "Your search did not match any documents. Please make sure that all words are spelled correctly and that you've selected enough categories.": "Nie znaleziono \u017cadnych pasuj\u0105cych dokument\u00f3w. Upewnij si\u0119, \u017ce wszystkie s\u0142owa s\u0105 poprawnie wpisane i \u017ce wybra\u0142e\u015b wystarczaj\u0105c\u0105liczb\u0119 kategorii.", "Search finished, found %s page(s) matching the search query.": "Przeszukiwanie zako\u0144czone, znaleziono %s pasuj\u0105cych stron.", ", in ": "", "Permalink to this headline": "Sta\u0142y odno\u015bnik do tego nag\u0142\u00f3wka", "Searching": "Wyszukiwanie", "Permalink to this definition": "Sta\u0142y odno\u015bnik do tej definicji", "Hide Search Matches": "Ukryj wyniki wyszukiwania", "Search Results": "Wyniki wyszukiwania"}}); \ No newline at end of file
+Documentation.addTranslations({"locale": "pl", "plural_expr": "(n==1 ? 0 : n%10>=2 && n%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2)", "messages": {"Search Results": "Wyniki wyszukiwania", "Preparing search...": "Przygotowanie wyszukiwania...", "Your search did not match any documents. Please make sure that all words are spelled correctly and that you've selected enough categories.": "Nie znaleziono \u017cadnych pasuj\u0105cych dokument\u00f3w. Upewnij si\u0119, \u017ce wszystkie s\u0142owa s\u0105 poprawnie wpisane i \u017ce wybra\u0142e\u015b wystarczaj\u0105c\u0105liczb\u0119 kategorii.", "Search finished, found %s page(s) matching the search query.": "Przeszukiwanie zako\u0144czone, znaleziono %s pasuj\u0105cych stron.", ", in ": ", w ", "Permalink to this headline": "Sta\u0142y odno\u015bnik do tego nag\u0142\u00f3wka", "Searching": "Wyszukiwanie", "Permalink to this definition": "Sta\u0142y odno\u015bnik do tej definicji", "module, in ": "modu\u0142, w ", "Hide Search Matches": "Ukryj wyniki wyszukiwania"}}); \ No newline at end of file
diff --git a/sphinx/locale/pl/LC_MESSAGES/sphinx.mo b/sphinx/locale/pl/LC_MESSAGES/sphinx.mo
index c53656a0..1d6fc6ce 100644
--- a/sphinx/locale/pl/LC_MESSAGES/sphinx.mo
+++ b/sphinx/locale/pl/LC_MESSAGES/sphinx.mo
Binary files differ
diff --git a/sphinx/locale/pl/LC_MESSAGES/sphinx.po b/sphinx/locale/pl/LC_MESSAGES/sphinx.po
index 350280b3..60638b1d 100644
--- a/sphinx/locale/pl/LC_MESSAGES/sphinx.po
+++ b/sphinx/locale/pl/LC_MESSAGES/sphinx.po
@@ -1,42 +1,47 @@
-
msgid ""
msgstr ""
"Project-Id-Version: Sphinx 0.5\n"
"Report-Msgid-Bugs-To: EMAIL@ADDRESS\n"
"POT-Creation-Date: 2008-08-10 11:43+0000\n"
-"PO-Revision-Date: 2009-08-06 22:48+0200\n"
+"PO-Revision-Date: 2009-09-07 10:28+0100\n"
"Last-Translator: Michał Kandulski <Michal.Kandulski@poczta.onet.pl>\n"
"Language-Team: \n"
-"Plural-Forms: nplurals=3; plural=(n==1 ? 0 : n%10>=2 && n%10<=4 && "
-"(n%100<10 || n%100>=20) ? 1 : 2)\n"
+"Plural-Forms: nplurals=3; plural=(n==1 ? 0 : n%10>=2 && n%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2)\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=utf-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Generated-By: Babel 0.9.4\n"
-#: sphinx/environment.py:103 sphinx/writers/latex.py:182
+#: sphinx/environment.py:103
+#: sphinx/writers/latex.py:184
#, python-format
msgid "%B %d, %Y"
msgstr "%B %d %Y"
-#: sphinx/environment.py:324 sphinx/themes/basic/genindex-single.html:2
+#: sphinx/environment.py:324
+#: sphinx/themes/basic/genindex-single.html:2
#: sphinx/themes/basic/genindex-split.html:2
#: sphinx/themes/basic/genindex-split.html:5
-#: sphinx/themes/basic/genindex.html:2 sphinx/themes/basic/genindex.html:5
-#: sphinx/themes/basic/genindex.html:48 sphinx/themes/basic/layout.html:131
-#: sphinx/writers/latex.py:188
+#: sphinx/themes/basic/genindex.html:2
+#: sphinx/themes/basic/genindex.html:5
+#: sphinx/themes/basic/genindex.html:48
+#: sphinx/themes/basic/layout.html:134
+#: sphinx/writers/latex.py:190
msgid "Index"
msgstr "Indeks"
-#: sphinx/environment.py:325 sphinx/writers/latex.py:187
+#: sphinx/environment.py:325
+#: sphinx/writers/latex.py:189
msgid "Module Index"
msgstr "Indeks modułów"
-#: sphinx/environment.py:326 sphinx/themes/basic/defindex.html:16
+#: sphinx/environment.py:326
+#: sphinx/themes/basic/defindex.html:16
msgid "Search Page"
msgstr "Wyszukiwanie"
-#: sphinx/roles.py:55 sphinx/directives/desc.py:747
+#: sphinx/roles.py:55
+#: sphinx/directives/desc.py:747
#, python-format
msgid "environment variable; %s"
msgstr "zmienna środowiskowa; %s"
@@ -54,40 +59,44 @@ msgstr "Wbudowane"
msgid "Module level"
msgstr "Poziom modułu"
-#: sphinx/builders/html.py:205
+#: sphinx/builders/html.py:222
#, python-format
msgid "%b %d, %Y"
msgstr "%b %d %Y"
-#: sphinx/builders/html.py:224 sphinx/themes/basic/defindex.html:21
+#: sphinx/builders/html.py:241
+#: sphinx/themes/basic/defindex.html:21
msgid "General Index"
msgstr "Indeks ogólny"
-#: sphinx/builders/html.py:224
+#: sphinx/builders/html.py:241
msgid "index"
msgstr "indeks"
-#: sphinx/builders/html.py:226 sphinx/builders/htmlhelp.py:219
-#: sphinx/builders/qthelp.py:133 sphinx/themes/basic/defindex.html:19
-#: sphinx/themes/basic/modindex.html:2 sphinx/themes/basic/modindex.html:13
+#: sphinx/builders/html.py:243
+#: sphinx/builders/htmlhelp.py:219
+#: sphinx/builders/qthelp.py:133
+#: sphinx/themes/basic/defindex.html:19
+#: sphinx/themes/basic/modindex.html:2
+#: sphinx/themes/basic/modindex.html:13
msgid "Global Module Index"
msgstr "Indeks modułów"
-#: sphinx/builders/html.py:227
+#: sphinx/builders/html.py:244
msgid "modules"
msgstr "moduły"
-#: sphinx/builders/html.py:281
+#: sphinx/builders/html.py:300
msgid "next"
msgstr "dalej"
-#: sphinx/builders/html.py:290
+#: sphinx/builders/html.py:309
msgid "previous"
msgstr "wstecz"
#: sphinx/builders/latex.py:162
msgid " (in "
-msgstr ""
+msgstr " (w "
#: sphinx/directives/desc.py:97
msgid "Raises"
@@ -106,9 +115,8 @@ msgid "Return type"
msgstr "Typ zwracany"
#: sphinx/directives/desc.py:186
-#, fuzzy
msgid "Parameter"
-msgstr "Parametry"
+msgstr "Parametr"
#: sphinx/directives/desc.py:190
msgid "Parameters"
@@ -119,7 +127,8 @@ msgstr "Parametry"
msgid "%s() (built-in function)"
msgstr "%s() (funkcja wbudowana)"
-#: sphinx/directives/desc.py:419 sphinx/directives/desc.py:476
+#: sphinx/directives/desc.py:419
+#: sphinx/directives/desc.py:476
#: sphinx/directives/desc.py:488
#, python-format
msgid "%s() (in module %s)"
@@ -130,15 +139,16 @@ msgstr "%s() (w module %s)"
msgid "%s (built-in variable)"
msgstr "%s (zmienna wbudowana)"
-#: sphinx/directives/desc.py:423 sphinx/directives/desc.py:514
+#: sphinx/directives/desc.py:423
+#: sphinx/directives/desc.py:514
#, python-format
msgid "%s (in module %s)"
msgstr "%s (w module %s)"
#: sphinx/directives/desc.py:439
-#, fuzzy, python-format
+#, python-format
msgid "%s (built-in class)"
-msgstr "%s (zmienna wbudowana)"
+msgstr "%s (klasa wbudowana)"
#: sphinx/directives/desc.py:440
#, python-format
@@ -201,57 +211,57 @@ msgid "%s (C variable)"
msgstr "%s (zmienna C)"
#: sphinx/directives/desc.py:665
-#, fuzzy, python-format
+#, python-format
msgid "%scommand line option; %s"
msgstr "%sopcja linii komend; %s"
-#: sphinx/directives/other.py:138
+#: sphinx/directives/other.py:140
msgid "Platforms: "
msgstr "Platformy: "
-#: sphinx/directives/other.py:144
+#: sphinx/directives/other.py:146
#, python-format
msgid "%s (module)"
msgstr "%s (moduł)"
-#: sphinx/directives/other.py:193
+#: sphinx/directives/other.py:195
msgid "Section author: "
msgstr "Autor rozdziału: "
-#: sphinx/directives/other.py:195
+#: sphinx/directives/other.py:197
msgid "Module author: "
msgstr "Autor modułu: "
-#: sphinx/directives/other.py:197
+#: sphinx/directives/other.py:199
msgid "Author: "
msgstr "Autor: "
-#: sphinx/directives/other.py:317
+#: sphinx/directives/other.py:319
msgid "See also"
msgstr "Zobacz także"
-#: sphinx/ext/autodoc.py:883
+#: sphinx/ext/autodoc.py:889
#, python-format
msgid " Bases: %s"
-msgstr ""
+msgstr " Klasy bazowe: %s"
-#: sphinx/ext/autodoc.py:916
+#: sphinx/ext/autodoc.py:922
#, python-format
msgid "alias of :class:`%s`"
-msgstr ""
+msgstr "alias klasy :class:`%s`"
#: sphinx/ext/todo.py:41
msgid "Todo"
-msgstr ""
+msgstr "Do zrobienia"
#: sphinx/ext/todo.py:99
#, python-format
msgid "(The original entry is located in %s, line %d and can be found "
-msgstr ""
+msgstr "(Oryginalny wpis znajduje się w pliku %s, w linii %d i może być odnaleziony "
#: sphinx/ext/todo.py:105
msgid "here"
-msgstr ""
+msgstr "tutaj"
#: sphinx/locale/__init__.py:15
msgid "Attention"
@@ -425,51 +435,47 @@ msgid "Go"
msgstr "Szukaj"
#: sphinx/themes/basic/layout.html:81
-#, fuzzy
msgid "Enter search terms or a module, class or function name."
-msgstr "Wprowadź nazwę modułu, klasy lub funkcji."
+msgstr "Wprowadź szukany termin lub nazwę modułu, klasy lub funkcji."
-#: sphinx/themes/basic/layout.html:119
+#: sphinx/themes/basic/layout.html:122
#, python-format
msgid "Search within %(docstitle)s"
msgstr "Szukaj pośród %(docstitle)s"
-#: sphinx/themes/basic/layout.html:128
+#: sphinx/themes/basic/layout.html:131
msgid "About these documents"
msgstr "O tych dokumentach"
-#: sphinx/themes/basic/layout.html:134 sphinx/themes/basic/search.html:2
+#: sphinx/themes/basic/layout.html:137
+#: sphinx/themes/basic/search.html:2
#: sphinx/themes/basic/search.html:5
msgid "Search"
msgstr "Szukaj"
-#: sphinx/themes/basic/layout.html:137
+#: sphinx/themes/basic/layout.html:140
msgid "Copyright"
msgstr "Copyright"
-#: sphinx/themes/basic/layout.html:183
+#: sphinx/themes/basic/layout.html:187
#, python-format
msgid "&copy; <a href=\"%(path)s\">Copyright</a> %(copyright)s."
msgstr "&copy; <a href=\"%(path)s\">Copyright</a> %(copyright)s."
-#: sphinx/themes/basic/layout.html:185
+#: sphinx/themes/basic/layout.html:189
#, python-format
msgid "&copy; Copyright %(copyright)s."
msgstr "&copy; Copyright %(copyright)s."
-#: sphinx/themes/basic/layout.html:188
+#: sphinx/themes/basic/layout.html:193
#, python-format
msgid "Last updated on %(last_updated)s."
msgstr "Ostatnia modyfikacja %(last_updated)s."
-#: sphinx/themes/basic/layout.html:191
+#: sphinx/themes/basic/layout.html:196
#, python-format
-msgid ""
-"Created using <a href=\"http://sphinx.pocoo.org/\">Sphinx</a> "
-"%(sphinx_version)s."
-msgstr ""
-"Utworzone przy pomocy <a href=\"http://sphinx.pocoo.org/\">Sphinx</a>'a "
-"%(sphinx_version)s."
+msgid "Created using <a href=\"http://sphinx.pocoo.org/\">Sphinx</a> %(sphinx_version)s."
+msgstr "Utworzone przy pomocy <a href=\"http://sphinx.pocoo.org/\">Sphinx</a>'a %(sphinx_version)s."
#: sphinx/themes/basic/modindex.html:36
msgid "Deprecated"
@@ -484,10 +490,9 @@ msgstr "Przeszukaj %(docstitle)s"
msgid ""
"Please activate JavaScript to enable the search\n"
" functionality."
-msgstr ""
+msgstr "Aby umożliwić wuszukiwanie, proszę włączyć JavaScript."
#: sphinx/themes/basic/search.html:14
-#, fuzzy
msgid ""
"From here you can search these documents. Enter your search\n"
" words into the box below and click \"search\". Note that the search\n"
@@ -496,16 +501,15 @@ msgid ""
msgstr ""
"Stąd możesz przeszukać dokumentację. Wprowadź szukane\n"
" słowa w poniższym okienku i kliknij \"Szukaj\". Zwróć uwagę, że\n"
-" funkcja szukająca będzie automatycznie szukała wszystkich słów. "
-"Strony nie zawierające wszystkich słów nie znajdą się na wynikowej "
-"liście."
+" funkcja szukająca będzie automatycznie szukała wszystkich słów. Strony\n"
+" nie zawierające wszystkich wpisanych słów nie znajdą się na wynikowej liście."
#: sphinx/themes/basic/search.html:21
msgid "search"
msgstr "Szukaj"
#: sphinx/themes/basic/search.html:25
-#: sphinx/themes/basic/static/searchtools.js:453
+#: sphinx/themes/basic/static/searchtools.js:462
msgid "Search Results"
msgstr "Wyniki wyszukiwania"
@@ -541,12 +545,14 @@ msgstr "Zmiany w C API"
msgid "Other changes"
msgstr "Inne zmiany"
-#: sphinx/themes/basic/static/doctools.js:139 sphinx/writers/html.py:473
+#: sphinx/themes/basic/static/doctools.js:139
+#: sphinx/writers/html.py:473
#: sphinx/writers/html.py:478
msgid "Permalink to this headline"
msgstr "Stały odnośnik do tego nagłówka"
-#: sphinx/themes/basic/static/doctools.js:145 sphinx/writers/html.py:80
+#: sphinx/themes/basic/static/doctools.js:145
+#: sphinx/writers/html.py:80
msgid "Permalink to this definition"
msgstr "Stały odnośnik do tej definicji"
@@ -562,44 +568,38 @@ msgstr "Wyszukiwanie"
msgid "Preparing search..."
msgstr "Przygotowanie wyszukiwania..."
-#: sphinx/themes/basic/static/searchtools.js:338
-#, fuzzy
+#: sphinx/themes/basic/static/searchtools.js:347
msgid "module, in "
-msgstr "moduł"
+msgstr "moduł, w "
-#: sphinx/themes/basic/static/searchtools.js:347
+#: sphinx/themes/basic/static/searchtools.js:356
msgid ", in "
-msgstr ""
+msgstr ", w "
-#: sphinx/themes/basic/static/searchtools.js:455
-msgid ""
-"Your search did not match any documents. Please make sure that all words "
-"are spelled correctly and that you've selected enough categories."
-msgstr ""
-"Nie znaleziono żadnych pasujących dokumentów. Upewnij się, że wszystkie "
-"słowa są poprawnie wpisane i że wybrałeś wystarczającąliczbę kategorii."
+#: sphinx/themes/basic/static/searchtools.js:464
+msgid "Your search did not match any documents. Please make sure that all words are spelled correctly and that you've selected enough categories."
+msgstr "Nie znaleziono żadnych pasujących dokumentów. Upewnij się, że wszystkie słowa są poprawnie wpisane i że wybrałeś wystarczającąliczbę kategorii."
-#: sphinx/themes/basic/static/searchtools.js:457
+#: sphinx/themes/basic/static/searchtools.js:466
#, python-format
msgid "Search finished, found %s page(s) matching the search query."
msgstr "Przeszukiwanie zakończone, znaleziono %s pasujących stron."
-#: sphinx/writers/latex.py:185
+#: sphinx/writers/latex.py:187
msgid "Release"
msgstr "Wydanie"
-#: sphinx/writers/latex.py:571
+#: sphinx/writers/latex.py:578
msgid "Footnotes"
-msgstr ""
+msgstr "Przypisy"
-#: sphinx/writers/latex.py:639
+#: sphinx/writers/latex.py:646
msgid "continued from previous page"
-msgstr ""
+msgstr "kontynuacja poprzedniej strony"
-#: sphinx/writers/latex.py:644
-#, fuzzy
+#: sphinx/writers/latex.py:651
msgid "Continued on next page"
-msgstr "Cały indeks na jednej stronie"
+msgstr "Kontynuacja na następnej stronie"
#: sphinx/writers/text.py:166
#, python-format
diff --git a/sphinx/locale/pt_BR/LC_MESSAGES/sphinx.js b/sphinx/locale/pt_BR/LC_MESSAGES/sphinx.js
index fb0fc93b..228dd96e 100644
--- a/sphinx/locale/pt_BR/LC_MESSAGES/sphinx.js
+++ b/sphinx/locale/pt_BR/LC_MESSAGES/sphinx.js
@@ -1 +1 @@
-Documentation.addTranslations({"locale": "pt_BR", "plural_expr": "(n > 1)", "messages": {"module, in ": "m\u00f3dulo, em ", "Preparing search...": "Preparando pesquisa...", "Your search did not match any documents. Please make sure that all words are spelled correctly and that you've selected enough categories.": "Sua pesquisa n\u00e3o encontrou nenhum documento. Por favor assegure-se de que todas as palavras foram digitadas corretamente e de que voc\u00ea tenha selecionado o m\u00ednimo de categorias.", "Search finished, found %s page(s) matching the search query.": "Pesquisa finalizada, foram encontrada(s) %s p\u00e1gina(s) que conferem com o crit\u00e9rio de pesquisa.", ", in ": ", em ", "Permalink to this headline": "Link permanente para este t\u00edtulo", "Searching": "Pesquisando", "Permalink to this definition": "Link permanente para esta defini\u00e7\u00e3o", "Hide Search Matches": "Esconder Resultados da Pesquisa", "Search Results": "Resultados da Pesquisa"}}); \ No newline at end of file
+Documentation.addTranslations({"locale": "pt_BR", "plural_expr": "(n > 1)", "messages": {"Search Results": "Resultados da Pesquisa", "Preparing search...": "Preparando pesquisa...", "Your search did not match any documents. Please make sure that all words are spelled correctly and that you've selected enough categories.": "Sua pesquisa n\u00e3o encontrou nenhum documento. Por favor assegure-se de que todas as palavras foram digitadas corretamente e de que voc\u00ea tenha selecionado o m\u00ednimo de categorias.", "Search finished, found %s page(s) matching the search query.": "Pesquisa finalizada, foram encontrada(s) %s p\u00e1gina(s) que conferem com o crit\u00e9rio de pesquisa.", ", in ": ", em ", "Permalink to this headline": "Link permanente para este t\u00edtulo", "Searching": "Pesquisando", "Permalink to this definition": "Link permanente para esta defini\u00e7\u00e3o", "module, in ": "m\u00f3dulo, em ", "Hide Search Matches": "Esconder Resultados da Pesquisa"}}); \ No newline at end of file
diff --git a/sphinx/locale/pt_BR/LC_MESSAGES/sphinx.mo b/sphinx/locale/pt_BR/LC_MESSAGES/sphinx.mo
index 5765c29f..84bd4e28 100644
--- a/sphinx/locale/pt_BR/LC_MESSAGES/sphinx.mo
+++ b/sphinx/locale/pt_BR/LC_MESSAGES/sphinx.mo
Binary files differ
diff --git a/sphinx/locale/pt_BR/LC_MESSAGES/sphinx.po b/sphinx/locale/pt_BR/LC_MESSAGES/sphinx.po
index 1d63841f..443967ed 100644
--- a/sphinx/locale/pt_BR/LC_MESSAGES/sphinx.po
+++ b/sphinx/locale/pt_BR/LC_MESSAGES/sphinx.po
@@ -8,7 +8,7 @@ msgstr ""
"Project-Id-Version: Sphinx 0.5\n"
"Report-Msgid-Bugs-To: roger.demetrescu@gmail.com\n"
"POT-Creation-Date: 2008-11-09 19:46+0100\n"
-"PO-Revision-Date: 2009-08-06 22:48+0200\n"
+"PO-Revision-Date: 2009-08-06 23:04+0200\n"
"Last-Translator: Roger Demetrescu <roger.demetrescu@gmail.com>\n"
"Language-Team: pt_BR <roger.demetrescu@gmail.com>\n"
"Plural-Forms: nplurals=2; plural=(n > 1)\n"
@@ -17,7 +17,7 @@ msgstr ""
"Content-Transfer-Encoding: 8bit\n"
"Generated-By: Babel 0.9.4\n"
-#: sphinx/environment.py:103 sphinx/writers/latex.py:182
+#: sphinx/environment.py:103 sphinx/writers/latex.py:184
#, python-format
msgid "%B %d, %Y"
msgstr "%d/%m/%Y"
@@ -26,12 +26,12 @@ msgstr "%d/%m/%Y"
#: sphinx/themes/basic/genindex-split.html:2
#: sphinx/themes/basic/genindex-split.html:5
#: sphinx/themes/basic/genindex.html:2 sphinx/themes/basic/genindex.html:5
-#: sphinx/themes/basic/genindex.html:48 sphinx/themes/basic/layout.html:131
-#: sphinx/writers/latex.py:188
+#: sphinx/themes/basic/genindex.html:48 sphinx/themes/basic/layout.html:134
+#: sphinx/writers/latex.py:190
msgid "Index"
msgstr "Índice"
-#: sphinx/environment.py:325 sphinx/writers/latex.py:187
+#: sphinx/environment.py:325 sphinx/writers/latex.py:189
msgid "Module Index"
msgstr "Índice do Módulo"
@@ -57,34 +57,34 @@ msgstr "Internos"
msgid "Module level"
msgstr "Módulo"
-#: sphinx/builders/html.py:205
+#: sphinx/builders/html.py:222
#, python-format
msgid "%b %d, %Y"
msgstr "%d/%m/%Y"
-#: sphinx/builders/html.py:224 sphinx/themes/basic/defindex.html:21
+#: sphinx/builders/html.py:241 sphinx/themes/basic/defindex.html:21
msgid "General Index"
msgstr "Índice Geral"
-#: sphinx/builders/html.py:224
+#: sphinx/builders/html.py:241
msgid "index"
msgstr "índice"
-#: sphinx/builders/html.py:226 sphinx/builders/htmlhelp.py:219
+#: sphinx/builders/html.py:243 sphinx/builders/htmlhelp.py:219
#: sphinx/builders/qthelp.py:133 sphinx/themes/basic/defindex.html:19
#: sphinx/themes/basic/modindex.html:2 sphinx/themes/basic/modindex.html:13
msgid "Global Module Index"
msgstr "Índice Global de Módulos"
-#: sphinx/builders/html.py:227
+#: sphinx/builders/html.py:244
msgid "modules"
msgstr "módulos"
-#: sphinx/builders/html.py:281
+#: sphinx/builders/html.py:300
msgid "next"
msgstr "próximo"
-#: sphinx/builders/html.py:290
+#: sphinx/builders/html.py:309
msgid "previous"
msgstr "anterior"
@@ -208,37 +208,37 @@ msgstr "%s (variável C)"
msgid "%scommand line option; %s"
msgstr "%sopção de linha de comando; %s"
-#: sphinx/directives/other.py:138
+#: sphinx/directives/other.py:140
msgid "Platforms: "
msgstr "Plataformas: "
-#: sphinx/directives/other.py:144
+#: sphinx/directives/other.py:146
#, python-format
msgid "%s (module)"
msgstr "%s (módulo)"
-#: sphinx/directives/other.py:193
+#: sphinx/directives/other.py:195
msgid "Section author: "
msgstr "Autor da seção: "
-#: sphinx/directives/other.py:195
+#: sphinx/directives/other.py:197
msgid "Module author: "
msgstr "Autor do módulo: "
-#: sphinx/directives/other.py:197
+#: sphinx/directives/other.py:199
msgid "Author: "
msgstr "Autor: "
-#: sphinx/directives/other.py:317
+#: sphinx/directives/other.py:319
msgid "See also"
msgstr "Veja também"
-#: sphinx/ext/autodoc.py:883
+#: sphinx/ext/autodoc.py:889
#, python-format
msgid " Bases: %s"
msgstr ""
-#: sphinx/ext/autodoc.py:916
+#: sphinx/ext/autodoc.py:922
#, python-format
msgid "alias of :class:`%s`"
msgstr ""
@@ -432,40 +432,40 @@ msgstr "Ir"
msgid "Enter search terms or a module, class or function name."
msgstr "Informe o nome de um módulo, classe ou função."
-#: sphinx/themes/basic/layout.html:119
+#: sphinx/themes/basic/layout.html:122
#, python-format
msgid "Search within %(docstitle)s"
msgstr "Pesquisar dentro de %(docstitle)s"
-#: sphinx/themes/basic/layout.html:128
+#: sphinx/themes/basic/layout.html:131
msgid "About these documents"
msgstr "Sobre estes documentos"
-#: sphinx/themes/basic/layout.html:134 sphinx/themes/basic/search.html:2
+#: sphinx/themes/basic/layout.html:137 sphinx/themes/basic/search.html:2
#: sphinx/themes/basic/search.html:5
msgid "Search"
msgstr "Pesquisar"
-#: sphinx/themes/basic/layout.html:137
+#: sphinx/themes/basic/layout.html:140
msgid "Copyright"
msgstr "Copyright"
-#: sphinx/themes/basic/layout.html:183
+#: sphinx/themes/basic/layout.html:187
#, python-format
msgid "&copy; <a href=\"%(path)s\">Copyright</a> %(copyright)s."
msgstr "&copy; <a href=\"%(path)s\">Copyright</a> %(copyright)s."
-#: sphinx/themes/basic/layout.html:185
+#: sphinx/themes/basic/layout.html:189
#, python-format
msgid "&copy; Copyright %(copyright)s."
msgstr "&copy; Copyright %(copyright)s."
-#: sphinx/themes/basic/layout.html:188
+#: sphinx/themes/basic/layout.html:193
#, python-format
msgid "Last updated on %(last_updated)s."
msgstr "Última atualização em %(last_updated)s."
-#: sphinx/themes/basic/layout.html:191
+#: sphinx/themes/basic/layout.html:196
#, python-format
msgid ""
"Created using <a href=\"http://sphinx.pocoo.org/\">Sphinx</a> "
@@ -509,7 +509,7 @@ msgid "search"
msgstr "pesquisar"
#: sphinx/themes/basic/search.html:25
-#: sphinx/themes/basic/static/searchtools.js:453
+#: sphinx/themes/basic/static/searchtools.js:462
msgid "Search Results"
msgstr "Resultados da Pesquisa"
@@ -566,15 +566,15 @@ msgstr "Pesquisando"
msgid "Preparing search..."
msgstr "Preparando pesquisa..."
-#: sphinx/themes/basic/static/searchtools.js:338
+#: sphinx/themes/basic/static/searchtools.js:347
msgid "module, in "
msgstr "módulo, em "
-#: sphinx/themes/basic/static/searchtools.js:347
+#: sphinx/themes/basic/static/searchtools.js:356
msgid ", in "
msgstr ", em "
-#: sphinx/themes/basic/static/searchtools.js:455
+#: sphinx/themes/basic/static/searchtools.js:464
msgid ""
"Your search did not match any documents. Please make sure that all words "
"are spelled correctly and that you've selected enough categories."
@@ -583,26 +583,26 @@ msgstr ""
" todas as palavras foram digitadas corretamente e de que você tenha "
"selecionado o mínimo de categorias."
-#: sphinx/themes/basic/static/searchtools.js:457
+#: sphinx/themes/basic/static/searchtools.js:466
#, python-format
msgid "Search finished, found %s page(s) matching the search query."
msgstr ""
"Pesquisa finalizada, foram encontrada(s) %s página(s) que conferem com o "
"critério de pesquisa."
-#: sphinx/writers/latex.py:185
+#: sphinx/writers/latex.py:187
msgid "Release"
msgstr "Versão"
-#: sphinx/writers/latex.py:571
+#: sphinx/writers/latex.py:578
msgid "Footnotes"
msgstr ""
-#: sphinx/writers/latex.py:639
+#: sphinx/writers/latex.py:646
msgid "continued from previous page"
msgstr ""
-#: sphinx/writers/latex.py:644
+#: sphinx/writers/latex.py:651
#, fuzzy
msgid "Continued on next page"
msgstr "Índice completo em uma página"
diff --git a/sphinx/locale/ru/LC_MESSAGES/sphinx.js b/sphinx/locale/ru/LC_MESSAGES/sphinx.js
index 70298427..8d72986b 100644
--- a/sphinx/locale/ru/LC_MESSAGES/sphinx.js
+++ b/sphinx/locale/ru/LC_MESSAGES/sphinx.js
@@ -1 +1 @@
-Documentation.addTranslations({"locale": "ru", "plural_expr": "n%10==1 && n%100!=11 ? 0 : n%10>=2 && n%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2", "messages": {"module, in ": ", \u043c\u043e\u0434\u0443\u043b\u044c \u0432 ", "Preparing search...": "\u041f\u043e\u0434\u0433\u043e\u0442\u043e\u0432\u043a\u0430 \u043a \u043f\u043e\u0438\u0441\u043a\u0443...", "Your search did not match any documents. Please make sure that all words are spelled correctly and that you've selected enough categories.": "\u041d\u0435\u0442 \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u043e\u0432, \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044e\u0449\u0438\u0445 \u0432\u0430\u0448\u0435\u043c\u0443 \u0437\u0430\u043f\u0440\u043e\u0441\u0443. \u041f\u0440\u043e\u0432\u0435\u0440\u044c\u0442\u0435, \u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u043e \u043b\u0438 \u0432\u044b\u0431\u0440\u0430\u043d\u044b \u043a\u0430\u0442\u0435\u0433\u043e\u0440\u0438\u0438 \u0438 \u043d\u0435\u0442 \u043b\u0438 \u043e\u043f\u0435\u0447\u0430\u0442\u043e\u043a \u0432 \u0437\u0430\u043f\u0440\u043e\u0441\u0435.", "Search finished, found %s page(s) matching the search query.": "\u041f\u043e\u0438\u0441\u043a \u043e\u043a\u043e\u043d\u0447\u0435\u043d, \u043d\u0430\u0439\u0434\u0435\u043d\u043e \u0441\u0442\u0440\u0430\u043d\u0438\u0446: %s.", ", in ": ", \u0432 ", "Permalink to this headline": "\u0421\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u044d\u0442\u043e\u0442 \u0437\u0430\u0433\u043e\u043b\u043e\u0432\u043e\u043a", "Searching": "\u041f\u043e\u0438\u0441\u043a", "Permalink to this definition": "\u0421\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u044d\u0442\u043e \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u0435", "Hide Search Matches": "\u0421\u043d\u044f\u0442\u044c \u0432\u044b\u0434\u0435\u043b\u0435\u043d\u0438\u0435", "Search Results": "\u0420\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u044b \u043f\u043e\u0438\u0441\u043a\u0430"}}); \ No newline at end of file
+Documentation.addTranslations({"locale": "ru", "plural_expr": "n%10==1 && n%100!=11 ? 0 : n%10>=2 && n%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2", "messages": {"Search Results": "\u0420\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u044b \u043f\u043e\u0438\u0441\u043a\u0430", "Preparing search...": "\u041f\u043e\u0434\u0433\u043e\u0442\u043e\u0432\u043a\u0430 \u043a \u043f\u043e\u0438\u0441\u043a\u0443...", "Your search did not match any documents. Please make sure that all words are spelled correctly and that you've selected enough categories.": "\u041d\u0435\u0442 \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u043e\u0432, \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044e\u0449\u0438\u0445 \u0432\u0430\u0448\u0435\u043c\u0443 \u0437\u0430\u043f\u0440\u043e\u0441\u0443. \u041f\u0440\u043e\u0432\u0435\u0440\u044c\u0442\u0435, \u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u043e \u043b\u0438 \u0432\u044b\u0431\u0440\u0430\u043d\u044b \u043a\u0430\u0442\u0435\u0433\u043e\u0440\u0438\u0438 \u0438 \u043d\u0435\u0442 \u043b\u0438 \u043e\u043f\u0435\u0447\u0430\u0442\u043e\u043a \u0432 \u0437\u0430\u043f\u0440\u043e\u0441\u0435.", "Search finished, found %s page(s) matching the search query.": "\u041f\u043e\u0438\u0441\u043a \u043e\u043a\u043e\u043d\u0447\u0435\u043d, \u043d\u0430\u0439\u0434\u0435\u043d\u043e \u0441\u0442\u0440\u0430\u043d\u0438\u0446: %s.", ", in ": ", \u0432 ", "Permalink to this headline": "\u0421\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u044d\u0442\u043e\u0442 \u0437\u0430\u0433\u043e\u043b\u043e\u0432\u043e\u043a", "Searching": "\u041f\u043e\u0438\u0441\u043a", "Permalink to this definition": "\u0421\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u044d\u0442\u043e \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u0435", "module, in ": ", \u043c\u043e\u0434\u0443\u043b\u044c \u0432 ", "Hide Search Matches": "\u0421\u043d\u044f\u0442\u044c \u0432\u044b\u0434\u0435\u043b\u0435\u043d\u0438\u0435"}}); \ No newline at end of file
diff --git a/sphinx/locale/ru/LC_MESSAGES/sphinx.mo b/sphinx/locale/ru/LC_MESSAGES/sphinx.mo
index 96f70851..ea2cd656 100644
--- a/sphinx/locale/ru/LC_MESSAGES/sphinx.mo
+++ b/sphinx/locale/ru/LC_MESSAGES/sphinx.mo
Binary files differ
diff --git a/sphinx/locale/ru/LC_MESSAGES/sphinx.po b/sphinx/locale/ru/LC_MESSAGES/sphinx.po
index cf466c7e..05594cc5 100644
--- a/sphinx/locale/ru/LC_MESSAGES/sphinx.po
+++ b/sphinx/locale/ru/LC_MESSAGES/sphinx.po
@@ -7,7 +7,7 @@ msgstr ""
"Project-Id-Version: Sphinx 0.6b1\n"
"Report-Msgid-Bugs-To: EMAIL@ADDRESS\n"
"POT-Creation-Date: 2009-01-24 18:39+0000\n"
-"PO-Revision-Date: 2009-08-06 22:48+0200\n"
+"PO-Revision-Date: 2009-08-06 23:04+0200\n"
"Last-Translator: alexander smishlajev <alex@tycobka.lv>\n"
"Language-Team: ru <LL@li.org>\n"
"Plural-Forms: nplurals=3; plural=n%10==1 && n%100!=11 ? 0 : n%10>=2 && "
@@ -17,7 +17,7 @@ msgstr ""
"Content-Transfer-Encoding: 8bit\n"
"Generated-By: Babel 0.9.4\n"
-#: sphinx/environment.py:103 sphinx/writers/latex.py:182
+#: sphinx/environment.py:103 sphinx/writers/latex.py:184
#, python-format
msgid "%B %d, %Y"
msgstr "%d %B %Y"
@@ -26,12 +26,12 @@ msgstr "%d %B %Y"
#: sphinx/themes/basic/genindex-split.html:2
#: sphinx/themes/basic/genindex-split.html:5
#: sphinx/themes/basic/genindex.html:2 sphinx/themes/basic/genindex.html:5
-#: sphinx/themes/basic/genindex.html:48 sphinx/themes/basic/layout.html:131
-#: sphinx/writers/latex.py:188
+#: sphinx/themes/basic/genindex.html:48 sphinx/themes/basic/layout.html:134
+#: sphinx/writers/latex.py:190
msgid "Index"
msgstr "Алфавитный указатель"
-#: sphinx/environment.py:325 sphinx/writers/latex.py:187
+#: sphinx/environment.py:325 sphinx/writers/latex.py:189
msgid "Module Index"
msgstr "Состав модуля"
@@ -57,34 +57,34 @@ msgstr "Встроенные функции"
msgid "Module level"
msgstr "Модуль"
-#: sphinx/builders/html.py:205
+#: sphinx/builders/html.py:222
#, python-format
msgid "%b %d, %Y"
msgstr "%d %b %Y"
-#: sphinx/builders/html.py:224 sphinx/themes/basic/defindex.html:21
+#: sphinx/builders/html.py:241 sphinx/themes/basic/defindex.html:21
msgid "General Index"
msgstr "Словарь-указатель"
-#: sphinx/builders/html.py:224
+#: sphinx/builders/html.py:241
msgid "index"
msgstr "словарь"
-#: sphinx/builders/html.py:226 sphinx/builders/htmlhelp.py:219
+#: sphinx/builders/html.py:243 sphinx/builders/htmlhelp.py:219
#: sphinx/builders/qthelp.py:133 sphinx/themes/basic/defindex.html:19
#: sphinx/themes/basic/modindex.html:2 sphinx/themes/basic/modindex.html:13
msgid "Global Module Index"
msgstr "Алфавитный указатель модулей"
-#: sphinx/builders/html.py:227
+#: sphinx/builders/html.py:244
msgid "modules"
msgstr "модули"
-#: sphinx/builders/html.py:281
+#: sphinx/builders/html.py:300
msgid "next"
msgstr "следующий"
-#: sphinx/builders/html.py:290
+#: sphinx/builders/html.py:309
msgid "previous"
msgstr "предыдущий"
@@ -207,37 +207,37 @@ msgstr "%s (переменная C)"
msgid "%scommand line option; %s"
msgstr "Опция командной строки %s; %s"
-#: sphinx/directives/other.py:138
+#: sphinx/directives/other.py:140
msgid "Platforms: "
msgstr "Платформы: "
-#: sphinx/directives/other.py:144
+#: sphinx/directives/other.py:146
#, python-format
msgid "%s (module)"
msgstr "%s (модуль)"
-#: sphinx/directives/other.py:193
+#: sphinx/directives/other.py:195
msgid "Section author: "
msgstr "Автор секции: "
-#: sphinx/directives/other.py:195
+#: sphinx/directives/other.py:197
msgid "Module author: "
msgstr "Автор модуля: "
-#: sphinx/directives/other.py:197
+#: sphinx/directives/other.py:199
msgid "Author: "
msgstr "Автор: "
-#: sphinx/directives/other.py:317
+#: sphinx/directives/other.py:319
msgid "See also"
msgstr "См.также"
-#: sphinx/ext/autodoc.py:883
+#: sphinx/ext/autodoc.py:889
#, python-format
msgid " Bases: %s"
msgstr " Базовые классы: %s"
-#: sphinx/ext/autodoc.py:916
+#: sphinx/ext/autodoc.py:922
#, python-format
msgid "alias of :class:`%s`"
msgstr "псевдоним класса :class:`%s`"
@@ -430,40 +430,40 @@ msgstr "Искать"
msgid "Enter search terms or a module, class or function name."
msgstr "Введите слова для поиска или имя модуля, класса или функции."
-#: sphinx/themes/basic/layout.html:119
+#: sphinx/themes/basic/layout.html:122
#, python-format
msgid "Search within %(docstitle)s"
msgstr "Поиск в документе «%(docstitle)s»"
-#: sphinx/themes/basic/layout.html:128
+#: sphinx/themes/basic/layout.html:131
msgid "About these documents"
msgstr "Об этих документах…"
-#: sphinx/themes/basic/layout.html:134 sphinx/themes/basic/search.html:2
+#: sphinx/themes/basic/layout.html:137 sphinx/themes/basic/search.html:2
#: sphinx/themes/basic/search.html:5
msgid "Search"
msgstr "Поиск"
-#: sphinx/themes/basic/layout.html:137
+#: sphinx/themes/basic/layout.html:140
msgid "Copyright"
msgstr "Copyright"
-#: sphinx/themes/basic/layout.html:183
+#: sphinx/themes/basic/layout.html:187
#, python-format
msgid "&copy; <a href=\"%(path)s\">Copyright</a> %(copyright)s."
msgstr "&copy; <a href=\"%(path)s\">Copyright</a> %(copyright)s."
-#: sphinx/themes/basic/layout.html:185
+#: sphinx/themes/basic/layout.html:189
#, python-format
msgid "&copy; Copyright %(copyright)s."
msgstr "&copy; Copyright %(copyright)s."
-#: sphinx/themes/basic/layout.html:188
+#: sphinx/themes/basic/layout.html:193
#, python-format
msgid "Last updated on %(last_updated)s."
msgstr "Дата последнего обновления: %(last_updated)s."
-#: sphinx/themes/basic/layout.html:191
+#: sphinx/themes/basic/layout.html:196
#, python-format
msgid ""
"Created using <a href=\"http://sphinx.pocoo.org/\">Sphinx</a> "
@@ -505,7 +505,7 @@ msgid "search"
msgstr "искать"
#: sphinx/themes/basic/search.html:25
-#: sphinx/themes/basic/static/searchtools.js:453
+#: sphinx/themes/basic/static/searchtools.js:462
msgid "Search Results"
msgstr "Результаты поиска"
@@ -562,15 +562,15 @@ msgstr "Поиск"
msgid "Preparing search..."
msgstr "Подготовка к поиску..."
-#: sphinx/themes/basic/static/searchtools.js:338
+#: sphinx/themes/basic/static/searchtools.js:347
msgid "module, in "
msgstr ", модуль в "
-#: sphinx/themes/basic/static/searchtools.js:347
+#: sphinx/themes/basic/static/searchtools.js:356
msgid ", in "
msgstr ", в "
-#: sphinx/themes/basic/static/searchtools.js:455
+#: sphinx/themes/basic/static/searchtools.js:464
msgid ""
"Your search did not match any documents. Please make sure that all words "
"are spelled correctly and that you've selected enough categories."
@@ -578,24 +578,24 @@ msgstr ""
"Нет документов, соответствующих вашему запросу. Проверьте, правильно ли "
"выбраны категории и нет ли опечаток в запросе."
-#: sphinx/themes/basic/static/searchtools.js:457
+#: sphinx/themes/basic/static/searchtools.js:466
#, python-format
msgid "Search finished, found %s page(s) matching the search query."
msgstr "Поиск окончен, найдено страниц: %s."
-#: sphinx/writers/latex.py:185
+#: sphinx/writers/latex.py:187
msgid "Release"
msgstr "Выпуск"
-#: sphinx/writers/latex.py:571
+#: sphinx/writers/latex.py:578
msgid "Footnotes"
msgstr ""
-#: sphinx/writers/latex.py:639
+#: sphinx/writers/latex.py:646
msgid "continued from previous page"
msgstr ""
-#: sphinx/writers/latex.py:644
+#: sphinx/writers/latex.py:651
#, fuzzy
msgid "Continued on next page"
msgstr "Полный алфавитный указатель на одной странице"
diff --git a/sphinx/locale/sl/LC_MESSAGES/sphinx.js b/sphinx/locale/sl/LC_MESSAGES/sphinx.js
index e00eb23b..a0936a57 100644
--- a/sphinx/locale/sl/LC_MESSAGES/sphinx.js
+++ b/sphinx/locale/sl/LC_MESSAGES/sphinx.js
@@ -1 +1 @@
-Documentation.addTranslations({"locale": "sl", "plural_expr": "0", "messages": {"module, in ": "modul, v ", "Preparing search...": "Pripravljam iskanje...", "Your search did not match any documents. Please make sure that all words are spelled correctly and that you've selected enough categories.": "Za va\u0161e iskanje ni rezultatov. Prosimo preglejte ali so vse besede pravilno \u010drkovane in ali ste izbrali dovolj kategorij.", "Search finished, found %s page(s) matching the search query.": "Iskanje kon\u010dano, najdeno %s strani, ki ustrezajo iskalnemu nizu.", ", in ": ", v ", "Permalink to this headline": "Povezava na naslov", "Searching": "I\u0161\u010dem", "Permalink to this definition": "Povezava na to definicijo", "Hide Search Matches": "Skrij Resultate Iskanja", "Search Results": "Rezultati Iskanja"}}); \ No newline at end of file
+Documentation.addTranslations({"locale": "sl", "plural_expr": "0", "messages": {"Search Results": "Rezultati Iskanja", "Preparing search...": "Pripravljam iskanje...", "Your search did not match any documents. Please make sure that all words are spelled correctly and that you've selected enough categories.": "Za va\u0161e iskanje ni rezultatov. Prosimo preglejte ali so vse besede pravilno \u010drkovane in ali ste izbrali dovolj kategorij.", "Search finished, found %s page(s) matching the search query.": "Iskanje kon\u010dano, najdeno %s strani, ki ustrezajo iskalnemu nizu.", ", in ": ", v ", "Permalink to this headline": "Povezava na naslov", "Searching": "I\u0161\u010dem", "Permalink to this definition": "Povezava na to definicijo", "module, in ": "modul, v ", "Hide Search Matches": "Skrij resultate iskanja"}}); \ No newline at end of file
diff --git a/sphinx/locale/sl/LC_MESSAGES/sphinx.mo b/sphinx/locale/sl/LC_MESSAGES/sphinx.mo
index e7d1e830..856c41e1 100644
--- a/sphinx/locale/sl/LC_MESSAGES/sphinx.mo
+++ b/sphinx/locale/sl/LC_MESSAGES/sphinx.mo
Binary files differ
diff --git a/sphinx/locale/sl/LC_MESSAGES/sphinx.po b/sphinx/locale/sl/LC_MESSAGES/sphinx.po
index cba48284..07fb84f1 100644
--- a/sphinx/locale/sl/LC_MESSAGES/sphinx.po
+++ b/sphinx/locale/sl/LC_MESSAGES/sphinx.po
@@ -4,8 +4,8 @@ msgstr ""
"Project-Id-Version: Sphinx\n"
"Report-Msgid-Bugs-To: EMAIL@ADDRESS\n"
"POT-Creation-Date: 2008-09-11 23:58+0200\n"
-"PO-Revision-Date: 2009-08-06 22:48+0200\n"
-"Last-Translator: Rok Garbas <rok.garbas@gmail.com>\n"
+"PO-Revision-Date: 2009-08-06 23:04+0200\n"
+"Last-Translator: Domen Kožar <domen@dev.si>\n"
"Language-Team: Rok Garbas <rok.garbas@gmail.com>\n"
"Plural-Forms: nplurals=1; plural=0\n"
"MIME-Version: 1.0\n"
@@ -13,7 +13,7 @@ msgstr ""
"Content-Transfer-Encoding: 8bit\n"
"Generated-By: Babel 0.9.4\n"
-#: sphinx/environment.py:103 sphinx/writers/latex.py:182
+#: sphinx/environment.py:103 sphinx/writers/latex.py:184
#, python-format
msgid "%B %d, %Y"
msgstr "%d %B, %Y"
@@ -22,23 +22,23 @@ msgstr "%d %B, %Y"
#: sphinx/themes/basic/genindex-split.html:2
#: sphinx/themes/basic/genindex-split.html:5
#: sphinx/themes/basic/genindex.html:2 sphinx/themes/basic/genindex.html:5
-#: sphinx/themes/basic/genindex.html:48 sphinx/themes/basic/layout.html:131
-#: sphinx/writers/latex.py:188
+#: sphinx/themes/basic/genindex.html:48 sphinx/themes/basic/layout.html:134
+#: sphinx/writers/latex.py:190
msgid "Index"
msgstr "Abecedni seznam"
-#: sphinx/environment.py:325 sphinx/writers/latex.py:187
+#: sphinx/environment.py:325 sphinx/writers/latex.py:189
msgid "Module Index"
msgstr "Seznam modulov"
#: sphinx/environment.py:326 sphinx/themes/basic/defindex.html:16
msgid "Search Page"
-msgstr "Iskalna stran"
+msgstr "Iskalnik"
#: sphinx/roles.py:55 sphinx/directives/desc.py:747
#, python-format
msgid "environment variable; %s"
-msgstr "globalna spremenljivka; %s"
+msgstr "okoljska spremenljivka; %s"
#: sphinx/roles.py:62
#, python-format
@@ -53,44 +53,44 @@ msgstr "Vgrajeni deli"
msgid "Module level"
msgstr "Nivo modula"
-#: sphinx/builders/html.py:205
+#: sphinx/builders/html.py:222
#, python-format
msgid "%b %d, %Y"
msgstr "%d %b, %Y"
-#: sphinx/builders/html.py:224 sphinx/themes/basic/defindex.html:21
+#: sphinx/builders/html.py:241 sphinx/themes/basic/defindex.html:21
msgid "General Index"
msgstr "Splošni abecedni seznam"
-#: sphinx/builders/html.py:224
+#: sphinx/builders/html.py:241
msgid "index"
msgstr "abecedni seznam"
-#: sphinx/builders/html.py:226 sphinx/builders/htmlhelp.py:219
+#: sphinx/builders/html.py:243 sphinx/builders/htmlhelp.py:219
#: sphinx/builders/qthelp.py:133 sphinx/themes/basic/defindex.html:19
#: sphinx/themes/basic/modindex.html:2 sphinx/themes/basic/modindex.html:13
msgid "Global Module Index"
-msgstr "Splošen Seznam Modulov"
+msgstr "Splošen seznam modulov"
-#: sphinx/builders/html.py:227
+#: sphinx/builders/html.py:244
msgid "modules"
msgstr "Moduli"
-#: sphinx/builders/html.py:281
+#: sphinx/builders/html.py:300
msgid "next"
msgstr "naprej"
-#: sphinx/builders/html.py:290
+#: sphinx/builders/html.py:309
msgid "previous"
msgstr "nazaj"
#: sphinx/builders/latex.py:162
msgid " (in "
-msgstr "(v "
+msgstr " (v "
#: sphinx/directives/desc.py:97
msgid "Raises"
-msgstr "Javi"
+msgstr "Sproži izjemo"
#: sphinx/directives/desc.py:101
msgid "Variable"
@@ -105,9 +105,8 @@ msgid "Return type"
msgstr "Vrne tip"
#: sphinx/directives/desc.py:186
-#, fuzzy
msgid "Parameter"
-msgstr "Parametri"
+msgstr "Parameter"
#: sphinx/directives/desc.py:190
msgid "Parameters"
@@ -202,51 +201,51 @@ msgstr "%s (C spremenljivka)"
#: sphinx/directives/desc.py:665
#, python-format
msgid "%scommand line option; %s"
-msgstr "%sopcija komandne linije; %s"
+msgstr "%scommand line parameter; %s"
-#: sphinx/directives/other.py:138
+#: sphinx/directives/other.py:140
msgid "Platforms: "
-msgstr "Platforma:"
+msgstr "Platforme:"
-#: sphinx/directives/other.py:144
+#: sphinx/directives/other.py:146
#, python-format
msgid "%s (module)"
msgstr "%s (modul)"
-#: sphinx/directives/other.py:193
+#: sphinx/directives/other.py:195
msgid "Section author: "
msgstr "Avtor sekcije:"
-#: sphinx/directives/other.py:195
+#: sphinx/directives/other.py:197
msgid "Module author: "
msgstr "Avtor modula:"
-#: sphinx/directives/other.py:197
+#: sphinx/directives/other.py:199
msgid "Author: "
msgstr "Avtor:"
-#: sphinx/directives/other.py:317
+#: sphinx/directives/other.py:319
msgid "See also"
-msgstr "Poglej tudi"
+msgstr "Poglej Tudi"
-#: sphinx/ext/autodoc.py:883
+#: sphinx/ext/autodoc.py:889
#, python-format
msgid " Bases: %s"
-msgstr ""
+msgstr " Osnove: %s"
-#: sphinx/ext/autodoc.py:916
+#: sphinx/ext/autodoc.py:922
#, python-format
msgid "alias of :class:`%s`"
-msgstr ""
+msgstr "vzdevek za :class:`%s`"
#: sphinx/ext/todo.py:41
msgid "Todo"
-msgstr "Naredi"
+msgstr "Todo"
#: sphinx/ext/todo.py:99
#, python-format
msgid "(The original entry is located in %s, line %d and can be found "
-msgstr "(Originalen vnos se nahajana v %s, vrstica %d in jo je moč poiskati "
+msgstr "(Originalen vnos se nahaja v %s, v vrstici %d, in ga je moč poiskati "
#: sphinx/ext/todo.py:105
msgid "here"
@@ -262,7 +261,7 @@ msgstr "Previdno"
#: sphinx/locale/__init__.py:17
msgid "Danger"
-msgstr "Navarno"
+msgstr "Nevarno"
#: sphinx/locale/__init__.py:18
msgid "Error"
@@ -300,7 +299,7 @@ msgstr "Novo v verziji %s"
#: sphinx/locale/__init__.py:29
#, python-format
msgid "Changed in version %s"
-msgstr "Spemenjeno v verziji %s"
+msgstr "Spremenjeno v verziji %s"
#: sphinx/locale/__init__.py:30
#, python-format
@@ -313,7 +312,7 @@ msgstr "modul"
#: sphinx/locale/__init__.py:35
msgid "keyword"
-msgstr "kllučna beseda"
+msgstr "ključna beseda"
#: sphinx/locale/__init__.py:36
msgid "operator"
@@ -341,7 +340,7 @@ msgstr "Pregled"
#: sphinx/themes/basic/defindex.html:11
msgid "Indices and tables:"
-msgstr "Kazalo in tabele:"
+msgstr "Kazalo in seznami:"
#: sphinx/themes/basic/defindex.html:14
msgid "Complete Table of Contents"
@@ -353,7 +352,7 @@ msgstr "prikazi vse sekcije in podsekcije"
#: sphinx/themes/basic/defindex.html:17
msgid "search this documentation"
-msgstr "isči po dokumentaciji"
+msgstr "išči po dokumentaciji"
#: sphinx/themes/basic/defindex.html:20
msgid "quick access to all modules"
@@ -361,7 +360,7 @@ msgstr "hiter dostop do vseh modulov"
#: sphinx/themes/basic/defindex.html:22
msgid "all functions, classes, terms"
-msgstr "vse funkcije, rezredi, termini"
+msgstr "vse funkcije, razredi, izrazi"
#: sphinx/themes/basic/genindex-single.html:5
#, python-format
@@ -409,7 +408,7 @@ msgstr "naslednje poglavje"
#: sphinx/themes/basic/layout.html:60
msgid "This Page"
-msgstr "Ta stran"
+msgstr "Trenutna stran"
#: sphinx/themes/basic/layout.html:63
msgid "Show Source"
@@ -424,44 +423,43 @@ msgid "Go"
msgstr "Potrdi"
#: sphinx/themes/basic/layout.html:81
-#, fuzzy
msgid "Enter search terms or a module, class or function name."
-msgstr "Vnesi ime mudla, razreda ali funkcije."
+msgstr "Vnesi ime modula, razreda ali funkcije."
-#: sphinx/themes/basic/layout.html:119
+#: sphinx/themes/basic/layout.html:122
#, python-format
msgid "Search within %(docstitle)s"
msgstr "Išči med %(docstitle)s"
-#: sphinx/themes/basic/layout.html:128
+#: sphinx/themes/basic/layout.html:131
msgid "About these documents"
-msgstr "O teh dokumentih"
+msgstr "O dokumentih"
-#: sphinx/themes/basic/layout.html:134 sphinx/themes/basic/search.html:2
+#: sphinx/themes/basic/layout.html:137 sphinx/themes/basic/search.html:2
#: sphinx/themes/basic/search.html:5
msgid "Search"
msgstr "Išči"
-#: sphinx/themes/basic/layout.html:137
+#: sphinx/themes/basic/layout.html:140
msgid "Copyright"
msgstr "Vse pravice pridržane"
-#: sphinx/themes/basic/layout.html:183
+#: sphinx/themes/basic/layout.html:187
#, python-format
msgid "&copy; <a href=\"%(path)s\">Copyright</a> %(copyright)s."
msgstr "&copy; <a href=\"%(path)s\">Vse pravice pridržane</a> %(copyright)s."
-#: sphinx/themes/basic/layout.html:185
+#: sphinx/themes/basic/layout.html:189
#, python-format
msgid "&copy; Copyright %(copyright)s."
msgstr "&copy; Vse pravice pridržane %(copyright)s."
-#: sphinx/themes/basic/layout.html:188
+#: sphinx/themes/basic/layout.html:193
#, python-format
msgid "Last updated on %(last_updated)s."
-msgstr "Zadnjič posodobljeno na %(last_updated)s."
+msgstr "Zadnjič posodobljeno %(last_updated)s."
-#: sphinx/themes/basic/layout.html:191
+#: sphinx/themes/basic/layout.html:196
#, python-format
msgid ""
"Created using <a href=\"http://sphinx.pocoo.org/\">Sphinx</a> "
@@ -484,16 +482,17 @@ msgid ""
"Please activate JavaScript to enable the search\n"
" functionality."
msgstr ""
+"Prosimo omogočite JavaScript\n"
+" za delovanje iskalnika."
#: sphinx/themes/basic/search.html:14
-#, fuzzy
msgid ""
"From here you can search these documents. Enter your search\n"
" words into the box below and click \"search\". Note that the search\n"
" function will automatically search for all of the words. Pages\n"
" containing fewer words won't appear in the result list."
msgstr ""
-"O tukaj lahko isčete dokumente. Vnesite iskalni\n"
+"Tukaj lahko iščete dokumente. Vnesite iskalni\n"
" niz v polje spodaj in pritisnite \"išči\". Sproženo iskanje\n"
" bo iskalo po vseh besedah v iskalnem nizu. Strani, ki ne\n"
" vsebujejo vseh besed ne bodo prikazane na seznamu rezultatov."
@@ -503,7 +502,7 @@ msgid "search"
msgstr "išči"
#: sphinx/themes/basic/search.html:25
-#: sphinx/themes/basic/static/searchtools.js:453
+#: sphinx/themes/basic/static/searchtools.js:462
msgid "Search Results"
msgstr "Rezultati Iskanja"
@@ -550,7 +549,7 @@ msgstr "Povezava na to definicijo"
#: sphinx/themes/basic/static/doctools.js:174
msgid "Hide Search Matches"
-msgstr "Skrij Resultate Iskanja"
+msgstr "Skrij resultate iskanja"
#: sphinx/themes/basic/static/searchtools.js:274
msgid "Searching"
@@ -560,15 +559,15 @@ msgstr "Iščem"
msgid "Preparing search..."
msgstr "Pripravljam iskanje..."
-#: sphinx/themes/basic/static/searchtools.js:338
+#: sphinx/themes/basic/static/searchtools.js:347
msgid "module, in "
msgstr "modul, v "
-#: sphinx/themes/basic/static/searchtools.js:347
+#: sphinx/themes/basic/static/searchtools.js:356
msgid ", in "
msgstr ", v "
-#: sphinx/themes/basic/static/searchtools.js:455
+#: sphinx/themes/basic/static/searchtools.js:464
msgid ""
"Your search did not match any documents. Please make sure that all words "
"are spelled correctly and that you've selected enough categories."
@@ -576,27 +575,26 @@ msgstr ""
"Za vaše iskanje ni rezultatov. Prosimo preglejte ali so vse besede "
"pravilno črkovane in ali ste izbrali dovolj kategorij."
-#: sphinx/themes/basic/static/searchtools.js:457
+#: sphinx/themes/basic/static/searchtools.js:466
#, python-format
msgid "Search finished, found %s page(s) matching the search query."
msgstr "Iskanje končano, najdeno %s strani, ki ustrezajo iskalnemu nizu."
-#: sphinx/writers/latex.py:185
+#: sphinx/writers/latex.py:187
msgid "Release"
msgstr "Izdaja"
-#: sphinx/writers/latex.py:571
+#: sphinx/writers/latex.py:578
msgid "Footnotes"
msgstr ""
-#: sphinx/writers/latex.py:639
+#: sphinx/writers/latex.py:646
msgid "continued from previous page"
-msgstr ""
+msgstr "nadaljevanje prejšnje strani"
-#: sphinx/writers/latex.py:644
-#, fuzzy
+#: sphinx/writers/latex.py:651
msgid "Continued on next page"
-msgstr "Poln indeks na eni strani"
+msgstr "Nadaljevanje na naslednji strani"
#: sphinx/writers/text.py:166
#, python-format
diff --git a/sphinx/locale/sphinx.pot b/sphinx/locale/sphinx.pot
index eff6e983..d6337cf7 100644
--- a/sphinx/locale/sphinx.pot
+++ b/sphinx/locale/sphinx.pot
@@ -6,9 +6,9 @@
#, fuzzy
msgid ""
msgstr ""
-"Project-Id-Version: Sphinx 0.6.2+/6b02a19ccf31\n"
+"Project-Id-Version: Sphinx 1.0\n"
"Report-Msgid-Bugs-To: EMAIL@ADDRESS\n"
-"POT-Creation-Date: 2009-08-06 22:48+0200\n"
+"POT-Creation-Date: 2009-08-06 23:04+0200\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
@@ -17,7 +17,7 @@ msgstr ""
"Content-Transfer-Encoding: 8bit\n"
"Generated-By: Babel 0.9.4\n"
-#: sphinx/environment.py:103 sphinx/writers/latex.py:182
+#: sphinx/environment.py:103 sphinx/writers/latex.py:184
#, python-format
msgid "%B %d, %Y"
msgstr ""
@@ -26,12 +26,12 @@ msgstr ""
#: sphinx/themes/basic/genindex-split.html:2
#: sphinx/themes/basic/genindex-split.html:5
#: sphinx/themes/basic/genindex.html:2 sphinx/themes/basic/genindex.html:5
-#: sphinx/themes/basic/genindex.html:48 sphinx/themes/basic/layout.html:131
-#: sphinx/writers/latex.py:188
+#: sphinx/themes/basic/genindex.html:48 sphinx/themes/basic/layout.html:134
+#: sphinx/writers/latex.py:190
msgid "Index"
msgstr ""
-#: sphinx/environment.py:325 sphinx/writers/latex.py:187
+#: sphinx/environment.py:325 sphinx/writers/latex.py:189
msgid "Module Index"
msgstr ""
@@ -57,34 +57,34 @@ msgstr ""
msgid "Module level"
msgstr ""
-#: sphinx/builders/html.py:205
+#: sphinx/builders/html.py:222
#, python-format
msgid "%b %d, %Y"
msgstr ""
-#: sphinx/builders/html.py:224 sphinx/themes/basic/defindex.html:21
+#: sphinx/builders/html.py:241 sphinx/themes/basic/defindex.html:21
msgid "General Index"
msgstr ""
-#: sphinx/builders/html.py:224
+#: sphinx/builders/html.py:241
msgid "index"
msgstr ""
-#: sphinx/builders/html.py:226 sphinx/builders/htmlhelp.py:219
+#: sphinx/builders/html.py:243 sphinx/builders/htmlhelp.py:219
#: sphinx/builders/qthelp.py:133 sphinx/themes/basic/defindex.html:19
#: sphinx/themes/basic/modindex.html:2 sphinx/themes/basic/modindex.html:13
msgid "Global Module Index"
msgstr ""
-#: sphinx/builders/html.py:227
+#: sphinx/builders/html.py:244
msgid "modules"
msgstr ""
-#: sphinx/builders/html.py:281
+#: sphinx/builders/html.py:300
msgid "next"
msgstr ""
-#: sphinx/builders/html.py:290
+#: sphinx/builders/html.py:309
msgid "previous"
msgstr ""
@@ -207,37 +207,37 @@ msgstr ""
msgid "%scommand line option; %s"
msgstr ""
-#: sphinx/directives/other.py:138
+#: sphinx/directives/other.py:140
msgid "Platforms: "
msgstr ""
-#: sphinx/directives/other.py:144
+#: sphinx/directives/other.py:146
#, python-format
msgid "%s (module)"
msgstr ""
-#: sphinx/directives/other.py:193
+#: sphinx/directives/other.py:195
msgid "Section author: "
msgstr ""
-#: sphinx/directives/other.py:195
+#: sphinx/directives/other.py:197
msgid "Module author: "
msgstr ""
-#: sphinx/directives/other.py:197
+#: sphinx/directives/other.py:199
msgid "Author: "
msgstr ""
-#: sphinx/directives/other.py:317
+#: sphinx/directives/other.py:319
msgid "See also"
msgstr ""
-#: sphinx/ext/autodoc.py:883
+#: sphinx/ext/autodoc.py:889
#, python-format
msgid " Bases: %s"
msgstr ""
-#: sphinx/ext/autodoc.py:916
+#: sphinx/ext/autodoc.py:922
#, python-format
msgid "alias of :class:`%s`"
msgstr ""
@@ -430,40 +430,40 @@ msgstr ""
msgid "Enter search terms or a module, class or function name."
msgstr ""
-#: sphinx/themes/basic/layout.html:119
+#: sphinx/themes/basic/layout.html:122
#, python-format
msgid "Search within %(docstitle)s"
msgstr ""
-#: sphinx/themes/basic/layout.html:128
+#: sphinx/themes/basic/layout.html:131
msgid "About these documents"
msgstr ""
-#: sphinx/themes/basic/layout.html:134 sphinx/themes/basic/search.html:2
+#: sphinx/themes/basic/layout.html:137 sphinx/themes/basic/search.html:2
#: sphinx/themes/basic/search.html:5
msgid "Search"
msgstr ""
-#: sphinx/themes/basic/layout.html:137
+#: sphinx/themes/basic/layout.html:140
msgid "Copyright"
msgstr ""
-#: sphinx/themes/basic/layout.html:183
+#: sphinx/themes/basic/layout.html:187
#, python-format
msgid "&copy; <a href=\"%(path)s\">Copyright</a> %(copyright)s."
msgstr ""
-#: sphinx/themes/basic/layout.html:185
+#: sphinx/themes/basic/layout.html:189
#, python-format
msgid "&copy; Copyright %(copyright)s."
msgstr ""
-#: sphinx/themes/basic/layout.html:188
+#: sphinx/themes/basic/layout.html:193
#, python-format
msgid "Last updated on %(last_updated)s."
msgstr ""
-#: sphinx/themes/basic/layout.html:191
+#: sphinx/themes/basic/layout.html:196
#, python-format
msgid ""
"Created using <a href=\"http://sphinx.pocoo.org/\">Sphinx</a> "
@@ -498,7 +498,7 @@ msgid "search"
msgstr ""
#: sphinx/themes/basic/search.html:25
-#: sphinx/themes/basic/static/searchtools.js:453
+#: sphinx/themes/basic/static/searchtools.js:462
msgid "Search Results"
msgstr ""
@@ -555,38 +555,38 @@ msgstr ""
msgid "Preparing search..."
msgstr ""
-#: sphinx/themes/basic/static/searchtools.js:338
+#: sphinx/themes/basic/static/searchtools.js:347
msgid "module, in "
msgstr ""
-#: sphinx/themes/basic/static/searchtools.js:347
+#: sphinx/themes/basic/static/searchtools.js:356
msgid ", in "
msgstr ""
-#: sphinx/themes/basic/static/searchtools.js:455
+#: sphinx/themes/basic/static/searchtools.js:464
msgid ""
"Your search did not match any documents. Please make sure that all words "
"are spelled correctly and that you've selected enough categories."
msgstr ""
-#: sphinx/themes/basic/static/searchtools.js:457
+#: sphinx/themes/basic/static/searchtools.js:466
#, python-format
msgid "Search finished, found %s page(s) matching the search query."
msgstr ""
-#: sphinx/writers/latex.py:185
+#: sphinx/writers/latex.py:187
msgid "Release"
msgstr ""
-#: sphinx/writers/latex.py:571
+#: sphinx/writers/latex.py:578
msgid "Footnotes"
msgstr ""
-#: sphinx/writers/latex.py:639
+#: sphinx/writers/latex.py:646
msgid "continued from previous page"
msgstr ""
-#: sphinx/writers/latex.py:644
+#: sphinx/writers/latex.py:651
msgid "Continued on next page"
msgstr ""
diff --git a/sphinx/locale/uk_UA/LC_MESSAGES/sphinx.js b/sphinx/locale/uk_UA/LC_MESSAGES/sphinx.js
index d1089bf1..061ecb58 100644
--- a/sphinx/locale/uk_UA/LC_MESSAGES/sphinx.js
+++ b/sphinx/locale/uk_UA/LC_MESSAGES/sphinx.js
@@ -1 +1 @@
-Documentation.addTranslations({"locale": "uk_UA", "plural_expr": "(n%10==1 && n%100!=11 ? 0 : n%10>=2 && n%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2)", "messages": {"module, in ": "\u043c\u043e\u0434\u0443\u043b\u044c, \u0432 ", "Preparing search...": "\u041f\u0456\u0434\u0433\u043e\u0442\u043e\u0432\u043a\u0430 \u0434\u043e \u043f\u043e\u0448\u0443\u043a\u0443...", "Your search did not match any documents. Please make sure that all words are spelled correctly and that you've selected enough categories.": "\u0412\u0430\u0448 \u043f\u043e\u0448\u0443\u043a \u043d\u0435 \u0432\u0438\u044f\u0432\u0438\u0432 \u0436\u043e\u0434\u043d\u043e\u0433\u043e \u0441\u043f\u0456\u0432\u043f\u0430\u0434\u0456\u043d\u043d\u044f. \u0411\u0443\u0434\u044c-\u043b\u0430\u0441\u043a\u0430 \u043f\u0435\u0440\u0435\u043a\u043e\u043d\u0430\u0439\u0442\u0435\u0441\u044f \u0449\u043e \u0432\u0441\u0456 \u0441\u043b\u043e\u0432\u0430 \u043d\u0430\u0431\u0440\u0430\u043d\u0456 \u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u043e \u0456 \u0432\u0438 \u043e\u0431\u0440\u0430\u043b\u0438 \u0434\u043e\u0441\u0442\u0430\u0442\u043d\u044c\u043e \u043a\u0430\u0442\u0435\u0433\u043e\u0440\u0456\u0439.", "Search finished, found %s page(s) matching the search query.": "\u041f\u043e\u0448\u0443\u043a \u0437\u0430\u043a\u0456\u043d\u0447\u0435\u043d\u043e, \u0437\u043d\u0430\u0439\u0434\u0435\u043d\u043e %s \u0441\u0442\u043e\u0440\u0456\u043d\u043e\u043a \u044f\u043a\u0456 \u0441\u043f\u0456\u0432\u043f\u0430\u043b\u0438 \u0437 \u043f\u043e\u0448\u0443\u043a\u043e\u0432\u0438\u043c \u0437\u0430\u043f\u0438\u0442\u043e\u043c.", ", in ": ", \u0432 ", "Permalink to this headline": "\u041f\u043e\u0441\u0442\u0456\u0439\u043d\u0435 \u043f\u043e\u0441\u0438\u043b\u0430\u043d\u043d\u044f \u043d\u0430 \u0446\u0435\u0439 \u0437\u0430\u0433\u043e\u043b\u043e\u0432\u043e\u043a", "Searching": "\u0428\u0443\u043a\u0430\u044e", "Permalink to this definition": "\u041f\u043e\u0441\u0442\u0456\u0439\u043d\u0435 \u043f\u043e\u0441\u0438\u043b\u0430\u043d\u043d\u044f \u043d\u0430 \u0446\u0435 \u0432\u0438\u0437\u043d\u0430\u0447\u0435\u043d\u043d\u044f", "Hide Search Matches": "\u041f\u0440\u0438\u0445\u043e\u0432\u0430\u0442\u0438 \u0441\u043f\u0456\u0432\u043f\u0430\u0434\u0456\u043d\u043d\u044f \u043f\u043e\u0448\u0443\u043a\u0443", "Search Results": "\u0420\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u0438 \u043f\u043e\u0448\u0443\u043a\u0443"}}); \ No newline at end of file
+Documentation.addTranslations({"locale": "uk_UA", "plural_expr": "(n%10==1 && n%100!=11 ? 0 : n%10>=2 && n%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2)", "messages": {"Search Results": "\u0420\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u0438 \u043f\u043e\u0448\u0443\u043a\u0443", "Preparing search...": "\u041f\u0456\u0434\u0433\u043e\u0442\u043e\u0432\u043a\u0430 \u0434\u043e \u043f\u043e\u0448\u0443\u043a\u0443...", "Your search did not match any documents. Please make sure that all words are spelled correctly and that you've selected enough categories.": "\u0412\u0430\u0448 \u043f\u043e\u0448\u0443\u043a \u043d\u0435 \u0432\u0438\u044f\u0432\u0438\u0432 \u0436\u043e\u0434\u043d\u043e\u0433\u043e \u0441\u043f\u0456\u0432\u043f\u0430\u0434\u0456\u043d\u043d\u044f. \u0411\u0443\u0434\u044c-\u043b\u0430\u0441\u043a\u0430 \u043f\u0435\u0440\u0435\u043a\u043e\u043d\u0430\u0439\u0442\u0435\u0441\u044f \u0449\u043e \u0432\u0441\u0456 \u0441\u043b\u043e\u0432\u0430 \u043d\u0430\u0431\u0440\u0430\u043d\u0456 \u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u043e \u0456 \u0432\u0438 \u043e\u0431\u0440\u0430\u043b\u0438 \u0434\u043e\u0441\u0442\u0430\u0442\u043d\u044c\u043e \u043a\u0430\u0442\u0435\u0433\u043e\u0440\u0456\u0439.", "Search finished, found %s page(s) matching the search query.": "\u041f\u043e\u0448\u0443\u043a \u0437\u0430\u043a\u0456\u043d\u0447\u0435\u043d\u043e, \u0437\u043d\u0430\u0439\u0434\u0435\u043d\u043e %s \u0441\u0442\u043e\u0440\u0456\u043d\u043e\u043a \u044f\u043a\u0456 \u0441\u043f\u0456\u0432\u043f\u0430\u043b\u0438 \u0437 \u043f\u043e\u0448\u0443\u043a\u043e\u0432\u0438\u043c \u0437\u0430\u043f\u0438\u0442\u043e\u043c.", ", in ": ", \u0432 ", "Permalink to this headline": "\u041f\u043e\u0441\u0442\u0456\u0439\u043d\u0435 \u043f\u043e\u0441\u0438\u043b\u0430\u043d\u043d\u044f \u043d\u0430 \u0446\u0435\u0439 \u0437\u0430\u0433\u043e\u043b\u043e\u0432\u043e\u043a", "Searching": "\u0428\u0443\u043a\u0430\u044e", "Permalink to this definition": "\u041f\u043e\u0441\u0442\u0456\u0439\u043d\u0435 \u043f\u043e\u0441\u0438\u043b\u0430\u043d\u043d\u044f \u043d\u0430 \u0446\u0435 \u0432\u0438\u0437\u043d\u0430\u0447\u0435\u043d\u043d\u044f", "module, in ": "\u043c\u043e\u0434\u0443\u043b\u044c, \u0432 ", "Hide Search Matches": "\u041f\u0440\u0438\u0445\u043e\u0432\u0430\u0442\u0438 \u0441\u043f\u0456\u0432\u043f\u0430\u0434\u0456\u043d\u043d\u044f \u043f\u043e\u0448\u0443\u043a\u0443"}}); \ No newline at end of file
diff --git a/sphinx/locale/uk_UA/LC_MESSAGES/sphinx.mo b/sphinx/locale/uk_UA/LC_MESSAGES/sphinx.mo
index 3c0eb4b3..c85724e4 100644
--- a/sphinx/locale/uk_UA/LC_MESSAGES/sphinx.mo
+++ b/sphinx/locale/uk_UA/LC_MESSAGES/sphinx.mo
Binary files differ
diff --git a/sphinx/locale/uk_UA/LC_MESSAGES/sphinx.po b/sphinx/locale/uk_UA/LC_MESSAGES/sphinx.po
index 75c933a2..16f6f022 100644
--- a/sphinx/locale/uk_UA/LC_MESSAGES/sphinx.po
+++ b/sphinx/locale/uk_UA/LC_MESSAGES/sphinx.po
@@ -8,7 +8,7 @@ msgstr ""
"Project-Id-Version: Sphinx 0.6\n"
"Report-Msgid-Bugs-To: EMAIL@ADDRESS\n"
"POT-Creation-Date: 2008-12-28 23:40+0100\n"
-"PO-Revision-Date: 2009-08-06 22:48+0200\n"
+"PO-Revision-Date: 2009-08-06 23:04+0200\n"
"Last-Translator: Petro Sasnyk <petro@sasnyk.name>\n"
"Language-Team: uk_UA <LL@li.org>\n"
"Plural-Forms: nplurals=3; plural=(n%10==1 && n%100!=11 ? 0 : n%10>=2 && "
@@ -18,7 +18,7 @@ msgstr ""
"Content-Transfer-Encoding: 8bit\n"
"Generated-By: Babel 0.9.4\n"
-#: sphinx/environment.py:103 sphinx/writers/latex.py:182
+#: sphinx/environment.py:103 sphinx/writers/latex.py:184
#, python-format
msgid "%B %d, %Y"
msgstr ""
@@ -27,12 +27,12 @@ msgstr ""
#: sphinx/themes/basic/genindex-split.html:2
#: sphinx/themes/basic/genindex-split.html:5
#: sphinx/themes/basic/genindex.html:2 sphinx/themes/basic/genindex.html:5
-#: sphinx/themes/basic/genindex.html:48 sphinx/themes/basic/layout.html:131
-#: sphinx/writers/latex.py:188
+#: sphinx/themes/basic/genindex.html:48 sphinx/themes/basic/layout.html:134
+#: sphinx/writers/latex.py:190
msgid "Index"
msgstr "Індекс"
-#: sphinx/environment.py:325 sphinx/writers/latex.py:187
+#: sphinx/environment.py:325 sphinx/writers/latex.py:189
msgid "Module Index"
msgstr "Індекс модулів"
@@ -58,34 +58,34 @@ msgstr "Вбудовані елементи"
msgid "Module level"
msgstr "Рівень модуля"
-#: sphinx/builders/html.py:205
+#: sphinx/builders/html.py:222
#, python-format
msgid "%b %d, %Y"
msgstr "%b %d, %Y"
-#: sphinx/builders/html.py:224 sphinx/themes/basic/defindex.html:21
+#: sphinx/builders/html.py:241 sphinx/themes/basic/defindex.html:21
msgid "General Index"
msgstr "Загальний індекс"
-#: sphinx/builders/html.py:224
+#: sphinx/builders/html.py:241
msgid "index"
msgstr "індекс"
-#: sphinx/builders/html.py:226 sphinx/builders/htmlhelp.py:219
+#: sphinx/builders/html.py:243 sphinx/builders/htmlhelp.py:219
#: sphinx/builders/qthelp.py:133 sphinx/themes/basic/defindex.html:19
#: sphinx/themes/basic/modindex.html:2 sphinx/themes/basic/modindex.html:13
msgid "Global Module Index"
msgstr "Загальний індекс модулів"
-#: sphinx/builders/html.py:227
+#: sphinx/builders/html.py:244
msgid "modules"
msgstr "модулі"
-#: sphinx/builders/html.py:281
+#: sphinx/builders/html.py:300
msgid "next"
msgstr "наступний"
-#: sphinx/builders/html.py:290
+#: sphinx/builders/html.py:309
msgid "previous"
msgstr "попередній"
@@ -208,37 +208,37 @@ msgstr "%s (C змінна)"
msgid "%scommand line option; %s"
msgstr "%sопція командного рядка; %s"
-#: sphinx/directives/other.py:138
+#: sphinx/directives/other.py:140
msgid "Platforms: "
msgstr "Платформи: "
-#: sphinx/directives/other.py:144
+#: sphinx/directives/other.py:146
#, python-format
msgid "%s (module)"
msgstr "%s (модуль)"
-#: sphinx/directives/other.py:193
+#: sphinx/directives/other.py:195
msgid "Section author: "
msgstr "Автор секції: "
-#: sphinx/directives/other.py:195
+#: sphinx/directives/other.py:197
msgid "Module author: "
msgstr "Автор модуля: "
-#: sphinx/directives/other.py:197
+#: sphinx/directives/other.py:199
msgid "Author: "
msgstr "Автор: "
-#: sphinx/directives/other.py:317
+#: sphinx/directives/other.py:319
msgid "See also"
msgstr "Дивись також"
-#: sphinx/ext/autodoc.py:883
+#: sphinx/ext/autodoc.py:889
#, python-format
msgid " Bases: %s"
msgstr " Базовий: %s"
-#: sphinx/ext/autodoc.py:916
+#: sphinx/ext/autodoc.py:922
#, python-format
msgid "alias of :class:`%s`"
msgstr "синонім :class:`%s`"
@@ -431,40 +431,40 @@ msgstr "Вперед"
msgid "Enter search terms or a module, class or function name."
msgstr "Введіть пошуковий термін, модуль, клас чи назву функції."
-#: sphinx/themes/basic/layout.html:119
+#: sphinx/themes/basic/layout.html:122
#, python-format
msgid "Search within %(docstitle)s"
msgstr "Шукати в %(docstitle)s"
-#: sphinx/themes/basic/layout.html:128
+#: sphinx/themes/basic/layout.html:131
msgid "About these documents"
msgstr "Про ці документи"
-#: sphinx/themes/basic/layout.html:134 sphinx/themes/basic/search.html:2
+#: sphinx/themes/basic/layout.html:137 sphinx/themes/basic/search.html:2
#: sphinx/themes/basic/search.html:5
msgid "Search"
msgstr "Пошук"
-#: sphinx/themes/basic/layout.html:137
+#: sphinx/themes/basic/layout.html:140
msgid "Copyright"
msgstr "Авторські права"
-#: sphinx/themes/basic/layout.html:183
+#: sphinx/themes/basic/layout.html:187
#, python-format
msgid "&copy; <a href=\"%(path)s\">Copyright</a> %(copyright)s."
msgstr "&copy; <a href=\"%(path)s\">Copyright</a> %(copyright)s."
-#: sphinx/themes/basic/layout.html:185
+#: sphinx/themes/basic/layout.html:189
#, python-format
msgid "&copy; Copyright %(copyright)s."
msgstr "&copy; Copyright %(copyright)s."
-#: sphinx/themes/basic/layout.html:188
+#: sphinx/themes/basic/layout.html:193
#, python-format
msgid "Last updated on %(last_updated)s."
msgstr "Востаннє оновлено %(last_updated)s."
-#: sphinx/themes/basic/layout.html:191
+#: sphinx/themes/basic/layout.html:196
#, python-format
msgid ""
"Created using <a href=\"http://sphinx.pocoo.org/\">Sphinx</a> "
@@ -508,7 +508,7 @@ msgid "search"
msgstr "пошук"
#: sphinx/themes/basic/search.html:25
-#: sphinx/themes/basic/static/searchtools.js:453
+#: sphinx/themes/basic/static/searchtools.js:462
msgid "Search Results"
msgstr "Результати пошуку"
@@ -565,15 +565,15 @@ msgstr "Шукаю"
msgid "Preparing search..."
msgstr "Підготовка до пошуку..."
-#: sphinx/themes/basic/static/searchtools.js:338
+#: sphinx/themes/basic/static/searchtools.js:347
msgid "module, in "
msgstr "модуль, в "
-#: sphinx/themes/basic/static/searchtools.js:347
+#: sphinx/themes/basic/static/searchtools.js:356
msgid ", in "
msgstr ", в "
-#: sphinx/themes/basic/static/searchtools.js:455
+#: sphinx/themes/basic/static/searchtools.js:464
msgid ""
"Your search did not match any documents. Please make sure that all words "
"are spelled correctly and that you've selected enough categories."
@@ -581,24 +581,24 @@ msgstr ""
"Ваш пошук не виявив жодного співпадіння. Будь-ласка переконайтеся що всі "
"слова набрані правильно і ви обрали достатньо категорій."
-#: sphinx/themes/basic/static/searchtools.js:457
+#: sphinx/themes/basic/static/searchtools.js:466
#, python-format
msgid "Search finished, found %s page(s) matching the search query."
msgstr "Пошук закінчено, знайдено %s сторінок які співпали з пошуковим запитом."
-#: sphinx/writers/latex.py:185
+#: sphinx/writers/latex.py:187
msgid "Release"
msgstr "Реліз"
-#: sphinx/writers/latex.py:571
+#: sphinx/writers/latex.py:578
msgid "Footnotes"
msgstr ""
-#: sphinx/writers/latex.py:639
+#: sphinx/writers/latex.py:646
msgid "continued from previous page"
msgstr ""
-#: sphinx/writers/latex.py:644
+#: sphinx/writers/latex.py:651
#, fuzzy
msgid "Continued on next page"
msgstr "Повний індекс на одній сторінці"
diff --git a/sphinx/locale/zh_CN/LC_MESSAGES/sphinx.js b/sphinx/locale/zh_CN/LC_MESSAGES/sphinx.js
new file mode 100644
index 00000000..d35c9aca
--- /dev/null
+++ b/sphinx/locale/zh_CN/LC_MESSAGES/sphinx.js
@@ -0,0 +1 @@
+Documentation.addTranslations({"locale": "zh_CN", "plural_expr": "0", "messages": {"Search Results": "\u641c\u7d22\u7ed3\u679c", "Preparing search...": "\u51c6\u5907\u641c\u7d22...", "Your search did not match any documents. Please make sure that all words are spelled correctly and that you've selected enough categories.": "\u4f60\u7684\u641c\u7d22\u6ca1\u6709\u5339\u914d\u5230\u4efb\u4f55\u6587\u6863\u3002\u8bf7\u786e\u8ba4\u4f60\u6240\u641c\u7d22\u7684\u5173\u952e\u5b57.", "Search finished, found %s page(s) matching the search query.": "\u641c\u7d22\u5b8c\u6210\uff0c \u627e\u5230\u4e86 %s \u9875\u5339\u914d\u6240\u641c\u7d22\u7684\u5173\u952e\u5b57", ", in ": ", \u4f4d\u4e8e", "Permalink to this headline": "\u6c38\u4e45\u94fe\u63a5\u81f3\u6807\u9898", "Searching": "\u641c\u7d22\u4e2d", "Permalink to this definition": "\u6c38\u4e45\u94fe\u63a5\u81f3\u76ee\u6807", "module, in ": "\u6a21\u5757\uff0c\u4f4d\u4e8e", "Hide Search Matches": "\u9690\u85cf\u641c\u7d22\u7ed3\u679c"}}); \ No newline at end of file
diff --git a/sphinx/locale/zh_CN/LC_MESSAGES/sphinx.mo b/sphinx/locale/zh_CN/LC_MESSAGES/sphinx.mo
new file mode 100644
index 00000000..16c492ca
--- /dev/null
+++ b/sphinx/locale/zh_CN/LC_MESSAGES/sphinx.mo
Binary files differ
diff --git a/sphinx/locale/zh_CN/LC_MESSAGES/sphinx.po b/sphinx/locale/zh_CN/LC_MESSAGES/sphinx.po
new file mode 100644
index 00000000..5b13794d
--- /dev/null
+++ b/sphinx/locale/zh_CN/LC_MESSAGES/sphinx.po
@@ -0,0 +1,604 @@
+# Chinese (Simplified Chinese) translations for Sphinx.
+# Copyright (C) 2009 Tower Joo
+# This file is distributed under the same license as the Sphinx project.
+# Tower Joo<zhutao.iscas@gmail.com>, 2009.
+# My homepage is at http://sites.google.com/site/towerjooeng
+#
+msgid ""
+msgstr ""
+"Project-Id-Version: Sphinx 0.6\n"
+"Report-Msgid-Bugs-To: zhutao.iscas@gmail.com\n"
+"POT-Creation-Date: 2009-03-09 19:46+0120\n"
+"PO-Revision-Date: 2009-08-06 23:04+0200\n"
+"Last-Translator: Tower Joo<zhutao.iscas@gmail.com>\n"
+"Language-Team: cn <LL@li.org>\n"
+"Plural-Forms: nplurals=1; plural=0\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=utf-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+"Generated-By: Babel 0.9.4\n"
+
+#: sphinx/environment.py:103 sphinx/writers/latex.py:184
+#, python-format
+msgid "%B %d, %Y"
+msgstr "%Y 年 %m 月 %d 日"
+
+#: sphinx/environment.py:324 sphinx/themes/basic/genindex-single.html:2
+#: sphinx/themes/basic/genindex-split.html:2
+#: sphinx/themes/basic/genindex-split.html:5
+#: sphinx/themes/basic/genindex.html:2 sphinx/themes/basic/genindex.html:5
+#: sphinx/themes/basic/genindex.html:48 sphinx/themes/basic/layout.html:134
+#: sphinx/writers/latex.py:190
+msgid "Index"
+msgstr "索引"
+
+#: sphinx/environment.py:325 sphinx/writers/latex.py:189
+msgid "Module Index"
+msgstr "模块索引"
+
+#: sphinx/environment.py:326 sphinx/themes/basic/defindex.html:16
+msgid "Search Page"
+msgstr "搜索页面"
+
+#: sphinx/roles.py:55 sphinx/directives/desc.py:747
+#, python-format
+msgid "environment variable; %s"
+msgstr "环境变量; %s"
+
+#: sphinx/roles.py:62
+#, python-format
+msgid "Python Enhancement Proposals!PEP %s"
+msgstr "Python 建议文件!PEP %s"
+
+#: sphinx/builders/changes.py:71
+msgid "Builtins"
+msgstr "内置"
+
+#: sphinx/builders/changes.py:73
+msgid "Module level"
+msgstr "模块级别"
+
+#: sphinx/builders/html.py:222
+#, python-format
+msgid "%b %d, %Y"
+msgstr "%Y 年 %m 月 %d 日"
+
+#: sphinx/builders/html.py:241 sphinx/themes/basic/defindex.html:21
+msgid "General Index"
+msgstr "总目录"
+
+#: sphinx/builders/html.py:241
+msgid "index"
+msgstr "索引"
+
+#: sphinx/builders/html.py:243 sphinx/builders/htmlhelp.py:219
+#: sphinx/builders/qthelp.py:133 sphinx/themes/basic/defindex.html:19
+#: sphinx/themes/basic/modindex.html:2 sphinx/themes/basic/modindex.html:13
+msgid "Global Module Index"
+msgstr "全局模块索引"
+
+#: sphinx/builders/html.py:244
+msgid "modules"
+msgstr "模块"
+
+#: sphinx/builders/html.py:300
+msgid "next"
+msgstr "下一页"
+
+#: sphinx/builders/html.py:309
+msgid "previous"
+msgstr "上一页"
+
+#: sphinx/builders/latex.py:162
+msgid " (in "
+msgstr ""
+
+#: sphinx/directives/desc.py:97
+msgid "Raises"
+msgstr "引发"
+
+#: sphinx/directives/desc.py:101
+msgid "Variable"
+msgstr "变量"
+
+#: sphinx/directives/desc.py:104
+msgid "Returns"
+msgstr "返回"
+
+#: sphinx/directives/desc.py:113
+msgid "Return type"
+msgstr "返回类型"
+
+#: sphinx/directives/desc.py:186
+#, fuzzy
+msgid "Parameter"
+msgstr "参数"
+
+#: sphinx/directives/desc.py:190
+msgid "Parameters"
+msgstr "参数"
+
+#: sphinx/directives/desc.py:418
+#, python-format
+msgid "%s() (built-in function)"
+msgstr "%s() (內置函数)"
+
+#: sphinx/directives/desc.py:419 sphinx/directives/desc.py:476
+#: sphinx/directives/desc.py:488
+#, python-format
+msgid "%s() (in module %s)"
+msgstr "%s() (在 %s 模块中)"
+
+#: sphinx/directives/desc.py:422
+#, python-format
+msgid "%s (built-in variable)"
+msgstr "%s (內置变量)"
+
+#: sphinx/directives/desc.py:423 sphinx/directives/desc.py:514
+#, python-format
+msgid "%s (in module %s)"
+msgstr "%s() (在 %s 模块中)"
+
+#: sphinx/directives/desc.py:439
+#, python-format
+msgid "%s (built-in class)"
+msgstr "%s (內置类)"
+
+#: sphinx/directives/desc.py:440
+#, python-format
+msgid "%s (class in %s)"
+msgstr ""
+
+#: sphinx/directives/desc.py:480
+#, python-format
+msgid "%s() (%s.%s method)"
+msgstr "%s() (%s.%s 方法)"
+
+#: sphinx/directives/desc.py:482
+#, python-format
+msgid "%s() (%s method)"
+msgstr "%s() (%s 方法)"
+
+#: sphinx/directives/desc.py:492
+#, python-format
+msgid "%s() (%s.%s static method)"
+msgstr "%s() (%s.%s 静态方法)"
+
+#: sphinx/directives/desc.py:495
+#, python-format
+msgid "%s() (%s static method)"
+msgstr "%s() (%s 静态方法)"
+
+#: sphinx/directives/desc.py:518
+#, python-format
+msgid "%s (%s.%s attribute)"
+msgstr "%s (%s.%s 属性)"
+
+#: sphinx/directives/desc.py:520
+#, python-format
+msgid "%s (%s attribute)"
+msgstr "%s (%s 属性)"
+
+#: sphinx/directives/desc.py:609
+#, python-format
+msgid "%s (C function)"
+msgstr "%s (C 函数)"
+
+#: sphinx/directives/desc.py:611
+#, python-format
+msgid "%s (C member)"
+msgstr "%s (C 成员)"
+
+#: sphinx/directives/desc.py:613
+#, python-format
+msgid "%s (C macro)"
+msgstr "%s (C 宏)"
+
+#: sphinx/directives/desc.py:615
+#, python-format
+msgid "%s (C type)"
+msgstr "%s (C 类型)"
+
+#: sphinx/directives/desc.py:617
+#, python-format
+msgid "%s (C variable)"
+msgstr "%s (C 变量)"
+
+#: sphinx/directives/desc.py:665
+#, python-format
+msgid "%scommand line option; %s"
+msgstr "%s命令行选项; %s"
+
+#: sphinx/directives/other.py:140
+msgid "Platforms: "
+msgstr "平台"
+
+#: sphinx/directives/other.py:146
+#, python-format
+msgid "%s (module)"
+msgstr "%s (模块)"
+
+#: sphinx/directives/other.py:195
+msgid "Section author: "
+msgstr "Section 作者:"
+
+#: sphinx/directives/other.py:197
+msgid "Module author: "
+msgstr "模块作者:"
+
+#: sphinx/directives/other.py:199
+msgid "Author: "
+msgstr "作者:"
+
+#: sphinx/directives/other.py:319
+msgid "See also"
+msgstr "也可以参考"
+
+#: sphinx/ext/autodoc.py:889
+#, python-format
+msgid " Bases: %s"
+msgstr ""
+
+#: sphinx/ext/autodoc.py:922
+#, python-format
+msgid "alias of :class:`%s`"
+msgstr ""
+
+#: sphinx/ext/todo.py:41
+msgid "Todo"
+msgstr "待处理"
+
+#: sphinx/ext/todo.py:99
+#, python-format
+msgid "(The original entry is located in %s, line %d and can be found "
+msgstr "(最初的入口位于%s 的第%d行"
+
+#: sphinx/ext/todo.py:105
+msgid "here"
+msgstr "这里"
+
+#: sphinx/locale/__init__.py:15
+msgid "Attention"
+msgstr "注意"
+
+#: sphinx/locale/__init__.py:16
+msgid "Caution"
+msgstr "警告"
+
+#: sphinx/locale/__init__.py:17
+msgid "Danger"
+msgstr "危险"
+
+#: sphinx/locale/__init__.py:18
+msgid "Error"
+msgstr "错误"
+
+#: sphinx/locale/__init__.py:19
+msgid "Hint"
+msgstr "提示"
+
+#: sphinx/locale/__init__.py:20
+msgid "Important"
+msgstr "重要"
+
+#: sphinx/locale/__init__.py:21
+msgid "Note"
+msgstr "注解"
+
+#: sphinx/locale/__init__.py:22
+msgid "See Also"
+msgstr "也可以参考"
+
+#: sphinx/locale/__init__.py:23
+msgid "Tip"
+msgstr "小技巧"
+
+#: sphinx/locale/__init__.py:24
+msgid "Warning"
+msgstr "警告"
+
+#: sphinx/locale/__init__.py:28
+#, python-format
+msgid "New in version %s"
+msgstr "%s 新版功能"
+
+#: sphinx/locale/__init__.py:29
+#, python-format
+msgid "Changed in version %s"
+msgstr "在 %s 版更改"
+
+#: sphinx/locale/__init__.py:30
+#, python-format
+msgid "Deprecated since version %s"
+msgstr "%s 版后已移除"
+
+#: sphinx/locale/__init__.py:34
+msgid "module"
+msgstr "模块"
+
+#: sphinx/locale/__init__.py:35
+msgid "keyword"
+msgstr "关键字"
+
+#: sphinx/locale/__init__.py:36
+msgid "operator"
+msgstr "操作数"
+
+#: sphinx/locale/__init__.py:37
+msgid "object"
+msgstr "对象"
+
+#: sphinx/locale/__init__.py:38
+msgid "exception"
+msgstr "例外"
+
+#: sphinx/locale/__init__.py:39
+msgid "statement"
+msgstr "语句"
+
+#: sphinx/locale/__init__.py:40
+msgid "built-in function"
+msgstr "內置函数"
+
+#: sphinx/themes/basic/defindex.html:2
+msgid "Overview"
+msgstr "概述"
+
+#: sphinx/themes/basic/defindex.html:11
+msgid "Indices and tables:"
+msgstr "索引和表格"
+
+#: sphinx/themes/basic/defindex.html:14
+msgid "Complete Table of Contents"
+msgstr "完整的内容表"
+
+#: sphinx/themes/basic/defindex.html:15
+msgid "lists all sections and subsections"
+msgstr "列出所有的章节和部分"
+
+#: sphinx/themes/basic/defindex.html:17
+msgid "search this documentation"
+msgstr "搜索文档"
+
+#: sphinx/themes/basic/defindex.html:20
+msgid "quick access to all modules"
+msgstr "快速查看所有的模块"
+
+#: sphinx/themes/basic/defindex.html:22
+msgid "all functions, classes, terms"
+msgstr "所的函数,类,术语"
+
+#: sphinx/themes/basic/genindex-single.html:5
+#, python-format
+msgid "Index &ndash; %(key)s"
+msgstr "索引 &ndash; %(key)s"
+
+#: sphinx/themes/basic/genindex-single.html:44
+#: sphinx/themes/basic/genindex-split.html:14
+#: sphinx/themes/basic/genindex-split.html:27
+#: sphinx/themes/basic/genindex.html:54
+msgid "Full index on one page"
+msgstr "一页的全部索引"
+
+#: sphinx/themes/basic/genindex-split.html:7
+msgid "Index pages by letter"
+msgstr "按照字母的索引页"
+
+#: sphinx/themes/basic/genindex-split.html:15
+msgid "can be huge"
+msgstr "可能会很多"
+
+#: sphinx/themes/basic/layout.html:10
+msgid "Navigation"
+msgstr "导航"
+
+#: sphinx/themes/basic/layout.html:42
+msgid "Table Of Contents"
+msgstr "內容目录"
+
+#: sphinx/themes/basic/layout.html:48
+msgid "Previous topic"
+msgstr "上一个主题"
+
+#: sphinx/themes/basic/layout.html:50
+msgid "previous chapter"
+msgstr "上一章"
+
+#: sphinx/themes/basic/layout.html:53
+msgid "Next topic"
+msgstr "下一个主题"
+
+#: sphinx/themes/basic/layout.html:55
+msgid "next chapter"
+msgstr "下一章"
+
+#: sphinx/themes/basic/layout.html:60
+msgid "This Page"
+msgstr "本页"
+
+#: sphinx/themes/basic/layout.html:63
+msgid "Show Source"
+msgstr "显示源代码"
+
+#: sphinx/themes/basic/layout.html:73
+msgid "Quick search"
+msgstr "快速搜索"
+
+#: sphinx/themes/basic/layout.html:76
+msgid "Go"
+msgstr "搜索"
+
+#: sphinx/themes/basic/layout.html:81
+msgid "Enter search terms or a module, class or function name."
+msgstr "输入相关的模块,术语,类或者函数名称进行搜索"
+
+#: sphinx/themes/basic/layout.html:122
+#, python-format
+msgid "Search within %(docstitle)s"
+msgstr "在 %(docstitle)s 中搜索"
+
+#: sphinx/themes/basic/layout.html:131
+msgid "About these documents"
+msgstr "关于这些文档"
+
+#: sphinx/themes/basic/layout.html:137 sphinx/themes/basic/search.html:2
+#: sphinx/themes/basic/search.html:5
+msgid "Search"
+msgstr "搜索"
+
+#: sphinx/themes/basic/layout.html:140
+msgid "Copyright"
+msgstr "版权所有"
+
+#: sphinx/themes/basic/layout.html:187
+#, python-format
+msgid "&copy; <a href=\"%(path)s\">Copyright</a> %(copyright)s."
+msgstr "&copy; <a href=\"%(path)s\">版权所有</a> % (copyright)s."
+
+#: sphinx/themes/basic/layout.html:189
+#, python-format
+msgid "&copy; Copyright %(copyright)s."
+msgstr "&copy; 版权所有 %(copyright)s."
+
+#: sphinx/themes/basic/layout.html:193
+#, python-format
+msgid "Last updated on %(last_updated)s."
+msgstr "最后更新日期是 %(last_updated)s."
+
+#: sphinx/themes/basic/layout.html:196
+#, python-format
+msgid ""
+"Created using <a href=\"http://sphinx.pocoo.org/\">Sphinx</a> "
+"%(sphinx_version)s."
+msgstr "使用 <a href=\"http://sphinx.pocoo.org/\">Sphinx</a> %(sphinx_version)s."
+
+#: sphinx/themes/basic/modindex.html:36
+msgid "Deprecated"
+msgstr "已移除"
+
+#: sphinx/themes/basic/opensearch.xml:4
+#, python-format
+msgid "Search %(docstitle)s"
+msgstr "搜索 %(docstitle)s"
+
+#: sphinx/themes/basic/search.html:9
+msgid ""
+"Please activate JavaScript to enable the search\n"
+" functionality."
+msgstr ""
+
+#: sphinx/themes/basic/search.html:14
+msgid ""
+"From here you can search these documents. Enter your search\n"
+" words into the box below and click \"search\". Note that the search\n"
+" function will automatically search for all of the words. Pages\n"
+" containing fewer words won't appear in the result list."
+msgstr "在这儿,你可以对这些文档进行搜索。向搜索框中输入你所要搜索的关键字并点击\"搜索\"。注意:搜索引擎会自动搜索所有的关键字。将不会搜索到部分关键字的页面."
+
+#: sphinx/themes/basic/search.html:21
+msgid "search"
+msgstr "搜索"
+
+#: sphinx/themes/basic/search.html:25
+#: sphinx/themes/basic/static/searchtools.js:462
+msgid "Search Results"
+msgstr "搜索结果"
+
+#: sphinx/themes/basic/search.html:27
+msgid "Your search did not match any results."
+msgstr "你的搜索没有找到任何的结果."
+
+#: sphinx/themes/basic/changes/frameset.html:5
+#: sphinx/themes/basic/changes/versionchanges.html:12
+#, python-format
+msgid "Changes in Version %(version)s &mdash; %(docstitle)s"
+msgstr "更改发生在版本 %(version)s &mdash; %(docstitle)s"
+
+#: sphinx/themes/basic/changes/rstsource.html:5
+#, python-format
+msgid "%(filename)s &mdash; %(docstitle)s"
+msgstr ""
+
+#: sphinx/themes/basic/changes/versionchanges.html:17
+#, python-format
+msgid "Automatically generated list of changes in version %(version)s"
+msgstr "自动生成的版本 %(version)s中的更改列表"
+
+#: sphinx/themes/basic/changes/versionchanges.html:18
+msgid "Library changes"
+msgstr "库更改"
+
+#: sphinx/themes/basic/changes/versionchanges.html:23
+msgid "C API changes"
+msgstr "C API 更改"
+
+#: sphinx/themes/basic/changes/versionchanges.html:25
+msgid "Other changes"
+msgstr "其他更改"
+
+#: sphinx/themes/basic/static/doctools.js:139 sphinx/writers/html.py:473
+#: sphinx/writers/html.py:478
+msgid "Permalink to this headline"
+msgstr "永久链接至标题"
+
+#: sphinx/themes/basic/static/doctools.js:145 sphinx/writers/html.py:80
+msgid "Permalink to this definition"
+msgstr "永久链接至目标"
+
+#: sphinx/themes/basic/static/doctools.js:174
+msgid "Hide Search Matches"
+msgstr "隐藏搜索结果"
+
+#: sphinx/themes/basic/static/searchtools.js:274
+msgid "Searching"
+msgstr "搜索中"
+
+#: sphinx/themes/basic/static/searchtools.js:279
+msgid "Preparing search..."
+msgstr "准备搜索..."
+
+#: sphinx/themes/basic/static/searchtools.js:347
+msgid "module, in "
+msgstr "模块,位于"
+
+#: sphinx/themes/basic/static/searchtools.js:356
+msgid ", in "
+msgstr ", 位于"
+
+#: sphinx/themes/basic/static/searchtools.js:464
+msgid ""
+"Your search did not match any documents. Please make sure that all words "
+"are spelled correctly and that you've selected enough categories."
+msgstr "你的搜索没有匹配到任何文档。请确认你所搜索的关键字."
+
+#: sphinx/themes/basic/static/searchtools.js:466
+#, python-format
+msgid "Search finished, found %s page(s) matching the search query."
+msgstr "搜索完成, 找到了 %s 页匹配所搜索的关键字"
+
+#: sphinx/writers/latex.py:187
+msgid "Release"
+msgstr "发布"
+
+#: sphinx/writers/latex.py:578
+msgid "Footnotes"
+msgstr ""
+
+#: sphinx/writers/latex.py:646
+msgid "continued from previous page"
+msgstr ""
+
+#: sphinx/writers/latex.py:651
+#, fuzzy
+msgid "Continued on next page"
+msgstr "一页的全部索引"
+
+#: sphinx/writers/text.py:166
+#, python-format
+msgid "Platform: %s"
+msgstr "平台:%s"
+
+#: sphinx/writers/text.py:428
+msgid "[image]"
+msgstr "[图片]"
+
diff --git a/sphinx/locale/zh_TW/LC_MESSAGES/sphinx.js b/sphinx/locale/zh_TW/LC_MESSAGES/sphinx.js
index 75383100..3e4631d4 100644
--- a/sphinx/locale/zh_TW/LC_MESSAGES/sphinx.js
+++ b/sphinx/locale/zh_TW/LC_MESSAGES/sphinx.js
@@ -1 +1 @@
-Documentation.addTranslations({"locale": "zh_TW", "plural_expr": "0", "messages": {"module, in ": "", "Preparing search...": "\u6e96\u5099\u641c\u5c0b...", "Your search did not match any documents. Please make sure that all words are spelled correctly and that you've selected enough categories.": "", "Search finished, found %s page(s) matching the search query.": "", ", in ": "", "Permalink to this headline": "", "Searching": "\u641c\u5c0b\u4e2d", "Permalink to this definition": "", "Hide Search Matches": "", "Search Results": "\u641c\u5c0b\u7d50\u679c"}}); \ No newline at end of file
+Documentation.addTranslations({"locale": "zh_TW", "plural_expr": "0", "messages": {"Search Results": "\u641c\u5c0b\u7d50\u679c", "Preparing search...": "\u6e96\u5099\u641c\u5c0b...", "Your search did not match any documents. Please make sure that all words are spelled correctly and that you've selected enough categories.": "", "Search finished, found %s page(s) matching the search query.": "", ", in ": "", "Permalink to this headline": "", "Searching": "\u641c\u5c0b\u4e2d", "Permalink to this definition": "", "module, in ": "", "Hide Search Matches": ""}}); \ No newline at end of file
diff --git a/sphinx/locale/zh_TW/LC_MESSAGES/sphinx.mo b/sphinx/locale/zh_TW/LC_MESSAGES/sphinx.mo
index 46d3cd27..05f098b1 100644
--- a/sphinx/locale/zh_TW/LC_MESSAGES/sphinx.mo
+++ b/sphinx/locale/zh_TW/LC_MESSAGES/sphinx.mo
Binary files differ
diff --git a/sphinx/locale/zh_TW/LC_MESSAGES/sphinx.po b/sphinx/locale/zh_TW/LC_MESSAGES/sphinx.po
index 6b86de79..53d1731d 100644
--- a/sphinx/locale/zh_TW/LC_MESSAGES/sphinx.po
+++ b/sphinx/locale/zh_TW/LC_MESSAGES/sphinx.po
@@ -8,7 +8,7 @@ msgstr ""
"Project-Id-Version: Sphinx 0.5\n"
"Report-Msgid-Bugs-To: EMAIL@ADDRESS\n"
"POT-Creation-Date: 2008-11-09 19:46+0100\n"
-"PO-Revision-Date: 2009-08-06 22:48+0200\n"
+"PO-Revision-Date: 2009-08-06 23:04+0200\n"
"Last-Translator: Fred Lin <gasolin@gmail.com>\n"
"Language-Team: tw <LL@li.org>\n"
"Plural-Forms: nplurals=1; plural=0\n"
@@ -17,7 +17,7 @@ msgstr ""
"Content-Transfer-Encoding: 8bit\n"
"Generated-By: Babel 0.9.4\n"
-#: sphinx/environment.py:103 sphinx/writers/latex.py:182
+#: sphinx/environment.py:103 sphinx/writers/latex.py:184
#, python-format
msgid "%B %d, %Y"
msgstr "%Y 年 %m 月 %d 日"
@@ -26,12 +26,12 @@ msgstr "%Y 年 %m 月 %d 日"
#: sphinx/themes/basic/genindex-split.html:2
#: sphinx/themes/basic/genindex-split.html:5
#: sphinx/themes/basic/genindex.html:2 sphinx/themes/basic/genindex.html:5
-#: sphinx/themes/basic/genindex.html:48 sphinx/themes/basic/layout.html:131
-#: sphinx/writers/latex.py:188
+#: sphinx/themes/basic/genindex.html:48 sphinx/themes/basic/layout.html:134
+#: sphinx/writers/latex.py:190
msgid "Index"
msgstr "索引"
-#: sphinx/environment.py:325 sphinx/writers/latex.py:187
+#: sphinx/environment.py:325 sphinx/writers/latex.py:189
msgid "Module Index"
msgstr "模組索引"
@@ -57,34 +57,34 @@ msgstr ""
msgid "Module level"
msgstr ""
-#: sphinx/builders/html.py:205
+#: sphinx/builders/html.py:222
#, python-format
msgid "%b %d, %Y"
msgstr "%Y 年 %m 月 %d 日"
-#: sphinx/builders/html.py:224 sphinx/themes/basic/defindex.html:21
+#: sphinx/builders/html.py:241 sphinx/themes/basic/defindex.html:21
msgid "General Index"
msgstr "總索引"
-#: sphinx/builders/html.py:224
+#: sphinx/builders/html.py:241
msgid "index"
msgstr "索引"
-#: sphinx/builders/html.py:226 sphinx/builders/htmlhelp.py:219
+#: sphinx/builders/html.py:243 sphinx/builders/htmlhelp.py:219
#: sphinx/builders/qthelp.py:133 sphinx/themes/basic/defindex.html:19
#: sphinx/themes/basic/modindex.html:2 sphinx/themes/basic/modindex.html:13
msgid "Global Module Index"
msgstr ""
-#: sphinx/builders/html.py:227
+#: sphinx/builders/html.py:244
msgid "modules"
msgstr "模組"
-#: sphinx/builders/html.py:281
+#: sphinx/builders/html.py:300
msgid "next"
msgstr "下一頁"
-#: sphinx/builders/html.py:290
+#: sphinx/builders/html.py:309
msgid "previous"
msgstr "上一頁"
@@ -208,37 +208,37 @@ msgstr "%s (C 變數)"
msgid "%scommand line option; %s"
msgstr "%s命令列選項; %s"
-#: sphinx/directives/other.py:138
+#: sphinx/directives/other.py:140
msgid "Platforms: "
msgstr "平台"
-#: sphinx/directives/other.py:144
+#: sphinx/directives/other.py:146
#, python-format
msgid "%s (module)"
msgstr "%s (模組)"
-#: sphinx/directives/other.py:193
+#: sphinx/directives/other.py:195
msgid "Section author: "
msgstr "Section 作者:"
-#: sphinx/directives/other.py:195
+#: sphinx/directives/other.py:197
msgid "Module author: "
msgstr "模組作者:"
-#: sphinx/directives/other.py:197
+#: sphinx/directives/other.py:199
msgid "Author: "
msgstr "作者:"
-#: sphinx/directives/other.py:317
+#: sphinx/directives/other.py:319
msgid "See also"
msgstr ""
-#: sphinx/ext/autodoc.py:883
+#: sphinx/ext/autodoc.py:889
#, python-format
msgid " Bases: %s"
msgstr ""
-#: sphinx/ext/autodoc.py:916
+#: sphinx/ext/autodoc.py:922
#, python-format
msgid "alias of :class:`%s`"
msgstr ""
@@ -432,40 +432,40 @@ msgstr ""
msgid "Enter search terms or a module, class or function name."
msgstr "輸入一個模組、類別、或是函式名稱."
-#: sphinx/themes/basic/layout.html:119
+#: sphinx/themes/basic/layout.html:122
#, python-format
msgid "Search within %(docstitle)s"
msgstr "在 %(docstitle)s 中搜尋"
-#: sphinx/themes/basic/layout.html:128
+#: sphinx/themes/basic/layout.html:131
msgid "About these documents"
msgstr ""
-#: sphinx/themes/basic/layout.html:134 sphinx/themes/basic/search.html:2
+#: sphinx/themes/basic/layout.html:137 sphinx/themes/basic/search.html:2
#: sphinx/themes/basic/search.html:5
msgid "Search"
msgstr "搜尋"
-#: sphinx/themes/basic/layout.html:137
+#: sphinx/themes/basic/layout.html:140
msgid "Copyright"
msgstr "版權所有"
-#: sphinx/themes/basic/layout.html:183
+#: sphinx/themes/basic/layout.html:187
#, python-format
msgid "&copy; <a href=\"%(path)s\">Copyright</a> %(copyright)s."
msgstr ""
-#: sphinx/themes/basic/layout.html:185
+#: sphinx/themes/basic/layout.html:189
#, python-format
msgid "&copy; Copyright %(copyright)s."
msgstr ""
-#: sphinx/themes/basic/layout.html:188
+#: sphinx/themes/basic/layout.html:193
#, python-format
msgid "Last updated on %(last_updated)s."
msgstr "最後更新日期是 %(last_updated)s."
-#: sphinx/themes/basic/layout.html:191
+#: sphinx/themes/basic/layout.html:196
#, python-format
msgid ""
"Created using <a href=\"http://sphinx.pocoo.org/\">Sphinx</a> "
@@ -500,7 +500,7 @@ msgid "search"
msgstr "搜尋"
#: sphinx/themes/basic/search.html:25
-#: sphinx/themes/basic/static/searchtools.js:453
+#: sphinx/themes/basic/static/searchtools.js:462
msgid "Search Results"
msgstr "搜尋結果"
@@ -557,38 +557,38 @@ msgstr "搜尋中"
msgid "Preparing search..."
msgstr "準備搜尋..."
-#: sphinx/themes/basic/static/searchtools.js:338
+#: sphinx/themes/basic/static/searchtools.js:347
msgid "module, in "
msgstr ""
-#: sphinx/themes/basic/static/searchtools.js:347
+#: sphinx/themes/basic/static/searchtools.js:356
msgid ", in "
msgstr ""
-#: sphinx/themes/basic/static/searchtools.js:455
+#: sphinx/themes/basic/static/searchtools.js:464
msgid ""
"Your search did not match any documents. Please make sure that all words "
"are spelled correctly and that you've selected enough categories."
msgstr ""
-#: sphinx/themes/basic/static/searchtools.js:457
+#: sphinx/themes/basic/static/searchtools.js:466
#, python-format
msgid "Search finished, found %s page(s) matching the search query."
msgstr ""
-#: sphinx/writers/latex.py:185
+#: sphinx/writers/latex.py:187
msgid "Release"
msgstr "釋出"
-#: sphinx/writers/latex.py:571
+#: sphinx/writers/latex.py:578
msgid "Footnotes"
msgstr ""
-#: sphinx/writers/latex.py:639
+#: sphinx/writers/latex.py:646
msgid "continued from previous page"
msgstr ""
-#: sphinx/writers/latex.py:644
+#: sphinx/writers/latex.py:651
msgid "Continued on next page"
msgstr ""
diff --git a/sphinx/pycode/__init__.py b/sphinx/pycode/__init__.py
index b7473bf2..93a11ca8 100644
--- a/sphinx/pycode/__init__.py
+++ b/sphinx/pycode/__init__.py
@@ -45,22 +45,33 @@ _eq = nodes.Leaf(token.EQUAL, '=')
class AttrDocVisitor(nodes.NodeVisitor):
"""
Visitor that collects docstrings for attribute assignments on toplevel and
- in classes.
+ in classes (class attributes and attributes set in __init__).
The docstrings can either be in special '#:' comments before the assignment
or in a docstring after it.
"""
def init(self, scope, encoding):
self.scope = scope
+ self.in_init = 0
self.encoding = encoding
self.namespace = []
self.collected = {}
def visit_classdef(self, node):
+ """Visit a class."""
self.namespace.append(node[1].value)
self.generic_visit(node)
self.namespace.pop()
+ def visit_funcdef(self, node):
+ """Visit a function (or method)."""
+ # usually, don't descend into functions -- nothing interesting there
+ if node[1].value == '__init__':
+ # however, collect attributes set in __init__ methods
+ self.in_init += 1
+ self.generic_visit(node)
+ self.in_init -= 1
+
def visit_expr_stmt(self, node):
"""Visit an assignment which may have a special comment before it."""
if _eq not in node.children:
@@ -97,20 +108,32 @@ class AttrDocVisitor(nodes.NodeVisitor):
docstring = prepare_docstring(docstring)
self.add_docstring(prev[0], docstring)
- def visit_funcdef(self, node):
- # don't descend into functions -- nothing interesting there
- return
-
def add_docstring(self, node, docstring):
# add an item for each assignment target
for i in range(0, len(node) - 1, 2):
target = node[i]
- if target.type != token.NAME:
- # don't care about complex targets
+ if self.in_init and self.number2name[target.type] == 'power':
+ # maybe an attribute assignment -- check necessary conditions
+ if (# node must have two children
+ len(target) != 2 or
+ # first child must be "self"
+ target[0].type != token.NAME or target[0].value != 'self' or
+ # second child must be a "trailer" with two children
+ self.number2name[target[1].type] != 'trailer' or
+ len(target[1]) != 2 or
+ # first child must be a dot, second child a name
+ target[1][0].type != token.DOT or
+ target[1][1].type != token.NAME):
+ continue
+ name = target[1][1].value
+ elif target.type != token.NAME:
+ # don't care about other complex targets
continue
+ else:
+ name = target.value
namespace = '.'.join(self.namespace)
if namespace.startswith(self.scope):
- self.collected[namespace, target.value] = docstring
+ self.collected[namespace, name] = docstring
class PycodeError(Exception):
@@ -298,8 +321,8 @@ if __name__ == '__main__':
import time, pprint
x0 = time.time()
#ma = ModuleAnalyzer.for_file(__file__.rstrip('c'), 'sphinx.builders.html')
- ma = ModuleAnalyzer.for_file('sphinx/builders/html.py',
- 'sphinx.builders.html')
+ ma = ModuleAnalyzer.for_file('sphinx/environment.py',
+ 'sphinx.environment')
ma.tokenize()
x1 = time.time()
ma.parse()
diff --git a/sphinx/pycode/pgen2/parse.c b/sphinx/pycode/pgen2/parse.c
index fd0e9ff9..e09f5058 100644
--- a/sphinx/pycode/pgen2/parse.c
+++ b/sphinx/pycode/pgen2/parse.c
@@ -1,8 +1,11 @@
-/* Generated by Cython 0.9.8.1 on Thu Jan 1 23:45:38 2009 */
+/* Generated by Cython 0.12 on Fri Jan 22 10:39:58 2010 */
#define PY_SSIZE_T_CLEAN
#include "Python.h"
#include "structmember.h"
+#ifndef Py_PYTHON_H
+ #error Python headers needed to compile C extensions, please install development version of Python.
+#else
#ifndef PY_LONG_LONG
#define PY_LONG_LONG LONG_LONG
#endif
@@ -11,11 +14,14 @@
#endif
#if PY_VERSION_HEX < 0x02040000
#define METH_COEXIST 0
+ #define PyDict_CheckExact(op) (Py_TYPE(op) == &PyDict_Type)
+ #define PyDict_Contains(d,o) PySequence_Contains(d,o)
#endif
#if PY_VERSION_HEX < 0x02050000
typedef int Py_ssize_t;
#define PY_SSIZE_T_MAX INT_MAX
#define PY_SSIZE_T_MIN INT_MIN
+ #define PY_FORMAT_SIZE_T ""
#define PyInt_FromSsize_t(z) PyInt_FromLong(z)
#define PyInt_AsSsize_t(o) PyInt_AsLong(o)
#define PyNumber_Index(o) PyNumber_Int(o)
@@ -31,20 +37,20 @@
typedef struct {
void *buf;
+ PyObject *obj;
Py_ssize_t len;
+ Py_ssize_t itemsize;
int readonly;
- const char *format;
int ndim;
+ char *format;
Py_ssize_t *shape;
Py_ssize_t *strides;
Py_ssize_t *suboffsets;
- Py_ssize_t itemsize;
void *internal;
} Py_buffer;
#define PyBUF_SIMPLE 0
#define PyBUF_WRITABLE 0x0001
- #define PyBUF_LOCK 0x0002
#define PyBUF_FORMAT 0x0004
#define PyBUF_ND 0x0008
#define PyBUF_STRIDES (0x0010 | PyBUF_ND)
@@ -63,9 +69,18 @@
#define Py_TPFLAGS_CHECKTYPES 0
#define Py_TPFLAGS_HAVE_INDEX 0
#endif
+#if (PY_VERSION_HEX < 0x02060000) || (PY_MAJOR_VERSION >= 3)
+ #define Py_TPFLAGS_HAVE_NEWBUFFER 0
+#endif
#if PY_MAJOR_VERSION >= 3
#define PyBaseString_Type PyUnicode_Type
- #define PyString_Type PyBytes_Type
+ #define PyString_Type PyUnicode_Type
+ #define PyString_CheckExact PyUnicode_CheckExact
+#else
+ #define PyBytes_Type PyString_Type
+ #define PyBytes_CheckExact PyString_CheckExact
+#endif
+#if PY_MAJOR_VERSION >= 3
#define PyInt_Type PyLong_Type
#define PyInt_Check(op) PyLong_Check(op)
#define PyInt_CheckExact(op) PyLong_CheckExact(op)
@@ -80,9 +95,10 @@
#define PyInt_AsUnsignedLongMask PyLong_AsUnsignedLongMask
#define PyInt_AsUnsignedLongLongMask PyLong_AsUnsignedLongLongMask
#define __Pyx_PyNumber_Divide(x,y) PyNumber_TrueDivide(x,y)
+ #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceTrueDivide(x,y)
#else
#define __Pyx_PyNumber_Divide(x,y) PyNumber_Divide(x,y)
- #define PyBytes_Type PyString_Type
+ #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceDivide(x,y)
#endif
#if PY_MAJOR_VERSION >= 3
#define PyMethod_New(func, self, klass) PyInstanceMethod_New(func)
@@ -94,9 +110,28 @@
#ifndef __cdecl
#define __cdecl
#endif
+ #ifndef __fastcall
+ #define __fastcall
+ #endif
#else
#define _USE_MATH_DEFINES
#endif
+#if PY_VERSION_HEX < 0x02050000
+ #define __Pyx_GetAttrString(o,n) PyObject_GetAttrString((o),((char *)(n)))
+ #define __Pyx_SetAttrString(o,n,a) PyObject_SetAttrString((o),((char *)(n)),(a))
+ #define __Pyx_DelAttrString(o,n) PyObject_DelAttrString((o),((char *)(n)))
+#else
+ #define __Pyx_GetAttrString(o,n) PyObject_GetAttrString((o),(n))
+ #define __Pyx_SetAttrString(o,n,a) PyObject_SetAttrString((o),(n),(a))
+ #define __Pyx_DelAttrString(o,n) PyObject_DelAttrString((o),(n))
+#endif
+#if PY_VERSION_HEX < 0x02050000
+ #define __Pyx_NAMESTR(n) ((char *)(n))
+ #define __Pyx_DOCSTR(n) ((char *)(n))
+#else
+ #define __Pyx_NAMESTR(n) (n)
+ #define __Pyx_DOCSTR(n) (n)
+#endif
#ifdef __cplusplus
#define __PYX_EXTERN_C extern "C"
#else
@@ -105,7 +140,6 @@
#include <math.h>
#define __PYX_HAVE_API__sphinx__pycode__pgen2__parse
-
#ifdef __GNUC__
#define INLINE __inline__
#elif _WIN32
@@ -114,43 +148,97 @@
#define INLINE
#endif
-typedef struct {PyObject **p; char *s; long n; char is_unicode; char intern; char is_identifier;} __Pyx_StringTabEntry; /*proto*/
-
-
-
-static int __pyx_skip_dispatch = 0;
+typedef struct {PyObject **p; char *s; const long n; const char* encoding; const char is_unicode; const char is_str; const char intern; } __Pyx_StringTabEntry; /*proto*/
/* Type Conversion Predeclarations */
#if PY_MAJOR_VERSION < 3
-#define __Pyx_PyBytes_FromString PyString_FromString
-#define __Pyx_PyBytes_AsString PyString_AsString
+#define __Pyx_PyBytes_FromString PyString_FromString
+#define __Pyx_PyBytes_FromStringAndSize PyString_FromStringAndSize
+#define __Pyx_PyBytes_AsString PyString_AsString
#else
-#define __Pyx_PyBytes_FromString PyBytes_FromString
-#define __Pyx_PyBytes_AsString PyBytes_AsString
+#define __Pyx_PyBytes_FromString PyBytes_FromString
+#define __Pyx_PyBytes_FromStringAndSize PyBytes_FromStringAndSize
+#define __Pyx_PyBytes_AsString PyBytes_AsString
#endif
+#define __Pyx_PyBytes_FromUString(s) __Pyx_PyBytes_FromString((char*)s)
+#define __Pyx_PyBytes_AsUString(s) ((unsigned char*) __Pyx_PyBytes_AsString(s))
+
#define __Pyx_PyBool_FromLong(b) ((b) ? (Py_INCREF(Py_True), Py_True) : (Py_INCREF(Py_False), Py_False))
-static INLINE int __Pyx_PyObject_IsTrue(PyObject* x);
-static INLINE PY_LONG_LONG __pyx_PyInt_AsLongLong(PyObject* x);
-static INLINE unsigned PY_LONG_LONG __pyx_PyInt_AsUnsignedLongLong(PyObject* x);
-static INLINE Py_ssize_t __pyx_PyIndex_AsSsize_t(PyObject* b);
+static INLINE int __Pyx_PyObject_IsTrue(PyObject*);
+static INLINE PyObject* __Pyx_PyNumber_Int(PyObject* x);
+
+#if !defined(T_PYSSIZET)
+#if PY_VERSION_HEX < 0x02050000
+#define T_PYSSIZET T_INT
+#elif !defined(T_LONGLONG)
+#define T_PYSSIZET \
+ ((sizeof(Py_ssize_t) == sizeof(int)) ? T_INT : \
+ ((sizeof(Py_ssize_t) == sizeof(long)) ? T_LONG : -1))
+#else
+#define T_PYSSIZET \
+ ((sizeof(Py_ssize_t) == sizeof(int)) ? T_INT : \
+ ((sizeof(Py_ssize_t) == sizeof(long)) ? T_LONG : \
+ ((sizeof(Py_ssize_t) == sizeof(PY_LONG_LONG)) ? T_LONGLONG : -1)))
+#endif
+#endif
+
+
+#if !defined(T_ULONGLONG)
+#define __Pyx_T_UNSIGNED_INT(x) \
+ ((sizeof(x) == sizeof(unsigned char)) ? T_UBYTE : \
+ ((sizeof(x) == sizeof(unsigned short)) ? T_USHORT : \
+ ((sizeof(x) == sizeof(unsigned int)) ? T_UINT : \
+ ((sizeof(x) == sizeof(unsigned long)) ? T_ULONG : -1))))
+#else
+#define __Pyx_T_UNSIGNED_INT(x) \
+ ((sizeof(x) == sizeof(unsigned char)) ? T_UBYTE : \
+ ((sizeof(x) == sizeof(unsigned short)) ? T_USHORT : \
+ ((sizeof(x) == sizeof(unsigned int)) ? T_UINT : \
+ ((sizeof(x) == sizeof(unsigned long)) ? T_ULONG : \
+ ((sizeof(x) == sizeof(unsigned PY_LONG_LONG)) ? T_ULONGLONG : -1)))))
+#endif
+#if !defined(T_LONGLONG)
+#define __Pyx_T_SIGNED_INT(x) \
+ ((sizeof(x) == sizeof(char)) ? T_BYTE : \
+ ((sizeof(x) == sizeof(short)) ? T_SHORT : \
+ ((sizeof(x) == sizeof(int)) ? T_INT : \
+ ((sizeof(x) == sizeof(long)) ? T_LONG : -1))))
+#else
+#define __Pyx_T_SIGNED_INT(x) \
+ ((sizeof(x) == sizeof(char)) ? T_BYTE : \
+ ((sizeof(x) == sizeof(short)) ? T_SHORT : \
+ ((sizeof(x) == sizeof(int)) ? T_INT : \
+ ((sizeof(x) == sizeof(long)) ? T_LONG : \
+ ((sizeof(x) == sizeof(PY_LONG_LONG)) ? T_LONGLONG : -1)))))
+#endif
+
+#define __Pyx_T_FLOATING(x) \
+ ((sizeof(x) == sizeof(float)) ? T_FLOAT : \
+ ((sizeof(x) == sizeof(double)) ? T_DOUBLE : -1))
+
+#if !defined(T_SIZET)
+#if !defined(T_ULONGLONG)
+#define T_SIZET \
+ ((sizeof(size_t) == sizeof(unsigned int)) ? T_UINT : \
+ ((sizeof(size_t) == sizeof(unsigned long)) ? T_ULONG : -1))
+#else
+#define T_SIZET \
+ ((sizeof(size_t) == sizeof(unsigned int)) ? T_UINT : \
+ ((sizeof(size_t) == sizeof(unsigned long)) ? T_ULONG : \
+ ((sizeof(size_t) == sizeof(unsigned PY_LONG_LONG)) ? T_ULONGLONG : -1)))
+#endif
+#endif
+
+static INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject*);
+static INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t);
+static INLINE size_t __Pyx_PyInt_AsSize_t(PyObject*);
-#define __pyx_PyInt_AsLong(x) (PyInt_CheckExact(x) ? PyInt_AS_LONG(x) : PyInt_AsLong(x))
#define __pyx_PyFloat_AsDouble(x) (PyFloat_CheckExact(x) ? PyFloat_AS_DOUBLE(x) : PyFloat_AsDouble(x))
-static INLINE unsigned char __pyx_PyInt_unsigned_char(PyObject* x);
-static INLINE unsigned short __pyx_PyInt_unsigned_short(PyObject* x);
-static INLINE char __pyx_PyInt_char(PyObject* x);
-static INLINE short __pyx_PyInt_short(PyObject* x);
-static INLINE int __pyx_PyInt_int(PyObject* x);
-static INLINE long __pyx_PyInt_long(PyObject* x);
-static INLINE signed char __pyx_PyInt_signed_char(PyObject* x);
-static INLINE signed short __pyx_PyInt_signed_short(PyObject* x);
-static INLINE signed int __pyx_PyInt_signed_int(PyObject* x);
-static INLINE signed long __pyx_PyInt_signed_long(PyObject* x);
-static INLINE long double __pyx_PyInt_long_double(PyObject* x);
+
#ifdef __GNUC__
/* Test for GCC > 2.95 */
#if __GNUC__ > 2 || (__GNUC__ == 2 && (__GNUC_MINOR__ > 95))
@@ -168,184 +256,468 @@ static INLINE long double __pyx_PyInt_long_double(PyObject* x);
static PyObject *__pyx_m;
static PyObject *__pyx_b;
static PyObject *__pyx_empty_tuple;
+static PyObject *__pyx_empty_bytes;
static int __pyx_lineno;
static int __pyx_clineno = 0;
static const char * __pyx_cfilenm= __FILE__;
static const char *__pyx_filename;
static const char **__pyx_f;
-static INLINE void __Pyx_RaiseArgtupleTooLong(Py_ssize_t num_expected, Py_ssize_t num_found); /*proto*/
-static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list); /*proto*/
+/* Type declarations */
-static PyObject *__Pyx_GetName(PyObject *dict, PyObject *name); /*proto*/
+/* "/home/gbr/devel/sphinx/sphinx/pycode/pgen2/parse.pyx":31
+ *
+ *
+ * cdef class Parser: # <<<<<<<<<<<<<<
+ * cdef public object grammar
+ * cdef public object rootnode
+ */
-static PyObject *__Pyx_CreateClass(PyObject *bases, PyObject *dict, PyObject *name, char *modname); /*proto*/
+struct __pyx_obj_6sphinx_6pycode_5pgen2_5parse_Parser {
+ PyObject_HEAD
+ struct __pyx_vtabstruct_6sphinx_6pycode_5pgen2_5parse_Parser *__pyx_vtab;
+ PyObject *grammar;
+ PyObject *rootnode;
+ PyObject *stack;
+ PyObject *used_names;
+ int _grammar_start;
+ PyObject *_grammar_labels;
+ PyObject *_grammar_dfas;
+ PyObject *_grammar_keywords;
+ PyObject *_grammar_tokens;
+ PyObject *_grammar_number2symbol;
+};
+
+
+struct __pyx_vtabstruct_6sphinx_6pycode_5pgen2_5parse_Parser {
+ int (*classify)(struct __pyx_obj_6sphinx_6pycode_5pgen2_5parse_Parser *, int, PyObject *, PyObject *);
+ void (*shift)(struct __pyx_obj_6sphinx_6pycode_5pgen2_5parse_Parser *, PyObject *, PyObject *, PyObject *, PyObject *);
+ void (*push)(struct __pyx_obj_6sphinx_6pycode_5pgen2_5parse_Parser *, PyObject *, PyObject *, PyObject *, PyObject *);
+ void (*pop)(struct __pyx_obj_6sphinx_6pycode_5pgen2_5parse_Parser *);
+ PyObject *(*convert)(struct __pyx_obj_6sphinx_6pycode_5pgen2_5parse_Parser *, PyObject *);
+};
+static struct __pyx_vtabstruct_6sphinx_6pycode_5pgen2_5parse_Parser *__pyx_vtabptr_6sphinx_6pycode_5pgen2_5parse_Parser;
+
+#ifndef CYTHON_REFNANNY
+ #define CYTHON_REFNANNY 0
+#endif
+
+#if CYTHON_REFNANNY
+ typedef struct {
+ void (*INCREF)(void*, PyObject*, int);
+ void (*DECREF)(void*, PyObject*, int);
+ void (*GOTREF)(void*, PyObject*, int);
+ void (*GIVEREF)(void*, PyObject*, int);
+ void* (*SetupContext)(const char*, int, const char*);
+ void (*FinishContext)(void**);
+ } __Pyx_RefNannyAPIStruct;
+ static __Pyx_RefNannyAPIStruct *__Pyx_RefNanny = NULL;
+ static __Pyx_RefNannyAPIStruct * __Pyx_RefNannyImportAPI(const char *modname) {
+ PyObject *m = NULL, *p = NULL;
+ void *r = NULL;
+ m = PyImport_ImportModule((char *)modname);
+ if (!m) goto end;
+ p = PyObject_GetAttrString(m, (char *)"RefNannyAPI");
+ if (!p) goto end;
+ r = PyLong_AsVoidPtr(p);
+ end:
+ Py_XDECREF(p);
+ Py_XDECREF(m);
+ return (__Pyx_RefNannyAPIStruct *)r;
+ }
+ #define __Pyx_RefNannySetupContext(name) void *__pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__)
+ #define __Pyx_RefNannyFinishContext() __Pyx_RefNanny->FinishContext(&__pyx_refnanny)
+ #define __Pyx_INCREF(r) __Pyx_RefNanny->INCREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
+ #define __Pyx_DECREF(r) __Pyx_RefNanny->DECREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
+ #define __Pyx_GOTREF(r) __Pyx_RefNanny->GOTREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
+ #define __Pyx_GIVEREF(r) __Pyx_RefNanny->GIVEREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
+ #define __Pyx_XDECREF(r) do { if((r) != NULL) {__Pyx_DECREF(r);} } while(0)
+#else
+ #define __Pyx_RefNannySetupContext(name)
+ #define __Pyx_RefNannyFinishContext()
+ #define __Pyx_INCREF(r) Py_INCREF(r)
+ #define __Pyx_DECREF(r) Py_DECREF(r)
+ #define __Pyx_GOTREF(r)
+ #define __Pyx_GIVEREF(r)
+ #define __Pyx_XDECREF(r) Py_XDECREF(r)
+#endif /* CYTHON_REFNANNY */
+#define __Pyx_XGIVEREF(r) do { if((r) != NULL) {__Pyx_GIVEREF(r);} } while(0)
+#define __Pyx_XGOTREF(r) do { if((r) != NULL) {__Pyx_GOTREF(r);} } while(0)
+
+static void __Pyx_RaiseDoubleKeywordsError(
+ const char* func_name, PyObject* kw_name); /*proto*/
+
+static void __Pyx_RaiseArgtupleInvalid(const char* func_name, int exact,
+ Py_ssize_t num_min, Py_ssize_t num_max, Py_ssize_t num_found); /*proto*/
+
+static int __Pyx_ParseOptionalKeywords(PyObject *kwds, PyObject **argnames[], PyObject *kwds2, PyObject *values[], Py_ssize_t num_pos_args, const char* function_name); /*proto*/
+
+#if PY_VERSION_HEX < 0x02050000
+#ifndef PyAnySet_CheckExact
+
+#define PyAnySet_CheckExact(ob) \
+ ((ob)->ob_type == &PySet_Type || \
+ (ob)->ob_type == &PyFrozenSet_Type)
-static INLINE PyObject *__Pyx_GetItemInt(PyObject *o, Py_ssize_t i, int is_unsigned) {
+#define PySet_New(iterable) \
+ PyObject_CallFunctionObjArgs((PyObject *)&PySet_Type, (iterable), NULL)
+
+#define Pyx_PyFrozenSet_New(iterable) \
+ PyObject_CallFunctionObjArgs((PyObject *)&PyFrozenSet_Type, (iterable), NULL)
+
+#define PySet_Size(anyset) \
+ PyObject_Size((anyset))
+
+#define PySet_Contains(anyset, key) \
+ PySequence_Contains((anyset), (key))
+
+#define PySet_Pop(set) \
+ PyObject_CallMethod(set, (char *)"pop", NULL)
+
+static INLINE int PySet_Clear(PyObject *set) {
+ PyObject *ret = PyObject_CallMethod(set, (char *)"clear", NULL);
+ if (!ret) return -1;
+ Py_DECREF(ret); return 0;
+}
+
+static INLINE int PySet_Discard(PyObject *set, PyObject *key) {
+ PyObject *ret = PyObject_CallMethod(set, (char *)"discard", (char *)"O", key);
+ if (!ret) return -1;
+ Py_DECREF(ret); return 0;
+}
+
+static INLINE int PySet_Add(PyObject *set, PyObject *key) {
+ PyObject *ret = PyObject_CallMethod(set, (char *)"add", (char *)"O", key);
+ if (!ret) return -1;
+ Py_DECREF(ret); return 0;
+}
+
+#endif /* PyAnySet_CheckExact (<= Py2.4) */
+
+#if PY_VERSION_HEX < 0x02040000
+#ifndef Py_SETOBJECT_H
+#define Py_SETOBJECT_H
+
+static PyTypeObject *__Pyx_PySet_Type = NULL;
+static PyTypeObject *__Pyx_PyFrozenSet_Type = NULL;
+
+#define PySet_Type (*__Pyx_PySet_Type)
+#define PyFrozenSet_Type (*__Pyx_PyFrozenSet_Type)
+
+#define PyAnySet_Check(ob) \
+ (PyAnySet_CheckExact(ob) || \
+ PyType_IsSubtype((ob)->ob_type, &PySet_Type) || \
+ PyType_IsSubtype((ob)->ob_type, &PyFrozenSet_Type))
+
+#define PyFrozenSet_CheckExact(ob) ((ob)->ob_type == &PyFrozenSet_Type)
+
+static int __Pyx_Py23SetsImport(void) {
+ PyObject *sets=0, *Set=0, *ImmutableSet=0;
+
+ sets = PyImport_ImportModule((char *)"sets");
+ if (!sets) goto bad;
+ Set = PyObject_GetAttrString(sets, (char *)"Set");
+ if (!Set) goto bad;
+ ImmutableSet = PyObject_GetAttrString(sets, (char *)"ImmutableSet");
+ if (!ImmutableSet) goto bad;
+ Py_DECREF(sets);
+
+ __Pyx_PySet_Type = (PyTypeObject*) Set;
+ __Pyx_PyFrozenSet_Type = (PyTypeObject*) ImmutableSet;
+
+ return 0;
+
+ bad:
+ Py_XDECREF(sets);
+ Py_XDECREF(Set);
+ Py_XDECREF(ImmutableSet);
+ return -1;
+}
+
+#else
+static int __Pyx_Py23SetsImport(void) { return 0; }
+#endif /* !Py_SETOBJECT_H */
+#endif /* < Py2.4 */
+#endif /* < Py2.5 */
+
+
+static INLINE PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j) {
PyObject *r;
- if (PyList_CheckExact(o) && 0 <= i && i < PyList_GET_SIZE(o)) {
+ if (!j) return NULL;
+ r = PyObject_GetItem(o, j);
+ Py_DECREF(j);
+ return r;
+}
+
+
+#define __Pyx_GetItemInt_List(o, i, size, to_py_func) ((size <= sizeof(Py_ssize_t)) ? \
+ __Pyx_GetItemInt_List_Fast(o, i, size <= sizeof(long)) : \
+ __Pyx_GetItemInt_Generic(o, to_py_func(i)))
+
+static INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i, int fits_long) {
+ if (likely(o != Py_None)) {
+ if (likely((0 <= i) & (i < PyList_GET_SIZE(o)))) {
+ PyObject *r = PyList_GET_ITEM(o, i);
+ Py_INCREF(r);
+ return r;
+ }
+ else if ((-PyList_GET_SIZE(o) <= i) & (i < 0)) {
+ PyObject *r = PyList_GET_ITEM(o, PyList_GET_SIZE(o) + i);
+ Py_INCREF(r);
+ return r;
+ }
+ }
+ return __Pyx_GetItemInt_Generic(o, fits_long ? PyInt_FromLong(i) : PyLong_FromLongLong(i));
+}
+
+#define __Pyx_GetItemInt_Tuple(o, i, size, to_py_func) ((size <= sizeof(Py_ssize_t)) ? \
+ __Pyx_GetItemInt_Tuple_Fast(o, i, size <= sizeof(long)) : \
+ __Pyx_GetItemInt_Generic(o, to_py_func(i)))
+
+static INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i, int fits_long) {
+ if (likely(o != Py_None)) {
+ if (likely((0 <= i) & (i < PyTuple_GET_SIZE(o)))) {
+ PyObject *r = PyTuple_GET_ITEM(o, i);
+ Py_INCREF(r);
+ return r;
+ }
+ else if ((-PyTuple_GET_SIZE(o) <= i) & (i < 0)) {
+ PyObject *r = PyTuple_GET_ITEM(o, PyTuple_GET_SIZE(o) + i);
+ Py_INCREF(r);
+ return r;
+ }
+ }
+ return __Pyx_GetItemInt_Generic(o, fits_long ? PyInt_FromLong(i) : PyLong_FromLongLong(i));
+}
+
+
+#define __Pyx_GetItemInt(o, i, size, to_py_func) ((size <= sizeof(Py_ssize_t)) ? \
+ __Pyx_GetItemInt_Fast(o, i, size <= sizeof(long)) : \
+ __Pyx_GetItemInt_Generic(o, to_py_func(i)))
+
+static INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i, int fits_long) {
+ PyObject *r;
+ if (PyList_CheckExact(o) && ((0 <= i) & (i < PyList_GET_SIZE(o)))) {
r = PyList_GET_ITEM(o, i);
Py_INCREF(r);
}
- else if (PyTuple_CheckExact(o) && 0 <= i && i < PyTuple_GET_SIZE(o)) {
+ else if (PyTuple_CheckExact(o) && ((0 <= i) & (i < PyTuple_GET_SIZE(o)))) {
r = PyTuple_GET_ITEM(o, i);
Py_INCREF(r);
}
- else if (Py_TYPE(o)->tp_as_sequence && Py_TYPE(o)->tp_as_sequence->sq_item && (likely(i >= 0) || !is_unsigned))
+ else if (Py_TYPE(o)->tp_as_sequence && Py_TYPE(o)->tp_as_sequence->sq_item && (likely(i >= 0))) {
r = PySequence_GetItem(o, i);
+ }
else {
- PyObject *j = (likely(i >= 0) || !is_unsigned) ? PyInt_FromLong(i) : PyLong_FromUnsignedLongLong((sizeof(unsigned long long) > sizeof(Py_ssize_t) ? (1ULL << (sizeof(Py_ssize_t)*8)) : 0) + i);
- if (!j)
- return 0;
- r = PyObject_GetItem(o, j);
- Py_DECREF(j);
+ r = __Pyx_GetItemInt_Generic(o, fits_long ? PyInt_FromLong(i) : PyLong_FromLongLong(i));
}
return r;
}
+static INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index);
+
+static INLINE void __Pyx_RaiseTooManyValuesError(void);
+
static PyObject *__Pyx_UnpackItem(PyObject *, Py_ssize_t index); /*proto*/
static int __Pyx_EndUnpack(PyObject *); /*proto*/
-static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb); /*proto*/
+static INLINE long __Pyx_NegateNonNeg(long b) { return unlikely(b < 0) ? b : !b; }
+static INLINE PyObject* __Pyx_PyBoolOrNull_FromLong(long b) {
+ return unlikely(b < 0) ? NULL : __Pyx_PyBool_FromLong(b);
+}
+
+static INLINE void __Pyx_RaiseNoneNotIterableError(void);
static INLINE PyObject* __Pyx_PyObject_Append(PyObject* L, PyObject* x) {
if (likely(PyList_CheckExact(L))) {
if (PyList_Append(L, x) < 0) return NULL;
Py_INCREF(Py_None);
- return Py_None; // this is just to have an accurate signature
+ return Py_None; /* this is just to have an accurate signature */
}
else {
- return PyObject_CallMethod(L, "append", "(O)", x);
+ PyObject *r, *m;
+ m = __Pyx_GetAttrString(L, "append");
+ if (!m) return NULL;
+ r = PyObject_CallFunctionObjArgs(m, x, NULL);
+ Py_DECREF(m);
+ return r;
}
}
-static INLINE int __Pyx_SetItemInt(PyObject *o, Py_ssize_t i, PyObject *v, int is_unsigned) {
+#define __Pyx_SetItemInt(o, i, v, size, to_py_func) ((size <= sizeof(Py_ssize_t)) ? \
+ __Pyx_SetItemInt_Fast(o, i, v, size <= sizeof(long)) : \
+ __Pyx_SetItemInt_Generic(o, to_py_func(i), v))
+
+static INLINE int __Pyx_SetItemInt_Generic(PyObject *o, PyObject *j, PyObject *v) {
int r;
- if (PyList_CheckExact(o) && 0 <= i && i < PyList_GET_SIZE(o)) {
- Py_DECREF(PyList_GET_ITEM(o, i));
+ if (!j) return -1;
+ r = PyObject_SetItem(o, j, v);
+ Py_DECREF(j);
+ return r;
+}
+
+static INLINE int __Pyx_SetItemInt_Fast(PyObject *o, Py_ssize_t i, PyObject *v, int fits_long) {
+ if (PyList_CheckExact(o) && ((0 <= i) & (i < PyList_GET_SIZE(o)))) {
Py_INCREF(v);
+ Py_DECREF(PyList_GET_ITEM(o, i));
PyList_SET_ITEM(o, i, v);
return 1;
}
- else if (Py_TYPE(o)->tp_as_sequence && Py_TYPE(o)->tp_as_sequence->sq_ass_item && (likely(i >= 0) || !is_unsigned))
- r = PySequence_SetItem(o, i, v);
+ else if (Py_TYPE(o)->tp_as_sequence && Py_TYPE(o)->tp_as_sequence->sq_ass_item && (likely(i >= 0)))
+ return PySequence_SetItem(o, i, v);
else {
- PyObject *j = (likely(i >= 0) || !is_unsigned) ? PyInt_FromLong(i) : PyLong_FromUnsignedLongLong((sizeof(unsigned long long) > sizeof(Py_ssize_t) ? (1ULL << (sizeof(Py_ssize_t)*8)) : 0) + i);
- if (!j)
- return -1;
- r = PyObject_SetItem(o, j, v);
- Py_DECREF(j);
+ PyObject *j = fits_long ? PyInt_FromLong(i) : PyLong_FromLongLong(i);
+ return __Pyx_SetItemInt_Generic(o, j, v);
}
- return r;
}
-static void __Pyx_WriteUnraisable(const char *name); /*proto*/
+static void __Pyx_UnpackTupleError(PyObject *, Py_ssize_t index); /*proto*/
-static int __Pyx_SetVtable(PyObject *dict, void *vtable); /*proto*/
+static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list); /*proto*/
-static void __Pyx_AddTraceback(const char *funcname); /*proto*/
+static PyObject *__Pyx_GetName(PyObject *dict, PyObject *name); /*proto*/
-static int __Pyx_InitStrings(__Pyx_StringTabEntry *t); /*proto*/
+static PyObject *__Pyx_CreateClass(PyObject *bases, PyObject *dict, PyObject *name, const char *modname); /*proto*/
-/* Type declarations */
+static INLINE void __Pyx_ErrRestore(PyObject *type, PyObject *value, PyObject *tb); /*proto*/
+static INLINE void __Pyx_ErrFetch(PyObject **type, PyObject **value, PyObject **tb); /*proto*/
-/* "/home/gbr/devel/sphinx/sphinx/pycode/pgen2/parse.pyx":31
- *
- *
- * cdef class Parser: # <<<<<<<<<<<<<<
- * cdef public grammar, stack, rootnode, used_names
- * cdef _grammar_dfas, _grammar_labels, _grammar_keywords, _grammar_tokens
- */
+static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb); /*proto*/
-struct __pyx_obj_6sphinx_6pycode_5pgen2_5parse_Parser {
- PyObject_HEAD
- struct __pyx_vtabstruct_6sphinx_6pycode_5pgen2_5parse_Parser *__pyx_vtab;
- PyObject *grammar;
- PyObject *stack;
- PyObject *rootnode;
- PyObject *used_names;
- PyObject *_grammar_dfas;
- PyObject *_grammar_labels;
- PyObject *_grammar_keywords;
- PyObject *_grammar_tokens;
- PyObject *_grammar_number2symbol;
-};
+static INLINE unsigned char __Pyx_PyInt_AsUnsignedChar(PyObject *);
+static INLINE unsigned short __Pyx_PyInt_AsUnsignedShort(PyObject *);
-struct __pyx_vtabstruct_6sphinx_6pycode_5pgen2_5parse_Parser {
- int (*classify)(struct __pyx_obj_6sphinx_6pycode_5pgen2_5parse_Parser *, PyObject *, PyObject *, PyObject *);
- void (*shift)(struct __pyx_obj_6sphinx_6pycode_5pgen2_5parse_Parser *, PyObject *, PyObject *, PyObject *, PyObject *);
- void (*push)(struct __pyx_obj_6sphinx_6pycode_5pgen2_5parse_Parser *, PyObject *, PyObject *, PyObject *, PyObject *);
- void (*pop)(struct __pyx_obj_6sphinx_6pycode_5pgen2_5parse_Parser *);
- PyObject *(*convert)(struct __pyx_obj_6sphinx_6pycode_5pgen2_5parse_Parser *, PyObject *);
-};
-static struct __pyx_vtabstruct_6sphinx_6pycode_5pgen2_5parse_Parser *__pyx_vtabptr_6sphinx_6pycode_5pgen2_5parse_Parser;
+static INLINE unsigned int __Pyx_PyInt_AsUnsignedInt(PyObject *);
+
+static INLINE char __Pyx_PyInt_AsChar(PyObject *);
+
+static INLINE short __Pyx_PyInt_AsShort(PyObject *);
+
+static INLINE int __Pyx_PyInt_AsInt(PyObject *);
+
+static INLINE signed char __Pyx_PyInt_AsSignedChar(PyObject *);
+
+static INLINE signed short __Pyx_PyInt_AsSignedShort(PyObject *);
+
+static INLINE signed int __Pyx_PyInt_AsSignedInt(PyObject *);
+
+static INLINE unsigned long __Pyx_PyInt_AsUnsignedLong(PyObject *);
+
+static INLINE unsigned PY_LONG_LONG __Pyx_PyInt_AsUnsignedLongLong(PyObject *);
+
+static INLINE long __Pyx_PyInt_AsLong(PyObject *);
+
+static INLINE PY_LONG_LONG __Pyx_PyInt_AsLongLong(PyObject *);
+
+static INLINE signed long __Pyx_PyInt_AsSignedLong(PyObject *);
+
+static INLINE signed PY_LONG_LONG __Pyx_PyInt_AsSignedLongLong(PyObject *);
+
+static void __Pyx_WriteUnraisable(const char *name); /*proto*/
+
+static int __Pyx_SetVtable(PyObject *dict, void *vtable); /*proto*/
+
+static void __Pyx_AddTraceback(const char *funcname); /*proto*/
+
+static int __Pyx_InitStrings(__Pyx_StringTabEntry *t); /*proto*/
/* Module declarations from sphinx.pycode.pgen2.parse */
static PyTypeObject *__pyx_ptype_6sphinx_6pycode_5pgen2_5parse_Parser = 0;
-
+#define __Pyx_MODULE_NAME "sphinx.pycode.pgen2.parse"
+int __pyx_module_is_main_sphinx__pycode__pgen2__parse = 0;
/* Implementation of sphinx.pycode.pgen2.parse */
-static char __pyx_k_2[] = "Exception to signal the parser is stuck.";
-static PyObject *__pyx_int_0;
-static PyObject *__pyx_int_1;
-static char __pyx_k___init__[] = "__init__";
-static PyObject *__pyx_kp___init__;
-static char __pyx_k_setup[] = "setup";
-static PyObject *__pyx_kp_setup;
-static char __pyx_k_addtoken[] = "addtoken";
-static PyObject *__pyx_kp_addtoken;
-static char __pyx_k_1[] = "sphinx.pycode.nodes";
-static PyObject *__pyx_kp_1;
-static char __pyx_k_Node[] = "Node";
-static PyObject *__pyx_kp_Node;
-static char __pyx_k_Leaf[] = "Leaf";
-static PyObject *__pyx_kp_Leaf;
-static char __pyx_k_ParseError[] = "ParseError";
-static PyObject *__pyx_kp_ParseError;
-static char __pyx_k_Exception[] = "Exception";
-static PyObject *__pyx_kp_Exception;
-static char __pyx_k_msg[] = "msg";
-static PyObject *__pyx_kp_msg;
-static char __pyx_k_type[] = "type";
-static PyObject *__pyx_kp_type;
-static char __pyx_k_value[] = "value";
-static PyObject *__pyx_kp_value;
-static char __pyx_k_context[] = "context";
-static PyObject *__pyx_kp_context;
-static char __pyx_k_dfas[] = "dfas";
-static PyObject *__pyx_kp_dfas;
-static char __pyx_k_labels[] = "labels";
-static PyObject *__pyx_kp_labels;
-static char __pyx_k_keywords[] = "keywords";
-static PyObject *__pyx_kp_keywords;
-static char __pyx_k_tokens[] = "tokens";
-static PyObject *__pyx_kp_tokens;
-static char __pyx_k_4[] = "number2symbol";
-static PyObject *__pyx_kp_4;
-static char __pyx_k_start[] = "start";
-static PyObject *__pyx_kp_start;
-static char __pyx_k_add[] = "add";
-static PyObject *__pyx_kp_add;
-static char __pyx_k_get[] = "get";
-static PyObject *__pyx_kp_get;
-static char __pyx_k_append[] = "append";
-static PyObject *__pyx_kp_append;
-static char __pyx_k_pop[] = "pop";
-static PyObject *__pyx_kp_pop;
-static char __pyx_k_used_names[] = "used_names";
-static PyObject *__pyx_kp_used_names;
-static PyObject *__pyx_kp_2;
static PyObject *__pyx_builtin_Exception;
-static PyObject *__pyx_kp_3;
-static char __pyx_k_3[] = "%s: type=%r, value=%r, context=%r";
-static PyObject *__pyx_kp_5;
-static PyObject *__pyx_kp_6;
-static char __pyx_k_5[] = "too much input";
-static char __pyx_k_6[] = "bad input";
-static PyObject *__pyx_kp_7;
-static char __pyx_k_7[] = "bad token";
+static char __pyx_k_1[] = "%s: type=%r, value=%r, context=%r";
+static char __pyx_k_2[] = "_grammar_number2symbol";
+static char __pyx_k_3[] = "too much input";
+static char __pyx_k_4[] = "bad input";
+static char __pyx_k_5[] = "bad token";
+static char __pyx_k_6[] = "Parser engine for the grammar tables generated by pgen.\n\nThe grammar table must be loaded first.\n\nSee Parser/parser.c in the Python distribution for additional info on\nhow this parsing engine works.\n\n";
+static char __pyx_k_7[] = "sphinx.pycode.nodes";
+static char __pyx_k_8[] = "Exception to signal the parser is stuck.";
+static char __pyx_k_9[] = "Parser.addtoken (line 66)";
+static char __pyx_k__add[] = "add";
+static char __pyx_k__msg[] = "msg";
+static char __pyx_k__pop[] = "pop";
+static char __pyx_k__Leaf[] = "Leaf";
+static char __pyx_k__Node[] = "Node";
+static char __pyx_k__dfas[] = "dfas";
+static char __pyx_k__push[] = "push";
+static char __pyx_k__self[] = "self";
+static char __pyx_k__type[] = "type";
+static char __pyx_k__shift[] = "shift";
+static char __pyx_k__stack[] = "stack";
+static char __pyx_k__start[] = "start";
+static char __pyx_k__value[] = "value";
+static char __pyx_k__Parser[] = "Parser";
+static char __pyx_k__labels[] = "labels";
+static char __pyx_k__tokens[] = "tokens";
+static char __pyx_k__context[] = "context";
+static char __pyx_k__convert[] = "convert";
+static char __pyx_k__grammar[] = "grammar";
+static char __pyx_k____init__[] = "__init__";
+static char __pyx_k____main__[] = "__main__";
+static char __pyx_k____test__[] = "__test__";
+static char __pyx_k__addtoken[] = "addtoken";
+static char __pyx_k__classify[] = "classify";
+static char __pyx_k__keywords[] = "keywords";
+static char __pyx_k__rootnode[] = "rootnode";
+static char __pyx_k__Exception[] = "Exception";
+static char __pyx_k__ParseError[] = "ParseError";
+static char __pyx_k__used_names[] = "used_names";
+static char __pyx_k___grammar_dfas[] = "_grammar_dfas";
+static char __pyx_k__number2symbol[] = "number2symbol";
+static char __pyx_k___grammar_start[] = "_grammar_start";
+static char __pyx_k___grammar_labels[] = "_grammar_labels";
+static char __pyx_k___grammar_tokens[] = "_grammar_tokens";
+static char __pyx_k___grammar_keywords[] = "_grammar_keywords";
+static PyObject *__pyx_kp_s_1;
+static PyObject *__pyx_n_s_2;
+static PyObject *__pyx_kp_s_3;
+static PyObject *__pyx_kp_s_4;
+static PyObject *__pyx_kp_s_5;
+static PyObject *__pyx_n_s_7;
+static PyObject *__pyx_kp_s_8;
+static PyObject *__pyx_kp_u_9;
+static PyObject *__pyx_n_s__Exception;
+static PyObject *__pyx_n_s__Leaf;
+static PyObject *__pyx_n_s__Node;
+static PyObject *__pyx_n_s__ParseError;
+static PyObject *__pyx_n_s__Parser;
+static PyObject *__pyx_n_s____init__;
+static PyObject *__pyx_n_s____main__;
+static PyObject *__pyx_n_s____test__;
+static PyObject *__pyx_n_s___grammar_dfas;
+static PyObject *__pyx_n_s___grammar_keywords;
+static PyObject *__pyx_n_s___grammar_labels;
+static PyObject *__pyx_n_s___grammar_start;
+static PyObject *__pyx_n_s___grammar_tokens;
+static PyObject *__pyx_n_s__add;
+static PyObject *__pyx_n_s__addtoken;
+static PyObject *__pyx_n_s__classify;
+static PyObject *__pyx_n_s__context;
+static PyObject *__pyx_n_s__convert;
+static PyObject *__pyx_n_s__dfas;
+static PyObject *__pyx_n_s__grammar;
+static PyObject *__pyx_n_s__keywords;
+static PyObject *__pyx_n_s__labels;
+static PyObject *__pyx_n_s__msg;
+static PyObject *__pyx_n_s__number2symbol;
+static PyObject *__pyx_n_s__pop;
+static PyObject *__pyx_n_s__push;
+static PyObject *__pyx_n_s__rootnode;
+static PyObject *__pyx_n_s__self;
+static PyObject *__pyx_n_s__shift;
+static PyObject *__pyx_n_s__stack;
+static PyObject *__pyx_n_s__start;
+static PyObject *__pyx_n_s__tokens;
+static PyObject *__pyx_n_s__type;
+static PyObject *__pyx_n_s__used_names;
+static PyObject *__pyx_n_s__value;
+static PyObject *__pyx_int_0;
/* "/home/gbr/devel/sphinx/sphinx/pycode/pgen2/parse.pyx":22
* """Exception to signal the parser is stuck."""
@@ -356,34 +728,86 @@ static char __pyx_k_7[] = "bad token";
*/
static PyObject *__pyx_pf_6sphinx_6pycode_5pgen2_5parse_10ParseError___init__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
-static PyMethodDef __pyx_mdef_6sphinx_6pycode_5pgen2_5parse_10ParseError___init__ = {"__init__", (PyCFunction)__pyx_pf_6sphinx_6pycode_5pgen2_5parse_10ParseError___init__, METH_VARARGS|METH_KEYWORDS, 0};
+static PyMethodDef __pyx_mdef_6sphinx_6pycode_5pgen2_5parse_10ParseError___init__ = {__Pyx_NAMESTR("__init__"), (PyCFunction)__pyx_pf_6sphinx_6pycode_5pgen2_5parse_10ParseError___init__, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)};
static PyObject *__pyx_pf_6sphinx_6pycode_5pgen2_5parse_10ParseError___init__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_self = 0;
PyObject *__pyx_v_msg = 0;
PyObject *__pyx_v_type = 0;
PyObject *__pyx_v_value = 0;
PyObject *__pyx_v_context = 0;
- PyObject *__pyx_r;
- PyObject *__pyx_1 = 0;
- PyObject *__pyx_2 = 0;
- PyObject *__pyx_3 = 0;
- static char *__pyx_argnames[] = {"self","msg","type","value","context",0};
+ PyObject *__pyx_r = NULL;
+ PyObject *__pyx_t_1 = NULL;
+ PyObject *__pyx_t_2 = NULL;
+ PyObject *__pyx_t_3 = NULL;
+ static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__self,&__pyx_n_s__msg,&__pyx_n_s__type,&__pyx_n_s__value,&__pyx_n_s__context,0};
+ __Pyx_RefNannySetupContext("__init__");
__pyx_self = __pyx_self;
- if (likely(!__pyx_kwds) && likely(PyTuple_GET_SIZE(__pyx_args) == 5)) {
+ if (unlikely(__pyx_kwds)) {
+ Py_ssize_t kw_args = PyDict_Size(__pyx_kwds);
+ PyObject* values[5] = {0,0,0,0,0};
+ switch (PyTuple_GET_SIZE(__pyx_args)) {
+ case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
+ case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
+ case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
+ case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
+ case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
+ case 0: break;
+ default: goto __pyx_L5_argtuple_error;
+ }
+ switch (PyTuple_GET_SIZE(__pyx_args)) {
+ case 0:
+ values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__self);
+ if (likely(values[0])) kw_args--;
+ else goto __pyx_L5_argtuple_error;
+ case 1:
+ values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__msg);
+ if (likely(values[1])) kw_args--;
+ else {
+ __Pyx_RaiseArgtupleInvalid("__init__", 1, 5, 5, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 22; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ }
+ case 2:
+ values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__type);
+ if (likely(values[2])) kw_args--;
+ else {
+ __Pyx_RaiseArgtupleInvalid("__init__", 1, 5, 5, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 22; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ }
+ case 3:
+ values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__value);
+ if (likely(values[3])) kw_args--;
+ else {
+ __Pyx_RaiseArgtupleInvalid("__init__", 1, 5, 5, 3); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 22; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ }
+ case 4:
+ values[4] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__context);
+ if (likely(values[4])) kw_args--;
+ else {
+ __Pyx_RaiseArgtupleInvalid("__init__", 1, 5, 5, 4); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 22; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ }
+ }
+ if (unlikely(kw_args > 0)) {
+ if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "__init__") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 22; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ }
+ __pyx_v_self = values[0];
+ __pyx_v_msg = values[1];
+ __pyx_v_type = values[2];
+ __pyx_v_value = values[3];
+ __pyx_v_context = values[4];
+ } else if (PyTuple_GET_SIZE(__pyx_args) != 5) {
+ goto __pyx_L5_argtuple_error;
+ } else {
__pyx_v_self = PyTuple_GET_ITEM(__pyx_args, 0);
__pyx_v_msg = PyTuple_GET_ITEM(__pyx_args, 1);
__pyx_v_type = PyTuple_GET_ITEM(__pyx_args, 2);
__pyx_v_value = PyTuple_GET_ITEM(__pyx_args, 3);
__pyx_v_context = PyTuple_GET_ITEM(__pyx_args, 4);
}
- else {
- if (unlikely(!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "OOOOO", __pyx_argnames, &__pyx_v_self, &__pyx_v_msg, &__pyx_v_type, &__pyx_v_value, &__pyx_v_context))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 22; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
- }
- goto __pyx_L4;
+ goto __pyx_L4_argument_unpacking_done;
+ __pyx_L5_argtuple_error:;
+ __Pyx_RaiseArgtupleInvalid("__init__", 1, 5, 5, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 22; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
__pyx_L3_error:;
__Pyx_AddTraceback("sphinx.pycode.pgen2.parse.ParseError.__init__");
return NULL;
- __pyx_L4:;
+ __pyx_L4_argument_unpacking_done:;
/* "/home/gbr/devel/sphinx/sphinx/pycode/pgen2/parse.pyx":23
*
@@ -392,7 +816,8 @@ static PyObject *__pyx_pf_6sphinx_6pycode_5pgen2_5parse_10ParseError___init__(Py
* (msg, type, value, context))
* self.msg = msg
*/
- __pyx_1 = PyObject_GetAttr(__pyx_builtin_Exception, __pyx_kp___init__); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 23; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PyObject_GetAttr(__pyx_builtin_Exception, __pyx_n_s____init__); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 23; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_1);
/* "/home/gbr/devel/sphinx/sphinx/pycode/pgen2/parse.pyx":24
* def __init__(self, msg, type, value, context):
@@ -401,26 +826,36 @@ static PyObject *__pyx_pf_6sphinx_6pycode_5pgen2_5parse_10ParseError___init__(Py
* self.msg = msg
* self.type = type
*/
- __pyx_2 = PyTuple_New(4); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 24; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- Py_INCREF(__pyx_v_msg);
- PyTuple_SET_ITEM(__pyx_2, 0, __pyx_v_msg);
- Py_INCREF(__pyx_v_type);
- PyTuple_SET_ITEM(__pyx_2, 1, __pyx_v_type);
- Py_INCREF(__pyx_v_value);
- PyTuple_SET_ITEM(__pyx_2, 2, __pyx_v_value);
- Py_INCREF(__pyx_v_context);
- PyTuple_SET_ITEM(__pyx_2, 3, __pyx_v_context);
- __pyx_3 = PyNumber_Remainder(__pyx_kp_3, ((PyObject *)__pyx_2)); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 23; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- Py_DECREF(((PyObject *)__pyx_2)); __pyx_2 = 0;
- __pyx_2 = PyTuple_New(2); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 23; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- Py_INCREF(__pyx_v_self);
- PyTuple_SET_ITEM(__pyx_2, 0, __pyx_v_self);
- PyTuple_SET_ITEM(__pyx_2, 1, __pyx_3);
- __pyx_3 = 0;
- __pyx_3 = PyObject_Call(__pyx_1, ((PyObject *)__pyx_2), NULL); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 23; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- Py_DECREF(__pyx_1); __pyx_1 = 0;
- Py_DECREF(((PyObject *)__pyx_2)); __pyx_2 = 0;
- Py_DECREF(__pyx_3); __pyx_3 = 0;
+ __pyx_t_2 = PyTuple_New(4); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 24; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_2);
+ __Pyx_INCREF(__pyx_v_msg);
+ PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_msg);
+ __Pyx_GIVEREF(__pyx_v_msg);
+ __Pyx_INCREF(__pyx_v_type);
+ PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_v_type);
+ __Pyx_GIVEREF(__pyx_v_type);
+ __Pyx_INCREF(__pyx_v_value);
+ PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_v_value);
+ __Pyx_GIVEREF(__pyx_v_value);
+ __Pyx_INCREF(__pyx_v_context);
+ PyTuple_SET_ITEM(__pyx_t_2, 3, __pyx_v_context);
+ __Pyx_GIVEREF(__pyx_v_context);
+ __pyx_t_3 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_1), __pyx_t_2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 23; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_3);
+ __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+ __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 23; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_2);
+ __Pyx_INCREF(__pyx_v_self);
+ PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_self);
+ __Pyx_GIVEREF(__pyx_v_self);
+ PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_3);
+ __Pyx_GIVEREF(__pyx_t_3);
+ __pyx_t_3 = 0;
+ __pyx_t_3 = PyObject_Call(__pyx_t_1, __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 23; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_3);
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+ __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+ __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
/* "/home/gbr/devel/sphinx/sphinx/pycode/pgen2/parse.pyx":25
* Exception.__init__(self, "%s: type=%r, value=%r, context=%r" %
@@ -429,7 +864,7 @@ static PyObject *__pyx_pf_6sphinx_6pycode_5pgen2_5parse_10ParseError___init__(Py
* self.type = type
* self.value = value
*/
- if (PyObject_SetAttr(__pyx_v_self, __pyx_kp_msg, __pyx_v_msg) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 25; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (PyObject_SetAttr(__pyx_v_self, __pyx_n_s__msg, __pyx_v_msg) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 25; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
/* "/home/gbr/devel/sphinx/sphinx/pycode/pgen2/parse.pyx":26
* (msg, type, value, context))
@@ -438,7 +873,7 @@ static PyObject *__pyx_pf_6sphinx_6pycode_5pgen2_5parse_10ParseError___init__(Py
* self.value = value
* self.context = context
*/
- if (PyObject_SetAttr(__pyx_v_self, __pyx_kp_type, __pyx_v_type) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 26; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (PyObject_SetAttr(__pyx_v_self, __pyx_n_s__type, __pyx_v_type) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 26; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
/* "/home/gbr/devel/sphinx/sphinx/pycode/pgen2/parse.pyx":27
* self.msg = msg
@@ -447,7 +882,7 @@ static PyObject *__pyx_pf_6sphinx_6pycode_5pgen2_5parse_10ParseError___init__(Py
* self.context = context
*
*/
- if (PyObject_SetAttr(__pyx_v_self, __pyx_kp_value, __pyx_v_value) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 27; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (PyObject_SetAttr(__pyx_v_self, __pyx_n_s__value, __pyx_v_value) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 27; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
/* "/home/gbr/devel/sphinx/sphinx/pycode/pgen2/parse.pyx":28
* self.type = type
@@ -456,22 +891,114 @@ static PyObject *__pyx_pf_6sphinx_6pycode_5pgen2_5parse_10ParseError___init__(Py
*
*
*/
- if (PyObject_SetAttr(__pyx_v_self, __pyx_kp_context, __pyx_v_context) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 28; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (PyObject_SetAttr(__pyx_v_self, __pyx_n_s__context, __pyx_v_context) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 28; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __pyx_r = Py_None; Py_INCREF(Py_None);
+ __pyx_r = Py_None; __Pyx_INCREF(Py_None);
goto __pyx_L0;
__pyx_L1_error:;
- Py_XDECREF(__pyx_1);
- Py_XDECREF(__pyx_2);
- Py_XDECREF(__pyx_3);
+ __Pyx_XDECREF(__pyx_t_1);
+ __Pyx_XDECREF(__pyx_t_2);
+ __Pyx_XDECREF(__pyx_t_3);
__Pyx_AddTraceback("sphinx.pycode.pgen2.parse.ParseError.__init__");
__pyx_r = NULL;
__pyx_L0:;
+ __Pyx_XGIVEREF(__pyx_r);
+ __Pyx_RefNannyFinishContext();
return __pyx_r;
}
-/* "/home/gbr/devel/sphinx/sphinx/pycode/pgen2/parse.pyx":36
- * cdef _grammar_number2symbol
+/* "/home/gbr/devel/sphinx/sphinx/pycode/pgen2/parse.pyx":34
+ * cdef public object grammar
+ * cdef public object rootnode
+ * cdef public list stack # <<<<<<<<<<<<<<
+ * cdef public set used_names
+ * cdef int _grammar_start
+ */
+
+static PyObject *__pyx_pf_6sphinx_6pycode_5pgen2_5parse_6Parser_5stack___get__(PyObject *__pyx_v_self); /*proto*/
+static PyObject *__pyx_pf_6sphinx_6pycode_5pgen2_5parse_6Parser_5stack___get__(PyObject *__pyx_v_self) {
+ PyObject *__pyx_r = NULL;
+ __Pyx_RefNannySetupContext("__get__");
+ __Pyx_XDECREF(__pyx_r);
+ __Pyx_INCREF(((PyObject *)((struct __pyx_obj_6sphinx_6pycode_5pgen2_5parse_Parser *)__pyx_v_self)->stack));
+ __pyx_r = ((PyObject *)((struct __pyx_obj_6sphinx_6pycode_5pgen2_5parse_Parser *)__pyx_v_self)->stack);
+ goto __pyx_L0;
+
+ __pyx_r = Py_None; __Pyx_INCREF(Py_None);
+ __pyx_L0:;
+ __Pyx_XGIVEREF(__pyx_r);
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+static int __pyx_pf_6sphinx_6pycode_5pgen2_5parse_6Parser_5stack___set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
+static int __pyx_pf_6sphinx_6pycode_5pgen2_5parse_6Parser_5stack___set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
+ int __pyx_r;
+ __Pyx_RefNannySetupContext("__set__");
+ if (!(likely(PyList_CheckExact(__pyx_v_value))||((__pyx_v_value) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected list, got %.200s", Py_TYPE(__pyx_v_value)->tp_name), 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 34; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_INCREF(__pyx_v_value);
+ __Pyx_GIVEREF(__pyx_v_value);
+ __Pyx_GOTREF(((struct __pyx_obj_6sphinx_6pycode_5pgen2_5parse_Parser *)__pyx_v_self)->stack);
+ __Pyx_DECREF(((PyObject *)((struct __pyx_obj_6sphinx_6pycode_5pgen2_5parse_Parser *)__pyx_v_self)->stack));
+ ((struct __pyx_obj_6sphinx_6pycode_5pgen2_5parse_Parser *)__pyx_v_self)->stack = ((PyObject *)__pyx_v_value);
+
+ __pyx_r = 0;
+ goto __pyx_L0;
+ __pyx_L1_error:;
+ __Pyx_AddTraceback("sphinx.pycode.pgen2.parse.Parser.stack.__set__");
+ __pyx_r = -1;
+ __pyx_L0:;
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+/* "/home/gbr/devel/sphinx/sphinx/pycode/pgen2/parse.pyx":35
+ * cdef public object rootnode
+ * cdef public list stack
+ * cdef public set used_names # <<<<<<<<<<<<<<
+ * cdef int _grammar_start
+ * cdef list _grammar_labels
+ */
+
+static PyObject *__pyx_pf_6sphinx_6pycode_5pgen2_5parse_6Parser_10used_names___get__(PyObject *__pyx_v_self); /*proto*/
+static PyObject *__pyx_pf_6sphinx_6pycode_5pgen2_5parse_6Parser_10used_names___get__(PyObject *__pyx_v_self) {
+ PyObject *__pyx_r = NULL;
+ __Pyx_RefNannySetupContext("__get__");
+ __Pyx_XDECREF(__pyx_r);
+ __Pyx_INCREF(((PyObject *)((struct __pyx_obj_6sphinx_6pycode_5pgen2_5parse_Parser *)__pyx_v_self)->used_names));
+ __pyx_r = ((PyObject *)((struct __pyx_obj_6sphinx_6pycode_5pgen2_5parse_Parser *)__pyx_v_self)->used_names);
+ goto __pyx_L0;
+
+ __pyx_r = Py_None; __Pyx_INCREF(Py_None);
+ __pyx_L0:;
+ __Pyx_XGIVEREF(__pyx_r);
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+static int __pyx_pf_6sphinx_6pycode_5pgen2_5parse_6Parser_10used_names___set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
+static int __pyx_pf_6sphinx_6pycode_5pgen2_5parse_6Parser_10used_names___set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
+ int __pyx_r;
+ __Pyx_RefNannySetupContext("__set__");
+ if (!(likely(PyAnySet_CheckExact(__pyx_v_value))||((__pyx_v_value) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected set, got %.200s", Py_TYPE(__pyx_v_value)->tp_name), 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 35; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_INCREF(__pyx_v_value);
+ __Pyx_GIVEREF(__pyx_v_value);
+ __Pyx_GOTREF(((struct __pyx_obj_6sphinx_6pycode_5pgen2_5parse_Parser *)__pyx_v_self)->used_names);
+ __Pyx_DECREF(((PyObject *)((struct __pyx_obj_6sphinx_6pycode_5pgen2_5parse_Parser *)__pyx_v_self)->used_names));
+ ((struct __pyx_obj_6sphinx_6pycode_5pgen2_5parse_Parser *)__pyx_v_self)->used_names = ((PyObject *)__pyx_v_value);
+
+ __pyx_r = 0;
+ goto __pyx_L0;
+ __pyx_L1_error:;
+ __Pyx_AddTraceback("sphinx.pycode.pgen2.parse.Parser.used_names.__set__");
+ __pyx_r = -1;
+ __pyx_L0:;
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+/* "/home/gbr/devel/sphinx/sphinx/pycode/pgen2/parse.pyx":43
+ * cdef dict _grammar_number2symbol
*
* def __init__(self, grammar, convert=None): # <<<<<<<<<<<<<<
* self.grammar = grammar
@@ -483,111 +1010,176 @@ static int __pyx_pf_6sphinx_6pycode_5pgen2_5parse_6Parser___init__(PyObject *__p
PyObject *__pyx_v_grammar = 0;
PyObject *__pyx_v_convert = 0;
int __pyx_r;
- PyObject *__pyx_1 = 0;
- static char *__pyx_argnames[] = {"grammar","convert",0};
- __pyx_v_convert = Py_None;
- if (likely(!__pyx_kwds) && likely(1 <= PyTuple_GET_SIZE(__pyx_args)) && likely(PyTuple_GET_SIZE(__pyx_args) <= 2)) {
- __pyx_v_grammar = PyTuple_GET_ITEM(__pyx_args, 0);
- if (PyTuple_GET_SIZE(__pyx_args) > 1) {
- __pyx_v_convert = PyTuple_GET_ITEM(__pyx_args, 1);
+ PyObject *__pyx_t_1 = NULL;
+ int __pyx_t_2;
+ static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__grammar,&__pyx_n_s__convert,0};
+ __Pyx_RefNannySetupContext("__init__");
+ if (unlikely(__pyx_kwds)) {
+ Py_ssize_t kw_args = PyDict_Size(__pyx_kwds);
+ PyObject* values[2] = {0,0};
+ values[1] = ((PyObject *)Py_None);
+ switch (PyTuple_GET_SIZE(__pyx_args)) {
+ case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
+ case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
+ case 0: break;
+ default: goto __pyx_L5_argtuple_error;
+ }
+ switch (PyTuple_GET_SIZE(__pyx_args)) {
+ case 0:
+ values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__grammar);
+ if (likely(values[0])) kw_args--;
+ else goto __pyx_L5_argtuple_error;
+ case 1:
+ if (kw_args > 1) {
+ PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__convert);
+ if (unlikely(value)) { values[1] = value; kw_args--; }
+ }
+ }
+ if (unlikely(kw_args > 0)) {
+ if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "__init__") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 43; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ }
+ __pyx_v_grammar = values[0];
+ __pyx_v_convert = values[1];
+ } else {
+ __pyx_v_convert = ((PyObject *)Py_None);
+ switch (PyTuple_GET_SIZE(__pyx_args)) {
+ case 2: __pyx_v_convert = PyTuple_GET_ITEM(__pyx_args, 1);
+ case 1: __pyx_v_grammar = PyTuple_GET_ITEM(__pyx_args, 0);
+ break;
+ default: goto __pyx_L5_argtuple_error;
}
}
- else {
- if (unlikely(!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "O|O", __pyx_argnames, &__pyx_v_grammar, &__pyx_v_convert))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 36; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
- }
- goto __pyx_L4;
+ goto __pyx_L4_argument_unpacking_done;
+ __pyx_L5_argtuple_error:;
+ __Pyx_RaiseArgtupleInvalid("__init__", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 43; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
__pyx_L3_error:;
__Pyx_AddTraceback("sphinx.pycode.pgen2.parse.Parser.__init__");
return -1;
- __pyx_L4:;
+ __pyx_L4_argument_unpacking_done:;
- /* "/home/gbr/devel/sphinx/sphinx/pycode/pgen2/parse.pyx":37
+ /* "/home/gbr/devel/sphinx/sphinx/pycode/pgen2/parse.pyx":44
*
* def __init__(self, grammar, convert=None):
* self.grammar = grammar # <<<<<<<<<<<<<<
* #self.convert = convert or noconvert
*
*/
- Py_INCREF(__pyx_v_grammar);
- Py_DECREF(((struct __pyx_obj_6sphinx_6pycode_5pgen2_5parse_Parser *)__pyx_v_self)->grammar);
+ __Pyx_INCREF(__pyx_v_grammar);
+ __Pyx_GIVEREF(__pyx_v_grammar);
+ __Pyx_GOTREF(((struct __pyx_obj_6sphinx_6pycode_5pgen2_5parse_Parser *)__pyx_v_self)->grammar);
+ __Pyx_DECREF(((struct __pyx_obj_6sphinx_6pycode_5pgen2_5parse_Parser *)__pyx_v_self)->grammar);
((struct __pyx_obj_6sphinx_6pycode_5pgen2_5parse_Parser *)__pyx_v_self)->grammar = __pyx_v_grammar;
- /* "/home/gbr/devel/sphinx/sphinx/pycode/pgen2/parse.pyx":40
+ /* "/home/gbr/devel/sphinx/sphinx/pycode/pgen2/parse.pyx":47
* #self.convert = convert or noconvert
*
* self._grammar_dfas = grammar.dfas # <<<<<<<<<<<<<<
* self._grammar_labels = grammar.labels
* self._grammar_keywords = grammar.keywords
*/
- __pyx_1 = PyObject_GetAttr(__pyx_v_grammar, __pyx_kp_dfas); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 40; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- Py_DECREF(((struct __pyx_obj_6sphinx_6pycode_5pgen2_5parse_Parser *)__pyx_v_self)->_grammar_dfas);
- ((struct __pyx_obj_6sphinx_6pycode_5pgen2_5parse_Parser *)__pyx_v_self)->_grammar_dfas = __pyx_1;
- __pyx_1 = 0;
-
- /* "/home/gbr/devel/sphinx/sphinx/pycode/pgen2/parse.pyx":41
+ __pyx_t_1 = PyObject_GetAttr(__pyx_v_grammar, __pyx_n_s__dfas); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 47; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_1);
+ if (!(likely(PyDict_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected dict, got %.200s", Py_TYPE(__pyx_t_1)->tp_name), 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 47; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GIVEREF(__pyx_t_1);
+ __Pyx_GOTREF(((struct __pyx_obj_6sphinx_6pycode_5pgen2_5parse_Parser *)__pyx_v_self)->_grammar_dfas);
+ __Pyx_DECREF(((PyObject *)((struct __pyx_obj_6sphinx_6pycode_5pgen2_5parse_Parser *)__pyx_v_self)->_grammar_dfas));
+ ((struct __pyx_obj_6sphinx_6pycode_5pgen2_5parse_Parser *)__pyx_v_self)->_grammar_dfas = ((PyObject *)__pyx_t_1);
+ __pyx_t_1 = 0;
+
+ /* "/home/gbr/devel/sphinx/sphinx/pycode/pgen2/parse.pyx":48
*
* self._grammar_dfas = grammar.dfas
* self._grammar_labels = grammar.labels # <<<<<<<<<<<<<<
* self._grammar_keywords = grammar.keywords
* self._grammar_tokens = grammar.tokens
*/
- __pyx_1 = PyObject_GetAttr(__pyx_v_grammar, __pyx_kp_labels); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 41; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- Py_DECREF(((struct __pyx_obj_6sphinx_6pycode_5pgen2_5parse_Parser *)__pyx_v_self)->_grammar_labels);
- ((struct __pyx_obj_6sphinx_6pycode_5pgen2_5parse_Parser *)__pyx_v_self)->_grammar_labels = __pyx_1;
- __pyx_1 = 0;
-
- /* "/home/gbr/devel/sphinx/sphinx/pycode/pgen2/parse.pyx":42
+ __pyx_t_1 = PyObject_GetAttr(__pyx_v_grammar, __pyx_n_s__labels); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 48; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_1);
+ if (!(likely(PyList_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected list, got %.200s", Py_TYPE(__pyx_t_1)->tp_name), 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 48; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GIVEREF(__pyx_t_1);
+ __Pyx_GOTREF(((struct __pyx_obj_6sphinx_6pycode_5pgen2_5parse_Parser *)__pyx_v_self)->_grammar_labels);
+ __Pyx_DECREF(((PyObject *)((struct __pyx_obj_6sphinx_6pycode_5pgen2_5parse_Parser *)__pyx_v_self)->_grammar_labels));
+ ((struct __pyx_obj_6sphinx_6pycode_5pgen2_5parse_Parser *)__pyx_v_self)->_grammar_labels = ((PyObject *)__pyx_t_1);
+ __pyx_t_1 = 0;
+
+ /* "/home/gbr/devel/sphinx/sphinx/pycode/pgen2/parse.pyx":49
* self._grammar_dfas = grammar.dfas
* self._grammar_labels = grammar.labels
* self._grammar_keywords = grammar.keywords # <<<<<<<<<<<<<<
* self._grammar_tokens = grammar.tokens
* self._grammar_number2symbol = grammar.number2symbol
*/
- __pyx_1 = PyObject_GetAttr(__pyx_v_grammar, __pyx_kp_keywords); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 42; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- Py_DECREF(((struct __pyx_obj_6sphinx_6pycode_5pgen2_5parse_Parser *)__pyx_v_self)->_grammar_keywords);
- ((struct __pyx_obj_6sphinx_6pycode_5pgen2_5parse_Parser *)__pyx_v_self)->_grammar_keywords = __pyx_1;
- __pyx_1 = 0;
-
- /* "/home/gbr/devel/sphinx/sphinx/pycode/pgen2/parse.pyx":43
+ __pyx_t_1 = PyObject_GetAttr(__pyx_v_grammar, __pyx_n_s__keywords); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 49; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_1);
+ if (!(likely(PyDict_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected dict, got %.200s", Py_TYPE(__pyx_t_1)->tp_name), 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 49; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GIVEREF(__pyx_t_1);
+ __Pyx_GOTREF(((struct __pyx_obj_6sphinx_6pycode_5pgen2_5parse_Parser *)__pyx_v_self)->_grammar_keywords);
+ __Pyx_DECREF(((PyObject *)((struct __pyx_obj_6sphinx_6pycode_5pgen2_5parse_Parser *)__pyx_v_self)->_grammar_keywords));
+ ((struct __pyx_obj_6sphinx_6pycode_5pgen2_5parse_Parser *)__pyx_v_self)->_grammar_keywords = ((PyObject *)__pyx_t_1);
+ __pyx_t_1 = 0;
+
+ /* "/home/gbr/devel/sphinx/sphinx/pycode/pgen2/parse.pyx":50
* self._grammar_labels = grammar.labels
* self._grammar_keywords = grammar.keywords
* self._grammar_tokens = grammar.tokens # <<<<<<<<<<<<<<
* self._grammar_number2symbol = grammar.number2symbol
- *
+ * self._grammar_start = grammar.start
*/
- __pyx_1 = PyObject_GetAttr(__pyx_v_grammar, __pyx_kp_tokens); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 43; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- Py_DECREF(((struct __pyx_obj_6sphinx_6pycode_5pgen2_5parse_Parser *)__pyx_v_self)->_grammar_tokens);
- ((struct __pyx_obj_6sphinx_6pycode_5pgen2_5parse_Parser *)__pyx_v_self)->_grammar_tokens = __pyx_1;
- __pyx_1 = 0;
-
- /* "/home/gbr/devel/sphinx/sphinx/pycode/pgen2/parse.pyx":44
+ __pyx_t_1 = PyObject_GetAttr(__pyx_v_grammar, __pyx_n_s__tokens); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 50; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_1);
+ if (!(likely(PyDict_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected dict, got %.200s", Py_TYPE(__pyx_t_1)->tp_name), 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 50; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GIVEREF(__pyx_t_1);
+ __Pyx_GOTREF(((struct __pyx_obj_6sphinx_6pycode_5pgen2_5parse_Parser *)__pyx_v_self)->_grammar_tokens);
+ __Pyx_DECREF(((PyObject *)((struct __pyx_obj_6sphinx_6pycode_5pgen2_5parse_Parser *)__pyx_v_self)->_grammar_tokens));
+ ((struct __pyx_obj_6sphinx_6pycode_5pgen2_5parse_Parser *)__pyx_v_self)->_grammar_tokens = ((PyObject *)__pyx_t_1);
+ __pyx_t_1 = 0;
+
+ /* "/home/gbr/devel/sphinx/sphinx/pycode/pgen2/parse.pyx":51
* self._grammar_keywords = grammar.keywords
* self._grammar_tokens = grammar.tokens
* self._grammar_number2symbol = grammar.number2symbol # <<<<<<<<<<<<<<
+ * self._grammar_start = grammar.start
+ *
+ */
+ __pyx_t_1 = PyObject_GetAttr(__pyx_v_grammar, __pyx_n_s__number2symbol); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 51; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_1);
+ if (!(likely(PyDict_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected dict, got %.200s", Py_TYPE(__pyx_t_1)->tp_name), 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 51; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GIVEREF(__pyx_t_1);
+ __Pyx_GOTREF(((struct __pyx_obj_6sphinx_6pycode_5pgen2_5parse_Parser *)__pyx_v_self)->_grammar_number2symbol);
+ __Pyx_DECREF(((PyObject *)((struct __pyx_obj_6sphinx_6pycode_5pgen2_5parse_Parser *)__pyx_v_self)->_grammar_number2symbol));
+ ((struct __pyx_obj_6sphinx_6pycode_5pgen2_5parse_Parser *)__pyx_v_self)->_grammar_number2symbol = ((PyObject *)__pyx_t_1);
+ __pyx_t_1 = 0;
+
+ /* "/home/gbr/devel/sphinx/sphinx/pycode/pgen2/parse.pyx":52
+ * self._grammar_tokens = grammar.tokens
+ * self._grammar_number2symbol = grammar.number2symbol
+ * self._grammar_start = grammar.start # <<<<<<<<<<<<<<
*
* def setup(self, start=None):
*/
- __pyx_1 = PyObject_GetAttr(__pyx_v_grammar, __pyx_kp_4); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 44; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- Py_DECREF(((struct __pyx_obj_6sphinx_6pycode_5pgen2_5parse_Parser *)__pyx_v_self)->_grammar_number2symbol);
- ((struct __pyx_obj_6sphinx_6pycode_5pgen2_5parse_Parser *)__pyx_v_self)->_grammar_number2symbol = __pyx_1;
- __pyx_1 = 0;
+ __pyx_t_1 = PyObject_GetAttr(__pyx_v_grammar, __pyx_n_s__start); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 52; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_1);
+ __pyx_t_2 = __Pyx_PyInt_AsInt(__pyx_t_1); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 52; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+ ((struct __pyx_obj_6sphinx_6pycode_5pgen2_5parse_Parser *)__pyx_v_self)->_grammar_start = __pyx_t_2;
__pyx_r = 0;
goto __pyx_L0;
__pyx_L1_error:;
- Py_XDECREF(__pyx_1);
+ __Pyx_XDECREF(__pyx_t_1);
__Pyx_AddTraceback("sphinx.pycode.pgen2.parse.Parser.__init__");
__pyx_r = -1;
__pyx_L0:;
+ __Pyx_RefNannyFinishContext();
return __pyx_r;
}
-/* "/home/gbr/devel/sphinx/sphinx/pycode/pgen2/parse.pyx":46
- * self._grammar_number2symbol = grammar.number2symbol
+/* "/home/gbr/devel/sphinx/sphinx/pycode/pgen2/parse.pyx":54
+ * self._grammar_start = grammar.start
*
* def setup(self, start=None): # <<<<<<<<<<<<<<
* if start is None:
- * start = self.grammar.start
+ * start = self._grammar_start
*/
static PyObject *__pyx_pf_6sphinx_6pycode_5pgen2_5parse_6Parser_setup(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
@@ -595,149 +1187,197 @@ static PyObject *__pyx_pf_6sphinx_6pycode_5pgen2_5parse_6Parser_setup(PyObject *
PyObject *__pyx_v_start = 0;
PyObject *__pyx_v_newnode;
PyObject *__pyx_v_stackentry;
- PyObject *__pyx_r;
- int __pyx_1;
- PyObject *__pyx_2 = 0;
- PyObject *__pyx_3 = 0;
- static char *__pyx_argnames[] = {"start",0};
- __pyx_v_start = Py_None;
- if (likely(!__pyx_kwds) && likely(0 <= PyTuple_GET_SIZE(__pyx_args)) && likely(PyTuple_GET_SIZE(__pyx_args) <= 1)) {
- if (PyTuple_GET_SIZE(__pyx_args) > 0) {
- __pyx_v_start = PyTuple_GET_ITEM(__pyx_args, 0);
+ PyObject *__pyx_r = NULL;
+ int __pyx_t_1;
+ PyObject *__pyx_t_2 = NULL;
+ PyObject *__pyx_t_3 = NULL;
+ static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__start,0};
+ __Pyx_RefNannySetupContext("setup");
+ if (unlikely(__pyx_kwds)) {
+ Py_ssize_t kw_args = PyDict_Size(__pyx_kwds);
+ PyObject* values[1] = {0};
+ values[0] = ((PyObject *)Py_None);
+ switch (PyTuple_GET_SIZE(__pyx_args)) {
+ case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
+ case 0: break;
+ default: goto __pyx_L5_argtuple_error;
+ }
+ switch (PyTuple_GET_SIZE(__pyx_args)) {
+ case 0:
+ if (kw_args > 1) {
+ PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__start);
+ if (unlikely(value)) { values[0] = value; kw_args--; }
+ }
+ }
+ if (unlikely(kw_args > 0)) {
+ if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "setup") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 54; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ }
+ __pyx_v_start = values[0];
+ } else {
+ __pyx_v_start = ((PyObject *)Py_None);
+ switch (PyTuple_GET_SIZE(__pyx_args)) {
+ case 1: __pyx_v_start = PyTuple_GET_ITEM(__pyx_args, 0);
+ case 0: break;
+ default: goto __pyx_L5_argtuple_error;
}
}
- else {
- if (unlikely(!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "|O", __pyx_argnames, &__pyx_v_start))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 46; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
- }
- goto __pyx_L4;
+ goto __pyx_L4_argument_unpacking_done;
+ __pyx_L5_argtuple_error:;
+ __Pyx_RaiseArgtupleInvalid("setup", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 54; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
__pyx_L3_error:;
__Pyx_AddTraceback("sphinx.pycode.pgen2.parse.Parser.setup");
return NULL;
- __pyx_L4:;
- Py_INCREF(__pyx_v_start);
- __pyx_v_newnode = Py_None; Py_INCREF(Py_None);
- __pyx_v_stackentry = Py_None; Py_INCREF(Py_None);
+ __pyx_L4_argument_unpacking_done:;
+ __Pyx_INCREF((PyObject *)__pyx_v_self);
+ __Pyx_INCREF(__pyx_v_start);
+ __pyx_v_newnode = Py_None; __Pyx_INCREF(Py_None);
+ __pyx_v_stackentry = Py_None; __Pyx_INCREF(Py_None);
- /* "/home/gbr/devel/sphinx/sphinx/pycode/pgen2/parse.pyx":47
+ /* "/home/gbr/devel/sphinx/sphinx/pycode/pgen2/parse.pyx":55
*
* def setup(self, start=None):
* if start is None: # <<<<<<<<<<<<<<
- * start = self.grammar.start
+ * start = self._grammar_start
* # Each stack entry is a tuple: (dfa, state, node).
*/
- __pyx_1 = (__pyx_v_start == Py_None);
- if (__pyx_1) {
+ __pyx_t_1 = (__pyx_v_start == Py_None);
+ if (__pyx_t_1) {
- /* "/home/gbr/devel/sphinx/sphinx/pycode/pgen2/parse.pyx":48
+ /* "/home/gbr/devel/sphinx/sphinx/pycode/pgen2/parse.pyx":56
* def setup(self, start=None):
* if start is None:
- * start = self.grammar.start # <<<<<<<<<<<<<<
+ * start = self._grammar_start # <<<<<<<<<<<<<<
* # Each stack entry is a tuple: (dfa, state, node).
* # A node is a tuple: (type, value, context, children),
*/
- __pyx_2 = PyObject_GetAttr(((struct __pyx_obj_6sphinx_6pycode_5pgen2_5parse_Parser *)__pyx_v_self)->grammar, __pyx_kp_start); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 48; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- Py_DECREF(__pyx_v_start);
- __pyx_v_start = __pyx_2;
- __pyx_2 = 0;
- goto __pyx_L5;
+ __pyx_t_2 = PyInt_FromLong(((struct __pyx_obj_6sphinx_6pycode_5pgen2_5parse_Parser *)__pyx_v_self)->_grammar_start); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 56; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_2);
+ __Pyx_DECREF(__pyx_v_start);
+ __pyx_v_start = __pyx_t_2;
+ __pyx_t_2 = 0;
+ goto __pyx_L6;
}
- __pyx_L5:;
+ __pyx_L6:;
- /* "/home/gbr/devel/sphinx/sphinx/pycode/pgen2/parse.pyx":52
+ /* "/home/gbr/devel/sphinx/sphinx/pycode/pgen2/parse.pyx":60
* # A node is a tuple: (type, value, context, children),
* # where children is a list of nodes or None, and context may be None.
* newnode = (start, None, None, []) # <<<<<<<<<<<<<<
* stackentry = (self._grammar_dfas[start], 0, newnode)
* self.stack = [stackentry]
*/
- __pyx_2 = PyList_New(0); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 52; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __pyx_3 = PyTuple_New(4); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 52; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- Py_INCREF(__pyx_v_start);
- PyTuple_SET_ITEM(__pyx_3, 0, __pyx_v_start);
- Py_INCREF(Py_None);
- PyTuple_SET_ITEM(__pyx_3, 1, Py_None);
- Py_INCREF(Py_None);
- PyTuple_SET_ITEM(__pyx_3, 2, Py_None);
- PyTuple_SET_ITEM(__pyx_3, 3, ((PyObject *)__pyx_2));
- __pyx_2 = 0;
- Py_DECREF(__pyx_v_newnode);
- __pyx_v_newnode = ((PyObject *)__pyx_3);
- __pyx_3 = 0;
-
- /* "/home/gbr/devel/sphinx/sphinx/pycode/pgen2/parse.pyx":53
+ __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 60; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(((PyObject *)__pyx_t_2));
+ __pyx_t_3 = PyTuple_New(4); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 60; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_3);
+ __Pyx_INCREF(__pyx_v_start);
+ PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_start);
+ __Pyx_GIVEREF(__pyx_v_start);
+ __Pyx_INCREF(Py_None);
+ PyTuple_SET_ITEM(__pyx_t_3, 1, Py_None);
+ __Pyx_GIVEREF(Py_None);
+ __Pyx_INCREF(Py_None);
+ PyTuple_SET_ITEM(__pyx_t_3, 2, Py_None);
+ __Pyx_GIVEREF(Py_None);
+ PyTuple_SET_ITEM(__pyx_t_3, 3, ((PyObject *)__pyx_t_2));
+ __Pyx_GIVEREF(((PyObject *)__pyx_t_2));
+ __pyx_t_2 = 0;
+ __Pyx_DECREF(__pyx_v_newnode);
+ __pyx_v_newnode = __pyx_t_3;
+ __pyx_t_3 = 0;
+
+ /* "/home/gbr/devel/sphinx/sphinx/pycode/pgen2/parse.pyx":61
* # where children is a list of nodes or None, and context may be None.
* newnode = (start, None, None, [])
* stackentry = (self._grammar_dfas[start], 0, newnode) # <<<<<<<<<<<<<<
* self.stack = [stackentry]
* self.rootnode = None
*/
- __pyx_2 = PyObject_GetItem(((struct __pyx_obj_6sphinx_6pycode_5pgen2_5parse_Parser *)__pyx_v_self)->_grammar_dfas, __pyx_v_start); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 53; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __pyx_3 = PyTuple_New(3); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 53; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- PyTuple_SET_ITEM(__pyx_3, 0, __pyx_2);
- Py_INCREF(__pyx_int_0);
- PyTuple_SET_ITEM(__pyx_3, 1, __pyx_int_0);
- Py_INCREF(__pyx_v_newnode);
- PyTuple_SET_ITEM(__pyx_3, 2, __pyx_v_newnode);
- __pyx_2 = 0;
- Py_DECREF(__pyx_v_stackentry);
- __pyx_v_stackentry = ((PyObject *)__pyx_3);
- __pyx_3 = 0;
-
- /* "/home/gbr/devel/sphinx/sphinx/pycode/pgen2/parse.pyx":54
+ __pyx_t_3 = PyObject_GetItem(((PyObject *)((struct __pyx_obj_6sphinx_6pycode_5pgen2_5parse_Parser *)__pyx_v_self)->_grammar_dfas), __pyx_v_start); if (!__pyx_t_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 61; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_3);
+ __pyx_t_2 = PyTuple_New(3); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 61; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_2);
+ PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_3);
+ __Pyx_GIVEREF(__pyx_t_3);
+ __Pyx_INCREF(__pyx_int_0);
+ PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_int_0);
+ __Pyx_GIVEREF(__pyx_int_0);
+ __Pyx_INCREF(__pyx_v_newnode);
+ PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_v_newnode);
+ __Pyx_GIVEREF(__pyx_v_newnode);
+ __pyx_t_3 = 0;
+ __Pyx_DECREF(__pyx_v_stackentry);
+ __pyx_v_stackentry = __pyx_t_2;
+ __pyx_t_2 = 0;
+
+ /* "/home/gbr/devel/sphinx/sphinx/pycode/pgen2/parse.pyx":62
* newnode = (start, None, None, [])
* stackentry = (self._grammar_dfas[start], 0, newnode)
* self.stack = [stackentry] # <<<<<<<<<<<<<<
* self.rootnode = None
* self.used_names = set() # Aliased to self.rootnode.used_names in pop()
*/
- __pyx_2 = PyList_New(1); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 54; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- Py_INCREF(__pyx_v_stackentry);
- PyList_SET_ITEM(__pyx_2, 0, __pyx_v_stackentry);
- Py_DECREF(((struct __pyx_obj_6sphinx_6pycode_5pgen2_5parse_Parser *)__pyx_v_self)->stack);
- ((struct __pyx_obj_6sphinx_6pycode_5pgen2_5parse_Parser *)__pyx_v_self)->stack = ((PyObject *)__pyx_2);
- __pyx_2 = 0;
-
- /* "/home/gbr/devel/sphinx/sphinx/pycode/pgen2/parse.pyx":55
+ __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 62; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(((PyObject *)__pyx_t_2));
+ __Pyx_INCREF(__pyx_v_stackentry);
+ PyList_SET_ITEM(__pyx_t_2, 0, __pyx_v_stackentry);
+ __Pyx_GIVEREF(__pyx_v_stackentry);
+ __Pyx_GIVEREF(((PyObject *)__pyx_t_2));
+ __Pyx_GOTREF(((struct __pyx_obj_6sphinx_6pycode_5pgen2_5parse_Parser *)__pyx_v_self)->stack);
+ __Pyx_DECREF(((PyObject *)((struct __pyx_obj_6sphinx_6pycode_5pgen2_5parse_Parser *)__pyx_v_self)->stack));
+ ((struct __pyx_obj_6sphinx_6pycode_5pgen2_5parse_Parser *)__pyx_v_self)->stack = __pyx_t_2;
+ __pyx_t_2 = 0;
+
+ /* "/home/gbr/devel/sphinx/sphinx/pycode/pgen2/parse.pyx":63
* stackentry = (self._grammar_dfas[start], 0, newnode)
* self.stack = [stackentry]
* self.rootnode = None # <<<<<<<<<<<<<<
* self.used_names = set() # Aliased to self.rootnode.used_names in pop()
*
*/
- Py_INCREF(Py_None);
- Py_DECREF(((struct __pyx_obj_6sphinx_6pycode_5pgen2_5parse_Parser *)__pyx_v_self)->rootnode);
+ __Pyx_INCREF(Py_None);
+ __Pyx_GIVEREF(Py_None);
+ __Pyx_GOTREF(((struct __pyx_obj_6sphinx_6pycode_5pgen2_5parse_Parser *)__pyx_v_self)->rootnode);
+ __Pyx_DECREF(((struct __pyx_obj_6sphinx_6pycode_5pgen2_5parse_Parser *)__pyx_v_self)->rootnode);
((struct __pyx_obj_6sphinx_6pycode_5pgen2_5parse_Parser *)__pyx_v_self)->rootnode = Py_None;
- /* "/home/gbr/devel/sphinx/sphinx/pycode/pgen2/parse.pyx":56
+ /* "/home/gbr/devel/sphinx/sphinx/pycode/pgen2/parse.pyx":64
* self.stack = [stackentry]
* self.rootnode = None
* self.used_names = set() # Aliased to self.rootnode.used_names in pop() # <<<<<<<<<<<<<<
*
- * def addtoken(self, type, value, context):
+ * def addtoken(self, int type, value, context):
*/
- __pyx_3 = PyObject_Call(((PyObject*)&PySet_Type), ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 56; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- Py_DECREF(((struct __pyx_obj_6sphinx_6pycode_5pgen2_5parse_Parser *)__pyx_v_self)->used_names);
- ((struct __pyx_obj_6sphinx_6pycode_5pgen2_5parse_Parser *)__pyx_v_self)->used_names = __pyx_3;
- __pyx_3 = 0;
-
- __pyx_r = Py_None; Py_INCREF(Py_None);
+ __pyx_t_2 = PySet_New(0); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 64; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(((PyObject *)__pyx_t_2));
+ if (!(likely(PyAnySet_CheckExact(((PyObject *)__pyx_t_2)))||((((PyObject *)__pyx_t_2)) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected set, got %.200s", Py_TYPE(((PyObject *)__pyx_t_2))->tp_name), 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 64; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GIVEREF(__pyx_t_2);
+ __Pyx_GOTREF(((struct __pyx_obj_6sphinx_6pycode_5pgen2_5parse_Parser *)__pyx_v_self)->used_names);
+ __Pyx_DECREF(((PyObject *)((struct __pyx_obj_6sphinx_6pycode_5pgen2_5parse_Parser *)__pyx_v_self)->used_names));
+ ((struct __pyx_obj_6sphinx_6pycode_5pgen2_5parse_Parser *)__pyx_v_self)->used_names = ((PyObject *)__pyx_t_2);
+ __pyx_t_2 = 0;
+
+ __pyx_r = Py_None; __Pyx_INCREF(Py_None);
goto __pyx_L0;
__pyx_L1_error:;
- Py_XDECREF(__pyx_2);
- Py_XDECREF(__pyx_3);
+ __Pyx_XDECREF(__pyx_t_2);
+ __Pyx_XDECREF(__pyx_t_3);
__Pyx_AddTraceback("sphinx.pycode.pgen2.parse.Parser.setup");
__pyx_r = NULL;
__pyx_L0:;
- Py_DECREF(__pyx_v_newnode);
- Py_DECREF(__pyx_v_stackentry);
- Py_DECREF(__pyx_v_start);
+ __Pyx_DECREF(__pyx_v_newnode);
+ __Pyx_DECREF(__pyx_v_stackentry);
+ __Pyx_DECREF((PyObject *)__pyx_v_self);
+ __Pyx_DECREF(__pyx_v_start);
+ __Pyx_XGIVEREF(__pyx_r);
+ __Pyx_RefNannyFinishContext();
return __pyx_r;
}
-/* "/home/gbr/devel/sphinx/sphinx/pycode/pgen2/parse.pyx":58
+/* "/home/gbr/devel/sphinx/sphinx/pycode/pgen2/parse.pyx":66
* self.used_names = set() # Aliased to self.rootnode.used_names in pop()
*
- * def addtoken(self, type, value, context): # <<<<<<<<<<<<<<
+ * def addtoken(self, int type, value, context): # <<<<<<<<<<<<<<
* """Add a token; return True iff this is the end of the program."""
* cdef int ilabel, i, t, state, newstate
*/
@@ -745,7 +1385,7 @@ static PyObject *__pyx_pf_6sphinx_6pycode_5pgen2_5parse_6Parser_setup(PyObject *
static PyObject *__pyx_pf_6sphinx_6pycode_5pgen2_5parse_6Parser_addtoken(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_6sphinx_6pycode_5pgen2_5parse_6Parser_addtoken[] = "Add a token; return True iff this is the end of the program.";
static PyObject *__pyx_pf_6sphinx_6pycode_5pgen2_5parse_6Parser_addtoken(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
- PyObject *__pyx_v_type = 0;
+ int __pyx_v_type;
PyObject *__pyx_v_value = 0;
PyObject *__pyx_v_context = 0;
int __pyx_v_ilabel;
@@ -762,40 +1402,82 @@ static PyObject *__pyx_pf_6sphinx_6pycode_5pgen2_5parse_6Parser_addtoken(PyObjec
PyObject *__pyx_v_itsdfa;
PyObject *__pyx_v_itsstates;
PyObject *__pyx_v_itsfirst;
- PyObject *__pyx_r;
- int __pyx_1;
- PyObject *__pyx_2 = 0;
- PyObject *__pyx_3 = 0;
- PyObject *__pyx_4 = 0;
- int __pyx_5;
- Py_ssize_t __pyx_6 = 0;
- PyObject *__pyx_7 = 0;
- int __pyx_8;
- static char *__pyx_argnames[] = {"type","value","context",0};
- if (likely(!__pyx_kwds) && likely(PyTuple_GET_SIZE(__pyx_args) == 3)) {
- __pyx_v_type = PyTuple_GET_ITEM(__pyx_args, 0);
+ PyObject *__pyx_r = NULL;
+ int __pyx_t_1;
+ PyObject *__pyx_t_2 = NULL;
+ PyObject *__pyx_t_3 = NULL;
+ PyObject *__pyx_t_4 = NULL;
+ PyObject *__pyx_t_5 = NULL;
+ int __pyx_t_6;
+ PyObject *__pyx_t_7 = NULL;
+ Py_ssize_t __pyx_t_8;
+ int __pyx_t_9;
+ int __pyx_t_10;
+ PyObject *__pyx_t_11 = NULL;
+ static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__type,&__pyx_n_s__value,&__pyx_n_s__context,0};
+ __Pyx_RefNannySetupContext("addtoken");
+ if (unlikely(__pyx_kwds)) {
+ Py_ssize_t kw_args = PyDict_Size(__pyx_kwds);
+ PyObject* values[3] = {0,0,0};
+ switch (PyTuple_GET_SIZE(__pyx_args)) {
+ case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
+ case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
+ case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
+ case 0: break;
+ default: goto __pyx_L5_argtuple_error;
+ }
+ switch (PyTuple_GET_SIZE(__pyx_args)) {
+ case 0:
+ values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__type);
+ if (likely(values[0])) kw_args--;
+ else goto __pyx_L5_argtuple_error;
+ case 1:
+ values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__value);
+ if (likely(values[1])) kw_args--;
+ else {
+ __Pyx_RaiseArgtupleInvalid("addtoken", 1, 3, 3, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 66; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ }
+ case 2:
+ values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__context);
+ if (likely(values[2])) kw_args--;
+ else {
+ __Pyx_RaiseArgtupleInvalid("addtoken", 1, 3, 3, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 66; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ }
+ }
+ if (unlikely(kw_args > 0)) {
+ if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "addtoken") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 66; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ }
+ __pyx_v_type = __Pyx_PyInt_AsInt(values[0]); if (unlikely((__pyx_v_type == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 66; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __pyx_v_value = values[1];
+ __pyx_v_context = values[2];
+ } else if (PyTuple_GET_SIZE(__pyx_args) != 3) {
+ goto __pyx_L5_argtuple_error;
+ } else {
+ __pyx_v_type = __Pyx_PyInt_AsInt(PyTuple_GET_ITEM(__pyx_args, 0)); if (unlikely((__pyx_v_type == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 66; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
__pyx_v_value = PyTuple_GET_ITEM(__pyx_args, 1);
__pyx_v_context = PyTuple_GET_ITEM(__pyx_args, 2);
}
- else {
- if (unlikely(!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "OOO", __pyx_argnames, &__pyx_v_type, &__pyx_v_value, &__pyx_v_context))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 58; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
- }
- goto __pyx_L4;
+ goto __pyx_L4_argument_unpacking_done;
+ __pyx_L5_argtuple_error:;
+ __Pyx_RaiseArgtupleInvalid("addtoken", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 66; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
__pyx_L3_error:;
__Pyx_AddTraceback("sphinx.pycode.pgen2.parse.Parser.addtoken");
return NULL;
- __pyx_L4:;
- __pyx_v_dfa = Py_None; Py_INCREF(Py_None);
- __pyx_v_node = Py_None; Py_INCREF(Py_None);
- __pyx_v_states = Py_None; Py_INCREF(Py_None);
- __pyx_v_first = Py_None; Py_INCREF(Py_None);
- __pyx_v_arcs = Py_None; Py_INCREF(Py_None);
- __pyx_v_v = Py_None; Py_INCREF(Py_None);
- __pyx_v_itsdfa = Py_None; Py_INCREF(Py_None);
- __pyx_v_itsstates = Py_None; Py_INCREF(Py_None);
- __pyx_v_itsfirst = Py_None; Py_INCREF(Py_None);
-
- /* "/home/gbr/devel/sphinx/sphinx/pycode/pgen2/parse.pyx":62
+ __pyx_L4_argument_unpacking_done:;
+ __Pyx_INCREF((PyObject *)__pyx_v_self);
+ __Pyx_INCREF(__pyx_v_value);
+ __Pyx_INCREF(__pyx_v_context);
+ __pyx_v_dfa = Py_None; __Pyx_INCREF(Py_None);
+ __pyx_v_node = Py_None; __Pyx_INCREF(Py_None);
+ __pyx_v_states = Py_None; __Pyx_INCREF(Py_None);
+ __pyx_v_first = Py_None; __Pyx_INCREF(Py_None);
+ __pyx_v_arcs = Py_None; __Pyx_INCREF(Py_None);
+ __pyx_v_v = Py_None; __Pyx_INCREF(Py_None);
+ __pyx_v_itsdfa = Py_None; __Pyx_INCREF(Py_None);
+ __pyx_v_itsstates = Py_None; __Pyx_INCREF(Py_None);
+ __pyx_v_itsfirst = Py_None; __Pyx_INCREF(Py_None);
+
+ /* "/home/gbr/devel/sphinx/sphinx/pycode/pgen2/parse.pyx":70
* cdef int ilabel, i, t, state, newstate
* # Map from token to label
* ilabel = self.classify(type, value, context) # <<<<<<<<<<<<<<
@@ -804,7 +1486,7 @@ static PyObject *__pyx_pf_6sphinx_6pycode_5pgen2_5parse_6Parser_addtoken(PyObjec
*/
__pyx_v_ilabel = ((struct __pyx_vtabstruct_6sphinx_6pycode_5pgen2_5parse_Parser *)((struct __pyx_obj_6sphinx_6pycode_5pgen2_5parse_Parser *)__pyx_v_self)->__pyx_vtab)->classify(((struct __pyx_obj_6sphinx_6pycode_5pgen2_5parse_Parser *)__pyx_v_self), __pyx_v_type, __pyx_v_value, __pyx_v_context);
- /* "/home/gbr/devel/sphinx/sphinx/pycode/pgen2/parse.pyx":64
+ /* "/home/gbr/devel/sphinx/sphinx/pycode/pgen2/parse.pyx":72
* ilabel = self.classify(type, value, context)
* # Loop until the token is shifted; may raise exceptions
* while True: # <<<<<<<<<<<<<<
@@ -812,102 +1494,104 @@ static PyObject *__pyx_pf_6sphinx_6pycode_5pgen2_5parse_6Parser_addtoken(PyObjec
* states, first = dfa
*/
while (1) {
- __pyx_1 = 1;
- if (!__pyx_1) break;
+ __pyx_t_1 = 1;
+ if (!__pyx_t_1) break;
- /* "/home/gbr/devel/sphinx/sphinx/pycode/pgen2/parse.pyx":65
+ /* "/home/gbr/devel/sphinx/sphinx/pycode/pgen2/parse.pyx":73
* # Loop until the token is shifted; may raise exceptions
* while True:
* dfa, state, node = self.stack[-1] # <<<<<<<<<<<<<<
* states, first = dfa
* arcs = states[state]
*/
- __pyx_2 = __Pyx_GetItemInt(((struct __pyx_obj_6sphinx_6pycode_5pgen2_5parse_Parser *)__pyx_v_self)->stack, -1, 0); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 65; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- if (PyTuple_CheckExact(__pyx_2) && PyTuple_GET_SIZE(__pyx_2) == 3) {
- PyObject* tuple = __pyx_2;
- __pyx_4 = PyTuple_GET_ITEM(tuple, 0);
- Py_INCREF(__pyx_4);
- Py_DECREF(__pyx_v_dfa);
- __pyx_v_dfa = __pyx_4;
- __pyx_4 = 0;
- __pyx_4 = PyTuple_GET_ITEM(tuple, 1);
- Py_INCREF(__pyx_4);
- __pyx_5 = __pyx_PyInt_int(__pyx_4); if (unlikely((__pyx_5 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 65; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- Py_DECREF(__pyx_4); __pyx_4 = 0;
- __pyx_v_state = __pyx_5;
- __pyx_4 = PyTuple_GET_ITEM(tuple, 2);
- Py_INCREF(__pyx_4);
- Py_DECREF(__pyx_v_node);
- __pyx_v_node = __pyx_4;
- __pyx_4 = 0;
- Py_DECREF(__pyx_2); __pyx_2 = 0;
+ __pyx_t_2 = __Pyx_GetItemInt_List(((PyObject *)((struct __pyx_obj_6sphinx_6pycode_5pgen2_5parse_Parser *)__pyx_v_self)->stack), -1, sizeof(long), PyInt_FromLong); if (!__pyx_t_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 73; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_2);
+ if (PyTuple_CheckExact(__pyx_t_2) && likely(PyTuple_GET_SIZE(__pyx_t_2) == 3)) {
+ PyObject* tuple = __pyx_t_2;
+ __pyx_t_3 = PyTuple_GET_ITEM(tuple, 0); __Pyx_INCREF(__pyx_t_3);
+ __pyx_t_4 = PyTuple_GET_ITEM(tuple, 1); __Pyx_INCREF(__pyx_t_4);
+ __pyx_t_6 = __Pyx_PyInt_AsInt(__pyx_t_4); if (unlikely((__pyx_t_6 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 73; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+ __pyx_t_5 = PyTuple_GET_ITEM(tuple, 2); __Pyx_INCREF(__pyx_t_5);
+ __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+ __Pyx_DECREF(__pyx_v_dfa);
+ __pyx_v_dfa = __pyx_t_3;
+ __pyx_t_3 = 0;
+ __pyx_v_state = __pyx_t_6;
+ __Pyx_DECREF(__pyx_v_node);
+ __pyx_v_node = __pyx_t_5;
+ __pyx_t_5 = 0;
+ } else {
+ __pyx_t_7 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 73; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_7);
+ __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+ __pyx_t_3 = __Pyx_UnpackItem(__pyx_t_7, 0); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 73; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_3);
+ __pyx_t_4 = __Pyx_UnpackItem(__pyx_t_7, 1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 73; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_4);
+ __pyx_t_6 = __Pyx_PyInt_AsInt(__pyx_t_4); if (unlikely((__pyx_t_6 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 73; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+ __pyx_t_5 = __Pyx_UnpackItem(__pyx_t_7, 2); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 73; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_5);
+ if (__Pyx_EndUnpack(__pyx_t_7) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 73; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
+ __Pyx_DECREF(__pyx_v_dfa);
+ __pyx_v_dfa = __pyx_t_3;
+ __pyx_t_3 = 0;
+ __pyx_v_state = __pyx_t_6;
+ __Pyx_DECREF(__pyx_v_node);
+ __pyx_v_node = __pyx_t_5;
+ __pyx_t_5 = 0;
}
- else {
- __pyx_3 = PyObject_GetIter(__pyx_2); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 65; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- Py_DECREF(__pyx_2); __pyx_2 = 0;
- __pyx_4 = __Pyx_UnpackItem(__pyx_3, 0); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 65; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- Py_DECREF(__pyx_v_dfa);
- __pyx_v_dfa = __pyx_4;
- __pyx_4 = 0;
- __pyx_4 = __Pyx_UnpackItem(__pyx_3, 1); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 65; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __pyx_5 = __pyx_PyInt_int(__pyx_4); if (unlikely((__pyx_5 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 65; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- Py_DECREF(__pyx_4); __pyx_4 = 0;
- __pyx_v_state = __pyx_5;
- __pyx_4 = __Pyx_UnpackItem(__pyx_3, 2); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 65; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- Py_DECREF(__pyx_v_node);
- __pyx_v_node = __pyx_4;
- __pyx_4 = 0;
- if (__Pyx_EndUnpack(__pyx_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 65; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- Py_DECREF(__pyx_3); __pyx_3 = 0;
- }
-
- /* "/home/gbr/devel/sphinx/sphinx/pycode/pgen2/parse.pyx":66
+
+ /* "/home/gbr/devel/sphinx/sphinx/pycode/pgen2/parse.pyx":74
* while True:
* dfa, state, node = self.stack[-1]
* states, first = dfa # <<<<<<<<<<<<<<
* arcs = states[state]
* # Look for a state with this label
*/
- if (PyTuple_CheckExact(__pyx_v_dfa) && PyTuple_GET_SIZE(__pyx_v_dfa) == 2) {
+ if (PyTuple_CheckExact(__pyx_v_dfa) && likely(PyTuple_GET_SIZE(__pyx_v_dfa) == 2)) {
PyObject* tuple = __pyx_v_dfa;
- __pyx_2 = PyTuple_GET_ITEM(tuple, 0);
- Py_INCREF(__pyx_2);
- Py_DECREF(__pyx_v_states);
- __pyx_v_states = __pyx_2;
- __pyx_2 = 0;
- __pyx_3 = PyTuple_GET_ITEM(tuple, 1);
- Py_INCREF(__pyx_3);
- Py_DECREF(__pyx_v_first);
- __pyx_v_first = __pyx_3;
- __pyx_3 = 0;
+ __pyx_t_2 = PyTuple_GET_ITEM(tuple, 0); __Pyx_INCREF(__pyx_t_2);
+ __pyx_t_5 = PyTuple_GET_ITEM(tuple, 1); __Pyx_INCREF(__pyx_t_5);
+ __Pyx_DECREF(__pyx_v_states);
+ __pyx_v_states = __pyx_t_2;
+ __pyx_t_2 = 0;
+ __Pyx_DECREF(__pyx_v_first);
+ __pyx_v_first = __pyx_t_5;
+ __pyx_t_5 = 0;
+ } else {
+ __pyx_t_4 = PyObject_GetIter(__pyx_v_dfa); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 74; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_4);
+ __pyx_t_2 = __Pyx_UnpackItem(__pyx_t_4, 0); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 74; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_2);
+ __pyx_t_5 = __Pyx_UnpackItem(__pyx_t_4, 1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 74; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_5);
+ if (__Pyx_EndUnpack(__pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 74; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+ __Pyx_DECREF(__pyx_v_states);
+ __pyx_v_states = __pyx_t_2;
+ __pyx_t_2 = 0;
+ __Pyx_DECREF(__pyx_v_first);
+ __pyx_v_first = __pyx_t_5;
+ __pyx_t_5 = 0;
}
- else {
- __pyx_4 = PyObject_GetIter(__pyx_v_dfa); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 66; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __pyx_2 = __Pyx_UnpackItem(__pyx_4, 0); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 66; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- Py_DECREF(__pyx_v_states);
- __pyx_v_states = __pyx_2;
- __pyx_2 = 0;
- __pyx_3 = __Pyx_UnpackItem(__pyx_4, 1); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 66; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- Py_DECREF(__pyx_v_first);
- __pyx_v_first = __pyx_3;
- __pyx_3 = 0;
- if (__Pyx_EndUnpack(__pyx_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 66; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- Py_DECREF(__pyx_4); __pyx_4 = 0;
- }
-
- /* "/home/gbr/devel/sphinx/sphinx/pycode/pgen2/parse.pyx":67
+
+ /* "/home/gbr/devel/sphinx/sphinx/pycode/pgen2/parse.pyx":75
* dfa, state, node = self.stack[-1]
* states, first = dfa
* arcs = states[state] # <<<<<<<<<<<<<<
* # Look for a state with this label
* for i, newstate in arcs:
*/
- __pyx_2 = __Pyx_GetItemInt(__pyx_v_states, __pyx_v_state, 0); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 67; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- Py_DECREF(__pyx_v_arcs);
- __pyx_v_arcs = __pyx_2;
- __pyx_2 = 0;
+ __pyx_t_5 = __Pyx_GetItemInt(__pyx_v_states, __pyx_v_state, sizeof(int), PyInt_FromLong); if (!__pyx_t_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 75; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_5);
+ __Pyx_DECREF(__pyx_v_arcs);
+ __pyx_v_arcs = __pyx_t_5;
+ __pyx_t_5 = 0;
- /* "/home/gbr/devel/sphinx/sphinx/pycode/pgen2/parse.pyx":69
+ /* "/home/gbr/devel/sphinx/sphinx/pycode/pgen2/parse.pyx":77
* arcs = states[state]
* # Look for a state with this label
* for i, newstate in arcs: # <<<<<<<<<<<<<<
@@ -915,112 +1599,119 @@ static PyObject *__pyx_pf_6sphinx_6pycode_5pgen2_5parse_6Parser_addtoken(PyObjec
* if ilabel == i:
*/
if (PyList_CheckExact(__pyx_v_arcs) || PyTuple_CheckExact(__pyx_v_arcs)) {
- __pyx_6 = 0; __pyx_3 = __pyx_v_arcs; Py_INCREF(__pyx_3);
+ __pyx_t_8 = 0; __pyx_t_5 = __pyx_v_arcs; __Pyx_INCREF(__pyx_t_5);
} else {
- __pyx_6 = -1; __pyx_3 = PyObject_GetIter(__pyx_v_arcs); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 69; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_8 = -1; __pyx_t_5 = PyObject_GetIter(__pyx_v_arcs); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 77; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_5);
}
for (;;) {
- if (likely(PyList_CheckExact(__pyx_3))) {
- if (__pyx_6 >= PyList_GET_SIZE(__pyx_3)) break;
- __pyx_4 = PyList_GET_ITEM(__pyx_3, __pyx_6); Py_INCREF(__pyx_4); __pyx_6++;
- } else if (likely(PyTuple_CheckExact(__pyx_3))) {
- if (__pyx_6 >= PyTuple_GET_SIZE(__pyx_3)) break;
- __pyx_4 = PyTuple_GET_ITEM(__pyx_3, __pyx_6); Py_INCREF(__pyx_4); __pyx_6++;
+ if (likely(PyList_CheckExact(__pyx_t_5))) {
+ if (__pyx_t_8 >= PyList_GET_SIZE(__pyx_t_5)) break;
+ __pyx_t_2 = PyList_GET_ITEM(__pyx_t_5, __pyx_t_8); __Pyx_INCREF(__pyx_t_2); __pyx_t_8++;
+ } else if (likely(PyTuple_CheckExact(__pyx_t_5))) {
+ if (__pyx_t_8 >= PyTuple_GET_SIZE(__pyx_t_5)) break;
+ __pyx_t_2 = PyTuple_GET_ITEM(__pyx_t_5, __pyx_t_8); __Pyx_INCREF(__pyx_t_2); __pyx_t_8++;
} else {
- __pyx_4 = PyIter_Next(__pyx_3);
- if (!__pyx_4) {
- if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 69; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = PyIter_Next(__pyx_t_5);
+ if (!__pyx_t_2) {
+ if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 77; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
break;
}
+ __Pyx_GOTREF(__pyx_t_2);
}
- if (PyTuple_CheckExact(__pyx_4) && PyTuple_GET_SIZE(__pyx_4) == 2) {
- PyObject* tuple = __pyx_4;
- __pyx_7 = PyTuple_GET_ITEM(tuple, 0);
- Py_INCREF(__pyx_7);
- __pyx_5 = __pyx_PyInt_int(__pyx_7); if (unlikely((__pyx_5 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 69; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- Py_DECREF(__pyx_7); __pyx_7 = 0;
- __pyx_v_i = __pyx_5;
- __pyx_7 = PyTuple_GET_ITEM(tuple, 1);
- Py_INCREF(__pyx_7);
- __pyx_5 = __pyx_PyInt_int(__pyx_7); if (unlikely((__pyx_5 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 69; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- Py_DECREF(__pyx_7); __pyx_7 = 0;
- __pyx_v_newstate = __pyx_5;
- Py_DECREF(__pyx_4); __pyx_4 = 0;
- }
- else {
- __pyx_2 = PyObject_GetIter(__pyx_4); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 69; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- Py_DECREF(__pyx_4); __pyx_4 = 0;
- __pyx_7 = __Pyx_UnpackItem(__pyx_2, 0); if (unlikely(!__pyx_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 69; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __pyx_5 = __pyx_PyInt_int(__pyx_7); if (unlikely((__pyx_5 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 69; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- Py_DECREF(__pyx_7); __pyx_7 = 0;
- __pyx_v_i = __pyx_5;
- __pyx_7 = __Pyx_UnpackItem(__pyx_2, 1); if (unlikely(!__pyx_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 69; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __pyx_5 = __pyx_PyInt_int(__pyx_7); if (unlikely((__pyx_5 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 69; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- Py_DECREF(__pyx_7); __pyx_7 = 0;
- __pyx_v_newstate = __pyx_5;
- if (__Pyx_EndUnpack(__pyx_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 69; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- Py_DECREF(__pyx_2); __pyx_2 = 0;
+ if (PyTuple_CheckExact(__pyx_t_2) && likely(PyTuple_GET_SIZE(__pyx_t_2) == 2)) {
+ PyObject* tuple = __pyx_t_2;
+ __pyx_t_4 = PyTuple_GET_ITEM(tuple, 0); __Pyx_INCREF(__pyx_t_4);
+ __pyx_t_6 = __Pyx_PyInt_AsInt(__pyx_t_4); if (unlikely((__pyx_t_6 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 77; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+ __pyx_t_3 = PyTuple_GET_ITEM(tuple, 1); __Pyx_INCREF(__pyx_t_3);
+ __pyx_t_9 = __Pyx_PyInt_AsInt(__pyx_t_3); if (unlikely((__pyx_t_9 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 77; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+ __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+ __pyx_v_i = __pyx_t_6;
+ __pyx_v_newstate = __pyx_t_9;
+ } else {
+ __pyx_t_7 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 77; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_7);
+ __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+ __pyx_t_4 = __Pyx_UnpackItem(__pyx_t_7, 0); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 77; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_4);
+ __pyx_t_9 = __Pyx_PyInt_AsInt(__pyx_t_4); if (unlikely((__pyx_t_9 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 77; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+ __pyx_t_3 = __Pyx_UnpackItem(__pyx_t_7, 1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 77; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_3);
+ __pyx_t_6 = __Pyx_PyInt_AsInt(__pyx_t_3); if (unlikely((__pyx_t_6 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 77; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+ if (__Pyx_EndUnpack(__pyx_t_7) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 77; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
+ __pyx_v_i = __pyx_t_9;
+ __pyx_v_newstate = __pyx_t_6;
}
- /* "/home/gbr/devel/sphinx/sphinx/pycode/pgen2/parse.pyx":70
+ /* "/home/gbr/devel/sphinx/sphinx/pycode/pgen2/parse.pyx":78
* # Look for a state with this label
* for i, newstate in arcs:
* t, v = self._grammar_labels[i] # <<<<<<<<<<<<<<
* if ilabel == i:
* # Look it up in the list of labels
*/
- __pyx_7 = __Pyx_GetItemInt(((struct __pyx_obj_6sphinx_6pycode_5pgen2_5parse_Parser *)__pyx_v_self)->_grammar_labels, __pyx_v_i, 0); if (!__pyx_7) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 70; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- if (PyTuple_CheckExact(__pyx_7) && PyTuple_GET_SIZE(__pyx_7) == 2) {
- PyObject* tuple = __pyx_7;
- __pyx_2 = PyTuple_GET_ITEM(tuple, 0);
- Py_INCREF(__pyx_2);
- __pyx_5 = __pyx_PyInt_int(__pyx_2); if (unlikely((__pyx_5 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 70; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- Py_DECREF(__pyx_2); __pyx_2 = 0;
- __pyx_v_t = __pyx_5;
- __pyx_2 = PyTuple_GET_ITEM(tuple, 1);
- Py_INCREF(__pyx_2);
- Py_DECREF(__pyx_v_v);
- __pyx_v_v = __pyx_2;
- __pyx_2 = 0;
- Py_DECREF(__pyx_7); __pyx_7 = 0;
- }
- else {
- __pyx_4 = PyObject_GetIter(__pyx_7); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 70; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- Py_DECREF(__pyx_7); __pyx_7 = 0;
- __pyx_2 = __Pyx_UnpackItem(__pyx_4, 0); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 70; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __pyx_5 = __pyx_PyInt_int(__pyx_2); if (unlikely((__pyx_5 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 70; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- Py_DECREF(__pyx_2); __pyx_2 = 0;
- __pyx_v_t = __pyx_5;
- __pyx_2 = __Pyx_UnpackItem(__pyx_4, 1); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 70; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- Py_DECREF(__pyx_v_v);
- __pyx_v_v = __pyx_2;
- __pyx_2 = 0;
- if (__Pyx_EndUnpack(__pyx_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 70; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- Py_DECREF(__pyx_4); __pyx_4 = 0;
+ __pyx_t_2 = __Pyx_GetItemInt_List(((PyObject *)((struct __pyx_obj_6sphinx_6pycode_5pgen2_5parse_Parser *)__pyx_v_self)->_grammar_labels), __pyx_v_i, sizeof(int), PyInt_FromLong); if (!__pyx_t_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 78; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_2);
+ if (PyTuple_CheckExact(__pyx_t_2) && likely(PyTuple_GET_SIZE(__pyx_t_2) == 2)) {
+ PyObject* tuple = __pyx_t_2;
+ __pyx_t_3 = PyTuple_GET_ITEM(tuple, 0); __Pyx_INCREF(__pyx_t_3);
+ __pyx_t_6 = __Pyx_PyInt_AsInt(__pyx_t_3); if (unlikely((__pyx_t_6 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 78; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+ __pyx_t_4 = PyTuple_GET_ITEM(tuple, 1); __Pyx_INCREF(__pyx_t_4);
+ __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+ __pyx_v_t = __pyx_t_6;
+ __Pyx_DECREF(__pyx_v_v);
+ __pyx_v_v = __pyx_t_4;
+ __pyx_t_4 = 0;
+ } else {
+ __pyx_t_7 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 78; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_7);
+ __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+ __pyx_t_3 = __Pyx_UnpackItem(__pyx_t_7, 0); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 78; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_3);
+ __pyx_t_6 = __Pyx_PyInt_AsInt(__pyx_t_3); if (unlikely((__pyx_t_6 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 78; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+ __pyx_t_4 = __Pyx_UnpackItem(__pyx_t_7, 1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 78; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_4);
+ if (__Pyx_EndUnpack(__pyx_t_7) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 78; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
+ __pyx_v_t = __pyx_t_6;
+ __Pyx_DECREF(__pyx_v_v);
+ __pyx_v_v = __pyx_t_4;
+ __pyx_t_4 = 0;
}
- /* "/home/gbr/devel/sphinx/sphinx/pycode/pgen2/parse.pyx":71
+ /* "/home/gbr/devel/sphinx/sphinx/pycode/pgen2/parse.pyx":79
* for i, newstate in arcs:
* t, v = self._grammar_labels[i]
* if ilabel == i: # <<<<<<<<<<<<<<
* # Look it up in the list of labels
* ## assert t < 256
*/
- __pyx_1 = (__pyx_v_ilabel == __pyx_v_i);
- if (__pyx_1) {
+ __pyx_t_1 = (__pyx_v_ilabel == __pyx_v_i);
+ if (__pyx_t_1) {
- /* "/home/gbr/devel/sphinx/sphinx/pycode/pgen2/parse.pyx":75
+ /* "/home/gbr/devel/sphinx/sphinx/pycode/pgen2/parse.pyx":83
* ## assert t < 256
* # Shift a token; we're done with it
* self.shift(type, value, newstate, context) # <<<<<<<<<<<<<<
* # Pop while we are in an accept-only state
* state = newstate
*/
- __pyx_2 = PyInt_FromLong(__pyx_v_newstate); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 75; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- ((struct __pyx_vtabstruct_6sphinx_6pycode_5pgen2_5parse_Parser *)((struct __pyx_obj_6sphinx_6pycode_5pgen2_5parse_Parser *)__pyx_v_self)->__pyx_vtab)->shift(((struct __pyx_obj_6sphinx_6pycode_5pgen2_5parse_Parser *)__pyx_v_self), __pyx_v_type, __pyx_v_value, __pyx_2, __pyx_v_context);
- Py_DECREF(__pyx_2); __pyx_2 = 0;
-
- /* "/home/gbr/devel/sphinx/sphinx/pycode/pgen2/parse.pyx":77
+ __pyx_t_2 = PyInt_FromLong(__pyx_v_type); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 83; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_2);
+ __pyx_t_4 = PyInt_FromLong(__pyx_v_newstate); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 83; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_4);
+ ((struct __pyx_vtabstruct_6sphinx_6pycode_5pgen2_5parse_Parser *)((struct __pyx_obj_6sphinx_6pycode_5pgen2_5parse_Parser *)__pyx_v_self)->__pyx_vtab)->shift(((struct __pyx_obj_6sphinx_6pycode_5pgen2_5parse_Parser *)__pyx_v_self), __pyx_t_2, __pyx_v_value, __pyx_t_4, __pyx_v_context);
+ __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+ __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+
+ /* "/home/gbr/devel/sphinx/sphinx/pycode/pgen2/parse.pyx":85
* self.shift(type, value, newstate, context)
* # Pop while we are in an accept-only state
* state = newstate # <<<<<<<<<<<<<<
@@ -1029,7 +1720,7 @@ static PyObject *__pyx_pf_6sphinx_6pycode_5pgen2_5parse_6Parser_addtoken(PyObjec
*/
__pyx_v_state = __pyx_v_newstate;
- /* "/home/gbr/devel/sphinx/sphinx/pycode/pgen2/parse.pyx":78
+ /* "/home/gbr/devel/sphinx/sphinx/pycode/pgen2/parse.pyx":86
* # Pop while we are in an accept-only state
* state = newstate
* while states[state] == [(0, state)]: # <<<<<<<<<<<<<<
@@ -1037,24 +1728,32 @@ static PyObject *__pyx_pf_6sphinx_6pycode_5pgen2_5parse_6Parser_addtoken(PyObjec
* if not self.stack:
*/
while (1) {
- __pyx_7 = __Pyx_GetItemInt(__pyx_v_states, __pyx_v_state, 0); if (!__pyx_7) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 78; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __pyx_4 = PyInt_FromLong(__pyx_v_state); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 78; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __pyx_2 = PyTuple_New(2); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 78; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- Py_INCREF(__pyx_int_0);
- PyTuple_SET_ITEM(__pyx_2, 0, __pyx_int_0);
- PyTuple_SET_ITEM(__pyx_2, 1, __pyx_4);
- __pyx_4 = 0;
- __pyx_4 = PyList_New(1); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 78; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- PyList_SET_ITEM(__pyx_4, 0, ((PyObject *)__pyx_2));
- __pyx_2 = 0;
- __pyx_2 = PyObject_RichCompare(__pyx_7, ((PyObject *)__pyx_4), Py_EQ); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 78; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- Py_DECREF(__pyx_7); __pyx_7 = 0;
- Py_DECREF(((PyObject *)__pyx_4)); __pyx_4 = 0;
- __pyx_1 = __Pyx_PyObject_IsTrue(__pyx_2); if (unlikely(__pyx_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 78; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- Py_DECREF(__pyx_2); __pyx_2 = 0;
- if (!__pyx_1) break;
-
- /* "/home/gbr/devel/sphinx/sphinx/pycode/pgen2/parse.pyx":79
+ __pyx_t_4 = __Pyx_GetItemInt(__pyx_v_states, __pyx_v_state, sizeof(int), PyInt_FromLong); if (!__pyx_t_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 86; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_4);
+ __pyx_t_2 = PyInt_FromLong(__pyx_v_state); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 86; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_2);
+ __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 86; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_3);
+ __Pyx_INCREF(__pyx_int_0);
+ PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_int_0);
+ __Pyx_GIVEREF(__pyx_int_0);
+ PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_2);
+ __Pyx_GIVEREF(__pyx_t_2);
+ __pyx_t_2 = 0;
+ __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 86; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(((PyObject *)__pyx_t_2));
+ PyList_SET_ITEM(__pyx_t_2, 0, __pyx_t_3);
+ __Pyx_GIVEREF(__pyx_t_3);
+ __pyx_t_3 = 0;
+ __pyx_t_3 = PyObject_RichCompare(__pyx_t_4, ((PyObject *)__pyx_t_2), Py_EQ); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 86; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_3);
+ __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+ __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
+ __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 86; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+ if (!__pyx_t_1) break;
+
+ /* "/home/gbr/devel/sphinx/sphinx/pycode/pgen2/parse.pyx":87
* state = newstate
* while states[state] == [(0, state)]:
* self.pop() # <<<<<<<<<<<<<<
@@ -1063,245 +1762,258 @@ static PyObject *__pyx_pf_6sphinx_6pycode_5pgen2_5parse_6Parser_addtoken(PyObjec
*/
((struct __pyx_vtabstruct_6sphinx_6pycode_5pgen2_5parse_Parser *)((struct __pyx_obj_6sphinx_6pycode_5pgen2_5parse_Parser *)__pyx_v_self)->__pyx_vtab)->pop(((struct __pyx_obj_6sphinx_6pycode_5pgen2_5parse_Parser *)__pyx_v_self));
- /* "/home/gbr/devel/sphinx/sphinx/pycode/pgen2/parse.pyx":80
+ /* "/home/gbr/devel/sphinx/sphinx/pycode/pgen2/parse.pyx":88
* while states[state] == [(0, state)]:
* self.pop()
* if not self.stack: # <<<<<<<<<<<<<<
* # Done parsing!
* return True
*/
- __pyx_1 = __Pyx_PyObject_IsTrue(((struct __pyx_obj_6sphinx_6pycode_5pgen2_5parse_Parser *)__pyx_v_self)->stack); if (unlikely(__pyx_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 80; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __pyx_8 = (!__pyx_1);
- if (__pyx_8) {
+ __pyx_t_1 = __Pyx_PyObject_IsTrue(((PyObject *)((struct __pyx_obj_6sphinx_6pycode_5pgen2_5parse_Parser *)__pyx_v_self)->stack)); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 88; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_10 = (!__pyx_t_1);
+ if (__pyx_t_10) {
- /* "/home/gbr/devel/sphinx/sphinx/pycode/pgen2/parse.pyx":82
+ /* "/home/gbr/devel/sphinx/sphinx/pycode/pgen2/parse.pyx":90
* if not self.stack:
* # Done parsing!
* return True # <<<<<<<<<<<<<<
* dfa, state, node = self.stack[-1]
* states, first = dfa
*/
- __pyx_7 = __Pyx_PyBool_FromLong(1); if (unlikely(!__pyx_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 82; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __pyx_r = __pyx_7;
- __pyx_7 = 0;
- Py_DECREF(__pyx_3); __pyx_3 = 0;
+ __Pyx_XDECREF(__pyx_r);
+ __pyx_t_3 = __Pyx_PyBool_FromLong(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 90; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_3);
+ __pyx_r = __pyx_t_3;
+ __pyx_t_3 = 0;
+ __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
goto __pyx_L0;
- goto __pyx_L12;
+ goto __pyx_L13;
}
- __pyx_L12:;
+ __pyx_L13:;
- /* "/home/gbr/devel/sphinx/sphinx/pycode/pgen2/parse.pyx":83
+ /* "/home/gbr/devel/sphinx/sphinx/pycode/pgen2/parse.pyx":91
* # Done parsing!
* return True
* dfa, state, node = self.stack[-1] # <<<<<<<<<<<<<<
* states, first = dfa
* # Done with this token
*/
- __pyx_4 = __Pyx_GetItemInt(((struct __pyx_obj_6sphinx_6pycode_5pgen2_5parse_Parser *)__pyx_v_self)->stack, -1, 0); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 83; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- if (PyTuple_CheckExact(__pyx_4) && PyTuple_GET_SIZE(__pyx_4) == 3) {
- PyObject* tuple = __pyx_4;
- __pyx_7 = PyTuple_GET_ITEM(tuple, 0);
- Py_INCREF(__pyx_7);
- Py_DECREF(__pyx_v_dfa);
- __pyx_v_dfa = __pyx_7;
- __pyx_7 = 0;
- __pyx_7 = PyTuple_GET_ITEM(tuple, 1);
- Py_INCREF(__pyx_7);
- __pyx_5 = __pyx_PyInt_int(__pyx_7); if (unlikely((__pyx_5 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 83; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- Py_DECREF(__pyx_7); __pyx_7 = 0;
- __pyx_v_state = __pyx_5;
- __pyx_7 = PyTuple_GET_ITEM(tuple, 2);
- Py_INCREF(__pyx_7);
- Py_DECREF(__pyx_v_node);
- __pyx_v_node = __pyx_7;
- __pyx_7 = 0;
- Py_DECREF(__pyx_4); __pyx_4 = 0;
- }
- else {
- __pyx_2 = PyObject_GetIter(__pyx_4); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 83; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- Py_DECREF(__pyx_4); __pyx_4 = 0;
- __pyx_7 = __Pyx_UnpackItem(__pyx_2, 0); if (unlikely(!__pyx_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 83; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- Py_DECREF(__pyx_v_dfa);
- __pyx_v_dfa = __pyx_7;
- __pyx_7 = 0;
- __pyx_7 = __Pyx_UnpackItem(__pyx_2, 1); if (unlikely(!__pyx_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 83; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __pyx_5 = __pyx_PyInt_int(__pyx_7); if (unlikely((__pyx_5 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 83; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- Py_DECREF(__pyx_7); __pyx_7 = 0;
- __pyx_v_state = __pyx_5;
- __pyx_7 = __Pyx_UnpackItem(__pyx_2, 2); if (unlikely(!__pyx_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 83; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- Py_DECREF(__pyx_v_node);
- __pyx_v_node = __pyx_7;
- __pyx_7 = 0;
- if (__Pyx_EndUnpack(__pyx_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 83; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- Py_DECREF(__pyx_2); __pyx_2 = 0;
+ __pyx_t_3 = __Pyx_GetItemInt_List(((PyObject *)((struct __pyx_obj_6sphinx_6pycode_5pgen2_5parse_Parser *)__pyx_v_self)->stack), -1, sizeof(long), PyInt_FromLong); if (!__pyx_t_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 91; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_3);
+ if (PyTuple_CheckExact(__pyx_t_3) && likely(PyTuple_GET_SIZE(__pyx_t_3) == 3)) {
+ PyObject* tuple = __pyx_t_3;
+ __pyx_t_2 = PyTuple_GET_ITEM(tuple, 0); __Pyx_INCREF(__pyx_t_2);
+ __pyx_t_4 = PyTuple_GET_ITEM(tuple, 1); __Pyx_INCREF(__pyx_t_4);
+ __pyx_t_6 = __Pyx_PyInt_AsInt(__pyx_t_4); if (unlikely((__pyx_t_6 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 91; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+ __pyx_t_7 = PyTuple_GET_ITEM(tuple, 2); __Pyx_INCREF(__pyx_t_7);
+ __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+ __Pyx_DECREF(__pyx_v_dfa);
+ __pyx_v_dfa = __pyx_t_2;
+ __pyx_t_2 = 0;
+ __pyx_v_state = __pyx_t_6;
+ __Pyx_DECREF(__pyx_v_node);
+ __pyx_v_node = __pyx_t_7;
+ __pyx_t_7 = 0;
+ } else {
+ __pyx_t_11 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 91; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_11);
+ __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+ __pyx_t_2 = __Pyx_UnpackItem(__pyx_t_11, 0); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 91; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_2);
+ __pyx_t_4 = __Pyx_UnpackItem(__pyx_t_11, 1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 91; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_4);
+ __pyx_t_6 = __Pyx_PyInt_AsInt(__pyx_t_4); if (unlikely((__pyx_t_6 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 91; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+ __pyx_t_7 = __Pyx_UnpackItem(__pyx_t_11, 2); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 91; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_7);
+ if (__Pyx_EndUnpack(__pyx_t_11) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 91; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
+ __Pyx_DECREF(__pyx_v_dfa);
+ __pyx_v_dfa = __pyx_t_2;
+ __pyx_t_2 = 0;
+ __pyx_v_state = __pyx_t_6;
+ __Pyx_DECREF(__pyx_v_node);
+ __pyx_v_node = __pyx_t_7;
+ __pyx_t_7 = 0;
}
- /* "/home/gbr/devel/sphinx/sphinx/pycode/pgen2/parse.pyx":84
+ /* "/home/gbr/devel/sphinx/sphinx/pycode/pgen2/parse.pyx":92
* return True
* dfa, state, node = self.stack[-1]
* states, first = dfa # <<<<<<<<<<<<<<
* # Done with this token
* return False
*/
- if (PyTuple_CheckExact(__pyx_v_dfa) && PyTuple_GET_SIZE(__pyx_v_dfa) == 2) {
+ if (PyTuple_CheckExact(__pyx_v_dfa) && likely(PyTuple_GET_SIZE(__pyx_v_dfa) == 2)) {
PyObject* tuple = __pyx_v_dfa;
- __pyx_4 = PyTuple_GET_ITEM(tuple, 0);
- Py_INCREF(__pyx_4);
- Py_DECREF(__pyx_v_states);
- __pyx_v_states = __pyx_4;
- __pyx_4 = 0;
- __pyx_2 = PyTuple_GET_ITEM(tuple, 1);
- Py_INCREF(__pyx_2);
- Py_DECREF(__pyx_v_first);
- __pyx_v_first = __pyx_2;
- __pyx_2 = 0;
- }
- else {
- __pyx_7 = PyObject_GetIter(__pyx_v_dfa); if (unlikely(!__pyx_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 84; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __pyx_4 = __Pyx_UnpackItem(__pyx_7, 0); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 84; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- Py_DECREF(__pyx_v_states);
- __pyx_v_states = __pyx_4;
- __pyx_4 = 0;
- __pyx_2 = __Pyx_UnpackItem(__pyx_7, 1); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 84; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- Py_DECREF(__pyx_v_first);
- __pyx_v_first = __pyx_2;
- __pyx_2 = 0;
- if (__Pyx_EndUnpack(__pyx_7) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 84; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- Py_DECREF(__pyx_7); __pyx_7 = 0;
+ __pyx_t_3 = PyTuple_GET_ITEM(tuple, 0); __Pyx_INCREF(__pyx_t_3);
+ __pyx_t_7 = PyTuple_GET_ITEM(tuple, 1); __Pyx_INCREF(__pyx_t_7);
+ __Pyx_DECREF(__pyx_v_states);
+ __pyx_v_states = __pyx_t_3;
+ __pyx_t_3 = 0;
+ __Pyx_DECREF(__pyx_v_first);
+ __pyx_v_first = __pyx_t_7;
+ __pyx_t_7 = 0;
+ } else {
+ __pyx_t_4 = PyObject_GetIter(__pyx_v_dfa); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 92; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_4);
+ __pyx_t_3 = __Pyx_UnpackItem(__pyx_t_4, 0); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 92; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_3);
+ __pyx_t_7 = __Pyx_UnpackItem(__pyx_t_4, 1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 92; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_7);
+ if (__Pyx_EndUnpack(__pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 92; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+ __Pyx_DECREF(__pyx_v_states);
+ __pyx_v_states = __pyx_t_3;
+ __pyx_t_3 = 0;
+ __Pyx_DECREF(__pyx_v_first);
+ __pyx_v_first = __pyx_t_7;
+ __pyx_t_7 = 0;
}
}
- /* "/home/gbr/devel/sphinx/sphinx/pycode/pgen2/parse.pyx":86
+ /* "/home/gbr/devel/sphinx/sphinx/pycode/pgen2/parse.pyx":94
* states, first = dfa
* # Done with this token
* return False # <<<<<<<<<<<<<<
* elif t >= 256:
* # See if it's a symbol and if we're in its first set
*/
- __pyx_4 = __Pyx_PyBool_FromLong(0); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 86; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __pyx_r = __pyx_4;
- __pyx_4 = 0;
- Py_DECREF(__pyx_3); __pyx_3 = 0;
+ __Pyx_XDECREF(__pyx_r);
+ __pyx_t_7 = __Pyx_PyBool_FromLong(0); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 94; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_7);
+ __pyx_r = __pyx_t_7;
+ __pyx_t_7 = 0;
+ __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
goto __pyx_L0;
- goto __pyx_L9;
+ goto __pyx_L10;
}
- /* "/home/gbr/devel/sphinx/sphinx/pycode/pgen2/parse.pyx":87
+ /* "/home/gbr/devel/sphinx/sphinx/pycode/pgen2/parse.pyx":95
* # Done with this token
* return False
* elif t >= 256: # <<<<<<<<<<<<<<
* # See if it's a symbol and if we're in its first set
* itsdfa = self._grammar_dfas[t]
*/
- __pyx_1 = (__pyx_v_t >= 256);
- if (__pyx_1) {
+ __pyx_t_10 = (__pyx_v_t >= 256);
+ if (__pyx_t_10) {
- /* "/home/gbr/devel/sphinx/sphinx/pycode/pgen2/parse.pyx":89
+ /* "/home/gbr/devel/sphinx/sphinx/pycode/pgen2/parse.pyx":97
* elif t >= 256:
* # See if it's a symbol and if we're in its first set
* itsdfa = self._grammar_dfas[t] # <<<<<<<<<<<<<<
* itsstates, itsfirst = itsdfa
* if ilabel in itsfirst:
*/
- __pyx_2 = __Pyx_GetItemInt(((struct __pyx_obj_6sphinx_6pycode_5pgen2_5parse_Parser *)__pyx_v_self)->_grammar_dfas, __pyx_v_t, 0); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 89; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- Py_DECREF(__pyx_v_itsdfa);
- __pyx_v_itsdfa = __pyx_2;
- __pyx_2 = 0;
+ __pyx_t_7 = __Pyx_GetItemInt(((PyObject *)((struct __pyx_obj_6sphinx_6pycode_5pgen2_5parse_Parser *)__pyx_v_self)->_grammar_dfas), __pyx_v_t, sizeof(int), PyInt_FromLong); if (!__pyx_t_7) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 97; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_7);
+ __Pyx_DECREF(__pyx_v_itsdfa);
+ __pyx_v_itsdfa = __pyx_t_7;
+ __pyx_t_7 = 0;
- /* "/home/gbr/devel/sphinx/sphinx/pycode/pgen2/parse.pyx":90
+ /* "/home/gbr/devel/sphinx/sphinx/pycode/pgen2/parse.pyx":98
* # See if it's a symbol and if we're in its first set
* itsdfa = self._grammar_dfas[t]
* itsstates, itsfirst = itsdfa # <<<<<<<<<<<<<<
* if ilabel in itsfirst:
* # Push a symbol
*/
- if (PyTuple_CheckExact(__pyx_v_itsdfa) && PyTuple_GET_SIZE(__pyx_v_itsdfa) == 2) {
+ if (PyTuple_CheckExact(__pyx_v_itsdfa) && likely(PyTuple_GET_SIZE(__pyx_v_itsdfa) == 2)) {
PyObject* tuple = __pyx_v_itsdfa;
- __pyx_4 = PyTuple_GET_ITEM(tuple, 0);
- Py_INCREF(__pyx_4);
- Py_DECREF(__pyx_v_itsstates);
- __pyx_v_itsstates = __pyx_4;
- __pyx_4 = 0;
- __pyx_2 = PyTuple_GET_ITEM(tuple, 1);
- Py_INCREF(__pyx_2);
- Py_DECREF(__pyx_v_itsfirst);
- __pyx_v_itsfirst = __pyx_2;
- __pyx_2 = 0;
- }
- else {
- __pyx_7 = PyObject_GetIter(__pyx_v_itsdfa); if (unlikely(!__pyx_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 90; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __pyx_4 = __Pyx_UnpackItem(__pyx_7, 0); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 90; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- Py_DECREF(__pyx_v_itsstates);
- __pyx_v_itsstates = __pyx_4;
- __pyx_4 = 0;
- __pyx_2 = __Pyx_UnpackItem(__pyx_7, 1); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 90; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- Py_DECREF(__pyx_v_itsfirst);
- __pyx_v_itsfirst = __pyx_2;
- __pyx_2 = 0;
- if (__Pyx_EndUnpack(__pyx_7) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 90; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- Py_DECREF(__pyx_7); __pyx_7 = 0;
+ __pyx_t_7 = PyTuple_GET_ITEM(tuple, 0); __Pyx_INCREF(__pyx_t_7);
+ __pyx_t_3 = PyTuple_GET_ITEM(tuple, 1); __Pyx_INCREF(__pyx_t_3);
+ __Pyx_DECREF(__pyx_v_itsstates);
+ __pyx_v_itsstates = __pyx_t_7;
+ __pyx_t_7 = 0;
+ __Pyx_DECREF(__pyx_v_itsfirst);
+ __pyx_v_itsfirst = __pyx_t_3;
+ __pyx_t_3 = 0;
+ } else {
+ __pyx_t_4 = PyObject_GetIter(__pyx_v_itsdfa); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 98; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_4);
+ __pyx_t_7 = __Pyx_UnpackItem(__pyx_t_4, 0); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 98; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_7);
+ __pyx_t_3 = __Pyx_UnpackItem(__pyx_t_4, 1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 98; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_3);
+ if (__Pyx_EndUnpack(__pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 98; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+ __Pyx_DECREF(__pyx_v_itsstates);
+ __pyx_v_itsstates = __pyx_t_7;
+ __pyx_t_7 = 0;
+ __Pyx_DECREF(__pyx_v_itsfirst);
+ __pyx_v_itsfirst = __pyx_t_3;
+ __pyx_t_3 = 0;
}
- /* "/home/gbr/devel/sphinx/sphinx/pycode/pgen2/parse.pyx":91
+ /* "/home/gbr/devel/sphinx/sphinx/pycode/pgen2/parse.pyx":99
* itsdfa = self._grammar_dfas[t]
* itsstates, itsfirst = itsdfa
* if ilabel in itsfirst: # <<<<<<<<<<<<<<
* # Push a symbol
* self.push(t, itsdfa, newstate, context)
*/
- __pyx_4 = PyInt_FromLong(__pyx_v_ilabel); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 91; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __pyx_8 = (PySequence_Contains(__pyx_v_itsfirst, __pyx_4)); if (unlikely(__pyx_8 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 91; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- Py_DECREF(__pyx_4); __pyx_4 = 0;
- if (__pyx_8) {
+ __pyx_t_3 = PyInt_FromLong(__pyx_v_ilabel); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 99; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_3);
+ __pyx_t_10 = ((PySequence_Contains(__pyx_v_itsfirst, __pyx_t_3))); if (unlikely(__pyx_t_10 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 99; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+ if (__pyx_t_10) {
- /* "/home/gbr/devel/sphinx/sphinx/pycode/pgen2/parse.pyx":93
+ /* "/home/gbr/devel/sphinx/sphinx/pycode/pgen2/parse.pyx":101
* if ilabel in itsfirst:
* # Push a symbol
* self.push(t, itsdfa, newstate, context) # <<<<<<<<<<<<<<
* break # To continue the outer while loop
* else:
*/
- __pyx_2 = PyInt_FromLong(__pyx_v_t); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 93; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __pyx_7 = PyInt_FromLong(__pyx_v_newstate); if (unlikely(!__pyx_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 93; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- ((struct __pyx_vtabstruct_6sphinx_6pycode_5pgen2_5parse_Parser *)((struct __pyx_obj_6sphinx_6pycode_5pgen2_5parse_Parser *)__pyx_v_self)->__pyx_vtab)->push(((struct __pyx_obj_6sphinx_6pycode_5pgen2_5parse_Parser *)__pyx_v_self), __pyx_2, __pyx_v_itsdfa, __pyx_7, __pyx_v_context);
- Py_DECREF(__pyx_2); __pyx_2 = 0;
- Py_DECREF(__pyx_7); __pyx_7 = 0;
+ __pyx_t_3 = PyInt_FromLong(__pyx_v_t); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 101; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_3);
+ __pyx_t_7 = PyInt_FromLong(__pyx_v_newstate); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 101; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_7);
+ ((struct __pyx_vtabstruct_6sphinx_6pycode_5pgen2_5parse_Parser *)((struct __pyx_obj_6sphinx_6pycode_5pgen2_5parse_Parser *)__pyx_v_self)->__pyx_vtab)->push(((struct __pyx_obj_6sphinx_6pycode_5pgen2_5parse_Parser *)__pyx_v_self), __pyx_t_3, __pyx_v_itsdfa, __pyx_t_7, __pyx_v_context);
+ __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+ __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
- /* "/home/gbr/devel/sphinx/sphinx/pycode/pgen2/parse.pyx":94
+ /* "/home/gbr/devel/sphinx/sphinx/pycode/pgen2/parse.pyx":102
* # Push a symbol
* self.push(t, itsdfa, newstate, context)
* break # To continue the outer while loop # <<<<<<<<<<<<<<
* else:
* if (0, state) in arcs:
*/
- goto __pyx_L8;
- goto __pyx_L13;
+ goto __pyx_L9_break;
+ goto __pyx_L14;
}
- __pyx_L13:;
- goto __pyx_L9;
+ __pyx_L14:;
+ goto __pyx_L10;
}
- __pyx_L9:;
+ __pyx_L10:;
}
/*else*/ {
- /* "/home/gbr/devel/sphinx/sphinx/pycode/pgen2/parse.pyx":96
+ /* "/home/gbr/devel/sphinx/sphinx/pycode/pgen2/parse.pyx":104
* break # To continue the outer while loop
* else:
* if (0, state) in arcs: # <<<<<<<<<<<<<<
* # An accepting state, pop it and try something else
* self.pop()
*/
- __pyx_4 = PyInt_FromLong(__pyx_v_state); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 96; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __pyx_2 = PyTuple_New(2); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 96; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- Py_INCREF(__pyx_int_0);
- PyTuple_SET_ITEM(__pyx_2, 0, __pyx_int_0);
- PyTuple_SET_ITEM(__pyx_2, 1, __pyx_4);
- __pyx_4 = 0;
- __pyx_1 = (PySequence_Contains(__pyx_v_arcs, ((PyObject *)__pyx_2))); if (unlikely(__pyx_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 96; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- Py_DECREF(((PyObject *)__pyx_2)); __pyx_2 = 0;
- if (__pyx_1) {
-
- /* "/home/gbr/devel/sphinx/sphinx/pycode/pgen2/parse.pyx":98
+ __pyx_t_7 = PyInt_FromLong(__pyx_v_state); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 104; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_7);
+ __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 104; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_3);
+ __Pyx_INCREF(__pyx_int_0);
+ PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_int_0);
+ __Pyx_GIVEREF(__pyx_int_0);
+ PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_7);
+ __Pyx_GIVEREF(__pyx_t_7);
+ __pyx_t_7 = 0;
+ __pyx_t_10 = ((PySequence_Contains(__pyx_v_arcs, __pyx_t_3))); if (unlikely(__pyx_t_10 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 104; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+ if (__pyx_t_10) {
+
+ /* "/home/gbr/devel/sphinx/sphinx/pycode/pgen2/parse.pyx":106
* if (0, state) in arcs:
* # An accepting state, pop it and try something else
* self.pop() # <<<<<<<<<<<<<<
@@ -1310,190 +2022,197 @@ static PyObject *__pyx_pf_6sphinx_6pycode_5pgen2_5parse_6Parser_addtoken(PyObjec
*/
((struct __pyx_vtabstruct_6sphinx_6pycode_5pgen2_5parse_Parser *)((struct __pyx_obj_6sphinx_6pycode_5pgen2_5parse_Parser *)__pyx_v_self)->__pyx_vtab)->pop(((struct __pyx_obj_6sphinx_6pycode_5pgen2_5parse_Parser *)__pyx_v_self));
- /* "/home/gbr/devel/sphinx/sphinx/pycode/pgen2/parse.pyx":99
+ /* "/home/gbr/devel/sphinx/sphinx/pycode/pgen2/parse.pyx":107
* # An accepting state, pop it and try something else
* self.pop()
* if not self.stack: # <<<<<<<<<<<<<<
* # Done parsing, but another token is input
* raise ParseError("too much input",
*/
- __pyx_8 = __Pyx_PyObject_IsTrue(((struct __pyx_obj_6sphinx_6pycode_5pgen2_5parse_Parser *)__pyx_v_self)->stack); if (unlikely(__pyx_8 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 99; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __pyx_1 = (!__pyx_8);
- if (__pyx_1) {
+ __pyx_t_10 = __Pyx_PyObject_IsTrue(((PyObject *)((struct __pyx_obj_6sphinx_6pycode_5pgen2_5parse_Parser *)__pyx_v_self)->stack)); if (unlikely(__pyx_t_10 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 107; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = (!__pyx_t_10);
+ if (__pyx_t_1) {
- /* "/home/gbr/devel/sphinx/sphinx/pycode/pgen2/parse.pyx":101
+ /* "/home/gbr/devel/sphinx/sphinx/pycode/pgen2/parse.pyx":109
* if not self.stack:
* # Done parsing, but another token is input
* raise ParseError("too much input", # <<<<<<<<<<<<<<
* type, value, context)
* else:
*/
- __pyx_7 = __Pyx_GetName(__pyx_m, __pyx_kp_ParseError); if (unlikely(!__pyx_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 101; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = __Pyx_GetName(__pyx_m, __pyx_n_s__ParseError); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 109; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_3);
- /* "/home/gbr/devel/sphinx/sphinx/pycode/pgen2/parse.pyx":102
+ /* "/home/gbr/devel/sphinx/sphinx/pycode/pgen2/parse.pyx":110
* # Done parsing, but another token is input
* raise ParseError("too much input",
* type, value, context) # <<<<<<<<<<<<<<
* else:
* # No success finding a transition
*/
- __pyx_4 = PyTuple_New(4); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 101; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- Py_INCREF(__pyx_kp_5);
- PyTuple_SET_ITEM(__pyx_4, 0, __pyx_kp_5);
- Py_INCREF(__pyx_v_type);
- PyTuple_SET_ITEM(__pyx_4, 1, __pyx_v_type);
- Py_INCREF(__pyx_v_value);
- PyTuple_SET_ITEM(__pyx_4, 2, __pyx_v_value);
- Py_INCREF(__pyx_v_context);
- PyTuple_SET_ITEM(__pyx_4, 3, __pyx_v_context);
- __pyx_2 = PyObject_Call(__pyx_7, ((PyObject *)__pyx_4), NULL); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 101; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- Py_DECREF(__pyx_7); __pyx_7 = 0;
- Py_DECREF(((PyObject *)__pyx_4)); __pyx_4 = 0;
- __Pyx_Raise(__pyx_2, 0, 0);
- Py_DECREF(__pyx_2); __pyx_2 = 0;
- {__pyx_filename = __pyx_f[0]; __pyx_lineno = 101; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- goto __pyx_L15;
+ __pyx_t_7 = PyInt_FromLong(__pyx_v_type); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 110; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_7);
+ __pyx_t_4 = PyTuple_New(4); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 109; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_4);
+ __Pyx_INCREF(((PyObject *)__pyx_kp_s_3));
+ PyTuple_SET_ITEM(__pyx_t_4, 0, ((PyObject *)__pyx_kp_s_3));
+ __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_3));
+ PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_7);
+ __Pyx_GIVEREF(__pyx_t_7);
+ __Pyx_INCREF(__pyx_v_value);
+ PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_v_value);
+ __Pyx_GIVEREF(__pyx_v_value);
+ __Pyx_INCREF(__pyx_v_context);
+ PyTuple_SET_ITEM(__pyx_t_4, 3, __pyx_v_context);
+ __Pyx_GIVEREF(__pyx_v_context);
+ __pyx_t_7 = 0;
+ __pyx_t_7 = PyObject_Call(__pyx_t_3, __pyx_t_4, NULL); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 109; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_7);
+ __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+ __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+ __Pyx_Raise(__pyx_t_7, 0, 0);
+ __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
+ {__pyx_filename = __pyx_f[0]; __pyx_lineno = 109; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ goto __pyx_L16;
}
- __pyx_L15:;
- goto __pyx_L14;
+ __pyx_L16:;
+ goto __pyx_L15;
}
/*else*/ {
- /* "/home/gbr/devel/sphinx/sphinx/pycode/pgen2/parse.pyx":105
+ /* "/home/gbr/devel/sphinx/sphinx/pycode/pgen2/parse.pyx":113
* else:
* # No success finding a transition
* raise ParseError("bad input", type, value, context) # <<<<<<<<<<<<<<
*
- * cdef int classify(self, type, value, context):
- */
- __pyx_7 = __Pyx_GetName(__pyx_m, __pyx_kp_ParseError); if (unlikely(!__pyx_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 105; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __pyx_4 = PyTuple_New(4); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 105; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- Py_INCREF(__pyx_kp_6);
- PyTuple_SET_ITEM(__pyx_4, 0, __pyx_kp_6);
- Py_INCREF(__pyx_v_type);
- PyTuple_SET_ITEM(__pyx_4, 1, __pyx_v_type);
- Py_INCREF(__pyx_v_value);
- PyTuple_SET_ITEM(__pyx_4, 2, __pyx_v_value);
- Py_INCREF(__pyx_v_context);
- PyTuple_SET_ITEM(__pyx_4, 3, __pyx_v_context);
- __pyx_2 = PyObject_Call(__pyx_7, ((PyObject *)__pyx_4), NULL); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 105; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- Py_DECREF(__pyx_7); __pyx_7 = 0;
- Py_DECREF(((PyObject *)__pyx_4)); __pyx_4 = 0;
- __Pyx_Raise(__pyx_2, 0, 0);
- Py_DECREF(__pyx_2); __pyx_2 = 0;
- {__pyx_filename = __pyx_f[0]; __pyx_lineno = 105; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ * cdef int classify(self, int type, value, context):
+ */
+ __pyx_t_7 = __Pyx_GetName(__pyx_m, __pyx_n_s__ParseError); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 113; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_7);
+ __pyx_t_4 = PyInt_FromLong(__pyx_v_type); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 113; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_4);
+ __pyx_t_3 = PyTuple_New(4); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 113; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_3);
+ __Pyx_INCREF(((PyObject *)__pyx_kp_s_4));
+ PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_kp_s_4));
+ __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_4));
+ PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_4);
+ __Pyx_GIVEREF(__pyx_t_4);
+ __Pyx_INCREF(__pyx_v_value);
+ PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_v_value);
+ __Pyx_GIVEREF(__pyx_v_value);
+ __Pyx_INCREF(__pyx_v_context);
+ PyTuple_SET_ITEM(__pyx_t_3, 3, __pyx_v_context);
+ __Pyx_GIVEREF(__pyx_v_context);
+ __pyx_t_4 = 0;
+ __pyx_t_4 = PyObject_Call(__pyx_t_7, __pyx_t_3, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 113; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_4);
+ __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
+ __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+ __Pyx_Raise(__pyx_t_4, 0, 0);
+ __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+ {__pyx_filename = __pyx_f[0]; __pyx_lineno = 113; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
}
- __pyx_L14:;
+ __pyx_L15:;
}
- __pyx_L8:;
- Py_DECREF(__pyx_3); __pyx_3 = 0;
+ __pyx_L9_break:;
+ __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
}
- __pyx_r = Py_None; Py_INCREF(Py_None);
+ __pyx_r = Py_None; __Pyx_INCREF(Py_None);
goto __pyx_L0;
__pyx_L1_error:;
- Py_XDECREF(__pyx_2);
- Py_XDECREF(__pyx_3);
- Py_XDECREF(__pyx_4);
- Py_XDECREF(__pyx_7);
+ __Pyx_XDECREF(__pyx_t_2);
+ __Pyx_XDECREF(__pyx_t_3);
+ __Pyx_XDECREF(__pyx_t_4);
+ __Pyx_XDECREF(__pyx_t_5);
+ __Pyx_XDECREF(__pyx_t_7);
+ __Pyx_XDECREF(__pyx_t_11);
__Pyx_AddTraceback("sphinx.pycode.pgen2.parse.Parser.addtoken");
__pyx_r = NULL;
__pyx_L0:;
- Py_DECREF(__pyx_v_dfa);
- Py_DECREF(__pyx_v_node);
- Py_DECREF(__pyx_v_states);
- Py_DECREF(__pyx_v_first);
- Py_DECREF(__pyx_v_arcs);
- Py_DECREF(__pyx_v_v);
- Py_DECREF(__pyx_v_itsdfa);
- Py_DECREF(__pyx_v_itsstates);
- Py_DECREF(__pyx_v_itsfirst);
+ __Pyx_DECREF(__pyx_v_dfa);
+ __Pyx_DECREF(__pyx_v_node);
+ __Pyx_DECREF(__pyx_v_states);
+ __Pyx_DECREF(__pyx_v_first);
+ __Pyx_DECREF(__pyx_v_arcs);
+ __Pyx_DECREF(__pyx_v_v);
+ __Pyx_DECREF(__pyx_v_itsdfa);
+ __Pyx_DECREF(__pyx_v_itsstates);
+ __Pyx_DECREF(__pyx_v_itsfirst);
+ __Pyx_DECREF((PyObject *)__pyx_v_self);
+ __Pyx_DECREF(__pyx_v_value);
+ __Pyx_DECREF(__pyx_v_context);
+ __Pyx_XGIVEREF(__pyx_r);
+ __Pyx_RefNannyFinishContext();
return __pyx_r;
}
-/* "/home/gbr/devel/sphinx/sphinx/pycode/pgen2/parse.pyx":107
+/* "/home/gbr/devel/sphinx/sphinx/pycode/pgen2/parse.pyx":115
* raise ParseError("bad input", type, value, context)
*
- * cdef int classify(self, type, value, context): # <<<<<<<<<<<<<<
+ * cdef int classify(self, int type, value, context): # <<<<<<<<<<<<<<
* """Turn a token into a label. (Internal)"""
* if type == NAME:
*/
-static int __pyx_f_6sphinx_6pycode_5pgen2_5parse_6Parser_classify(struct __pyx_obj_6sphinx_6pycode_5pgen2_5parse_Parser *__pyx_v_self, PyObject *__pyx_v_type, PyObject *__pyx_v_value, PyObject *__pyx_v_context) {
- PyObject *__pyx_v_ilabel;
+static int __pyx_f_6sphinx_6pycode_5pgen2_5parse_6Parser_classify(struct __pyx_obj_6sphinx_6pycode_5pgen2_5parse_Parser *__pyx_v_self, int __pyx_v_type, PyObject *__pyx_v_value, PyObject *__pyx_v_context) {
int __pyx_r;
- PyObject *__pyx_1 = 0;
- int __pyx_2;
- PyObject *__pyx_3 = 0;
- PyObject *__pyx_4 = 0;
- int __pyx_5;
- __pyx_v_ilabel = Py_None; Py_INCREF(Py_None);
-
- /* "/home/gbr/devel/sphinx/sphinx/pycode/pgen2/parse.pyx":109
- * cdef int classify(self, type, value, context):
+ int __pyx_t_1;
+ int __pyx_t_2;
+ PyObject *__pyx_t_3 = NULL;
+ PyObject *__pyx_t_4 = NULL;
+ PyObject *__pyx_t_5 = NULL;
+ __Pyx_RefNannySetupContext("classify");
+ __Pyx_INCREF((PyObject *)__pyx_v_self);
+ __Pyx_INCREF(__pyx_v_value);
+ __Pyx_INCREF(__pyx_v_context);
+
+ /* "/home/gbr/devel/sphinx/sphinx/pycode/pgen2/parse.pyx":117
+ * cdef int classify(self, int type, value, context):
* """Turn a token into a label. (Internal)"""
* if type == NAME: # <<<<<<<<<<<<<<
* # Keep a listing of all used names
* self.used_names.add(value)
*/
- __pyx_1 = PyObject_RichCompare(__pyx_v_type, __pyx_int_1, Py_EQ); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 109; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __pyx_2 = __Pyx_PyObject_IsTrue(__pyx_1); if (unlikely(__pyx_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 109; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- Py_DECREF(__pyx_1); __pyx_1 = 0;
- if (__pyx_2) {
+ __pyx_t_1 = (__pyx_v_type == 1);
+ if (__pyx_t_1) {
- /* "/home/gbr/devel/sphinx/sphinx/pycode/pgen2/parse.pyx":111
+ /* "/home/gbr/devel/sphinx/sphinx/pycode/pgen2/parse.pyx":119
* if type == NAME:
* # Keep a listing of all used names
* self.used_names.add(value) # <<<<<<<<<<<<<<
* # Check for reserved words
- * ilabel = self._grammar_keywords.get(value)
- */
- __pyx_1 = PyObject_GetAttr(__pyx_v_self->used_names, __pyx_kp_add); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 111; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __pyx_3 = PyTuple_New(1); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 111; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- Py_INCREF(__pyx_v_value);
- PyTuple_SET_ITEM(__pyx_3, 0, __pyx_v_value);
- __pyx_4 = PyObject_Call(__pyx_1, ((PyObject *)__pyx_3), NULL); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 111; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- Py_DECREF(__pyx_1); __pyx_1 = 0;
- Py_DECREF(((PyObject *)__pyx_3)); __pyx_3 = 0;
- Py_DECREF(__pyx_4); __pyx_4 = 0;
-
- /* "/home/gbr/devel/sphinx/sphinx/pycode/pgen2/parse.pyx":113
+ * if value in self._grammar_keywords:
+ */
+ __pyx_t_2 = PySet_Add(((PyObject *)__pyx_v_self->used_names), __pyx_v_value); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 119; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+
+ /* "/home/gbr/devel/sphinx/sphinx/pycode/pgen2/parse.pyx":121
* self.used_names.add(value)
* # Check for reserved words
- * ilabel = self._grammar_keywords.get(value) # <<<<<<<<<<<<<<
- * if ilabel is not None:
- * return ilabel
- */
- __pyx_1 = PyObject_GetAttr(__pyx_v_self->_grammar_keywords, __pyx_kp_get); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 113; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __pyx_3 = PyTuple_New(1); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 113; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- Py_INCREF(__pyx_v_value);
- PyTuple_SET_ITEM(__pyx_3, 0, __pyx_v_value);
- __pyx_4 = PyObject_Call(__pyx_1, ((PyObject *)__pyx_3), NULL); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 113; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- Py_DECREF(__pyx_1); __pyx_1 = 0;
- Py_DECREF(((PyObject *)__pyx_3)); __pyx_3 = 0;
- Py_DECREF(__pyx_v_ilabel);
- __pyx_v_ilabel = __pyx_4;
- __pyx_4 = 0;
-
- /* "/home/gbr/devel/sphinx/sphinx/pycode/pgen2/parse.pyx":114
+ * if value in self._grammar_keywords: # <<<<<<<<<<<<<<
+ * return self._grammar_keywords[value]
+ * if type not in self._grammar_tokens:
+ */
+ if (unlikely(((PyObject *)__pyx_v_self->_grammar_keywords) == Py_None)) {
+ __Pyx_RaiseNoneNotIterableError(); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 121; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ } else {
+ __pyx_t_1 = ((PyDict_Contains(((PyObject *)__pyx_v_self->_grammar_keywords), __pyx_v_value))); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 121; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ }
+ if (__pyx_t_1) {
+
+ /* "/home/gbr/devel/sphinx/sphinx/pycode/pgen2/parse.pyx":122
* # Check for reserved words
- * ilabel = self._grammar_keywords.get(value)
- * if ilabel is not None: # <<<<<<<<<<<<<<
- * return ilabel
- * ilabel = self._grammar_tokens.get(type)
- */
- __pyx_2 = (__pyx_v_ilabel != Py_None);
- if (__pyx_2) {
-
- /* "/home/gbr/devel/sphinx/sphinx/pycode/pgen2/parse.pyx":115
- * ilabel = self._grammar_keywords.get(value)
- * if ilabel is not None:
- * return ilabel # <<<<<<<<<<<<<<
- * ilabel = self._grammar_tokens.get(type)
- * if ilabel is None:
- */
- __pyx_5 = __pyx_PyInt_int(__pyx_v_ilabel); if (unlikely((__pyx_5 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 115; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __pyx_r = __pyx_5;
+ * if value in self._grammar_keywords:
+ * return self._grammar_keywords[value] # <<<<<<<<<<<<<<
+ * if type not in self._grammar_tokens:
+ * raise ParseError("bad token", type, value, context)
+ */
+ __pyx_t_3 = PyObject_GetItem(((PyObject *)__pyx_v_self->_grammar_keywords), __pyx_v_value); if (!__pyx_t_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 122; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_3);
+ __pyx_t_2 = __Pyx_PyInt_AsInt(__pyx_t_3); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 122; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+ __pyx_r = __pyx_t_2;
goto __pyx_L0;
goto __pyx_L4;
}
@@ -1502,241 +2221,277 @@ static int __pyx_f_6sphinx_6pycode_5pgen2_5parse_6Parser_classify(struct __pyx_
}
__pyx_L3:;
- /* "/home/gbr/devel/sphinx/sphinx/pycode/pgen2/parse.pyx":116
- * if ilabel is not None:
- * return ilabel
- * ilabel = self._grammar_tokens.get(type) # <<<<<<<<<<<<<<
- * if ilabel is None:
- * raise ParseError("bad token", type, value, context)
- */
- __pyx_1 = PyObject_GetAttr(__pyx_v_self->_grammar_tokens, __pyx_kp_get); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 116; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __pyx_3 = PyTuple_New(1); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 116; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- Py_INCREF(__pyx_v_type);
- PyTuple_SET_ITEM(__pyx_3, 0, __pyx_v_type);
- __pyx_4 = PyObject_Call(__pyx_1, ((PyObject *)__pyx_3), NULL); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 116; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- Py_DECREF(__pyx_1); __pyx_1 = 0;
- Py_DECREF(((PyObject *)__pyx_3)); __pyx_3 = 0;
- Py_DECREF(__pyx_v_ilabel);
- __pyx_v_ilabel = __pyx_4;
- __pyx_4 = 0;
-
- /* "/home/gbr/devel/sphinx/sphinx/pycode/pgen2/parse.pyx":117
- * return ilabel
- * ilabel = self._grammar_tokens.get(type)
- * if ilabel is None: # <<<<<<<<<<<<<<
+ /* "/home/gbr/devel/sphinx/sphinx/pycode/pgen2/parse.pyx":123
+ * if value in self._grammar_keywords:
+ * return self._grammar_keywords[value]
+ * if type not in self._grammar_tokens: # <<<<<<<<<<<<<<
* raise ParseError("bad token", type, value, context)
- * return ilabel
+ * return self._grammar_tokens[type]
*/
- __pyx_2 = (__pyx_v_ilabel == Py_None);
- if (__pyx_2) {
+ __pyx_t_3 = PyInt_FromLong(__pyx_v_type); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 123; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_3);
+ if (unlikely(((PyObject *)__pyx_v_self->_grammar_tokens) == Py_None)) {
+ __Pyx_RaiseNoneNotIterableError(); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 123; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ } else {
+ __pyx_t_1 = (__Pyx_NegateNonNeg(PyDict_Contains(((PyObject *)__pyx_v_self->_grammar_tokens), __pyx_t_3))); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 123; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ }
+ __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+ if (__pyx_t_1) {
- /* "/home/gbr/devel/sphinx/sphinx/pycode/pgen2/parse.pyx":118
- * ilabel = self._grammar_tokens.get(type)
- * if ilabel is None:
+ /* "/home/gbr/devel/sphinx/sphinx/pycode/pgen2/parse.pyx":124
+ * return self._grammar_keywords[value]
+ * if type not in self._grammar_tokens:
* raise ParseError("bad token", type, value, context) # <<<<<<<<<<<<<<
- * return ilabel
+ * return self._grammar_tokens[type]
*
*/
- __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_kp_ParseError); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 118; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __pyx_3 = PyTuple_New(4); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 118; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- Py_INCREF(__pyx_kp_7);
- PyTuple_SET_ITEM(__pyx_3, 0, __pyx_kp_7);
- Py_INCREF(__pyx_v_type);
- PyTuple_SET_ITEM(__pyx_3, 1, __pyx_v_type);
- Py_INCREF(__pyx_v_value);
- PyTuple_SET_ITEM(__pyx_3, 2, __pyx_v_value);
- Py_INCREF(__pyx_v_context);
- PyTuple_SET_ITEM(__pyx_3, 3, __pyx_v_context);
- __pyx_4 = PyObject_Call(__pyx_1, ((PyObject *)__pyx_3), NULL); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 118; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- Py_DECREF(__pyx_1); __pyx_1 = 0;
- Py_DECREF(((PyObject *)__pyx_3)); __pyx_3 = 0;
- __Pyx_Raise(__pyx_4, 0, 0);
- Py_DECREF(__pyx_4); __pyx_4 = 0;
- {__pyx_filename = __pyx_f[0]; __pyx_lineno = 118; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = __Pyx_GetName(__pyx_m, __pyx_n_s__ParseError); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 124; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_3);
+ __pyx_t_4 = PyInt_FromLong(__pyx_v_type); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 124; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_4);
+ __pyx_t_5 = PyTuple_New(4); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 124; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_5);
+ __Pyx_INCREF(((PyObject *)__pyx_kp_s_5));
+ PyTuple_SET_ITEM(__pyx_t_5, 0, ((PyObject *)__pyx_kp_s_5));
+ __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_5));
+ PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_4);
+ __Pyx_GIVEREF(__pyx_t_4);
+ __Pyx_INCREF(__pyx_v_value);
+ PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_v_value);
+ __Pyx_GIVEREF(__pyx_v_value);
+ __Pyx_INCREF(__pyx_v_context);
+ PyTuple_SET_ITEM(__pyx_t_5, 3, __pyx_v_context);
+ __Pyx_GIVEREF(__pyx_v_context);
+ __pyx_t_4 = 0;
+ __pyx_t_4 = PyObject_Call(__pyx_t_3, __pyx_t_5, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 124; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_4);
+ __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+ __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+ __Pyx_Raise(__pyx_t_4, 0, 0);
+ __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+ {__pyx_filename = __pyx_f[0]; __pyx_lineno = 124; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
goto __pyx_L5;
}
__pyx_L5:;
- /* "/home/gbr/devel/sphinx/sphinx/pycode/pgen2/parse.pyx":119
- * if ilabel is None:
+ /* "/home/gbr/devel/sphinx/sphinx/pycode/pgen2/parse.pyx":125
+ * if type not in self._grammar_tokens:
* raise ParseError("bad token", type, value, context)
- * return ilabel # <<<<<<<<<<<<<<
+ * return self._grammar_tokens[type] # <<<<<<<<<<<<<<
*
* cdef void shift(self, type, value, newstate, context):
*/
- __pyx_5 = __pyx_PyInt_int(__pyx_v_ilabel); if (unlikely((__pyx_5 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 119; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __pyx_r = __pyx_5;
+ __pyx_t_4 = __Pyx_GetItemInt(((PyObject *)__pyx_v_self->_grammar_tokens), __pyx_v_type, sizeof(int), PyInt_FromLong); if (!__pyx_t_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 125; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_4);
+ __pyx_t_2 = __Pyx_PyInt_AsInt(__pyx_t_4); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 125; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+ __pyx_r = __pyx_t_2;
goto __pyx_L0;
__pyx_r = 0;
goto __pyx_L0;
__pyx_L1_error:;
- Py_XDECREF(__pyx_1);
- Py_XDECREF(__pyx_3);
- Py_XDECREF(__pyx_4);
+ __Pyx_XDECREF(__pyx_t_3);
+ __Pyx_XDECREF(__pyx_t_4);
+ __Pyx_XDECREF(__pyx_t_5);
__Pyx_WriteUnraisable("sphinx.pycode.pgen2.parse.Parser.classify");
__pyx_r = 0;
__pyx_L0:;
- Py_DECREF(__pyx_v_ilabel);
+ __Pyx_DECREF((PyObject *)__pyx_v_self);
+ __Pyx_DECREF(__pyx_v_value);
+ __Pyx_DECREF(__pyx_v_context);
+ __Pyx_RefNannyFinishContext();
return __pyx_r;
}
-/* "/home/gbr/devel/sphinx/sphinx/pycode/pgen2/parse.pyx":121
- * return ilabel
+/* "/home/gbr/devel/sphinx/sphinx/pycode/pgen2/parse.pyx":127
+ * return self._grammar_tokens[type]
*
* cdef void shift(self, type, value, newstate, context): # <<<<<<<<<<<<<<
* """Shift a token. (Internal)"""
- * dfa, state, node = self.stack[-1]
+ * cdef tuple node
*/
static void __pyx_f_6sphinx_6pycode_5pgen2_5parse_6Parser_shift(struct __pyx_obj_6sphinx_6pycode_5pgen2_5parse_Parser *__pyx_v_self, PyObject *__pyx_v_type, PyObject *__pyx_v_value, PyObject *__pyx_v_newstate, PyObject *__pyx_v_context) {
+ PyObject *__pyx_v_node;
PyObject *__pyx_v_dfa;
PyObject *__pyx_v_state;
- PyObject *__pyx_v_node;
PyObject *__pyx_v_newnode;
- PyObject *__pyx_1 = 0;
- PyObject *__pyx_2 = 0;
- PyObject *__pyx_3 = 0;
- int __pyx_4;
- __pyx_v_dfa = Py_None; Py_INCREF(Py_None);
- __pyx_v_state = Py_None; Py_INCREF(Py_None);
- __pyx_v_node = Py_None; Py_INCREF(Py_None);
- __pyx_v_newnode = Py_None; Py_INCREF(Py_None);
-
- /* "/home/gbr/devel/sphinx/sphinx/pycode/pgen2/parse.pyx":123
- * cdef void shift(self, type, value, newstate, context):
+ PyObject *__pyx_t_1 = NULL;
+ PyObject *__pyx_t_2 = NULL;
+ PyObject *__pyx_t_3 = NULL;
+ PyObject *__pyx_t_4 = NULL;
+ PyObject *__pyx_t_5 = NULL;
+ int __pyx_t_6;
+ __Pyx_RefNannySetupContext("shift");
+ __Pyx_INCREF((PyObject *)__pyx_v_self);
+ __Pyx_INCREF(__pyx_v_type);
+ __Pyx_INCREF(__pyx_v_value);
+ __Pyx_INCREF(__pyx_v_newstate);
+ __Pyx_INCREF(__pyx_v_context);
+ __pyx_v_node = ((PyObject *)Py_None); __Pyx_INCREF(Py_None);
+ __pyx_v_dfa = Py_None; __Pyx_INCREF(Py_None);
+ __pyx_v_state = Py_None; __Pyx_INCREF(Py_None);
+ __pyx_v_newnode = Py_None; __Pyx_INCREF(Py_None);
+
+ /* "/home/gbr/devel/sphinx/sphinx/pycode/pgen2/parse.pyx":130
* """Shift a token. (Internal)"""
+ * cdef tuple node
* dfa, state, node = self.stack[-1] # <<<<<<<<<<<<<<
* newnode = (type, value, context, None)
* newnode = self.convert(newnode)
*/
- __pyx_1 = __Pyx_GetItemInt(__pyx_v_self->stack, -1, 0); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 123; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- if (PyTuple_CheckExact(__pyx_1) && PyTuple_GET_SIZE(__pyx_1) == 3) {
- PyObject* tuple = __pyx_1;
- __pyx_3 = PyTuple_GET_ITEM(tuple, 0);
- Py_INCREF(__pyx_3);
- Py_DECREF(__pyx_v_dfa);
- __pyx_v_dfa = __pyx_3;
- __pyx_3 = 0;
- __pyx_3 = PyTuple_GET_ITEM(tuple, 1);
- Py_INCREF(__pyx_3);
- Py_DECREF(__pyx_v_state);
- __pyx_v_state = __pyx_3;
- __pyx_3 = 0;
- __pyx_3 = PyTuple_GET_ITEM(tuple, 2);
- Py_INCREF(__pyx_3);
- Py_DECREF(__pyx_v_node);
- __pyx_v_node = __pyx_3;
- __pyx_3 = 0;
- Py_DECREF(__pyx_1); __pyx_1 = 0;
- }
- else {
- __pyx_2 = PyObject_GetIter(__pyx_1); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 123; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- Py_DECREF(__pyx_1); __pyx_1 = 0;
- __pyx_3 = __Pyx_UnpackItem(__pyx_2, 0); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 123; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- Py_DECREF(__pyx_v_dfa);
- __pyx_v_dfa = __pyx_3;
- __pyx_3 = 0;
- __pyx_3 = __Pyx_UnpackItem(__pyx_2, 1); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 123; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- Py_DECREF(__pyx_v_state);
- __pyx_v_state = __pyx_3;
- __pyx_3 = 0;
- __pyx_3 = __Pyx_UnpackItem(__pyx_2, 2); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 123; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- Py_DECREF(__pyx_v_node);
- __pyx_v_node = __pyx_3;
- __pyx_3 = 0;
- if (__Pyx_EndUnpack(__pyx_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 123; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- Py_DECREF(__pyx_2); __pyx_2 = 0;
+ __pyx_t_1 = __Pyx_GetItemInt_List(((PyObject *)__pyx_v_self->stack), -1, sizeof(long), PyInt_FromLong); if (!__pyx_t_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 130; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_1);
+ if (PyTuple_CheckExact(__pyx_t_1) && likely(PyTuple_GET_SIZE(__pyx_t_1) == 3)) {
+ PyObject* tuple = __pyx_t_1;
+ __pyx_t_2 = PyTuple_GET_ITEM(tuple, 0); __Pyx_INCREF(__pyx_t_2);
+ __pyx_t_3 = PyTuple_GET_ITEM(tuple, 1); __Pyx_INCREF(__pyx_t_3);
+ __pyx_t_4 = PyTuple_GET_ITEM(tuple, 2); __Pyx_INCREF(__pyx_t_4);
+ if (!(likely(PyTuple_CheckExact(__pyx_t_4))||((__pyx_t_4) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected tuple, got %.200s", Py_TYPE(__pyx_t_4)->tp_name), 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 130; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+ __Pyx_DECREF(__pyx_v_dfa);
+ __pyx_v_dfa = __pyx_t_2;
+ __pyx_t_2 = 0;
+ __Pyx_DECREF(__pyx_v_state);
+ __pyx_v_state = __pyx_t_3;
+ __pyx_t_3 = 0;
+ __Pyx_DECREF(((PyObject *)__pyx_v_node));
+ __pyx_v_node = ((PyObject *)__pyx_t_4);
+ __pyx_t_4 = 0;
+ } else {
+ __pyx_t_5 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 130; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_5);
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+ __pyx_t_2 = __Pyx_UnpackItem(__pyx_t_5, 0); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 130; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_2);
+ __pyx_t_3 = __Pyx_UnpackItem(__pyx_t_5, 1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 130; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_3);
+ __pyx_t_4 = __Pyx_UnpackItem(__pyx_t_5, 2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 130; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_4);
+ if (!(likely(PyTuple_CheckExact(__pyx_t_4))||((__pyx_t_4) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected tuple, got %.200s", Py_TYPE(__pyx_t_4)->tp_name), 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 130; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (__Pyx_EndUnpack(__pyx_t_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 130; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+ __Pyx_DECREF(__pyx_v_dfa);
+ __pyx_v_dfa = __pyx_t_2;
+ __pyx_t_2 = 0;
+ __Pyx_DECREF(__pyx_v_state);
+ __pyx_v_state = __pyx_t_3;
+ __pyx_t_3 = 0;
+ __Pyx_DECREF(((PyObject *)__pyx_v_node));
+ __pyx_v_node = ((PyObject *)__pyx_t_4);
+ __pyx_t_4 = 0;
}
- /* "/home/gbr/devel/sphinx/sphinx/pycode/pgen2/parse.pyx":124
- * """Shift a token. (Internal)"""
+ /* "/home/gbr/devel/sphinx/sphinx/pycode/pgen2/parse.pyx":131
+ * cdef tuple node
* dfa, state, node = self.stack[-1]
* newnode = (type, value, context, None) # <<<<<<<<<<<<<<
* newnode = self.convert(newnode)
* if newnode is not None:
*/
- __pyx_3 = PyTuple_New(4); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 124; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- Py_INCREF(__pyx_v_type);
- PyTuple_SET_ITEM(__pyx_3, 0, __pyx_v_type);
- Py_INCREF(__pyx_v_value);
- PyTuple_SET_ITEM(__pyx_3, 1, __pyx_v_value);
- Py_INCREF(__pyx_v_context);
- PyTuple_SET_ITEM(__pyx_3, 2, __pyx_v_context);
- Py_INCREF(Py_None);
- PyTuple_SET_ITEM(__pyx_3, 3, Py_None);
- Py_DECREF(__pyx_v_newnode);
- __pyx_v_newnode = ((PyObject *)__pyx_3);
- __pyx_3 = 0;
+ __pyx_t_1 = PyTuple_New(4); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 131; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_1);
+ __Pyx_INCREF(__pyx_v_type);
+ PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_type);
+ __Pyx_GIVEREF(__pyx_v_type);
+ __Pyx_INCREF(__pyx_v_value);
+ PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_value);
+ __Pyx_GIVEREF(__pyx_v_value);
+ __Pyx_INCREF(__pyx_v_context);
+ PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_v_context);
+ __Pyx_GIVEREF(__pyx_v_context);
+ __Pyx_INCREF(Py_None);
+ PyTuple_SET_ITEM(__pyx_t_1, 3, Py_None);
+ __Pyx_GIVEREF(Py_None);
+ __Pyx_DECREF(__pyx_v_newnode);
+ __pyx_v_newnode = __pyx_t_1;
+ __pyx_t_1 = 0;
- /* "/home/gbr/devel/sphinx/sphinx/pycode/pgen2/parse.pyx":125
+ /* "/home/gbr/devel/sphinx/sphinx/pycode/pgen2/parse.pyx":132
* dfa, state, node = self.stack[-1]
* newnode = (type, value, context, None)
* newnode = self.convert(newnode) # <<<<<<<<<<<<<<
* if newnode is not None:
* node[-1].append(newnode)
*/
- __pyx_1 = ((struct __pyx_vtabstruct_6sphinx_6pycode_5pgen2_5parse_Parser *)__pyx_v_self->__pyx_vtab)->convert(__pyx_v_self, __pyx_v_newnode); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 125; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- Py_DECREF(__pyx_v_newnode);
- __pyx_v_newnode = __pyx_1;
- __pyx_1 = 0;
+ if (!(likely(PyTuple_CheckExact(__pyx_v_newnode))||((__pyx_v_newnode) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected tuple, got %.200s", Py_TYPE(__pyx_v_newnode)->tp_name), 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 132; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = ((struct __pyx_vtabstruct_6sphinx_6pycode_5pgen2_5parse_Parser *)__pyx_v_self->__pyx_vtab)->convert(__pyx_v_self, ((PyObject *)__pyx_v_newnode)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 132; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_1);
+ __Pyx_DECREF(__pyx_v_newnode);
+ __pyx_v_newnode = __pyx_t_1;
+ __pyx_t_1 = 0;
- /* "/home/gbr/devel/sphinx/sphinx/pycode/pgen2/parse.pyx":126
+ /* "/home/gbr/devel/sphinx/sphinx/pycode/pgen2/parse.pyx":133
* newnode = (type, value, context, None)
* newnode = self.convert(newnode)
* if newnode is not None: # <<<<<<<<<<<<<<
* node[-1].append(newnode)
* self.stack[-1] = (dfa, newstate, node)
*/
- __pyx_4 = (__pyx_v_newnode != Py_None);
- if (__pyx_4) {
+ __pyx_t_6 = (__pyx_v_newnode != Py_None);
+ if (__pyx_t_6) {
- /* "/home/gbr/devel/sphinx/sphinx/pycode/pgen2/parse.pyx":127
+ /* "/home/gbr/devel/sphinx/sphinx/pycode/pgen2/parse.pyx":134
* newnode = self.convert(newnode)
* if newnode is not None:
* node[-1].append(newnode) # <<<<<<<<<<<<<<
* self.stack[-1] = (dfa, newstate, node)
*
*/
- __pyx_2 = __Pyx_GetItemInt(__pyx_v_node, -1, 0); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 127; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __pyx_3 = __Pyx_PyObject_Append(__pyx_2, __pyx_v_newnode); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 127; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- Py_DECREF(__pyx_2); __pyx_2 = 0;
- Py_DECREF(__pyx_3); __pyx_3 = 0;
+ __pyx_t_1 = __Pyx_GetItemInt_Tuple(((PyObject *)__pyx_v_node), -1, sizeof(long), PyInt_FromLong); if (!__pyx_t_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 134; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_1);
+ __pyx_t_4 = __Pyx_PyObject_Append(__pyx_t_1, __pyx_v_newnode); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 134; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_4);
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+ __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
goto __pyx_L3;
}
__pyx_L3:;
- /* "/home/gbr/devel/sphinx/sphinx/pycode/pgen2/parse.pyx":128
+ /* "/home/gbr/devel/sphinx/sphinx/pycode/pgen2/parse.pyx":135
* if newnode is not None:
* node[-1].append(newnode)
* self.stack[-1] = (dfa, newstate, node) # <<<<<<<<<<<<<<
*
* cdef void push(self, type, newdfa, newstate, context):
*/
- __pyx_1 = PyTuple_New(3); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 128; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- Py_INCREF(__pyx_v_dfa);
- PyTuple_SET_ITEM(__pyx_1, 0, __pyx_v_dfa);
- Py_INCREF(__pyx_v_newstate);
- PyTuple_SET_ITEM(__pyx_1, 1, __pyx_v_newstate);
- Py_INCREF(__pyx_v_node);
- PyTuple_SET_ITEM(__pyx_1, 2, __pyx_v_node);
- if (__Pyx_SetItemInt(__pyx_v_self->stack, -1, ((PyObject *)__pyx_1), 0) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 128; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- Py_DECREF(((PyObject *)__pyx_1)); __pyx_1 = 0;
+ __pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 135; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_4);
+ __Pyx_INCREF(__pyx_v_dfa);
+ PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_dfa);
+ __Pyx_GIVEREF(__pyx_v_dfa);
+ __Pyx_INCREF(__pyx_v_newstate);
+ PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_v_newstate);
+ __Pyx_GIVEREF(__pyx_v_newstate);
+ __Pyx_INCREF(((PyObject *)__pyx_v_node));
+ PyTuple_SET_ITEM(__pyx_t_4, 2, ((PyObject *)__pyx_v_node));
+ __Pyx_GIVEREF(((PyObject *)__pyx_v_node));
+ if (__Pyx_SetItemInt(((PyObject *)__pyx_v_self->stack), -1, __pyx_t_4, sizeof(long), PyInt_FromLong) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 135; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
goto __pyx_L0;
__pyx_L1_error:;
- Py_XDECREF(__pyx_1);
- Py_XDECREF(__pyx_2);
- Py_XDECREF(__pyx_3);
+ __Pyx_XDECREF(__pyx_t_1);
+ __Pyx_XDECREF(__pyx_t_2);
+ __Pyx_XDECREF(__pyx_t_3);
+ __Pyx_XDECREF(__pyx_t_4);
+ __Pyx_XDECREF(__pyx_t_5);
__Pyx_WriteUnraisable("sphinx.pycode.pgen2.parse.Parser.shift");
__pyx_L0:;
- Py_DECREF(__pyx_v_dfa);
- Py_DECREF(__pyx_v_state);
- Py_DECREF(__pyx_v_node);
- Py_DECREF(__pyx_v_newnode);
+ __Pyx_DECREF(__pyx_v_node);
+ __Pyx_DECREF(__pyx_v_dfa);
+ __Pyx_DECREF(__pyx_v_state);
+ __Pyx_DECREF(__pyx_v_newnode);
+ __Pyx_DECREF((PyObject *)__pyx_v_self);
+ __Pyx_DECREF(__pyx_v_type);
+ __Pyx_DECREF(__pyx_v_value);
+ __Pyx_DECREF(__pyx_v_newstate);
+ __Pyx_DECREF(__pyx_v_context);
+ __Pyx_RefNannyFinishContext();
}
-/* "/home/gbr/devel/sphinx/sphinx/pycode/pgen2/parse.pyx":130
+/* "/home/gbr/devel/sphinx/sphinx/pycode/pgen2/parse.pyx":137
* self.stack[-1] = (dfa, newstate, node)
*
* cdef void push(self, type, newdfa, newstate, context): # <<<<<<<<<<<<<<
@@ -1749,130 +2504,154 @@ static void __pyx_f_6sphinx_6pycode_5pgen2_5parse_6Parser_push(struct __pyx_obj
PyObject *__pyx_v_state;
PyObject *__pyx_v_node;
PyObject *__pyx_v_newnode;
- PyObject *__pyx_1 = 0;
- PyObject *__pyx_2 = 0;
- PyObject *__pyx_3 = 0;
- __pyx_v_dfa = Py_None; Py_INCREF(Py_None);
- __pyx_v_state = Py_None; Py_INCREF(Py_None);
- __pyx_v_node = Py_None; Py_INCREF(Py_None);
- __pyx_v_newnode = Py_None; Py_INCREF(Py_None);
+ PyObject *__pyx_t_1 = NULL;
+ PyObject *__pyx_t_2 = NULL;
+ PyObject *__pyx_t_3 = NULL;
+ PyObject *__pyx_t_4 = NULL;
+ PyObject *__pyx_t_5 = NULL;
+ int __pyx_t_6;
+ __Pyx_RefNannySetupContext("push");
+ __pyx_v_dfa = Py_None; __Pyx_INCREF(Py_None);
+ __pyx_v_state = Py_None; __Pyx_INCREF(Py_None);
+ __pyx_v_node = Py_None; __Pyx_INCREF(Py_None);
+ __pyx_v_newnode = Py_None; __Pyx_INCREF(Py_None);
- /* "/home/gbr/devel/sphinx/sphinx/pycode/pgen2/parse.pyx":132
+ /* "/home/gbr/devel/sphinx/sphinx/pycode/pgen2/parse.pyx":139
* cdef void push(self, type, newdfa, newstate, context):
* """Push a nonterminal. (Internal)"""
* dfa, state, node = self.stack[-1] # <<<<<<<<<<<<<<
* newnode = (type, None, context, [])
* self.stack[-1] = (dfa, newstate, node)
*/
- __pyx_1 = __Pyx_GetItemInt(__pyx_v_self->stack, -1, 0); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 132; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- if (PyTuple_CheckExact(__pyx_1) && PyTuple_GET_SIZE(__pyx_1) == 3) {
- PyObject* tuple = __pyx_1;
- __pyx_3 = PyTuple_GET_ITEM(tuple, 0);
- Py_INCREF(__pyx_3);
- Py_DECREF(__pyx_v_dfa);
- __pyx_v_dfa = __pyx_3;
- __pyx_3 = 0;
- __pyx_3 = PyTuple_GET_ITEM(tuple, 1);
- Py_INCREF(__pyx_3);
- Py_DECREF(__pyx_v_state);
- __pyx_v_state = __pyx_3;
- __pyx_3 = 0;
- __pyx_3 = PyTuple_GET_ITEM(tuple, 2);
- Py_INCREF(__pyx_3);
- Py_DECREF(__pyx_v_node);
- __pyx_v_node = __pyx_3;
- __pyx_3 = 0;
- Py_DECREF(__pyx_1); __pyx_1 = 0;
- }
- else {
- __pyx_2 = PyObject_GetIter(__pyx_1); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 132; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- Py_DECREF(__pyx_1); __pyx_1 = 0;
- __pyx_3 = __Pyx_UnpackItem(__pyx_2, 0); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 132; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- Py_DECREF(__pyx_v_dfa);
- __pyx_v_dfa = __pyx_3;
- __pyx_3 = 0;
- __pyx_3 = __Pyx_UnpackItem(__pyx_2, 1); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 132; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- Py_DECREF(__pyx_v_state);
- __pyx_v_state = __pyx_3;
- __pyx_3 = 0;
- __pyx_3 = __Pyx_UnpackItem(__pyx_2, 2); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 132; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- Py_DECREF(__pyx_v_node);
- __pyx_v_node = __pyx_3;
- __pyx_3 = 0;
- if (__Pyx_EndUnpack(__pyx_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 132; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- Py_DECREF(__pyx_2); __pyx_2 = 0;
+ __pyx_t_1 = __Pyx_GetItemInt_List(((PyObject *)__pyx_v_self->stack), -1, sizeof(long), PyInt_FromLong); if (!__pyx_t_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 139; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_1);
+ if (PyTuple_CheckExact(__pyx_t_1) && likely(PyTuple_GET_SIZE(__pyx_t_1) == 3)) {
+ PyObject* tuple = __pyx_t_1;
+ __pyx_t_2 = PyTuple_GET_ITEM(tuple, 0); __Pyx_INCREF(__pyx_t_2);
+ __pyx_t_3 = PyTuple_GET_ITEM(tuple, 1); __Pyx_INCREF(__pyx_t_3);
+ __pyx_t_4 = PyTuple_GET_ITEM(tuple, 2); __Pyx_INCREF(__pyx_t_4);
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+ __Pyx_DECREF(__pyx_v_dfa);
+ __pyx_v_dfa = __pyx_t_2;
+ __pyx_t_2 = 0;
+ __Pyx_DECREF(__pyx_v_state);
+ __pyx_v_state = __pyx_t_3;
+ __pyx_t_3 = 0;
+ __Pyx_DECREF(__pyx_v_node);
+ __pyx_v_node = __pyx_t_4;
+ __pyx_t_4 = 0;
+ } else {
+ __pyx_t_5 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 139; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_5);
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+ __pyx_t_2 = __Pyx_UnpackItem(__pyx_t_5, 0); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 139; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_2);
+ __pyx_t_3 = __Pyx_UnpackItem(__pyx_t_5, 1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 139; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_3);
+ __pyx_t_4 = __Pyx_UnpackItem(__pyx_t_5, 2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 139; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_4);
+ if (__Pyx_EndUnpack(__pyx_t_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 139; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+ __Pyx_DECREF(__pyx_v_dfa);
+ __pyx_v_dfa = __pyx_t_2;
+ __pyx_t_2 = 0;
+ __Pyx_DECREF(__pyx_v_state);
+ __pyx_v_state = __pyx_t_3;
+ __pyx_t_3 = 0;
+ __Pyx_DECREF(__pyx_v_node);
+ __pyx_v_node = __pyx_t_4;
+ __pyx_t_4 = 0;
}
- /* "/home/gbr/devel/sphinx/sphinx/pycode/pgen2/parse.pyx":133
+ /* "/home/gbr/devel/sphinx/sphinx/pycode/pgen2/parse.pyx":140
* """Push a nonterminal. (Internal)"""
* dfa, state, node = self.stack[-1]
* newnode = (type, None, context, []) # <<<<<<<<<<<<<<
* self.stack[-1] = (dfa, newstate, node)
* self.stack.append((newdfa, 0, newnode))
*/
- __pyx_3 = PyList_New(0); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 133; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __pyx_1 = PyTuple_New(4); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 133; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- Py_INCREF(__pyx_v_type);
- PyTuple_SET_ITEM(__pyx_1, 0, __pyx_v_type);
- Py_INCREF(Py_None);
- PyTuple_SET_ITEM(__pyx_1, 1, Py_None);
- Py_INCREF(__pyx_v_context);
- PyTuple_SET_ITEM(__pyx_1, 2, __pyx_v_context);
- PyTuple_SET_ITEM(__pyx_1, 3, ((PyObject *)__pyx_3));
- __pyx_3 = 0;
- Py_DECREF(__pyx_v_newnode);
- __pyx_v_newnode = ((PyObject *)__pyx_1);
- __pyx_1 = 0;
-
- /* "/home/gbr/devel/sphinx/sphinx/pycode/pgen2/parse.pyx":134
+ __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 140; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(((PyObject *)__pyx_t_1));
+ __pyx_t_4 = PyTuple_New(4); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 140; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_4);
+ __Pyx_INCREF(__pyx_v_type);
+ PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_type);
+ __Pyx_GIVEREF(__pyx_v_type);
+ __Pyx_INCREF(Py_None);
+ PyTuple_SET_ITEM(__pyx_t_4, 1, Py_None);
+ __Pyx_GIVEREF(Py_None);
+ __Pyx_INCREF(__pyx_v_context);
+ PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_v_context);
+ __Pyx_GIVEREF(__pyx_v_context);
+ PyTuple_SET_ITEM(__pyx_t_4, 3, ((PyObject *)__pyx_t_1));
+ __Pyx_GIVEREF(((PyObject *)__pyx_t_1));
+ __pyx_t_1 = 0;
+ __Pyx_DECREF(__pyx_v_newnode);
+ __pyx_v_newnode = __pyx_t_4;
+ __pyx_t_4 = 0;
+
+ /* "/home/gbr/devel/sphinx/sphinx/pycode/pgen2/parse.pyx":141
* dfa, state, node = self.stack[-1]
* newnode = (type, None, context, [])
* self.stack[-1] = (dfa, newstate, node) # <<<<<<<<<<<<<<
* self.stack.append((newdfa, 0, newnode))
*
*/
- __pyx_2 = PyTuple_New(3); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 134; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- Py_INCREF(__pyx_v_dfa);
- PyTuple_SET_ITEM(__pyx_2, 0, __pyx_v_dfa);
- Py_INCREF(__pyx_v_newstate);
- PyTuple_SET_ITEM(__pyx_2, 1, __pyx_v_newstate);
- Py_INCREF(__pyx_v_node);
- PyTuple_SET_ITEM(__pyx_2, 2, __pyx_v_node);
- if (__Pyx_SetItemInt(__pyx_v_self->stack, -1, ((PyObject *)__pyx_2), 0) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 134; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- Py_DECREF(((PyObject *)__pyx_2)); __pyx_2 = 0;
-
- /* "/home/gbr/devel/sphinx/sphinx/pycode/pgen2/parse.pyx":135
+ __pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 141; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_4);
+ __Pyx_INCREF(__pyx_v_dfa);
+ PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_dfa);
+ __Pyx_GIVEREF(__pyx_v_dfa);
+ __Pyx_INCREF(__pyx_v_newstate);
+ PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_v_newstate);
+ __Pyx_GIVEREF(__pyx_v_newstate);
+ __Pyx_INCREF(__pyx_v_node);
+ PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_v_node);
+ __Pyx_GIVEREF(__pyx_v_node);
+ if (__Pyx_SetItemInt(((PyObject *)__pyx_v_self->stack), -1, __pyx_t_4, sizeof(long), PyInt_FromLong) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 141; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+
+ /* "/home/gbr/devel/sphinx/sphinx/pycode/pgen2/parse.pyx":142
* newnode = (type, None, context, [])
* self.stack[-1] = (dfa, newstate, node)
* self.stack.append((newdfa, 0, newnode)) # <<<<<<<<<<<<<<
*
* cdef void pop(self):
*/
- __pyx_3 = PyTuple_New(3); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 135; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- Py_INCREF(__pyx_v_newdfa);
- PyTuple_SET_ITEM(__pyx_3, 0, __pyx_v_newdfa);
- Py_INCREF(__pyx_int_0);
- PyTuple_SET_ITEM(__pyx_3, 1, __pyx_int_0);
- Py_INCREF(__pyx_v_newnode);
- PyTuple_SET_ITEM(__pyx_3, 2, __pyx_v_newnode);
- __pyx_1 = __Pyx_PyObject_Append(__pyx_v_self->stack, ((PyObject *)__pyx_3)); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 135; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- Py_DECREF(((PyObject *)__pyx_3)); __pyx_3 = 0;
- Py_DECREF(__pyx_1); __pyx_1 = 0;
+ if (unlikely(__pyx_v_self->stack == Py_None)) {
+ PyErr_SetString(PyExc_AttributeError, "'NoneType' object has no attribute 'append'"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 142; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ }
+ __pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 142; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_4);
+ __Pyx_INCREF(__pyx_v_newdfa);
+ PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_newdfa);
+ __Pyx_GIVEREF(__pyx_v_newdfa);
+ __Pyx_INCREF(__pyx_int_0);
+ PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_int_0);
+ __Pyx_GIVEREF(__pyx_int_0);
+ __Pyx_INCREF(__pyx_v_newnode);
+ PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_v_newnode);
+ __Pyx_GIVEREF(__pyx_v_newnode);
+ __pyx_t_6 = PyList_Append(((PyObject *)__pyx_v_self->stack), __pyx_t_4); if (unlikely(__pyx_t_6 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 142; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
goto __pyx_L0;
__pyx_L1_error:;
- Py_XDECREF(__pyx_1);
- Py_XDECREF(__pyx_2);
- Py_XDECREF(__pyx_3);
+ __Pyx_XDECREF(__pyx_t_1);
+ __Pyx_XDECREF(__pyx_t_2);
+ __Pyx_XDECREF(__pyx_t_3);
+ __Pyx_XDECREF(__pyx_t_4);
+ __Pyx_XDECREF(__pyx_t_5);
__Pyx_WriteUnraisable("sphinx.pycode.pgen2.parse.Parser.push");
__pyx_L0:;
- Py_DECREF(__pyx_v_dfa);
- Py_DECREF(__pyx_v_state);
- Py_DECREF(__pyx_v_node);
- Py_DECREF(__pyx_v_newnode);
+ __Pyx_DECREF(__pyx_v_dfa);
+ __Pyx_DECREF(__pyx_v_state);
+ __Pyx_DECREF(__pyx_v_node);
+ __Pyx_DECREF(__pyx_v_newnode);
+ __Pyx_RefNannyFinishContext();
}
-/* "/home/gbr/devel/sphinx/sphinx/pycode/pgen2/parse.pyx":137
+/* "/home/gbr/devel/sphinx/sphinx/pycode/pgen2/parse.pyx":144
* self.stack.append((newdfa, 0, newnode))
*
* cdef void pop(self): # <<<<<<<<<<<<<<
@@ -1888,178 +2667,191 @@ static void __pyx_f_6sphinx_6pycode_5pgen2_5parse_6Parser_pop(struct __pyx_obj_
PyObject *__pyx_v_dfa;
PyObject *__pyx_v_state;
PyObject *__pyx_v_node;
- PyObject *__pyx_1 = 0;
- PyObject *__pyx_2 = 0;
- PyObject *__pyx_3 = 0;
- int __pyx_4;
- __pyx_v_popdfa = Py_None; Py_INCREF(Py_None);
- __pyx_v_popstate = Py_None; Py_INCREF(Py_None);
- __pyx_v_popnode = Py_None; Py_INCREF(Py_None);
- __pyx_v_newnode = Py_None; Py_INCREF(Py_None);
- __pyx_v_dfa = Py_None; Py_INCREF(Py_None);
- __pyx_v_state = Py_None; Py_INCREF(Py_None);
- __pyx_v_node = Py_None; Py_INCREF(Py_None);
-
- /* "/home/gbr/devel/sphinx/sphinx/pycode/pgen2/parse.pyx":139
+ PyObject *__pyx_t_1 = NULL;
+ PyObject *__pyx_t_2 = NULL;
+ PyObject *__pyx_t_3 = NULL;
+ PyObject *__pyx_t_4 = NULL;
+ PyObject *__pyx_t_5 = NULL;
+ int __pyx_t_6;
+ __Pyx_RefNannySetupContext("pop");
+ __Pyx_INCREF((PyObject *)__pyx_v_self);
+ __pyx_v_popdfa = Py_None; __Pyx_INCREF(Py_None);
+ __pyx_v_popstate = Py_None; __Pyx_INCREF(Py_None);
+ __pyx_v_popnode = Py_None; __Pyx_INCREF(Py_None);
+ __pyx_v_newnode = Py_None; __Pyx_INCREF(Py_None);
+ __pyx_v_dfa = Py_None; __Pyx_INCREF(Py_None);
+ __pyx_v_state = Py_None; __Pyx_INCREF(Py_None);
+ __pyx_v_node = Py_None; __Pyx_INCREF(Py_None);
+
+ /* "/home/gbr/devel/sphinx/sphinx/pycode/pgen2/parse.pyx":146
* cdef void pop(self):
* """Pop a nonterminal. (Internal)"""
* popdfa, popstate, popnode = self.stack.pop() # <<<<<<<<<<<<<<
* newnode = self.convert(popnode)
* if newnode is not None:
*/
- __pyx_1 = PyObject_GetAttr(__pyx_v_self->stack, __pyx_kp_pop); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 139; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __pyx_2 = PyObject_Call(__pyx_1, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 139; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- Py_DECREF(__pyx_1); __pyx_1 = 0;
- if (PyTuple_CheckExact(__pyx_2) && PyTuple_GET_SIZE(__pyx_2) == 3) {
- PyObject* tuple = __pyx_2;
- __pyx_3 = PyTuple_GET_ITEM(tuple, 0);
- Py_INCREF(__pyx_3);
- Py_DECREF(__pyx_v_popdfa);
- __pyx_v_popdfa = __pyx_3;
- __pyx_3 = 0;
- __pyx_3 = PyTuple_GET_ITEM(tuple, 1);
- Py_INCREF(__pyx_3);
- Py_DECREF(__pyx_v_popstate);
- __pyx_v_popstate = __pyx_3;
- __pyx_3 = 0;
- __pyx_3 = PyTuple_GET_ITEM(tuple, 2);
- Py_INCREF(__pyx_3);
- Py_DECREF(__pyx_v_popnode);
- __pyx_v_popnode = __pyx_3;
- __pyx_3 = 0;
- Py_DECREF(__pyx_2); __pyx_2 = 0;
- }
- else {
- __pyx_1 = PyObject_GetIter(__pyx_2); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 139; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- Py_DECREF(__pyx_2); __pyx_2 = 0;
- __pyx_3 = __Pyx_UnpackItem(__pyx_1, 0); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 139; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- Py_DECREF(__pyx_v_popdfa);
- __pyx_v_popdfa = __pyx_3;
- __pyx_3 = 0;
- __pyx_3 = __Pyx_UnpackItem(__pyx_1, 1); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 139; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- Py_DECREF(__pyx_v_popstate);
- __pyx_v_popstate = __pyx_3;
- __pyx_3 = 0;
- __pyx_3 = __Pyx_UnpackItem(__pyx_1, 2); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 139; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- Py_DECREF(__pyx_v_popnode);
- __pyx_v_popnode = __pyx_3;
- __pyx_3 = 0;
- if (__Pyx_EndUnpack(__pyx_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 139; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- Py_DECREF(__pyx_1); __pyx_1 = 0;
+ __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_self->stack), __pyx_n_s__pop); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 146; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_1);
+ __pyx_t_2 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 146; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_2);
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+ if (PyTuple_CheckExact(__pyx_t_2) && likely(PyTuple_GET_SIZE(__pyx_t_2) == 3)) {
+ PyObject* tuple = __pyx_t_2;
+ __pyx_t_1 = PyTuple_GET_ITEM(tuple, 0); __Pyx_INCREF(__pyx_t_1);
+ __pyx_t_3 = PyTuple_GET_ITEM(tuple, 1); __Pyx_INCREF(__pyx_t_3);
+ __pyx_t_4 = PyTuple_GET_ITEM(tuple, 2); __Pyx_INCREF(__pyx_t_4);
+ __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+ __Pyx_DECREF(__pyx_v_popdfa);
+ __pyx_v_popdfa = __pyx_t_1;
+ __pyx_t_1 = 0;
+ __Pyx_DECREF(__pyx_v_popstate);
+ __pyx_v_popstate = __pyx_t_3;
+ __pyx_t_3 = 0;
+ __Pyx_DECREF(__pyx_v_popnode);
+ __pyx_v_popnode = __pyx_t_4;
+ __pyx_t_4 = 0;
+ } else {
+ __pyx_t_5 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 146; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_5);
+ __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+ __pyx_t_1 = __Pyx_UnpackItem(__pyx_t_5, 0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 146; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_1);
+ __pyx_t_3 = __Pyx_UnpackItem(__pyx_t_5, 1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 146; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_3);
+ __pyx_t_4 = __Pyx_UnpackItem(__pyx_t_5, 2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 146; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_4);
+ if (__Pyx_EndUnpack(__pyx_t_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 146; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+ __Pyx_DECREF(__pyx_v_popdfa);
+ __pyx_v_popdfa = __pyx_t_1;
+ __pyx_t_1 = 0;
+ __Pyx_DECREF(__pyx_v_popstate);
+ __pyx_v_popstate = __pyx_t_3;
+ __pyx_t_3 = 0;
+ __Pyx_DECREF(__pyx_v_popnode);
+ __pyx_v_popnode = __pyx_t_4;
+ __pyx_t_4 = 0;
}
- /* "/home/gbr/devel/sphinx/sphinx/pycode/pgen2/parse.pyx":140
+ /* "/home/gbr/devel/sphinx/sphinx/pycode/pgen2/parse.pyx":147
* """Pop a nonterminal. (Internal)"""
* popdfa, popstate, popnode = self.stack.pop()
* newnode = self.convert(popnode) # <<<<<<<<<<<<<<
* if newnode is not None:
* if self.stack:
*/
- __pyx_3 = ((struct __pyx_vtabstruct_6sphinx_6pycode_5pgen2_5parse_Parser *)__pyx_v_self->__pyx_vtab)->convert(__pyx_v_self, __pyx_v_popnode); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 140; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- Py_DECREF(__pyx_v_newnode);
- __pyx_v_newnode = __pyx_3;
- __pyx_3 = 0;
-
- /* "/home/gbr/devel/sphinx/sphinx/pycode/pgen2/parse.pyx":141
+ if (!(likely(PyTuple_CheckExact(__pyx_v_popnode))||((__pyx_v_popnode) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected tuple, got %.200s", Py_TYPE(__pyx_v_popnode)->tp_name), 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 147; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = ((struct __pyx_vtabstruct_6sphinx_6pycode_5pgen2_5parse_Parser *)__pyx_v_self->__pyx_vtab)->convert(__pyx_v_self, ((PyObject *)__pyx_v_popnode)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 147; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_2);
+ __Pyx_DECREF(__pyx_v_newnode);
+ __pyx_v_newnode = __pyx_t_2;
+ __pyx_t_2 = 0;
+
+ /* "/home/gbr/devel/sphinx/sphinx/pycode/pgen2/parse.pyx":148
* popdfa, popstate, popnode = self.stack.pop()
* newnode = self.convert(popnode)
* if newnode is not None: # <<<<<<<<<<<<<<
* if self.stack:
* dfa, state, node = self.stack[-1]
*/
- __pyx_4 = (__pyx_v_newnode != Py_None);
- if (__pyx_4) {
+ __pyx_t_6 = (__pyx_v_newnode != Py_None);
+ if (__pyx_t_6) {
- /* "/home/gbr/devel/sphinx/sphinx/pycode/pgen2/parse.pyx":142
+ /* "/home/gbr/devel/sphinx/sphinx/pycode/pgen2/parse.pyx":149
* newnode = self.convert(popnode)
* if newnode is not None:
* if self.stack: # <<<<<<<<<<<<<<
* dfa, state, node = self.stack[-1]
* node[-1].append(newnode)
*/
- __pyx_4 = __Pyx_PyObject_IsTrue(__pyx_v_self->stack); if (unlikely(__pyx_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 142; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- if (__pyx_4) {
+ __pyx_t_6 = __Pyx_PyObject_IsTrue(((PyObject *)__pyx_v_self->stack)); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 149; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (__pyx_t_6) {
- /* "/home/gbr/devel/sphinx/sphinx/pycode/pgen2/parse.pyx":143
+ /* "/home/gbr/devel/sphinx/sphinx/pycode/pgen2/parse.pyx":150
* if newnode is not None:
* if self.stack:
* dfa, state, node = self.stack[-1] # <<<<<<<<<<<<<<
* node[-1].append(newnode)
* else:
*/
- __pyx_2 = __Pyx_GetItemInt(__pyx_v_self->stack, -1, 0); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 143; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- if (PyTuple_CheckExact(__pyx_2) && PyTuple_GET_SIZE(__pyx_2) == 3) {
- PyObject* tuple = __pyx_2;
- __pyx_3 = PyTuple_GET_ITEM(tuple, 0);
- Py_INCREF(__pyx_3);
- Py_DECREF(__pyx_v_dfa);
- __pyx_v_dfa = __pyx_3;
- __pyx_3 = 0;
- __pyx_3 = PyTuple_GET_ITEM(tuple, 1);
- Py_INCREF(__pyx_3);
- Py_DECREF(__pyx_v_state);
- __pyx_v_state = __pyx_3;
- __pyx_3 = 0;
- __pyx_3 = PyTuple_GET_ITEM(tuple, 2);
- Py_INCREF(__pyx_3);
- Py_DECREF(__pyx_v_node);
- __pyx_v_node = __pyx_3;
- __pyx_3 = 0;
- Py_DECREF(__pyx_2); __pyx_2 = 0;
- }
- else {
- __pyx_1 = PyObject_GetIter(__pyx_2); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 143; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- Py_DECREF(__pyx_2); __pyx_2 = 0;
- __pyx_3 = __Pyx_UnpackItem(__pyx_1, 0); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 143; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- Py_DECREF(__pyx_v_dfa);
- __pyx_v_dfa = __pyx_3;
- __pyx_3 = 0;
- __pyx_3 = __Pyx_UnpackItem(__pyx_1, 1); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 143; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- Py_DECREF(__pyx_v_state);
- __pyx_v_state = __pyx_3;
- __pyx_3 = 0;
- __pyx_3 = __Pyx_UnpackItem(__pyx_1, 2); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 143; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- Py_DECREF(__pyx_v_node);
- __pyx_v_node = __pyx_3;
- __pyx_3 = 0;
- if (__Pyx_EndUnpack(__pyx_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 143; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- Py_DECREF(__pyx_1); __pyx_1 = 0;
+ __pyx_t_2 = __Pyx_GetItemInt_List(((PyObject *)__pyx_v_self->stack), -1, sizeof(long), PyInt_FromLong); if (!__pyx_t_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 150; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_2);
+ if (PyTuple_CheckExact(__pyx_t_2) && likely(PyTuple_GET_SIZE(__pyx_t_2) == 3)) {
+ PyObject* tuple = __pyx_t_2;
+ __pyx_t_4 = PyTuple_GET_ITEM(tuple, 0); __Pyx_INCREF(__pyx_t_4);
+ __pyx_t_3 = PyTuple_GET_ITEM(tuple, 1); __Pyx_INCREF(__pyx_t_3);
+ __pyx_t_1 = PyTuple_GET_ITEM(tuple, 2); __Pyx_INCREF(__pyx_t_1);
+ __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+ __Pyx_DECREF(__pyx_v_dfa);
+ __pyx_v_dfa = __pyx_t_4;
+ __pyx_t_4 = 0;
+ __Pyx_DECREF(__pyx_v_state);
+ __pyx_v_state = __pyx_t_3;
+ __pyx_t_3 = 0;
+ __Pyx_DECREF(__pyx_v_node);
+ __pyx_v_node = __pyx_t_1;
+ __pyx_t_1 = 0;
+ } else {
+ __pyx_t_5 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 150; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_5);
+ __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+ __pyx_t_4 = __Pyx_UnpackItem(__pyx_t_5, 0); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 150; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_4);
+ __pyx_t_3 = __Pyx_UnpackItem(__pyx_t_5, 1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 150; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_3);
+ __pyx_t_1 = __Pyx_UnpackItem(__pyx_t_5, 2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 150; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_1);
+ if (__Pyx_EndUnpack(__pyx_t_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 150; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+ __Pyx_DECREF(__pyx_v_dfa);
+ __pyx_v_dfa = __pyx_t_4;
+ __pyx_t_4 = 0;
+ __Pyx_DECREF(__pyx_v_state);
+ __pyx_v_state = __pyx_t_3;
+ __pyx_t_3 = 0;
+ __Pyx_DECREF(__pyx_v_node);
+ __pyx_v_node = __pyx_t_1;
+ __pyx_t_1 = 0;
}
- /* "/home/gbr/devel/sphinx/sphinx/pycode/pgen2/parse.pyx":144
+ /* "/home/gbr/devel/sphinx/sphinx/pycode/pgen2/parse.pyx":151
* if self.stack:
* dfa, state, node = self.stack[-1]
* node[-1].append(newnode) # <<<<<<<<<<<<<<
* else:
* self.rootnode = newnode
*/
- __pyx_3 = __Pyx_GetItemInt(__pyx_v_node, -1, 0); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 144; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __pyx_2 = __Pyx_PyObject_Append(__pyx_3, __pyx_v_newnode); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 144; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- Py_DECREF(__pyx_3); __pyx_3 = 0;
- Py_DECREF(__pyx_2); __pyx_2 = 0;
+ __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_node, -1, sizeof(long), PyInt_FromLong); if (!__pyx_t_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 151; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_2);
+ __pyx_t_1 = __Pyx_PyObject_Append(__pyx_t_2, __pyx_v_newnode); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 151; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_1);
+ __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
goto __pyx_L4;
}
/*else*/ {
- /* "/home/gbr/devel/sphinx/sphinx/pycode/pgen2/parse.pyx":146
+ /* "/home/gbr/devel/sphinx/sphinx/pycode/pgen2/parse.pyx":153
* node[-1].append(newnode)
* else:
* self.rootnode = newnode # <<<<<<<<<<<<<<
* self.rootnode.used_names = self.used_names
*
*/
- Py_INCREF(__pyx_v_newnode);
- Py_DECREF(__pyx_v_self->rootnode);
+ __Pyx_INCREF(__pyx_v_newnode);
+ __Pyx_GIVEREF(__pyx_v_newnode);
+ __Pyx_GOTREF(__pyx_v_self->rootnode);
+ __Pyx_DECREF(__pyx_v_self->rootnode);
__pyx_v_self->rootnode = __pyx_v_newnode;
- /* "/home/gbr/devel/sphinx/sphinx/pycode/pgen2/parse.pyx":147
+ /* "/home/gbr/devel/sphinx/sphinx/pycode/pgen2/parse.pyx":154
* else:
* self.rootnode = newnode
* self.rootnode.used_names = self.used_names # <<<<<<<<<<<<<<
*
- * cdef convert(self, raw_node):
+ * cdef convert(self, tuple raw_node):
*/
- if (PyObject_SetAttr(__pyx_v_self->rootnode, __pyx_kp_used_names, __pyx_v_self->used_names) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 147; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (PyObject_SetAttr(__pyx_v_self->rootnode, __pyx_n_s__used_names, ((PyObject *)__pyx_v_self->used_names)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 154; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
}
__pyx_L4:;
goto __pyx_L3;
@@ -2068,24 +2860,28 @@ static void __pyx_f_6sphinx_6pycode_5pgen2_5parse_6Parser_pop(struct __pyx_obj_
goto __pyx_L0;
__pyx_L1_error:;
- Py_XDECREF(__pyx_1);
- Py_XDECREF(__pyx_2);
- Py_XDECREF(__pyx_3);
+ __Pyx_XDECREF(__pyx_t_1);
+ __Pyx_XDECREF(__pyx_t_2);
+ __Pyx_XDECREF(__pyx_t_3);
+ __Pyx_XDECREF(__pyx_t_4);
+ __Pyx_XDECREF(__pyx_t_5);
__Pyx_WriteUnraisable("sphinx.pycode.pgen2.parse.Parser.pop");
__pyx_L0:;
- Py_DECREF(__pyx_v_popdfa);
- Py_DECREF(__pyx_v_popstate);
- Py_DECREF(__pyx_v_popnode);
- Py_DECREF(__pyx_v_newnode);
- Py_DECREF(__pyx_v_dfa);
- Py_DECREF(__pyx_v_state);
- Py_DECREF(__pyx_v_node);
+ __Pyx_DECREF(__pyx_v_popdfa);
+ __Pyx_DECREF(__pyx_v_popstate);
+ __Pyx_DECREF(__pyx_v_popnode);
+ __Pyx_DECREF(__pyx_v_newnode);
+ __Pyx_DECREF(__pyx_v_dfa);
+ __Pyx_DECREF(__pyx_v_state);
+ __Pyx_DECREF(__pyx_v_node);
+ __Pyx_DECREF((PyObject *)__pyx_v_self);
+ __Pyx_RefNannyFinishContext();
}
-/* "/home/gbr/devel/sphinx/sphinx/pycode/pgen2/parse.pyx":149
+/* "/home/gbr/devel/sphinx/sphinx/pycode/pgen2/parse.pyx":156
* self.rootnode.used_names = self.used_names
*
- * cdef convert(self, raw_node): # <<<<<<<<<<<<<<
+ * cdef convert(self, tuple raw_node): # <<<<<<<<<<<<<<
* type, value, context, children = raw_node
* if children or type in self._grammar_number2symbol:
*/
@@ -2095,178 +2891,182 @@ static PyObject *__pyx_f_6sphinx_6pycode_5pgen2_5parse_6Parser_convert(struct _
PyObject *__pyx_v_value;
PyObject *__pyx_v_context;
PyObject *__pyx_v_children;
- PyObject *__pyx_r;
- PyObject *__pyx_1 = 0;
- PyObject *__pyx_2 = 0;
- int __pyx_3;
- Py_ssize_t __pyx_4 = 0;
- PyObject *__pyx_5 = 0;
- PyObject *__pyx_6 = 0;
- __pyx_v_type = Py_None; Py_INCREF(Py_None);
- __pyx_v_value = Py_None; Py_INCREF(Py_None);
- __pyx_v_context = Py_None; Py_INCREF(Py_None);
- __pyx_v_children = Py_None; Py_INCREF(Py_None);
-
- /* "/home/gbr/devel/sphinx/sphinx/pycode/pgen2/parse.pyx":150
+ PyObject *__pyx_r = NULL;
+ PyObject *__pyx_t_1 = NULL;
+ PyObject *__pyx_t_2 = NULL;
+ PyObject *__pyx_t_3 = NULL;
+ PyObject *__pyx_t_4 = NULL;
+ int __pyx_t_5;
+ int __pyx_t_6;
+ int __pyx_t_7;
+ Py_ssize_t __pyx_t_8;
+ __Pyx_RefNannySetupContext("convert");
+ __Pyx_INCREF((PyObject *)__pyx_v_self);
+ __Pyx_INCREF(__pyx_v_raw_node);
+ __pyx_v_type = Py_None; __Pyx_INCREF(Py_None);
+ __pyx_v_value = Py_None; __Pyx_INCREF(Py_None);
+ __pyx_v_context = Py_None; __Pyx_INCREF(Py_None);
+ __pyx_v_children = Py_None; __Pyx_INCREF(Py_None);
+
+ /* "/home/gbr/devel/sphinx/sphinx/pycode/pgen2/parse.pyx":157
*
- * cdef convert(self, raw_node):
+ * cdef convert(self, tuple raw_node):
* type, value, context, children = raw_node # <<<<<<<<<<<<<<
* if children or type in self._grammar_number2symbol:
* # If there's exactly one child, return that child instead of
*/
- if (PyTuple_CheckExact(__pyx_v_raw_node) && PyTuple_GET_SIZE(__pyx_v_raw_node) == 4) {
- PyObject* tuple = __pyx_v_raw_node;
- __pyx_2 = PyTuple_GET_ITEM(tuple, 0);
- Py_INCREF(__pyx_2);
- Py_DECREF(__pyx_v_type);
- __pyx_v_type = __pyx_2;
- __pyx_2 = 0;
- __pyx_2 = PyTuple_GET_ITEM(tuple, 1);
- Py_INCREF(__pyx_2);
- Py_DECREF(__pyx_v_value);
- __pyx_v_value = __pyx_2;
- __pyx_2 = 0;
- __pyx_2 = PyTuple_GET_ITEM(tuple, 2);
- Py_INCREF(__pyx_2);
- Py_DECREF(__pyx_v_context);
- __pyx_v_context = __pyx_2;
- __pyx_2 = 0;
- __pyx_2 = PyTuple_GET_ITEM(tuple, 3);
- Py_INCREF(__pyx_2);
- Py_DECREF(__pyx_v_children);
- __pyx_v_children = __pyx_2;
- __pyx_2 = 0;
- }
- else {
- __pyx_1 = PyObject_GetIter(__pyx_v_raw_node); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 150; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __pyx_2 = __Pyx_UnpackItem(__pyx_1, 0); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 150; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- Py_DECREF(__pyx_v_type);
- __pyx_v_type = __pyx_2;
- __pyx_2 = 0;
- __pyx_2 = __Pyx_UnpackItem(__pyx_1, 1); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 150; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- Py_DECREF(__pyx_v_value);
- __pyx_v_value = __pyx_2;
- __pyx_2 = 0;
- __pyx_2 = __Pyx_UnpackItem(__pyx_1, 2); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 150; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- Py_DECREF(__pyx_v_context);
- __pyx_v_context = __pyx_2;
- __pyx_2 = 0;
- __pyx_2 = __Pyx_UnpackItem(__pyx_1, 3); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 150; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- Py_DECREF(__pyx_v_children);
- __pyx_v_children = __pyx_2;
- __pyx_2 = 0;
- if (__Pyx_EndUnpack(__pyx_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 150; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- Py_DECREF(__pyx_1); __pyx_1 = 0;
+ if (likely(((PyObject *)__pyx_v_raw_node) != Py_None) && likely(PyTuple_GET_SIZE(((PyObject *)__pyx_v_raw_node)) == 4)) {
+ PyObject* tuple = ((PyObject *)__pyx_v_raw_node);
+ __pyx_t_1 = PyTuple_GET_ITEM(tuple, 0); __Pyx_INCREF(__pyx_t_1);
+ __pyx_t_2 = PyTuple_GET_ITEM(tuple, 1); __Pyx_INCREF(__pyx_t_2);
+ __pyx_t_3 = PyTuple_GET_ITEM(tuple, 2); __Pyx_INCREF(__pyx_t_3);
+ __pyx_t_4 = PyTuple_GET_ITEM(tuple, 3); __Pyx_INCREF(__pyx_t_4);
+ __Pyx_DECREF(__pyx_v_type);
+ __pyx_v_type = __pyx_t_1;
+ __pyx_t_1 = 0;
+ __Pyx_DECREF(__pyx_v_value);
+ __pyx_v_value = __pyx_t_2;
+ __pyx_t_2 = 0;
+ __Pyx_DECREF(__pyx_v_context);
+ __pyx_v_context = __pyx_t_3;
+ __pyx_t_3 = 0;
+ __Pyx_DECREF(__pyx_v_children);
+ __pyx_v_children = __pyx_t_4;
+ __pyx_t_4 = 0;
+ } else {
+ __Pyx_UnpackTupleError(((PyObject *)__pyx_v_raw_node), 4);
+ {__pyx_filename = __pyx_f[0]; __pyx_lineno = 157; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
}
- /* "/home/gbr/devel/sphinx/sphinx/pycode/pgen2/parse.pyx":151
- * cdef convert(self, raw_node):
+ /* "/home/gbr/devel/sphinx/sphinx/pycode/pgen2/parse.pyx":158
+ * cdef convert(self, tuple raw_node):
* type, value, context, children = raw_node
* if children or type in self._grammar_number2symbol: # <<<<<<<<<<<<<<
* # If there's exactly one child, return that child instead of
* # creating a new node.
*/
- __pyx_2 = __pyx_v_children;
- Py_INCREF(__pyx_2);
- __pyx_3 = __Pyx_PyObject_IsTrue(__pyx_2); if (unlikely(__pyx_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 151; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- if (!__pyx_3) {
- Py_DECREF(__pyx_2); __pyx_2 = 0;
- __pyx_3 = (PySequence_Contains(__pyx_v_self->_grammar_number2symbol, __pyx_v_type)); if (unlikely(__pyx_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 151; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __pyx_2 = __Pyx_PyBool_FromLong(__pyx_3); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 151; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_v_children); if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 158; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (!__pyx_t_5) {
+ if (unlikely(((PyObject *)__pyx_v_self->_grammar_number2symbol) == Py_None)) {
+ __Pyx_RaiseNoneNotIterableError(); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 158; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ } else {
+ __pyx_t_6 = ((PyDict_Contains(((PyObject *)__pyx_v_self->_grammar_number2symbol), __pyx_v_type))); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 158; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ }
+ __pyx_t_7 = __pyx_t_6;
+ } else {
+ __pyx_t_7 = __pyx_t_5;
}
- __pyx_3 = __Pyx_PyObject_IsTrue(__pyx_2); if (unlikely(__pyx_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 151; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- Py_DECREF(__pyx_2); __pyx_2 = 0;
- if (__pyx_3) {
+ if (__pyx_t_7) {
- /* "/home/gbr/devel/sphinx/sphinx/pycode/pgen2/parse.pyx":154
+ /* "/home/gbr/devel/sphinx/sphinx/pycode/pgen2/parse.pyx":161
* # If there's exactly one child, return that child instead of
* # creating a new node.
* if len(children) == 1: # <<<<<<<<<<<<<<
* return children[0]
* return Node(type, children, context=context)
*/
- __pyx_4 = PyObject_Length(__pyx_v_children); if (unlikely(__pyx_4 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 154; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __pyx_3 = (__pyx_4 == 1);
- if (__pyx_3) {
+ __pyx_t_8 = PyObject_Length(__pyx_v_children); if (unlikely(__pyx_t_8 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 161; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_7 = (__pyx_t_8 == 1);
+ if (__pyx_t_7) {
- /* "/home/gbr/devel/sphinx/sphinx/pycode/pgen2/parse.pyx":155
+ /* "/home/gbr/devel/sphinx/sphinx/pycode/pgen2/parse.pyx":162
* # creating a new node.
* if len(children) == 1:
* return children[0] # <<<<<<<<<<<<<<
* return Node(type, children, context=context)
* else:
*/
- __pyx_1 = __Pyx_GetItemInt(__pyx_v_children, 0, 0); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 155; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __pyx_r = __pyx_1;
- __pyx_1 = 0;
+ __Pyx_XDECREF(__pyx_r);
+ __pyx_t_4 = __Pyx_GetItemInt(__pyx_v_children, 0, sizeof(long), PyInt_FromLong); if (!__pyx_t_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 162; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_4);
+ __pyx_r = __pyx_t_4;
+ __pyx_t_4 = 0;
goto __pyx_L0;
goto __pyx_L4;
}
__pyx_L4:;
- /* "/home/gbr/devel/sphinx/sphinx/pycode/pgen2/parse.pyx":156
+ /* "/home/gbr/devel/sphinx/sphinx/pycode/pgen2/parse.pyx":163
* if len(children) == 1:
* return children[0]
* return Node(type, children, context=context) # <<<<<<<<<<<<<<
* else:
* return Leaf(type, value, context=context)
*/
- __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_kp_Node); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 156; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __pyx_1 = PyTuple_New(2); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 156; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- Py_INCREF(__pyx_v_type);
- PyTuple_SET_ITEM(__pyx_1, 0, __pyx_v_type);
- Py_INCREF(__pyx_v_children);
- PyTuple_SET_ITEM(__pyx_1, 1, __pyx_v_children);
- __pyx_5 = PyDict_New(); if (unlikely(!__pyx_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 156; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- if (PyDict_SetItem(__pyx_5, __pyx_kp_context, __pyx_v_context) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 156; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __pyx_6 = PyEval_CallObjectWithKeywords(__pyx_2, ((PyObject *)__pyx_1), ((PyObject *)__pyx_5)); if (unlikely(!__pyx_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 156; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- Py_DECREF(__pyx_2); __pyx_2 = 0;
- Py_DECREF(((PyObject *)__pyx_1)); __pyx_1 = 0;
- Py_DECREF(((PyObject *)__pyx_5)); __pyx_5 = 0;
- __pyx_r = __pyx_6;
- __pyx_6 = 0;
+ __Pyx_XDECREF(__pyx_r);
+ __pyx_t_4 = __Pyx_GetName(__pyx_m, __pyx_n_s__Node); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 163; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_4);
+ __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 163; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_3);
+ __Pyx_INCREF(__pyx_v_type);
+ PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_type);
+ __Pyx_GIVEREF(__pyx_v_type);
+ __Pyx_INCREF(__pyx_v_children);
+ PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_v_children);
+ __Pyx_GIVEREF(__pyx_v_children);
+ __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 163; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(((PyObject *)__pyx_t_2));
+ if (PyDict_SetItem(__pyx_t_2, ((PyObject *)__pyx_n_s__context), __pyx_v_context) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 163; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PyEval_CallObjectWithKeywords(__pyx_t_4, __pyx_t_3, ((PyObject *)__pyx_t_2)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 163; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_1);
+ __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+ __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+ __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
+ __pyx_r = __pyx_t_1;
+ __pyx_t_1 = 0;
goto __pyx_L0;
goto __pyx_L3;
}
/*else*/ {
- /* "/home/gbr/devel/sphinx/sphinx/pycode/pgen2/parse.pyx":158
+ /* "/home/gbr/devel/sphinx/sphinx/pycode/pgen2/parse.pyx":165
* return Node(type, children, context=context)
* else:
* return Leaf(type, value, context=context) # <<<<<<<<<<<<<<
*/
- __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_kp_Leaf); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 158; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __pyx_1 = PyTuple_New(2); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 158; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- Py_INCREF(__pyx_v_type);
- PyTuple_SET_ITEM(__pyx_1, 0, __pyx_v_type);
- Py_INCREF(__pyx_v_value);
- PyTuple_SET_ITEM(__pyx_1, 1, __pyx_v_value);
- __pyx_5 = PyDict_New(); if (unlikely(!__pyx_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 158; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- if (PyDict_SetItem(__pyx_5, __pyx_kp_context, __pyx_v_context) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 158; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __pyx_6 = PyEval_CallObjectWithKeywords(__pyx_2, ((PyObject *)__pyx_1), ((PyObject *)__pyx_5)); if (unlikely(!__pyx_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 158; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- Py_DECREF(__pyx_2); __pyx_2 = 0;
- Py_DECREF(((PyObject *)__pyx_1)); __pyx_1 = 0;
- Py_DECREF(((PyObject *)__pyx_5)); __pyx_5 = 0;
- __pyx_r = __pyx_6;
- __pyx_6 = 0;
+ __Pyx_XDECREF(__pyx_r);
+ __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__Leaf); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 165; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_1);
+ __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 165; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_2);
+ __Pyx_INCREF(__pyx_v_type);
+ PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_type);
+ __Pyx_GIVEREF(__pyx_v_type);
+ __Pyx_INCREF(__pyx_v_value);
+ PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_v_value);
+ __Pyx_GIVEREF(__pyx_v_value);
+ __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 165; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(((PyObject *)__pyx_t_3));
+ if (PyDict_SetItem(__pyx_t_3, ((PyObject *)__pyx_n_s__context), __pyx_v_context) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 165; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = PyEval_CallObjectWithKeywords(__pyx_t_1, __pyx_t_2, ((PyObject *)__pyx_t_3)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 165; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_4);
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+ __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+ __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
+ __pyx_r = __pyx_t_4;
+ __pyx_t_4 = 0;
goto __pyx_L0;
}
__pyx_L3:;
- __pyx_r = Py_None; Py_INCREF(Py_None);
+ __pyx_r = Py_None; __Pyx_INCREF(Py_None);
goto __pyx_L0;
__pyx_L1_error:;
- Py_XDECREF(__pyx_1);
- Py_XDECREF(__pyx_2);
- Py_XDECREF(__pyx_5);
- Py_XDECREF(__pyx_6);
+ __Pyx_XDECREF(__pyx_t_1);
+ __Pyx_XDECREF(__pyx_t_2);
+ __Pyx_XDECREF(__pyx_t_3);
+ __Pyx_XDECREF(__pyx_t_4);
__Pyx_AddTraceback("sphinx.pycode.pgen2.parse.Parser.convert");
__pyx_r = 0;
__pyx_L0:;
- Py_DECREF(__pyx_v_type);
- Py_DECREF(__pyx_v_value);
- Py_DECREF(__pyx_v_context);
- Py_DECREF(__pyx_v_children);
+ __Pyx_DECREF(__pyx_v_type);
+ __Pyx_DECREF(__pyx_v_value);
+ __Pyx_DECREF(__pyx_v_context);
+ __Pyx_DECREF(__pyx_v_children);
+ __Pyx_DECREF((PyObject *)__pyx_v_self);
+ __Pyx_DECREF(__pyx_v_raw_node);
+ __Pyx_XGIVEREF(__pyx_r);
+ __Pyx_RefNannyFinishContext();
return __pyx_r;
}
static struct __pyx_vtabstruct_6sphinx_6pycode_5pgen2_5parse_Parser __pyx_vtable_6sphinx_6pycode_5pgen2_5parse_Parser;
@@ -2278,28 +3078,28 @@ static PyObject *__pyx_tp_new_6sphinx_6pycode_5pgen2_5parse_Parser(PyTypeObject
p = ((struct __pyx_obj_6sphinx_6pycode_5pgen2_5parse_Parser *)o);
p->__pyx_vtab = __pyx_vtabptr_6sphinx_6pycode_5pgen2_5parse_Parser;
p->grammar = Py_None; Py_INCREF(Py_None);
- p->stack = Py_None; Py_INCREF(Py_None);
p->rootnode = Py_None; Py_INCREF(Py_None);
- p->used_names = Py_None; Py_INCREF(Py_None);
- p->_grammar_dfas = Py_None; Py_INCREF(Py_None);
- p->_grammar_labels = Py_None; Py_INCREF(Py_None);
- p->_grammar_keywords = Py_None; Py_INCREF(Py_None);
- p->_grammar_tokens = Py_None; Py_INCREF(Py_None);
- p->_grammar_number2symbol = Py_None; Py_INCREF(Py_None);
+ p->stack = ((PyObject *)Py_None); Py_INCREF(Py_None);
+ p->used_names = ((PyObject *)Py_None); Py_INCREF(Py_None);
+ p->_grammar_labels = ((PyObject *)Py_None); Py_INCREF(Py_None);
+ p->_grammar_dfas = ((PyObject *)Py_None); Py_INCREF(Py_None);
+ p->_grammar_keywords = ((PyObject *)Py_None); Py_INCREF(Py_None);
+ p->_grammar_tokens = ((PyObject *)Py_None); Py_INCREF(Py_None);
+ p->_grammar_number2symbol = ((PyObject *)Py_None); Py_INCREF(Py_None);
return o;
}
static void __pyx_tp_dealloc_6sphinx_6pycode_5pgen2_5parse_Parser(PyObject *o) {
struct __pyx_obj_6sphinx_6pycode_5pgen2_5parse_Parser *p = (struct __pyx_obj_6sphinx_6pycode_5pgen2_5parse_Parser *)o;
Py_XDECREF(p->grammar);
- Py_XDECREF(p->stack);
Py_XDECREF(p->rootnode);
- Py_XDECREF(p->used_names);
- Py_XDECREF(p->_grammar_dfas);
- Py_XDECREF(p->_grammar_labels);
- Py_XDECREF(p->_grammar_keywords);
- Py_XDECREF(p->_grammar_tokens);
- Py_XDECREF(p->_grammar_number2symbol);
+ Py_XDECREF(((PyObject *)p->stack));
+ Py_XDECREF(((PyObject *)p->used_names));
+ Py_XDECREF(((PyObject *)p->_grammar_labels));
+ Py_XDECREF(((PyObject *)p->_grammar_dfas));
+ Py_XDECREF(((PyObject *)p->_grammar_keywords));
+ Py_XDECREF(((PyObject *)p->_grammar_tokens));
+ Py_XDECREF(((PyObject *)p->_grammar_number2symbol));
(*Py_TYPE(o)->tp_free)(o);
}
@@ -2309,21 +3109,21 @@ static int __pyx_tp_traverse_6sphinx_6pycode_5pgen2_5parse_Parser(PyObject *o, v
if (p->grammar) {
e = (*v)(p->grammar, a); if (e) return e;
}
- if (p->stack) {
- e = (*v)(p->stack, a); if (e) return e;
- }
if (p->rootnode) {
e = (*v)(p->rootnode, a); if (e) return e;
}
+ if (p->stack) {
+ e = (*v)(p->stack, a); if (e) return e;
+ }
if (p->used_names) {
e = (*v)(p->used_names, a); if (e) return e;
}
- if (p->_grammar_dfas) {
- e = (*v)(p->_grammar_dfas, a); if (e) return e;
- }
if (p->_grammar_labels) {
e = (*v)(p->_grammar_labels, a); if (e) return e;
}
+ if (p->_grammar_dfas) {
+ e = (*v)(p->_grammar_dfas, a); if (e) return e;
+ }
if (p->_grammar_keywords) {
e = (*v)(p->_grammar_keywords, a); if (e) return e;
}
@@ -2342,44 +3142,76 @@ static int __pyx_tp_clear_6sphinx_6pycode_5pgen2_5parse_Parser(PyObject *o) {
tmp = ((PyObject*)p->grammar);
p->grammar = Py_None; Py_INCREF(Py_None);
Py_XDECREF(tmp);
- tmp = ((PyObject*)p->stack);
- p->stack = Py_None; Py_INCREF(Py_None);
- Py_XDECREF(tmp);
tmp = ((PyObject*)p->rootnode);
p->rootnode = Py_None; Py_INCREF(Py_None);
Py_XDECREF(tmp);
- tmp = ((PyObject*)p->used_names);
- p->used_names = Py_None; Py_INCREF(Py_None);
+ tmp = ((PyObject*)p->stack);
+ p->stack = ((PyObject *)Py_None); Py_INCREF(Py_None);
Py_XDECREF(tmp);
- tmp = ((PyObject*)p->_grammar_dfas);
- p->_grammar_dfas = Py_None; Py_INCREF(Py_None);
+ tmp = ((PyObject*)p->used_names);
+ p->used_names = ((PyObject *)Py_None); Py_INCREF(Py_None);
Py_XDECREF(tmp);
tmp = ((PyObject*)p->_grammar_labels);
- p->_grammar_labels = Py_None; Py_INCREF(Py_None);
+ p->_grammar_labels = ((PyObject *)Py_None); Py_INCREF(Py_None);
+ Py_XDECREF(tmp);
+ tmp = ((PyObject*)p->_grammar_dfas);
+ p->_grammar_dfas = ((PyObject *)Py_None); Py_INCREF(Py_None);
Py_XDECREF(tmp);
tmp = ((PyObject*)p->_grammar_keywords);
- p->_grammar_keywords = Py_None; Py_INCREF(Py_None);
+ p->_grammar_keywords = ((PyObject *)Py_None); Py_INCREF(Py_None);
Py_XDECREF(tmp);
tmp = ((PyObject*)p->_grammar_tokens);
- p->_grammar_tokens = Py_None; Py_INCREF(Py_None);
+ p->_grammar_tokens = ((PyObject *)Py_None); Py_INCREF(Py_None);
Py_XDECREF(tmp);
tmp = ((PyObject*)p->_grammar_number2symbol);
- p->_grammar_number2symbol = Py_None; Py_INCREF(Py_None);
+ p->_grammar_number2symbol = ((PyObject *)Py_None); Py_INCREF(Py_None);
Py_XDECREF(tmp);
return 0;
}
+static PyObject *__pyx_getprop_6sphinx_6pycode_5pgen2_5parse_6Parser_stack(PyObject *o, void *x) {
+ return __pyx_pf_6sphinx_6pycode_5pgen2_5parse_6Parser_5stack___get__(o);
+}
+
+static int __pyx_setprop_6sphinx_6pycode_5pgen2_5parse_6Parser_stack(PyObject *o, PyObject *v, void *x) {
+ if (v) {
+ return __pyx_pf_6sphinx_6pycode_5pgen2_5parse_6Parser_5stack___set__(o, v);
+ }
+ else {
+ PyErr_SetString(PyExc_NotImplementedError, "__del__");
+ return -1;
+ }
+}
+
+static PyObject *__pyx_getprop_6sphinx_6pycode_5pgen2_5parse_6Parser_used_names(PyObject *o, void *x) {
+ return __pyx_pf_6sphinx_6pycode_5pgen2_5parse_6Parser_10used_names___get__(o);
+}
+
+static int __pyx_setprop_6sphinx_6pycode_5pgen2_5parse_6Parser_used_names(PyObject *o, PyObject *v, void *x) {
+ if (v) {
+ return __pyx_pf_6sphinx_6pycode_5pgen2_5parse_6Parser_10used_names___set__(o, v);
+ }
+ else {
+ PyErr_SetString(PyExc_NotImplementedError, "__del__");
+ return -1;
+ }
+}
+
static struct PyMethodDef __pyx_methods_6sphinx_6pycode_5pgen2_5parse_Parser[] = {
- {"setup", (PyCFunction)__pyx_pf_6sphinx_6pycode_5pgen2_5parse_6Parser_setup, METH_VARARGS|METH_KEYWORDS, 0},
- {"addtoken", (PyCFunction)__pyx_pf_6sphinx_6pycode_5pgen2_5parse_6Parser_addtoken, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6sphinx_6pycode_5pgen2_5parse_6Parser_addtoken},
+ {__Pyx_NAMESTR("setup"), (PyCFunction)__pyx_pf_6sphinx_6pycode_5pgen2_5parse_6Parser_setup, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)},
+ {__Pyx_NAMESTR("addtoken"), (PyCFunction)__pyx_pf_6sphinx_6pycode_5pgen2_5parse_6Parser_addtoken, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_6sphinx_6pycode_5pgen2_5parse_6Parser_addtoken)},
{0, 0, 0, 0}
};
static struct PyMemberDef __pyx_members_6sphinx_6pycode_5pgen2_5parse_Parser[] = {
- {"grammar", T_OBJECT, offsetof(struct __pyx_obj_6sphinx_6pycode_5pgen2_5parse_Parser, grammar), 0, 0},
- {"stack", T_OBJECT, offsetof(struct __pyx_obj_6sphinx_6pycode_5pgen2_5parse_Parser, stack), 0, 0},
- {"rootnode", T_OBJECT, offsetof(struct __pyx_obj_6sphinx_6pycode_5pgen2_5parse_Parser, rootnode), 0, 0},
- {"used_names", T_OBJECT, offsetof(struct __pyx_obj_6sphinx_6pycode_5pgen2_5parse_Parser, used_names), 0, 0},
+ {(char *)"grammar", T_OBJECT, offsetof(struct __pyx_obj_6sphinx_6pycode_5pgen2_5parse_Parser, grammar), 0, 0},
+ {(char *)"rootnode", T_OBJECT, offsetof(struct __pyx_obj_6sphinx_6pycode_5pgen2_5parse_Parser, rootnode), 0, 0},
+ {0, 0, 0, 0, 0}
+};
+
+static struct PyGetSetDef __pyx_getsets_6sphinx_6pycode_5pgen2_5parse_Parser[] = {
+ {(char *)"stack", __pyx_getprop_6sphinx_6pycode_5pgen2_5parse_6Parser_stack, __pyx_setprop_6sphinx_6pycode_5pgen2_5parse_6Parser_stack, 0, 0},
+ {(char *)"used_names", __pyx_getprop_6sphinx_6pycode_5pgen2_5parse_6Parser_used_names, __pyx_setprop_6sphinx_6pycode_5pgen2_5parse_6Parser_used_names, 0, 0},
{0, 0, 0, 0, 0}
};
@@ -2407,7 +3239,11 @@ static PyNumberMethods __pyx_tp_as_number_Parser = {
0, /*nb_coerce*/
#endif
0, /*nb_int*/
+ #if PY_MAJOR_VERSION >= 3
+ 0, /*reserved*/
+ #else
0, /*nb_long*/
+ #endif
0, /*nb_float*/
#if PY_MAJOR_VERSION < 3
0, /*nb_oct*/
@@ -2469,17 +3305,17 @@ static PyBufferProcs __pyx_tp_as_buffer_Parser = {
#if PY_MAJOR_VERSION < 3
0, /*bf_getcharbuffer*/
#endif
- #if (PY_MAJOR_VERSION >= 3) || (Py_TPFLAGS_DEFAULT & Py_TPFLAGS_HAVE_NEWBUFFER)
+ #if PY_VERSION_HEX >= 0x02060000
0, /*bf_getbuffer*/
#endif
- #if (PY_MAJOR_VERSION >= 3) || (Py_TPFLAGS_DEFAULT & Py_TPFLAGS_HAVE_NEWBUFFER)
+ #if PY_VERSION_HEX >= 0x02060000
0, /*bf_releasebuffer*/
#endif
};
PyTypeObject __pyx_type_6sphinx_6pycode_5pgen2_5parse_Parser = {
PyVarObject_HEAD_INIT(0, 0)
- "sphinx.pycode.pgen2.parse.Parser", /*tp_name*/
+ __Pyx_NAMESTR("sphinx.pycode.pgen2.parse.Parser"), /*tp_name*/
sizeof(struct __pyx_obj_6sphinx_6pycode_5pgen2_5parse_Parser), /*tp_basicsize*/
0, /*tp_itemsize*/
__pyx_tp_dealloc_6sphinx_6pycode_5pgen2_5parse_Parser, /*tp_dealloc*/
@@ -2497,7 +3333,7 @@ PyTypeObject __pyx_type_6sphinx_6pycode_5pgen2_5parse_Parser = {
0, /*tp_getattro*/
0, /*tp_setattro*/
&__pyx_tp_as_buffer_Parser, /*tp_as_buffer*/
- Py_TPFLAGS_DEFAULT|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
+ Py_TPFLAGS_DEFAULT|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
0, /*tp_doc*/
__pyx_tp_traverse_6sphinx_6pycode_5pgen2_5parse_Parser, /*tp_traverse*/
__pyx_tp_clear_6sphinx_6pycode_5pgen2_5parse_Parser, /*tp_clear*/
@@ -2507,7 +3343,7 @@ PyTypeObject __pyx_type_6sphinx_6pycode_5pgen2_5parse_Parser = {
0, /*tp_iternext*/
__pyx_methods_6sphinx_6pycode_5pgen2_5parse_Parser, /*tp_methods*/
__pyx_members_6sphinx_6pycode_5pgen2_5parse_Parser, /*tp_members*/
- 0, /*tp_getset*/
+ __pyx_getsets_6sphinx_6pycode_5pgen2_5parse_Parser, /*tp_getset*/
0, /*tp_base*/
0, /*tp_dict*/
0, /*tp_descr_get*/
@@ -2523,6 +3359,10 @@ PyTypeObject __pyx_type_6sphinx_6pycode_5pgen2_5parse_Parser = {
0, /*tp_cache*/
0, /*tp_subclasses*/
0, /*tp_weaklist*/
+ 0, /*tp_del*/
+ #if PY_VERSION_HEX >= 0x02060000
+ 0, /*tp_version_tag*/
+ #endif
};
static struct PyMethodDef __pyx_methods[] = {
@@ -2534,8 +3374,8 @@ static void __pyx_init_filenames(void); /*proto*/
#if PY_MAJOR_VERSION >= 3
static struct PyModuleDef __pyx_moduledef = {
PyModuleDef_HEAD_INIT,
- "parse",
- 0, /* m_doc */
+ __Pyx_NAMESTR("parse"),
+ __Pyx_DOCSTR(__pyx_k_6), /* m_doc */
-1, /* m_size */
__pyx_methods /* m_methods */,
NULL, /* m_reload */
@@ -2546,47 +3386,64 @@ static struct PyModuleDef __pyx_moduledef = {
#endif
static __Pyx_StringTabEntry __pyx_string_tab[] = {
- {&__pyx_kp___init__, __pyx_k___init__, sizeof(__pyx_k___init__), 0, 1, 1},
- {&__pyx_kp_setup, __pyx_k_setup, sizeof(__pyx_k_setup), 0, 1, 1},
- {&__pyx_kp_addtoken, __pyx_k_addtoken, sizeof(__pyx_k_addtoken), 0, 1, 1},
- {&__pyx_kp_1, __pyx_k_1, sizeof(__pyx_k_1), 1, 1, 1},
- {&__pyx_kp_Node, __pyx_k_Node, sizeof(__pyx_k_Node), 1, 1, 1},
- {&__pyx_kp_Leaf, __pyx_k_Leaf, sizeof(__pyx_k_Leaf), 1, 1, 1},
- {&__pyx_kp_ParseError, __pyx_k_ParseError, sizeof(__pyx_k_ParseError), 0, 1, 1},
- {&__pyx_kp_Exception, __pyx_k_Exception, sizeof(__pyx_k_Exception), 1, 1, 1},
- {&__pyx_kp_msg, __pyx_k_msg, sizeof(__pyx_k_msg), 1, 1, 1},
- {&__pyx_kp_type, __pyx_k_type, sizeof(__pyx_k_type), 1, 1, 1},
- {&__pyx_kp_value, __pyx_k_value, sizeof(__pyx_k_value), 1, 1, 1},
- {&__pyx_kp_context, __pyx_k_context, sizeof(__pyx_k_context), 1, 1, 1},
- {&__pyx_kp_dfas, __pyx_k_dfas, sizeof(__pyx_k_dfas), 1, 1, 1},
- {&__pyx_kp_labels, __pyx_k_labels, sizeof(__pyx_k_labels), 1, 1, 1},
- {&__pyx_kp_keywords, __pyx_k_keywords, sizeof(__pyx_k_keywords), 1, 1, 1},
- {&__pyx_kp_tokens, __pyx_k_tokens, sizeof(__pyx_k_tokens), 1, 1, 1},
- {&__pyx_kp_4, __pyx_k_4, sizeof(__pyx_k_4), 1, 1, 1},
- {&__pyx_kp_start, __pyx_k_start, sizeof(__pyx_k_start), 1, 1, 1},
- {&__pyx_kp_add, __pyx_k_add, sizeof(__pyx_k_add), 1, 1, 1},
- {&__pyx_kp_get, __pyx_k_get, sizeof(__pyx_k_get), 1, 1, 1},
- {&__pyx_kp_append, __pyx_k_append, sizeof(__pyx_k_append), 1, 1, 1},
- {&__pyx_kp_pop, __pyx_k_pop, sizeof(__pyx_k_pop), 1, 1, 1},
- {&__pyx_kp_used_names, __pyx_k_used_names, sizeof(__pyx_k_used_names), 1, 1, 1},
- {&__pyx_kp_2, __pyx_k_2, sizeof(__pyx_k_2), 0, 0, 0},
- {&__pyx_kp_3, __pyx_k_3, sizeof(__pyx_k_3), 0, 0, 0},
- {&__pyx_kp_5, __pyx_k_5, sizeof(__pyx_k_5), 0, 0, 0},
- {&__pyx_kp_6, __pyx_k_6, sizeof(__pyx_k_6), 0, 0, 0},
- {&__pyx_kp_7, __pyx_k_7, sizeof(__pyx_k_7), 0, 0, 0},
- {0, 0, 0, 0, 0, 0}
+ {&__pyx_kp_s_1, __pyx_k_1, sizeof(__pyx_k_1), 0, 0, 1, 0},
+ {&__pyx_n_s_2, __pyx_k_2, sizeof(__pyx_k_2), 0, 0, 1, 1},
+ {&__pyx_kp_s_3, __pyx_k_3, sizeof(__pyx_k_3), 0, 0, 1, 0},
+ {&__pyx_kp_s_4, __pyx_k_4, sizeof(__pyx_k_4), 0, 0, 1, 0},
+ {&__pyx_kp_s_5, __pyx_k_5, sizeof(__pyx_k_5), 0, 0, 1, 0},
+ {&__pyx_n_s_7, __pyx_k_7, sizeof(__pyx_k_7), 0, 0, 1, 1},
+ {&__pyx_kp_s_8, __pyx_k_8, sizeof(__pyx_k_8), 0, 0, 1, 0},
+ {&__pyx_kp_u_9, __pyx_k_9, sizeof(__pyx_k_9), 0, 1, 0, 0},
+ {&__pyx_n_s__Exception, __pyx_k__Exception, sizeof(__pyx_k__Exception), 0, 0, 1, 1},
+ {&__pyx_n_s__Leaf, __pyx_k__Leaf, sizeof(__pyx_k__Leaf), 0, 0, 1, 1},
+ {&__pyx_n_s__Node, __pyx_k__Node, sizeof(__pyx_k__Node), 0, 0, 1, 1},
+ {&__pyx_n_s__ParseError, __pyx_k__ParseError, sizeof(__pyx_k__ParseError), 0, 0, 1, 1},
+ {&__pyx_n_s__Parser, __pyx_k__Parser, sizeof(__pyx_k__Parser), 0, 0, 1, 1},
+ {&__pyx_n_s____init__, __pyx_k____init__, sizeof(__pyx_k____init__), 0, 0, 1, 1},
+ {&__pyx_n_s____main__, __pyx_k____main__, sizeof(__pyx_k____main__), 0, 0, 1, 1},
+ {&__pyx_n_s____test__, __pyx_k____test__, sizeof(__pyx_k____test__), 0, 0, 1, 1},
+ {&__pyx_n_s___grammar_dfas, __pyx_k___grammar_dfas, sizeof(__pyx_k___grammar_dfas), 0, 0, 1, 1},
+ {&__pyx_n_s___grammar_keywords, __pyx_k___grammar_keywords, sizeof(__pyx_k___grammar_keywords), 0, 0, 1, 1},
+ {&__pyx_n_s___grammar_labels, __pyx_k___grammar_labels, sizeof(__pyx_k___grammar_labels), 0, 0, 1, 1},
+ {&__pyx_n_s___grammar_start, __pyx_k___grammar_start, sizeof(__pyx_k___grammar_start), 0, 0, 1, 1},
+ {&__pyx_n_s___grammar_tokens, __pyx_k___grammar_tokens, sizeof(__pyx_k___grammar_tokens), 0, 0, 1, 1},
+ {&__pyx_n_s__add, __pyx_k__add, sizeof(__pyx_k__add), 0, 0, 1, 1},
+ {&__pyx_n_s__addtoken, __pyx_k__addtoken, sizeof(__pyx_k__addtoken), 0, 0, 1, 1},
+ {&__pyx_n_s__classify, __pyx_k__classify, sizeof(__pyx_k__classify), 0, 0, 1, 1},
+ {&__pyx_n_s__context, __pyx_k__context, sizeof(__pyx_k__context), 0, 0, 1, 1},
+ {&__pyx_n_s__convert, __pyx_k__convert, sizeof(__pyx_k__convert), 0, 0, 1, 1},
+ {&__pyx_n_s__dfas, __pyx_k__dfas, sizeof(__pyx_k__dfas), 0, 0, 1, 1},
+ {&__pyx_n_s__grammar, __pyx_k__grammar, sizeof(__pyx_k__grammar), 0, 0, 1, 1},
+ {&__pyx_n_s__keywords, __pyx_k__keywords, sizeof(__pyx_k__keywords), 0, 0, 1, 1},
+ {&__pyx_n_s__labels, __pyx_k__labels, sizeof(__pyx_k__labels), 0, 0, 1, 1},
+ {&__pyx_n_s__msg, __pyx_k__msg, sizeof(__pyx_k__msg), 0, 0, 1, 1},
+ {&__pyx_n_s__number2symbol, __pyx_k__number2symbol, sizeof(__pyx_k__number2symbol), 0, 0, 1, 1},
+ {&__pyx_n_s__pop, __pyx_k__pop, sizeof(__pyx_k__pop), 0, 0, 1, 1},
+ {&__pyx_n_s__push, __pyx_k__push, sizeof(__pyx_k__push), 0, 0, 1, 1},
+ {&__pyx_n_s__rootnode, __pyx_k__rootnode, sizeof(__pyx_k__rootnode), 0, 0, 1, 1},
+ {&__pyx_n_s__self, __pyx_k__self, sizeof(__pyx_k__self), 0, 0, 1, 1},
+ {&__pyx_n_s__shift, __pyx_k__shift, sizeof(__pyx_k__shift), 0, 0, 1, 1},
+ {&__pyx_n_s__stack, __pyx_k__stack, sizeof(__pyx_k__stack), 0, 0, 1, 1},
+ {&__pyx_n_s__start, __pyx_k__start, sizeof(__pyx_k__start), 0, 0, 1, 1},
+ {&__pyx_n_s__tokens, __pyx_k__tokens, sizeof(__pyx_k__tokens), 0, 0, 1, 1},
+ {&__pyx_n_s__type, __pyx_k__type, sizeof(__pyx_k__type), 0, 0, 1, 1},
+ {&__pyx_n_s__used_names, __pyx_k__used_names, sizeof(__pyx_k__used_names), 0, 0, 1, 1},
+ {&__pyx_n_s__value, __pyx_k__value, sizeof(__pyx_k__value), 0, 0, 1, 1},
+ {0, 0, 0, 0, 0, 0, 0}
};
static int __Pyx_InitCachedBuiltins(void) {
- __pyx_builtin_Exception = __Pyx_GetName(__pyx_b, __pyx_kp_Exception); if (!__pyx_builtin_Exception) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 19; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_builtin_Exception = __Pyx_GetName(__pyx_b, __pyx_n_s__Exception); if (!__pyx_builtin_Exception) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 19; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
return 0;
__pyx_L1_error:;
return -1;
}
static int __Pyx_InitGlobals(void) {
- __pyx_int_0 = PyInt_FromLong(0); if (unlikely(!__pyx_int_0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
- __pyx_int_1 = PyInt_FromLong(1); if (unlikely(!__pyx_int_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
+ #if PY_VERSION_HEX < 0x02040000
+ if (unlikely(__Pyx_Py23SetsImport() < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ #endif
if (__Pyx_InitStrings(__pyx_string_tab) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
+ __pyx_int_0 = PyInt_FromLong(0); if (unlikely(!__pyx_int_0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
return 0;
__pyx_L1_error:;
return -1;
@@ -2600,18 +3457,38 @@ PyMODINIT_FUNC PyInit_parse(void); /*proto*/
PyMODINIT_FUNC PyInit_parse(void)
#endif
{
- PyObject *__pyx_1 = 0;
- PyObject *__pyx_2 = 0;
- PyObject *__pyx_3 = 0;
- PyObject *__pyx_4 = 0;
- __pyx_empty_tuple = PyTuple_New(0); if (unlikely(!__pyx_empty_tuple)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- /*--- Libary function declarations ---*/
+ PyObject *__pyx_t_1 = NULL;
+ PyObject *__pyx_t_2 = NULL;
+ PyObject *__pyx_t_3 = NULL;
+ PyObject *__pyx_t_4 = NULL;
+ #if CYTHON_REFNANNY
+ void* __pyx_refnanny = NULL;
+ __Pyx_RefNanny = __Pyx_RefNannyImportAPI("refnanny");
+ if (!__Pyx_RefNanny) {
+ PyErr_Clear();
+ __Pyx_RefNanny = __Pyx_RefNannyImportAPI("Cython.Runtime.refnanny");
+ if (!__Pyx_RefNanny)
+ Py_FatalError("failed to import 'refnanny' module");
+ }
+ __pyx_refnanny = __Pyx_RefNanny->SetupContext("PyMODINIT_FUNC PyInit_parse(void)", __LINE__, __FILE__);
+ #endif
__pyx_init_filenames();
- /*--- Initialize various global constants etc. ---*/
- if (unlikely(__Pyx_InitGlobals() < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_empty_tuple = PyTuple_New(0); if (unlikely(!__pyx_empty_tuple)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ #if PY_MAJOR_VERSION < 3
+ __pyx_empty_bytes = PyString_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_bytes)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ #else
+ __pyx_empty_bytes = PyBytes_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_bytes)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ #endif
+ /*--- Library function declarations ---*/
+ /*--- Threads initialization code ---*/
+ #if defined(__PYX_FORCE_INIT_THREADS) && __PYX_FORCE_INIT_THREADS
+ #ifdef WITH_THREAD /* Python build with threading support? */
+ PyEval_InitThreads();
+ #endif
+ #endif
/*--- Module creation code ---*/
#if PY_MAJOR_VERSION < 3
- __pyx_m = Py_InitModule4("parse", __pyx_methods, 0, 0, PYTHON_API_VERSION);
+ __pyx_m = Py_InitModule4(__Pyx_NAMESTR("parse"), __pyx_methods, __Pyx_DOCSTR(__pyx_k_6), 0, PYTHON_API_VERSION);
#else
__pyx_m = PyModule_Create(&__pyx_moduledef);
#endif
@@ -2619,24 +3496,36 @@ PyMODINIT_FUNC PyInit_parse(void)
#if PY_MAJOR_VERSION < 3
Py_INCREF(__pyx_m);
#endif
- __pyx_b = PyImport_AddModule(__Pyx_BUILTIN_MODULE_NAME);
+ __pyx_b = PyImport_AddModule(__Pyx_NAMESTR(__Pyx_BUILTIN_MODULE_NAME));
if (!__pyx_b) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
- if (PyObject_SetAttrString(__pyx_m, "__builtins__", __pyx_b) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
+ if (__Pyx_SetAttrString(__pyx_m, "__builtins__", __pyx_b) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
+ /*--- Initialize various global constants etc. ---*/
+ if (unlikely(__Pyx_InitGlobals() < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (__pyx_module_is_main_sphinx__pycode__pgen2__parse) {
+ if (__Pyx_SetAttrString(__pyx_m, "__name__", __pyx_n_s____main__) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
+ }
/*--- Builtin init code ---*/
if (unlikely(__Pyx_InitCachedBuiltins() < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __pyx_skip_dispatch = 0;
/*--- Global init code ---*/
/*--- Function export code ---*/
/*--- Type init code ---*/
__pyx_vtabptr_6sphinx_6pycode_5pgen2_5parse_Parser = &__pyx_vtable_6sphinx_6pycode_5pgen2_5parse_Parser;
+ #if PY_MAJOR_VERSION >= 3
+ __pyx_vtable_6sphinx_6pycode_5pgen2_5parse_Parser.classify = (int (*)(struct __pyx_obj_6sphinx_6pycode_5pgen2_5parse_Parser *, int, PyObject *, PyObject *))__pyx_f_6sphinx_6pycode_5pgen2_5parse_6Parser_classify;
+ __pyx_vtable_6sphinx_6pycode_5pgen2_5parse_Parser.shift = (void (*)(struct __pyx_obj_6sphinx_6pycode_5pgen2_5parse_Parser *, PyObject *, PyObject *, PyObject *, PyObject *))__pyx_f_6sphinx_6pycode_5pgen2_5parse_6Parser_shift;
+ __pyx_vtable_6sphinx_6pycode_5pgen2_5parse_Parser.push = (void (*)(struct __pyx_obj_6sphinx_6pycode_5pgen2_5parse_Parser *, PyObject *, PyObject *, PyObject *, PyObject *))__pyx_f_6sphinx_6pycode_5pgen2_5parse_6Parser_push;
+ __pyx_vtable_6sphinx_6pycode_5pgen2_5parse_Parser.pop = (void (*)(struct __pyx_obj_6sphinx_6pycode_5pgen2_5parse_Parser *))__pyx_f_6sphinx_6pycode_5pgen2_5parse_6Parser_pop;
+ __pyx_vtable_6sphinx_6pycode_5pgen2_5parse_Parser.convert = (PyObject *(*)(struct __pyx_obj_6sphinx_6pycode_5pgen2_5parse_Parser *, PyObject *))__pyx_f_6sphinx_6pycode_5pgen2_5parse_6Parser_convert;
+ #else
*(void(**)(void))&__pyx_vtable_6sphinx_6pycode_5pgen2_5parse_Parser.classify = (void(*)(void))__pyx_f_6sphinx_6pycode_5pgen2_5parse_6Parser_classify;
*(void(**)(void))&__pyx_vtable_6sphinx_6pycode_5pgen2_5parse_Parser.shift = (void(*)(void))__pyx_f_6sphinx_6pycode_5pgen2_5parse_6Parser_shift;
*(void(**)(void))&__pyx_vtable_6sphinx_6pycode_5pgen2_5parse_Parser.push = (void(*)(void))__pyx_f_6sphinx_6pycode_5pgen2_5parse_6Parser_push;
*(void(**)(void))&__pyx_vtable_6sphinx_6pycode_5pgen2_5parse_Parser.pop = (void(*)(void))__pyx_f_6sphinx_6pycode_5pgen2_5parse_6Parser_pop;
*(void(**)(void))&__pyx_vtable_6sphinx_6pycode_5pgen2_5parse_Parser.convert = (void(*)(void))__pyx_f_6sphinx_6pycode_5pgen2_5parse_6Parser_convert;
+ #endif
if (PyType_Ready(&__pyx_type_6sphinx_6pycode_5pgen2_5parse_Parser) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 31; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
if (__Pyx_SetVtable(__pyx_type_6sphinx_6pycode_5pgen2_5parse_Parser.tp_dict, __pyx_vtabptr_6sphinx_6pycode_5pgen2_5parse_Parser) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 31; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- if (PyObject_SetAttrString(__pyx_m, "Parser", (PyObject *)&__pyx_type_6sphinx_6pycode_5pgen2_5parse_Parser) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 31; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (__Pyx_SetAttrString(__pyx_m, "Parser", (PyObject *)&__pyx_type_6sphinx_6pycode_5pgen2_5parse_Parser) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 31; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__pyx_ptype_6sphinx_6pycode_5pgen2_5parse_Parser = &__pyx_type_6sphinx_6pycode_5pgen2_5parse_Parser;
/*--- Type import code ---*/
/*--- Function import code ---*/
@@ -2649,20 +3538,26 @@ PyMODINIT_FUNC PyInit_parse(void)
*
* DEF NAME = 1
*/
- __pyx_1 = PyList_New(2); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 15; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- Py_INCREF(__pyx_kp_Node);
- PyList_SET_ITEM(__pyx_1, 0, __pyx_kp_Node);
- Py_INCREF(__pyx_kp_Leaf);
- PyList_SET_ITEM(__pyx_1, 1, __pyx_kp_Leaf);
- __pyx_2 = __Pyx_Import(__pyx_kp_1, ((PyObject *)__pyx_1)); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 15; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- Py_DECREF(((PyObject *)__pyx_1)); __pyx_1 = 0;
- __pyx_1 = PyObject_GetAttr(__pyx_2, __pyx_kp_Node); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 15; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- if (PyObject_SetAttr(__pyx_m, __pyx_kp_Node, __pyx_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 15; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- Py_DECREF(__pyx_1); __pyx_1 = 0;
- __pyx_1 = PyObject_GetAttr(__pyx_2, __pyx_kp_Leaf); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 15; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- if (PyObject_SetAttr(__pyx_m, __pyx_kp_Leaf, __pyx_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 15; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- Py_DECREF(__pyx_1); __pyx_1 = 0;
- Py_DECREF(__pyx_2); __pyx_2 = 0;
+ __pyx_t_1 = PyList_New(2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 15; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(((PyObject *)__pyx_t_1));
+ __Pyx_INCREF(((PyObject *)__pyx_n_s__Node));
+ PyList_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_n_s__Node));
+ __Pyx_GIVEREF(((PyObject *)__pyx_n_s__Node));
+ __Pyx_INCREF(((PyObject *)__pyx_n_s__Leaf));
+ PyList_SET_ITEM(__pyx_t_1, 1, ((PyObject *)__pyx_n_s__Leaf));
+ __Pyx_GIVEREF(((PyObject *)__pyx_n_s__Leaf));
+ __pyx_t_2 = __Pyx_Import(((PyObject *)__pyx_n_s_7), ((PyObject *)__pyx_t_1)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 15; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_2);
+ __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
+ __pyx_t_1 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__Node); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 15; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_1);
+ if (PyObject_SetAttr(__pyx_m, __pyx_n_s__Node, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 15; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+ __pyx_t_1 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__Leaf); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 15; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_1);
+ if (PyObject_SetAttr(__pyx_m, __pyx_n_s__Leaf, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 15; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+ __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
/* "/home/gbr/devel/sphinx/sphinx/pycode/pgen2/parse.pyx":19
* DEF NAME = 1
@@ -2671,13 +3566,17 @@ PyMODINIT_FUNC PyInit_parse(void)
* """Exception to signal the parser is stuck."""
*
*/
- __pyx_2 = PyDict_New(); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 19; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __pyx_1 = PyTuple_New(1); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 19; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- Py_INCREF(__pyx_builtin_Exception);
- PyTuple_SET_ITEM(__pyx_1, 0, __pyx_builtin_Exception);
- if (PyDict_SetItemString(((PyObject *)__pyx_2), "__doc__", __pyx_kp_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 19; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __pyx_3 = __Pyx_CreateClass(((PyObject *)__pyx_1), ((PyObject *)__pyx_2), __pyx_kp_ParseError, "sphinx.pycode.pgen2.parse"); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 19; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- Py_DECREF(((PyObject *)__pyx_1)); __pyx_1 = 0;
+ __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 19; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(((PyObject *)__pyx_t_2));
+ __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 19; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_1);
+ __Pyx_INCREF(__pyx_builtin_Exception);
+ PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_builtin_Exception);
+ __Pyx_GIVEREF(__pyx_builtin_Exception);
+ if (PyDict_SetItemString(((PyObject *)__pyx_t_2), "__doc__", ((PyObject *)__pyx_kp_s_8)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 19; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = __Pyx_CreateClass(__pyx_t_1, ((PyObject *)__pyx_t_2), __pyx_n_s__ParseError, "sphinx.pycode.pgen2.parse"); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 19; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_3);
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
/* "/home/gbr/devel/sphinx/sphinx/pycode/pgen2/parse.pyx":22
* """Exception to signal the parser is stuck."""
@@ -2686,36 +3585,55 @@ PyMODINIT_FUNC PyInit_parse(void)
* Exception.__init__(self, "%s: type=%r, value=%r, context=%r" %
* (msg, type, value, context))
*/
- __pyx_1 = PyCFunction_New(&__pyx_mdef_6sphinx_6pycode_5pgen2_5parse_10ParseError___init__, 0); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 22; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __pyx_4 = PyMethod_New(__pyx_1, 0, __pyx_3); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 22; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- Py_DECREF(__pyx_1); __pyx_1 = 0;
- if (PyObject_SetAttr(__pyx_3, __pyx_kp___init__, __pyx_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 22; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- Py_DECREF(__pyx_4); __pyx_4 = 0;
- if (PyObject_SetAttr(__pyx_m, __pyx_kp_ParseError, __pyx_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 19; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- Py_DECREF(__pyx_3); __pyx_3 = 0;
- Py_DECREF(((PyObject *)__pyx_2)); __pyx_2 = 0;
-
- /* "/home/gbr/devel/sphinx/sphinx/pycode/pgen2/parse.pyx":149
- * self.rootnode.used_names = self.used_names
+ __pyx_t_1 = PyCFunction_New(&__pyx_mdef_6sphinx_6pycode_5pgen2_5parse_10ParseError___init__, 0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 22; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_1);
+ __pyx_t_4 = PyMethod_New(__pyx_t_1, 0, __pyx_t_3); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 22; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_4);
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+ if (PyObject_SetAttr(__pyx_t_3, __pyx_n_s____init__, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 22; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+ if (PyObject_SetAttr(__pyx_m, __pyx_n_s__ParseError, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 19; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+ __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
+
+ /* "/home/gbr/devel/sphinx/sphinx/pycode/pgen2/parse.pyx":1
+ * # Copyright 2004-2005 Elemental Security, Inc. All Rights Reserved. # <<<<<<<<<<<<<<
+ * # Licensed to PSF under a Contributor Agreement.
*
- * cdef convert(self, raw_node): # <<<<<<<<<<<<<<
- * type, value, context, children = raw_node
- * if children or type in self._grammar_number2symbol:
*/
+ __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(((PyObject *)__pyx_t_2));
+ __pyx_t_3 = PyObject_GetAttr(__pyx_m, __pyx_n_s__Parser); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_3);
+ __pyx_t_4 = PyObject_GetAttr(__pyx_t_3, __pyx_n_s__addtoken); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_4);
+ __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+ __pyx_t_3 = __Pyx_GetAttrString(__pyx_t_4, "__doc__");
+ __Pyx_GOTREF(__pyx_t_3);
+ __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+ if (PyDict_SetItem(__pyx_t_2, ((PyObject *)__pyx_kp_u_9), __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+ if (PyObject_SetAttr(__pyx_m, __pyx_n_s____test__, ((PyObject *)__pyx_t_2)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
+ goto __pyx_L0;
+ __pyx_L1_error:;
+ __Pyx_XDECREF(__pyx_t_1);
+ __Pyx_XDECREF(__pyx_t_2);
+ __Pyx_XDECREF(__pyx_t_3);
+ __Pyx_XDECREF(__pyx_t_4);
+ if (__pyx_m) {
+ __Pyx_AddTraceback("init sphinx.pycode.pgen2.parse");
+ Py_DECREF(__pyx_m); __pyx_m = 0;
+ } else if (!PyErr_Occurred()) {
+ PyErr_SetString(PyExc_ImportError, "init sphinx.pycode.pgen2.parse");
+ }
+ __pyx_L0:;
+ __Pyx_RefNannyFinishContext();
#if PY_MAJOR_VERSION < 3
return;
#else
return __pyx_m;
#endif
- __pyx_L1_error:;
- Py_XDECREF(__pyx_1);
- Py_XDECREF(__pyx_2);
- Py_XDECREF(__pyx_3);
- Py_XDECREF(__pyx_4);
- __Pyx_AddTraceback("sphinx.pycode.pgen2.parse");
- #if PY_MAJOR_VERSION >= 3
- return NULL;
- #endif
}
static const char *__pyx_filenames[] = {
@@ -2728,17 +3646,179 @@ static void __pyx_init_filenames(void) {
__pyx_f = __pyx_filenames;
}
-static INLINE void __Pyx_RaiseArgtupleTooLong(
- Py_ssize_t num_expected,
+static void __Pyx_RaiseDoubleKeywordsError(
+ const char* func_name,
+ PyObject* kw_name)
+{
+ PyErr_Format(PyExc_TypeError,
+ #if PY_MAJOR_VERSION >= 3
+ "%s() got multiple values for keyword argument '%U'", func_name, kw_name);
+ #else
+ "%s() got multiple values for keyword argument '%s'", func_name,
+ PyString_AS_STRING(kw_name));
+ #endif
+}
+
+static void __Pyx_RaiseArgtupleInvalid(
+ const char* func_name,
+ int exact,
+ Py_ssize_t num_min,
+ Py_ssize_t num_max,
Py_ssize_t num_found)
{
- const char* error_message =
- #if PY_VERSION_HEX < 0x02050000
- "function takes at most %d positional arguments (%d given)";
+ Py_ssize_t num_expected;
+ const char *number, *more_or_less;
+
+ if (num_found < num_min) {
+ num_expected = num_min;
+ more_or_less = "at least";
+ } else {
+ num_expected = num_max;
+ more_or_less = "at most";
+ }
+ if (exact) {
+ more_or_less = "exactly";
+ }
+ number = (num_expected == 1) ? "" : "s";
+ PyErr_Format(PyExc_TypeError,
+ #if PY_VERSION_HEX < 0x02050000
+ "%s() takes %s %d positional argument%s (%d given)",
+ #else
+ "%s() takes %s %zd positional argument%s (%zd given)",
+ #endif
+ func_name, more_or_less, num_expected, number, num_found);
+}
+
+static int __Pyx_ParseOptionalKeywords(
+ PyObject *kwds,
+ PyObject **argnames[],
+ PyObject *kwds2,
+ PyObject *values[],
+ Py_ssize_t num_pos_args,
+ const char* function_name)
+{
+ PyObject *key = 0, *value = 0;
+ Py_ssize_t pos = 0;
+ PyObject*** name;
+ PyObject*** first_kw_arg = argnames + num_pos_args;
+
+ while (PyDict_Next(kwds, &pos, &key, &value)) {
+ name = first_kw_arg;
+ while (*name && (**name != key)) name++;
+ if (*name) {
+ values[name-argnames] = value;
+ } else {
+ #if PY_MAJOR_VERSION < 3
+ if (unlikely(!PyString_CheckExact(key)) && unlikely(!PyString_Check(key))) {
+ #else
+ if (unlikely(!PyUnicode_CheckExact(key)) && unlikely(!PyUnicode_Check(key))) {
+ #endif
+ goto invalid_keyword_type;
+ } else {
+ for (name = first_kw_arg; *name; name++) {
+ #if PY_MAJOR_VERSION >= 3
+ if (PyUnicode_GET_SIZE(**name) == PyUnicode_GET_SIZE(key) &&
+ PyUnicode_Compare(**name, key) == 0) break;
+ #else
+ if (PyString_GET_SIZE(**name) == PyString_GET_SIZE(key) &&
+ _PyString_Eq(**name, key)) break;
+ #endif
+ }
+ if (*name) {
+ values[name-argnames] = value;
+ } else {
+ /* unexpected keyword found */
+ for (name=argnames; name != first_kw_arg; name++) {
+ if (**name == key) goto arg_passed_twice;
+ #if PY_MAJOR_VERSION >= 3
+ if (PyUnicode_GET_SIZE(**name) == PyUnicode_GET_SIZE(key) &&
+ PyUnicode_Compare(**name, key) == 0) goto arg_passed_twice;
+ #else
+ if (PyString_GET_SIZE(**name) == PyString_GET_SIZE(key) &&
+ _PyString_Eq(**name, key)) goto arg_passed_twice;
+ #endif
+ }
+ if (kwds2) {
+ if (unlikely(PyDict_SetItem(kwds2, key, value))) goto bad;
+ } else {
+ goto invalid_keyword;
+ }
+ }
+ }
+ }
+ }
+ return 0;
+arg_passed_twice:
+ __Pyx_RaiseDoubleKeywordsError(function_name, **name);
+ goto bad;
+invalid_keyword_type:
+ PyErr_Format(PyExc_TypeError,
+ "%s() keywords must be strings", function_name);
+ goto bad;
+invalid_keyword:
+ PyErr_Format(PyExc_TypeError,
+ #if PY_MAJOR_VERSION < 3
+ "%s() got an unexpected keyword argument '%s'",
+ function_name, PyString_AsString(key));
#else
- "function takes at most %zd positional arguments (%zd given)";
+ "%s() got an unexpected keyword argument '%U'",
+ function_name, key);
#endif
- PyErr_Format(PyExc_TypeError, error_message, num_expected, num_found);
+bad:
+ return -1;
+}
+
+
+static INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index) {
+ PyErr_Format(PyExc_ValueError,
+ #if PY_VERSION_HEX < 0x02050000
+ "need more than %d value%s to unpack", (int)index,
+ #else
+ "need more than %zd value%s to unpack", index,
+ #endif
+ (index == 1) ? "" : "s");
+}
+
+static INLINE void __Pyx_RaiseTooManyValuesError(void) {
+ PyErr_SetString(PyExc_ValueError, "too many values to unpack");
+}
+
+static PyObject *__Pyx_UnpackItem(PyObject *iter, Py_ssize_t index) {
+ PyObject *item;
+ if (!(item = PyIter_Next(iter))) {
+ if (!PyErr_Occurred()) {
+ __Pyx_RaiseNeedMoreValuesError(index);
+ }
+ }
+ return item;
+}
+
+static int __Pyx_EndUnpack(PyObject *iter) {
+ PyObject *item;
+ if ((item = PyIter_Next(iter))) {
+ Py_DECREF(item);
+ __Pyx_RaiseTooManyValuesError();
+ return -1;
+ }
+ else if (!PyErr_Occurred())
+ return 0;
+ else
+ return -1;
+}
+
+static INLINE void __Pyx_RaiseNoneNotIterableError(void) {
+ PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable");
+}
+
+
+static void __Pyx_UnpackTupleError(PyObject *t, Py_ssize_t index) {
+ if (t == Py_None) {
+ __Pyx_RaiseNoneNotIterableError();
+ } else if (PyTuple_GET_SIZE(t) < index) {
+ __Pyx_RaiseNeedMoreValuesError(PyTuple_GET_SIZE(t));
+ } else {
+ __Pyx_RaiseTooManyValuesError();
+ }
}
static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list) {
@@ -2748,7 +3828,7 @@ static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list) {
PyObject *global_dict = 0;
PyObject *empty_dict = 0;
PyObject *list;
- __import__ = PyObject_GetAttrString(__pyx_b, "__import__");
+ __import__ = __Pyx_GetAttrString(__pyx_b, "__import__");
if (!__import__)
goto bad;
if (from_list)
@@ -2765,8 +3845,8 @@ static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list) {
empty_dict = PyDict_New();
if (!empty_dict)
goto bad;
- module = PyObject_CallFunction(__import__, "OOOO",
- name, global_dict, empty_dict, list);
+ module = PyObject_CallFunctionObjArgs(__import__,
+ name, global_dict, empty_dict, list, NULL);
bad:
Py_XDECREF(empty_list);
Py_XDECREF(__import__);
@@ -2783,7 +3863,7 @@ static PyObject *__Pyx_GetName(PyObject *dict, PyObject *name) {
}
static PyObject *__Pyx_CreateClass(
- PyObject *bases, PyObject *dict, PyObject *name, char *modname)
+ PyObject *bases, PyObject *dict, PyObject *name, const char *modname)
{
PyObject *py_modname;
PyObject *result = 0;
@@ -2807,35 +3887,34 @@ bad:
return result;
}
-
-static PyObject *__Pyx_UnpackItem(PyObject *iter, Py_ssize_t index) {
- PyObject *item;
- if (!(item = PyIter_Next(iter))) {
- if (!PyErr_Occurred()) {
- PyErr_Format(PyExc_ValueError,
- #if PY_VERSION_HEX < 0x02050000
- "need more than %d values to unpack", (int)index);
- #else
- "need more than %zd values to unpack", index);
- #endif
- }
- }
- return item;
+static INLINE void __Pyx_ErrRestore(PyObject *type, PyObject *value, PyObject *tb) {
+ PyObject *tmp_type, *tmp_value, *tmp_tb;
+ PyThreadState *tstate = PyThreadState_GET();
+
+ tmp_type = tstate->curexc_type;
+ tmp_value = tstate->curexc_value;
+ tmp_tb = tstate->curexc_traceback;
+ tstate->curexc_type = type;
+ tstate->curexc_value = value;
+ tstate->curexc_traceback = tb;
+ Py_XDECREF(tmp_type);
+ Py_XDECREF(tmp_value);
+ Py_XDECREF(tmp_tb);
}
-static int __Pyx_EndUnpack(PyObject *iter) {
- PyObject *item;
- if ((item = PyIter_Next(iter))) {
- Py_DECREF(item);
- PyErr_SetString(PyExc_ValueError, "too many values to unpack");
- return -1;
- }
- else if (!PyErr_Occurred())
- return 0;
- else
- return -1;
+static INLINE void __Pyx_ErrFetch(PyObject **type, PyObject **value, PyObject **tb) {
+ PyThreadState *tstate = PyThreadState_GET();
+ *type = tstate->curexc_type;
+ *value = tstate->curexc_value;
+ *tb = tstate->curexc_traceback;
+
+ tstate->curexc_type = 0;
+ tstate->curexc_value = 0;
+ tstate->curexc_traceback = 0;
}
+
+#if PY_MAJOR_VERSION < 3
static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb) {
Py_XINCREF(type);
Py_XINCREF(value);
@@ -2891,7 +3970,8 @@ static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb) {
}
#endif
}
- PyErr_Restore(type, value, tb);
+
+ __Pyx_ErrRestore(type, value, tb);
return;
raise_error:
Py_XDECREF(value);
@@ -2900,39 +3980,464 @@ raise_error:
return;
}
+#else /* Python 3+ */
+
+static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb) {
+ if (tb == Py_None) {
+ tb = 0;
+ } else if (tb && !PyTraceBack_Check(tb)) {
+ PyErr_SetString(PyExc_TypeError,
+ "raise: arg 3 must be a traceback or None");
+ goto bad;
+ }
+ if (value == Py_None)
+ value = 0;
+
+ if (PyExceptionInstance_Check(type)) {
+ if (value) {
+ PyErr_SetString(PyExc_TypeError,
+ "instance exception may not have a separate value");
+ goto bad;
+ }
+ value = type;
+ type = (PyObject*) Py_TYPE(value);
+ } else if (!PyExceptionClass_Check(type)) {
+ PyErr_SetString(PyExc_TypeError,
+ "raise: exception class must be a subclass of BaseException");
+ goto bad;
+ }
+
+ PyErr_SetObject(type, value);
+
+ if (tb) {
+ PyThreadState *tstate = PyThreadState_GET();
+ PyObject* tmp_tb = tstate->curexc_traceback;
+ if (tb != tmp_tb) {
+ Py_INCREF(tb);
+ tstate->curexc_traceback = tb;
+ Py_XDECREF(tmp_tb);
+ }
+ }
+
+bad:
+ return;
+}
+#endif
+
+static INLINE unsigned char __Pyx_PyInt_AsUnsignedChar(PyObject* x) {
+ const unsigned char neg_one = (unsigned char)-1, const_zero = 0;
+ const int is_unsigned = neg_one > const_zero;
+ if (sizeof(unsigned char) < sizeof(long)) {
+ long val = __Pyx_PyInt_AsLong(x);
+ if (unlikely(val != (long)(unsigned char)val)) {
+ if (!unlikely(val == -1 && PyErr_Occurred())) {
+ PyErr_SetString(PyExc_OverflowError,
+ (is_unsigned && unlikely(val < 0)) ?
+ "can't convert negative value to unsigned char" :
+ "value too large to convert to unsigned char");
+ }
+ return (unsigned char)-1;
+ }
+ return (unsigned char)val;
+ }
+ return (unsigned char)__Pyx_PyInt_AsUnsignedLong(x);
+}
+
+static INLINE unsigned short __Pyx_PyInt_AsUnsignedShort(PyObject* x) {
+ const unsigned short neg_one = (unsigned short)-1, const_zero = 0;
+ const int is_unsigned = neg_one > const_zero;
+ if (sizeof(unsigned short) < sizeof(long)) {
+ long val = __Pyx_PyInt_AsLong(x);
+ if (unlikely(val != (long)(unsigned short)val)) {
+ if (!unlikely(val == -1 && PyErr_Occurred())) {
+ PyErr_SetString(PyExc_OverflowError,
+ (is_unsigned && unlikely(val < 0)) ?
+ "can't convert negative value to unsigned short" :
+ "value too large to convert to unsigned short");
+ }
+ return (unsigned short)-1;
+ }
+ return (unsigned short)val;
+ }
+ return (unsigned short)__Pyx_PyInt_AsUnsignedLong(x);
+}
+
+static INLINE unsigned int __Pyx_PyInt_AsUnsignedInt(PyObject* x) {
+ const unsigned int neg_one = (unsigned int)-1, const_zero = 0;
+ const int is_unsigned = neg_one > const_zero;
+ if (sizeof(unsigned int) < sizeof(long)) {
+ long val = __Pyx_PyInt_AsLong(x);
+ if (unlikely(val != (long)(unsigned int)val)) {
+ if (!unlikely(val == -1 && PyErr_Occurred())) {
+ PyErr_SetString(PyExc_OverflowError,
+ (is_unsigned && unlikely(val < 0)) ?
+ "can't convert negative value to unsigned int" :
+ "value too large to convert to unsigned int");
+ }
+ return (unsigned int)-1;
+ }
+ return (unsigned int)val;
+ }
+ return (unsigned int)__Pyx_PyInt_AsUnsignedLong(x);
+}
+
+static INLINE char __Pyx_PyInt_AsChar(PyObject* x) {
+ const char neg_one = (char)-1, const_zero = 0;
+ const int is_unsigned = neg_one > const_zero;
+ if (sizeof(char) < sizeof(long)) {
+ long val = __Pyx_PyInt_AsLong(x);
+ if (unlikely(val != (long)(char)val)) {
+ if (!unlikely(val == -1 && PyErr_Occurred())) {
+ PyErr_SetString(PyExc_OverflowError,
+ (is_unsigned && unlikely(val < 0)) ?
+ "can't convert negative value to char" :
+ "value too large to convert to char");
+ }
+ return (char)-1;
+ }
+ return (char)val;
+ }
+ return (char)__Pyx_PyInt_AsLong(x);
+}
+
+static INLINE short __Pyx_PyInt_AsShort(PyObject* x) {
+ const short neg_one = (short)-1, const_zero = 0;
+ const int is_unsigned = neg_one > const_zero;
+ if (sizeof(short) < sizeof(long)) {
+ long val = __Pyx_PyInt_AsLong(x);
+ if (unlikely(val != (long)(short)val)) {
+ if (!unlikely(val == -1 && PyErr_Occurred())) {
+ PyErr_SetString(PyExc_OverflowError,
+ (is_unsigned && unlikely(val < 0)) ?
+ "can't convert negative value to short" :
+ "value too large to convert to short");
+ }
+ return (short)-1;
+ }
+ return (short)val;
+ }
+ return (short)__Pyx_PyInt_AsLong(x);
+}
+
+static INLINE int __Pyx_PyInt_AsInt(PyObject* x) {
+ const int neg_one = (int)-1, const_zero = 0;
+ const int is_unsigned = neg_one > const_zero;
+ if (sizeof(int) < sizeof(long)) {
+ long val = __Pyx_PyInt_AsLong(x);
+ if (unlikely(val != (long)(int)val)) {
+ if (!unlikely(val == -1 && PyErr_Occurred())) {
+ PyErr_SetString(PyExc_OverflowError,
+ (is_unsigned && unlikely(val < 0)) ?
+ "can't convert negative value to int" :
+ "value too large to convert to int");
+ }
+ return (int)-1;
+ }
+ return (int)val;
+ }
+ return (int)__Pyx_PyInt_AsLong(x);
+}
+
+static INLINE signed char __Pyx_PyInt_AsSignedChar(PyObject* x) {
+ const signed char neg_one = (signed char)-1, const_zero = 0;
+ const int is_unsigned = neg_one > const_zero;
+ if (sizeof(signed char) < sizeof(long)) {
+ long val = __Pyx_PyInt_AsLong(x);
+ if (unlikely(val != (long)(signed char)val)) {
+ if (!unlikely(val == -1 && PyErr_Occurred())) {
+ PyErr_SetString(PyExc_OverflowError,
+ (is_unsigned && unlikely(val < 0)) ?
+ "can't convert negative value to signed char" :
+ "value too large to convert to signed char");
+ }
+ return (signed char)-1;
+ }
+ return (signed char)val;
+ }
+ return (signed char)__Pyx_PyInt_AsSignedLong(x);
+}
+
+static INLINE signed short __Pyx_PyInt_AsSignedShort(PyObject* x) {
+ const signed short neg_one = (signed short)-1, const_zero = 0;
+ const int is_unsigned = neg_one > const_zero;
+ if (sizeof(signed short) < sizeof(long)) {
+ long val = __Pyx_PyInt_AsLong(x);
+ if (unlikely(val != (long)(signed short)val)) {
+ if (!unlikely(val == -1 && PyErr_Occurred())) {
+ PyErr_SetString(PyExc_OverflowError,
+ (is_unsigned && unlikely(val < 0)) ?
+ "can't convert negative value to signed short" :
+ "value too large to convert to signed short");
+ }
+ return (signed short)-1;
+ }
+ return (signed short)val;
+ }
+ return (signed short)__Pyx_PyInt_AsSignedLong(x);
+}
+
+static INLINE signed int __Pyx_PyInt_AsSignedInt(PyObject* x) {
+ const signed int neg_one = (signed int)-1, const_zero = 0;
+ const int is_unsigned = neg_one > const_zero;
+ if (sizeof(signed int) < sizeof(long)) {
+ long val = __Pyx_PyInt_AsLong(x);
+ if (unlikely(val != (long)(signed int)val)) {
+ if (!unlikely(val == -1 && PyErr_Occurred())) {
+ PyErr_SetString(PyExc_OverflowError,
+ (is_unsigned && unlikely(val < 0)) ?
+ "can't convert negative value to signed int" :
+ "value too large to convert to signed int");
+ }
+ return (signed int)-1;
+ }
+ return (signed int)val;
+ }
+ return (signed int)__Pyx_PyInt_AsSignedLong(x);
+}
+
+static INLINE unsigned long __Pyx_PyInt_AsUnsignedLong(PyObject* x) {
+ const unsigned long neg_one = (unsigned long)-1, const_zero = 0;
+ const int is_unsigned = neg_one > const_zero;
+#if PY_VERSION_HEX < 0x03000000
+ if (likely(PyInt_Check(x))) {
+ long val = PyInt_AS_LONG(x);
+ if (is_unsigned && unlikely(val < 0)) {
+ PyErr_SetString(PyExc_OverflowError,
+ "can't convert negative value to unsigned long");
+ return (unsigned long)-1;
+ }
+ return (unsigned long)val;
+ } else
+#endif
+ if (likely(PyLong_Check(x))) {
+ if (is_unsigned) {
+ if (unlikely(Py_SIZE(x) < 0)) {
+ PyErr_SetString(PyExc_OverflowError,
+ "can't convert negative value to unsigned long");
+ return (unsigned long)-1;
+ }
+ return PyLong_AsUnsignedLong(x);
+ } else {
+ return PyLong_AsLong(x);
+ }
+ } else {
+ unsigned long val;
+ PyObject *tmp = __Pyx_PyNumber_Int(x);
+ if (!tmp) return (unsigned long)-1;
+ val = __Pyx_PyInt_AsUnsignedLong(tmp);
+ Py_DECREF(tmp);
+ return val;
+ }
+}
+
+static INLINE unsigned PY_LONG_LONG __Pyx_PyInt_AsUnsignedLongLong(PyObject* x) {
+ const unsigned PY_LONG_LONG neg_one = (unsigned PY_LONG_LONG)-1, const_zero = 0;
+ const int is_unsigned = neg_one > const_zero;
+#if PY_VERSION_HEX < 0x03000000
+ if (likely(PyInt_Check(x))) {
+ long val = PyInt_AS_LONG(x);
+ if (is_unsigned && unlikely(val < 0)) {
+ PyErr_SetString(PyExc_OverflowError,
+ "can't convert negative value to unsigned PY_LONG_LONG");
+ return (unsigned PY_LONG_LONG)-1;
+ }
+ return (unsigned PY_LONG_LONG)val;
+ } else
+#endif
+ if (likely(PyLong_Check(x))) {
+ if (is_unsigned) {
+ if (unlikely(Py_SIZE(x) < 0)) {
+ PyErr_SetString(PyExc_OverflowError,
+ "can't convert negative value to unsigned PY_LONG_LONG");
+ return (unsigned PY_LONG_LONG)-1;
+ }
+ return PyLong_AsUnsignedLongLong(x);
+ } else {
+ return PyLong_AsLongLong(x);
+ }
+ } else {
+ unsigned PY_LONG_LONG val;
+ PyObject *tmp = __Pyx_PyNumber_Int(x);
+ if (!tmp) return (unsigned PY_LONG_LONG)-1;
+ val = __Pyx_PyInt_AsUnsignedLongLong(tmp);
+ Py_DECREF(tmp);
+ return val;
+ }
+}
+
+static INLINE long __Pyx_PyInt_AsLong(PyObject* x) {
+ const long neg_one = (long)-1, const_zero = 0;
+ const int is_unsigned = neg_one > const_zero;
+#if PY_VERSION_HEX < 0x03000000
+ if (likely(PyInt_Check(x))) {
+ long val = PyInt_AS_LONG(x);
+ if (is_unsigned && unlikely(val < 0)) {
+ PyErr_SetString(PyExc_OverflowError,
+ "can't convert negative value to long");
+ return (long)-1;
+ }
+ return (long)val;
+ } else
+#endif
+ if (likely(PyLong_Check(x))) {
+ if (is_unsigned) {
+ if (unlikely(Py_SIZE(x) < 0)) {
+ PyErr_SetString(PyExc_OverflowError,
+ "can't convert negative value to long");
+ return (long)-1;
+ }
+ return PyLong_AsUnsignedLong(x);
+ } else {
+ return PyLong_AsLong(x);
+ }
+ } else {
+ long val;
+ PyObject *tmp = __Pyx_PyNumber_Int(x);
+ if (!tmp) return (long)-1;
+ val = __Pyx_PyInt_AsLong(tmp);
+ Py_DECREF(tmp);
+ return val;
+ }
+}
+
+static INLINE PY_LONG_LONG __Pyx_PyInt_AsLongLong(PyObject* x) {
+ const PY_LONG_LONG neg_one = (PY_LONG_LONG)-1, const_zero = 0;
+ const int is_unsigned = neg_one > const_zero;
+#if PY_VERSION_HEX < 0x03000000
+ if (likely(PyInt_Check(x))) {
+ long val = PyInt_AS_LONG(x);
+ if (is_unsigned && unlikely(val < 0)) {
+ PyErr_SetString(PyExc_OverflowError,
+ "can't convert negative value to PY_LONG_LONG");
+ return (PY_LONG_LONG)-1;
+ }
+ return (PY_LONG_LONG)val;
+ } else
+#endif
+ if (likely(PyLong_Check(x))) {
+ if (is_unsigned) {
+ if (unlikely(Py_SIZE(x) < 0)) {
+ PyErr_SetString(PyExc_OverflowError,
+ "can't convert negative value to PY_LONG_LONG");
+ return (PY_LONG_LONG)-1;
+ }
+ return PyLong_AsUnsignedLongLong(x);
+ } else {
+ return PyLong_AsLongLong(x);
+ }
+ } else {
+ PY_LONG_LONG val;
+ PyObject *tmp = __Pyx_PyNumber_Int(x);
+ if (!tmp) return (PY_LONG_LONG)-1;
+ val = __Pyx_PyInt_AsLongLong(tmp);
+ Py_DECREF(tmp);
+ return val;
+ }
+}
+
+static INLINE signed long __Pyx_PyInt_AsSignedLong(PyObject* x) {
+ const signed long neg_one = (signed long)-1, const_zero = 0;
+ const int is_unsigned = neg_one > const_zero;
+#if PY_VERSION_HEX < 0x03000000
+ if (likely(PyInt_Check(x))) {
+ long val = PyInt_AS_LONG(x);
+ if (is_unsigned && unlikely(val < 0)) {
+ PyErr_SetString(PyExc_OverflowError,
+ "can't convert negative value to signed long");
+ return (signed long)-1;
+ }
+ return (signed long)val;
+ } else
+#endif
+ if (likely(PyLong_Check(x))) {
+ if (is_unsigned) {
+ if (unlikely(Py_SIZE(x) < 0)) {
+ PyErr_SetString(PyExc_OverflowError,
+ "can't convert negative value to signed long");
+ return (signed long)-1;
+ }
+ return PyLong_AsUnsignedLong(x);
+ } else {
+ return PyLong_AsLong(x);
+ }
+ } else {
+ signed long val;
+ PyObject *tmp = __Pyx_PyNumber_Int(x);
+ if (!tmp) return (signed long)-1;
+ val = __Pyx_PyInt_AsSignedLong(tmp);
+ Py_DECREF(tmp);
+ return val;
+ }
+}
+
+static INLINE signed PY_LONG_LONG __Pyx_PyInt_AsSignedLongLong(PyObject* x) {
+ const signed PY_LONG_LONG neg_one = (signed PY_LONG_LONG)-1, const_zero = 0;
+ const int is_unsigned = neg_one > const_zero;
+#if PY_VERSION_HEX < 0x03000000
+ if (likely(PyInt_Check(x))) {
+ long val = PyInt_AS_LONG(x);
+ if (is_unsigned && unlikely(val < 0)) {
+ PyErr_SetString(PyExc_OverflowError,
+ "can't convert negative value to signed PY_LONG_LONG");
+ return (signed PY_LONG_LONG)-1;
+ }
+ return (signed PY_LONG_LONG)val;
+ } else
+#endif
+ if (likely(PyLong_Check(x))) {
+ if (is_unsigned) {
+ if (unlikely(Py_SIZE(x) < 0)) {
+ PyErr_SetString(PyExc_OverflowError,
+ "can't convert negative value to signed PY_LONG_LONG");
+ return (signed PY_LONG_LONG)-1;
+ }
+ return PyLong_AsUnsignedLongLong(x);
+ } else {
+ return PyLong_AsLongLong(x);
+ }
+ } else {
+ signed PY_LONG_LONG val;
+ PyObject *tmp = __Pyx_PyNumber_Int(x);
+ if (!tmp) return (signed PY_LONG_LONG)-1;
+ val = __Pyx_PyInt_AsSignedLongLong(tmp);
+ Py_DECREF(tmp);
+ return val;
+ }
+}
static void __Pyx_WriteUnraisable(const char *name) {
PyObject *old_exc, *old_val, *old_tb;
PyObject *ctx;
- PyErr_Fetch(&old_exc, &old_val, &old_tb);
+ __Pyx_ErrFetch(&old_exc, &old_val, &old_tb);
#if PY_MAJOR_VERSION < 3
ctx = PyString_FromString(name);
#else
ctx = PyUnicode_FromString(name);
#endif
- PyErr_Restore(old_exc, old_val, old_tb);
- if (!ctx)
- ctx = Py_None;
- PyErr_WriteUnraisable(ctx);
+ __Pyx_ErrRestore(old_exc, old_val, old_tb);
+ if (!ctx) {
+ PyErr_WriteUnraisable(Py_None);
+ } else {
+ PyErr_WriteUnraisable(ctx);
+ Py_DECREF(ctx);
+ }
}
static int __Pyx_SetVtable(PyObject *dict, void *vtable) {
- PyObject *pycobj = 0;
- int result;
-
- pycobj = PyCObject_FromVoidPtr(vtable, 0);
- if (!pycobj)
+#if PY_VERSION_HEX < 0x03010000
+ PyObject *ob = PyCObject_FromVoidPtr(vtable, 0);
+#else
+ PyObject *ob = PyCapsule_New(vtable, 0, 0);
+#endif
+ if (!ob)
goto bad;
- if (PyDict_SetItemString(dict, "__pyx_vtable__", pycobj) < 0)
+ if (PyDict_SetItemString(dict, "__pyx_vtable__", ob) < 0)
goto bad;
- result = 0;
- goto done;
-
+ Py_DECREF(ob);
+ return 0;
bad:
- result = -1;
-done:
- Py_XDECREF(pycobj);
- return result;
+ Py_XDECREF(ob);
+ return -1;
}
#include "compile.h"
@@ -2943,7 +4448,6 @@ static void __Pyx_AddTraceback(const char *funcname) {
PyObject *py_srcfile = 0;
PyObject *py_funcname = 0;
PyObject *py_globals = 0;
- PyObject *empty_string = 0;
PyCodeObject *py_code = 0;
PyFrameObject *py_frame = 0;
@@ -2970,12 +4474,6 @@ static void __Pyx_AddTraceback(const char *funcname) {
if (!py_funcname) goto bad;
py_globals = PyModule_GetDict(__pyx_m);
if (!py_globals) goto bad;
- #if PY_MAJOR_VERSION < 3
- empty_string = PyString_FromStringAndSize("", 0);
- #else
- empty_string = PyBytes_FromStringAndSize("", 0);
- #endif
- if (!empty_string) goto bad;
py_code = PyCode_New(
0, /*int argcount,*/
#if PY_MAJOR_VERSION >= 3
@@ -2984,7 +4482,7 @@ static void __Pyx_AddTraceback(const char *funcname) {
0, /*int nlocals,*/
0, /*int stacksize,*/
0, /*int flags,*/
- empty_string, /*PyObject *code,*/
+ __pyx_empty_bytes, /*PyObject *code,*/
__pyx_empty_tuple, /*PyObject *consts,*/
__pyx_empty_tuple, /*PyObject *names,*/
__pyx_empty_tuple, /*PyObject *varnames,*/
@@ -2993,11 +4491,11 @@ static void __Pyx_AddTraceback(const char *funcname) {
py_srcfile, /*PyObject *filename,*/
py_funcname, /*PyObject *name,*/
__pyx_lineno, /*int firstlineno,*/
- empty_string /*PyObject *lnotab*/
+ __pyx_empty_bytes /*PyObject *lnotab*/
);
if (!py_code) goto bad;
py_frame = PyFrame_New(
- PyThreadState_Get(), /*PyThreadState *tstate,*/
+ PyThreadState_GET(), /*PyThreadState *tstate,*/
py_code, /*PyCodeObject *code,*/
py_globals, /*PyObject *globals,*/
0 /*PyObject *locals*/
@@ -3008,7 +4506,6 @@ static void __Pyx_AddTraceback(const char *funcname) {
bad:
Py_XDECREF(py_srcfile);
Py_XDECREF(py_funcname);
- Py_XDECREF(empty_string);
Py_XDECREF(py_code);
Py_XDECREF(py_frame);
}
@@ -3016,7 +4513,7 @@ bad:
static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) {
while (t->p) {
#if PY_MAJOR_VERSION < 3
- if (t->is_unicode && (!t->is_identifier)) {
+ if (t->is_unicode) {
*t->p = PyUnicode_DecodeUTF8(t->s, t->n - 1, NULL);
} else if (t->intern) {
*t->p = PyString_InternFromString(t->s);
@@ -3024,10 +4521,14 @@ static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) {
*t->p = PyString_FromStringAndSize(t->s, t->n - 1);
}
#else /* Python 3+ has unicode identifiers */
- if (t->is_identifier || (t->is_unicode && t->intern)) {
- *t->p = PyUnicode_InternFromString(t->s);
- } else if (t->is_unicode) {
- *t->p = PyUnicode_FromStringAndSize(t->s, t->n - 1);
+ if (t->is_unicode | t->is_str) {
+ if (t->intern) {
+ *t->p = PyUnicode_InternFromString(t->s);
+ } else if (t->encoding) {
+ *t->p = PyUnicode_Decode(t->s, t->n - 1, t->encoding, NULL);
+ } else {
+ *t->p = PyUnicode_FromStringAndSize(t->s, t->n - 1);
+ }
} else {
*t->p = PyBytes_FromStringAndSize(t->s, t->n - 1);
}
@@ -3041,221 +4542,92 @@ static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) {
/* Type Conversion Functions */
-static INLINE Py_ssize_t __pyx_PyIndex_AsSsize_t(PyObject* b) {
- Py_ssize_t ival;
- PyObject* x = PyNumber_Index(b);
- if (!x) return -1;
- ival = PyInt_AsSsize_t(x);
- Py_DECREF(x);
- return ival;
-}
-
static INLINE int __Pyx_PyObject_IsTrue(PyObject* x) {
if (x == Py_True) return 1;
- else if (x == Py_False) return 0;
+ else if ((x == Py_False) | (x == Py_None)) return 0;
else return PyObject_IsTrue(x);
}
-static INLINE PY_LONG_LONG __pyx_PyInt_AsLongLong(PyObject* x) {
- if (PyInt_CheckExact(x)) {
- return PyInt_AS_LONG(x);
- }
- else if (PyLong_CheckExact(x)) {
- return PyLong_AsLongLong(x);
- }
- else {
- PY_LONG_LONG val;
- PyObject* tmp = PyNumber_Int(x); if (!tmp) return (PY_LONG_LONG)-1;
- val = __pyx_PyInt_AsLongLong(tmp);
- Py_DECREF(tmp);
- return val;
- }
-}
-
-static INLINE unsigned PY_LONG_LONG __pyx_PyInt_AsUnsignedLongLong(PyObject* x) {
- if (PyInt_CheckExact(x)) {
- long val = PyInt_AS_LONG(x);
- if (unlikely(val < 0)) {
- PyErr_SetString(PyExc_TypeError, "Negative assignment to unsigned type.");
- return (unsigned PY_LONG_LONG)-1;
- }
- return val;
- }
- else if (PyLong_CheckExact(x)) {
- return PyLong_AsUnsignedLongLong(x);
- }
- else {
- PY_LONG_LONG val;
- PyObject* tmp = PyNumber_Int(x); if (!tmp) return (PY_LONG_LONG)-1;
- val = __pyx_PyInt_AsUnsignedLongLong(tmp);
- Py_DECREF(tmp);
- return val;
- }
-}
-
-
-static INLINE unsigned char __pyx_PyInt_unsigned_char(PyObject* x) {
- if (sizeof(unsigned char) < sizeof(long)) {
- long long_val = __pyx_PyInt_AsLong(x);
- unsigned char val = (unsigned char)long_val;
- if (unlikely((val != long_val) || (long_val < 0))) {
- PyErr_SetString(PyExc_OverflowError, "value too large to convert to unsigned char");
- return (unsigned char)-1;
- }
- return val;
- }
- else {
- return __pyx_PyInt_AsLong(x);
- }
-}
-
-static INLINE unsigned short __pyx_PyInt_unsigned_short(PyObject* x) {
- if (sizeof(unsigned short) < sizeof(long)) {
- long long_val = __pyx_PyInt_AsLong(x);
- unsigned short val = (unsigned short)long_val;
- if (unlikely((val != long_val) || (long_val < 0))) {
- PyErr_SetString(PyExc_OverflowError, "value too large to convert to unsigned short");
- return (unsigned short)-1;
- }
- return val;
- }
- else {
- return __pyx_PyInt_AsLong(x);
- }
-}
-
-static INLINE char __pyx_PyInt_char(PyObject* x) {
- if (sizeof(char) < sizeof(long)) {
- long long_val = __pyx_PyInt_AsLong(x);
- char val = (char)long_val;
- if (unlikely((val != long_val) )) {
- PyErr_SetString(PyExc_OverflowError, "value too large to convert to char");
- return (char)-1;
- }
- return val;
- }
- else {
- return __pyx_PyInt_AsLong(x);
- }
-}
-
-static INLINE short __pyx_PyInt_short(PyObject* x) {
- if (sizeof(short) < sizeof(long)) {
- long long_val = __pyx_PyInt_AsLong(x);
- short val = (short)long_val;
- if (unlikely((val != long_val) )) {
- PyErr_SetString(PyExc_OverflowError, "value too large to convert to short");
- return (short)-1;
- }
- return val;
- }
- else {
- return __pyx_PyInt_AsLong(x);
- }
-}
-
-static INLINE int __pyx_PyInt_int(PyObject* x) {
- if (sizeof(int) < sizeof(long)) {
- long long_val = __pyx_PyInt_AsLong(x);
- int val = (int)long_val;
- if (unlikely((val != long_val) )) {
- PyErr_SetString(PyExc_OverflowError, "value too large to convert to int");
- return (int)-1;
- }
- return val;
- }
- else {
- return __pyx_PyInt_AsLong(x);
- }
-}
-
-static INLINE long __pyx_PyInt_long(PyObject* x) {
- if (sizeof(long) < sizeof(long)) {
- long long_val = __pyx_PyInt_AsLong(x);
- long val = (long)long_val;
- if (unlikely((val != long_val) )) {
- PyErr_SetString(PyExc_OverflowError, "value too large to convert to long");
- return (long)-1;
- }
- return val;
- }
- else {
- return __pyx_PyInt_AsLong(x);
- }
-}
-
-static INLINE signed char __pyx_PyInt_signed_char(PyObject* x) {
- if (sizeof(signed char) < sizeof(long)) {
- long long_val = __pyx_PyInt_AsLong(x);
- signed char val = (signed char)long_val;
- if (unlikely((val != long_val) )) {
- PyErr_SetString(PyExc_OverflowError, "value too large to convert to signed char");
- return (signed char)-1;
- }
- return val;
- }
- else {
- return __pyx_PyInt_AsLong(x);
+static INLINE PyObject* __Pyx_PyNumber_Int(PyObject* x) {
+ PyNumberMethods *m;
+ const char *name = NULL;
+ PyObject *res = NULL;
+#if PY_VERSION_HEX < 0x03000000
+ if (PyInt_Check(x) || PyLong_Check(x))
+#else
+ if (PyLong_Check(x))
+#endif
+ return Py_INCREF(x), x;
+ m = Py_TYPE(x)->tp_as_number;
+#if PY_VERSION_HEX < 0x03000000
+ if (m && m->nb_int) {
+ name = "int";
+ res = PyNumber_Int(x);
+ }
+ else if (m && m->nb_long) {
+ name = "long";
+ res = PyNumber_Long(x);
+ }
+#else
+ if (m && m->nb_int) {
+ name = "int";
+ res = PyNumber_Long(x);
+ }
+#endif
+ if (res) {
+#if PY_VERSION_HEX < 0x03000000
+ if (!PyInt_Check(res) && !PyLong_Check(res)) {
+#else
+ if (!PyLong_Check(res)) {
+#endif
+ PyErr_Format(PyExc_TypeError,
+ "__%s__ returned non-%s (type %.200s)",
+ name, name, Py_TYPE(res)->tp_name);
+ Py_DECREF(res);
+ return NULL;
}
+ }
+ else if (!PyErr_Occurred()) {
+ PyErr_SetString(PyExc_TypeError,
+ "an integer is required");
+ }
+ return res;
}
-static INLINE signed short __pyx_PyInt_signed_short(PyObject* x) {
- if (sizeof(signed short) < sizeof(long)) {
- long long_val = __pyx_PyInt_AsLong(x);
- signed short val = (signed short)long_val;
- if (unlikely((val != long_val) )) {
- PyErr_SetString(PyExc_OverflowError, "value too large to convert to signed short");
- return (signed short)-1;
- }
- return val;
- }
- else {
- return __pyx_PyInt_AsLong(x);
- }
+static INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject* b) {
+ Py_ssize_t ival;
+ PyObject* x = PyNumber_Index(b);
+ if (!x) return -1;
+ ival = PyInt_AsSsize_t(x);
+ Py_DECREF(x);
+ return ival;
}
-static INLINE signed int __pyx_PyInt_signed_int(PyObject* x) {
- if (sizeof(signed int) < sizeof(long)) {
- long long_val = __pyx_PyInt_AsLong(x);
- signed int val = (signed int)long_val;
- if (unlikely((val != long_val) )) {
- PyErr_SetString(PyExc_OverflowError, "value too large to convert to signed int");
- return (signed int)-1;
- }
- return val;
- }
- else {
- return __pyx_PyInt_AsLong(x);
- }
+static INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t ival) {
+#if PY_VERSION_HEX < 0x02050000
+ if (ival <= LONG_MAX)
+ return PyInt_FromLong((long)ival);
+ else {
+ unsigned char *bytes = (unsigned char *) &ival;
+ int one = 1; int little = (int)*(unsigned char*)&one;
+ return _PyLong_FromByteArray(bytes, sizeof(size_t), little, 0);
+ }
+#else
+ return PyInt_FromSize_t(ival);
+#endif
}
-static INLINE signed long __pyx_PyInt_signed_long(PyObject* x) {
- if (sizeof(signed long) < sizeof(long)) {
- long long_val = __pyx_PyInt_AsLong(x);
- signed long val = (signed long)long_val;
- if (unlikely((val != long_val) )) {
- PyErr_SetString(PyExc_OverflowError, "value too large to convert to signed long");
- return (signed long)-1;
- }
- return val;
- }
- else {
- return __pyx_PyInt_AsLong(x);
- }
+static INLINE size_t __Pyx_PyInt_AsSize_t(PyObject* x) {
+ unsigned PY_LONG_LONG val = __Pyx_PyInt_AsUnsignedLongLong(x);
+ if (unlikely(val == (unsigned PY_LONG_LONG)-1 && PyErr_Occurred())) {
+ return (size_t)-1;
+ } else if (unlikely(val != (unsigned PY_LONG_LONG)(size_t)val)) {
+ PyErr_SetString(PyExc_OverflowError,
+ "value too large to convert to size_t");
+ return (size_t)-1;
+ }
+ return (size_t)val;
}
-static INLINE long double __pyx_PyInt_long_double(PyObject* x) {
- if (sizeof(long double) < sizeof(long)) {
- long long_val = __pyx_PyInt_AsLong(x);
- long double val = (long double)long_val;
- if (unlikely((val != long_val) )) {
- PyErr_SetString(PyExc_OverflowError, "value too large to convert to long double");
- return (long double)-1;
- }
- return val;
- }
- else {
- return __pyx_PyInt_AsLong(x);
- }
-}
+#endif /* Py_PYTHON_H */
diff --git a/sphinx/pycode/pgen2/parse.pyx b/sphinx/pycode/pgen2/parse.pyx
index 537d7393..9c97a453 100644
--- a/sphinx/pycode/pgen2/parse.pyx
+++ b/sphinx/pycode/pgen2/parse.pyx
@@ -29,9 +29,16 @@ class ParseError(Exception):
cdef class Parser:
- cdef public grammar, stack, rootnode, used_names
- cdef _grammar_dfas, _grammar_labels, _grammar_keywords, _grammar_tokens
- cdef _grammar_number2symbol
+ cdef public object grammar
+ cdef public object rootnode
+ cdef public list stack
+ cdef public set used_names
+ cdef int _grammar_start
+ cdef list _grammar_labels
+ cdef dict _grammar_dfas
+ cdef dict _grammar_keywords
+ cdef dict _grammar_tokens
+ cdef dict _grammar_number2symbol
def __init__(self, grammar, convert=None):
self.grammar = grammar
@@ -42,10 +49,11 @@ cdef class Parser:
self._grammar_keywords = grammar.keywords
self._grammar_tokens = grammar.tokens
self._grammar_number2symbol = grammar.number2symbol
+ self._grammar_start = grammar.start
def setup(self, start=None):
if start is None:
- start = self.grammar.start
+ start = self._grammar_start
# Each stack entry is a tuple: (dfa, state, node).
# A node is a tuple: (type, value, context, children),
# where children is a list of nodes or None, and context may be None.
@@ -55,7 +63,7 @@ cdef class Parser:
self.rootnode = None
self.used_names = set() # Aliased to self.rootnode.used_names in pop()
- def addtoken(self, type, value, context):
+ def addtoken(self, int type, value, context):
"""Add a token; return True iff this is the end of the program."""
cdef int ilabel, i, t, state, newstate
# Map from token to label
@@ -104,22 +112,21 @@ cdef class Parser:
# No success finding a transition
raise ParseError("bad input", type, value, context)
- cdef int classify(self, type, value, context):
+ cdef int classify(self, int type, value, context):
"""Turn a token into a label. (Internal)"""
if type == NAME:
# Keep a listing of all used names
self.used_names.add(value)
# Check for reserved words
- ilabel = self._grammar_keywords.get(value)
- if ilabel is not None:
- return ilabel
- ilabel = self._grammar_tokens.get(type)
- if ilabel is None:
+ if value in self._grammar_keywords:
+ return self._grammar_keywords[value]
+ if type not in self._grammar_tokens:
raise ParseError("bad token", type, value, context)
- return ilabel
+ return self._grammar_tokens[type]
cdef void shift(self, type, value, newstate, context):
"""Shift a token. (Internal)"""
+ cdef tuple node
dfa, state, node = self.stack[-1]
newnode = (type, value, context, None)
newnode = self.convert(newnode)
@@ -146,7 +153,7 @@ cdef class Parser:
self.rootnode = newnode
self.rootnode.used_names = self.used_names
- cdef convert(self, raw_node):
+ cdef convert(self, tuple raw_node):
type, value, context, children = raw_node
if children or type in self._grammar_number2symbol:
# If there's exactly one child, return that child instead of
diff --git a/sphinx/quickstart.py b/sphinx/quickstart.py
index af1132d5..7e261e4b 100644
--- a/sphinx/quickstart.py
+++ b/sphinx/quickstart.py
@@ -14,7 +14,8 @@ from os import path
TERM_ENCODING = getattr(sys.stdin, 'encoding', None)
-from sphinx.util import make_filename
+from sphinx import __version__
+from sphinx.util.osutil import make_filename
from sphinx.util.console import purple, bold, red, turquoise, \
nocolor, color_terminal
from sphinx.util import texescape
@@ -45,6 +46,9 @@ import sys, os
# -- General configuration -----------------------------------------------------
+# If your documentation needs a minimal Sphinx version, state it here.
+#needs_sphinx = '1.0'
+
# Add any Sphinx extension module names here, as strings. They can be extensions
# coming with Sphinx (named 'sphinx.ext.*') or your custom ones.
extensions = [%(extensions)s]
@@ -56,7 +60,7 @@ templates_path = ['%(dot)stemplates']
source_suffix = '%(suffix)s'
# The encoding of source files.
-#source_encoding = 'utf-8'
+#source_encoding = 'utf-8-sig'
# The master toctree document.
master_doc = '%(master_str)s'
@@ -84,12 +88,9 @@ release = '%(release_str)s'
# Else, today_fmt is used as the format for a strftime call.
#today_fmt = '%%B %%d, %%Y'
-# List of documents that shouldn't be included in the build.
-#unused_docs = []
-
-# List of directories, relative to source directory, that shouldn't be searched
-# for source files.
-exclude_trees = [%(exclude_trees)s]
+# List of patterns, relative to source directory, that match files and
+# directories to ignore when looking for source files.
+exclude_patterns = [%(exclude_patterns)s]
# The reST default role (used for this markup: `text`) to use for all documents.
#default_role = None
@@ -174,6 +175,12 @@ html_static_path = ['%(dot)sstatic']
# If true, links to the reST sources are added to the pages.
#html_show_sourcelink = True
+# If true, "Created using Sphinx" is shown in the HTML footer. Default is True.
+#html_show_sphinx = True
+
+# If true, "(C) Copyright ..." is shown in the HTML footer. Default is True.
+#html_show_copyright = True
+
# If true, an OpenSearch description file will be output, and all pages will
# contain a <link> tag referring to it. The value of this option must be the
# base URL from which the finished HTML is served.
@@ -217,6 +224,43 @@ latex_documents = [
# If false, no module index is generated.
#latex_use_modindex = True
+
+
+# -- Options for Epub output ---------------------------------------------------
+
+# Bibliographic Dublin Core info.
+#epub_title = ''
+#epub_author = ''
+#epub_publisher = ''
+#epub_copyright = ''
+
+# The language of the text. It defaults to the language option
+# or en if the language is not set.
+#epub_language = ''
+
+# The scheme of the identifier. Typical schemes are ISBN or URL.
+#epub_scheme = ''
+
+# The unique identifier of the text. This can be a ISBN number
+# or the project homepage.
+#epub_identifier = ''
+
+# A unique identification for the text.
+#epub_uid = ''
+
+# HTML files that should be inserted before the pages created by sphinx.
+# The format is a list of tuples containing the path and title.
+#epub_pre_files = []
+
+# HTML files shat should be inserted after the pages created by sphinx.
+# The format is a list of tuples containing the path and title.
+#epub_post_files = []
+
+# A list of files that should not be packed into the epub file.
+#epub_exclude_files = []
+
+# The depth of the table of contents in toc.ncx.
+#epub_tocdepth = 3
'''
INTERSPHINX_CONFIG = '''
@@ -264,21 +308,25 @@ PAPEROPT_letter = -D latex_paper_size=letter
ALLSPHINXOPTS = -d $(BUILDDIR)/doctrees $(PAPEROPT_$(PAPER)) \
$(SPHINXOPTS) %(rsrcdir)s
-.PHONY: help clean html dirhtml pickle json htmlhelp qthelp latex changes \
-linkcheck doctest
+.PHONY: help clean html dirhtml singlehtml pickle json htmlhelp qthelp epub \
+latex changes linkcheck doctest
help:
\t@echo "Please use \\`make <target>' where <target> is one of"
-\t@echo " html to make standalone HTML files"
-\t@echo " dirhtml to make HTML files named index.html in directories"
-\t@echo " pickle to make pickle files"
-\t@echo " json to make JSON files"
-\t@echo " htmlhelp to make HTML files and a HTML help project"
-\t@echo " qthelp to make HTML files and a qthelp project"
-\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 \
+\t@echo " html to make standalone HTML files"
+\t@echo " dirhtml to make HTML files named index.html in directories"
+\t@echo " singlehtml to make a single large HTML file"
+\t@echo " pickle to make pickle files"
+\t@echo " json to make JSON files"
+\t@echo " htmlhelp to make HTML files and a HTML help project"
+\t@echo " qthelp to make HTML files and a qthelp project"
+\t@echo " devhelp to make HTML files and a Devhelp project"
+\t@echo " epub to make an epub"
+\t@echo " latex to make LaTeX files, you can set PAPER=a4 or PAPER=letter"
+\t@echo " latexpdf to make LaTeX files and run them through pdflatex"
+\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)"
clean:
@@ -294,6 +342,11 @@ dirhtml:
\t@echo
\t@echo "Build finished. The HTML pages are in $(BUILDDIR)/dirhtml."
+singlehtml:
+\t$(SPHINXBUILD) -b singlehtml $(ALLSPHINXOPTS) $(BUILDDIR)/singlehtml
+\t@echo
+\t@echo "Build finished. The HTML page is in $(BUILDDIR)/singlehtml."
+
pickle:
\t$(SPHINXBUILD) -b pickle $(ALLSPHINXOPTS) $(BUILDDIR)/pickle
\t@echo
@@ -319,6 +372,21 @@ qthelp:
\t@echo "To view the help file:"
\t@echo "# assistant -collectionFile $(BUILDDIR)/qthelp/%(project_fn)s.qhc"
+devhelp:
+\t$(SPHINXBUILD) -b devhelp $(ALLSPHINXOPTS) %(rbuilddir)s/devhelp
+\t@echo
+\t@echo "Build finished."
+\t@echo "To view the help file:"
+\t@echo "# mkdir -p $$HOME/.local/share/devhelp/%(project_fn)s"
+\t@echo "# ln -s %(rbuilddir)s/devhelp\
+ $$HOME/.local/share/devhelp/%(project_fn)s"
+\t@echo "# devhelp"
+
+epub:
+\t$(SPHINXBUILD) -b epub $(ALLSPHINXOPTS) $(BUILDDIR)/epub
+\t@echo
+\t@echo "Build finished. The epub file is in $(BUILDDIR)/epub."
+
latex:
\t$(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex
\t@echo
@@ -326,6 +394,12 @@ latex:
\t@echo "Run \\`make all-pdf' or \\`make all-ps' in that directory to" \\
\t "run these through (pdf)latex."
+latexpdf: latex
+\t$(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) %(rbuilddir)s/latex
+\t@echo "Running LaTeX files through pdflatex..."
+\tmake -C %(rbuilddir)s/latex all-pdf
+\t@echo "pdflatex finished; the PDF files are in %(rbuilddir)s/latex."
+
changes:
\t$(SPHINXBUILD) -b changes $(ALLSPHINXOPTS) $(BUILDDIR)/changes
\t@echo
@@ -348,7 +422,9 @@ BATCHFILE = '''\
REM Command file for Sphinx documentation
-set SPHINXBUILD=sphinx-build
+if "%%SPHINXBUILD%%" == "" (
+\tset SPHINXBUILD=sphinx-build
+)
set BUILDDIR=%(rbuilddir)s
set ALLSPHINXOPTS=-d %%BUILDDIR%%/doctrees %%SPHINXOPTS%% %(rsrcdir)s
if NOT "%%PAPER%%" == "" (
@@ -360,16 +436,19 @@ if "%%1" == "" goto help
if "%%1" == "help" (
\t:help
\techo.Please use `make ^<target^>` where ^<target^> is one of
-\techo. html to make standalone HTML files
-\techo. dirhtml to make HTML files named index.html in directories
-\techo. pickle to make pickle files
-\techo. json to make JSON files
-\techo. htmlhelp to make HTML files and a HTML help project
-\techo. qthelp to make HTML files and a qthelp project
-\techo. latex to make LaTeX files, you can set PAPER=a4 or PAPER=letter
-\techo. changes to make an overview over all changed/added/deprecated items
-\techo. linkcheck to check all external links for integrity
-\techo. doctest to run all doctests embedded in the documentation if enabled
+\techo. html to make standalone HTML files
+\techo. dirhtml to make HTML files named index.html in directories
+\techo. singlehtml to make a single large HTML file
+\techo. pickle to make pickle files
+\techo. json to make JSON files
+\techo. htmlhelp to make HTML files and a HTML help project
+\techo. qthelp to make HTML files and a qthelp project
+\techo. devhelp to make HTML files and a Devhelp project
+\techo. epub to make an epub
+\techo. latex to make LaTeX files, you can set PAPER=a4 or PAPER=letter
+\techo. changes to make an overview over all changed/added/deprecated items
+\techo. linkcheck to check all external links for integrity
+\techo. doctest to run all doctests embedded in the documentation if enabled
\tgoto end
)
@@ -393,6 +472,13 @@ if "%%1" == "dirhtml" (
\tgoto end
)
+if "%%1" == "singlehtml" (
+\t%%SPHINXBUILD%% -b singlehtml %%ALLSPHINXOPTS%% %%BUILDDIR%%/singlehtml
+\techo.
+\techo.Build finished. The HTML pages are in %%BUILDDIR%%/singlehtml.
+\tgoto end
+)
+
if "%%1" == "pickle" (
\t%%SPHINXBUILD%% -b pickle %%ALLSPHINXOPTS%% %%BUILDDIR%%/pickle
\techo.
@@ -426,6 +512,20 @@ if "%%1" == "qthelp" (
\tgoto end
)
+if "%%1" == "devhelp" (
+\t%%SPHINXBUILD%% -b devhelp %%ALLSPHINXOPTS%% %(rbuilddir)s/devhelp
+\techo.
+\techo.Build finished.
+\tgoto end
+)
+
+if "%%1" == "epub" (
+\t%%SPHINXBUILD%% -b epub %%ALLSPHINXOPTS%% %%BUILDDIR%%/epub
+\techo.
+\techo.Build finished. The epub file is in %%BUILDDIR%%/epub.
+\tgoto end
+)
+
if "%%1" == "latex" (
\t%%SPHINXBUILD%% -b latex %%ALLSPHINXOPTS%% %%BUILDDIR%%/latex
\techo.
@@ -537,7 +637,7 @@ def inner_main(args):
if not color_terminal():
nocolor()
- print bold('Welcome to the Sphinx quickstart utility.')
+ print bold('Welcome to the Sphinx %s quickstart utility.') % __version__
print '''
Please enter values for the following settings (just press Enter to
accept a default value, if one is given in brackets).'''
@@ -663,10 +763,10 @@ directly.'''
mkdir_p(srcdir)
if d['sep']:
builddir = path.join(d['path'], 'build')
- d['exclude_trees'] = ''
+ d['exclude_patterns'] = ''
else:
builddir = path.join(srcdir, d['dot'] + 'build')
- d['exclude_trees'] = repr(d['dot'] + 'build')
+ d['exclude_patterns'] = repr(d['dot'] + 'build')
mkdir_p(builddir)
mkdir_p(path.join(srcdir, d['dot'] + 'templates'))
mkdir_p(path.join(srcdir, d['dot'] + 'static'))
diff --git a/sphinx/roles.py b/sphinx/roles.py
index 599de3c7..6dfcb760 100644
--- a/sphinx/roles.py
+++ b/sphinx/roles.py
@@ -15,7 +15,8 @@ from docutils import nodes, utils
from docutils.parsers.rst import roles
from sphinx import addnodes
-from sphinx.util import ws_re, caption_ref_re
+from sphinx.util import ws_re
+from sphinx.util.nodes import split_explicit_title
generic_docroles = {
@@ -133,28 +134,15 @@ def xfileref_role(typ, rawtext, text, lineno, inliner, options={}, content=[]):
modname=env.currmodule, classname=env.currclass)
# we may need the line number for warnings
pnode.line = lineno
- # the link title may differ from the target, but by default
- # they are the same
- title = target = text
- titleistarget = True
# look if explicit title and target are given with `foo <bar>` syntax
- brace = text.find('<')
- if brace != -1:
- titleistarget = False
+ has_explicit_title, title, target = split_explicit_title(text)
+ if has_explicit_title:
pnode['refcaption'] = True
- m = caption_ref_re.match(text)
- if m:
- target = m.group(2)
- title = m.group(1)
- else:
- # fallback: everything after '<' is the target
- target = text[brace+1:]
- title = text[:brace]
# special target for Python object cross-references
if typ in ('data', 'exc', 'func', 'class', 'const', 'attr',
'meth', 'mod', 'obj'):
# fix-up parentheses in link title
- if titleistarget:
+ if not has_explicit_title:
title = title.lstrip('.') # only has a meaning for the target
target = target.lstrip('~') # only has a meaning for the title
title = _fix_parens(typ, title, env)
@@ -176,7 +164,7 @@ def xfileref_role(typ, rawtext, text, lineno, inliner, options={}, content=[]):
# some other special cases for the target
elif typ == 'option':
program = env.currprogram
- if titleistarget:
+ if not has_explicit_title:
if ' ' in title and not (title.startswith('/') or
title.startswith('-')):
program, target = re.split(' (?=-|--|/)', title, 1)
@@ -195,7 +183,7 @@ def xfileref_role(typ, rawtext, text, lineno, inliner, options={}, content=[]):
target = ws_re.sub('', target).lower()
elif typ == 'cfunc':
# fix-up parens for C functions too
- if titleistarget:
+ if not has_explicit_title:
title = _fix_parens(typ, title, env)
# remove parentheses from the target too
if target.endswith('()'):
diff --git a/sphinx/search.py b/sphinx/search.py
index c0d3ab3c..7161bc4c 100644
--- a/sphinx/search.py
+++ b/sphinx/search.py
@@ -13,8 +13,14 @@ import cPickle as pickle
from docutils.nodes import comment, Text, NodeVisitor, SkipNode
-from sphinx.util.stemmer import PorterStemmer
from sphinx.util import jsdump, rpartition
+try:
+ # http://bitbucket.org/methane/porterstemmer/
+ from porterstemmer import Stemmer as CStemmer
+ CSTEMMER = True
+except ImportError:
+ from sphinx.util.stemmer import PorterStemmer
+ CSTEMMER = False
word_re = re.compile(r'\w+(?u)')
@@ -61,15 +67,23 @@ class _JavaScriptIndex(object):
js_index = _JavaScriptIndex()
-class Stemmer(PorterStemmer):
- """
- All those porter stemmer implementations look hideous.
- make at least the stem method nicer.
- """
+if CSTEMMER:
+ class Stemmer(CStemmer):
+
+ def stem(self, word):
+ return self(word.lower())
+
+else:
+ class Stemmer(PorterStemmer):
+ """
+ All those porter stemmer implementations look hideous.
+ make at least the stem method nicer.
+ """
+
+ def stem(self, word):
+ word = word.lower()
+ return PorterStemmer.stem(self, word, 0, len(word) - 1)
- def stem(self, word):
- word = word.lower()
- return PorterStemmer.stem(self, word, 0, len(word) - 1)
class WordCollector(NodeVisitor):
@@ -197,11 +211,11 @@ class IndexBuilder(object):
visitor = WordCollector(doctree)
doctree.walk(visitor)
- def add_term(word, prefix='', stem=self._stemmer.stem):
+ def add_term(word, stem=self._stemmer.stem):
word = stem(word)
if len(word) < 3 or word in stopwords or word.isdigit():
return
- self._mapping.setdefault(prefix + word, set()).add(filename)
+ self._mapping.setdefault(word, set()).add(filename)
for word in word_re.findall(title):
add_term(word)
diff --git a/sphinx/setup_command.py b/sphinx/setup_command.py
index d569b031..d4f87348 100644
--- a/sphinx/setup_command.py
+++ b/sphinx/setup_command.py
@@ -22,7 +22,41 @@ from sphinx.util.console import darkred, nocolor, color_terminal
class BuildDoc(Command):
- """Distutils command to build Sphinx documentation."""
+ """Distutils command to build Sphinx documentation.
+
+ The Sphinx build can then be triggered from distutils, and some Sphinx
+ options can be set in ``setup.py`` or ``setup.cfg`` instead of Sphinx own
+ configuration file.
+
+ For instance, from `setup.py`::
+
+ # this is only necessary when not using setuptools/distribute
+ from sphinx.setup_command import BuildDoc
+ cmdclass = {'build_sphinx': BuildDoc}
+
+ name = 'My project'
+ version = 1.2
+ release = 1.2.0
+ setup(
+ name=name,
+ author='Bernard Montgomery',
+ version=release,
+ cmdclass={'build_sphinx': BuildDoc},
+ # these are optional and override conf.py settings
+ command_options={
+ 'build_sphinx': {
+ 'project': ('setup.py', name),
+ 'version': ('setup.py', version),
+ 'release': ('setup.py', release)}},
+ )
+
+ Or add this section in ``setup.cfg``::
+
+ [build_sphinx]
+ project = 'My project'
+ version = 1.2
+ release = 1.2.0
+ """
description = 'Build Sphinx documentation'
user_options = [
@@ -31,15 +65,22 @@ class BuildDoc(Command):
('source-dir=', 's', 'Source directory'),
('build-dir=', None, 'Build directory'),
('builder=', 'b', 'The builder to use. Defaults to "html"'),
- ]
+ ('project=', None, 'The documented project\'s name'),
+ ('version=', None, 'The short X.Y version'),
+ ('release=', None, 'The full version, including alpha/beta/rc tags'),
+ ('today=', None, 'How to format the current date, used as the '
+ 'replacement for |today|'),
+ ]
boolean_options = ['fresh-env', 'all-files']
def initialize_options(self):
self.fresh_env = self.all_files = False
self.source_dir = self.build_dir = None
- self.conf_file_name = 'conf.py'
self.builder = 'html'
+ self.version = ''
+ self.release = ''
+ self.today = ''
def _guess_source_dir(self):
for guess in ('doc', 'docs'):
@@ -74,9 +115,16 @@ class BuildDoc(Command):
status_stream = StringIO()
else:
status_stream = sys.stdout
+ confoverrides = {}
+ if self.version:
+ confoverrides['version'] = self.version
+ if self.release:
+ confoverrides['release'] = self.release
+ if self.today:
+ confoverrides['today'] = self.today
app = Sphinx(self.source_dir, self.source_dir,
self.builder_target_dir, self.doctree_dir,
- self.builder, {}, status_stream,
+ self.builder, confoverrides, status_stream,
freshenv=self.fresh_env)
try:
diff --git a/sphinx/texinputs/howto.cls b/sphinx/texinputs/sphinxhowto.cls
index 87d207d1..204d7063 100644
--- a/sphinx/texinputs/howto.cls
+++ b/sphinx/texinputs/sphinxhowto.cls
@@ -1,14 +1,25 @@
%
-% howto.cls for Sphinx
+% sphinxhowto.cls for Sphinx (http://sphinx.pocoo.org/)
%
\NeedsTeXFormat{LaTeX2e}[1995/12/01]
-\ProvidesClass{howto}[2008/10/18 Document class (Sphinx HOWTO)]
+\ProvidesClass{sphinxhowto}[2009/06/02 Document class (Sphinx HOWTO)]
-% Pass all given class options to the parent class.
-\DeclareOption*{\PassOptionsToClass{\CurrentOption}{article}}
+% 'oneside' option overriding the 'twoside' default
+\newif\if@oneside
+\DeclareOption{oneside}{\@onesidetrue}
+% Pass remaining document options to the parent class.
+\DeclareOption*{\PassOptionsToClass{\CurrentOption}{\sphinxdocclass}}
\ProcessOptions\relax
-\LoadClass[twoside]{article}
+
+% Default to two-side document
+\if@oneside
+% nothing to do (oneside is the default)
+\else
+\PassOptionsToClass{twoside}{\sphinxdocclass}
+\fi
+
+\LoadClass{\sphinxdocclass}
% Set some sane defaults for section numbering depth and TOC depth. You can
% reset these counters in your preamble.
diff --git a/sphinx/texinputs/manual.cls b/sphinx/texinputs/sphinxmanual.cls
index f94ee6d6..da805cdc 100644
--- a/sphinx/texinputs/manual.cls
+++ b/sphinx/texinputs/sphinxmanual.cls
@@ -1,14 +1,28 @@
%
-% manual.cls for Sphinx
+% sphinxmanual.cls for Sphinx (http://sphinx.pocoo.org/)
%
\NeedsTeXFormat{LaTeX2e}[1995/12/01]
-\ProvidesClass{manual}[2008/10/18 Document class (Sphinx manual)]
+\ProvidesClass{sphinxmanual}[2009/06/02 Document class (Sphinx manual)]
-% Pass all given class options to the parent class.
-\DeclareOption*{\PassOptionsToClass{\CurrentOption}{report}}
+% chapters starting at odd pages (overridden by 'openany' document option)
+\PassOptionsToClass{openright}{\sphinxdocclass}
+
+% 'oneside' option overriding the 'twoside' default
+\newif\if@oneside
+\DeclareOption{oneside}{\@onesidetrue}
+% Pass remaining document options to the parent class.
+\DeclareOption*{\PassOptionsToClass{\CurrentOption}{\sphinxdocclass}}
\ProcessOptions\relax
-\LoadClass[twoside,openright]{report}
+
+% Defaults two-side document
+\if@oneside
+% nothing to do (oneside is the default)
+\else
+\PassOptionsToClass{twoside}{\sphinxdocclass}
+\fi
+
+\LoadClass{\sphinxdocclass}
% Set some sane defaults for section numbering depth and TOC depth. You can
% reset these counters in your preamble.
diff --git a/sphinx/themes/agogo/layout.html b/sphinx/themes/agogo/layout.html
new file mode 100644
index 00000000..73636376
--- /dev/null
+++ b/sphinx/themes/agogo/layout.html
@@ -0,0 +1,91 @@
+{#
+ agogo/layout.html
+ ~~~~~~~~~~~~~~~~~
+
+ Sphinx layout template for the agogo theme, originally written
+ by Andi Albrecht.
+
+ :copyright: Copyright 2007-2010 by the Sphinx team, see AUTHORS.
+ :license: BSD, see LICENSE for details.
+#}
+{% extends "basic/layout.html" %}
+
+{% block header %}
+ <div class="header-wrapper">
+ <div class="header">
+ {%- if logo %}
+ <p class="logo"><a href="{{ pathto(master_doc) }}">
+ <img class="logo" src="{{ pathto('_static/' + logo, 1) }}" alt="Logo"/>
+ </a></p>
+ {%- endif %}
+ {%- block headertitle %}
+ <h1><a href="{{ pathto(master_doc) }}">{{ shorttitle|e }}</a></h1>
+ {%- endblock %}
+ <div class="rel">
+ {%- for rellink in rellinks %}
+ <a href="{{ pathto(rellink[0]) }}" title="{{ rellink[1]|striptags }}"
+ {{ accesskey(rellink[2]) }}>{{ rellink[3] }}</a>
+ {%- if not loop.last %}{{ reldelim2 }}{% endif %}
+ {%- endfor %}
+ </div>
+ </div>
+ </div>
+{% endblock %}
+
+{% block content %}
+ <div class="content-wrapper">
+ <div class="content">
+ <div class="document">
+ {%- block document %}
+ {{ super() }}
+ {%- endblock %}
+ </div>
+ <div class="sidebar">
+ {%- block sidebartoc %}
+ <h3>{{ _('Contents') }}</h3>
+ {{ toctree() }}
+ {%- endblock %}
+ {%- block sidebarsearch %}
+ <h3 style="margin-top: 1.5em;">{{ _('Search') }}</h3>
+ <form class="search" action="{{ pathto('search') }}" method="get">
+ <input type="text" name="q" size="18" />
+ <input type="submit" value="{{ _('Go') }}" />
+ <input type="hidden" name="check_keywords" value="yes" />
+ <input type="hidden" name="area" value="default" />
+ </form>
+ <p class="searchtip" style="font-size: 90%">
+ {{ _('Enter search terms or a module, class or function name.') }}
+ </p>
+ {%- endblock %}
+ </div>
+ <div class="clearer"></div>
+ </div>
+ </div>
+{% endblock %}
+
+{% block footer %}
+ <div class="footer-wrapper">
+ <div class="footer">
+ <div class="left">
+ {%- for rellink in rellinks %}
+ <a href="{{ pathto(rellink[0]) }}" title="{{ rellink[1]|striptags }}"
+ {{ accesskey(rellink[2]) }}>{{ rellink[3] }}</a>
+ {%- if not loop.last %}{{ reldelim2 }}{% endif %}
+ {%- endfor %}
+ {%- if show_source and has_source and sourcename %}
+ <br/>
+ <a href="{{ pathto('_sources/' + sourcename, true)|e }}"
+ rel="nofollow">{{ _('Show Source') }}</a>
+ {%- endif %}
+ </div>
+
+ <div class="right">
+ {{ super() }}
+ </div>
+ <div class="clearer"></div>
+ </div>
+ </div>
+{% endblock %}
+
+{% block relbar1 %}{% endblock %}
+{% block relbar2 %}{% endblock %}
diff --git a/sphinx/themes/agogo/static/agogo.css_t b/sphinx/themes/agogo/static/agogo.css_t
new file mode 100644
index 00000000..cfe21612
--- /dev/null
+++ b/sphinx/themes/agogo/static/agogo.css_t
@@ -0,0 +1,392 @@
+/*
+ * agogo.css_t
+ * ~~~~~~~~~~~
+ *
+ * Sphinx stylesheet -- agogo theme.
+ *
+ * :copyright: Copyright 2007-2010 by the Sphinx team, see AUTHORS.
+ * :license: BSD, see LICENSE for details.
+ *
+ */
+
+* {
+ margin: 0px;
+ padding: 0px;
+}
+
+body {
+ font-family: {{ theme_bodyfont }};
+ line-height: 1.4em;
+ font-size: 14px;
+ color: black;
+ background-color: {{ theme_bgcolor }};
+}
+
+
+/* Page layout */
+
+div.header, div.content, div.footer {
+ width: {{ theme_pagewidth }};
+ margin-left: auto;
+ margin-right: auto;
+}
+
+div.header-wrapper {
+ background: {{ theme_headerbg }};
+ border-bottom: 3px solid #2e3436;
+}
+
+
+/* Default body styles */
+a {
+ color: {{ theme_linkcolor }};
+}
+
+div.bodywrapper a, div.footer a {
+ text-decoration: underline;
+}
+
+.clearer {
+ clear: both;
+}
+
+.left {
+ float: left;
+}
+
+.right {
+ float: right;
+}
+
+.line-block {
+ display: block;
+ margin-top: 1em;
+ margin-bottom: 1em;
+}
+
+.line-block .line-block {
+ margin-top: 0;
+ margin-bottom: 0;
+ margin-left: 1.5em;
+}
+
+h1, h2, h3, h4 {
+ font-family: {{ theme_headerfont }};
+ font-weight: normal;
+ color: {{ theme_headercolor2 }};
+ margin-bottom: .8em;
+}
+
+h1 {
+ color: {{ theme_headercolor1 }};
+}
+
+h2 {
+ padding-bottom: .5em;
+ border-bottom: 1px solid {{ theme_headercolor2 }};
+}
+
+a.headerlink {
+ visibility: hidden;
+ color: #dddddd;
+ padding-left: .3em;
+}
+
+h1:hover > a.headerlink,
+h2:hover > a.headerlink,
+h3:hover > a.headerlink,
+h4:hover > a.headerlink,
+h5:hover > a.headerlink,
+h6:hover > a.headerlink,
+dt:hover > a.headerlink {
+ visibility: visible;
+}
+
+img {
+ border: 0;
+}
+
+div.admonition {
+ margin-top: 10px;
+ margin-bottom: 10px;
+ padding: 2px 7px 1px 7px;
+ border-left: 0.2em solid black;
+}
+
+p.admonition-title {
+ margin: 0px 10px 5px 0px;
+ font-weight: bold;
+}
+
+/* Header */
+
+div.header {
+ padding-top: 10px;
+ padding-bottom: 10px;
+}
+
+div.header h1 {
+ font-family: {{ theme_headerfont }};
+ font-weight: normal;
+ font-size: 160%;
+ letter-spacing: .08em;
+}
+
+div.header h1 a {
+ color: white;
+}
+
+div.header div.rel {
+ margin-top: 1em;
+}
+
+div.header div.rel a {
+ color: {{ theme_headerlinkcolor }};
+ letter-spacing: .1em;
+ text-transform: uppercase;
+}
+
+p.logo {
+ float: right;
+}
+
+img.logo {
+ border: 0;
+}
+
+
+/* Content */
+div.content-wrapper {
+ background-color: white;
+ padding-top: 20px;
+ padding-bottom: 20px;
+}
+
+div.document {
+ width: {{ theme_documentwidth }};
+ float: left;
+}
+
+div.body {
+ padding-right: 2em;
+ text-align: {{ theme_textalign }};
+}
+
+div.document ul {
+ margin-left: 1.2em;
+ list-style-type: square;
+}
+
+div.document dd {
+ margin-left: 1.2em;
+ margin-top: .4em;
+ margin-bottom: 1em;
+}
+
+div.document .section {
+ margin-top: 1.7em;
+}
+div.document .section:first-child {
+ margin-top: 0px;
+}
+
+div.document div.highlight {
+ padding: 3px;
+ background-color: #eeeeec;
+ border-top: 2px solid #dddddd;
+ border-bottom: 2px solid #dddddd;
+ margin-top: .8em;
+ margin-bottom: .8em;
+}
+
+div.document h2 {
+ margin-top: .7em;
+}
+
+div.document p {
+ margin-bottom: .5em;
+}
+
+div.document li.toctree-l1 {
+ margin-bottom: 1em;
+}
+
+div.document .descname {
+ font-weight: bold;
+}
+
+div.document .docutils.literal {
+ background-color: #eeeeec;
+ padding: 1px;
+}
+
+div.document .docutils.xref.literal {
+ background-color: transparent;
+ padding: 0px;
+}
+
+
+/* Sidebar */
+
+div.sidebar {
+ width: {{ theme_sidebarwidth }};
+ float: right;
+ font-size: .9em;
+}
+
+div.sidebar a, div.header a {
+ text-decoration: none;
+}
+
+div.sidebar a:hover, div.header a:hover {
+ text-decoration: underline;
+}
+
+div.sidebar h3 {
+ color: #2e3436;
+ text-transform: uppercase;
+ font-size: 130%;
+ letter-spacing: .1em;
+}
+
+div.sidebar ul {
+ list-style-type: none;
+}
+
+div.sidebar li.toctree-l1 a {
+ display: block;
+ padding: 1px;
+ border: 1px solid #dddddd;
+ background-color: #eeeeec;
+ margin-bottom: .4em;
+ padding-left: 3px;
+ color: #2e3436;
+}
+
+div.sidebar li.toctree-l2 a {
+ background-color: transparent;
+ border: none;
+ margin-left: 1em;
+ border-bottom: 1px solid #dddddd;
+}
+
+div.sidebar li.toctree-l3 a {
+ background-color: transparent;
+ border: none;
+ margin-left: 2em;
+ border-bottom: 1px solid #dddddd;
+}
+
+div.sidebar li.toctree-l2:last-child a {
+ border-bottom: none;
+}
+
+div.sidebar li.toctree-l1.current a {
+ border-right: 5px solid {{ theme_headerlinkcolor }};
+}
+
+div.sidebar li.toctree-l1.current li.toctree-l2 a {
+ border-right: none;
+}
+
+
+/* Footer */
+
+div.footer-wrapper {
+ background: {{ theme_footerbg }};
+ border-top: 4px solid #babdb6;
+ padding-top: 10px;
+ padding-bottom: 10px;
+ min-height: 80px;
+}
+
+div.footer, div.footer a {
+ color: #888a85;
+}
+
+div.footer .right {
+ text-align: right;
+}
+
+div.footer .left {
+ text-transform: uppercase;
+}
+
+
+/* Styles copied from basic theme */
+
+/* -- search page ----------------------------------------------------------- */
+
+ul.search {
+ margin: 10px 0 0 20px;
+ padding: 0;
+}
+
+ul.search li {
+ padding: 5px 0 5px 20px;
+ background-image: url(file.png);
+ background-repeat: no-repeat;
+ background-position: 0 7px;
+}
+
+ul.search li a {
+ font-weight: bold;
+}
+
+ul.search li div.context {
+ color: #888;
+ margin: 2px 0 0 30px;
+ text-align: left;
+}
+
+ul.keywordmatches li.goodmatch a {
+ font-weight: bold;
+}
+
+/* -- index page ------------------------------------------------------------ */
+
+table.contentstable {
+ width: 90%;
+}
+
+table.contentstable p.biglink {
+ line-height: 150%;
+}
+
+a.biglink {
+ font-size: 1.3em;
+}
+
+span.linkdescr {
+ font-style: italic;
+ padding-top: 5px;
+ font-size: 90%;
+}
+
+/* -- general index --------------------------------------------------------- */
+
+table.indextable td {
+ text-align: left;
+ vertical-align: top;
+}
+
+table.indextable dl, table.indextable dd {
+ margin-top: 0;
+ margin-bottom: 0;
+}
+
+table.indextable tr.pcap {
+ height: 10px;
+}
+
+table.indextable tr.cap {
+ margin-top: 10px;
+ background-color: #f2f2f2;
+}
+
+img.toggler {
+ margin-right: 3px;
+ margin-top: 3px;
+ cursor: pointer;
+}
+
diff --git a/sphinx/themes/agogo/static/bgfooter.png b/sphinx/themes/agogo/static/bgfooter.png
new file mode 100644
index 00000000..9ce5bdd9
--- /dev/null
+++ b/sphinx/themes/agogo/static/bgfooter.png
Binary files differ
diff --git a/sphinx/themes/agogo/static/bgtop.png b/sphinx/themes/agogo/static/bgtop.png
new file mode 100644
index 00000000..a0d4709b
--- /dev/null
+++ b/sphinx/themes/agogo/static/bgtop.png
Binary files differ
diff --git a/sphinx/themes/agogo/theme.conf b/sphinx/themes/agogo/theme.conf
new file mode 100644
index 00000000..3fc88580
--- /dev/null
+++ b/sphinx/themes/agogo/theme.conf
@@ -0,0 +1,19 @@
+[theme]
+inherit = basic
+stylesheet = agogo.css
+pygments_style = tango
+
+[options]
+bodyfont = "Verdana", Arial, sans-serif
+headerfont = "Georgia", "Times New Roman", serif
+pagewidth = 70em
+documentwidth = 50em
+sidebarwidth = 20em
+bgcolor = #eeeeec
+headerbg = url(bgtop.png) top left repeat-x
+footerbg = url(bgfooter.png) top left repeat-x
+linkcolor = #ce5c00
+headercolor1 = #204a87
+headercolor2 = #3465a4
+headerlinkcolor = #fcaf3e
+textalign = justify \ No newline at end of file
diff --git a/sphinx/themes/basic/defindex.html b/sphinx/themes/basic/defindex.html
index 40f4f4c9..f337faec 100644
--- a/sphinx/themes/basic/defindex.html
+++ b/sphinx/themes/basic/defindex.html
@@ -1,3 +1,12 @@
+{#
+ basic/defindex.html
+ ~~~~~~~~~~~~~~~~~~~
+
+ Default template for the "index" page.
+
+ :copyright: Copyright 2007-2010 by the Sphinx team, see AUTHORS.
+ :license: BSD, see LICENSE for details.
+#}
{% extends "layout.html" %}
{% set title = _('Overview') %}
{% block body %}
diff --git a/sphinx/themes/basic/genindex-single.html b/sphinx/themes/basic/genindex-single.html
index 9aaaeb0c..1e98ba9c 100644
--- a/sphinx/themes/basic/genindex-single.html
+++ b/sphinx/themes/basic/genindex-single.html
@@ -1,36 +1,38 @@
+{#
+ basic/genindex-single.html
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+ Template for a "single" page of a split index.
+
+ :copyright: Copyright 2007-2010 by the Sphinx team, see AUTHORS.
+ :license: BSD, see LICENSE for details.
+#}
{% extends "layout.html" %}
{% set title = _('Index') %}
{% block body %}
<h1 id="index">{% trans key=key %}Index &ndash; {{ key }}{% endtrans %}</h1>
-<table width="100%" class="indextable"><tr><td width="33%" valign="top">
-<dl>
-{%- set breakat = count // 2 %}
-{%- set numcols = 1 %}
-{%- set numitems = 0 %}
-{% for entryname, (links, subitems) in entries %}
-<dt>{%- if links -%}<a href="{{ links[0] }}">{{ entryname|e }}</a>
- {%- for link in links[1:] %}, <a href="{{ link }}">[{{ loop.index }}]</a>{% endfor -%}
- {%- else -%}
-{{ entryname|e }}
- {%- endif -%}</dt>
- {%- if subitems %}
- <dd><dl>
+<table width="100%" class="indextable"><tr>
+ {%- for column in entries|slice(2) if column %}
+ <td width="33%" valign="top"><dl>
+ {%- for entryname, (links, subitems) in column %}
+ <dt>{% if links %}<a href="{{ links[0] }}">{{ entryname|e }}</a>
+ {%- for link in links[1:] %}, <a href="{{ link }}">[{{ loop.index }}]</a>{% endfor %}
+ {%- else %}{{ entryname|e }}{% endif %}</dt>
+ {%- if subitems %}
+ <dd><dl>
{%- for subentryname, subentrylinks in subitems %}
- <dt><a href="{{ subentrylinks[0] }}">{{ subentryname|e }}</a>
- {%- for link in subentrylinks[1:] %}, <a href="{{ link }}">[{{ loop.index }}]</a>{% endfor -%}
- </dt>
+ <dt><a href="{{ subentrylinks[0] }}">{{ subentryname|e }}</a>
+ {%- for link in subentrylinks[1:] %}, <a href="{{ link }}">[{{ loop.index }}]</a>{% endfor -%}
+ </dt>
{%- endfor %}
</dl></dd>
{%- endif -%}
-{%- set numitems = numitems + 1 + (subitems|length) -%}
-{%- if numcols < 2 and numitems > breakat -%}
-{%- set numcols = numcols+1 -%}
-</dl></td><td width="33%" valign="top"><dl>
-{%- endif -%}
{%- endfor %}
-</dl></td></tr></table>
+</dl></td>
+{%- endfor %}
+</tr></table>
{% endblock %}
diff --git a/sphinx/themes/basic/genindex-split.html b/sphinx/themes/basic/genindex-split.html
index ab099e5b..d068a96a 100644
--- a/sphinx/themes/basic/genindex-split.html
+++ b/sphinx/themes/basic/genindex-split.html
@@ -1,3 +1,12 @@
+{#
+ basic/genindex-split.html
+ ~~~~~~~~~~~~~~~~~~~~~~~~~
+
+ Template for a "split" index overview page.
+
+ :copyright: Copyright 2007-2010 by the Sphinx team, see AUTHORS.
+ :license: BSD, see LICENSE for details.
+#}
{% extends "layout.html" %}
{% set title = _('Index') %}
{% block body %}
@@ -6,6 +15,7 @@
<p>{{ _('Index pages by letter') }}:</p>
+ <div class="genindex-jumpbox">
<p>{% for key, dummy in genindexentries -%}
<a href="{{ pathto('genindex-' + key) }}"><strong>{{ key }}</strong></a>
{% if not loop.last %}| {% endif %}
@@ -13,6 +23,7 @@
<p><a href="{{ pathto('genindex-all') }}"><strong>{{ _('Full index on one page') }}</strong>
({{ _('can be huge') }})</a></p>
+ </div>
{% endblock %}
diff --git a/sphinx/themes/basic/genindex.html b/sphinx/themes/basic/genindex.html
index a19aa80f..4d46380f 100644
--- a/sphinx/themes/basic/genindex.html
+++ b/sphinx/themes/basic/genindex.html
@@ -1,44 +1,46 @@
+{#
+ basic/genindex.html
+ ~~~~~~~~~~~~~~~~~~~
+
+ Template for an "all-in-one" index.
+
+ :copyright: Copyright 2007-2010 by the Sphinx team, see AUTHORS.
+ :license: BSD, see LICENSE for details.
+#}
{% extends "layout.html" %}
{% set title = _('Index') %}
{% block body %}
<h1 id="index">{{ _('Index') }}</h1>
+ <div class="genindex-jumpbox">
{% for key, dummy in genindexentries -%}
<a href="#{{ key }}"><strong>{{ key }}</strong></a> {% if not loop.last %}| {% endif %}
{%- endfor %}
+ </div>
- <hr />
-
- {% for key, entries in genindexentries %}
+ {%- for key, entries in genindexentries %}
<h2 id="{{ key }}">{{ key }}</h2>
-<table width="100%" class="indextable"><tr><td width="33%" valign="top">
-<dl>
-{%- set breakat = genindexcounts[loop.index0] // 2 %}
-{%- set numcols = 1 %}
-{%- set numitems = 0 %}
-{% for entryname, (links, subitems) in entries %}
-<dt>{%- if links -%}<a href="{{ links[0] }}">{{ entryname|e }}</a>
- {%- for link in links[1:] %}, <a href="{{ link }}">[{{ loop.index }}]</a>{% endfor -%}
- {%- else -%}
-{{ entryname|e }}
- {%- endif -%}</dt>
- {%- if subitems %}
- <dd><dl>
+<table width="100%" class="indextable genindextable"><tr>
+ {%- for column in entries|slice(2) if column %}
+ <td width="33%" valign="top"><dl>
+ {%- for entryname, (links, subitems) in column %}
+ <dt>{% if links %}<a href="{{ links[0] }}">{{ entryname|e }}</a>
+ {%- for link in links[1:] %}, <a href="{{ link }}">[{{ loop.index }}]</a>{% endfor %}
+ {%- else %}{{ entryname|e }}{% endif %}</dt>
+ {%- if subitems %}
+ <dd><dl>
{%- for subentryname, subentrylinks in subitems %}
- <dt><a href="{{ subentrylinks[0] }}">{{ subentryname|e }}</a>
- {%- for link in subentrylinks[1:] %}, <a href="{{ link }}">[{{ loop.index }}]</a>{% endfor -%}
- </dt>
+ <dt><a href="{{ subentrylinks[0] }}">{{ subentryname|e }}</a>
+ {%- for link in subentrylinks[1:] %}, <a href="{{ link }}">[{{ loop.index }}]</a>{% endfor -%}
+ </dt>
{%- endfor %}
</dl></dd>
{%- endif -%}
-{%- set numitems = numitems + 1 + (subitems|length) -%}
-{%- if numcols < 2 and numitems > breakat -%}
-{%- set numcols = numcols+1 -%}
-</dl></td><td width="33%" valign="top"><dl>
-{%- endif -%}
{%- endfor %}
-</dl></td></tr></table>
+</dl></td>
+{%- endfor %}
+</tr></table>
{% endfor %}
{% endblock %}
diff --git a/sphinx/themes/basic/globaltoc.html b/sphinx/themes/basic/globaltoc.html
new file mode 100644
index 00000000..c5332471
--- /dev/null
+++ b/sphinx/themes/basic/globaltoc.html
@@ -0,0 +1,13 @@
+{#
+ basic/globaltoc.html
+ ~~~~~~~~~~~~~~~~~~~~
+
+ Sphinx sidebar template: global table of contents.
+
+ :copyright: Copyright 2007-2010 by the Sphinx team, see AUTHORS.
+ :license: BSD, see LICENSE for details.
+#}
+{%- if display_toc %}
+ <h3><a href="{{ pathto(master_doc) }}">{{ _('Table Of Contents') }}</a></h3>
+ {{ toctree() }}
+{%- endif %}
diff --git a/sphinx/themes/basic/layout.html b/sphinx/themes/basic/layout.html
index 2c8c4d7d..d3ef88ab 100644
--- a/sphinx/themes/basic/layout.html
+++ b/sphinx/themes/basic/layout.html
@@ -1,9 +1,20 @@
+{#
+ basic/layout.html
+ ~~~~~~~~~~~~~~~~~
+
+ Master layout template for Sphinx themes.
+
+ :copyright: Copyright 2007-2010 by the Sphinx team, see AUTHORS.
+ :license: BSD, see LICENSE for details.
+#}
{%- block doctype -%}
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
{%- endblock %}
{%- set reldelim1 = reldelim1 is not defined and ' &raquo;' or reldelim1 %}
{%- set reldelim2 = reldelim2 is not defined and ' |' or reldelim2 %}
+{%- set render_sidebar = (not embedded) and (not theme_nosidebar|tobool) and
+ (not sidebars == []) %}
{%- macro relbar() %}
<div class="related">
@@ -27,7 +38,7 @@
{%- endmacro %}
{%- macro sidebar() %}
- {%- if not embedded %}{% if not theme_nosidebar|tobool %}
+ {%- if render_sidebar %}
<div class="sphinxsidebar">
<div class="sphinxsidebarwrapper">
{%- block sidebarlogo %}
@@ -37,70 +48,51 @@
</a></p>
{%- endif %}
{%- endblock %}
- {%- block sidebartoc %}
- {%- if display_toc %}
- <h3><a href="{{ pathto(master_doc) }}">{{ _('Table Of Contents') }}</a></h3>
- {{ toc }}
- {%- endif %}
- {%- endblock %}
- {%- block sidebarrel %}
- {%- if prev %}
- <h4>{{ _('Previous topic') }}</h4>
- <p class="topless"><a href="{{ prev.link|e }}"
- title="{{ _('previous chapter') }}">{{ prev.title }}</a></p>
- {%- endif %}
- {%- if next %}
- <h4>{{ _('Next topic') }}</h4>
- <p class="topless"><a href="{{ next.link|e }}"
- title="{{ _('next chapter') }}">{{ next.title }}</a></p>
- {%- endif %}
- {%- endblock %}
- {%- block sidebarsourcelink %}
- {%- if show_source and has_source and sourcename %}
- <h3>{{ _('This Page') }}</h3>
- <ul class="this-page-menu">
- <li><a href="{{ pathto('_sources/' + sourcename, true)|e }}"
- rel="nofollow">{{ _('Show Source') }}</a></li>
- </ul>
- {%- endif %}
- {%- endblock %}
- {%- if customsidebar %}
- {% include customsidebar %}
+ {%- if sidebars != None %}
+ {#- new style sidebar: explicitly include/exclude templates #}
+ {%- for sidebartemplate in sidebars %}
+ {%- include sidebartemplate %}
+ {%- endfor %}
+ {%- else %}
+ {#- old style sidebars: using blocks -- should be deprecated #}
+ {%- block sidebartoc %}
+ {%- include "localtoc.html" %}
+ {%- endblock %}
+ {%- block sidebarrel %}
+ {%- include "relations.html" %}
+ {%- endblock %}
+ {%- block sidebarsourcelink %}
+ {%- include "sourcelink.html" %}
+ {%- endblock %}
+ {%- if customsidebar %}
+ {%- include customsidebar %}
+ {%- endif %}
+ {%- block sidebarsearch %}
+ {%- include "searchbox.html" %}
+ {%- endblock %}
{%- endif %}
- {%- block sidebarsearch %}
- {%- if pagename != "search" %}
- <div id="searchbox" style="display: none">
- <h3>{{ _('Quick search') }}</h3>
- <form class="search" action="{{ pathto('search') }}" method="get">
- <input type="text" name="q" size="18" />
- <input type="submit" value="{{ _('Go') }}" />
- <input type="hidden" name="check_keywords" value="yes" />
- <input type="hidden" name="area" value="default" />
- </form>
- <p class="searchtip" style="font-size: 90%">
- {{ _('Enter search terms or a module, class or function name.') }}
- </p>
- </div>
- <script type="text/javascript">$('#searchbox').show(0);</script>
- {%- endif %}
- {%- endblock %}
</div>
</div>
- {%- endif %}{% endif %}
+ {%- endif %}
{%- endmacro %}
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
- <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
+ <meta http-equiv="Content-Type" content="text/html; charset={{ encoding }}" />
{{ metatags }}
{%- if not embedded and docstitle %}
{%- set titlesuffix = " &mdash; "|safe + docstitle|e %}
{%- else %}
{%- set titlesuffix = "" %}
{%- endif %}
+ {%- block htmltitle %}
<title>{{ title|striptags }}{{ titlesuffix }}</title>
+ {%- endblock %}
<link rel="stylesheet" href="{{ pathto('_static/' + style, 1) }}" type="text/css" />
<link rel="stylesheet" href="{{ pathto('_static/pygments.css', 1) }}" type="text/css" />
+ {%- for cssfile in css_files %}
+ <link rel="stylesheet" href="{{ pathto('_static/' + cssfile, 1) }}" type="text/css" />
+ {%- endfor %}
{%- if not embedded %}
<script type="text/javascript">
var DOCUMENTATION_OPTIONS = {
@@ -154,35 +146,39 @@
{%- block relbar1 %}{{ relbar() }}{% endblock %}
-{%- block sidebar1 %} {# possible location for sidebar #} {% endblock %}
+{%- block content %}
+ {%- block sidebar1 %} {# possible location for sidebar #} {% endblock %}
<div class="document">
-{%- block document %}
+ {%- block document %}
<div class="documentwrapper">
- {%- if not embedded %}{% if not theme_nosidebar|tobool %}
+ {%- if render_sidebar %}
<div class="bodywrapper">
- {%- endif %}{% endif %}
+ {%- endif %}
<div class="body">
{% block body %} {% endblock %}
</div>
- {%- if not embedded %}{% if not theme_nosidebar|tobool %}
+ {%- if render_sidebar %}
</div>
- {%- endif %}{% endif %}
+ {%- endif %}
</div>
-{%- endblock %}
+ {%- endblock %}
-{%- block sidebar2 %}{{ sidebar() }}{% endblock %}
+ {%- block sidebar2 %}{{ sidebar() }}{% endblock %}
<div class="clearer"></div>
</div>
+{%- endblock %}
{%- block relbar2 %}{{ relbar() }}{% endblock %}
{%- block footer %}
<div class="footer">
- {%- if hasdoc('copyright') %}
- {% trans path=pathto('copyright'), copyright=copyright|e %}&copy; <a href="{{ path }}">Copyright</a> {{ copyright }}.{% endtrans %}
- {%- else %}
- {% trans copyright=copyright|e %}&copy; Copyright {{ copyright }}.{% endtrans %}
+ {%- if show_copyright %}
+ {%- if hasdoc('copyright') %}
+ {% trans path=pathto('copyright'), copyright=copyright|e %}&copy; <a href="{{ path }}">Copyright</a> {{ copyright }}.{% endtrans %}
+ {%- else %}
+ {% trans copyright=copyright|e %}&copy; Copyright {{ copyright }}.{% endtrans %}
+ {%- endif %}
{%- endif %}
{%- if last_updated %}
{% trans last_updated=last_updated|e %}Last updated on {{ last_updated }}.{% endtrans %}
diff --git a/sphinx/themes/basic/localtoc.html b/sphinx/themes/basic/localtoc.html
new file mode 100644
index 00000000..896eda9c
--- /dev/null
+++ b/sphinx/themes/basic/localtoc.html
@@ -0,0 +1,13 @@
+{#
+ basic/localtoc.html
+ ~~~~~~~~~~~~~~~~~~~
+
+ Sphinx sidebar template: local table of contents.
+
+ :copyright: Copyright 2007-2010 by the Sphinx team, see AUTHORS.
+ :license: BSD, see LICENSE for details.
+#}
+{%- if display_toc %}
+ <h3><a href="{{ pathto(master_doc) }}">{{ _('Table Of Contents') }}</a></h3>
+ {{ toc }}
+{%- endif %}
diff --git a/sphinx/themes/basic/modindex.html b/sphinx/themes/basic/modindex.html
index 0392edc8..96f8ac43 100644
--- a/sphinx/themes/basic/modindex.html
+++ b/sphinx/themes/basic/modindex.html
@@ -1,3 +1,12 @@
+{#
+ basic/modindex.html
+ ~~~~~~~~~~~~~~~~~~~
+
+ Template for the module index.
+
+ :copyright: Copyright 2007-2010 by the Sphinx team, see AUTHORS.
+ :license: BSD, see LICENSE for details.
+#}
{% extends "layout.html" %}
{% set title = _('Global Module Index') %}
{% block extrahead %}
@@ -12,12 +21,13 @@
<h1 id="global-module-index">{{ _('Global Module Index') }}</h1>
+ <div class="modindex-jumpbox">
{%- for letter in letters %}
<a href="#cap-{{ letter }}"><strong>{{ letter }}</strong></a> {% if not loop.last %}| {% endif %}
{%- endfor %}
- <hr/>
+ </div>
- <table width="100%" class="indextable" cellspacing="0" cellpadding="2">
+ <table class="indextable modindextable" cellspacing="0" cellpadding="2">
{%- for modname, collapse, cgroup, indent, fname, synops, pform, dep, stripped in modindexentries %}
{%- if not modname -%}
<tr class="pcap"><td></td><td>&nbsp;</td><td></td></tr>
diff --git a/sphinx/themes/basic/page.html b/sphinx/themes/basic/page.html
index 17a93016..c7188fa5 100644
--- a/sphinx/themes/basic/page.html
+++ b/sphinx/themes/basic/page.html
@@ -1,3 +1,12 @@
+{#
+ basic/page.html
+ ~~~~~~~~~~~~~~~
+
+ Master template for simple pages.
+
+ :copyright: Copyright 2007-2010 by the Sphinx team, see AUTHORS.
+ :license: BSD, see LICENSE for details.
+#}
{% extends "layout.html" %}
{% block body %}
{{ body }}
diff --git a/sphinx/themes/basic/relations.html b/sphinx/themes/basic/relations.html
new file mode 100644
index 00000000..b693daf8
--- /dev/null
+++ b/sphinx/themes/basic/relations.html
@@ -0,0 +1,19 @@
+{#
+ basic/relations.html
+ ~~~~~~~~~~~~~~~~~~~~
+
+ Sphinx sidebar template: relation links.
+
+ :copyright: Copyright 2007-2010 by the Sphinx team, see AUTHORS.
+ :license: BSD, see LICENSE for details.
+#}
+{%- if prev %}
+ <h4>{{ _('Previous topic') }}</h4>
+ <p class="topless"><a href="{{ prev.link|e }}"
+ title="{{ _('previous chapter') }}">{{ prev.title }}</a></p>
+{%- endif %}
+{%- if next %}
+ <h4>{{ _('Next topic') }}</h4>
+ <p class="topless"><a href="{{ next.link|e }}"
+ title="{{ _('next chapter') }}">{{ next.title }}</a></p>
+{%- endif %}
diff --git a/sphinx/themes/basic/search.html b/sphinx/themes/basic/search.html
index 96c40652..eac32605 100644
--- a/sphinx/themes/basic/search.html
+++ b/sphinx/themes/basic/search.html
@@ -1,3 +1,12 @@
+{#
+ basic/search.html
+ ~~~~~~~~~~~~~~~~~
+
+ Template for the search page.
+
+ :copyright: Copyright 2007-2010 by the Sphinx team, see AUTHORS.
+ :license: BSD, see LICENSE for details.
+#}
{% extends "layout.html" %}
{% set title = _('Search') %}
{% set script_files = script_files + ['_static/searchtools.js'] %}
diff --git a/sphinx/themes/basic/searchbox.html b/sphinx/themes/basic/searchbox.html
new file mode 100644
index 00000000..56d6617c
--- /dev/null
+++ b/sphinx/themes/basic/searchbox.html
@@ -0,0 +1,24 @@
+{#
+ basic/searchbox.html
+ ~~~~~~~~~~~~~~~~~~~~
+
+ Sphinx sidebar template: quick search box.
+
+ :copyright: Copyright 2007-2010 by the Sphinx team, see AUTHORS.
+ :license: BSD, see LICENSE for details.
+#}
+{%- if pagename != "search" %}
+<div id="searchbox" style="display: none">
+ <h3>{{ _('Quick search') }}</h3>
+ <form class="search" action="{{ pathto('search') }}" method="get">
+ <input type="text" name="q" size="18" />
+ <input type="submit" value="{{ _('Go') }}" />
+ <input type="hidden" name="check_keywords" value="yes" />
+ <input type="hidden" name="area" value="default" />
+ </form>
+ <p class="searchtip" style="font-size: 90%">
+ {{ _('Enter search terms or a module, class or function name.') }}
+ </p>
+</div>
+<script type="text/javascript">$('#searchbox').show(0);</script>
+{%- endif %}
diff --git a/sphinx/themes/basic/sourcelink.html b/sphinx/themes/basic/sourcelink.html
new file mode 100644
index 00000000..8fa7563b
--- /dev/null
+++ b/sphinx/themes/basic/sourcelink.html
@@ -0,0 +1,16 @@
+{#
+ basic/sourcelink.html
+ ~~~~~~~~~~~~~~~~~~~~~
+
+ Sphinx sidebar template: "show source" link.
+
+ :copyright: Copyright 2007-2010 by the Sphinx team, see AUTHORS.
+ :license: BSD, see LICENSE for details.
+#}
+{%- if show_source and has_source and sourcename %}
+ <h3>{{ _('This Page') }}</h3>
+ <ul class="this-page-menu">
+ <li><a href="{{ pathto('_sources/' + sourcename, true)|e }}"
+ rel="nofollow">{{ _('Show Source') }}</a></li>
+ </ul>
+{%- endif %}
diff --git a/sphinx/themes/basic/static/basic.css b/sphinx/themes/basic/static/basic.css
index a04d6545..bd0a8544 100644
--- a/sphinx/themes/basic/static/basic.css
+++ b/sphinx/themes/basic/static/basic.css
@@ -1,6 +1,12 @@
-/**
- * Sphinx stylesheet -- basic theme
- * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+/*
+ * basic.css
+ * ~~~~~~~~~
+ *
+ * Sphinx stylesheet -- basic theme.
+ *
+ * :copyright: Copyright 2007-2010 by the Sphinx team, see AUTHORS.
+ * :license: BSD, see LICENSE for details.
+ *
*/
/* -- main layout ----------------------------------------------------------- */
@@ -127,6 +133,10 @@ span.linkdescr {
/* -- general index --------------------------------------------------------- */
+table.indextable {
+ width: 100%;
+}
+
table.indextable td {
text-align: left;
vertical-align: top;
@@ -152,6 +162,20 @@ img.toggler {
cursor: pointer;
}
+div.modindex-jumpbox {
+ border-top: 1px solid #ddd;
+ border-bottom: 1px solid #ddd;
+ margin: 1em 0 1em 0;
+ padding: 0.4em;
+}
+
+div.genindex-jumpbox {
+ border-top: 1px solid #ddd;
+ border-bottom: 1px solid #ddd;
+ margin: 1em 0 1em 0;
+ padding: 0.4em;
+}
+
/* -- general body styles --------------------------------------------------- */
a.headerlink {
@@ -252,7 +276,7 @@ table.docutils {
}
table.docutils td, table.docutils th {
- padding: 1px 8px 1px 0;
+ padding: 1px 8px 1px 5px;
border-top: 0;
border-left: 0;
border-right: 0;
diff --git a/sphinx/themes/basic/static/doctools.js b/sphinx/themes/basic/static/doctools.js
index 9447678c..c2bd1ac5 100644
--- a/sphinx/themes/basic/static/doctools.js
+++ b/sphinx/themes/basic/static/doctools.js
@@ -1,4 +1,18 @@
-/// XXX: make it cross browser
+/*
+ * doctools.js
+ * ~~~~~~~~~~~
+ *
+ * Sphinx JavaScript utilties for all documentation.
+ *
+ * :copyright: Copyright 2007-2010 by the Sphinx team, see AUTHORS.
+ * :license: BSD, see LICENSE for details.
+ *
+ */
+
+/**
+ * select a different prefix for underscore
+ */
+$u = _.noConflict();
/**
* make the code below compatible with browsers without
@@ -9,7 +23,7 @@ if (!window.console || !console.firebug) {
"group", "groupEnd", "time", "timeEnd", "count", "trace", "profile", "profileEnd"];
window.console = {};
for (var i = 0; i < names.length; ++i)
- window.console[names[i]] = function() {}
+ window.console[names[i]] = function() {};
}
/**
@@ -44,7 +58,7 @@ jQuery.getQueryParameters = function(s) {
result[key] = [value];
}
return result;
-}
+};
/**
* small function to check if an array contains
@@ -56,7 +70,7 @@ jQuery.contains = function(arr, item) {
return true;
}
return false;
-}
+};
/**
* highlight a given string on a jquery object by wrapping it in
@@ -79,14 +93,14 @@ jQuery.fn.highlightText = function(text, className) {
}
else if (!jQuery(node).is("button, select, textarea")) {
jQuery.each(node.childNodes, function() {
- highlight(this)
+ highlight(this);
});
}
}
return this.each(function() {
highlight(this);
});
-}
+};
/**
* Small JavaScript module for the documentation.
diff --git a/sphinx/themes/basic/static/searchtools.js b/sphinx/themes/basic/static/searchtools.js
index e0226258..ba91e30c 100644
--- a/sphinx/themes/basic/static/searchtools.js
+++ b/sphinx/themes/basic/static/searchtools.js
@@ -1,3 +1,14 @@
+/*
+ * searchtools.js
+ * ~~~~~~~~~~~~~~
+ *
+ * Sphinx JavaScript utilties for the full-text search.
+ *
+ * :copyright: Copyright 2007-2010 by the Sphinx team, see AUTHORS.
+ * :license: BSD, see LICENSE for details.
+ *
+ */
+
/**
* helper function to return a node containing the
* search summary for a given text. keywords is a list
@@ -287,8 +298,13 @@ var Search = {
},
query : function(query) {
- // stem the searchterms and add them to the
- // correct list
+ var stopwords = ['and', 'then', 'into', 'it', 'as', 'are', 'in',
+ 'if', 'for', 'no', 'there', 'their', 'was', 'is',
+ 'be', 'to', 'that', 'but', 'they', 'not', 'such',
+ 'with', 'by', 'a', 'on', 'these', 'of', 'will',
+ 'this', 'near', 'the', 'or', 'at'];
+
+ // stem the searchterms and add them to the correct list
var stemmer = new PorterStemmer();
var searchterms = [];
var excluded = [];
@@ -296,6 +312,10 @@ var Search = {
var tmp = query.split(/\s+/);
var object = (tmp.length == 1) ? tmp[0].toLowerCase() : null;
for (var i = 0; i < tmp.length; i++) {
+ if ($u.indexOf(stopwords, tmp[i]) != -1 || tmp[i].match(/^\d+$/)) {
+ // skip this word
+ continue;
+ }
// stem the word
var word = stemmer.stemWord(tmp[i]).toLowerCase();
// select the correct list
diff --git a/sphinx/themes/basic/static/underscore.js b/sphinx/themes/basic/static/underscore.js
new file mode 100644
index 00000000..9146e086
--- /dev/null
+++ b/sphinx/themes/basic/static/underscore.js
@@ -0,0 +1,16 @@
+(function(){var j=this,n=j._,i=function(a){this._wrapped=a},m=typeof StopIteration!=="undefined"?StopIteration:"__break__",b=j._=function(a){return new i(a)};if(typeof exports!=="undefined")exports._=b;var k=Array.prototype.slice,o=Array.prototype.unshift,p=Object.prototype.toString,q=Object.prototype.hasOwnProperty,r=Object.prototype.propertyIsEnumerable;b.VERSION="0.5.5";b.each=function(a,c,d){try{if(a.forEach)a.forEach(c,d);else if(b.isArray(a)||b.isArguments(a))for(var e=0,f=a.length;e<f;e++)c.call(d,
+a[e],e,a);else{var g=b.keys(a);f=g.length;for(e=0;e<f;e++)c.call(d,a[g[e]],g[e],a)}}catch(h){if(h!=m)throw h;}return a};b.map=function(a,c,d){if(a&&b.isFunction(a.map))return a.map(c,d);var e=[];b.each(a,function(f,g,h){e.push(c.call(d,f,g,h))});return e};b.reduce=function(a,c,d,e){if(a&&b.isFunction(a.reduce))return a.reduce(b.bind(d,e),c);b.each(a,function(f,g,h){c=d.call(e,c,f,g,h)});return c};b.reduceRight=function(a,c,d,e){if(a&&b.isFunction(a.reduceRight))return a.reduceRight(b.bind(d,e),c);
+var f=b.clone(b.toArray(a)).reverse();b.each(f,function(g,h){c=d.call(e,c,g,h,a)});return c};b.detect=function(a,c,d){var e;b.each(a,function(f,g,h){if(c.call(d,f,g,h)){e=f;b.breakLoop()}});return e};b.select=function(a,c,d){if(a&&b.isFunction(a.filter))return a.filter(c,d);var e=[];b.each(a,function(f,g,h){c.call(d,f,g,h)&&e.push(f)});return e};b.reject=function(a,c,d){var e=[];b.each(a,function(f,g,h){!c.call(d,f,g,h)&&e.push(f)});return e};b.all=function(a,c,d){c=c||b.identity;if(a&&b.isFunction(a.every))return a.every(c,
+d);var e=true;b.each(a,function(f,g,h){(e=e&&c.call(d,f,g,h))||b.breakLoop()});return e};b.any=function(a,c,d){c=c||b.identity;if(a&&b.isFunction(a.some))return a.some(c,d);var e=false;b.each(a,function(f,g,h){if(e=c.call(d,f,g,h))b.breakLoop()});return e};b.include=function(a,c){if(b.isArray(a))return b.indexOf(a,c)!=-1;var d=false;b.each(a,function(e){if(d=e===c)b.breakLoop()});return d};b.invoke=function(a,c){var d=b.rest(arguments,2);return b.map(a,function(e){return(c?e[c]:e).apply(e,d)})};b.pluck=
+function(a,c){return b.map(a,function(d){return d[c]})};b.max=function(a,c,d){if(!c&&b.isArray(a))return Math.max.apply(Math,a);var e={computed:-Infinity};b.each(a,function(f,g,h){g=c?c.call(d,f,g,h):f;g>=e.computed&&(e={value:f,computed:g})});return e.value};b.min=function(a,c,d){if(!c&&b.isArray(a))return Math.min.apply(Math,a);var e={computed:Infinity};b.each(a,function(f,g,h){g=c?c.call(d,f,g,h):f;g<e.computed&&(e={value:f,computed:g})});return e.value};b.sortBy=function(a,c,d){return b.pluck(b.map(a,
+function(e,f,g){return{value:e,criteria:c.call(d,e,f,g)}}).sort(function(e,f){e=e.criteria;f=f.criteria;return e<f?-1:e>f?1:0}),"value")};b.sortedIndex=function(a,c,d){d=d||b.identity;for(var e=0,f=a.length;e<f;){var g=e+f>>1;d(a[g])<d(c)?(e=g+1):(f=g)}return e};b.toArray=function(a){if(!a)return[];if(a.toArray)return a.toArray();if(b.isArray(a))return a;if(b.isArguments(a))return k.call(a);return b.values(a)};b.size=function(a){return b.toArray(a).length};b.first=function(a,c,d){return c&&!d?k.call(a,
+0,c):a[0]};b.rest=function(a,c,d){return k.call(a,b.isUndefined(c)||d?1:c)};b.last=function(a){return a[a.length-1]};b.compact=function(a){return b.select(a,function(c){return!!c})};b.flatten=function(a){return b.reduce(a,[],function(c,d){if(b.isArray(d))return c.concat(b.flatten(d));c.push(d);return c})};b.without=function(a){var c=b.rest(arguments);return b.select(a,function(d){return!b.include(c,d)})};b.uniq=function(a,c){return b.reduce(a,[],function(d,e,f){if(0==f||(c===true?b.last(d)!=e:!b.include(d,
+e)))d.push(e);return d})};b.intersect=function(a){var c=b.rest(arguments);return b.select(b.uniq(a),function(d){return b.all(c,function(e){return b.indexOf(e,d)>=0})})};b.zip=function(){for(var a=b.toArray(arguments),c=b.max(b.pluck(a,"length")),d=new Array(c),e=0;e<c;e++)d[e]=b.pluck(a,String(e));return d};b.indexOf=function(a,c){if(a.indexOf)return a.indexOf(c);for(var d=0,e=a.length;d<e;d++)if(a[d]===c)return d;return-1};b.lastIndexOf=function(a,c){if(a.lastIndexOf)return a.lastIndexOf(c);for(var d=
+a.length;d--;)if(a[d]===c)return d;return-1};b.range=function(a,c,d){var e=b.toArray(arguments),f=e.length<=1;a=f?0:e[0];c=f?e[0]:e[1];d=e[2]||1;e=Math.ceil((c-a)/d);if(e<=0)return[];e=new Array(e);f=a;for(var g=0;1;f+=d){if((d>0?f-c:c-f)>=0)return e;e[g++]=f}};b.bind=function(a,c){var d=b.rest(arguments,2);return function(){return a.apply(c||j,d.concat(b.toArray(arguments)))}};b.bindAll=function(a){var c=b.rest(arguments);if(c.length==0)c=b.functions(a);b.each(c,function(d){a[d]=b.bind(a[d],a)});
+return a};b.delay=function(a,c){var d=b.rest(arguments,2);return setTimeout(function(){return a.apply(a,d)},c)};b.defer=function(a){return b.delay.apply(b,[a,1].concat(b.rest(arguments)))};b.wrap=function(a,c){return function(){var d=[a].concat(b.toArray(arguments));return c.apply(c,d)}};b.compose=function(){var a=b.toArray(arguments);return function(){for(var c=b.toArray(arguments),d=a.length-1;d>=0;d--)c=[a[d].apply(this,c)];return c[0]}};b.keys=function(a){if(b.isArray(a))return b.range(0,a.length);
+var c=[];for(var d in a)q.call(a,d)&&c.push(d);return c};b.values=function(a){return b.map(a,b.identity)};b.functions=function(a){return b.select(b.keys(a),function(c){return b.isFunction(a[c])}).sort()};b.extend=function(a,c){for(var d in c)a[d]=c[d];return a};b.clone=function(a){if(b.isArray(a))return a.slice(0);return b.extend({},a)};b.tap=function(a,c){c(a);return a};b.isEqual=function(a,c){if(a===c)return true;var d=typeof a;if(d!=typeof c)return false;if(a==c)return true;if(!a&&c||a&&!c)return false;
+if(a.isEqual)return a.isEqual(c);if(b.isDate(a)&&b.isDate(c))return a.getTime()===c.getTime();if(b.isNaN(a)&&b.isNaN(c))return true;if(b.isRegExp(a)&&b.isRegExp(c))return a.source===c.source&&a.global===c.global&&a.ignoreCase===c.ignoreCase&&a.multiline===c.multiline;if(d!=="object")return false;if(a.length&&a.length!==c.length)return false;d=b.keys(a);var e=b.keys(c);if(d.length!=e.length)return false;for(var f in a)if(!b.isEqual(a[f],c[f]))return false;return true};b.isEmpty=function(a){return b.keys(a).length==
+0};b.isElement=function(a){return!!(a&&a.nodeType==1)};b.isArray=function(a){return!!(a&&a.concat&&a.unshift)};b.isArguments=function(a){return a&&b.isNumber(a.length)&&!b.isArray(a)&&!r.call(a,"length")};b.isFunction=function(a){return!!(a&&a.constructor&&a.call&&a.apply)};b.isString=function(a){return!!(a===""||a&&a.charCodeAt&&a.substr)};b.isNumber=function(a){return p.call(a)==="[object Number]"};b.isDate=function(a){return!!(a&&a.getTimezoneOffset&&a.setUTCFullYear)};b.isRegExp=function(a){return!!(a&&
+a.test&&a.exec&&(a.ignoreCase||a.ignoreCase===false))};b.isNaN=function(a){return b.isNumber(a)&&isNaN(a)};b.isNull=function(a){return a===null};b.isUndefined=function(a){return typeof a=="undefined"};b.noConflict=function(){j._=n;return this};b.identity=function(a){return a};b.breakLoop=function(){throw m;};var s=0;b.uniqueId=function(a){var c=s++;return a?a+c:c};b.template=function(a,c){a=new Function("obj","var p=[],print=function(){p.push.apply(p,arguments);};with(obj){p.push('"+a.replace(/[\r\t\n]/g,
+" ").replace(/'(?=[^%]*%>)/g,"\t").split("'").join("\\'").split("\t").join("'").replace(/<%=(.+?)%>/g,"',$1,'").split("<%").join("');").split("%>").join("p.push('")+"');}return p.join('');");return c?a(c):a};b.forEach=b.each;b.foldl=b.inject=b.reduce;b.foldr=b.reduceRight;b.filter=b.select;b.every=b.all;b.some=b.any;b.head=b.first;b.tail=b.rest;b.methods=b.functions;var l=function(a,c){return c?b(a).chain():a};b.each(b.functions(b),function(a){var c=b[a];i.prototype[a]=function(){var d=b.toArray(arguments);
+o.call(d,this._wrapped);return l(c.apply(b,d),this._chain)}});b.each(["pop","push","reverse","shift","sort","splice","unshift"],function(a){var c=Array.prototype[a];i.prototype[a]=function(){c.apply(this._wrapped,arguments);return l(this._wrapped,this._chain)}});b.each(["concat","join","slice"],function(a){var c=Array.prototype[a];i.prototype[a]=function(){return l(c.apply(this._wrapped,arguments),this._chain)}});i.prototype.chain=function(){this._chain=true;return this};i.prototype.value=function(){return this._wrapped}})();
diff --git a/sphinx/themes/default/static/default.css_t b/sphinx/themes/default/static/default.css_t
index 5f4a4c6f..42fc377f 100644
--- a/sphinx/themes/default/static/default.css_t
+++ b/sphinx/themes/default/static/default.css_t
@@ -1,6 +1,12 @@
-/**
- * Sphinx stylesheet -- default theme
- * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+/*
+ * default.css_t
+ * ~~~~~~~~~~~~~
+ *
+ * Sphinx stylesheet -- default theme.
+ *
+ * :copyright: Copyright 2007-2010 by the Sphinx team, see AUTHORS.
+ * :license: BSD, see LICENSE for details.
+ *
*/
@import url("basic.css");
@@ -148,6 +154,11 @@ a {
text-decoration: none;
}
+a:visited {
+ color: {{ theme_visitedlinkcolor }};
+ text-decoration: none;
+}
+
a:hover {
text-decoration: underline;
}
@@ -255,6 +266,10 @@ tt {
font-size: 0.95em;
}
+th {
+ background-color: #ede;
+}
+
.warning tt {
background: #efc2c2;
}
diff --git a/sphinx/themes/default/theme.conf b/sphinx/themes/default/theme.conf
index 812330f8..5035fae5 100644
--- a/sphinx/themes/default/theme.conf
+++ b/sphinx/themes/default/theme.conf
@@ -21,6 +21,7 @@ headbgcolor = #f2f2f2
headtextcolor = #20435c
headlinkcolor = #c60f0f
linkcolor = #355f7c
+visitedlinkcolor = #355f7c
codebgcolor = #eeffcc
codetextcolor = #333333
diff --git a/sphinx/themes/epub/layout.html b/sphinx/themes/epub/layout.html
new file mode 100644
index 00000000..8a348bed
--- /dev/null
+++ b/sphinx/themes/epub/layout.html
@@ -0,0 +1,16 @@
+{#
+ epub/layout.html
+ ~~~~~~~~~~~~~~~~
+
+ Sphinx layout template for the epub theme.
+
+ :copyright: Copyright 2007-2010 by the Sphinx team, see AUTHORS.
+ :license: BSD, see LICENSE for details.
+#}
+{% extends "basic/layout.html" %}
+
+{# add only basic navigation links #}
+{% block sidebar1 %}{% endblock %}
+{% block sidebar2 %}{% endblock %}
+{% block relbar2 %}{% endblock %}
+{% block linktags %}{% endblock %}
diff --git a/sphinx/themes/epub/static/epub.css b/sphinx/themes/epub/static/epub.css
new file mode 100644
index 00000000..c6320c8c
--- /dev/null
+++ b/sphinx/themes/epub/static/epub.css
@@ -0,0 +1,464 @@
+/*
+ * epub.css_t
+ * ~~~~~~~~~~
+ *
+ * Sphinx stylesheet -- epub theme.
+ *
+ * :copyright: Copyright 2007-2010 by the Sphinx team, see AUTHORS.
+ * :license: BSD, see LICENSE for details.
+ *
+ */
+
+/* -- main layout ----------------------------------------------------------- */
+
+div.clearer {
+ clear: both;
+}
+
+a:link, a:visited {
+ color: #3333ff;
+ text-decoration: underline;
+}
+
+img {
+ border: 0;
+}
+
+/* -- relbar ---------------------------------------------------------------- */
+
+div.related {
+ width: 100%;
+ font-family: sans-serif;
+ font-size: 90%;
+}
+
+div.related h3 {
+ display: none;
+}
+
+div.related ul {
+ margin: 0;
+ padding: 0 0 0 10px;
+ list-style: none;
+}
+
+div.related li {
+ display: inline;
+}
+
+div.related li.right {
+ float: right;
+ margin-right: 5px;
+}
+
+/* -- sidebar --------------------------------------------------------------- */
+
+div.sphinxsidebarwrapper {
+ padding: 10px 5px 0 10px;
+}
+
+div.sphinxsidebar {
+ float: left;
+ width: 230px;
+ margin-left: -100%;
+ font-size: 90%;
+}
+
+div.sphinxsidebar ul {
+ list-style: none;
+}
+
+div.sphinxsidebar ul ul,
+div.sphinxsidebar ul.want-points {
+ margin-left: 20px;
+ list-style: square;
+}
+
+div.sphinxsidebar ul ul {
+ margin-top: 0;
+ margin-bottom: 0;
+}
+
+div.sphinxsidebar form {
+ margin-top: 10px;
+}
+
+div.sphinxsidebar input {
+ border: 1px solid #98dbcc;
+ font-family: sans-serif;
+ font-size: 100%;
+}
+
+img {
+ border: 0;
+}
+
+/* -- search page ----------------------------------------------------------- */
+
+ul.search {
+ margin: 10px 0 0 20px;
+ padding: 0;
+}
+
+ul.search li {
+ padding: 5px 0 5px 20px;
+ background-image: url(file.png);
+ background-repeat: no-repeat;
+ background-position: 0 7px;
+}
+
+ul.search li a {
+ font-weight: bold;
+}
+
+ul.search li div.context {
+ color: #888;
+ margin: 2px 0 0 30px;
+ text-align: left;
+}
+
+ul.keywordmatches li.goodmatch a {
+ font-weight: bold;
+}
+
+/* -- index page ------------------------------------------------------------ */
+
+table.contentstable {
+ width: 90%;
+}
+
+table.contentstable p.biglink {
+ line-height: 150%;
+}
+
+a.biglink {
+ font-size: 130%;
+}
+
+span.linkdescr {
+ font-style: italic;
+ padding-top: 5px;
+ font-size: 90%;
+}
+
+/* -- general index --------------------------------------------------------- */
+
+table.indextable td {
+ text-align: left;
+ vertical-align: top;
+}
+
+table.indextable dl, table.indextable dd {
+ margin-top: 0;
+ margin-bottom: 0;
+}
+
+table.indextable tr.pcap {
+ height: 10px;
+}
+
+table.indextable tr.cap {
+ margin-top: 10px;
+ background-color: #f2f2f2;
+}
+
+img.toggler {
+ margin-right: 3px;
+ margin-top: 3px;
+ cursor: pointer;
+}
+
+/* -- general body styles --------------------------------------------------- */
+
+a.headerlink {
+ visibility: hidden;
+}
+
+div.body p.caption {
+ text-align: inherit;
+}
+
+div.body td {
+ text-align: left;
+}
+
+.field-list ul {
+ padding-left: 100%;
+}
+
+.first {
+ margin-top: 0 !important;
+}
+
+p.rubric {
+ margin-top: 30px;
+ font-weight: bold;
+}
+
+/* -- sidebars -------------------------------------------------------------- */
+
+div.sidebar {
+ margin: 0 0 0.5em 1em;
+ border: 1px solid #ddb;
+ padding: 7px 7px 0 7px;
+ background-color: #ffe;
+ width: 40%;
+ float: right;
+}
+
+p.sidebar-title {
+ font-weight: bold;
+}
+
+/* -- topics ---------------------------------------------------------------- */
+
+div.topic {
+ border: 1px solid #ccc;
+ padding: 7px 7px 0 7px;
+ margin: 10px 0 10px 0;
+}
+
+p.topic-title {
+ font-size: 110%;
+ font-weight: bold;
+ margin-top: 10px;
+}
+
+/* -- admonitions ----------------------------------------------------------- */
+
+div.admonition {
+ margin-top: 10px;
+ margin-bottom: 10px;
+ padding: 7px;
+}
+
+div.admonition dt {
+ font-weight: bold;
+}
+
+div.admonition dl {
+ margin-bottom: 0;
+}
+
+p.admonition-title {
+ margin: 0px 10px 5px 0px;
+ font-weight: bold;
+}
+
+div.body p.centered {
+ text-align: center;
+ margin-top: 25px;
+}
+
+/* -- tables ---------------------------------------------------------------- */
+
+table.docutils {
+ border: 0;
+ border-collapse: collapse;
+}
+
+table.docutils td, table.docutils th {
+ padding: 1px 8px 1px 5px;
+ border-top: 0;
+ border-left: 0;
+ border-right: 0;
+ border-bottom: 1px solid #aaa;
+}
+
+table.field-list td, table.field-list th {
+ border: 0 !important;
+}
+
+table.footnote td, table.footnote th {
+ border: 0 !important;
+}
+
+th {
+ text-align: left;
+ padding-right: 5px;
+}
+
+/* -- other body styles ----------------------------------------------------- */
+
+dl {
+ margin-bottom: 15px;
+}
+
+dd p {
+ margin-top: 0px;
+}
+
+dd ul, dd table {
+ margin-bottom: 10px;
+}
+
+dd {
+ margin-top: 3px;
+ margin-bottom: 10px;
+ margin-left: 30px;
+}
+
+dt:target, .highlight {
+ background-color: #ddd;
+}
+
+dl.glossary dt {
+ font-weight: bold;
+ font-size: 110%;
+}
+
+.field-list ul {
+ margin: 0;
+ padding-left: 1em;
+}
+
+.field-list p {
+ margin: 0;
+}
+
+.refcount {
+ color: #060;
+}
+
+.optional {
+ font-size: 130%;
+}
+
+.versionmodified {
+ font-style: italic;
+}
+
+.system-message {
+ background-color: #fda;
+ padding: 5px;
+ border: 3px solid red;
+}
+
+.footnote:target {
+ background-color: #dddddd;
+}
+
+/* -- code displays --------------------------------------------------------- */
+
+pre {
+ font-family: "LiberationNarrow", monospace;
+ overflow: auto;
+}
+
+td.linenos pre {
+ padding: 5px 0px;
+ border: 0;
+ background-color: transparent;
+ color: #aaa;
+}
+
+table.highlighttable {
+ margin-left: 0.5em;
+}
+
+table.highlighttable td {
+ padding: 0 0.5em 0 0.5em;
+}
+
+tt {
+ font-family: "LiberationNarrow", monospace;
+}
+
+tt.descname {
+ background-color: transparent;
+ font-weight: bold;
+ font-size: 1.2em;
+}
+
+tt.descclassname {
+ background-color: transparent;
+}
+
+tt.xref, a tt {
+ background-color: transparent;
+ font-weight: bold;
+}
+
+h1 tt, h2 tt, h3 tt, h4 tt, h5 tt, h6 tt {
+ background-color: transparent;
+}
+
+/* -- math display ---------------------------------------------------------- */
+
+img.math {
+ vertical-align: middle;
+}
+
+div.body div.math p {
+ text-align: center;
+}
+
+span.eqno {
+ float: right;
+}
+
+/* -- special divs --------------------------------------------------------- */
+
+div.quotebar {
+ background-color: #e3eff1;
+ max-width: 250px;
+ float: right;
+ font-family: sans-serif;
+ padding: 7px 7px;
+ border: 1px solid #ccc;
+}
+div.footer {
+ background-color: #e3eff1;
+ padding: 3px 8px 3px 0;
+ clear: both;
+ font-family: sans-serif;
+ font-size: 80%;
+ text-align: right;
+}
+
+div.footer a {
+ text-decoration: underline;
+}
+
+/* -- link-target ----------------------------------------------------------- */
+
+.link-target {
+ font-size: 80%;
+}
+
+table .link-target {
+ /* Do not show links in tables, there is not enough space */
+ display: none;
+}
+
+/* -- font-face ------------------------------------------------------------- */
+
+@font-face {
+ font-family: "LiberationNarrow";
+ font-style: normal;
+ font-weight: normal;
+ src: url("res:///Data/fonts/LiberationNarrow-Regular.otf")
+ format("opentype");
+}
+@font-face {
+ font-family: "LiberationNarrow";
+ font-style: oblique, italic;
+ font-weight: normal;
+ src: url("res:///Data/fonts/LiberationNarrow-Italic.otf")
+ format("opentype");
+}
+@font-face {
+ font-family: "LiberationNarrow";
+ font-style: normal;
+ font-weight: bold;
+ src: url("res:///Data/fonts/LiberationNarrow-Bold.otf")
+ format("opentype");
+}
+@font-face {
+ font-family: "LiberationNarrow";
+ font-style: oblique, italic;
+ font-weight: bold;
+ src: url("res:///Data/fonts/LiberationNarrow-BoldItalic.otf")
+ format("opentype");
+}
+
diff --git a/sphinx/themes/epub/theme.conf b/sphinx/themes/epub/theme.conf
new file mode 100644
index 00000000..d5806ec5
--- /dev/null
+++ b/sphinx/themes/epub/theme.conf
@@ -0,0 +1,4 @@
+[theme]
+inherit = basic
+stylesheet = epub.css
+pygments_style = none
diff --git a/sphinx/themes/haiku/layout.html b/sphinx/themes/haiku/layout.html
new file mode 100644
index 00000000..91c76852
--- /dev/null
+++ b/sphinx/themes/haiku/layout.html
@@ -0,0 +1,68 @@
+{#
+ haiku/layout.html
+ ~~~~~~~~~~~~~~~~~
+
+ Sphinx layout template for the haiku theme.
+
+ :copyright: Copyright 2007-2010 by the Sphinx team, see AUTHORS.
+ :license: BSD, see LICENSE for details.
+#}
+{% extends "basic/layout.html" %}
+{% set script_files = script_files + ['_static/theme_extras.js'] %}
+{% set css_files = css_files + ['_static/print.css'] %}
+
+{# do not display relbars #}
+{% block relbar1 %}{% endblock %}
+{% block relbar2 %}{% endblock %}
+
+{% macro nav() %}
+ <p>
+ {%- block haikurel1 %}
+ {%- endblock %}
+ {%- if prev %}
+ «&#160;&#160;<a href="{{ prev.link|e }}">{{ prev.title }}</a>
+ &#160;&#160;::&#160;&#160;
+ {%- endif %}
+ <a class="uplink" href="{{ pathto(master_doc) }}">{{ _('Contents') }}</a>
+ {%- if next %}
+ &#160;&#160;::&#160;&#160;
+ <a href="{{ next.link|e }}">{{ next.title }}</a>&#160;&#160;»
+ {%- endif %}
+ {%- block haikurel2 %}
+ {%- endblock %}
+ </p>
+{% endmacro %}
+
+{% block content %}
+ <div class="header">
+ {%- block haikuheader %}
+ {%- if theme_full_logo != "false" %}
+ <a href="{{ pathto('index') }}">
+ <img class="logo" src="{{ pathto('_static/' + logo, 1) }}" alt="Logo"/>
+ </a>
+ {%- else %}
+ {%- if logo -%}
+ <img class="rightlogo" src="{{ pathto('_static/' + logo, 1) }}" alt="Logo"/>
+ {%- endif -%}
+ <h1 class="heading"><a href="{{ pathto('index') }}">
+ <span>{{ shorttitle|e }}</span></a></h1>
+ <h2 class="heading"><span>{{ title|striptags }}</span></h2>
+ {%- endif %}
+ {%- endblock %}
+ </div>
+ <div class="topnav">
+ {{ nav() }}
+ </div>
+ <div class="content">
+ {#{%- if display_toc %}
+ <div id="toc">
+ <h3>Table Of Contents</h3>
+ {{ toc }}
+ </div>
+ {%- endif %}#}
+ {% block body %}{% endblock %}
+ </div>
+ <div class="bottomnav">
+ {{ nav() }}
+ </div>
+{% endblock %} \ No newline at end of file
diff --git a/sphinx/themes/haiku/static/alert_info_32.png b/sphinx/themes/haiku/static/alert_info_32.png
new file mode 100644
index 00000000..05b4fe89
--- /dev/null
+++ b/sphinx/themes/haiku/static/alert_info_32.png
Binary files differ
diff --git a/sphinx/themes/haiku/static/alert_warning_32.png b/sphinx/themes/haiku/static/alert_warning_32.png
new file mode 100644
index 00000000..f13611cd
--- /dev/null
+++ b/sphinx/themes/haiku/static/alert_warning_32.png
Binary files differ
diff --git a/sphinx/themes/haiku/static/bg-page.png b/sphinx/themes/haiku/static/bg-page.png
new file mode 100644
index 00000000..c6f3bc47
--- /dev/null
+++ b/sphinx/themes/haiku/static/bg-page.png
Binary files differ
diff --git a/sphinx/themes/haiku/static/bullet_orange.png b/sphinx/themes/haiku/static/bullet_orange.png
new file mode 100644
index 00000000..ad5d02f3
--- /dev/null
+++ b/sphinx/themes/haiku/static/bullet_orange.png
Binary files differ
diff --git a/sphinx/themes/haiku/static/haiku.css_t b/sphinx/themes/haiku/static/haiku.css_t
new file mode 100644
index 00000000..7adfb0f3
--- /dev/null
+++ b/sphinx/themes/haiku/static/haiku.css_t
@@ -0,0 +1,359 @@
+/*
+ * haiku.css_t
+ * ~~~~~~~~~~~
+ *
+ * Sphinx stylesheet -- haiku theme.
+ *
+ * Adapted from http://haiku-os.org/docs/Haiku-doc.css.
+ * Original copyright message:
+ *
+ * Copyright 2008-2009, Haiku. All rights reserved.
+ * Distributed under the terms of the MIT License.
+ *
+ * Authors:
+ * Francois Revol <revol@free.fr>
+ * Stephan Assmus <superstippi@gmx.de>
+ * Braden Ewing <brewin@gmail.com>
+ * Humdinger <humdingerb@gmail.com>
+ *
+ * :copyright: Copyright 2007-2010 by the Sphinx team, see AUTHORS.
+ * :license: BSD, see LICENSE for details.
+ *
+ */
+
+@import url("basic.css");
+
+html {
+ margin: 0px;
+ padding: 0px;
+ background: #FFF url(bg-page.png) top left repeat-x;
+}
+
+body {
+ line-height: 1.5;
+ margin: auto;
+ padding: 0px;
+ font-family: "DejaVu Sans", Arial, Helvetica, sans-serif;
+ min-width: 59em;
+ max-width: 70em;
+ color: {{ theme_textcolor }};
+}
+
+div.footer {
+ padding: 8px;
+ font-size: 11px;
+ text-align: center;
+ letter-spacing: 0.5px;
+}
+
+/* link colors and text decoration */
+
+a:link {
+ font-weight: bold;
+ text-decoration: none;
+ color: {{ theme_linkcolor }};
+}
+
+a:visited {
+ font-weight: bold;
+ text-decoration: none;
+ color: {{ theme_visitedlinkcolor }};
+}
+
+a:hover, a:active {
+ text-decoration: underline;
+ color: {{ theme_hoverlinkcolor }};
+}
+
+/* Some headers act as anchors, don't give them a hover effect */
+
+h1 a:hover, a:active {
+ text-decoration: none;
+ color: {{ theme_headingcolor }};
+}
+
+h2 a:hover, a:active {
+ text-decoration: none;
+ color: {{ theme_headingcolor }};
+}
+
+h3 a:hover, a:active {
+ text-decoration: none;
+ color: {{ theme_headingcolor }};
+}
+
+h4 a:hover, a:active {
+ text-decoration: none;
+ color: {{ theme_headingcolor }};
+}
+
+a.headerlink {
+ color: #a7ce38;
+ padding-left: 5px;
+}
+
+a.headerlink:hover {
+ color: #a7ce38;
+}
+
+/* basic text elements */
+
+div.content {
+ margin-top: 20px;
+ margin-left: 40px;
+ margin-right: 40px;
+ margin-bottom: 50px;
+ font-size: 0.9em;
+}
+
+/* heading and navigation */
+
+div.header {
+ position: relative;
+ left: 0px;
+ top: 0px;
+ height: 85px;
+ /* background: #eeeeee; */
+ padding: 0 40px;
+}
+div.header h1 {
+ font-size: 1.6em;
+ font-weight: normal;
+ letter-spacing: 1px;
+ color: {{ theme_headingcolor }};
+ border: 0;
+ margin: 0;
+ padding-top: 15px;
+}
+div.header h1 a {
+ font-weight: normal;
+ color: {{ theme_headingcolor }};
+}
+div.header h2 {
+ font-size: 1.3em;
+ font-weight: normal;
+ letter-spacing: 1px;
+ text-transform: uppercase;
+ color: #aaa;
+ border: 0;
+ margin-top: -3px;
+ padding: 0;
+}
+
+div.header img.rightlogo {
+ float: right;
+}
+
+
+div.title {
+ font-size: 1.3em;
+ font-weight: bold;
+ color: {{ theme_headingcolor }};
+ border-bottom: dotted thin #e0e0e0;
+ margin-bottom: 25px;
+}
+div.topnav {
+ /* background: #e0e0e0; */
+}
+div.topnav p {
+ margin-top: 0;
+ margin-left: 40px;
+ margin-right: 40px;
+ margin-bottom: 0px;
+ text-align: right;
+ font-size: 0.8em;
+}
+div.bottomnav {
+ background: #eeeeee;
+}
+div.bottomnav p {
+ margin-right: 40px;
+ text-align: right;
+ font-size: 0.8em;
+}
+
+a.uplink {
+ font-weight: normal;
+}
+
+
+/* contents box */
+
+table.index {
+ margin: 0px 0px 30px 30px;
+ padding: 1px;
+ border-width: 1px;
+ border-style: dotted;
+ border-color: #e0e0e0;
+}
+table.index tr.heading {
+ background-color: #e0e0e0;
+ text-align: center;
+ font-weight: bold;
+ font-size: 1.1em;
+}
+table.index tr.index {
+ background-color: #eeeeee;
+}
+table.index td {
+ padding: 5px 20px;
+}
+
+table.index a:link, table.index a:visited {
+ font-weight: normal;
+ text-decoration: none;
+ color: {{ theme_linkcolor }};
+}
+table.index a:hover, table.index a:active {
+ text-decoration: underline;
+ color: {{ theme_hoverlinkcolor }};
+}
+
+
+/* Haiku User Guide styles and layout */
+
+/* Rounded corner boxes */
+/* Common declarations */
+div.admonition {
+ -webkit-border-radius: 10px;
+ -khtml-border-radius: 10px;
+ -moz-border-radius: 10px;
+ border-radius: 10px;
+ border-style: dotted;
+ border-width: thin;
+ border-color: #dcdcdc;
+ padding: 10px 15px 10px 15px;
+ margin-bottom: 15px;
+ margin-top: 15px;
+}
+div.note {
+ padding: 10px 15px 10px 80px;
+ background: #e4ffde url(alert_info_32.png) 15px 15px no-repeat;
+ min-height: 42px;
+}
+div.warning {
+ padding: 10px 15px 10px 80px;
+ background: #fffbc6 url(alert_warning_32.png) 15px 15px no-repeat;
+ min-height: 42px;
+}
+div.seealso {
+ background: #e4ffde;
+}
+
+/* More layout and styles */
+h1 {
+ font-size: 1.3em;
+ font-weight: bold;
+ color: {{ theme_headingcolor }};
+ border-bottom: dotted thin #e0e0e0;
+ margin-top: 30px;
+}
+
+h2 {
+ font-size: 1.2em;
+ font-weight: normal;
+ color: {{ theme_headingcolor }};
+ border-bottom: dotted thin #e0e0e0;
+ margin-top: 30px;
+}
+
+h3 {
+ font-size: 1.1em;
+ font-weight: normal;
+ color: {{ theme_headingcolor }};
+ margin-top: 30px;
+}
+
+h4 {
+ font-size: 1.0em;
+ font-weight: normal;
+ color: {{ theme_headingcolor }};
+ margin-top: 30px;
+}
+
+p {
+ text-align: justify;
+}
+
+p.last {
+ margin-bottom: 0;
+}
+
+ol {
+ padding-left: 20px;
+}
+
+ul {
+ padding-left: 5px;
+ margin-top: 3px;
+}
+
+li {
+ line-height: 1.3;
+}
+
+div.content li {
+ -moz-background-clip:border;
+ -moz-background-inline-policy:continuous;
+ -moz-background-origin:padding;
+ background: transparent url(bullet_orange.png) no-repeat scroll left 0.45em;
+ list-style-image: none;
+ list-style-type: none;
+ padding: 0 0 0 1.666em;
+ margin-bottom: 3px;
+}
+
+td {
+ vertical-align: top;
+}
+
+tt {
+ background-color: #e2e2e2;
+ font-size: 1.0em;
+ font-family: monospace;
+}
+
+pre {
+ border-color: #0c3762;
+ border-style: dotted;
+ border-width: thin;
+ margin: 0 0 12px 0;
+ padding: 0.8em;
+ background-color: #f0f0f0;
+}
+
+hr {
+ border-top: 1px solid #ccc;
+ border-bottom: 0;
+ border-right: 0;
+ border-left: 0;
+ margin-bottom: 10px;
+ margin-top: 20px;
+}
+
+/* printer only pretty stuff */
+@media print {
+ .noprint {
+ display: none;
+ }
+ /* for acronyms we want their definitions inlined at print time */
+ acronym[title]:after {
+ font-size: small;
+ content: " (" attr(title) ")";
+ font-style: italic;
+ }
+ /* and not have mozilla dotted underline */
+ acronym {
+ border: none;
+ }
+ div.topnav, div.bottomnav, div.header, table.index {
+ display: none;
+ }
+ div.content {
+ margin: 0px;
+ padding: 0px;
+ }
+ html {
+ background: #FFF;
+ }
+}
diff --git a/sphinx/themes/haiku/theme.conf b/sphinx/themes/haiku/theme.conf
new file mode 100644
index 00000000..3537da1d
--- /dev/null
+++ b/sphinx/themes/haiku/theme.conf
@@ -0,0 +1,12 @@
+[theme]
+inherit = basic
+stylesheet = haiku.css
+pygments_style = autumn
+
+[options]
+full_logo = false
+textcolor = #333333
+headingcolor = #0c3762
+linkcolor = #dc3c01
+visitedlinkcolor = #892601
+hoverlinkcolor = #ff4500
diff --git a/sphinx/themes/nature/static/nature.css_t b/sphinx/themes/nature/static/nature.css_t
new file mode 100644
index 00000000..5991e349
--- /dev/null
+++ b/sphinx/themes/nature/static/nature.css_t
@@ -0,0 +1,235 @@
+/*
+ * nature.css_t
+ * ~~~~~~~~~~~~
+ *
+ * Sphinx stylesheet -- nature theme.
+ *
+ * :copyright: Copyright 2007-2010 by the Sphinx team, see AUTHORS.
+ * :license: BSD, see LICENSE for details.
+ *
+ */
+
+@import url("basic.css");
+
+/* -- page layout ----------------------------------------------------------- */
+
+body {
+ font-family: Arial, sans-serif;
+ font-size: 100%;
+ background-color: #111;
+ color: #555;
+ margin: 0;
+ padding: 0;
+}
+
+div.documentwrapper {
+ float: left;
+ width: 100%;
+}
+
+div.bodywrapper {
+ margin: 0 0 0 230px;
+}
+
+hr {
+ border: 1px solid #B1B4B6;
+}
+
+div.document {
+ background-color: #eee;
+}
+
+div.body {
+ background-color: #ffffff;
+ color: #3E4349;
+ padding: 0 30px 30px 30px;
+ font-size: 0.9em;
+}
+
+div.footer {
+ color: #555;
+ width: 100%;
+ padding: 13px 0;
+ text-align: center;
+ font-size: 75%;
+}
+
+div.footer a {
+ color: #444;
+ text-decoration: underline;
+}
+
+div.related {
+ background-color: #6BA81E;
+ line-height: 32px;
+ color: #fff;
+ text-shadow: 0px 1px 0 #444;
+ font-size: 0.9em;
+}
+
+div.related a {
+ color: #E2F3CC;
+}
+
+div.sphinxsidebar {
+ font-size: 0.75em;
+ line-height: 1.5em;
+}
+
+div.sphinxsidebarwrapper{
+ padding: 20px 0;
+}
+
+div.sphinxsidebar h3,
+div.sphinxsidebar h4 {
+ font-family: Arial, sans-serif;
+ color: #222;
+ font-size: 1.2em;
+ font-weight: normal;
+ margin: 0;
+ padding: 5px 10px;
+ background-color: #ddd;
+ text-shadow: 1px 1px 0 white
+}
+
+div.sphinxsidebar h4{
+ font-size: 1.1em;
+}
+
+div.sphinxsidebar h3 a {
+ color: #444;
+}
+
+
+div.sphinxsidebar p {
+ color: #888;
+ padding: 5px 20px;
+}
+
+div.sphinxsidebar p.topless {
+}
+
+div.sphinxsidebar ul {
+ margin: 10px 20px;
+ padding: 0;
+ color: #000;
+}
+
+div.sphinxsidebar a {
+ color: #444;
+}
+
+div.sphinxsidebar input {
+ border: 1px solid #ccc;
+ font-family: sans-serif;
+ font-size: 1em;
+}
+
+div.sphinxsidebar input[type=text]{
+ margin-left: 20px;
+}
+
+/* -- body styles ----------------------------------------------------------- */
+
+a {
+ color: #005B81;
+ text-decoration: none;
+}
+
+a:hover {
+ color: #E32E00;
+ text-decoration: underline;
+}
+
+div.body h1,
+div.body h2,
+div.body h3,
+div.body h4,
+div.body h5,
+div.body h6 {
+ font-family: Arial, sans-serif;
+ background-color: #BED4EB;
+ font-weight: normal;
+ color: #212224;
+ margin: 30px 0px 10px 0px;
+ padding: 5px 0 5px 10px;
+ text-shadow: 0px 1px 0 white
+}
+
+div.body h1 { border-top: 20px solid white; margin-top: 0; font-size: 200%; }
+div.body h2 { font-size: 150%; background-color: #C8D5E3; }
+div.body h3 { font-size: 120%; background-color: #D8DEE3; }
+div.body h4 { font-size: 110%; background-color: #D8DEE3; }
+div.body h5 { font-size: 100%; background-color: #D8DEE3; }
+div.body h6 { font-size: 100%; background-color: #D8DEE3; }
+
+a.headerlink {
+ color: #c60f0f;
+ font-size: 0.8em;
+ padding: 0 4px 0 4px;
+ text-decoration: none;
+}
+
+a.headerlink:hover {
+ background-color: #c60f0f;
+ color: white;
+}
+
+div.body p, div.body dd, div.body li {
+ line-height: 1.5em;
+}
+
+div.admonition p.admonition-title + p {
+ display: inline;
+}
+
+div.highlight{
+ background-color: white;
+}
+
+div.note {
+ background-color: #eee;
+ border: 1px solid #ccc;
+}
+
+div.seealso {
+ background-color: #ffc;
+ border: 1px solid #ff6;
+}
+
+div.topic {
+ background-color: #eee;
+}
+
+div.warning {
+ background-color: #ffe4e4;
+ border: 1px solid #f66;
+}
+
+p.admonition-title {
+ display: inline;
+}
+
+p.admonition-title:after {
+ content: ":";
+}
+
+pre {
+ padding: 10px;
+ background-color: White;
+ color: #222;
+ line-height: 1.2em;
+ border: 1px solid #C6C9CB;
+ font-size: 1.1em;
+ margin: 1.5em 0 1.5em 0;
+ -webkit-box-shadow: 1px 1px 1px #d8d8d8;
+ -moz-box-shadow: 1px 1px 1px #d8d8d8;
+}
+
+tt {
+ background-color: #ecf0f3;
+ color: #222;
+ /* padding: 1px 2px; */
+ font-size: 1.1em;
+ font-family: monospace;
+}
diff --git a/sphinx/themes/nature/theme.conf b/sphinx/themes/nature/theme.conf
new file mode 100644
index 00000000..1cc40044
--- /dev/null
+++ b/sphinx/themes/nature/theme.conf
@@ -0,0 +1,4 @@
+[theme]
+inherit = basic
+stylesheet = nature.css
+pygments_style = tango
diff --git a/sphinx/themes/scrolls/artwork/logo.svg b/sphinx/themes/scrolls/artwork/logo.svg
new file mode 100644
index 00000000..0907a4ea
--- /dev/null
+++ b/sphinx/themes/scrolls/artwork/logo.svg
@@ -0,0 +1,107 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<!-- Created with Inkscape (http://www.inkscape.org/) -->
+<svg
+ xmlns:dc="http://purl.org/dc/elements/1.1/"
+ xmlns:cc="http://creativecommons.org/ns#"
+ xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
+ xmlns:svg="http://www.w3.org/2000/svg"
+ xmlns="http://www.w3.org/2000/svg"
+ xmlns:xlink="http://www.w3.org/1999/xlink"
+ xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
+ xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
+ width="200"
+ height="80"
+ id="svg2766"
+ sodipodi:version="0.32"
+ inkscape:version="0.46"
+ version="1.0"
+ sodipodi:docname="logo.svg"
+ inkscape:output_extension="org.inkscape.output.svg.inkscape">
+ <defs
+ id="defs2768">
+ <linearGradient
+ id="linearGradient6558">
+ <stop
+ style="stop-color:#575757;stop-opacity:1;"
+ offset="0"
+ id="stop6560" />
+ <stop
+ style="stop-color:#2f2f2f;stop-opacity:1;"
+ offset="1"
+ id="stop6562" />
+ </linearGradient>
+ <inkscape:perspective
+ sodipodi:type="inkscape:persp3d"
+ inkscape:vp_x="0 : 526.18109 : 1"
+ inkscape:vp_y="0 : 1000 : 0"
+ inkscape:vp_z="744.09448 : 526.18109 : 1"
+ inkscape:persp3d-origin="372.04724 : 350.78739 : 1"
+ id="perspective2774" />
+ <radialGradient
+ inkscape:collect="always"
+ xlink:href="#linearGradient6558"
+ id="radialGradient2797"
+ gradientUnits="userSpaceOnUse"
+ gradientTransform="matrix(0.7160081,0,0,0.6767021,-34.98413,-3.3035294e-2)"
+ cx="61.297766"
+ cy="60.910986"
+ fx="61.297766"
+ fy="60.910986"
+ r="44.688254" />
+ </defs>
+ <sodipodi:namedview
+ id="base"
+ pagecolor="#ffffff"
+ bordercolor="#666666"
+ borderopacity="1.0"
+ gridtolerance="10000"
+ guidetolerance="10"
+ objecttolerance="10"
+ inkscape:pageopacity="0.0"
+ inkscape:pageshadow="2"
+ inkscape:zoom="6.1848684"
+ inkscape:cx="95.923838"
+ inkscape:cy="34.518668"
+ inkscape:document-units="px"
+ inkscape:current-layer="layer1"
+ showgrid="false"
+ inkscape:window-width="1440"
+ inkscape:window-height="852"
+ inkscape:window-x="0"
+ inkscape:window-y="0" />
+ <metadata
+ id="metadata2771">
+ <rdf:RDF>
+ <cc:Work
+ rdf:about="">
+ <dc:format>image/svg+xml</dc:format>
+ <dc:type
+ rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
+ </cc:Work>
+ </rdf:RDF>
+ </metadata>
+ <g
+ inkscape:label="Layer 1"
+ inkscape:groupmode="layer"
+ id="layer1">
+ <path
+ style="opacity:1;fill:url(#radialGradient2797);fill-opacity:1;fill-rule:evenodd;stroke:#323232;stroke-width:0.71600807000000000;stroke-linecap:butt;stroke-linejoin:miter;marker:none;marker-start:none;marker-mid:none;marker-end:none;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
+ d="M 72.4375 8.6875 L 3.0625 18.71875 L 20.84375 29.0625 L 20.6875 44.09375 L 7.75 36.1875 L 8.40625 71.75 L 17.125 65.625 L 29.09375 67.5625 L 33.15625 39.90625 L 25.875 43.78125 L 26.1875 33.59375 L 46.875 31.34375 L 47.21875 42.96875 L 39.28125 40.5625 L 42.6875 67.71875 L 52.375 66.75 L 60.3125 71.75 L 62.90625 33.4375 L 53.03125 43.625 L 53.03125 28.25 L 72.4375 8.6875 z M 48.03125 22.125 L 47.0625 26.46875 L 28.46875 28.09375 L 28.46875 25.1875 L 48.03125 22.125 z M 58.375 45.0625 L 57.40625 62.875 L 51.40625 60.59375 L 45.90625 61.71875 L 43 46.21875 L 53.84375 49.9375 L 58.375 45.0625 z M 12.125 46.53125 L 22 49.75 L 26.53125 47.03125 L 25.21875 62.0625 L 16.96875 60.4375 L 12.125 63.65625 L 12.125 46.53125 z "
+ id="path2783" />
+ <path
+ style="opacity:1;fill:#e7eef6;fill-opacity:1;fill-rule:nonzero;stroke:#e1e8f3;stroke-width:0.52748101999999997;stroke-linecap:butt;stroke-linejoin:round;marker:none;marker-start:none;marker-mid:none;marker-end:none;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
+ d="M 75.632462,22.265877 L 64.489624,64.880679 L 92.7889,40.941187 L 91.373937,61.872575 L 128.87048,23.519253 L 116.84328,58.36312 L 144.25821,44.450641 L 145.49631,65.632704 L 169.02007,38.183758 L 170.78877,60.493861 L 193.07447,18.631085 L 176.09491,36.554369 L 176.44864,19.633786 L 152.0405,44.701316 L 156.81601,27.655396 L 128.87048,44.325304 L 137.00652,14.494942 L 99.863721,44.325304 L 100.74807,27.028707 L 76.163076,45.829355 L 75.632462,22.265877 z"
+ id="path2804" />
+ <text
+ xml:space="preserve"
+ style="font-size:12px;font-style:normal;font-weight:normal;opacity:1;fill:#1752b4;fill-opacity:1;fill-rule:nonzero;stroke:#28437f;stroke-width:0.71600807000000000;stroke-linecap:butt;stroke-linejoin:miter;marker:none;marker-start:none;marker-mid:none;marker-end:none;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;visibility:visible;display:inline;overflow:visible;enable-background:accumulate;font-family:Bitstream Vera Sans"
+ x="68.40242"
+ y="54.03759"
+ id="text2800"><tspan
+ sodipodi:role="line"
+ id="tspan2802"
+ x="68.40242"
+ y="54.03759"
+ style="font-size:36px;fill:#1752b4;fill-opacity:1;fill-rule:nonzero;stroke:#28437f;stroke-width:0.71600807000000000;stroke-linecap:butt;stroke-linejoin:miter;marker:none;marker-start:none;marker-mid:none;marker-end:none;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;visibility:visible;display:inline;overflow:visible;enable-background:accumulate">Project</tspan></text>
+ </g>
+</svg>
diff --git a/sphinx/themes/scrolls/layout.html b/sphinx/themes/scrolls/layout.html
new file mode 100644
index 00000000..9c139b88
--- /dev/null
+++ b/sphinx/themes/scrolls/layout.html
@@ -0,0 +1,42 @@
+{#
+ scrolls/layout.html
+ ~~~~~~~~~~~~~~~~~~~
+
+ Sphinx layout template for the scrolls theme, originally written
+ by Armin Ronacher.
+
+ :copyright: Copyright 2007-2010 by the Sphinx team, see AUTHORS.
+ :license: BSD, see LICENSE for details.
+#}
+{% extends "basic/layout.html" %}
+{% set script_files = script_files + ['_static/theme_extras.js'] %}
+{% set css_files = css_files + ['_static/print.css'] %}
+{# do not display relbars #}
+{% block relbar1 %}{% endblock %}
+{% block relbar2 %}{% endblock %}
+{% block content %}
+ <div id="content">
+ <div class="header">
+ <h1 class="heading"><a href="{{ pathto('index') }}"
+ title="back to the documentation overview"><span>{{ title|striptags }}</span></a></h1>
+ </div>
+ <div class="relnav">
+ {%- if prev %}
+ <a href="{{ prev.link|e }}">&laquo; {{ prev.title }}</a> |
+ {%- endif %}
+ <a href="{{ pathto(current_page_name) if current_page_name else '#' }}">{{ title }}</a>
+ {%- if next %}
+ | <a href="{{ next.link|e }}">{{ next.title }} &raquo;</a>
+ {%- endif %}
+ </div>
+ <div id="contentwrapper">
+ {%- if display_toc %}
+ <div id="toc">
+ <h3>Table Of Contents</h3>
+ {{ toc }}
+ </div>
+ {%- endif %}
+ {% block body %}{% endblock %}
+ </div>
+ </div>
+{% endblock %} \ No newline at end of file
diff --git a/sphinx/themes/scrolls/static/darkmetal.png b/sphinx/themes/scrolls/static/darkmetal.png
new file mode 100644
index 00000000..e8c9ff62
--- /dev/null
+++ b/sphinx/themes/scrolls/static/darkmetal.png
Binary files differ
diff --git a/sphinx/themes/scrolls/static/headerbg.png b/sphinx/themes/scrolls/static/headerbg.png
new file mode 100644
index 00000000..0c5b3657
--- /dev/null
+++ b/sphinx/themes/scrolls/static/headerbg.png
Binary files differ
diff --git a/sphinx/themes/scrolls/static/logo.png b/sphinx/themes/scrolls/static/logo.png
new file mode 100644
index 00000000..d1961cf0
--- /dev/null
+++ b/sphinx/themes/scrolls/static/logo.png
Binary files differ
diff --git a/sphinx/themes/scrolls/static/metal.png b/sphinx/themes/scrolls/static/metal.png
new file mode 100644
index 00000000..97166f13
--- /dev/null
+++ b/sphinx/themes/scrolls/static/metal.png
Binary files differ
diff --git a/sphinx/themes/scrolls/static/navigation.png b/sphinx/themes/scrolls/static/navigation.png
new file mode 100644
index 00000000..1e248d4d
--- /dev/null
+++ b/sphinx/themes/scrolls/static/navigation.png
Binary files differ
diff --git a/sphinx/themes/scrolls/static/print.css b/sphinx/themes/scrolls/static/print.css
new file mode 100644
index 00000000..fb633d87
--- /dev/null
+++ b/sphinx/themes/scrolls/static/print.css
@@ -0,0 +1,5 @@
+div.header, div.relnav, #toc { display: none; }
+#contentwrapper { padding: 0; margin: 0; border: none; }
+body { color: black; background-color: white; }
+div.footer { border-top: 1px solid #888; color: #888; margin-top: 1cm; }
+div.footer a { text-decoration: none; }
diff --git a/sphinx/themes/scrolls/static/scrolls.css_t b/sphinx/themes/scrolls/static/scrolls.css_t
new file mode 100644
index 00000000..41a725a6
--- /dev/null
+++ b/sphinx/themes/scrolls/static/scrolls.css_t
@@ -0,0 +1,414 @@
+/*
+ * scrolls.css_t
+ * ~~~~~~~~~~~~~
+ *
+ * Sphinx stylesheet -- scrolls theme.
+ *
+ * :copyright: Copyright 2007-2010 by the Sphinx team, see AUTHORS.
+ * :license: BSD, see LICENSE for details.
+ *
+ */
+
+body {
+ background-color: #222;
+ margin: 0;
+ padding: 0;
+ font-family: 'Georgia', serif;
+ font-size: 15px;
+ color: #eee;
+}
+
+div.footer {
+ border-top: 1px solid #111;
+ padding: 8px;
+ font-size: 11px;
+ text-align: center;
+ letter-spacing: 0.5px;
+}
+
+div.footer a {
+ color: #eee;
+}
+
+div.header {
+ margin: 0 -15px 0 -15px;
+ background: url(headerbg.png) repeat-x;
+ border-top: 6px solid {{ theme_headerbordercolor }};
+}
+
+div.relnav {
+ border-bottom: 1px solid #111;
+ background: url(navigation.png);
+ margin: 0 -15px 0 -15px;
+ padding: 2px 20px 0 28px;
+ line-height: 25px;
+ color: #aaa;
+ font-size: 12px;
+ text-align: center;
+}
+
+div.relnav a {
+ color: #eee;
+ font-weight: bold;
+ text-decoration: none;
+}
+
+div.relnav a:hover {
+ text-decoration: underline;
+}
+
+#content {
+ background-color: white;
+ color: #111;
+ border-bottom: 1px solid black;
+ background: url(watermark.png) center 0;
+ padding: 0 15px 0 15px;
+ margin: 0;
+}
+
+h1 {
+ margin: 0;
+ padding: 15px 0 0 0;
+}
+
+h1.heading {
+ margin: 0;
+ padding: 0;
+ height: 80px;
+}
+
+h1.heading:hover {
+ background: #222;
+}
+
+h1.heading a {
+ background: url({{ logo if logo else 'logo.png' }}) no-repeat center 0;
+ display: block;
+ width: 100%;
+ height: 80px;
+}
+
+h1.heading a:focus {
+ -moz-outline: none;
+ outline: none;
+}
+
+h1.heading span {
+ display: none;
+}
+
+#contentwrapper {
+ max-width: 680px;
+ padding: 0 18px 20px 18px;
+ margin: 0 auto 0 auto;
+ border-right: 1px solid #eee;
+ border-left: 1px solid #eee;
+ background: url(watermark_blur.png) center -114px;
+}
+
+#contentwrapper h2,
+#contentwrapper h2 a {
+ color: #222;
+ font-size: 24px;
+ margin: 20px 0 0 0;
+}
+
+#contentwrapper h3,
+#contentwrapper h3 a {
+ color: {{ theme_subheadlinecolor }};
+ font-size: 20px;
+ margin: 20px 0 0 0;
+}
+
+table.docutils {
+ border-collapse: collapse;
+ border: 2px solid #aaa;
+ margin: 0.5em 1.5em 0.5em 1.5em;
+}
+
+table.docutils td {
+ padding: 2px;
+ border: 1px solid #ddd;
+}
+
+p, li, dd, dt, blockquote {
+ color: #333;
+}
+
+blockquote {
+ margin: 10px 0 10px 20px;
+}
+
+p {
+ line-height: 20px;
+ margin-bottom: 0;
+ margin-top: 10px;
+}
+
+hr {
+ border-top: 1px solid #ccc;
+ border-bottom: 0;
+ border-right: 0;
+ border-left: 0;
+ margin-bottom: 10px;
+ margin-top: 20px;
+}
+
+dl {
+ margin-left: 10px;
+}
+
+li, dt {
+ margin-top: 5px;
+}
+
+dt {
+ font-weight: bold;
+ color: #000;
+}
+
+dd {
+ margin-top: 10px;
+ line-height: 20px;
+}
+
+th {
+ text-align: left;
+ padding: 3px;
+ background-color: #f2f2f2;
+}
+
+a {
+ color: {{ theme_linkcolor }};
+}
+
+a:hover {
+ color: {{ theme_visitedlinkcolor }};
+}
+
+pre {
+ background: #ededed url(metal.png);
+ border-top: 1px solid #ccc;
+ border-bottom: 1px solid #ccc;
+ padding: 5px;
+ font-size: 13px;
+ font-family: 'Bitstream Vera Sans Mono', 'Monaco', monospace;
+}
+
+tt {
+ font-size: 13px;
+ font-family: 'Bitstream Vera Sans Mono', 'Monaco', monospace;
+ color: black;
+ padding: 1px 2px 1px 2px;
+ background-color: #fafafa;
+ border-bottom: 1px solid #eee;
+}
+
+a.reference:hover tt {
+ border-bottom-color: #aaa;
+}
+
+cite {
+ /* abusing <cite>, it's generated by ReST for `x` */
+ font-size: 13px;
+ font-family: 'Bitstream Vera Sans Mono', 'Monaco', monospace;
+ font-weight: bold;
+ font-style: normal;
+}
+
+div.admonition {
+ margin: 10px 0 10px 0;
+ padding: 10px;
+ border: 1px solid #ccc;
+}
+
+div.admonition p.admonition-title {
+ background-color: {{ theme_admonitioncolor }};
+ color: white;
+ margin: -10px -10px 10px -10px;
+ padding: 4px 10px 4px 10px;
+ font-weight: bold;
+ font-size: 15px;
+}
+
+div.admonition p.admonition-title a {
+ color: white!important;
+}
+
+a.headerlink {
+ color: #B4B4B4!important;
+ font-size: 0.8em;
+ padding: 0 4px 0 4px;
+ text-decoration: none!important;
+ visibility: hidden;
+}
+
+h1:hover > a.headerlink,
+h2:hover > a.headerlink,
+h3:hover > a.headerlink,
+h4:hover > a.headerlink,
+h5:hover > a.headerlink,
+h6:hover > a.headerlink,
+dt:hover > a.headerlink,
+dt:hover > a.headerlink {
+ visibility: visible;
+}
+
+a.headerlink:hover {
+ background-color: #B4B4B4;
+ color: #F0F0F0!important;
+}
+
+table.indextable {
+ width: 100%;
+}
+
+table.genindextable td {
+ vertical-align: top;
+ width: 50%;
+}
+
+table.indextable dl dd {
+ font-size: 11px;
+}
+
+table.indextable dl dd a {
+ color: #000;
+}
+
+div.modindex-jumpbox {
+ border-top: 1px solid #ddd;
+ border-bottom: 1px solid #ddd;
+ margin: 1em 0 1em 0;
+ padding: 0.4em;
+}
+
+table.modindextable {
+ width: 100%;
+ border: none;
+}
+
+table.modindextable img.toggler {
+ margin-right: 10px;
+}
+
+dl.function dt,
+dl.class dt,
+dl.exception dt,
+dl.method dt,
+dl.attribute dt {
+ font-weight: normal;
+}
+
+dt .descname {
+ font-weight: bold;
+ margin-right: 4px;
+}
+
+dt .descname, dt .descclassname {
+ padding: 0;
+ background: transparent;
+ border-bottom: 1px solid #111;
+}
+
+dt .descclassname {
+ margin-left: 2px;
+}
+
+dl dt big {
+ font-size: 100%;
+}
+
+ul.search {
+ margin: 10px 0 0 30px;
+ padding: 0;
+}
+
+ul.search li {
+ margin: 10px 0 0 0;
+ padding: 0;
+}
+
+ul.search div.context {
+ font-size: 12px;
+ padding: 4px 0 0 20px;
+ color: #888;
+}
+
+span.highlight {
+ background-color: #eee;
+ border: 1px solid #ccc;
+}
+
+#toc {
+ margin: 0 -17px 0 -17px;
+ display: none;
+}
+
+#toc h3 {
+ float: right;
+ margin: 5px 5px 0 0;
+ padding: 0;
+ font-size: 12px;
+ color: #777;
+}
+
+#toc h3:hover {
+ color: #333;
+ cursor: pointer;
+}
+
+.expandedtoc {
+ background: #222 url(darkmetal.png);
+ border-bottom: 1px solid #111;
+ outline-bottom: 1px solid #000;
+ padding: 5px;
+}
+
+.expandedtoc h3 {
+ color: #aaa;
+ margin: 0!important;
+}
+
+.expandedtoc h3:hover {
+ color: white!important;
+}
+
+#tod h3:hover {
+ color: white;
+}
+
+#toc a {
+ color: #ddd;
+ text-decoration: none;
+}
+
+#toc a:hover {
+ color: white;
+ text-decoration: underline;
+}
+
+#toc ul {
+ margin: 5px 0 12px 17px;
+ padding: 0 7px 0 7px;
+}
+
+#toc ul ul {
+ margin-bottom: 0;
+}
+
+#toc ul li {
+ margin: 2px 0 0 0;
+}
+
+.line-block {
+ display: block;
+ margin-top: 1em;
+ margin-bottom: 1em;
+}
+
+.line-block .line-block {
+ margin-top: 0;
+ margin-bottom: 0;
+ margin-left: 1.5em;
+}
diff --git a/sphinx/themes/scrolls/static/theme_extras.js b/sphinx/themes/scrolls/static/theme_extras.js
new file mode 100644
index 00000000..1c042187
--- /dev/null
+++ b/sphinx/themes/scrolls/static/theme_extras.js
@@ -0,0 +1,26 @@
+$(function() {
+
+ var
+ toc = $('#toc').show(),
+ items = $('#toc > ul').hide();
+
+ $('#toc h3')
+ .click(function() {
+ if (items.is(':visible')) {
+ items.animate({
+ height: 'hide',
+ opacity: 'hide'
+ }, 300, function() {
+ toc.removeClass('expandedtoc');
+ });
+ }
+ else {
+ items.animate({
+ height: 'show',
+ opacity: 'show'
+ }, 400);
+ toc.addClass('expandedtoc');
+ }
+ });
+
+});
diff --git a/sphinx/themes/scrolls/static/watermark.png b/sphinx/themes/scrolls/static/watermark.png
new file mode 100644
index 00000000..eb1b6be9
--- /dev/null
+++ b/sphinx/themes/scrolls/static/watermark.png
Binary files differ
diff --git a/sphinx/themes/scrolls/static/watermark_blur.png b/sphinx/themes/scrolls/static/watermark_blur.png
new file mode 100644
index 00000000..563f6cde
--- /dev/null
+++ b/sphinx/themes/scrolls/static/watermark_blur.png
Binary files differ
diff --git a/sphinx/themes/scrolls/theme.conf b/sphinx/themes/scrolls/theme.conf
new file mode 100644
index 00000000..4e7800f9
--- /dev/null
+++ b/sphinx/themes/scrolls/theme.conf
@@ -0,0 +1,11 @@
+[theme]
+inherit = basic
+stylesheet = scrolls.css
+pygments_style = tango
+
+[options]
+headerbordercolor = #1752b4
+subheadlinecolor = #0d306b
+linkcolor = #1752b4
+visitedlinkcolor = #444
+admonitioncolor = #28437f
diff --git a/sphinx/themes/sphinxdoc/layout.html b/sphinx/themes/sphinxdoc/layout.html
index 48d2118e..2d653f9f 100644
--- a/sphinx/themes/sphinxdoc/layout.html
+++ b/sphinx/themes/sphinxdoc/layout.html
@@ -1,3 +1,12 @@
+{#
+ sphinxdoc/layout.html
+ ~~~~~~~~~~~~~~~~~~~~~
+
+ Sphinx layout template for the sphinxdoc theme.
+
+ :copyright: Copyright 2007-2010 by the Sphinx team, see AUTHORS.
+ :license: BSD, see LICENSE for details.
+#}
{% extends "basic/layout.html" %}
{# put the sidebar before the body #}
diff --git a/sphinx/themes/sphinxdoc/static/sphinxdoc.css b/sphinx/themes/sphinxdoc/static/sphinxdoc.css
index 75b2ae0f..3f1e84e5 100644
--- a/sphinx/themes/sphinxdoc/static/sphinxdoc.css
+++ b/sphinx/themes/sphinxdoc/static/sphinxdoc.css
@@ -1,8 +1,13 @@
-/**
- * Sphinx stylesheet -- sphinxdoc theme
- * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+/*
+ * sphinxdoc.css_t
+ * ~~~~~~~~~~~~~~~
+ *
+ * Sphinx stylesheet -- sphinxdoc theme. Originally created by
+ * Armin Ronacher for Werkzeug.
+ *
+ * :copyright: Copyright 2007-2010 by the Sphinx team, see AUTHORS.
+ * :license: BSD, see LICENSE for details.
*
- * Originally created by Armin Ronacher for Werkzeug, adapted by Georg Brandl.
*/
@import url("basic.css");
diff --git a/sphinx/themes/traditional/static/traditional.css b/sphinx/themes/traditional/static/traditional.css
index 8c224c07..022e55ae 100644
--- a/sphinx/themes/traditional/static/traditional.css
+++ b/sphinx/themes/traditional/static/traditional.css
@@ -1,5 +1,12 @@
-/**
- * Sphinx Doc Design -- traditional python.org style
+/*
+ * traditional.css
+ * ~~~~~~~~~~~~~~~
+ *
+ * Sphinx stylesheet -- traditional docs.python.org theme.
+ *
+ * :copyright: Copyright 2007-2010 by the Sphinx team, see AUTHORS.
+ * :license: BSD, see LICENSE for details.
+ *
*/
body {
@@ -636,6 +643,18 @@ tt.xref, a tt {
.footnote:target { background-color: #ffa }
+.line-block {
+ display: block;
+ margin-top: 1em;
+ margin-bottom: 1em;
+}
+
+.line-block .line-block {
+ margin-top: 0;
+ margin-bottom: 0;
+ margin-left: 1.5em;
+}
+
h1 tt, h2 tt, h3 tt, h4 tt, h5 tt, h6 tt {
background-color: transparent;
}
diff --git a/sphinx/theming.py b/sphinx/theming.py
index 27a1c26a..0d0f2863 100644
--- a/sphinx/theming.py
+++ b/sphinx/theming.py
@@ -78,7 +78,7 @@ class Theme(object):
dirname = path.dirname(name)
if not path.isdir(path.join(self.themedir, dirname)):
os.makedirs(path.join(self.themedir, dirname))
- fp = open(path.join(self.themedir, name), 'w')
+ fp = open(path.join(self.themedir, name), 'wb')
fp.write(tinfo.read(name))
fp.close()
diff --git a/sphinx/util/__init__.py b/sphinx/util/__init__.py
index 5745907f..876d3fda 100644
--- a/sphinx/util/__init__.py
+++ b/sphinx/util/__init__.py
@@ -12,10 +12,6 @@
import os
import re
import sys
-import stat
-import time
-import errno
-import types
import shutil
import fnmatch
import tempfile
@@ -24,301 +20,71 @@ import traceback
from os import path
import docutils
+from docutils.utils import relative_path
+
+import jinja2
+
import sphinx
-# Errnos that we need.
-EEXIST = getattr(errno, 'EEXIST', 0)
-ENOENT = getattr(errno, 'ENOENT', 0)
-EPIPE = getattr(errno, 'EPIPE', 0)
+# import other utilities; partly for backwards compatibility, so don't
+# prune unused ones indiscriminately
+from sphinx.util.osutil import SEP, os_path, relative_uri, ensuredir, walk, \
+ mtimes_of_files, movefile, copyfile, copytimes, make_filename, ustrftime
+from sphinx.util.nodes import nested_parse_with_titles, split_explicit_title, \
+ explicit_title_re, caption_ref_re
+from sphinx.util.matching import patfilter
# Generally useful regular expressions.
ws_re = re.compile(r'\s+')
-caption_ref_re = re.compile(r'^([^<]+?)\s*<(.+)>$')
url_re = re.compile(r'(?P<schema>.+)://.*')
-# SEP separates path elements in the canonical file names
-#
-# Define SEP as a manifest constant, not so much because we expect it to change
-# in the future as to avoid the suspicion that a stray "/" in the code is a
-# hangover from more *nix-oriented origins.
-SEP = "/"
-
-def os_path(canonicalpath):
- return canonicalpath.replace(SEP, os.path.sep)
-
-
-def relative_uri(base, to):
- """Return a relative URL from ``base`` to ``to``."""
- if to.startswith(SEP):
- return to
- b2 = base.split(SEP)
- t2 = to.split(SEP)
- # remove common segments
- for x, y in zip(b2, t2):
- if x != y:
- break
- b2.pop(0)
- t2.pop(0)
- return ('..' + SEP) * (len(b2)-1) + SEP.join(t2)
+# High-level utility functions.
def docname_join(basedocname, docname):
return posixpath.normpath(
posixpath.join('/' + basedocname, '..', docname))[1:]
-def ensuredir(path):
- """Ensure that a path exists."""
- try:
- os.makedirs(path)
- except OSError, err:
- # 0 for Jython/Win32
- if err.errno not in [0, EEXIST]:
- raise
-
-
-def walk(top, topdown=True, followlinks=False):
- """
- Backport of os.walk from 2.6, where the followlinks argument was added.
- """
- names = os.listdir(top)
-
- dirs, nondirs = [], []
- for name in names:
- if path.isdir(path.join(top, name)):
- dirs.append(name)
- else:
- nondirs.append(name)
-
- if topdown:
- yield top, dirs, nondirs
- for name in dirs:
- fullpath = path.join(top, name)
- if followlinks or not path.islink(fullpath):
- for x in walk(fullpath, topdown, followlinks):
- yield x
- if not topdown:
- yield top, dirs, nondirs
-
-
-def get_matching_docs(dirname, suffix, exclude_docs=(), exclude_dirs=(),
- exclude_trees=(), exclude_dirnames=()):
+def get_matching_files(dirname, exclude_matchers=()):
"""
- Get all file names (without suffix) matching a suffix in a
- directory, recursively.
+ Get all file names in a directory, recursively.
- Exclude docs in *exclude_docs*, exclude dirs in *exclude_dirs*,
- prune dirs in *exclude_trees*, prune dirnames in *exclude_dirnames*.
+ Exclude files and dirs matching some matcher in *exclude_matchers*.
"""
- pattern = '*' + suffix
# dirname is a normalized absolute path.
dirname = path.normpath(path.abspath(dirname))
- dirlen = len(dirname) + 1 # exclude slash
- for root, dirs, files in walk(dirname, followlinks=True):
- if root[dirlen:] in exclude_dirs:
- continue
- if root[dirlen:] in exclude_trees:
- del dirs[:]
- continue
- dirs.sort()
- files.sort()
- for prunedir in exclude_dirnames:
- if prunedir in dirs:
- dirs.remove(prunedir)
- for sfile in files:
- if not fnmatch.fnmatch(sfile, pattern):
- continue
- qualified_name = path.join(root[dirlen:], sfile[:-len(suffix)])
- qualified_name = qualified_name.replace(os.path.sep, SEP)
- if qualified_name in exclude_docs:
- continue
- yield qualified_name
-
-
-def mtimes_of_files(dirnames, suffix):
- for dirname in dirnames:
- for root, dirs, files in os.walk(dirname):
- for sfile in files:
- if sfile.endswith(suffix):
- try:
- yield path.getmtime(path.join(root, sfile))
- except EnvironmentError:
- pass
-
-
-def shorten_result(text='', keywords=[], maxlen=240, fuzz=60):
- if not text:
- text = ''
- text_low = text.lower()
- beg = -1
- for k in keywords:
- i = text_low.find(k.lower())
- if (i > -1 and i < beg) or beg == -1:
- beg = i
- excerpt_beg = 0
- if beg > fuzz:
- for sep in ('.', ':', ';', '='):
- eb = text.find(sep, beg - fuzz, beg - 1)
- if eb > -1:
- eb += 1
- break
- else:
- eb = beg - fuzz
- excerpt_beg = eb
- if excerpt_beg < 0:
- excerpt_beg = 0
- msg = text[excerpt_beg:beg+maxlen]
- if beg > fuzz:
- msg = '... ' + msg
- if beg < len(text)-maxlen:
- msg = msg + ' ...'
- return msg
-
-
-class attrdict(dict):
- def __getattr__(self, key):
- return self[key]
- def __setattr__(self, key, val):
- self[key] = val
- def __delattr__(self, key):
- del self[key]
-
-
-def fmt_ex(ex):
- """Format a single line with an exception description."""
- return traceback.format_exception_only(ex.__class__, ex)[-1].strip()
-
-
-def rpartition(s, t):
- """Similar to str.rpartition from 2.5, but doesn't return the separator."""
- i = s.rfind(t)
- if i != -1:
- return s[:i], s[i+len(t):]
- return '', s
-
-
-def format_exception_cut_frames(x=1):
- """
- Format an exception with traceback, but only the last x frames.
- """
- typ, val, tb = sys.exc_info()
- #res = ['Traceback (most recent call last):\n']
- res = []
- tbres = traceback.format_tb(tb)
- res += tbres[-x:]
- res += traceback.format_exception_only(typ, val)
- return ''.join(res)
-
-
-def save_traceback():
- """
- Save the current exception's traceback in a temporary file.
- """
- exc = traceback.format_exc()
- fd, path = tempfile.mkstemp('.log', 'sphinx-err-')
- os.write(fd, '# Sphinx version: %s\n' % sphinx.__version__)
- os.write(fd, '# Docutils version: %s %s\n' % (docutils.__version__,
- docutils.__version_details__))
- os.write(fd, exc)
- os.close(fd)
- return path
+ dirlen = len(dirname) + 1 # exclude final os.path.sep
+ for root, dirs, files in walk(dirname, followlinks=True):
+ relativeroot = root[dirlen:]
-def _translate_pattern(pat):
- """
- Translate a shell-style glob pattern to a regular expression.
+ qdirs = enumerate(path.join(relativeroot, dn).replace(os.path.sep, SEP)
+ for dn in dirs)
+ qfiles = enumerate(path.join(relativeroot, fn).replace(os.path.sep, SEP)
+ for fn in files)
+ for matcher in exclude_matchers:
+ qdirs = [entry for entry in qdirs if not matcher(entry[1])]
+ qfiles = [entry for entry in qfiles if not matcher(entry[1])]
- Adapted from the fnmatch module, but enhanced so that single stars don't
- match slashes.
- """
- i, n = 0, len(pat)
- res = ''
- while i < n:
- c = pat[i]
- i += 1
- if c == '*':
- if i < n and pat[i] == '*':
- # double star matches slashes too
- i += 1
- res = res + '.*'
- else:
- # single star doesn't match slashes
- res = res + '[^/]*'
- elif c == '?':
- # question mark doesn't match slashes too
- res = res + '[^/]'
- elif c == '[':
- j = i
- if j < n and pat[j] == '!':
- j += 1
- if j < n and pat[j] == ']':
- j += 1
- while j < n and pat[j] != ']':
- j += 1
- if j >= n:
- res = res + '\\['
- else:
- stuff = pat[i:j].replace('\\', '\\\\')
- i = j + 1
- if stuff[0] == '!':
- # negative pattern mustn't match slashes too
- stuff = '^/' + stuff[1:]
- elif stuff[0] == '^':
- stuff = '\\' + stuff
- res = '%s[%s]' % (res, stuff)
- else:
- res += re.escape(c)
- return res + '$'
+ dirs[:] = sorted(dirs[i] for (i, _) in qdirs)
+ for i, filename in sorted(qfiles):
+ yield filename
-_pat_cache = {}
-def patfilter(names, pat):
+def get_matching_docs(dirname, suffix, exclude_matchers=()):
"""
- Return the subset of the list NAMES that match PAT.
- Adapted from fnmatch module.
- """
- if pat not in _pat_cache:
- _pat_cache[pat] = re.compile(_translate_pattern(pat))
- match = _pat_cache[pat].match
- return filter(match, names)
-
-
-no_fn_re = re.compile(r'[^a-zA-Z0-9_-]')
-
-def make_filename(string):
- return no_fn_re.sub('', string)
-
-
-def nested_parse_with_titles(state, content, node):
- # hack around title style bookkeeping
- surrounding_title_styles = state.memo.title_styles
- surrounding_section_level = state.memo.section_level
- state.memo.title_styles = []
- state.memo.section_level = 0
- try:
- return state.nested_parse(content, 0, node, match_titles=1)
- finally:
- state.memo.title_styles = surrounding_title_styles
- state.memo.section_level = surrounding_section_level
-
-
-def ustrftime(format, *args):
- # strftime for unicode strings
- return time.strftime(unicode(format).encode('utf-8'), *args).decode('utf-8')
-
+ Get all file names (without suffix) matching a suffix in a
+ directory, recursively.
-class Tee(object):
+ Exclude files and dirs matching a pattern in *exclude_patterns*.
"""
- File-like object writing to two streams.
- """
- def __init__(self, stream1, stream2):
- self.stream1 = stream1
- self.stream2 = stream2
-
- def write(self, text):
- self.stream1.write(text)
- self.stream2.write(text)
+ suffixpattern = '*' + suffix
+ for filename in get_matching_files(dirname, exclude_matchers):
+ if not fnmatch.fnmatch(filename, suffixpattern):
+ continue
+ yield filename[:-len(suffix)]
class FilenameUniqDict(dict):
@@ -358,6 +124,73 @@ class FilenameUniqDict(dict):
self._existing = state
+def copy_static_entry(source, targetdir, builder, context={},
+ exclude_matchers=(), level=0):
+ """Copy a HTML builder static_path entry from source to targetdir.
+
+ Handles all possible cases of files, directories and subdirectories.
+ """
+ if exclude_matchers:
+ relpath = relative_path(builder.srcdir, source)
+ for matcher in exclude_matchers:
+ if matcher(relpath):
+ return
+ if path.isfile(source):
+ target = path.join(targetdir, path.basename(source))
+ if source.lower().endswith('_t') and builder.templates:
+ # templated!
+ fsrc = open(source, 'rb')
+ fdst = open(target[:-2], 'wb')
+ fdst.write(builder.templates.render_string(fsrc.read(), context))
+ fsrc.close()
+ fdst.close()
+ else:
+ copyfile(source, target)
+ elif path.isdir(source):
+ if level == 0:
+ for entry in os.listdir(source):
+ if entry.startswith('.'):
+ continue
+ copy_static_entry(path.join(source, entry), targetdir,
+ builder, context, level=1,
+ exclude_matchers=exclude_matchers)
+ else:
+ target = path.join(targetdir, path.basename(source))
+ if path.exists(target):
+ shutil.rmtree(target)
+ shutil.copytree(source, target)
+
+
+def save_traceback():
+ """
+ Save the current exception's traceback in a temporary file.
+ """
+ exc = traceback.format_exc()
+ fd, path = tempfile.mkstemp('.log', 'sphinx-err-')
+ os.write(fd, '# Sphinx version: %s\n' % sphinx.__version__)
+ os.write(fd, '# Docutils version: %s %s\n' % (docutils.__version__,
+ docutils.__version_details__))
+ os.write(fd, '# Jinja2 version: %s\n' % jinja2.__version__)
+ os.write(fd, exc)
+ os.close(fd)
+ return path
+
+
+# Low-level utility functions and classes.
+
+class Tee(object):
+ """
+ File-like object writing to two streams.
+ """
+ def __init__(self, stream1, stream2):
+ self.stream1 = stream1
+ self.stream2 = stream2
+
+ def write(self, text):
+ self.stream1.write(text)
+ self.stream2.write(text)
+
+
def parselinenos(spec, total):
"""
Parse a line number spec (such as "1,2,4-6") and return a list of
@@ -376,12 +209,13 @@ def parselinenos(spec, total):
start = (begend[0] == '') and 0 or int(begend[0])-1
end = (begend[1] == '') and total or int(begend[1])
items.extend(xrange(start, end))
- except Exception, err:
+ except Exception:
raise ValueError('invalid line number spec: %r' % spec)
return items
def force_decode(string, encoding):
+ """Forcibly get a unicode string out of a bytestring."""
if isinstance(string, str):
if encoding:
string = string.decode(encoding)
@@ -395,93 +229,31 @@ def force_decode(string, encoding):
return string
-def movefile(source, dest):
- """Move a file, removing the destination if it exists."""
- if os.path.exists(dest):
- try:
- os.unlink(dest)
- except OSError:
- pass
- os.rename(source, dest)
-
-
-def copytimes(source, dest):
- """Copy a file's modification times."""
- st = os.stat(source)
- if hasattr(os, 'utime'):
- os.utime(dest, (st.st_atime, st.st_mtime))
+class attrdict(dict):
+ def __getattr__(self, key):
+ return self[key]
+ def __setattr__(self, key, val):
+ self[key] = val
+ def __delattr__(self, key):
+ del self[key]
-def copyfile(source, dest):
- """Copy a file and its modification times, if possible."""
- shutil.copyfile(source, dest)
- try:
- # don't do full copystat because the source may be read-only
- copytimes(source, dest)
- except OSError:
- pass
+def rpartition(s, t):
+ """Similar to str.rpartition from 2.5, but doesn't return the separator."""
+ i = s.rfind(t)
+ if i != -1:
+ return s[:i], s[i+len(t):]
+ return '', s
-def copy_static_entry(source, target, builder, context={}):
- if path.isfile(source):
- if source.lower().endswith('_t'):
- # templated!
- fsrc = open(source, 'rb')
- fdst = open(target[:-2], 'wb')
- fdst.write(builder.templates.render_string(fsrc.read(), context))
- fsrc.close()
- fdst.close()
- else:
- copyfile(source, target)
- elif path.isdir(source):
- if source in builder.config.exclude_dirnames:
- return
- if path.exists(target):
- shutil.rmtree(target)
- shutil.copytree(source, target)
-
-
-def clean_astext(node):
- """Like node.astext(), but ignore images."""
- node = node.deepcopy()
- for img in node.traverse(docutils.nodes.image):
- img['alt'] = ''
- return node.astext()
-
-
-# monkey-patch Node.traverse to get more speed
-# traverse() is called so many times during a build that it saves
-# on average 20-25% overall build time!
-
-def _all_traverse(self):
- """Version of Node.traverse() that doesn't need a condition."""
- result = []
- result.append(self)
- for child in self.children:
- result.extend(child._all_traverse())
- return result
-
-def _fast_traverse(self, cls):
- """Version of Node.traverse() that only supports instance checks."""
- result = []
- if isinstance(self, cls):
- result.append(self)
- for child in self.children:
- result.extend(child._fast_traverse(cls))
- return result
-
-def _new_traverse(self, condition=None,
- include_self=1, descend=1, siblings=0, ascend=0):
- if include_self and descend and not siblings and not ascend:
- if condition is 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)
-
-import docutils.nodes
-docutils.nodes.Node._old_traverse = docutils.nodes.Node.traverse
-docutils.nodes.Node._all_traverse = _all_traverse
-docutils.nodes.Node._fast_traverse = _fast_traverse
-docutils.nodes.Node.traverse = _new_traverse
+def format_exception_cut_frames(x=1):
+ """
+ Format an exception with traceback, but only the last x frames.
+ """
+ typ, val, tb = sys.exc_info()
+ #res = ['Traceback (most recent call last):\n']
+ res = []
+ tbres = traceback.format_tb(tb)
+ res += tbres[-x:]
+ res += traceback.format_exception_only(typ, val)
+ return ''.join(res)
diff --git a/sphinx/util/matching.py b/sphinx/util/matching.py
new file mode 100644
index 00000000..c459aca2
--- /dev/null
+++ b/sphinx/util/matching.py
@@ -0,0 +1,83 @@
+# -*- coding: utf-8 -*-
+"""
+ sphinx.util.matching
+ ~~~~~~~~~~~~~~~~~~~~
+
+ Pattern-matching utility functions for Sphinx.
+
+ :copyright: Copyright 2007-2010 by the Sphinx team, see AUTHORS.
+ :license: BSD, see LICENSE for details.
+"""
+
+import re
+
+
+def _translate_pattern(pat):
+ """
+ Translate a shell-style glob pattern to a regular expression.
+
+ Adapted from the fnmatch module, but enhanced so that single stars don't
+ match slashes.
+ """
+ i, n = 0, len(pat)
+ res = ''
+ while i < n:
+ c = pat[i]
+ i += 1
+ if c == '*':
+ if i < n and pat[i] == '*':
+ # double star matches slashes too
+ i += 1
+ res = res + '.*'
+ else:
+ # single star doesn't match slashes
+ res = res + '[^/]*'
+ elif c == '?':
+ # question mark doesn't match slashes too
+ res = res + '[^/]'
+ elif c == '[':
+ j = i
+ if j < n and pat[j] == '!':
+ j += 1
+ if j < n and pat[j] == ']':
+ j += 1
+ while j < n and pat[j] != ']':
+ j += 1
+ if j >= n:
+ res = res + '\\['
+ else:
+ stuff = pat[i:j].replace('\\', '\\\\')
+ i = j + 1
+ if stuff[0] == '!':
+ # negative pattern mustn't match slashes too
+ stuff = '^/' + stuff[1:]
+ elif stuff[0] == '^':
+ stuff = '\\' + stuff
+ res = '%s[%s]' % (res, stuff)
+ else:
+ res += re.escape(c)
+ return res + '$'
+
+def compile_matchers(patterns):
+ return [re.compile(_translate_pattern(pat)).match for pat in patterns]
+
+
+_pat_cache = {}
+
+def patmatch(name, pat):
+ """
+ Return if name matches pat. Adapted from fnmatch module.
+ """
+ if pat not in _pat_cache:
+ _pat_cache[pat] = re.compile(_translate_pattern(pat))
+ return _pat_cache[pat].match(name)
+
+def patfilter(names, pat):
+ """
+ Return the subset of the list NAMES that match PAT.
+ Adapted from fnmatch module.
+ """
+ if pat not in _pat_cache:
+ _pat_cache[pat] = re.compile(_translate_pattern(pat))
+ match = _pat_cache[pat].match
+ return filter(match, names)
diff --git a/sphinx/util/nodes.py b/sphinx/util/nodes.py
new file mode 100644
index 00000000..0c43ec20
--- /dev/null
+++ b/sphinx/util/nodes.py
@@ -0,0 +1,111 @@
+# -*- coding: utf-8 -*-
+"""
+ sphinx.util.nodes
+ ~~~~~~~~~~~~~~~~~
+
+ Docutils node-related utility functions for Sphinx.
+
+ :copyright: Copyright 2007-2010 by the Sphinx team, see AUTHORS.
+ :license: BSD, see LICENSE for details.
+"""
+
+import re
+import types
+
+from sphinx import addnodes
+
+
+explicit_title_re = re.compile('^(.+?)\s*<(.*?)>$', re.DOTALL)
+caption_ref_re = explicit_title_re # b/w compat alias
+
+
+def nested_parse_with_titles(state, content, node):
+ # hack around title style bookkeeping
+ surrounding_title_styles = state.memo.title_styles
+ surrounding_section_level = state.memo.section_level
+ state.memo.title_styles = []
+ state.memo.section_level = 0
+ try:
+ return state.nested_parse(content, 0, node, match_titles=1)
+ finally:
+ state.memo.title_styles = surrounding_title_styles
+ state.memo.section_level = surrounding_section_level
+
+
+def clean_astext(node):
+ """Like node.astext(), but ignore images."""
+ node = node.deepcopy()
+ for img in node.traverse(docutils.nodes.image):
+ img['alt'] = ''
+ return node.astext()
+
+
+def split_explicit_title(text):
+ """Split role content into title and target, if given."""
+ match = explicit_title_re.match(text)
+ if match:
+ return True, match.group(1), match.group(2)
+ return False, text, text
+
+
+def inline_all_toctrees(builder, docnameset, docname, tree, colorfunc):
+ """Inline all toctrees in the *tree*.
+
+ Record all docnames in *docnameset*, and output docnames with *colorfunc*.
+ """
+ tree = tree.deepcopy()
+ for toctreenode in tree.traverse(addnodes.toctree):
+ newnodes = []
+ includefiles = map(str, toctreenode['includefiles'])
+ for includefile in includefiles:
+ try:
+ builder.info(colorfunc(includefile) + " ", nonl=1)
+ subtree = inline_all_toctrees(builder, docnameset, includefile,
+ builder.env.get_doctree(includefile), colorfunc)
+ docnameset.add(includefile)
+ except Exception:
+ builder.warn('toctree contains ref to nonexisting '
+ 'file %r' % includefile,
+ builder.env.doc2path(docname))
+ else:
+ sof = addnodes.start_of_file(docname=includefile)
+ sof.children = subtree.children
+ newnodes.append(sof)
+ toctreenode.parent.replace(toctreenode, newnodes)
+ return tree
+
+
+# monkey-patch Node.traverse to get more speed
+# traverse() is called so many times during a build that it saves
+# on average 20-25% overall build time!
+
+def _all_traverse(self, result):
+ """Version of Node.traverse() that doesn't need a condition."""
+ result.append(self)
+ for child in self.children:
+ child._all_traverse(result)
+ return result
+
+def _fast_traverse(self, cls, result):
+ """Version of Node.traverse() that only supports instance checks."""
+ if isinstance(self, cls):
+ result.append(self)
+ for child in self.children:
+ child._fast_traverse(cls, result)
+ return result
+
+def _new_traverse(self, condition=None,
+ include_self=1, descend=1, siblings=0, ascend=0):
+ if include_self and descend and not siblings and not ascend:
+ if condition is 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)
+
+import docutils.nodes
+docutils.nodes.Node._old_traverse = docutils.nodes.Node.traverse
+docutils.nodes.Node._all_traverse = _all_traverse
+docutils.nodes.Node._fast_traverse = _fast_traverse
+docutils.nodes.Node.traverse = _new_traverse
diff --git a/sphinx/util/osutil.py b/sphinx/util/osutil.py
new file mode 100644
index 00000000..beab38cb
--- /dev/null
+++ b/sphinx/util/osutil.py
@@ -0,0 +1,130 @@
+# -*- coding: utf-8 -*-
+"""
+ sphinx.util.osutil
+ ~~~~~~~~~~~~~~~~~~
+
+ Operating system-related utility functions for Sphinx.
+
+ :copyright: Copyright 2007-2010 by the Sphinx team, see AUTHORS.
+ :license: BSD, see LICENSE for details.
+"""
+
+import os
+import re
+import time
+import errno
+import shutil
+from os import path
+
+# Errnos that we need.
+EEXIST = getattr(errno, 'EEXIST', 0)
+ENOENT = getattr(errno, 'ENOENT', 0)
+EPIPE = getattr(errno, 'EPIPE', 0)
+
+# SEP separates path elements in the canonical file names
+#
+# Define SEP as a manifest constant, not so much because we expect it to change
+# in the future as to avoid the suspicion that a stray "/" in the code is a
+# hangover from more *nix-oriented origins.
+SEP = "/"
+
+def os_path(canonicalpath):
+ return canonicalpath.replace(SEP, path.sep)
+
+
+def relative_uri(base, to):
+ """Return a relative URL from ``base`` to ``to``."""
+ if to.startswith(SEP):
+ return to
+ b2 = base.split(SEP)
+ t2 = to.split(SEP)
+ # remove common segments
+ for x, y in zip(b2, t2):
+ if x != y:
+ break
+ b2.pop(0)
+ t2.pop(0)
+ return ('..' + SEP) * (len(b2)-1) + SEP.join(t2)
+
+
+def ensuredir(path):
+ """Ensure that a path exists."""
+ try:
+ os.makedirs(path)
+ except OSError, err:
+ # 0 for Jython/Win32
+ if err.errno not in [0, EEXIST]:
+ raise
+
+
+def walk(top, topdown=True, followlinks=False):
+ """
+ Backport of os.walk from 2.6, where the followlinks argument was added.
+ """
+ names = os.listdir(top)
+
+ dirs, nondirs = [], []
+ for name in names:
+ if path.isdir(path.join(top, name)):
+ dirs.append(name)
+ else:
+ nondirs.append(name)
+
+ if topdown:
+ yield top, dirs, nondirs
+ for name in dirs:
+ fullpath = path.join(top, name)
+ if followlinks or not path.islink(fullpath):
+ for x in walk(fullpath, topdown, followlinks):
+ yield x
+ if not topdown:
+ yield top, dirs, nondirs
+
+
+def mtimes_of_files(dirnames, suffix):
+ for dirname in dirnames:
+ for root, dirs, files in os.walk(dirname):
+ for sfile in files:
+ if sfile.endswith(suffix):
+ try:
+ yield path.getmtime(path.join(root, sfile))
+ except EnvironmentError:
+ pass
+
+
+def movefile(source, dest):
+ """Move a file, removing the destination if it exists."""
+ if os.path.exists(dest):
+ try:
+ os.unlink(dest)
+ except OSError:
+ pass
+ os.rename(source, dest)
+
+
+def copytimes(source, dest):
+ """Copy a file's modification times."""
+ st = os.stat(source)
+ if hasattr(os, 'utime'):
+ os.utime(dest, (st.st_atime, st.st_mtime))
+
+
+def copyfile(source, dest):
+ """Copy a file and its modification times, if possible."""
+ shutil.copyfile(source, dest)
+ try:
+ # don't do full copystat because the source may be read-only
+ copytimes(source, dest)
+ except OSError:
+ pass
+
+
+no_fn_re = re.compile(r'[^a-zA-Z0-9_-]')
+
+def make_filename(string):
+ return no_fn_re.sub('', string)
+
+
+def ustrftime(format, *args):
+ # strftime for unicode strings
+ return time.strftime(unicode(format).encode('utf-8'), *args).decode('utf-8')
diff --git a/sphinx/util/pycompat.py b/sphinx/util/pycompat.py
index 02194307..24040608 100644
--- a/sphinx/util/pycompat.py
+++ b/sphinx/util/pycompat.py
@@ -13,6 +13,17 @@ import sys
import codecs
import encodings
+
+try:
+ any = any
+except NameError:
+ def any(gen):
+ for i in gen:
+ if i:
+ return True
+ return False
+
+
if sys.version_info < (2, 5):
# Python 2.4 doesn't know the utf-8-sig encoding, so deliver it here
diff --git a/sphinx/writers/html.py b/sphinx/writers/html.py
index ea79fb9d..320463e2 100644
--- a/sphinx/writers/html.py
+++ b/sphinx/writers/html.py
@@ -60,6 +60,12 @@ class HTMLTranslator(BaseTranslator):
self.protect_literal_text = 0
self.add_permalinks = builder.config.html_add_permalinks
+ def visit_start_of_file(self, node):
+ # only occurs in the single-file builder
+ self.body.append('<span id="document-%s"></span>' % node['docname'])
+ def depart_start_of_file(self, node):
+ pass
+
def visit_desc(self, node):
self.body.append(self.starttag(node, 'dl', CLASS=node['desctype']))
def depart_desc(self, node):
@@ -138,7 +144,7 @@ class HTMLTranslator(BaseTranslator):
self.body.append('</em>')
def visit_versionmodified(self, node):
- self.body.append(self.starttag(node, 'p'))
+ self.body.append(self.starttag(node, 'p', CLASS=node['type']))
text = versionlabels[node['type']] % node['version']
if len(node):
text += ': '
diff --git a/sphinx/writers/latex.py b/sphinx/writers/latex.py
index 517d8d86..948f5118 100644
--- a/sphinx/writers/latex.py
+++ b/sphinx/writers/latex.py
@@ -23,13 +23,15 @@ from sphinx import addnodes
from sphinx import highlighting
from sphinx.errors import SphinxError
from sphinx.locale import admonitionlabels, versionlabels
-from sphinx.util import ustrftime
+from sphinx.util.osutil import ustrftime
from sphinx.util.texescape import tex_escape_map
from sphinx.util.smartypants import educateQuotesLatex
HEADER = r'''%% Generated by Sphinx.
-\documentclass[%(papersize)s,%(pointsize)s%(classoptions)s]{%(docclass)s}
+\def\sphinxdocclass{%(docclass)s}
+\documentclass[%(papersize)s,%(pointsize)s%(classoptions)s]{%(wrapperclass)s}
%(inputenc)s
+%(utf8extra)s
%(fontenc)s
%(babel)s
%(fontpkg)s
@@ -134,11 +136,11 @@ class LaTeXTranslator(nodes.NodeVisitor):
ignore_missing_images = False
default_elements = {
- 'docclass': 'manual',
'papersize': 'letterpaper',
'pointsize': '10pt',
'classoptions': '',
'inputenc': '\\usepackage[utf8]{inputenc}',
+ 'utf8extra': '\\DeclareUnicodeCharacter{00A0}{\\nobreakspace}',
'fontenc': '\\usepackage[T1]{fontenc}',
'babel': '\\usepackage{babel}',
'fontpkg': '\\usepackage{times}',
@@ -173,7 +175,7 @@ class LaTeXTranslator(nodes.NodeVisitor):
self.elements = self.default_elements.copy()
self.elements.update({
- 'docclass': document.settings.docclass,
+ 'wrapperclass': 'sphinx' + document.settings.docclass,
'papersize': papersize,
'pointsize': builder.config.latex_font_size,
# if empty, the title is set to the first section title
@@ -185,6 +187,11 @@ class LaTeXTranslator(nodes.NodeVisitor):
'modindexname': _('Module Index'),
'indexname': _('Index'),
})
+ if document.settings.docclass == 'howto':
+ docclass = builder.config.latex_docclass.get('howto', 'article')
+ else:
+ docclass = builder.config.latex_docclass.get('manual', 'report')
+ self.elements['docclass'] = docclass
if builder.config.today:
self.elements['date'] = builder.config.today
else:
@@ -211,8 +218,8 @@ class LaTeXTranslator(nodes.NodeVisitor):
# allow the user to override them all
self.elements.update(builder.config.latex_elements)
- self.highlighter = highlighting.PygmentsBridge(
- 'latex', builder.config.pygments_style)
+ self.highlighter = highlighting.PygmentsBridge('latex',
+ builder.config.pygments_style, builder.config.trim_doctest_flags)
self.context = []
self.descstack = []
self.bibitems = []
@@ -224,13 +231,13 @@ class LaTeXTranslator(nodes.NodeVisitor):
self.footnotestack = []
self.curfilestack = []
self.handled_abbrs = set()
- if self.elements['docclass'] == 'manual':
+ if document.settings.docclass == 'howto':
+ self.top_sectionlevel = 2
+ else:
if builder.config.latex_use_parts:
self.top_sectionlevel = 0
else:
self.top_sectionlevel = 1
- else:
- self.top_sectionlevel = 2
self.next_section_target = None
# flags
self.verbatim = None
diff --git a/sphinx/writers/text.py b/sphinx/writers/text.py
index 69fd037f..84dc4b38 100644
--- a/sphinx/writers/text.py
+++ b/sphinx/writers/text.py
@@ -47,7 +47,7 @@ STDINDENT = 3
class TextTranslator(nodes.NodeVisitor):
- sectionchars = '*=-~"+'
+ sectionchars = '*=-~"+`'
def __init__(self, document, builder):
nodes.NodeVisitor.__init__(self, document)