summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.hgignore21
-rw-r--r--AUTHORS9
-rw-r--r--CHANGES140
-rw-r--r--EXAMPLES166
-rw-r--r--Makefile2
-rw-r--r--doc/Makefile31
-rw-r--r--doc/_templates/index.html73
-rw-r--r--doc/_templates/layout.html13
-rw-r--r--doc/builders.rst80
-rw-r--r--doc/conf.py113
-rw-r--r--doc/config.rst393
-rw-r--r--doc/contents.rst4
-rw-r--r--doc/domains.rst661
-rw-r--r--doc/ext/appapi.rst134
-rw-r--r--doc/ext/autodoc.rst67
-rw-r--r--doc/ext/autosummary.rst125
-rw-r--r--doc/ext/builderapi.rst1
-rw-r--r--doc/ext/doctest.rst21
-rw-r--r--doc/ext/extlinks.rst54
-rw-r--r--doc/ext/graphviz.rst25
-rw-r--r--doc/ext/ifconfig.rst2
-rw-r--r--doc/ext/inheritance.rst4
-rw-r--r--doc/ext/intersphinx.rst65
-rw-r--r--doc/ext/math.rst8
-rw-r--r--doc/ext/oldcmarkup.rst35
-rw-r--r--doc/ext/todo.rst8
-rw-r--r--doc/ext/tutorial.rst10
-rw-r--r--doc/ext/viewcode.rst19
-rw-r--r--doc/extensions.rst3
-rw-r--r--doc/faq.rst51
-rw-r--r--doc/glossary.rst54
-rw-r--r--doc/intro.rst128
-rw-r--r--doc/invocation.rst178
-rw-r--r--doc/man/sphinx-build.rst102
-rw-r--r--doc/man/sphinx-quickstart.rst33
-rw-r--r--doc/markup/code.rst19
-rw-r--r--doc/markup/desc.rst357
-rw-r--r--doc/markup/index.rst6
-rw-r--r--doc/markup/inline.rst293
-rw-r--r--doc/markup/misc.rst40
-rw-r--r--doc/markup/para.rst86
-rw-r--r--doc/markup/toctree.rst (renamed from doc/concepts.rst)50
-rw-r--r--doc/more.pngbin0 -> 1502 bytes
-rw-r--r--doc/rest.rst233
-rw-r--r--doc/sphinx-build.1102
-rw-r--r--doc/sphinx-quickstart.117
-rw-r--r--doc/templating.rst35
-rw-r--r--doc/themes/agogo.pngbin0 -> 38724 bytes
-rw-r--r--doc/themes/default.pngbin0 -> 57108 bytes
-rw-r--r--doc/themes/fullsize/agogo.pngbin0 -> 75005 bytes
-rw-r--r--doc/themes/fullsize/default.pngbin0 -> 96831 bytes
-rw-r--r--doc/themes/fullsize/haiku.pngbin0 -> 104662 bytes
-rw-r--r--doc/themes/fullsize/nature.pngbin0 -> 44469 bytes
-rw-r--r--doc/themes/fullsize/scrolls.pngbin0 -> 121464 bytes
-rw-r--r--doc/themes/fullsize/sphinxdoc.pngbin0 -> 99682 bytes
-rw-r--r--doc/themes/fullsize/traditional.pngbin0 -> 108985 bytes
-rw-r--r--doc/themes/haiku.pngbin0 -> 54252 bytes
-rw-r--r--doc/themes/nature.pngbin0 -> 42295 bytes
-rw-r--r--doc/themes/scrolls.pngbin0 -> 44266 bytes
-rw-r--r--doc/themes/sphinxdoc.pngbin0 -> 42982 bytes
-rw-r--r--doc/themes/traditional.pngbin0 -> 45762 bytes
-rw-r--r--doc/theming.rst102
-rw-r--r--doc/tutorial.rst262
-rw-r--r--setup.cfg1
-rw-r--r--setup.py32
-rw-r--r--sphinx/__init__.py4
-rw-r--r--sphinx/addnodes.py5
-rw-r--r--sphinx/application.py208
-rw-r--r--sphinx/builder.py28
-rw-r--r--sphinx/builders/__init__.py104
-rw-r--r--sphinx/builders/changes.py10
-rw-r--r--sphinx/builders/devhelp.py133
-rw-r--r--sphinx/builders/epub.py441
-rw-r--r--sphinx/builders/html.py524
-rw-r--r--sphinx/builders/htmlhelp.py6
-rw-r--r--sphinx/builders/latex.py29
-rw-r--r--sphinx/builders/linkcheck.py2
-rw-r--r--sphinx/builders/manpage.py92
-rw-r--r--sphinx/builders/qthelp.py9
-rw-r--r--sphinx/builders/text.py2
-rw-r--r--sphinx/cmdline.py13
-rw-r--r--sphinx/config.py49
-rw-r--r--sphinx/directives/__init__.py176
-rw-r--r--sphinx/directives/code.py27
-rw-r--r--sphinx/directives/desc.py771
-rw-r--r--sphinx/directives/other.py284
-rw-r--r--sphinx/domains/__init__.py270
-rw-r--r--sphinx/domains/c.py213
-rw-r--r--sphinx/domains/cpp.py1096
-rw-r--r--sphinx/domains/javascript.py217
-rw-r--r--sphinx/domains/python.py622
-rw-r--r--sphinx/domains/rst.py134
-rw-r--r--sphinx/domains/std.py501
-rw-r--r--sphinx/environment.py704
-rw-r--r--sphinx/errors.py12
-rw-r--r--sphinx/ext/autodoc.py126
-rw-r--r--sphinx/ext/autosummary/__init__.py349
-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/coverage.py14
-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/inheritance_diagram.py14
-rw-r--r--sphinx/ext/intersphinx.py177
-rw-r--r--sphinx/ext/mathbase.py17
-rw-r--r--sphinx/ext/oldcmarkup.py52
-rw-r--r--sphinx/ext/pngmath.py2
-rw-r--r--sphinx/ext/refcounting.py2
-rw-r--r--sphinx/ext/todo.py26
-rw-r--r--sphinx/ext/viewcode.py169
-rw-r--r--sphinx/highlighting.py13
-rw-r--r--sphinx/jinja2glue.py9
-rw-r--r--sphinx/locale/__init__.py194
-rw-r--r--sphinx/locale/ca/LC_MESSAGES/sphinx.js1
-rw-r--r--sphinx/locale/ca/LC_MESSAGES/sphinx.mobin0 -> 9378 bytes
-rw-r--r--sphinx/locale/ca/LC_MESSAGES/sphinx.po783
-rw-r--r--sphinx/locale/cs/LC_MESSAGES/sphinx.js2
-rw-r--r--sphinx/locale/cs/LC_MESSAGES/sphinx.mobin7926 -> 9067 bytes
-rw-r--r--sphinx/locale/cs/LC_MESSAGES/sphinx.po671
-rw-r--r--sphinx/locale/de/LC_MESSAGES/sphinx.js2
-rw-r--r--sphinx/locale/de/LC_MESSAGES/sphinx.mobin8276 -> 10037 bytes
-rw-r--r--sphinx/locale/de/LC_MESSAGES/sphinx.po664
-rw-r--r--sphinx/locale/es/LC_MESSAGES/sphinx.js2
-rw-r--r--sphinx/locale/es/LC_MESSAGES/sphinx.mobin6919 -> 8121 bytes
-rw-r--r--sphinx/locale/es/LC_MESSAGES/sphinx.po668
-rw-r--r--sphinx/locale/fi/LC_MESSAGES/sphinx.js2
-rw-r--r--sphinx/locale/fi/LC_MESSAGES/sphinx.mobin7644 -> 9102 bytes
-rw-r--r--sphinx/locale/fi/LC_MESSAGES/sphinx.po642
-rw-r--r--sphinx/locale/fr/LC_MESSAGES/sphinx.js2
-rw-r--r--sphinx/locale/fr/LC_MESSAGES/sphinx.mobin7626 -> 8885 bytes
-rw-r--r--sphinx/locale/fr/LC_MESSAGES/sphinx.po682
-rw-r--r--sphinx/locale/hr/LC_MESSAGES/sphinx.js1
-rw-r--r--sphinx/locale/hr/LC_MESSAGES/sphinx.mobin0 -> 9195 bytes
-rw-r--r--sphinx/locale/hr/LC_MESSAGES/sphinx.po795
-rw-r--r--sphinx/locale/it/LC_MESSAGES/sphinx.js2
-rw-r--r--sphinx/locale/it/LC_MESSAGES/sphinx.mobin8243 -> 9461 bytes
-rw-r--r--sphinx/locale/it/LC_MESSAGES/sphinx.po670
-rw-r--r--sphinx/locale/ja/LC_MESSAGES/sphinx.js2
-rw-r--r--sphinx/locale/ja/LC_MESSAGES/sphinx.mobin7647 -> 9950 bytes
-rw-r--r--sphinx/locale/ja/LC_MESSAGES/sphinx.po683
-rw-r--r--sphinx/locale/nl/LC_MESSAGES/sphinx.js2
-rw-r--r--sphinx/locale/nl/LC_MESSAGES/sphinx.mobin8159 -> 9370 bytes
-rw-r--r--sphinx/locale/nl/LC_MESSAGES/sphinx.po723
-rw-r--r--sphinx/locale/pl/LC_MESSAGES/sphinx.js2
-rw-r--r--sphinx/locale/pl/LC_MESSAGES/sphinx.mobin7284 -> 9370 bytes
-rw-r--r--sphinx/locale/pl/LC_MESSAGES/sphinx.po711
-rw-r--r--sphinx/locale/pt_BR/LC_MESSAGES/sphinx.js2
-rw-r--r--sphinx/locale/pt_BR/LC_MESSAGES/sphinx.mobin7582 -> 8836 bytes
-rw-r--r--sphinx/locale/pt_BR/LC_MESSAGES/sphinx.po671
-rw-r--r--sphinx/locale/ru/LC_MESSAGES/sphinx.js2
-rw-r--r--sphinx/locale/ru/LC_MESSAGES/sphinx.mobin10230 -> 11308 bytes
-rw-r--r--sphinx/locale/ru/LC_MESSAGES/sphinx.po670
-rw-r--r--sphinx/locale/sl/LC_MESSAGES/sphinx.js2
-rw-r--r--sphinx/locale/sl/LC_MESSAGES/sphinx.mobin8045 -> 9146 bytes
-rw-r--r--sphinx/locale/sl/LC_MESSAGES/sphinx.po737
-rw-r--r--sphinx/locale/sphinx.pot623
-rw-r--r--sphinx/locale/tr/LC_MESSAGES/sphinx.js1
-rw-r--r--sphinx/locale/tr/LC_MESSAGES/sphinx.mobin0 -> 9431 bytes
-rw-r--r--sphinx/locale/tr/LC_MESSAGES/sphinx.po785
-rw-r--r--sphinx/locale/uk_UA/LC_MESSAGES/sphinx.js2
-rw-r--r--sphinx/locale/uk_UA/LC_MESSAGES/sphinx.mobin9911 -> 10983 bytes
-rw-r--r--sphinx/locale/uk_UA/LC_MESSAGES/sphinx.po671
-rw-r--r--sphinx/locale/zh_CN/LC_MESSAGES/sphinx.js1
-rw-r--r--sphinx/locale/zh_CN/LC_MESSAGES/sphinx.mobin0 -> 8755 bytes
-rw-r--r--sphinx/locale/zh_CN/LC_MESSAGES/sphinx.po775
-rw-r--r--sphinx/locale/zh_TW/LC_MESSAGES/sphinx.js2
-rw-r--r--sphinx/locale/zh_TW/LC_MESSAGES/sphinx.mobin7732 -> 8934 bytes
-rw-r--r--sphinx/locale/zh_TW/LC_MESSAGES/sphinx.po666
-rw-r--r--sphinx/pycode/__init__.py108
-rw-r--r--sphinx/pycode/pgen2/driver.py2
-rw-r--r--sphinx/pycode/pgen2/grammar.py2
-rw-r--r--sphinx/pycode/pgen2/parse.c4730
-rw-r--r--sphinx/pycode/pgen2/parse.pyx33
-rw-r--r--sphinx/pycode/pgen2/pgen.py8
-rw-r--r--sphinx/quickstart.py236
-rw-r--r--sphinx/roles.py327
-rw-r--r--sphinx/search.py105
-rw-r--r--sphinx/setup_command.py74
-rw-r--r--sphinx/texinputs/Makefile2
-rw-r--r--sphinx/texinputs/sphinx.sty324
-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_t422
-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/domainindex.html57
-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.html11
-rw-r--r--sphinx/themes/basic/layout.html120
-rw-r--r--sphinx/themes/basic/localtoc.html13
-rw-r--r--sphinx/themes/basic/modindex.html42
-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.css56
-rw-r--r--sphinx/themes/basic/static/doctools.js51
-rw-r--r--sphinx/themes/basic/static/jquery.js177
-rw-r--r--sphinx/themes/basic/static/searchtools.js92
-rw-r--r--sphinx/themes/basic/static/underscore.js16
-rw-r--r--sphinx/themes/default/layout.html14
-rw-r--r--sphinx/themes/default/static/default.css_t49
-rw-r--r--sphinx/themes/default/static/sidebar.js147
-rw-r--r--sphinx/themes/default/theme.conf3
-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_t371
-rw-r--r--sphinx/themes/haiku/theme.conf12
-rw-r--r--sphinx/themes/nature/static/nature.css_t245
-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_t431
-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.css24
-rw-r--r--sphinx/themes/traditional/static/traditional.css40
-rw-r--r--sphinx/theming.py2
-rw-r--r--sphinx/util/__init__.py521
-rw-r--r--sphinx/util/compat.py69
-rw-r--r--sphinx/util/docfields.py267
-rw-r--r--sphinx/util/matching.py83
-rw-r--r--sphinx/util/nodes.py138
-rw-r--r--sphinx/util/osutil.py130
-rw-r--r--sphinx/util/pycompat.py11
-rw-r--r--sphinx/util/texescape.py2
-rw-r--r--sphinx/writers/html.py85
-rw-r--r--sphinx/writers/latex.py429
-rw-r--r--sphinx/writers/manpage.py328
-rw-r--r--sphinx/writers/text.py15
-rwxr-xr-xtests/coverage.py110
-rw-r--r--tests/root/_static/README2
-rw-r--r--tests/root/_static/excluded.css1
-rw-r--r--tests/root/_static/subdir/foo.css1
-rw-r--r--tests/root/_templates/contentssb.html2
-rw-r--r--tests/root/_templates/customsb.html2
-rw-r--r--tests/root/_templates/layout.html7
-rw-r--r--tests/root/conf.py42
-rw-r--r--tests/root/contents.txt5
-rw-r--r--tests/root/desc.txt71
-rw-r--r--tests/root/extapi.txt10
-rw-r--r--tests/root/extensions.txt8
-rw-r--r--tests/root/includes.txt15
-rw-r--r--tests/root/markup.txt120
-rw-r--r--tests/root/metadata.txt53
-rw-r--r--tests/root/objects.txt145
-rw-r--r--tests/root/subdir/excluded.txt2
-rw-r--r--tests/root/tabs.inc5
-rw-r--r--tests/root/templated.css_t2
-rw-r--r--tests/test_autodoc.py85
-rw-r--r--tests/test_autosummary.py34
-rw-r--r--tests/test_build.py263
-rw-r--r--tests/test_build_html.py291
-rw-r--r--tests/test_build_latex.py94
-rw-r--r--tests/test_config.py14
-rw-r--r--tests/test_coverage.py2
-rw-r--r--tests/test_cpp_domain.py55
-rw-r--r--tests/test_env.py22
-rw-r--r--tests/test_highlighting.py16
-rw-r--r--tests/test_intersphinx.py112
-rw-r--r--tests/test_markup.py33
-rw-r--r--tests/test_metadata.py69
-rw-r--r--tests/test_quickstart.py6
-rw-r--r--tests/test_rst_domain.py26
-rw-r--r--tests/test_search.py4
-rw-r--r--tests/test_theming.py4
-rw-r--r--tests/util.py5
-rwxr-xr-xutils/check_sources.py6
-rw-r--r--utils/pylintrc2
294 files changed, 28517 insertions, 11071 deletions
diff --git a/.hgignore b/.hgignore
index f617875e8..612c93310 100644
--- a/.hgignore
+++ b/.hgignore
@@ -1,11 +1,16 @@
.*\.pyc
.*\.egg
.*\.so
-build/
-dist/
-tests/.coverage
-sphinx/pycode/Grammar.*pickle
-Sphinx.egg-info/
-doc/_build/
-TAGS
-\.ropeproject/
+.dir-locals.el
+\.DS_Store$
+^build/
+^dist/
+^tests/.coverage
+^sphinx/pycode/Grammar.*pickle
+^Sphinx.egg-info/
+^doc/_build/
+^TAGS
+^\.ropeproject/
+^env/
+\.DS_Store$
+~$
diff --git a/AUTHORS b/AUTHORS
index 259c0949c..10120c7b4 100644
--- a/AUTHORS
+++ b/AUTHORS
@@ -5,6 +5,8 @@ Substantial parts of the templates were written by Armin Ronacher
Other contributors, listed alphabetically, are:
+* Andi Albrecht -- agogo theme
+* Henrique Bastos -- SVG support for graphviz extension
* Daniel Bültmann -- todo extension
* Michael Droettboom -- inheritance_diagram extension
* Charles Duffy -- original graphviz extension
@@ -13,13 +15,20 @@ Other contributors, listed alphabetically, are:
* Martin Hans -- autodoc improvements
* Dave Kuhlman -- original LaTeX writer
* Thomas Lamb -- linkcheck builder
+* Dan MacKinlay -- metadata fixes
+* Martin Mahner -- nature theme
* Will Maier -- directory HTML builder
+* Roland Meister -- epub builder
+* Ezio Melotti -- collapsible sidebar JavaScript
+* Daniel Neuhäuser -- JavaScript domain
* Christopher Perkins -- autosummary integration
* Benjamin Peterson -- unittests
+* T. Powers -- HTML output improvements
* Stefan Seefeld -- toctree improvements
* Antonio Valentino -- qthelp builder
* Pauli Virtanen -- autodoc improvements, autosummary extension
* Stefan van der Walt -- autosummary extension
+* Barry Warsaw -- setup command improvements
* Sebastian Wiesner -- image handling, distutils support
Many thanks for all contributions!
diff --git a/CHANGES b/CHANGES
index 2adf4a3fa..754b68266 100644
--- a/CHANGES
+++ b/CHANGES
@@ -1,3 +1,143 @@
+Release 1.0 (in development)
+============================
+
+Incompatible changes
+--------------------
+
+* Support for domains has been added. A domain is a collection of
+ directives and roles that all describe objects belonging together,
+ e.g. elements of a programming language. A few builtin domains are
+ provided:
+
+ - Python
+ - C
+ - C++
+ - JavaScript
+ - reStructuredText
+
+* The old markup for defining and linking to C directives will not work
+ anymore without activating the ``oldcmarkup`` extension.
+
+* Removed support for old dependency versions; requirements are now:
+
+ - docutils >= 0.5
+ - Jinja2 >= 2.2
+
+* Removed deprecated elements:
+
+ - ``exclude_dirs`` config value
+ - ``sphinx.builder`` module
+
+Features added
+--------------
+
+* General:
+
+ - Added a "nitpicky" mode that emits warnings for all missing
+ references. It is activated by the ``-n`` command-line switch or
+ the ``nitpicky`` config value.
+ - Added ``latexpdf`` target in quickstart Makefile.
+
+* Markup:
+
+ - The ``menuselection`` and ``guilabel`` roles now support ampersand
+ accelerators.
+ - New more compact doc field syntax is now recognized: ``:param type
+ name: description``.
+ - Added ``tab-width`` option to ``literalinclude`` directive.
+ - Added ``titlesonly`` option to ``toctree`` directive.
+ - Added the ``prepend`` and ``append`` options to the
+ ``literalinclude`` directive.
+ - #284: All docinfo metadata is now put into the document metadata, not
+ just the author.
+
+* Configuration:
+
+ - Added ``rst_prolog`` config value.
+ - Added ``html_secnumber_suffix`` config value to control section
+ numbering format.
+ - Added ``html_compact_lists`` config value to control docutils'
+ compact lists feature.
+ - The ``html_sidebars`` config value can now contain patterns as
+ keys, and the values can be lists that explicitly select which
+ sidebar templates should be rendered. That means that the builtin
+ sidebar contents can be included only selectively.
+ - ``html_static_path`` can now contain single file entries.
+ - The new universal config value ``exclude_patterns`` makes the
+ old ``unused_docs``, ``exclude_trees`` and ``exclude_dirnames``
+ obsolete.
+ - Added ``html_output_encoding`` config value.
+ - Added the ``latex_docclass`` config value and made the "twoside"
+ documentclass option overridable by "oneside".
+ - Added the ``trim_doctest_flags`` config value, which is true by
+ default.
+ - Added ``html_show_copyright`` config value.
+ - Added ``latex_show_pagerefs`` and ``latex_show_urls`` config values.
+
+* New builders:
+
+ - Added a builder for the Epub format.
+ - Added a builder for manual pages.
+ - Added a single-file HTML builder.
+
+* HTML output:
+
+ - Inline roles now get a CSS class with their name, allowing styles to
+ customize their appearance. Domain-specific roles get two classes,
+ ``domain`` and ``domain-rolename``.
+ - References now get the class ``internal`` if they are internal to
+ the whole project, as opposed to internal to the current page.
+ - External references can be styled differently with the new
+ ``externalrefs`` theme option for the default theme.
+ - In the default theme, the sidebar can experimentally now be made
+ collapsible using the new ``collapsiblesidebar`` theme option.
+ - #129: Toctrees are now wrapped in a ``div`` tag with class
+ ``toctree-wrapper`` in HTML output.
+ - The ``toctree()`` callable in templates now has a ``maxdepth``
+ keyword argument to control the depth of the generated tree.
+ - Added ``htmltitle`` block in layout template.
+ - In the JavaScript search, allow searching for object names including
+ the module name, like ``sys.argv``.
+ - Added new theme ``haiku``, inspired by the Haiku OS user guide.
+ - Added new theme ``nature``.
+ - Added new theme ``agogo``, created by Andi Albrecht.
+ - Added new theme ``scrolls``, created by Armin Ronacher.
+ - #193: Added a ``visitedlinkcolor`` theme option to the default
+ theme.
+
+* Extension API:
+
+ - Added ``html-collect-pages`` event.
+ - Added ``needs_sphinx`` config value and ``Sphinx.require_sphinx``
+ application API function.
+ - #200: Added ``Sphinx.add_stylesheet()``.
+
+* Extensions:
+
+ - Added the ``viewcode`` extension.
+ - Added the ``extlinks`` extension.
+ - Added support for source ordering of members in autodoc, with
+ ``autodoc_member_order = 'bysource'``.
+ - Added ``autodoc_default_flags`` config value, which can be used to
+ select default flags for all autodoc directives.
+ - Added a way for intersphinx to refer to named labels in other
+ projects, and to specify the project you want to link to.
+ - #280: Autodoc can now document instance attributes assigned in
+ ``__init__`` methods.
+ - Many improvements and fixes to the ``autosummary`` extension, thanks
+ to Pauli Virtanen.
+ - #309: The ``graphviz`` extension can now output SVG instead of PNG
+ images, controlled by the ``graphviz_output_format`` config value.
+ - Added ``alt`` option to ``graphviz`` extension directives.
+
+* Translations:
+
+ - Added Croatian translation, thanks to Bojan Mihelač.
+ - Added Turkish translation, thanks to Firat Ozgul.
+ - Added Catalan translation, thanks to Pau Fernández.
+ - Added simplified Chinese translation.
+
+
Release 0.6.7 (in development)
==============================
diff --git a/EXAMPLES b/EXAMPLES
index f4dc9f90c..764d0de00 100644
--- a/EXAMPLES
+++ b/EXAMPLES
@@ -1,97 +1,149 @@
Projects using Sphinx
=====================
-This is an (incomplete) alphabetic list of projects that use Sphinx or are
-experimenting with using it for their documentation. If you like to be
-included, please mail to `the Google group
+This is an (incomplete) alphabetic list of projects that use Sphinx or
+are experimenting with using it for their documentation. If you like to
+be included, please mail to `the Google group
<http://groups.google.com/group/sphinx-dev>`_.
-* Advanced Generic Widgets: http://xoomer.virgilio.it/infinity77/AGW_Docs/index.html
-* Applied Mathematics at the Stellenbosch University: http://dip.sun.ac.za/
+I've grouped the list into sections to make it easier to find
+interesting examples.
+
+Documentation using the default theme
+-------------------------------------
+
* APSW: http://apsw.googlecode.com/svn/publish/index.html
* ASE: https://wiki.fysik.dtu.dk/ase/
-* Bazaar: http://doc.bazaar.canonical.com/en/
-* Blender: http://www.blender.org/documentation/250PythonDoc/
* boostmpi: http://documen.tician.de/boostmpi/
* Calibre: http://calibre.kovidgoyal.net/user_manual/
-* Chaco: http://code.enthought.com/projects/chaco/docs/html/
* CodePy: http://documen.tician.de/codepy/
* Cython: http://docs.cython.org/
* C\\C++ Python language binding project: http://language-binding.net/index.html
* Director: http://packages.python.org/director/
-* Djagios: http://djagios.org/
-* Django: http://docs.djangoproject.com/
* F2py: http://www.f2py.org/html/
-* Fityk: http://www.unipress.waw.pl/fityk/
* GeoDjango: http://geodjango.org/docs/
-* GeoServer: http://docs.geoserver.org/
-* Glashammer: http://glashammer.org/
-* GPAW: https://wiki.fysik.dtu.dk/gpaw/
-* Grok: http://grok.zope.org/doc/current/
* GSL Shell: http://www.nongnu.org/gsl-shell/
* Hedge: http://documen.tician.de/hedge/
-* IFM: http://fluffybunny.memebot.com/ifm-docs/index.html
-* Jinja: http://jinja.pocoo.org/2/documentation/
* Kaa: http://doc.freevo.org/api/kaa/
-* LEPL: http://www.acooke.org/lepl/
-* MapServer: http://mapserver.org/
-* Matplotlib: http://matplotlib.sourceforge.net/
-* Mayavi: http://code.enthought.com/projects/mayavi/docs/development/html/mayavi
* MeshPy: http://documen.tician.de/meshpy/
-* MirrorBrain: http://mirrorbrain.org/docs/
-* Mixin.com: http://dev.mixin.com/
* mpmath: http://mpmath.googlecode.com/svn/trunk/doc/build/index.html
-* MyHDL: http://www.myhdl.org/doc/0.6/
-* NetworkX: http://networkx.lanl.gov/
-* nose: http://somethingaboutorange.com/mrl/projects/nose/
-* NumPy: http://docs.scipy.org/doc/numpy/reference/
-* ObjectListView: http://objectlistview.sourceforge.net/python
* OpenEXR: http://excamera.com/articles/26/doc/index.html
* OpenGDA: http://www.opengda.org/gdadoc/html/
-* OpenLayers: http://docs.openlayers.org/
* openWNS: http://docs.openwns.org/
* Paste: http://pythonpaste.org/script/
* Paver: http://www.blueskyonmars.com/projects/paver/
-* Peach^3: http://peach3.nl/doc/latest/userdoc/
-* Py on Windows: http://timgolden.me.uk/python-on-windows/
+* Pyccuracy: http://www.pyccuracy.org/
* PyCuda: http://documen.tician.de/pycuda/
-* PyEphem: http://rhodesmill.org/pyephem/
* Pyevolve: http://pyevolve.sourceforge.net/
-* PyLit: http://pylit.berlios.de/
* Pylo: http://documen.tician.de/pylo/
-* Pylons: http://docs.pylonshq.com/
-* PyMOTW: http://www.doughellmann.com/PyMOTW/
* PyPubSub: http://pubsub.sourceforge.net/
* pyrticle: http://documen.tician.de/pyrticle/
-* Pysparse: http://pysparse.sourceforge.net/
-* PyTango: http://www.tango-controls.org/static/PyTango/latest/doc/html/index.html
* Python: http://docs.python.org/
-* python-apt: http://people.debian.org/~jak/python-apt-doc/
+* python-apt: http://apt.alioth.debian.org/python-apt-doc/
* PyUblas: http://documen.tician.de/pyublas/
-* Quex: http://quex.sourceforge.net/
-* Reteisi: http://docs.argolinux.org/reteisi/
-* Roundup: http://www.roundup-tracker.org/
+* Quex: http://quex.sourceforge.net/doc/html/main.html
+* Scapy: http://www.secdev.org/projects/scapy/doc/
+* SimPy: http://simpy.sourceforge.net/SimPyDocs/index.html
+* SymPy: http://docs.sympy.org/
+* WTForms: http://wtforms.simplecodes.com/docs/
+* z3c: http://docs.carduner.net/z3c-tutorial/
+
+
+Documentation using a customized version of the default theme
+-------------------------------------------------------------
+
+* Advanced Generic Widgets:
+ http://xoomer.virgilio.it/infinity77/AGW_Docs/index.html
+* Bazaar: http://doc.bazaar.canonical.com/en/
+* Chaco: http://code.enthought.com/projects/chaco/docs/html/
+* Djagios: http://djagios.org/
+* GetFEM++: http://home.gna.org/getfem/
+* GPAW: https://wiki.fysik.dtu.dk/gpaw/
+* Grok: http://grok.zope.org/doc/current/
+* IFM: http://fluffybunny.memebot.com/ifm-docs/index.html
+* LEPL: http://www.acooke.org/lepl/
+* Mayavi: http://code.enthought.com/projects/mayavi/docs/development/html/mayavi
+* NOC: http://trac.nocproject.org/trac/wiki/NocGuide
+* NumPy: http://docs.scipy.org/doc/numpy/reference/
+* Peach^3: http://peach3.nl/doc/latest/userdoc/
+* Py on Windows: http://timgolden.me.uk/python-on-windows/
+* PyLit: http://pylit.berlios.de/
* Sage: http://sagemath.org/doc/
+* SciPy: http://docs.scipy.org/doc/scipy/reference/
+* simuPOP: http://simupop.sourceforge.net/manual_release/build/userGuide.html
+* Sprox: http://sprox.org/
+* TurboGears: http://turbogears.org/2.0/docs/
+* Zope: http://docs.zope.org/zope2/index.html
+* zc.async: http://packages.python.org/zc.async/1.5.0/
+
+
+Documentation using the sphinxdoc theme
+---------------------------------------
+
+* Fityk: http://www.unipress.waw.pl/fityk/
+* MapServer: http://mapserver.org/
+* Matplotlib: http://matplotlib.sourceforge.net/
+* MyHDL: http://www.myhdl.org/doc/0.6/
+* NetworkX: http://networkx.lanl.gov/
+* Pweave: http://mpastell.com/pweave/
+* Pysparse: http://pysparse.sourceforge.net/
+* PyTango:
+ http://www.tango-controls.org/static/PyTango/latest/doc/html/index.html
+* Reteisi: http://docs.argolinux.org/reteisi/
* Satchmo: http://www.satchmoproject.com/docs/svn/
-* Scapy: http://www.secdev.org/projects/scapy/doc/
-* Selenium: http://seleniumhq.org/docs/
-* Self: http://selflanguage.org/
-* SimPy: http://simpy.sourceforge.net/
* Sphinx: http://sphinx.pocoo.org/
-* Sprox: http://sprox.org/
-* SQLAlchemy: http://www.sqlalchemy.org/docs/
* Sqlkit: http://sqlkit.argolinux.org/
-* sqlparse: http://python-sqlparse.googlecode.com/svn/docs/api/index.html
-* SymPy: http://docs.sympy.org/
-* tinyTiM: http://tinytim.sourceforge.net/docs/2.0/
-* The Wine Cellar Book: http://www.thewinecellarbook.com/doc/en/
* Total Open Station: http://tops.berlios.de/
-* TurboGears: http://turbogears.org/2.0/docs/
-* VOR: http://www.vor-cycling.be/
* WebFaction: http://docs.webfaction.com/
+
+
+Documentation using another builtin theme
+-----------------------------------------
+
+* C/C++ Development with Eclipse: http://book.dehlia.in/c-cpp-eclipse/ (agogo)
+* Distribute: http://packages.python.org/distribute/ (nature)
+* Jinja: http://jinja.pocoo.org/2/documentation/ (scrolls)
+* pip: http://pip.openplans.org/ (nature)
+* Programmieren mit PyGTK und Glade (German):
+ http://www.florian-diesch.de/doc/python-und-glade/online/ (agogo)
+* sqlparse: http://python-sqlparse.googlecode.com/svn/docs/api/index.html
+ (agogo)
+
+
+Documentation using a custom theme/integrated in a site
+-------------------------------------------------------
+
+* Blender: http://www.blender.org/documentation/250PythonDoc/
+* Blinker: http://discorporate.us/projects/Blinker/docs/
+* Classy: classy: http://classy.pocoo.org/
+* Django: http://docs.djangoproject.com/
+* Flask: http://flask.pocoo.org/docs/
+* Flask-OpenID: http://packages.python.org/Flask-OpenID/
+* GeoServer: http://docs.geoserver.org/
+* Glashammer: http://glashammer.org/
+* MirrorBrain: http://mirrorbrain.org/docs/
+* nose: http://somethingaboutorange.com/mrl/projects/nose/
+* ObjectListView: http://objectlistview.sourceforge.net/python
+* Open ERP: http://doc.openerp.com/
+* OpenLayers: http://docs.openlayers.org/
+* PyEphem: http://rhodesmill.org/pyephem/
+* Pylons: http://pylonshq.com/docs/en/0.9.7/
+* PyMOTW: http://www.doughellmann.com/PyMOTW/
+* Roundup: http://www.roundup-tracker.org/
+* Selenium: http://seleniumhq.org/docs/
+* Self: http://selflanguage.org/
+* SQLAlchemy: http://www.sqlalchemy.org/docs/
+* tinyTiM: http://tinytim.sourceforge.net/docs/2.0/
+* Werkzeug: http://werkzeug.pocoo.org/documentation/dev/
* WFront: http://discorporate.us/projects/WFront/
-* WTForms: http://wtforms.simplecodes.com/docs/
-* Zope 3: e.g. http://docs.carduner.net/z3c-tutorial/
-* zc.async: http://packages.python.org/zc.async/1.5.0/
-.. XXX maybe regroup by interesting features used?
+
+Homepages and other non-documentation sites
+-------------------------------------------
+
+* Applied Mathematics at the Stellenbosch University: http://dip.sun.ac.za/
+* A personal page: http://www.dehlia.in/
+* Benoit Boissinot: http://perso.ens-lyon.fr/benoit.boissinot/
+* lunarsite: http://lunaryorn.de/
+* The Wine Cellar Book: http://www.thewinecellarbook.com/doc/en/
+* VOR: http://www.vor-cycling.be/
diff --git a/Makefile b/Makefile
index b7716b592..90f7c3d46 100644
--- a/Makefile
+++ b/Makefile
@@ -9,7 +9,7 @@ all: clean-pyc check test
check:
@$(PYTHON) utils/check_sources.py -i build -i dist -i sphinx/style/jquery.js \
-i sphinx/pycode/pgen2 -i sphinx/util/smartypants.py -i .ropeproject \
- -i doc/_build -i ez_setup.py -i tests/path.py -i tests/coverage.py .
+ -i doc/_build -i ez_setup.py -i tests/path.py -i tests/coverage.py -i env .
clean: clean-pyc clean-patchfiles
diff --git a/doc/Makefile b/doc/Makefile
index 89b01a085..d6a0cf72c 100644
--- a/doc/Makefile
+++ b/doc/Makefile
@@ -9,9 +9,9 @@ PAPER =
PAPEROPT_a4 = -D latex_paper_size=a4
PAPEROPT_letter = -D latex_paper_size=letter
ALLSPHINXOPTS = -d _build/doctrees $(PAPEROPT_$(PAPER)) \
- $(SPHINXOPTS) .
+ $(SPHINXOPTS) $(O) .
-.PHONY: help clean html dirhtml pickle htmlhelp qthelp latex changes linkcheck doctest
+.PHONY: help clean html dirhtml pickle htmlhelp qthelp latex changes linkcheck doctest man
help:
@echo "Please use \`make <target>' where <target> is one of"
@@ -20,7 +20,9 @@ help:
@echo " pickle to make pickle files"
@echo " json to make json files"
@echo " htmlhelp to make HTML files and a HTML help project"
+ @echo " epub to make an epub file"
@echo " latex to make LaTeX files, you can set PAPER=a4 or PAPER=letter"
+ @echo " man to make manual pages"
@echo " changes to make an overview over all changed/added/deprecated items"
@echo " linkcheck to check all external links for integrity"
@@ -28,25 +30,31 @@ clean:
-rm -rf _build/*
html:
- mkdir -p _build/html _build/doctrees
$(SPHINXBUILD) -b html $(ALLSPHINXOPTS) _build/html
@echo
@echo "Build finished. The HTML pages are in _build/html."
dirhtml:
- mkdir -p _build/dirhtml _build/doctrees
$(SPHINXBUILD) -b dirhtml $(ALLSPHINXOPTS) _build/dirhtml
@echo
@echo "Build finished. The HTML pages are in _build/dirhtml."
+singlehtml:
+ $(SPHINXBUILD) -b singlehtml $(ALLSPHINXOPTS) _build/singlehtml
+ @echo
+ @echo "Build finished. The HTML page is in _build/singlehtml."
+
text:
- mkdir -p _build/text _build/doctrees
$(SPHINXBUILD) -b text $(ALLSPHINXOPTS) _build/text
@echo
@echo "Build finished."
+man:
+ $(SPHINXBUILD) -b man $(ALLSPHINXOPTS) _build/man
+ @echo
+ @echo "Build finished."
+
pickle:
- mkdir -p _build/pickle _build/doctrees
$(SPHINXBUILD) -b pickle $(ALLSPHINXOPTS) _build/pickle
json:
@@ -54,14 +62,12 @@ json:
$(SPHINXBUILD) -b json $(ALLSPHINXOPTS) _build/json
htmlhelp:
- mkdir -p _build/htmlhelp _build/doctrees
$(SPHINXBUILD) -b htmlhelp $(ALLSPHINXOPTS) _build/htmlhelp
@echo
@echo "Build finished; now you can run HTML Help Workshop with the" \
".hhp project file in _build/htmlhelp."
qthelp:
- mkdir -p _build/qthelp _build/doctrees
$(SPHINXBUILD) -b qthelp $(ALLSPHINXOPTS) _build/qthelp
@echo
@echo "Build finished; now you can run qcollectiongenerator with the" \
@@ -70,8 +76,12 @@ qthelp:
@echo "To view the help collection:"
@echo "# assistant -collectionFile _build/qthelp/Sphinx.qhc"
+epub:
+ $(SPHINXBUILD) -b epub $(ALLSPHINXOPTS) _build/epub
+ @echo
+ @echo "Build finished. The epub file is in _build/epub."
+
latex:
- mkdir -p _build/latex _build/doctrees
$(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) _build/latex
@echo
@echo "Build finished; the LaTeX files are in _build/latex."
@@ -79,18 +89,15 @@ latex:
"run these through (pdf)latex."
changes:
- mkdir -p _build/changes _build/doctrees
$(SPHINXBUILD) -b changes $(ALLSPHINXOPTS) _build/changes
@echo
@echo "The overview file is in _build/changes."
linkcheck:
- mkdir -p _build/linkcheck _build/doctrees
$(SPHINXBUILD) -b linkcheck $(ALLSPHINXOPTS) _build/linkcheck
@echo
@echo "Link check complete; look for any errors in the above output " \
"or in _build/linkcheck/output.txt."
doctest:
- mkdir -p _build/doctest _build/doctrees
$(SPHINXBUILD) -b doctest $(ALLSPHINXOPTS) _build/doctest
diff --git a/doc/_templates/index.html b/doc/_templates/index.html
index a68a62514..524b2ffb6 100644
--- a/doc/_templates/index.html
+++ b/doc/_templates/index.html
@@ -4,7 +4,7 @@
<h1>Welcome</h1>
<div class="quotebar">
- <p>What users say:</p>
+ <p><em>What users say:</em></p>
<p>&ldquo;Cheers for a great tool that actually makes programmers <b>want</b>
to write documentation!&rdquo;</p>
</div>
@@ -12,28 +12,30 @@
<p>
Sphinx is a tool that makes it easy to create intelligent and beautiful
documentation, written by Georg Brandl and licensed under the BSD license.</p>
- <p>It was originally created to translate <a href="http://docs.python.org/dev/">the
- new Python documentation</a>, and it has excellent support for the documentation
- of Python projects, but other documents can be written with it too. Of course,
- this site is also created from reStructuredText sources using Sphinx!
+ <p>It was originally created for <a href="http://docs.python.org/dev/">the
+ new Python documentation</a>, and it has excellent facilities for the
+ documentation of Python projects, but C/C++ is already supported as well,
+ and it is planned to add special support for other languages as well. Of
+ course, this site is also created from reStructuredText sources using
+ Sphinx!
</p>
<p>
- It is still under constant development, and the following features are
- already present, work fine and can be seen &#8220;in action&#8221; in the
- Python docs:
+ Sphinx is under constant development. The following features are present,
+ work fine and can be seen &#8220;in action&#8221; in the Python docs:
</p>
<ul>
- <li><b>Output formats:</b> HTML (including Windows HTML Help) and LaTeX, for
- printable PDF versions</li>
+ <li><b>Output formats:</b> HTML (including Windows HTML Help), LaTeX (for
+ printable PDF versions), manual pages, plain text</li>
<li><b>Extensive cross-references:</b> semantic markup and automatic links
- for functions, classes, glossary terms and similar pieces of information</li>
+ for functions, classes, citations, glossary terms and similar pieces of
+ information</li>
<li><b>Hierarchical structure:</b> easy definition of a document tree, with
- automatic links to siblings, parents and children</li>
+ automatic links to siblings, parents and children</li>
<li><b>Automatic indices:</b> general index as well as a module index</li>
<li><b>Code handling:</b> automatic highlighting using the <a
- href="http://pygments.org">Pygments</a> highlighter</li>
+ href="http://pygments.org">Pygments</a> highlighter</li>
<li><b>Extensions:</b> automatic testing of code snippets, inclusion of
- docstrings from Python modules, and more</li>
+ docstrings from Python modules (API docs), and more</li>
</ul>
<p>
Sphinx uses <a href="http://docutils.sf.net/rst.html">reStructuredText</a>
@@ -42,45 +44,46 @@
suite, the <a href="http://docutils.sf.net/">Docutils</a>.
</p>
- <h2>Examples</h2>
- <p>
- The <a href="http://docs.python.org/dev/">Python documentation</a> and
- this page are different examples of Sphinx in use.
- You can also download PDF versions of the Sphinx documentation:
- a <a href="http://sphinx.pocoo.org/sphinx.pdf">version</a> generated from
- the LaTeX Sphinx produces, and a
- <a href="http://sphinx.pocoo.org/sphinx-rst2pdf.pdf">version</a> generated by rst2pdf.
- </p>
- <p>
- For examples of how Sphinx source files look, use the &#8220;Show source&#8221;
- links on all pages of the documentation apart from this welcome page.
- </p>
- <p>Links to more documentation generated with Sphinx can be found on the
- <a href="{{ pathto("examples") }}">Projects using Sphinx</a> page.
- </p>
-
<h2>Documentation</h2>
<table class="contentstable" align="center" style="margin-left: 30px"><tr>
<td width="50%">
+ <p class="biglink"><a class="biglink" href="{{ pathto("tutorial") }}">First steps with Sphinx</a><br/>
+ <span class="linkdescr">overview of basic tasks</span></p>
<p class="biglink"><a class="biglink" href="{{ pathto("contents") }}">Contents</a><br/>
<span class="linkdescr">for a complete overview</span></p>
+ </td><td width="50%">
<p class="biglink"><a class="biglink" href="{{ pathto("search") }}">Search page</a><br/>
<span class="linkdescr">search the documentation</span></p>
- </td><td width="50%">
<p class="biglink"><a class="biglink" href="{{ pathto("genindex") }}">General Index</a><br/>
<span class="linkdescr">all functions, classes, terms</span></p>
- <p class="biglink"><a class="biglink" href="{{ pathto("modindex") }}">Module Index</a><br/>
- <span class="linkdescr">quick access to all documented modules</span></p>
</td></tr>
</table>
+ <p>
+ You can also download PDF versions of the Sphinx documentation:
+ a <a href="http://sphinx.pocoo.org/sphinx.pdf">version</a> generated from
+ the LaTeX Sphinx produces, and
+ a <a href="http://sphinx.pocoo.org/sphinx-rst2pdf.pdf">version</a> generated
+ by rst2pdf.
+ </p>
+
+ <h2>Examples</h2>
+ <p>Links to documentation generated with Sphinx can be found on the
+ <a href="{{ pathto("examples") }}">Projects using Sphinx</a> page.
+ </p>
+ <p>
+ For examples of how Sphinx source files look, use the &#8220;Show
+ source&#8221; links on all pages of the documentation apart from this
+ welcome page.
+ </p>
+
<p>You may also be interested in the very nice
<a href="http://matplotlib.sourceforge.net/sampledoc/">tutorial</a> on how to
create a customized documentation using Sphinx written by the matplotlib
developers.</p>
- <p>There is a <a href="http://sphinx.shibu.jp/">Japanese translation</a>
+ <p>There is a <a href="http://sphinx-users.jp/doc10/">Japanese translation</a>
of this documentation, thanks to Yoshiki Shibukawa.</p>
<h2>Get Sphinx</h2>
diff --git a/doc/_templates/layout.html b/doc/_templates/layout.html
index 080c0935a..6e609e1a1 100644
--- a/doc/_templates/layout.html
+++ b/doc/_templates/layout.html
@@ -1,8 +1,19 @@
{% extends "!layout.html" %}
+{% block extrahead %}
+{{ super() }}
+{%- if not embedded %}
+<style type="text/css">
+ table.right { float: right; margin-left: 20px; }
+ table.right td { border: 1px solid #ccc; }
+</style>
+{%- endif %}
+{% endblock %}
+
{% block rootrellink %}
<li><a href="{{ pathto('index') }}">Sphinx home</a>&nbsp;|&nbsp;</li>
- <li><a href="{{ pathto('contents') }}">Documentation</a>&raquo;</li>
+ <li><a href="{{ pathto('contents') }}">Documentation</a>
+ &raquo;</li>
{% endblock %}
{% block header %}
diff --git a/doc/builders.rst b/doc/builders.rst
index bc9bfabff..6e90ccc62 100644
--- a/doc/builders.rst
+++ b/doc/builders.rst
@@ -36,6 +36,17 @@ The builder's "name" must be given to the **-b** command-line option of
.. versionadded:: 0.6
+.. class:: SingleFileHTMLBuilder
+
+ This is an HTML builder that combines the whole project in one output file.
+ (Obviously this only works with smaller projects.) The file is named like
+ the master document. No indices will be generated.
+
+ Its name is ``singlehtml``.
+
+ .. versionadded:: 1.0
+
+.. module:: sphinx.builders.htmlhelp
.. class:: HTMLHelpBuilder
This builder produces the same output as the standalone HTML builder, but
@@ -44,6 +55,41 @@ The builder's "name" must be given to the **-b** command-line option of
Its name is ``htmlhelp``.
+.. module:: sphinx.builders.qthelp
+.. class:: QtHelpBuilder
+
+ This builder produces the same output as the standalone HTML builder, but
+ also generates `Qt help`_ collection support files that allow
+ the Qt collection generator to compile them.
+
+ Its name is ``qthelp``.
+
+ .. _Qt help: http://doc.trolltech.com/4.6/qthelp-framework.html
+
+.. module:: sphinx.builders.devhelp
+.. class:: DevhelpBuilder
+
+ This builder produces the same output as the standalone HTML builder, but
+ also generates `GNOME Devhelp <http://live.gnome.org/devhelp>`__
+ support file that allows the GNOME Devhelp reader to view them.
+
+ Its name is ``devhelp``.
+
+.. module:: sphinx.builders.epub
+.. class:: EpubBuilder
+
+ This builder produces the same output as the standalone HTML builder, but
+ also generates an *epub* file for ebook readers. See :ref:`epub-faq` for
+ details about it. For definition of the epub format, have a look at
+ `<http://www.idpf.org/specs.htm>`_ or `<http://en.wikipedia.org/wiki/EPUB>`_.
+
+ Some ebook readers do not show the link targets of references. Therefore
+ this builder adds the targets after the link when necessary. The display
+ of the URLs can be customized by adding CSS rules for the class
+ ``link-target``.
+
+ Its name is ``epub``.
+
.. module:: sphinx.builders.latex
.. class:: LaTeXBuilder
@@ -82,6 +128,22 @@ Note that a direct PDF builder using ReportLab is available in `rst2pdf
.. versionadded:: 0.4
+.. module:: sphinx.builders.manpage
+.. class:: ManualPageBuilder
+
+ This builder produces manual pages in the groff format. You have to specify
+ which documents are to be included in which manual pages via the
+ :confval:`man_pages` configuration value.
+
+ Its name is ``man``.
+
+ .. note::
+
+ This builder requires the docutils manual page writer, which is only
+ available as of docutils 0.6.
+
+ .. versionadded:: 1.0
+
.. currentmodule:: sphinx.builders.html
.. class:: SerializingHTMLBuilder
@@ -89,7 +151,7 @@ Note that a direct PDF builder using ReportLab is available in `rst2pdf
(`pickle`, `simplejson`, `phpserialize`, and others) to dump the generated
HTML documentation. The pickle builder is a subclass of it.
- A concreate subclass of this builder serializing to the `PHP serialization`_
+ A concrete subclass of this builder serializing to the `PHP serialization`_
format could look like this::
import phpserialize
@@ -161,8 +223,8 @@ Note that a direct PDF builder using ReportLab is available in `rst2pdf
.. module:: sphinx.builders.changes
.. class:: ChangesBuilder
- This builder produces an HTML overview of all :dir:`versionadded`,
- :dir:`versionchanged` and :dir:`deprecated` directives for the current
+ This builder produces an HTML overview of all :rst:dir:`versionadded`,
+ :rst:dir:`versionchanged` and :rst:dir:`deprecated` directives for the current
:confval:`version`. This is useful to generate a ChangeLog file, for
example.
@@ -234,8 +296,8 @@ The special files are located in the root output directory. They are:
``project``, ``copyright``, ``release``, ``version``
The same values as given in the configuration file.
- ``style``, ``use_modindex``
- :confval:`html_style` and :confval:`html_use_modindex`, respectively.
+ ``style``
+ :confval:`html_style`.
``last_updated``
Date of last build.
@@ -260,7 +322,9 @@ The special files are located in the root output directory. They are:
``environment.pickle``
The build environment. This is always a pickle file, independent of the
builder and a copy of the environment that was used when the builder was
- started. (XXX: document common members)
+ started.
+
+ .. todo:: Document common members.
- Unlike the other pickle files this pickle file requires that the sphinx
- module is available on unpickling.
+ Unlike the other pickle files this pickle file requires that the ``sphinx``
+ package is available on unpickling.
diff --git a/doc/conf.py b/doc/conf.py
index 415b0c8dd..e009fa1b4 100644
--- a/doc/conf.py
+++ b/doc/conf.py
@@ -2,109 +2,74 @@
#
# Sphinx documentation build configuration file
-import sys, os, re
+import re
+import sphinx
-# Add any Sphinx extension module names here, as strings. They can be extensions
-# coming with Sphinx (named 'sphinx.addons.*') or your custom ones.
extensions = ['sphinx.ext.autodoc', 'sphinx.ext.doctest', 'sphinx.ext.todo',
- 'sphinx.ext.autosummary']
-
-# Add any paths that contain templates here, relative to this directory.
-templates_path = ['_templates']
-
-# The suffix of source filenames.
-source_suffix = '.rst'
+ 'sphinx.ext.autosummary', 'sphinx.ext.extlinks']
-# The master toctree document.
master_doc = 'contents'
+templates_path = ['_templates']
+exclude_patterns = ['_build']
-# General substitutions.
project = 'Sphinx'
copyright = '2007-2010, Georg Brandl'
-
-# The default replacements for |version| and |release|, also used in various
-# other places throughout the built documents.
-import sphinx
version = sphinx.__released__
release = version
-
-# Show author directives in the output.
show_authors = True
-# The HTML template theme.
-html_theme = 'sphinxdoc'
-
-# A list of ignored prefixes names for module index sorting.
+html_theme = 'default'
+html_theme_options = {'collapsiblesidebar': True, 'stickysidebar': False}
modindex_common_prefix = ['sphinx.']
-
-# Add any paths that contain custom static files (such as style sheets) here,
-# relative to this directory. They are copied after the builtin static files,
-# so a file named "default.css" will overwrite the builtin "default.css".
html_static_path = ['_static']
-
-# If not '', a 'Last updated on:' timestamp is inserted at every page bottom,
-# using the given strftime format.
-html_last_updated_fmt = '%b %d, %Y'
-
-# Content template for the index page.
html_index = 'index.html'
-
-# Custom sidebar templates, maps page names to templates.
-html_sidebars = {'index': 'indexsidebar.html'}
-
-# Additional templates that should be rendered to pages, maps page names to
-# templates.
+html_sidebars = {'index': ['indexsidebar.html', 'searchbox.html']}
html_additional_pages = {'index': 'index.html'}
-
-# Generate an OpenSearch description with that URL as the base.
html_use_opensearch = 'http://sphinx.pocoo.org'
-# Output file base name for HTML help builder.
htmlhelp_basename = 'Sphinxdoc'
-# Grouping the document tree into LaTeX files. List of tuples
-# (source start file, target name, title, author, documentclass [howto/manual]).
+epub_theme = 'epub'
+epub_basename = 'sphinx'
+epub_author = 'Georg Brandl'
+epub_publisher = 'http://sphinx.pocoo.org/'
+epub_scheme = 'url'
+epub_identifier = epub_publisher
+epub_pre_files = [('index', 'Welcome')]
+epub_exclude_files = ['_static/opensearch.xml', '_static/doctools.js',
+ '_static/jquery.js', '_static/searchtools.js',
+ '_static/basic.css', 'search.html']
+
latex_documents = [('contents', 'sphinx.tex', 'Sphinx Documentation',
'Georg Brandl', 'manual', 1)]
-
-# Add our logo to the LaTeX file.
latex_logo = '_static/sphinx.png'
-
-# Additional stuff for the LaTeX preamble.
latex_elements = {
- 'fontpkg': '\\usepackage{palatino}'
+ 'fontpkg': '\\usepackage{palatino}',
}
-# Put TODOs into the output.
+autodoc_member_order = 'groupwise'
todo_include_todos = True
+extlinks = {'duref': ('http://docutils.sourceforge.net/docs/ref/rst/'
+ 'restructuredtext.html#%s', ''),
+ 'durole': ('http://docutils.sourceforge.net/docs/ref/rst/'
+ 'roles.html#%s', ''),
+ 'dudir': ('http://docutils.sourceforge.net/docs/ref/rst/'
+ 'directives.html#%s', '')}
+
+man_pages = [
+ ('contents', 'sphinx-all', 'Sphinx documentation generator system manual',
+ 'Georg Brandl', 1),
+ ('man/sphinx-build', 'sphinx-build', 'Sphinx documentation generator tool',
+ '', 1),
+ ('man/sphinx-quickstart', 'sphinx-quickstart', 'Sphinx documentation '
+ 'template generator', '', 1),
+]
# -- Extension interface -------------------------------------------------------
from sphinx import addnodes
-dir_sig_re = re.compile(r'\.\. ([^:]+)::(.*)$')
-
-def parse_directive(env, sig, signode):
- if not sig.startswith('.'):
- dec_sig = '.. %s::' % sig
- signode += addnodes.desc_name(dec_sig, dec_sig)
- return sig
- m = dir_sig_re.match(sig)
- if not m:
- signode += addnodes.desc_name(sig, sig)
- return sig
- name, args = m.groups()
- dec_name = '.. %s::' % name
- signode += addnodes.desc_name(dec_name, dec_name)
- signode += addnodes.desc_addname(args, args)
- return name
-
-
-def parse_role(env, sig, signode):
- signode += addnodes.desc_name(':%s:' % sig, ':%s:' % sig)
- return sig
-
event_sig_re = re.compile(r'([a-zA-Z-]+)\s*\((.*)\)')
@@ -126,9 +91,7 @@ def parse_event(env, sig, signode):
def setup(app):
from sphinx.ext.autodoc import cut_lines
app.connect('autodoc-process-docstring', cut_lines(4, what=['module']))
- app.add_description_unit('directive', 'dir', 'pair: %s; directive',
- parse_directive)
- app.add_description_unit('role', 'role', 'pair: %s; role', parse_role)
app.add_description_unit('confval', 'confval',
- 'pair: %s; configuration value')
+ objname='configuration value',
+ indextemplate='pair: %s; configuration value')
app.add_description_unit('event', 'event', 'pair: %s; event', parse_event)
diff --git a/doc/config.rst b/doc/config.rst
index c118d165c..d968ce551 100644
--- a/doc/config.rst
+++ b/doc/config.rst
@@ -1,5 +1,7 @@
.. highlightlang:: python
+.. _build-config:
+
The build configuration file
============================
@@ -85,7 +87,29 @@ General configuration
.. confval:: master_doc
The document name of the "master" document, that is, the document that
- contains the root :dir:`toctree` directive. Default is ``'contents'``.
+ contains the root :rst:dir:`toctree` directive. Default is ``'contents'``.
+
+.. confval:: exclude_patterns
+
+ A list of glob-style patterns that should be excluded when looking for source
+ files. [1]_ They are matched against the source file names relative to the
+ source directory, using slashes as directory separators on all platforms.
+
+ Example patterns:
+
+ - ``'library/xml.rst'`` -- ignores the ``library/xml.rst`` file (replaces
+ entry in :confval:`unused_docs`
+ - ``'library/xml'`` -- ignores the ``library/xml`` directory (replaces entry
+ in :confval:`exclude_trees`)
+ - ``'library/xml*'`` -- ignores all files and directories starting with
+ ``library/xml``
+ - ``'**/.svn'`` -- ignores all ``.svn`` directories (replaces entry in
+ :confval:`exclude_dirnames`)
+
+ :confval:`exclude_patterns` is also consulted when looking for static files
+ in :confval:`html_static_path`.
+
+ .. versionadded:: 1.0
.. confval:: unused_docs
@@ -93,6 +117,9 @@ General configuration
toctree. Use this setting to suppress the warning that is normally emitted
in that case.
+ .. deprecated:: 1.0
+ Use :confval:`exclude_patterns` instead.
+
.. confval:: exclude_trees
A list of directory paths, relative to the source directory, that are to be
@@ -101,6 +128,9 @@ General configuration
.. versionadded:: 0.4
+ .. deprecated:: 1.0
+ Use :confval:`exclude_patterns` instead.
+
.. confval:: exclude_dirnames
A list of directory names that are to be excluded from any recursive
@@ -110,15 +140,8 @@ General configuration
.. versionadded:: 0.5
-.. confval:: exclude_dirs
-
- A list of directory names, relative to the source directory, that are to be
- excluded from the search for source files.
-
- .. deprecated:: 0.5
- This does not take subdirs of the excluded directories into account. Use
- :confval:`exclude_trees` or :confval:`exclude_dirnames`, which match the
- expectations.
+ .. deprecated:: 1.0
+ Use :confval:`exclude_patterns` instead.
.. confval:: locale_dirs
@@ -126,10 +149,11 @@ General configuration
Directories in which to search for additional Sphinx message catalogs (see
:confval:`language`), relative to the source directory. The directories on
- this path are searched by the standard :mod:`gettext` module for a domain of
- ``sphinx``; so if you add the directory :file:`./locale` to this settting,
- the message catalogs (compiled from ``.po`` format using :program:`msgfmt`)
- must be in :file:`./locale/{language}/LC_MESSAGES/sphinx.mo`.
+ this path are searched by the standard :mod:`gettext` module for a text
+ domain of ``sphinx``; so if you add the directory :file:`./locale` to this
+ settting, the message catalogs (compiled from ``.po`` format using
+ :program:`msgfmt`) must be in
+ :file:`./locale/{language}/LC_MESSAGES/sphinx.mo`.
The default is ``[]``.
@@ -161,17 +185,38 @@ General configuration
.. versionadded:: 0.6
+.. confval:: rst_prolog
+
+ A string of reStructuredText that will be included at the beginning of every
+ source file that is read.
+
+ .. versionadded:: 1.0
+
+.. confval:: primary_domain
+
+ .. index:: default; domain
+ primary; domain
+
+ The name of the default :ref:`domain <domains>`. Can also be ``None`` to
+ disable a default domain. The default is ``'py'``. Those objects in other
+ domains (whether the domain name is given explicitly, or selected by a
+ :rst:dir:`default-domain` directive) will have the domain name explicitly
+ prepended when named (e.g., when the default domain is C, Python functions
+ will be named "Python function", not just "function").
+
+ .. versionadded:: 1.0
+
.. confval:: default_role
.. index:: default; role
The name of a reST role (builtin or Sphinx extension) to use as the default
role, that is, for text marked up ```like this```. This can be set to
- ``'obj'`` to make ```filter``` a cross-reference to the function "filter".
- The default is ``None``, which doesn't reassign the default role.
+ ``'py:obj'`` to make ```filter``` a cross-reference to the Python function
+ "filter". The default is ``None``, which doesn't reassign the default role.
The default role can always be set within individual documents using the
- standard reST :dir:`default-role` directive.
+ standard reST :rst:dir:`default-role` directive.
.. versionadded:: 0.4
@@ -185,15 +230,21 @@ General configuration
.. versionadded:: 0.5
+.. confval:: needs_sphinx
-.. confval:: modindex_common_prefix
+ If set to a ``major.minor`` version string like ``'1.1'``, Sphinx will
+ compare it with its version and refuse to build if it is too old. Default is
+ no requirement.
- A list of prefixes that are ignored for sorting the module index (e.g.,
- if this is set to ``['foo.']``, then ``foo.bar`` is shown under ``B``, not
- ``F``). This can be handy if you document a project that consists of a single
- package. Works only for the HTML builder currently. Default is ``[]``.
+ .. versionadded:: 1.0
- .. versionadded:: 0.6
+.. confval:: nitpicky
+
+ If true, Sphinx will warn about *all* references where the target cannot be
+ found. Default is ``False``. You can activate this mode temporarily using
+ the :option:`-n` command-line switch.
+
+ .. versionadded:: 1.0
Project information
@@ -232,19 +283,23 @@ Project information
Currently supported languages are:
+ * ``ca`` -- Catalan
* ``cs`` -- Czech
* ``de`` -- German
* ``en`` -- English
* ``es`` -- Spanish
* ``fi`` -- Finnish
* ``fr`` -- French
+ * ``hr`` -- Croatian
* ``it`` -- Italian
* ``nl`` -- Dutch
* ``pl`` -- Polish
* ``pt_BR`` -- Brazilian Portuguese
* ``ru`` -- Russian
* ``sl`` -- Slovenian
+ * ``tr`` -- Turkish
* ``uk_UA`` -- Ukrainian
+ * ``zh_CN`` -- Simplified Chinese
* ``zh_TW`` -- Traditional Chinese
.. confval:: today
@@ -287,14 +342,24 @@ Project information
.. confval:: add_module_names
A boolean that decides whether module names are prepended to all
- :term:`description unit` titles, e.g. for :dir:`function` directives.
- Default is ``True``.
+ :term:`object` names (for object types where a "module" of some kind is
+ defined), e.g. for :rst:dir:`function` directives. Default is ``True``.
.. confval:: show_authors
- A boolean that decides whether :dir:`moduleauthor` and :dir:`sectionauthor`
+ A boolean that decides whether :rst:dir:`moduleauthor` and :rst:dir:`sectionauthor`
directives produce any output in the built files.
+.. confval:: modindex_common_prefix
+
+ A list of prefixes that are ignored for sorting the Python module index
+ (e.g., if this is set to ``['foo.']``, then ``foo.bar`` is shown under ``B``,
+ not ``F``). This can be handy if you document a project that consists of a
+ single package. Works only for the HTML builder currently. Default is
+ ``[]``.
+
+ .. versionadded:: 0.6
+
.. confval:: trim_footnote_reference_space
Trim spaces before footnote references that are necessary for the reST parser
@@ -302,6 +367,15 @@ Project information
.. versionadded:: 0.6
+.. confval:: trim_doctest_flags
+
+ If true, doctest flags (comments looking like ``# doctest: FLAG, ...``) at
+ the ends of lines are removed for all code blocks showing interactive Python
+ sessions (i.e. doctests). Default is true. See the extension
+ :mod:`~sphinx.ext.doctest` for more possibilities of including doctests.
+
+ .. versionadded:: 1.0
+
.. _html-options:
@@ -388,6 +462,9 @@ that use Sphinx' HTMLWriter class.
.. versionchanged:: 0.4
The paths in :confval:`html_static_path` can now contain subdirectories.
+ .. versionchanged:: 1.0
+ The entries in :confval:`html_static_path` can now be single files.
+
.. confval:: html_last_updated_fmt
If this is not the empty string, a 'Last updated on:' timestamp is inserted
@@ -411,14 +488,53 @@ that use Sphinx' HTMLWriter class.
.. confval:: html_sidebars
Custom sidebar templates, must be a dictionary that maps document names to
- template names. Example::
+ template names.
+
+ The keys can contain glob-style patterns [1]_, in which case all matching
+ documents will get the specified sidebars. (A warning is emitted when a
+ more than one glob-style pattern matches for any document.)
+
+ The values can be either lists or single strings.
+
+ * If a value is a list, it specifies the complete list of sidebar templates
+ to include. If all or some of the default sidebars are to be included,
+ they must be put into this list as well.
+
+ The default sidebars (for documents that don't match any pattern) are:
+ ``['localtoc.html', 'relations.html', 'sourcelink.html',
+ 'searchbox.html']``.
+
+ * If a value is a single string, it specifies a custom sidebar to be added
+ between the ``'sourcelink.html'`` and ``'searchbox.html'`` entries. This
+ is for compatibility with Sphinx versions before 1.0.
+
+ Builtin sidebar templates that can be rendered are:
+
+ * **localtoc.html** -- a fine-grained table of contents of the current document
+ * **globaltoc.html** -- a coarse-grained table of contents for the whole
+ documentation set, collapsed
+ * **relations.html** -- two links to the previous and next documents
+ * **sourcelink.html** -- a link to the source of the current document, if
+ enabled in :confval:`html_show_sourcelink`
+ * **searchbox.html** -- the "quick search" box
+
+ Example::
html_sidebars = {
- 'using/windows': 'windowssidebar.html'
+ '**': ['globaltoc.html', 'sourcelink.html', 'searchbox.html'],
+ 'using/windows': ['windowssidebar.html', 'searchbox.html'],
}
- This will render the template ``windowssidebar.html`` within the sidebar of
- the given document.
+ This will render the custom template ``windowssidebar.html`` and the quick
+ search box within the sidebar of the given document, and render the default
+ sidebars for all other pages (except that the local TOC is replaced by the
+ global TOC).
+
+ .. versionadded:: 1.0
+ The ability to use globbing keys and to specify multiple sidebars.
+
+ Note that this value only has no effect if the chosen theme does not possess
+ a sidebar, like the builtin **scrolls** and **haiku** themes.
.. confval:: html_additional_pages
@@ -447,10 +563,25 @@ that use Sphinx' HTMLWriter class.
... old template content ...
{% endblock %}
+.. confval:: html_domain_indices
+
+ If true, generate domain-specific indices in addition to the general index.
+ For e.g. the Python domain, this is the global module index. Default is
+ ``True``.
+
+ This value can be a bool or a list of index names that should be generated.
+ To find out the index name for a specific index, look at the HTML file name.
+ For example, the Python module index has the name ``'py-modindex'``.
+
+ .. versionadded:: 1.0
+
.. confval:: html_use_modindex
If true, add a module index to the HTML documents. Default is ``True``.
+ .. deprecated:: 1.0
+ Use :confval:`html_domain_indices`.
+
.. confval:: html_use_index
If true, add an index to the HTML documents. Default is ``True``.
@@ -513,6 +644,12 @@ that use Sphinx' HTMLWriter class.
to translate document trees to HTML. Default is ``None`` (use the builtin
translator).
+.. confval:: html_show_copyright
+
+ If true, "(C) Copyright ..." is shown in the HTML footer. Default is ``True``.
+
+ .. versionadded:: 1.0
+
.. confval:: html_show_sphinx
If true, "Created using Sphinx" is shown in the HTML footer. Default is
@@ -520,11 +657,130 @@ that use Sphinx' HTMLWriter class.
.. versionadded:: 0.4
+.. confval:: html_output_encoding
+
+ Encoding of HTML output files. Default is ``'utf-8'``. Note that this
+ encoding name must both be a valid Python encoding name and a valid HTML
+ ``charset`` value.
+
+ .. versionadded:: 1.0
+
+.. confval:: html_compact_lists
+
+ If true, list items containing only a single paragraph will not be rendered
+ with a ``<p>`` element. This is standard docutils behavior. Default:
+ ``True``.
+
+ .. versionadded:: 1.0
+
+.. confval:: html_secnumber_suffix
+
+ Suffix for section numbers. Default: ``". "``. Set to ``" "`` to suppress
+ the final dot on section numbers.
+
+ .. versionadded:: 1.0
+
.. confval:: htmlhelp_basename
Output file base name for HTML help builder. Default is ``'pydoc'``.
+.. _epub-options:
+
+Options for epub output
+-----------------------
+
+These options influence the epub output. As this builder derives from the HTML
+builder, the HTML options also apply where appropriate. The actual values for
+some of the options is not really important, they just have to be entered into
+the `Dublin Core metadata <http://dublincore.org/>`_.
+
+.. confval:: epub_basename
+
+ The basename for the epub file. It defaults to the :confval:`project` name.
+
+.. confval:: epub_theme
+
+ The HTML theme for the epub output. Since the default themes are not
+ optimized for small screen space, using the same theme for HTML and epub
+ output is usually not wise. This defaults to ``'epub'``, a theme designed to
+ save visual space.
+
+.. confval:: epub_title
+
+ The title of the document. It defaults to the :confval:`html_title` option
+ but can be set independently for epub creation.
+
+.. confval:: epub_author
+
+ The author of the document. This is put in the Dublin Core metadata. The
+ default value is ``'unknown'``.
+
+.. confval:: epub_language
+
+ The language of the document. This is put in the Dublin Core metadata. The
+ default is the :confval:`language` option or ``'en'`` if unset.
+
+.. confval:: epub_publisher
+
+ The publisher of the document. This is put in the Dublin Core metadata. You
+ may use any sensible string, e.g. the project homepage. The default value is
+ ``'unknown'``.
+
+.. confval:: epub_copyright
+
+ The copyright of the document. It defaults to the :confval:`copyright`
+ option but can be set independently for epub creation.
+
+.. confval:: epub_identifier
+
+ An identifier for the document. This is put in the Dublin Core metadata.
+ For published documents this is the ISBN number, but you can also use an
+ alternative scheme, e.g. the project homepage. The default value is
+ ``'unknown'``.
+
+.. confval:: epub_scheme
+
+ The publication scheme for the :confval:`epub_identifier`. This is put in
+ the Dublin Core metadata. For published books the scheme is ``'ISBN'``. If
+ you use the project homepage, ``'URL'`` seems reasonable. The default value
+ is ``'unknown'``.
+
+.. confval:: epub_uid
+
+ A unique identifier for the document. This is put in the Dublin Core
+ metadata. You may use a random string. The default value is ``'unknown'``.
+
+.. confval:: epub_pre_files
+
+ Additional files that should be inserted before the text generated by
+ Sphinx. It is a list of tuples containing the file name and the title.
+ Example::
+
+ epub_pre_files = [
+ ('index.html', 'Welcome'),
+ ]
+
+ The default value is ``[]``.
+
+.. confval:: epub_post_files
+
+ Additional files that should be inserted after the text generated by Sphinx.
+ It is a list of tuples containing the file name and the title. The default
+ value is ``[]``.
+
+.. confval:: epub_exclude_files
+
+ A list of files that are generated/copied in the build directory but should
+ not be included in the epub file. The default value is ``[]``.
+
+.. confval:: epub_tocdepth
+
+ The depth of the table of contents in the file :file:`toc.ncx`. It should
+ be an integer greater than zero. The default value is 3. Note: A deeply
+ nested table of contents may be difficult to navigate.
+
+
.. _latex-options:
Options for LaTeX output
@@ -578,10 +834,38 @@ These options influence LaTeX output.
A list of document names to append as an appendix to all manuals.
+.. confval:: latex_domain_indices
+
+ If true, generate domain-specific indices in addition to the general index.
+ For e.g. the Python domain, this is the global module index. Default is
+ ``True``.
+
+ This value can be a bool or a list of index names that should be generated,
+ like for :confval:`html_domain_indices`.
+
+ .. versionadded:: 1.0
+
.. confval:: latex_use_modindex
If true, add a module index to LaTeX documents. Default is ``True``.
+ .. deprecated:: 1.0
+ Use :confval:`latex_domain_indices`.
+
+.. confval:: latex_show_pagerefs
+
+ If true, add page references after internal references. This is very useful
+ for printed copies of the manual. Default is ``False``.
+
+ .. versionadded:: 1.0
+
+.. confval:: latex_show_urls
+
+ If true, add URL addresses after links. This is very useful for printed
+ copies of the manual. Default is ``False``.
+
+ .. versionadded:: 1.0
+
.. confval:: latex_elements
.. versionadded:: 0.5
@@ -648,9 +932,15 @@ These options influence LaTeX output.
``'logo'``
``'releasename'``
``'makeindex'``
- ``'makemodindex'``
``'shorthandoff'``
- ``'printmodindex'``
+
+.. confval:: latex_docclass
+
+ A dictionary mapping ``'howto'`` and ``'manual'`` to names of real document
+ classes that will be used as the base for the two Sphinx classes. Default
+ is to use ``'article'`` for ``'howto'`` and ``'report'`` for ``'manual'``.
+
+ .. versionadded:: 1.0
.. confval:: latex_additional_files
@@ -685,3 +975,42 @@ These options influence LaTeX output.
.. deprecated:: 0.5
Use the ``'pointsize'`` key in the :confval:`latex_elements` value.
+
+
+.. _man-options:
+
+Options for manual page output
+------------------------------
+
+These options influence manual page output.
+
+.. confval:: man_pages
+
+ This value determines how to group the document tree into manual pages. It
+ must be a list of tuples ``(startdocname, name, description, authors,
+ section)``, where the items are:
+
+ * *startdocname*: document name that is the "root" of the manual page. All
+ documents referenced by it in TOC trees will be included in the manual file
+ too. (If you want one master manual page, use your :confval:`master_doc`
+ here.)
+ * *name*: name of the manual page. This should be a short string without
+ spaces or special characters. It is used to determine the file name as
+ well as the name of the manual page (in the NAME section).
+ * *description*: description of the manual page. This is used in the NAME
+ section.
+ * *authors*: A list of strings with authors, or a single string. Can be
+ an empty string or list if you do not want to automatically generate
+ an AUTHORS section in the manual page.
+ * *section*: The manual page section. Used for the output file name as well
+ as in the manual page header.
+
+ .. versionadded:: 1.0
+
+
+.. rubric:: Footnotes
+
+.. [1] A note on available globbing syntax: you can use the standard shell
+ constructs ``*``, ``?``, ``[...]`` and ``[!...]`` with the feature that
+ these all don't match slashes. A double star ``**`` can be used to match
+ any sequence of characters *including* slashes.
diff --git a/doc/contents.rst b/doc/contents.rst
index 1f3860ea8..079f93f26 100644
--- a/doc/contents.rst
+++ b/doc/contents.rst
@@ -7,9 +7,11 @@ Sphinx documentation contents
:maxdepth: 2
intro
- concepts
+ tutorial
+ invocation
rest
markup/index
+ domains
builders
config
theming
diff --git a/doc/domains.rst b/doc/domains.rst
new file mode 100644
index 000000000..f9c0a0aec
--- /dev/null
+++ b/doc/domains.rst
@@ -0,0 +1,661 @@
+.. highlight:: rst
+
+.. _domains:
+
+Sphinx Domains
+==============
+
+.. versionadded:: 1.0
+
+What is a Domain?
+-----------------
+
+Originally, Sphinx was conceived for a single project, the documentation of the
+Python language. Shortly afterwards, it was made available for everyone as a
+documentation tool, but the documentation of Python modules remained deeply
+built in -- the most fundamental directives, like ``function``, were designed
+for Python objects. Since Sphinx has become somewhat popular, interest
+developed in using it for many different purposes: C/C++ projects, JavaScript,
+or even reStructuredText markup (like in this documentation).
+
+While this was always possible, it is now much easier to easily support
+documentation of projects using different programming languages or even ones not
+supported by the main Sphinx distribution, by providing a **domain** for every
+such purpose.
+
+A domain is a collection of markup (reStructuredText :term:`directive`\ s and
+:term:`role`\ s) to describe and link to :term:`object`\ s belonging together,
+e.g. elements of a programming language. Directive and role names in a domain
+have names like ``domain:name``, e.g. ``py:function``. Domains can also provide
+custom indices (like the Python Module Index).
+
+Having domains means that there are no naming problems when one set of
+documentation wants to refer to e.g. C++ and Python classes. It also means that
+extensions that support the documentation of whole new languages are much easier
+to write.
+
+This section describes what the domains that come with Sphinx provide. The
+domain API is documented as well, in the section :ref:`domain-api`.
+
+
+.. _basic-domain-markup:
+
+Basic Markup
+------------
+
+Most domains provide a number of :dfn:`object description directives`, used to
+describe specific objects provided by modules. Each directive requires one or
+more signatures to provide basic information about what is being described, and
+the content should be the description. The basic version makes entries in the
+general index; if no index entry is desired, you can give the directive option
+flag ``:noindex:``. An example using a Python domain directive::
+
+ .. py:function:: spam(eggs)
+ ham(eggs)
+ :noindex:
+
+ Spam or ham the foo.
+
+The domains also provide roles that link back to these object descriptions. For
+example, to link to one of the functions described in the example above, you
+could say ::
+
+ The function :py:func:`spam` does a similar thing.
+
+As you can see, both directive and role names contain the domain name and the
+directive name.
+
+.. rubric:: Default Domain
+
+To avoid having to writing the domain name all the time when you e.g. only
+describe Python objects, a default domain can be selected with either the config
+value :confval:`primary_domain` or this directive:
+
+.. rst:directive:: .. default-domain:: name
+
+ Select a new default domain. While the :confval:`primary_domain` selects a
+ global default, this only has an effect within the same file.
+
+If no other default is selected, the Python domain (named ``py``) is the default
+one, mostly for compatibility with documentation written for older versions of
+Sphinx.
+
+Directives and roles that belong to the default domain can be mentioned without
+giving the domain name, i.e. ::
+
+ .. function:: pyfunc()
+
+ Describes a Python function.
+
+ Reference to :func:`pyfunc`.
+
+
+Cross-referencing syntax
+~~~~~~~~~~~~~~~~~~~~~~~~
+
+For cross-reference roles provided by domains, the same facilities exist as for
+general cross-references. See :ref:`xref-syntax`.
+
+In short:
+
+* You may supply an explicit title and reference target: ``:role:`title
+ <target>``` will refer to *target*, but the link text will be *title*.
+
+* If you prefix the content with ``!``, no reference/hyperlink will be created.
+
+* If you prefix the content with ``~``, the link text will only be the last
+ component of the target. For example, ``:py:meth:`~Queue.Queue.get``` will
+ refer to ``Queue.Queue.get`` but only display ``get`` as the link text.
+
+
+The Python Domain
+-----------------
+
+The Python domain (name **py**) provides the following directives for module
+declarations:
+
+.. rst:directive:: .. py:module:: name
+
+ This directive marks the beginning of the description of a module (or package
+ submodule, in which case the name should be fully qualified, including the
+ package name). It does not create content (like e.g. :rst:dir:`py:class` does).
+
+ This directive will also cause an entry in the global module index.
+
+ The ``platform`` option, if present, is a comma-separated list of the
+ platforms on which the module is available (if it is available on all
+ platforms, the option should be omitted). The keys are short identifiers;
+ examples that are in use include "IRIX", "Mac", "Windows", and "Unix". It is
+ important to use a key which has already been used when applicable.
+
+ The ``synopsis`` option should consist of one sentence describing the
+ module's purpose -- it is currently only used in the Global Module Index.
+
+ The ``deprecated`` option can be given (with no value) to mark a module as
+ deprecated; it will be designated as such in various locations then.
+
+
+.. rst:directive:: .. py:currentmodule:: name
+
+ This directive tells Sphinx that the classes, functions etc. documented from
+ here are in the given module (like :rst:dir:`py:module`), but it will not create
+ index entries, an entry in the Global Module Index, or a link target for
+ :rst:role:`mod`. This is helpful in situations where documentation for things in
+ a module is spread over multiple files or sections -- one location has the
+ :rst:dir:`py:module` directive, the others only :rst:dir:`py:currentmodule`.
+
+
+The following directives are provided for module and class contents:
+
+.. rst:directive:: .. py:data:: name
+
+ Describes global data in a module, including both variables and values used
+ as "defined constants." Class and object attributes are not documented
+ using this environment.
+
+.. rst:directive:: .. py:exception:: name
+
+ Describes an exception class. The signature can, but need not include
+ parentheses with constructor arguments.
+
+.. rst:directive:: .. py:function:: name(signature)
+
+ Describes a module-level function. The signature should include the
+ parameters, enclosing optional parameters in brackets. Default values can be
+ given if it enhances clarity; see :ref:`signatures`. For example::
+
+ .. py:function:: Timer.repeat([repeat=3[, number=1000000]])
+
+ Object methods are not documented using this directive. Bound object methods
+ placed in the module namespace as part of the public interface of the module
+ are documented using this, as they are equivalent to normal functions for
+ most purposes.
+
+ The description should include information about the parameters required and
+ how they are used (especially whether mutable objects passed as parameters
+ are modified), side effects, and possible exceptions. A small example may be
+ provided.
+
+.. rst:directive:: .. py:class:: name[(signature)]
+
+ Describes a class. The signature can include parentheses with parameters
+ which will be shown as the constructor arguments. See also
+ :ref:`signatures`.
+
+ Methods and attributes belonging to the class should be placed in this
+ directive's body. If they are placed outside, the supplied name should
+ contain the class name so that cross-references still work. Example::
+
+ .. py:class:: Foo
+ .. py:method:: quux()
+
+ -- or --
+
+ .. py:class:: Bar
+
+ .. py:method:: Bar.quux()
+
+ The first way is the preferred one.
+
+.. rst:directive:: .. py:attribute:: name
+
+ Describes an object data attribute. The description should include
+ information about the type of the data to be expected and whether it may be
+ changed directly.
+
+.. rst:directive:: .. py:method:: name(signature)
+
+ Describes an object method. The parameters should not include the ``self``
+ parameter. The description should include similar information to that
+ described for ``function``. See also :ref:`signatures`.
+
+.. rst:directive:: .. py:staticmethod:: name(signature)
+
+ Like :rst:dir:`py:method`, but indicates that the method is a static method.
+
+ .. versionadded:: 0.4
+
+.. rst:directive:: .. py:classmethod:: name(signature)
+
+ Like :rst:dir:`py:method`, but indicates that the method is a class method.
+
+ .. versionadded:: 0.6
+
+
+.. _signatures:
+
+Python Signatures
+~~~~~~~~~~~~~~~~~
+
+Signatures of functions, methods and class constructors can be given like they
+would be written in Python, with the exception that optional parameters can be
+indicated by brackets::
+
+ .. py:function:: compile(source[, filename[, symbol]])
+
+It is customary to put the opening bracket before the comma. In addition to
+this "nested" bracket style, a "flat" style can also be used, due to the fact
+that most optional parameters can be given independently::
+
+ .. py:function:: compile(source[, filename, symbol])
+
+Default values for optional arguments can be given (but if they contain commas,
+they will confuse the signature parser). Python 3-style argument annotations
+can also be given as well as return type annotations::
+
+ .. py:function:: compile(source : string[, filename, symbol]) -> ast object
+
+
+Info field lists
+~~~~~~~~~~~~~~~~
+
+.. versionadded:: 0.4
+
+Inside Python object description directives, reST field lists with these fields
+are recognized and formatted nicely:
+
+* ``param``, ``parameter``, ``arg``, ``argument``, ``key``, ``keyword``:
+ Description of a parameter.
+* ``type``: Type of a parameter.
+* ``raises``, ``raise``, ``except``, ``exception``: That (and when) a specific
+ exception is raised.
+* ``var``, ``ivar``, ``cvar``: Description of a variable.
+* ``returns``, ``return``: Description of the return value.
+* ``rtype``: Return type.
+
+The field names must consist of one of these keywords and an argument (except
+for ``returns`` and ``rtype``, which do not need an argument). This is best
+explained by an example::
+
+ .. py:function:: format_exception(etype, value, tb[, limit=None])
+
+ Format the exception with a traceback.
+
+ :param etype: exception type
+ :param value: exception value
+ :param tb: traceback object
+ :param limit: maximum number of stack frames to show
+ :type limit: integer or None
+ :rtype: list of strings
+
+It is also possible to combine parameter type and description, if the type is a
+single word, like this::
+
+ :param integer limit: maximum number of stack frames to show
+
+This will render like this:
+
+ .. py:function:: format_exception(etype, value, tb[, limit=None])
+ :noindex:
+
+ Format the exception with a traceback.
+
+ :param etype: exception type
+ :param value: exception value
+ :param tb: traceback object
+ :param limit: maximum number of stack frames to show
+ :type limit: integer or None
+ :rtype: list of strings
+
+
+Cross-referencing Python objects
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+The following roles refer to objects in modules and are possibly hyperlinked if
+a matching identifier is found:
+
+.. rst:role:: py:mod
+
+ Reference a module; a dotted name may be used. This should also be used for
+ package names.
+
+.. rst:role:: py:func
+
+ Reference a Python function; dotted names may be used. The role text needs
+ not include trailing parentheses to enhance readability; they will be added
+ automatically by Sphinx if the :confval:`add_function_parentheses` config
+ value is true (the default).
+
+.. rst:role:: py:data
+
+ Reference a module-level variable.
+
+.. rst:role:: py:const
+
+ Reference a "defined" constant. This may be a C-language ``#define`` or a
+ Python variable that is not intended to be changed.
+
+.. rst:role:: py:class
+
+ Reference a class; a dotted name may be used.
+
+.. rst:role:: py:meth
+
+ Reference a method of an object. The role text can include the type name and
+ the method name; if it occurs within the description of a type, the type name
+ can be omitted. A dotted name may be used.
+
+.. rst:role:: py:attr
+
+ Reference a data attribute of an object.
+
+.. rst:role:: py:exc
+
+ Reference an exception. A dotted name may be used.
+
+.. rst:role:: py:obj
+
+ Reference an object of unspecified type. Useful e.g. as the
+ :confval:`default_role`.
+
+ .. versionadded:: 0.4
+
+The name enclosed in this markup can include a module name and/or a class name.
+For example, ``:py:func:`filter``` could refer to a function named ``filter`` in
+the current module, or the built-in function of that name. In contrast,
+``:py:func:`foo.filter``` clearly refers to the ``filter`` function in the
+``foo`` module.
+
+Normally, names in these roles are searched first without any further
+qualification, then with the current module name prepended, then with the
+current module and class name (if any) prepended. If you prefix the name with a
+dot, this order is reversed. For example, in the documentation of Python's
+:mod:`codecs` module, ``:py:func:`open``` always refers to the built-in
+function, while ``:py:func:`.open``` refers to :func:`codecs.open`.
+
+A similar heuristic is used to determine whether the name is an attribute of the
+currently documented class.
+
+
+.. _c-domain:
+
+The C Domain
+------------
+
+The C domain (name **c**) is suited for documentation of C API.
+
+.. rst:directive:: .. c:function:: type name(signature)
+
+ Describes a C function. The signature should be given as in C, e.g.::
+
+ .. c:function:: PyObject* PyType_GenericAlloc(PyTypeObject *type, Py_ssize_t nitems)
+
+ This is also used to describe function-like preprocessor macros. The names
+ of the arguments should be given so they may be used in the description.
+
+ Note that you don't have to backslash-escape asterisks in the signature, as
+ it is not parsed by the reST inliner.
+
+.. rst:directive:: .. c:member:: type name
+
+ Describes a C struct member. Example signature::
+
+ .. c:member:: PyObject* PyTypeObject.tp_bases
+
+ The text of the description should include the range of values allowed, how
+ the value should be interpreted, and whether the value can be changed.
+ References to structure members in text should use the ``member`` role.
+
+.. rst:directive:: .. c:macro:: name
+
+ Describes a "simple" C macro. Simple macros are macros which are used for
+ code expansion, but which do not take arguments so cannot be described as
+ functions. This is not to be used for simple constant definitions. Examples
+ of its use in the Python documentation include :c:macro:`PyObject_HEAD` and
+ :c:macro:`Py_BEGIN_ALLOW_THREADS`.
+
+.. rst:directive:: .. c:type:: name
+
+ Describes a C type (whether defined by a typedef or struct). The signature
+ should just be the type name.
+
+.. rst:directive:: .. c:var:: type name
+
+ Describes a global C variable. The signature should include the type, such
+ as::
+
+ .. c:var:: PyObject* PyClass_Type
+
+
+Cross-referencing C constructs
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+The following roles create cross-references to C-language constructs if they are
+defined in the documentation:
+
+.. rst:role:: c:data
+
+ Reference a C-language variable.
+
+.. rst:role:: c:func
+
+ Reference a C-language function. Should include trailing parentheses.
+
+.. rst:role:: c:macro
+
+ Reference a "simple" C macro, as defined above.
+
+.. rst:role:: c:type
+
+ Reference a C-language type.
+
+
+The C++ Domain
+--------------
+
+The C++ domain (name **cpp**) supports documenting C++ projects.
+
+The following directives are available:
+
+.. rst:directive:: .. cpp:class:: signatures
+ .. cpp:function:: signatures
+ .. cpp:member:: signatures
+ .. cpp:type:: signatures
+
+ Describe a C++ object. Full signature specification is supported -- give the
+ signature as you would in the declaration. Example::
+
+ .. cpp:function:: const int IntArray::operator[]
+
+ Describes the indexing operator of IntArrays.
+
+.. rst:directive:: .. cpp:namespace:: namespace
+
+ Select the current C++ namespace for the following objects.
+
+These roles link to the given object types:
+
+.. rst:role:: cpp:class
+ cpp:func
+ cpp:member
+ cpp:type
+
+ Reference a C++ object. You can give the full signature (and need to, for
+ overloaded functions.)
+
+
+The Standard Domain
+-------------------
+
+The so-called "standard" domain collects all markup that doesn't warrant a
+domain of its own. Its directives and roles are not prefixed with a domain
+name.
+
+The standard domain is also where custom object descriptions, added using the
+:func:`~sphinx.application.Sphinx.add_object_type` API, are placed.
+
+There is a set of directives allowing documenting command-line programs:
+
+.. rst:directive:: .. option:: name args, name args, ...
+
+ Describes a command line option or switch. Option argument names should be
+ enclosed in angle brackets. Example::
+
+ .. option:: -m <module>, --module <module>
+
+ Run a module as a script.
+
+ The directive will create a cross-reference target named after the *first*
+ option, referencable by :rst:role:`option` (in the example case, you'd use
+ something like ``:option:`-m```).
+
+.. rst:directive:: .. envvar:: name
+
+ Describes an environment variable that the documented code or program uses or
+ defines. Referencable by :rst:role:`envvar`.
+
+.. rst:directive:: .. program:: name
+
+ Like :rst:dir:`py:currentmodule`, this directive produces no output. Instead, it
+ serves to notify Sphinx that all following :rst:dir:`option` directives
+ document options for the program called *name*.
+
+ If you use :rst:dir:`program`, you have to qualify the references in your
+ :rst:role:`option` roles by the program name, so if you have the following
+ situation ::
+
+ .. program:: rm
+
+ .. option:: -r
+
+ Work recursively.
+
+ .. program:: svn
+
+ .. option:: -r revision
+
+ Specify the revision to work upon.
+
+ then ``:option:`rm -r``` would refer to the first option, while
+ ``:option:`svn -r``` would refer to the second one.
+
+ The program name may contain spaces (in case you want to document subcommands
+ like ``svn add`` and ``svn commit`` separately).
+
+ .. versionadded:: 0.5
+
+
+There is also a very generic object description directive, which is not tied to
+any domain:
+
+.. rst:directive:: .. describe:: text
+ .. object:: text
+
+ This directive produces the same formatting as the specific ones provided by
+ domains, but does not create index entries or cross-referencing targets.
+ Example::
+
+ .. describe:: PAPER
+
+ You can set this variable to select a paper size.
+
+
+The JavaScript Domain
+---------------------
+
+The JavaScript domain (name **js**) provides the following directives:
+
+.. rst:directive:: .. js:function:: name(signature)
+
+ Describes a JavaScript function, method or constructor. If you want to
+ describe arguments as optional use square brackets as :ref:`documented
+ <signatures>` for Python signatures.
+
+ You can use fields to give more details about arguments and their expected
+ types, errors which may be thrown by the function, and the value being
+ returned::
+
+ .. js:function:: $.getJSON(href, callback[, errback])
+
+ :param string href: An URI to the location of the resource.
+ :param callback: Get's called with the object.
+ :param errback:
+ Get's called in case the request fails. And a lot of other
+ text so we need multiple lines
+ :throws SomeError: For whatever reason in that case.
+ :returns: Something
+
+ This is rendered as:
+
+ .. js:function:: $.getJSON(href, callback[, errback])
+
+ :param string href: An URI to the location of the resource.
+ :param callback: Get's called with the object.
+ :param errback:
+ Get's called in case the request fails. And a lot of other
+ text so we need multiple lines.
+ :throws SomeError: For whatever reason in that case.
+ :returns: Something
+
+.. rst:directive:: .. js:data:: name
+
+ Describes a global variable or constant.
+
+.. rst:directive:: .. js:attribute:: object.name
+
+ Describes the attribute *name* of *object*.
+
+These roles are provided to refer to the described objects:
+
+.. rst:role:: js:func
+ js:data
+ js:attr
+
+
+The reStructuredText domain
+---------------------------
+
+The reStructuredText domain (name **rst**) provides the following directives:
+
+.. rst:directive:: .. rst:directive:: name
+
+ Describes a reST directive. The *name* can be a single directive name or
+ actual directive syntax (`..` prefix and `::` suffix) with arguments that
+ will be rendered differently. For example::
+
+ .. rst:directive:: foo
+
+ Foo description.
+
+ .. rst:directive:: .. bar:: baz
+
+ Bar description.
+
+ will be rendered as:
+
+ .. rst:directive:: foo
+
+ Foo description.
+
+ .. rst:directive:: .. bar:: baz
+
+ Bar description.
+
+.. rst:directive:: .. rst:role:: name
+
+ Describes a reST role. For example::
+
+ .. rst:role:: foo
+
+ Foo description.
+
+ will be rendered as:
+
+ .. rst:role:: foo
+
+ Foo description.
+
+These roles are provided to refer to the described objects:
+
+.. rst:role:: rst:dir
+ rst:role
+
+
+More domains
+------------
+
+The sphinx-contrib_ repository contains more domains available as extensions;
+currently a Ruby and an Erlang domain.
+
+
+.. _sphinx-contrib: http://bitbucket.org/birkenfeld/sphinx-contrib/
diff --git a/doc/ext/appapi.rst b/doc/ext/appapi.rst
index 398e972e2..402dd72f0 100644
--- a/doc/ext/appapi.rst
+++ b/doc/ext/appapi.rst
@@ -43,20 +43,42 @@ the following public API:
``'env'``) to a string. However, booleans are still accepted and
converted internally.
+.. method:: Sphinx.add_domain(domain)
+
+ Make the given *domain* (which must be a class; more precisely, a subclass of
+ :class:`~sphinx.domains.Domain`) known to Sphinx.
+
+ .. versionadded:: 1.0
+
+.. method:: Sphinx.override_domain(domain)
+
+ Make the given *domain* class known to Sphinx, assuming that there is already
+ a domain with its ``.name``. The new domain must be a subclass of the
+ existing one.
+
+ .. versionadded:: 1.0
+
+.. method:: Sphinx.add_index_to_domain(domain, index)
+
+ Add a custom *index* class to the domain named *domain*. *index* must be a
+ subclass of :class:`~sphinx.domains.Index`.
+
+ .. versionadded:: 1.0
+
.. method:: Sphinx.add_event(name)
- Register an event called *name*.
+ Register an event called *name*. This is needed to be able to emit it.
.. method:: Sphinx.add_node(node, **kwds)
Register a Docutils node class. This is necessary for Docutils internals.
It may also be used in the future to validate nodes in the parsed documents.
- Node visitor functions for the Sphinx HTML, LaTeX and text writers can be
- given as keyword arguments: the keyword must be one or more of ``'html'``,
- ``'latex'``, ``'text'``, the value a 2-tuple of ``(visit, depart)`` methods.
- ``depart`` can be ``None`` if the ``visit`` function raises
- :exc:`docutils.nodes.SkipNode`. Example:
+ Node visitor functions for the Sphinx HTML, LaTeX, text and manpage writers
+ can be given as keyword arguments: the keyword must be one or more of
+ ``'html'``, ``'latex'``, ``'text'``, ``'man'``, the value a 2-tuple of
+ ``(visit, depart)`` methods. ``depart`` can be ``None`` if the ``visit``
+ function raises :exc:`docutils.nodes.SkipNode`. Example:
.. code-block:: python
@@ -81,10 +103,10 @@ the following public API:
Register a Docutils directive. *name* must be the prospective directive
name. There are two possible ways to write a directive:
- * In the docutils 0.4 style, *func* is the directive function. *content*,
+ * In the docutils 0.4 style, *obj* is the directive function. *content*,
*arguments* and *options* are set as attributes on the function and
determine whether the directive has content, arguments and options,
- respectively.
+ respectively. **This style is deprecated.**
* In the docutils 0.5 style, *directiveclass* is the directive class. It
must already have attributes named *has_content*, *required_arguments*,
@@ -99,7 +121,7 @@ the following public API:
instead which does the right thing even on docutils 0.4 (which doesn't
support directive classes otherwise).
- For example, the (already existing) :dir:`literalinclude` directive would be
+ For example, the (already existing) :rst:dir:`literalinclude` directive would be
added like this:
.. code-block:: python
@@ -114,12 +136,26 @@ the following public API:
.. versionchanged:: 0.6
Docutils 0.5-style directive classes are now supported.
+.. method:: Sphinx.add_directive_to_domain(domain, name, func, content, arguments, **options)
+ Sphinx.add_directive_to_domain(domain, name, directiveclass)
+
+ Like :meth:`add_directive`, but the directive is added to the domain named
+ *domain*.
+
+ .. versionadded:: 1.0
+
.. method:: Sphinx.add_role(name, role)
Register a Docutils role. *name* must be the role name that occurs in the
source, *role* the role function (see the `Docutils documentation
<http://docutils.sourceforge.net/docs/howto/rst-roles.html>`_ on details).
+.. method:: Sphinx.add_role_to_domain(domain, name, role)
+
+ Like :meth:`add_role`, but the role is added to the domain named *domain*.
+
+ .. versionadded:: 1.0
+
.. method:: Sphinx.add_generic_role(name, nodeclass)
Register a Docutils role that does nothing but wrap its contents in the
@@ -127,36 +163,38 @@ the following public API:
.. versionadded:: 0.6
-.. method:: Sphinx.add_description_unit(directivename, rolename, indextemplate='', parse_node=None, ref_nodeclass=None)
+.. method:: Sphinx.add_object_type(directivename, rolename, indextemplate='', parse_node=None, ref_nodeclass=None, objname='')
- This method is a very convenient way to add a new type of information that
+ This method is a very convenient way to add a new :term:`object` type that
can be cross-referenced. It will do this:
- * Create a new directive (called *directivename*) for a :term:`description
- unit`. It will automatically add index entries if *indextemplate* is
- nonempty; if given, it must contain exactly one instance of ``%s``. See
- the example below for how the template will be interpreted.
+ * Create a new directive (called *directivename*) for documenting an object.
+ It will automatically add index entries if *indextemplate* is nonempty; if
+ given, it must contain exactly one instance of ``%s``. See the example
+ below for how the template will be interpreted.
* Create a new role (called *rolename*) to cross-reference to these
- description units.
+ object descriptions.
* If you provide *parse_node*, it must be a function that takes a string and
a docutils node, and it must populate the node with children parsed from
the string. It must then return the name of the item to be used in
cross-referencing and index entries. See the :file:`conf.py` file in the
source for this documentation for an example.
+ * The *objname* (if not given, will default to *directivename*) names the
+ type of object. It is used when listing objects, e.g. in search results.
For example, if you have this call in a custom Sphinx extension::
- app.add_description_unit('directive', 'dir', 'pair: %s; directive')
+ app.add_object_type('directive', 'dir', 'pair: %s; directive')
you can use this markup in your documents::
- .. directive:: function
+ .. rst:directive:: function
Document a function.
<...>
- See also the :dir:`function` directive.
+ See also the :rst:dir:`function` directive.
For the directive, an index entry will be generated as if you had prepended ::
@@ -168,16 +206,19 @@ the following public API:
``docutils.nodes.emphasis`` or ``docutils.nodes.strong`` -- you can also use
``docutils.nodes.generated`` if you want no further text decoration).
- For the role content, you have the same options as for standard Sphinx roles
- (see :ref:`xref-syntax`).
+ For the role content, you have the same syntactical possibilities as for
+ standard Sphinx roles (see :ref:`xref-syntax`).
-.. method:: Sphinx.add_crossref_type(directivename, rolename, indextemplate='', ref_nodeclass=None)
+ This method is also available under the deprecated alias
+ :meth:`add_description_unit`.
- This method is very similar to :meth:`add_description_unit` except that the
+.. method:: Sphinx.add_crossref_type(directivename, rolename, indextemplate='', ref_nodeclass=None, objname='')
+
+ This method is very similar to :meth:`add_object_type` except that the
directive it generates must be empty, and will produce no output.
That means that you can add semantic targets to your sources, and refer to
- them using custom roles instead of generic ones (like :role:`ref`). Example
+ them using custom roles instead of generic ones (like :rst:role:`ref`). Example
call::
app.add_crossref_type('topic', 'topic', 'single: %s', docutils.nodes.emphasis)
@@ -209,6 +250,14 @@ the following public API:
.. versionadded:: 0.5
+.. method:: Sphinx.add_stylesheet(filename)
+
+ Add *filename* to the list of CSS files that the default HTML template will
+ include. Like for :meth:`add_javascript`, the filename must be relative to
+ the HTML static path.
+
+ .. versionadded:: 1.0
+
.. method:: Sphinx.add_lexer(alias, lexer)
Use *lexer*, which must be an instance of a Pygments lexer class, to
@@ -256,11 +305,18 @@ the following public API:
.. method:: Sphinx.emit_firstresult(event, *arguments)
Emit *event* and pass *arguments* to the callback functions. Return the
- result of the first callback that doesn't return ``None`` (and don't call
- the rest of the callbacks).
+ result of the first callback that doesn't return ``None``.
.. versionadded:: 0.5
+.. method:: Sphinx.require_sphinx(version)
+
+ Compare *version* (which must be a ``major.minor`` version string,
+ e.g. ``'1.1'``) with the version of the running Sphinx, and abort the build
+ when it is too old.
+
+ .. versionadded:: 1.0
+
.. exception:: ExtensionError
@@ -347,7 +403,15 @@ registered event handlers.
.. versionadded:: 0.5
-.. event:: page-context (app, pagename, templatename, context, doctree)
+.. event:: html-collect-pages (app)
+
+ Emitted when the HTML builder is starting to write non-document pages. You
+ can add pages to write by returning an iterable from this event consisting of
+ ``(pagename, context, templatename)``.
+
+ .. versionadded:: 1.0
+
+.. event:: html-page-context (app, pagename, templatename, context, doctree)
Emitted when the HTML builder has created a context dictionary to render a
template with -- this can be used to add custom elements to the context.
@@ -386,3 +450,19 @@ The template bridge
.. autoclass:: TemplateBridge
:members:
+
+
+.. _domain-api:
+
+Domain API
+----------
+
+.. module:: sphinx.domains
+
+.. autoclass:: Domain
+ :members:
+
+.. autoclass:: ObjType
+
+.. autoclass:: Index
+ :members:
diff --git a/doc/ext/autodoc.rst b/doc/ext/autodoc.rst
index b4b4b3f31..bd725cfaa 100644
--- a/doc/ext/autodoc.rst
+++ b/doc/ext/autodoc.rst
@@ -27,18 +27,18 @@ two locations for documentation, while at the same time avoiding
auto-generated-looking pure API documentation.
:mod:`autodoc` provides several directives that are versions of the usual
-:dir:`module`, :dir:`class` and so forth. On parsing time, they import the
+:rst:dir:`module`, :rst:dir:`class` and so forth. On parsing time, they import the
corresponding module and extract the docstring of the given objects, inserting
-them into the page source under a suitable :dir:`module`, :dir:`class` etc.
+them into the page source under a suitable :rst:dir:`module`, :rst:dir:`class` etc.
directive.
.. note::
- Just as :dir:`class` respects the current :dir:`module`, :dir:`autoclass`
- will also do so, and likewise with :dir:`method` and :dir:`class`.
+ Just as :rst:dir:`class` respects the current :rst:dir:`module`, :rst:dir:`autoclass`
+ will also do so, and likewise with :rst:dir:`method` and :rst:dir:`class`.
-.. directive:: automodule
+.. rst:directive:: automodule
autoclass
autoexception
@@ -89,6 +89,9 @@ directive.
.. autoclass:: Noodle
:members: eat, slurp
+ * If you want to make the ``members`` option the default, see
+ :confval:`autodoc_default_flags`.
+
* Members without docstrings will be left out, unless you give the
``undoc-members`` flag option::
@@ -124,27 +127,27 @@ directive.
.. versionadded:: 0.4
- * The :dir:`automodule`, :dir:`autoclass` and :dir:`autoexception` directives
+ * The :rst:dir:`automodule`, :rst:dir:`autoclass` and :rst:dir:`autoexception` directives
also support a flag option called ``show-inheritance``. When given, a list
of base classes will be inserted just below the class signature (when used
- with :dir:`automodule`, this will be inserted for every class that is
+ with :rst:dir:`automodule`, this will be inserted for every class that is
documented in the module).
.. versionadded:: 0.4
* All autodoc directives support the ``noindex`` flag option that has the
- same effect as for standard :dir:`function` etc. directives: no index
+ same effect as for standard :rst:dir:`function` etc. directives: no index
entries are generated for the documented object (and all autodocumented
members).
.. versionadded:: 0.4
- * :dir:`automodule` also recognizes the ``synopsis``, ``platform`` and
- ``deprecated`` options that the standard :dir:`module` directive supports.
+ * :rst:dir:`automodule` also recognizes the ``synopsis``, ``platform`` and
+ ``deprecated`` options that the standard :rst:dir:`module` directive supports.
.. versionadded:: 0.5
- * :dir:`automodule` and :dir:`autoclass` also has an ``member-order`` option
+ * :rst:dir:`automodule` and :rst:dir:`autoclass` also has an ``member-order`` option
that can be used to override the global value of
:confval:`autodoc_member_order` for one directive.
@@ -158,18 +161,18 @@ directive.
.. note::
- In an :dir:`automodule` directive with the ``members`` option set, only
+ In an :rst:dir:`automodule` directive with the ``members`` option set, only
module members whose ``__module__`` attribute is equal to the module name
as given to ``automodule`` will be documented. This is to prevent
documentation of imported classes or functions.
-.. directive:: autofunction
+.. rst:directive:: autofunction
autodata
automethod
autoattribute
- These work exactly like :dir:`autoclass` etc., but do not offer the options
+ These work exactly like :rst:dir:`autoclass` etc., but do not offer the options
used for automatic member documentation.
For module data members and class attributes, documentation can either be put
@@ -187,7 +190,7 @@ directive.
"""Docstring for attribute Foo.baz."""
.. versionchanged:: 0.6
- :dir:`autodata` and :dir:`autoattribute` can now extract docstrings.
+ :rst:dir:`autodata` and :rst:dir:`autoattribute` can now extract docstrings.
.. note::
@@ -206,12 +209,12 @@ There are also new config values that you can set:
.. confval:: autoclass_content
This value selects what content will be inserted into the main body of an
- :dir:`autoclass` directive. The possible values are:
+ :rst:dir:`autoclass` directive. The possible values are:
``"class"``
Only the class' docstring is inserted. This is the default. You can
- still document ``__init__`` as a separate method using :dir:`automethod`
- or the ``members`` option to :dir:`autoclass`.
+ still document ``__init__`` as a separate method using :rst:dir:`automethod`
+ or the ``members`` option to :rst:dir:`autoclass`.
``"both"``
Both the class' and the ``__init__`` method's docstring are concatenated
and inserted.
@@ -223,10 +226,34 @@ There are also new config values that you can set:
.. confval:: autodoc_member_order
This value selects if automatically documented members are sorted
- alphabetical (value ``'alphabetical'``) or by member type (value
- ``'groupwise'``). The default is alphabetical.
+ alphabetical (value ``'alphabetical'``), by member type (value
+ ``'groupwise'``) or by source order (value ``'bysource'``). The default is
+ alphabetical.
+
+ Note that for source order, the module must be a Python module with the
+ source code available.
.. versionadded:: 0.6
+ .. versionchanged:: 1.0
+ Support for ``'bysource'``.
+
+.. confval:: autodoc_default_flags
+
+ This value is a list of autodoc directive flags that should be automatically
+ applied to all autodoc directives. The supported flags are ``'members'``,
+ ``'undoc-members'``, ``'inherited-members'`` and ``'show-inheritance'``.
+
+ If you set one of these flags in this config value, you can use a negated
+ form, :samp:`'no-{flag}'`, in an autodoc directive, to disable it once.
+ For example, if ``autodoc_default_flags`` is set to ``['members',
+ 'undoc-members']``, and you write a directive like this::
+
+ .. automodule:: foo
+ :no-undoc-members:
+
+ the directive will be interpreted as if only ``:members:`` was given.
+
+ .. versionadded:: 1.0
Docstring preprocessing
diff --git a/doc/ext/autosummary.rst b/doc/ext/autosummary.rst
index 7b5e5b6b9..9f66e5103 100644
--- a/doc/ext/autosummary.rst
+++ b/doc/ext/autosummary.rst
@@ -15,22 +15,22 @@ one of them on a separate page makes them easier to read.
The :mod:`sphinx.ext.autosummary` extension does this in two parts:
-1. There is an :dir:`autosummary` directive for generating summary listings that
+1. There is an :rst:dir:`autosummary` directive for generating summary listings that
contain links to the documented items, and short summary blurbs extracted
from their docstrings.
2. The convenience script :program:`sphinx-autogen` or the new
:confval:`autosummary_generate` config value can be used to generate short
- "stub" files for the entries listed in the :dir:`autosummary` directives.
+ "stub" files for the entries listed in the :rst:dir:`autosummary` directives.
These by default contain only the corresponding :mod:`sphinx.ext.autodoc`
directive.
-.. directive:: autosummary
+.. rst:directive:: autosummary
Insert a table that contains links to documented items, and a short summary
blurb (the first sentence of the docstring) for each of them. The
- :dir:`autosummary` directive can also optionally serve as a :dir:`toctree`
+ :rst:dir:`autosummary` directive can also optionally serve as a :rst:dir:`toctree`
entry for the included items.
For example, ::
@@ -60,7 +60,7 @@ The :mod:`sphinx.ext.autosummary` extension does this in two parts:
**Options**
- * If you want the :dir:`autosummary` table to also serve as a :dir:`toctree`
+ * If you want the :rst:dir:`autosummary` table to also serve as a :rst:dir:`toctree`
entry, use the ``toctree`` option, for example::
.. autosummary::
@@ -76,7 +76,7 @@ The :mod:`sphinx.ext.autosummary` extension does this in two parts:
directory. If no argument is given, output is placed in the same directory
as the file that contains the directive.
- * If you don't want the :dir:`autosummary` to show function signatures in the
+ * If you don't want the :rst:dir:`autosummary` to show function signatures in the
listing, include the ``nosignatures`` option::
.. autosummary::
@@ -85,18 +85,32 @@ The :mod:`sphinx.ext.autosummary` extension does this in two parts:
sphinx.environment.BuildEnvironment
sphinx.util.relative_uri
+ * You can specify a custom template with the ``template`` option.
+ For example, ::
+
+ .. autosummary::
+ :template: mytemplate.rst
+
+ sphinx.environment.BuildEnvironment
+
+ would use the template :file:`mytemplate.rst` in your
+ :confval:`templates_path` to generate the pages for all entries
+ listed. See `Customizing templates`_ below.
+
+ .. versionadded:: 1.0
+
:program:`sphinx-autogen` -- generate autodoc stub pages
--------------------------------------------------------
The :program:`sphinx-autogen` script can be used to conveniently generate stub
-documentation pages for items included in :dir:`autosummary` listings.
+documentation pages for items included in :rst:dir:`autosummary` listings.
For example, the command ::
$ sphinx-autogen -o generated *.rst
-will read all :dir:`autosummary` tables in the :file:`*.rst` files that have the
+will read all :rst:dir:`autosummary` tables in the :file:`*.rst` files that have the
``:toctree:`` option set, and output corresponding stub pages in directory
``generated`` for all documented items. The generated pages by default contain
text of the form::
@@ -118,7 +132,100 @@ also use this new config value:
.. confval:: autosummary_generate
- A list of documents for which stub pages should be generated.
+ Boolean indicating whether to scan all found documents for autosummary
+ directives, and to generate stub pages for each.
+
+ Can also be a list of documents for which stub pages should be generated.
The new files will be placed in the directories specified in the
``:toctree:`` options of the directives.
+
+
+Customizing templates
+---------------------
+
+.. versionadded:: 1.0
+
+You can customize the stub page templates, in a similar way as the HTML Jinja
+templates, see :ref:`templating`. (:class:`~sphinx.application.TemplateBridge`
+is not supported.)
+
+.. note::
+
+ If you find yourself spending much time tailoring the stub templates, this
+ may indicate that it's a better idea to write custom narrative documentation
+ instead.
+
+Autosummary uses the following template files:
+
+- :file:`autosummary/base.rst` -- fallback template
+- :file:`autosummary/module.rst` -- template for modules
+- :file:`autosummary/class.rst` -- template for classes
+- :file:`autosummary/function.rst` -- template for functions
+- :file:`autosummary/attribute.rst` -- template for class attributes
+- :file:`autosummary/method.rst` -- template for class methods
+
+The following variables available in the templates:
+
+.. currentmodule:: None
+
+.. data:: name
+
+ Name of the documented object, excluding the module and class parts.
+
+.. data:: objname
+
+ Name of the documented object, excluding the module parts.
+
+.. data:: fullname
+
+ Full name of the documented object, including module and class parts.
+
+.. data:: module
+
+ Name of the module the documented object belongs to.
+
+.. data:: class
+
+ Name of the class the documented object belongs to. Only available for
+ methods and attributes.
+
+.. data:: underline
+
+ A string containing ``len(full_name) * '='``.
+
+.. data:: members
+
+ List containing names of all members of the module or class. Only available
+ for modules and classes.
+
+.. data:: functions
+
+ List containing names of "public" functions in the module. Here, "public"
+ here means that the name does not start with an underscore. Only available
+ for modules.
+
+.. data:: classes
+
+ List containing names of "public" classes in the module. Only available for
+ modules.
+
+.. data:: exceptions
+
+ List containing names of "public" exceptions in the module. Only available
+ for modules.
+
+.. data:: methods
+
+ List containing names of "public" methods in the class. Only available for
+ classes.
+
+.. data:: attributes
+
+ List containing names of "public" attributes in the class. Only available
+ for classes.
+
+.. note::
+
+ You can use the :rst:dir:`autosummary` directive in the stub pages.
+ Stub pages are generated also based on these directives.
diff --git a/doc/ext/builderapi.rst b/doc/ext/builderapi.rst
index bb11bfe2f..3ace26871 100644
--- a/doc/ext/builderapi.rst
+++ b/doc/ext/builderapi.rst
@@ -13,7 +13,6 @@ Writing new builders
These methods are predefined and will be called from the application:
- .. automethod:: load_env
.. automethod:: get_relative_uri
.. automethod:: build_all
.. automethod:: build_specific
diff --git a/doc/ext/doctest.rst b/doc/ext/doctest.rst
index 0c64f17a0..20e747de1 100644
--- a/doc/ext/doctest.rst
+++ b/doc/ext/doctest.rst
@@ -39,13 +39,13 @@ interpreted as follows: if it is empty, the block is assigned to the group named
``default`` group). Otherwise, it must be a comma-separated list of group
names.
-.. directive:: .. testsetup:: [group]
+.. rst:directive:: .. testsetup:: [group]
A setup code block. This code is not shown in the output for other builders,
but executed before the doctests of the group(s) it belongs to.
-.. directive:: .. doctest:: [group]
+.. rst:directive:: .. doctest:: [group]
A doctest-style code block. You can use standard :mod:`doctest` flags for
controlling how actual output is compared with what you give as output. By
@@ -78,7 +78,7 @@ names.
output.
-.. directive:: .. testcode:: [group]
+.. rst:directive:: .. testcode:: [group]
A code block for a code-output-style test.
@@ -107,10 +107,10 @@ names.
applies to testcode/testoutput as well.
-.. directive:: .. testoutput:: [group]
+.. rst:directive:: .. testoutput:: [group]
The corresponding output, or the exception message, for the last
- :dir:`testcode` block.
+ :rst:dir:`testcode` block.
This directive supports two options:
@@ -134,7 +134,7 @@ names.
The following is an example for the usage of the directives. The test via
-:dir:`doctest` and the test via :dir:`testcode` and :dir:`testoutput` are
+:rst:dir:`doctest` and the test via :rst:dir:`testcode` and :rst:dir:`testoutput` are
equivalent. ::
The parrot module
@@ -197,9 +197,9 @@ There are also these config values for customizing the doctest extension:
Some more documentation text.
- (Note that no special ``::`` is needed to introduce the block; docutils
- recognizes it from the leading ``>>>``. Also, no additional indentation is
- necessary, though it doesn't hurt.)
+ (Note that no special ``::`` is used to introduce a doctest block; docutils
+ recognizes them from the leading ``>>>``. Also, no additional indentation is
+ used, though it doesn't hurt.)
If this value is left at its default value, the above snippet is interpreted
by the doctest builder exactly like the following::
@@ -220,4 +220,5 @@ There are also these config values for customizing the doctest extension:
Note though that you can't have blank lines in reST doctest blocks. They
will be interpreted as one block ending and another one starting. Also,
removal of ``<BLANKLINE>`` and ``# doctest:`` options only works in
- :dir:`doctest` blocks.
+ :rst:dir:`doctest` blocks, though you may set :confval:`trim_doctest_flags` to
+ achieve the latter in all code blocks with Python console content.
diff --git a/doc/ext/extlinks.rst b/doc/ext/extlinks.rst
new file mode 100644
index 000000000..d4478c5b3
--- /dev/null
+++ b/doc/ext/extlinks.rst
@@ -0,0 +1,54 @@
+:mod:`sphinx.ext.extlinks` -- Markup to shorten external links
+==============================================================
+
+.. module:: sphinx.ext.extlinks
+ :synopsis: Allow inserting external links with common base URLs easily.
+.. moduleauthor:: Georg Brandl
+
+.. versionadded:: 1.0
+
+
+This extension is meant to help with the common pattern of having many external
+links that point to URLs on one and the same site, e.g. links to bug trackers,
+version control web interfaces, or simply subpages in other websites. It does
+so by providing aliases to base URLs, so that you only need to give the subpage
+name when creating a link.
+
+Let's assume that you want to include many links to issues at the Sphinx
+tracker, at :samp:`http://bitbucket.org/birkenfeld/sphinx/issue/{num}`. Typing
+this URL again and again is tedious, so you can use :mod:`~sphinx.ext.extlinks`
+to avoid repeating yourself.
+
+The extension adds one new config value:
+
+.. confval:: extlinks
+
+ This config value must be a dictionary of external sites, mapping unique
+ short alias names to a base URL and a *prefix*. For example, to create an
+ alias for the above mentioned issues, you would add ::
+
+ extlinks = {'issue': ('http://bitbucket.org/birkenfeld/sphinx/issue/%s',
+ 'issue ')}
+
+ Now, you can use the alias name as a new role, e.g. ``:issue:`123```. This
+ then inserts a link to http://bitbucket.org/birkenfeld/sphinx/issue/123.
+ As you can see, the target given in the role is substituted in the base URL
+ in the place of ``%s``.
+
+ The link *caption* depends on the second item in the tuple, the *prefix*:
+
+ - If the prefix is ``None``, the link caption is the full URL.
+ - If the prefix is the empty string, the link caption is the partial URL
+ given in the role content (``123`` in this case.)
+ - If the prefix is a non-empty string, the link caption is the partial URL,
+ prepended by the prefix -- in the above example, the link caption would be
+ ``issue 123``.
+
+ You can also use the usual "explicit title" syntax supported by other roles
+ that generate links, i.e. ``:issue:`this issue <123>```. In this case, the
+ *prefix* is not relevant.
+
+.. note::
+
+ Since links are generated from the role in the reading stage, they appear as
+ ordinary links to e.g. the ``linkcheck`` builder.
diff --git a/doc/ext/graphviz.rst b/doc/ext/graphviz.rst
index d007bf258..3741cec64 100644
--- a/doc/ext/graphviz.rst
+++ b/doc/ext/graphviz.rst
@@ -14,7 +14,7 @@ your documents.
It adds these directives:
-.. directive:: graphviz
+.. rst:directive:: graphviz
Directive to embed graphviz code. The input code for ``dot`` is given as the
content. For example::
@@ -25,11 +25,12 @@ It adds these directives:
"bar" -> "baz";
}
- In HTML output, the code will be rendered to a PNG image. In LaTeX output,
- the code will be rendered to an embeddable PDF file.
+ In HTML output, the code will be rendered to a PNG or SVG image (see
+ :confval:`graphviz_output_format`). In LaTeX output, the code will be
+ rendered to an embeddable PDF file.
-.. directive:: graph
+.. rst:directive:: graph
Directive for embedding a single undirected graph. The name is given as a
directive argument, the contents of the graph are the directive content.
@@ -42,7 +43,7 @@ It adds these directives:
"bar" -- "baz";
-.. directive:: digraph
+.. rst:directive:: digraph
Directive for embedding a single directed graph. The name is given as a
directive argument, the contents of the graph are the directive content.
@@ -55,6 +56,12 @@ It adds these directives:
"bar" -> "baz" -> "quux";
+.. versionadded:: 1.0
+ All three directives support an ``alt`` option that determines the image's
+ alternate text for HTML output. If not given, the alternate text defaults to
+ the graphviz code.
+
+
There are also these new config values:
.. confval:: graphviz_dot
@@ -75,3 +82,11 @@ There are also these new config values:
Additional command-line arguments to give to dot, as a list. The default is
an empty list. This is the right place to set global graph, node or edge
attributes via dot's ``-G``, ``-N`` and ``-E`` options.
+
+.. confval:: graphviz_output_format
+
+ The output format for Graphviz when building HTML files. This must be either
+ ``'png'`` or ``'svg'``; the default is ``'png'``.
+
+ .. versionadded:: 1.0
+ Previously, output always was PNG.
diff --git a/doc/ext/ifconfig.rst b/doc/ext/ifconfig.rst
index d7d16981b..a11e30726 100644
--- a/doc/ext/ifconfig.rst
+++ b/doc/ext/ifconfig.rst
@@ -8,7 +8,7 @@
This extension is quite simple, and features only one directive:
-.. directive:: ifconfig
+.. rst:directive:: ifconfig
Include content of the directive only if the Python expression given as an
argument is ``True``, evaluated in the namespace of the project's
diff --git a/doc/ext/inheritance.rst b/doc/ext/inheritance.rst
index 72849e05a..76388a94c 100644
--- a/doc/ext/inheritance.rst
+++ b/doc/ext/inheritance.rst
@@ -13,11 +13,11 @@ This extension allows you to include inheritance diagrams, rendered via the
It adds this directive:
-.. directive:: inheritance-diagram
+.. rst:directive:: inheritance-diagram
This directive has one or more arguments, each giving a module or class
name. Class names can be unqualified; in that case they are taken to exist
- in the currently described module (see :dir:`module`).
+ in the currently described module (see :rst:dir:`module`).
For each given class, and each class in each given module, the base classes
are determined. Then, from all classes and their base classes, a graph is
diff --git a/doc/ext/intersphinx.rst b/doc/ext/intersphinx.rst
index 6a079cd48..29b4057f1 100644
--- a/doc/ext/intersphinx.rst
+++ b/doc/ext/intersphinx.rst
@@ -8,17 +8,16 @@
.. versionadded:: 0.5
-This extension can generate automatic links to the documentation of Python
-objects in other projects. This works as follows:
+This extension can generate automatic links to the documentation of objects in
+other projects. This works as follows:
-* Each Sphinx HTML build creates a file named :file:`objects.inv` that
- contains a mapping from Python identifiers to URIs relative to the HTML set's
- root.
+* Each Sphinx HTML build creates a file named :file:`objects.inv` that contains
+ a mapping from object names to URIs relative to the HTML set's root.
* Projects using the Intersphinx extension can specify the location of such
mapping files in the :confval:`intersphinx_mapping` config value. The mapping
- will then be used to resolve otherwise missing references to Python objects
- into links to the other documentation.
+ will then be used to resolve otherwise missing references to objects into
+ links to the other documentation.
* By default, the mapping file is assumed to be at the same location as the rest
of the documentation; however, the location of the mapping file can also be
@@ -31,37 +30,63 @@ linking:
.. confval:: intersphinx_mapping
+ This config value contains the locations and names of other projects that
+ should be linked to in this documentation.
+
+ Relative local paths for target locations are taken as relative to the base
+ of the built documentation, while relative local paths for inventory
+ locations are taken as relative to the source directory.
+
+ When fetching remote inventory files, proxy settings will be read from
+ the ``$HTTP_PROXY`` environment variable.
+
+ **Old format for this config value**
+
+ This is the format used before Sphinx 1.0. It is still recognized.
+
A dictionary mapping URIs to either ``None`` or an URI. The keys are the
base URI of the foreign Sphinx documentation sets and can be local paths or
HTTP URIs. The values indicate where the inventory file can be found: they
can be ``None`` (at the same location as the base URI) or another local or
HTTP URI.
- Relative local paths in the keys are taken as relative to the base of the
- built documentation, while relative local paths in the values are taken as
- relative to the source directory.
+ **New format for this config value**
- An example, to add links to modules and objects in the Python standard
- library documentation::
+ .. versionadded:: 1.0
- intersphinx_mapping = {'http://docs.python.org/': None}
+ A dictionary mapping unique identifiers to a tuple ``(target, inventory)``.
+ Each ``target`` is the base URI of a foreign Sphinx documentation set and can
+ be a local path or an HTTP URI. The ``inventory`` indicates where the
+ inventory file can be found: it can be ``None`` (at the same location as
+ the base URI) or another local or HTTP URI.
+
+ The unique identifier can be used to prefix cross-reference targets, so that
+ it is clear which intersphinx set the target belongs to. A link like
+ ``:ref:`comparison manual <python:comparisons>``` will link to the label
+ "comparisons" in the doc set "python", if it exists.
+
+ **Example**
+
+ To add links to modules and objects in the Python standard library
+ documentation, use::
+
+ intersphinx_mapping = {'python': ('http://docs.python.org/', None)}
This will download the corresponding :file:`objects.inv` file from the
Internet and generate links to the pages under the given URI. The downloaded
inventory is cached in the Sphinx environment, so it must be redownloaded
whenever you do a full rebuild.
- A second example, showing the meaning of a non-``None`` value::
+ A second example, showing the meaning of a non-``None`` value of the second
+ tuple item::
- intersphinx_mapping = {'http://docs.python.org/': 'python-inv.txt'}
+ intersphinx_mapping = {'python': ('http://docs.python.org/',
+ 'python-inv.txt')}
This will read the inventory from :file:`python-inv.txt` in the source
directory, but still generate links to the pages under
- ``http://docs.python.org/``. It is up to you to update the inventory file
- as new objects are added to the Python documentation.
-
- When fetching remote inventory files, proxy settings will be read from
- the ``$HTTP_PROXY`` environment variable.
+ ``http://docs.python.org/``. It is up to you to update the inventory file as
+ new objects are added to the Python documentation.
.. confval:: intersphinx_cache_limit
diff --git a/doc/ext/math.rst b/doc/ext/math.rst
index c16025583..b9f6ab12b 100644
--- a/doc/ext/math.rst
+++ b/doc/ext/math.rst
@@ -27,13 +27,13 @@ further translation is necessary when building LaTeX output.
:mod:`mathbase` defines these new markup elements:
-.. role:: math
+.. rst:role:: math
Role for inline math. Use like this::
Since Pythagoras, we know that :math:`a^2 + b^2 = c^2`.
-.. directive:: math
+.. rst:directive:: math
Directive for displayed math (math that takes the whole line for itself).
@@ -66,7 +66,7 @@ further translation is necessary when building LaTeX output.
Normally, equations are not numbered. If you want your equation to get a
number, use the ``label`` option. When given, it selects a label for the
equation, by which it can be cross-referenced, and causes an equation number
- to be issued. See :role:`eqref` for an example. The numbering style depends
+ to be issued. See :rst:role:`eqref` for an example. The numbering style depends
on the output format.
There is also an option ``nowrap`` that prevents any wrapping of the given
@@ -81,7 +81,7 @@ further translation is necessary when building LaTeX output.
f(x) & = & x^2 + 2xy + y^2
\end{eqnarray}
-.. role:: eq
+.. rst:role:: eq
Role for cross-referencing equations via their label. This currently works
only within the same document. Example::
diff --git a/doc/ext/oldcmarkup.rst b/doc/ext/oldcmarkup.rst
new file mode 100644
index 000000000..0fdd9fecb
--- /dev/null
+++ b/doc/ext/oldcmarkup.rst
@@ -0,0 +1,35 @@
+:mod:`sphinx.ext.oldcmarkup` -- Compatibility extension for old C markup
+========================================================================
+
+.. module:: sphinx.ext.oldcmarkup
+ :synopsis: Allow further use of the pre-domain C markup
+.. moduleauthor:: Georg Brandl
+
+.. versionadded:: 1.0
+
+
+This extension is a transition helper for projects that used the old
+(pre-domain) C markup, i.e. the directives like ``cfunction`` and roles like
+``cfunc``. Since the introduction of domains, they must be called by their
+fully-qualified name (``c:function`` and ``c:func``, respectively) or, with the
+default domain set to ``c``, by their new name (``function`` and ``func``).
+(See :ref:`c-domain` for the details.)
+
+If you activate this extension, it will register the old names, and you can
+use them like before Sphinx 1.0. The directives are:
+
+- ``cfunction``
+- ``cmember``
+- ``cmacro``
+- ``ctype``
+- ``cvar``
+
+The roles are:
+
+- ``cdata``
+- ``cfunc``
+- ``cmacro``
+- ``ctype``
+
+However, it is advised to migrate to the new markup -- this extension is a
+compatibility convenience and will disappear in a future version of Sphinx.
diff --git a/doc/ext/todo.rst b/doc/ext/todo.rst
index 4f5a379dc..349d286ac 100644
--- a/doc/ext/todo.rst
+++ b/doc/ext/todo.rst
@@ -9,14 +9,14 @@
There are two additional directives when using this extension:
-.. directive:: todo
+.. rst:directive:: todo
- Use this directive like, for example, :dir:`note`.
+ Use this directive like, for example, :rst:dir:`note`.
It will only show up in the output if :confval:`todo_include_todos` is true.
-.. directive:: todolist
+.. rst:directive:: todolist
This directive is replaced by a list of all todo directives in the whole
documentation, if :confval:`todo_include_todos` is true.
@@ -26,5 +26,5 @@ There is also an additional config value:
.. confval:: todo_include_todos
- If this is ``True``, :dir:`todo` and :dir:`todolist` produce output, else
+ If this is ``True``, :rst:dir:`todo` and :rst:dir:`todolist` produce output, else
they produce nothing. The default is ``False``.
diff --git a/doc/ext/tutorial.rst b/doc/ext/tutorial.rst
index c44748d23..de61e2012 100644
--- a/doc/ext/tutorial.rst
+++ b/doc/ext/tutorial.rst
@@ -201,8 +201,7 @@ The ``todo`` directive function looks like this::
def run(self):
env = self.state.document.settings.env
- targetid = "todo-%s" % env.index_num
- env.index_num += 1
+ targetid = "todo-%d" % env.new_serialno('todo')
targetnode = nodes.target('', '', ids=[targetid])
ad = make_admonition(todo, self.name, [_('Todo')], self.options,
@@ -225,9 +224,10 @@ to the build environment instance using ``self.state.document.settings.env``.
Then, to act as a link target (from the todolist), the todo directive needs to
return a target node in addition to the todo node. The target ID (in HTML, this
-will be the anchor name) is generated by using ``env.index_num`` which is
-persistent between directive calls and therefore leads to unique target names.
-The target node is instantiated without any text (the first two arguments).
+will be the anchor name) is generated by using ``env.new_serialno`` which is
+returns a new integer directive on each call and therefore leads to unique
+target names. The target node is instantiated without any text (the first two
+arguments).
An admonition is created using a standard docutils function (wrapped in Sphinx
for docutils cross-version compatibility). The first argument gives the node
diff --git a/doc/ext/viewcode.rst b/doc/ext/viewcode.rst
new file mode 100644
index 000000000..ba6c8f864
--- /dev/null
+++ b/doc/ext/viewcode.rst
@@ -0,0 +1,19 @@
+:mod:`sphinx.ext.viewcode` -- Add links to highlighted source code
+==================================================================
+
+.. module:: sphinx.ext.viewcode
+ :synopsis: Add links to a highlighted version of the source code.
+.. moduleauthor:: Georg Brandl
+
+.. versionadded:: 1.0
+
+
+This extension looks at your Python object descriptions (``.. class::``,
+``.. function::`` etc.) and tries to find the source files where the objects are
+contained. When found, a separate HTML page will be output for each module with
+a highlighted version of the source code, and a link will be added to all object
+descriptions that leads to the source code of the described object. A link back
+from the source to the description will also be inserted.
+
+There are currently no configuration values for this extension; you just need to
+add ``'sphinx.ext.viewcode'`` to your :confval:`extensions` value for it to work.
diff --git a/doc/extensions.rst b/doc/extensions.rst
index 0716e485a..492247744 100644
--- a/doc/extensions.rst
+++ b/doc/extensions.rst
@@ -51,6 +51,9 @@ These extensions are built in and can be activated by respective entries in the
ext/ifconfig
ext/coverage
ext/todo
+ ext/extlinks
+ ext/viewcode
+ ext/oldcmarkup
Third-party extensions
diff --git a/doc/faq.rst b/doc/faq.rst
index 54aef384c..613283c5d 100644
--- a/doc/faq.rst
+++ b/doc/faq.rst
@@ -16,7 +16,7 @@ How do I...
... get section numbers?
They are automatic in LaTeX output; for HTML, give a ``:numbered:`` option to
- the :dir:`toctree` directive where you want to start numbering.
+ the :rst:dir:`toctree` directive where you want to start numbering.
... customize the look of the built HTML files?
Use themes, see :doc:`theming`.
@@ -24,6 +24,10 @@ How do I...
... add global substitutions or includes?
Add them in the :confval:`rst_epilog` config value.
+... display the whole TOC tree in the sidebar?
+ Use the :data:`toctree` callable in a custom layout template, probably in the
+ ``sidebartoc`` block.
+
... write my own extension?
See the :ref:`extension tutorial <exttut>`.
@@ -33,6 +37,8 @@ How do I...
come through cleanly.
+.. _usingwith:
+
Using Sphinx with...
--------------------
@@ -48,6 +54,12 @@ SCons
Glenn Hutchings has written a SCons build script to build Sphinx
documentation; it is hosted here: http://bitbucket.org/zondo/sphinx-scons
+PyPI
+ Jannis Leidel wrote a `setuptools command
+ <http://pypi.python.org/pypi/Sphinx-PyPI-upload>`_ that automatically uploads
+ Sphinx documentation to the PyPI package documentation area at
+ http://packages.python.org/.
+
github pages
You can use `Michael Jones' sphinx-to-github tool
<http://github.com/michaeljones/sphinx-to-github/tree/master>`_ to prepare
@@ -89,3 +101,40 @@ Google Analytics
.. _api role: http://git.savannah.gnu.org/cgit/kenozooid.git/tree/doc/extapi.py
.. _xhtml to reST: http://docutils.sourceforge.net/sandbox/xhtml2rest/xhtml2rest.py
+
+
+.. _epub-faq:
+
+Epub info
+---------
+
+The epub builder is currently in an experimental stage. It has only been tested
+with the Sphinx documentation itself. If you want to create epubs, here are
+some notes:
+
+* Split the text into several files. The longer the individual HTML files are,
+ the longer it takes the ebook reader to render them. In extreme cases, the
+ rendering can take up to one minute.
+
+* Try to minimize the markup. This also pays in rendering time.
+
+* For some readers you can use embedded or external fonts using the CSS
+ ``@font-face`` directive. This is *extremely* useful for code listings which
+ are often cut at the right margin. The default Courier font (or variant) is
+ quite wide and you can only display up to 60 characters on a line. If you
+ replace it with a narrower font, you can get more characters on a line. You
+ may even use `FontForge <http://fontforge.sourceforge.net/>`_ and create
+ narrow variants of some free font. In my case I get up to 70 characters on a
+ line.
+
+ You may have to experiment a little until you get reasonable results.
+
+* Test the created epubs. You can use several alternatives. The ones I am aware
+ of are Epubcheck_, Calibre_, FBreader_ (although it does not render the CSS),
+ and Bookworm_. For bookworm you can download the source from
+ http://code.google.com/p/threepress/ and run your own local server.
+
+.. _Epubcheck: http://code.google.com/p/epubcheck/
+.. _Calibre: http://calibre-ebook.com/
+.. _FBreader: http://www.fbreader.org/
+.. _Bookworm: http://bookworm.oreilly.com/
diff --git a/doc/glossary.rst b/doc/glossary.rst
index 7ec787ff5..2a82e20f2 100644
--- a/doc/glossary.rst
+++ b/doc/glossary.rst
@@ -19,10 +19,43 @@ Glossary
the :term:`source directory`, but can be set differently with the **-c**
command-line option.
- description unit
- The basic building block of Sphinx documentation. Every "description
- directive" (e.g. :dir:`function` or :dir:`describe`) creates such a unit;
- and most units can be cross-referenced to.
+ directive
+ A reStructuredText markup element that allows marking a block of content
+ with special meaning. Directives are supplied not only by docutils, but
+ Sphinx and custom extensions can add their own. The basic directive
+ syntax looks like this::
+
+ .. directivename:: argument ...
+ :option: value
+
+ Content of the directive.
+
+ See :ref:`directives` for more information.
+
+ document name
+ Since reST source files can have different extensions (some people like
+ ``.txt``, some like ``.rst`` -- the extension can be configured with
+ :confval:`source_suffix`) and different OSes have different path separators,
+ Sphinx abstracts them: :dfn:`document names` are always relative to the
+ :term:`source directory`, the extension is stripped, and path separators
+ are converted to slashes. All values, parameters and such referring to
+ "documents" expect such document names.
+
+ Examples for document names are ``index``, ``library/zipfile``, or
+ ``reference/datamodel/types``. Note that there is no leading or trailing
+ slash.
+
+ domain
+ A domain is a collection of markup (reStructuredText :term:`directive`\ s
+ and :term:`role`\ s) to describe and link to :term:`object`\ s belonging
+ together, e.g. elements of a programming language. Directive and role
+ names in a domain have names like ``domain:name``, e.g. ``py:function``.
+
+ Having domains means that there are no naming problems when one set of
+ documentation wants to refer to e.g. C++ and Python classes. It also
+ means that extensions that support the documentation of whole new
+ languages are much easier to write. For more information about domains,
+ see the chapter :ref:`domains`.
environment
A structure where information about all documents under the root is saved,
@@ -30,6 +63,19 @@ Glossary
parsing stage, so that successive runs only need to read and parse new and
changed documents.
+ master document
+ The document that contains the root :rst:dir:`toctree` directive.
+
+ object
+ The basic building block of Sphinx documentation. Every "object
+ directive" (e.g. :rst:dir:`function` or :rst:dir:`object`) creates such a block;
+ and most objects can be cross-referenced to.
+
+ role
+ A reStructuredText markup element that allows marking a piece of text.
+ Like directives, roles are extensible. The basic syntax looks like this:
+ ``:rolename:`content```. See :ref:`inlinemarkup` for details.
+
source directory
The directory which, including its subdirectories, contains all source
files for one Sphinx project.
diff --git a/doc/intro.rst b/doc/intro.rst
index 773bc74ed..33f97a3f8 100644
--- a/doc/intro.rst
+++ b/doc/intro.rst
@@ -8,12 +8,13 @@ you have a directory containing a bunch of reST-formatted documents (and
possibly subdirectories of docs in there as well), Sphinx can generate a
nicely-organized arrangement of HTML files (in some other directory) for easy
browsing and navigation. But from the same source, it can also generate a
-LaTeX file that you can compile into a PDF version of the documents.
+LaTeX file that you can compile into a PDF version of the documents, or a
+PDF file directly using `rst2pdf <http://rst2pdf.googlecode.com>`_.
The focus is on hand-written documentation, rather than auto-generated API docs.
-Though there is limited support for that kind of docs as well (which is intended
-to be freely mixed with hand-written content), if you need pure API docs have a
-look at `Epydoc <http://epydoc.sf.net/>`_, which also understands reST.
+Though there is support for that kind of docs as well (which is intended to be
+freely mixed with hand-written content), if you need pure API docs have a look
+at `Epydoc <http://epydoc.sf.net/>`_, which also understands reST.
Conversion from other systems
@@ -35,6 +36,12 @@ to reStructuredText/Sphinx from other documentation systems.
markup; it is at `Google Code <http://code.google.com/p/db2rst/>`_.
+Use with other systems
+----------------------
+
+See the :ref:`pertinent section in the FAQ list <usingwith>`.
+
+
Prerequisites
-------------
@@ -47,113 +54,8 @@ or some (not broken) SVN trunk snapshot.
.. _Pygments: http://pygments.org
-Setting up the documentation sources
-------------------------------------
-
-The root directory of a documentation collection is called the :dfn:`source
-directory`. Normally, this directory also contains the Sphinx configuration
-file :file:`conf.py`, but that file can also live in another directory, the
-:dfn:`configuration directory`.
-
-.. versionadded:: 0.3
- Support for a different configuration directory.
-
-Sphinx comes with a script called :program:`sphinx-quickstart` that sets up a
-source directory and creates a default :file:`conf.py` from a few questions it
-asks you. Just run ::
-
- $ sphinx-quickstart
-
-and answer the questions.
-
-
-Running a build
----------------
-
-A build is started with the :program:`sphinx-build` script. It is called
-like this::
-
- $ sphinx-build -b latex sourcedir builddir
-
-where *sourcedir* is the :term:`source directory`, and *builddir* is the
-directory in which you want to place the built documentation (it must be an
-existing directory). The :option:`-b` option selects a builder; in this example
-Sphinx will build LaTeX files.
-
-The :program:`sphinx-build` script has several more options:
-
-**-a**
- If given, always write all output files. The default is to only write output
- files for new and changed source files. (This may not apply to all
- builders.)
-
-**-E**
- Don't use a saved :term:`environment` (the structure caching all
- cross-references), but rebuild it completely. The default is to only read
- and parse source files that are new or have changed since the last run.
-
-**-t** *tag*
- Define the tag *tag*. This is relevant for :dir:`only` directives that only
- include their content if this tag is set.
-
- .. versionadded:: 0.6
-
-**-d** *path*
- Since Sphinx has to read and parse all source files before it can write an
- output file, the parsed source files are cached as "doctree pickles".
- Normally, these files are put in a directory called :file:`.doctrees` under
- the build directory; with this option you can select a different cache
- directory (the doctrees can be shared between all builders).
-
-**-c** *path*
- Don't look for the :file:`conf.py` in the source directory, but use the given
- configuration directory instead. Note that various other files and paths
- given by configuration values are expected to be relative to the
- configuration directory, so they will have to be present at this location
- too.
-
- .. versionadded:: 0.3
-
-**-C**
- Don't look for a configuration file; only take options via the ``-D`` option.
-
- .. versionadded:: 0.5
-
-**-D** *setting=value*
- Override a configuration value set in the :file:`conf.py` file. The value
- must be a string or dictionary value. For the latter, supply the setting
- name and key like this: ``-D latex_elements.docclass=scrartcl``.
-
- .. versionchanged:: 0.6
- The value can now be a dictionary value.
-
-**-A** *name=value*
- Make the *name* assigned to *value* in the HTML templates.
-
-**-N**
- Do not do colored output. (On Windows, colored output is disabled in any
- case.)
-
-**-q**
- Do not output anything on standard output, only write warnings and errors to
- standard error.
-
-**-Q**
- Do not output anything on standard output, also suppress warnings. Only
- errors are written to standard error.
-
-**-w** *file*
- Write warnings (and errors) to the given file, in addition to standard error.
-
-**-W**
- Turn warnings into errors. This means that the build stops at the first
- warning and ``sphinx-build`` exits with exit status 1.
-
-**-P**
- (Useful for debugging only.) Run the Python debugger, :mod:`pdb`, if an
- unhandled exception occurs while building.
-
+Usage
+-----
-You can also give one or more filenames on the command line after the source and
-build directories. Sphinx will then try to build only these output files (and
-their dependencies).
+See :doc:`tutorial` for an introduction. It also contains links to more
+advanced sections in this manual for the topics it discusses.
diff --git a/doc/invocation.rst b/doc/invocation.rst
new file mode 100644
index 000000000..6b8b9ee35
--- /dev/null
+++ b/doc/invocation.rst
@@ -0,0 +1,178 @@
+.. _invocation:
+
+Invocation of sphinx-build
+==========================
+
+The :program:`sphinx-build` script builds a Sphinx documentation set. It is
+called like this::
+
+ $ sphinx-build [options] sourcedir builddir [filenames]
+
+where *sourcedir* is the :term:`source directory`, and *builddir* is the
+directory in which you want to place the built documentation. Most of the time,
+you don't need to specify any *filenames*.
+
+The :program:`sphinx-build` script has several options:
+
+.. option:: -b buildername
+
+ The most important option: it selects a builder. The most common builders
+ are:
+
+ **html**
+ Build HTML pages. This is the default builder.
+
+ **dirhtml**
+ Build HTML pages, but with a single directory per document. Makes for
+ prettier URLs (no ``.html``) if served from a webserver.
+
+ **singlehtml**
+ Build a single HTML with the whole content.
+
+ **htmlhelp**, **qthelp**, **devhelp**, **epub**
+ Build HTML files with additional information for building a documentation
+ collection in one of these formats.
+
+ **latex**
+ Build LaTeX sources that can be compiled to a PDF document using
+ :program:`pdflatex`.
+
+ **man**
+ Build manual pages in groff format for UNIX systems.
+
+ **text**
+ Build plain text files.
+
+ **doctest**
+ Run all doctests in the documentation, if the :mod:`~sphinx.ext.doctest`
+ extension is enabled.
+
+ **linkcheck**
+ Check the integrity of all external links.
+
+ See :ref:`builders` for a list of all builders shipped with Sphinx.
+ Extensions can add their own builders.
+
+.. option:: -a
+
+ If given, always write all output files. The default is to only write output
+ files for new and changed source files. (This may not apply to all
+ builders.)
+
+.. option:: -E
+
+ Don't use a saved :term:`environment` (the structure caching all
+ cross-references), but rebuild it completely. The default is to only read
+ and parse source files that are new or have changed since the last run.
+
+.. option:: -t tag
+
+ Define the tag *tag*. This is relevant for :rst:dir:`only` directives that only
+ include their content if this tag is set.
+
+ .. versionadded:: 0.6
+
+.. option:: -d path
+
+ Since Sphinx has to read and parse all source files before it can write an
+ output file, the parsed source files are cached as "doctree pickles".
+ Normally, these files are put in a directory called :file:`.doctrees` under
+ the build directory; with this option you can select a different cache
+ directory (the doctrees can be shared between all builders).
+
+.. option:: -c path
+
+ Don't look for the :file:`conf.py` in the source directory, but use the given
+ configuration directory instead. Note that various other files and paths
+ given by configuration values are expected to be relative to the
+ configuration directory, so they will have to be present at this location
+ too.
+
+ .. versionadded:: 0.3
+
+.. option:: -C
+
+ Don't look for a configuration file; only take options via the ``-D`` option.
+
+ .. versionadded:: 0.5
+
+.. option:: -D setting=value
+
+ Override a configuration value set in the :file:`conf.py` file. The value
+ must be a string or dictionary value. For the latter, supply the setting
+ name and key like this: ``-D latex_elements.docclass=scrartcl``. For boolean
+ values, use ``0`` or ``1`` as the value.
+
+ .. versionchanged:: 0.6
+ The value can now be a dictionary value.
+
+.. option:: -A name=value
+
+ Make the *name* assigned to *value* in the HTML templates.
+
+ .. versionadded:: 0.5
+
+.. option:: -n
+
+ Run in nit-picky mode. Currently, this generates warnings for all missing
+ references.
+
+.. option:: -N
+
+ Do not emit colored output. (On Windows, colored output is disabled in any
+ case.)
+
+.. option:: -q
+
+ Do not output anything on standard output, only write warnings and errors to
+ standard error.
+
+.. option:: -Q
+
+ Do not output anything on standard output, also suppress warnings. Only
+ errors are written to standard error.
+
+.. option:: -w file
+
+ Write warnings (and errors) to the given file, in addition to standard error.
+
+.. option:: -W
+
+ Turn warnings into errors. This means that the build stops at the first
+ warning and ``sphinx-build`` exits with exit status 1.
+
+.. option:: -P
+
+ (Useful for debugging only.) Run the Python debugger, :mod:`pdb`, if an
+ unhandled exception occurs while building.
+
+
+You can also give one or more filenames on the command line after the source and
+build directories. Sphinx will then try to build only these output files (and
+their dependencies).
+
+
+Makefile options
+----------------
+
+The :file:`Makefile` and :file:`make.bat` files created by
+:program:`sphinx-quickstart` usually run :program:`sphinx-build` only with the
+:option:`-b` and :option:`-d` options. However, they support the following
+variables to customize behavior:
+
+.. describe:: PAPER
+
+ The value for :confval:`latex_paper_size`.
+
+.. describe:: SPHINXBUILD
+
+ The command to use instead of ``sphinx-build``.
+
+.. describe:: BUILDDIR
+
+ The build directory to use instead of the one chosen in
+ :program:`sphinx-quickstart`.
+
+.. describe:: SPHINXOPTS
+
+ Additional options for :program:`sphinx-build`.
diff --git a/doc/man/sphinx-build.rst b/doc/man/sphinx-build.rst
new file mode 100644
index 000000000..30f824e8c
--- /dev/null
+++ b/doc/man/sphinx-build.rst
@@ -0,0 +1,102 @@
+:orphan:
+
+sphinx-build manual page
+========================
+
+Synopsis
+--------
+
+**sphinx-build** [*options*] <*sourcedir*> <*outdir*> [*filenames* ...]
+
+
+Description
+-----------
+
+:program:`sphinx-build` generates documentation from the files in
+``<sourcedir>`` and places it in the ``<outdir>``.
+
+:program:`sphinx-build` looks for ``<sourcedir>/conf.py`` for the configuration
+settings. :manpage:`sphinx-quickstart(1)` may be used to generate template
+files, including ``conf.py``.
+
+:program:`sphinx-build` can create documentation in different formats. A format
+is selected by specifying the builder name on the command line; it defaults to
+HTML. Builders can also perform other tasks related to documentation
+processing.
+
+By default, everything that is outdated is built. Output only for selected
+files can be built by specifying individual filenames.
+
+List of available builders:
+
+html
+ HTML file generation. This is the default builder.
+
+htmlhelp
+ Generates files for CHM (compiled help files) generation.
+
+qthelp
+ Generates files for Qt help collection generation.
+
+devhelp
+ Generates files for the GNOME Devhelp help viewer.
+
+latex
+ Generates LaTeX output that can be compiled to a PDF document.
+
+man
+ Generates manual pages.
+
+text
+ Generates a plain-text version of the documentation.
+
+changes
+ Generates HTML files listing changed/added/deprecated items for
+ the current version of the documented project.
+
+linkcheck
+ Checks the integrity of all external links in the source.
+
+pickle / json
+ Generates serialized HTML files for use in web applications.
+
+
+Options
+-------
+
+-b <builder> Builder to use; defaults to html. See the full list
+ of builders above.
+-a Generate output for all files; without this option only
+ output for new and changed files is generated.
+-E Ignore cached files, forces to re-read all source files
+ from disk.
+-c <path> Locate the conf.py file in the specified path instead of
+ <sourcedir>.
+-C Specify that no conf.py file at all is to be used.
+ Configuration can only be set with the -D option.
+-D <setting=value> Override a setting from the configuration file.
+-d <path> Path to cached files; defaults to <outdir>/.doctrees.
+-A <name=value> Pass a value into the HTML templates (only for HTML builders).
+-n Run in nit-picky mode, warn about all missing references.
+-N Prevent colored output.
+-q Quiet operation, just print warnings and errors on stderr.
+-Q Very quiet operation, don't print anything except for errors.
+-w <file> Write warnings and errors into the given file, in addition
+ to stderr.
+-W Turn warnings into errors.
+-P Run Pdb on exception.
+
+
+See also
+--------
+
+:manpage:`sphinx-quickstart(1)`
+
+Author
+------
+
+Georg Brandl <georg@python.org>, Armin Ronacher <armin.ronacher@active-4.com> et
+al.
+
+This manual page was initially written by Mikhail Gusarov
+<dottedmag@dottedmag.net>, for the Debian project.
diff --git a/doc/man/sphinx-quickstart.rst b/doc/man/sphinx-quickstart.rst
new file mode 100644
index 000000000..172772610
--- /dev/null
+++ b/doc/man/sphinx-quickstart.rst
@@ -0,0 +1,33 @@
+:orphan:
+
+sphinx-quickstart manual page
+=============================
+
+Synopsis
+--------
+
+**sphinx-quickstart**
+
+
+Description
+-----------
+
+:program:`sphinx-quickstart` is an interactive tool that asks some questions
+about your project and then generates a complete documentation directory and
+sample Makefile to be used with :manpage:`sphinx-build(1)`.
+
+
+See also
+--------
+
+:manpage:`sphinx-build(1)`
+
+
+Author
+------
+
+Georg Brandl <georg@python.org>, Armin Ronacher <armin.ronacher@active-4.com> et
+al.
+
+This manual page was initially written by Mikhail Gusarov
+<dottedmag@dottedmag.net>, for the Debian project.
diff --git a/doc/markup/code.rst b/doc/markup/code.rst
index 93cd127ba..eaaf17d08 100644
--- a/doc/markup/code.rst
+++ b/doc/markup/code.rst
@@ -43,14 +43,14 @@ installed) and handled in a smart way:
This language is used until the next ``highlight`` directive is encountered.
* For documents that have to show snippets in different languages, there's also
- a :dir:`code-block` directive that is given the highlighting language
+ a :rst:dir:`code-block` directive that is given the highlighting language
directly::
.. code-block:: ruby
Some Ruby code.
- The directive's alias name :dir:`sourcecode` works as well.
+ The directive's alias name :rst:dir:`sourcecode` works as well.
* The valid values for the highlighting language are:
@@ -70,7 +70,7 @@ Line numbers
If installed, Pygments can generate line numbers for code blocks. For
automatically-highlighted blocks (those started by ``::``), line numbers must be
-switched on in a :dir:`highlight` directive, with the ``linenothreshold``
+switched on in a :rst:dir:`highlight` directive, with the ``linenothreshold``
option::
.. highlight:: python
@@ -78,7 +78,7 @@ option::
This will produce line numbers for all code blocks longer than five lines.
-For :dir:`code-block` blocks, a ``linenos`` flag option can be given to switch
+For :rst:dir:`code-block` blocks, a ``linenos`` flag option can be given to switch
on line numbers for the individual block::
.. code-block:: ruby
@@ -90,7 +90,7 @@ on line numbers for the individual block::
Includes
^^^^^^^^
-.. directive:: .. literalinclude:: filename
+.. rst:directive:: .. literalinclude:: filename
Longer displays of verbatim text may be included by storing the example text in
an external file containing only plain text. The file may be included using the
@@ -103,6 +103,9 @@ Includes
is absolute (starting with ``/``), it is relative to the top source
directory.
+ Tabs in the input are expanded if you give a ``tab-width`` option with the
+ desired tab width.
+
The directive also supports the ``linenos`` flag option to switch on line
numbers, and a ``language`` option to select a language different from the
current file's standard language. Example with options::
@@ -143,11 +146,17 @@ Includes
string option, only lines that precede the first lines containing that string
are included.
+ You can prepend and/or append a line to the included code, using the
+ ``prepend`` and ``append`` option, respectively. This is useful e.g. for
+ highlighting PHP code that doesn't include the ``<?php``/``?>`` markers.
+
.. versionadded:: 0.4.3
The ``encoding`` option.
.. versionadded:: 0.6
The ``pyobject``, ``lines``, ``start-after`` and ``end-before`` options,
as well as support for absolute filenames.
+ .. versionadded:: 1.0
+ The ``prepend`` and ``append`` options, as well as ``tab-width``.
.. rubric:: Footnotes
diff --git a/doc/markup/desc.rst b/doc/markup/desc.rst
deleted file mode 100644
index ec8ede37d..000000000
--- a/doc/markup/desc.rst
+++ /dev/null
@@ -1,357 +0,0 @@
-.. highlight:: rest
-
-Module-specific markup
-----------------------
-
-The markup described in this section is used to provide information about a
-module being documented. Normally this markup appears after a title heading; a
-typical module section might start like this::
-
- :mod:`parrot` -- Dead parrot access
- ===================================
-
- .. module:: parrot
- :platform: Unix, Windows
- :synopsis: Analyze and reanimate dead parrots.
- .. moduleauthor:: Eric Cleese <eric@python.invalid>
- .. moduleauthor:: John Idle <john@python.invalid>
-
-
-The directives you can use for module declarations are:
-
-.. directive:: .. module:: name
-
- This directive marks the beginning of the description of a module (or package
- submodule, in which case the name should be fully qualified, including the
- package name). It does not create content (like e.g. :dir:`class` does).
-
- This directive will also cause an entry in the global module index.
-
- The ``platform`` option, if present, is a comma-separated list of the
- platforms on which the module is available (if it is available on all
- platforms, the option should be omitted). The keys are short identifiers;
- examples that are in use include "IRIX", "Mac", "Windows", and "Unix". It is
- important to use a key which has already been used when applicable.
-
- The ``synopsis`` option should consist of one sentence describing the
- module's purpose -- it is currently only used in the Global Module Index.
-
- The ``deprecated`` option can be given (with no value) to mark a module as
- deprecated; it will be designated as such in various locations then.
-
-
-.. directive:: .. currentmodule:: name
-
- This directive tells Sphinx that the classes, functions etc. documented from
- here are in the given module (like :dir:`module`), but it will not create
- index entries, an entry in the Global Module Index, or a link target for
- :role:`mod`. This is helpful in situations where documentation for things in
- a module is spread over multiple files or sections -- one location has the
- :dir:`module` directive, the others only :dir:`currentmodule`.
-
-
-.. directive:: .. moduleauthor:: name <email>
-
- The ``moduleauthor`` directive, which can appear multiple times, names the
- authors of the module code, just like ``sectionauthor`` names the author(s)
- of a piece of documentation. It too only produces output if the
- :confval:`show_authors` configuration value is True.
-
-
-.. note::
-
- It is important to make the section title of a module-describing file
- meaningful since that value will be inserted in the table-of-contents trees
- in overview files.
-
-
-.. _desc-units:
-
-Object description units
-------------------------
-
-There are a number of directives used to describe specific features provided by
-modules. Each directive requires one or more signatures to provide basic
-information about what is being described, and the content should be the
-description. The basic version makes entries in the general index; if no index
-entry is desired, you can give the directive option flag ``:noindex:``. The
-following example shows all of the features of this directive type::
-
- .. function:: spam(eggs)
- ham(eggs)
- :noindex:
-
- Spam or ham the foo.
-
-The signatures of object methods or data attributes should always include the
-type name (``.. method:: FileInput.input(...)``), even if it is obvious from the
-context which type they belong to; this is to enable consistent
-cross-references. If you describe methods belonging to an abstract protocol,
-such as "context managers", include a (pseudo-)type name too to make the
-index entries more informative.
-
-The directives are:
-
-.. directive:: .. cfunction:: type name(signature)
-
- Describes a C function. The signature should be given as in C, e.g.::
-
- .. cfunction:: PyObject* PyType_GenericAlloc(PyTypeObject *type, Py_ssize_t nitems)
-
- This is also used to describe function-like preprocessor macros. The names
- of the arguments should be given so they may be used in the description.
-
- Note that you don't have to backslash-escape asterisks in the signature,
- as it is not parsed by the reST inliner.
-
-.. directive:: .. cmember:: type name
-
- Describes a C struct member. Example signature::
-
- .. cmember:: PyObject* PyTypeObject.tp_bases
-
- The text of the description should include the range of values allowed, how
- the value should be interpreted, and whether the value can be changed.
- References to structure members in text should use the ``member`` role.
-
-.. directive:: .. cmacro:: name
-
- Describes a "simple" C macro. Simple macros are macros which are used
- for code expansion, but which do not take arguments so cannot be described as
- functions. This is not to be used for simple constant definitions. Examples
- of its use in the Python documentation include :cmacro:`PyObject_HEAD` and
- :cmacro:`Py_BEGIN_ALLOW_THREADS`.
-
-.. directive:: .. ctype:: name
-
- Describes a C type. The signature should just be the type name.
-
-.. directive:: .. cvar:: type name
-
- Describes a global C variable. The signature should include the type, such
- as::
-
- .. cvar:: PyObject* PyClass_Type
-
-.. directive:: .. data:: name
-
- Describes global data in a module, including both variables and values used
- as "defined constants." Class and object attributes are not documented
- using this environment.
-
-.. directive:: .. exception:: name
-
- Describes an exception class. The signature can, but need not include
- parentheses with constructor arguments.
-
-.. directive:: .. function:: name(signature)
-
- Describes a module-level function. The signature should include the
- parameters, enclosing optional parameters in brackets. Default values can be
- given if it enhances clarity; see :ref:`signatures`. For example::
-
- .. function:: Timer.repeat([repeat=3[, number=1000000]])
-
- Object methods are not documented using this directive. Bound object methods
- placed in the module namespace as part of the public interface of the module
- are documented using this, as they are equivalent to normal functions for
- most purposes.
-
- The description should include information about the parameters required and
- how they are used (especially whether mutable objects passed as parameters
- are modified), side effects, and possible exceptions. A small example may be
- provided.
-
-.. directive:: .. class:: name[(signature)]
-
- Describes a class. The signature can include parentheses with parameters
- which will be shown as the constructor arguments. See also
- :ref:`signatures`.
-
- Methods and attributes belonging to the class should be placed in this
- directive's body. If they are placed outside, the supplied name should
- contain the class name so that cross-references still work. Example::
-
- .. class:: Foo
- .. method:: quux()
-
- -- or --
-
- .. class:: Bar
-
- .. method:: Bar.quux()
-
- The first way is the preferred one.
-
- .. versionadded:: 0.4
- The standard reST directive ``class`` is now provided by Sphinx under
- the name ``cssclass``.
-
-.. directive:: .. attribute:: name
-
- Describes an object data attribute. The description should include
- information about the type of the data to be expected and whether it may be
- changed directly.
-
-.. directive:: .. method:: name(signature)
-
- Describes an object method. The parameters should not include the ``self``
- parameter. The description should include similar information to that
- described for ``function``. See also :ref:`signatures`.
-
-.. directive:: .. staticmethod:: name(signature)
-
- Like :dir:`method`, but indicates that the method is a static method.
-
- .. versionadded:: 0.4
-
-.. directive:: .. classmethod:: name(signature)
-
- Like :dir:`method`, but indicates that the method is a class method.
-
- .. versionadded:: 0.6
-
-
-.. _signatures:
-
-Signatures
-~~~~~~~~~~
-
-Signatures of functions, methods and class constructors can be given like they
-would be written in Python, with the exception that optional parameters can be
-indicated by brackets::
-
- .. function:: compile(source[, filename[, symbol]])
-
-It is customary to put the opening bracket before the comma. In addition to
-this "nested" bracket style, a "flat" style can also be used, due to the fact
-that most optional parameters can be given independently::
-
- .. function:: compile(source[, filename, symbol])
-
-Default values for optional arguments can be given (but if they contain commas,
-they will confuse the signature parser). Python 3-style argument annotations
-can also be given as well as return type annotations::
-
- .. function:: compile(source : string[, filename, symbol]) -> ast object
-
-
-Info field lists
-~~~~~~~~~~~~~~~~
-
-.. versionadded:: 0.4
-
-Inside description unit directives, reST field lists with these fields are
-recognized and formatted nicely:
-
-* ``param``, ``parameter``, ``arg``, ``argument``, ``key``, ``keyword``:
- Description of a parameter.
-* ``type``: Type of a parameter.
-* ``raises``, ``raise``, ``except``, ``exception``: That (and when) a specific
- exception is raised.
-* ``var``, ``ivar``, ``cvar``: Description of a variable.
-* ``returns``, ``return``: Description of the return value.
-* ``rtype``: Return type.
-
-The field names must consist of one of these keywords and an argument (except
-for ``returns`` and ``rtype``, which do not need an argument). This is best
-explained by an example::
-
- .. function:: format_exception(etype, value, tb[, limit=None])
-
- Format the exception with a traceback.
-
- :param etype: exception type
- :param value: exception value
- :param tb: traceback object
- :param limit: maximum number of stack frames to show
- :type limit: integer or None
- :rtype: list of strings
-
-This will render like this:
-
- .. function:: format_exception(etype, value, tb[, limit=None])
- :noindex:
-
- Format the exception with a traceback.
-
- :param etype: exception type
- :param value: exception value
- :param tb: traceback object
- :param limit: maximum number of stack frames to show
- :type limit: integer or None
- :rtype: list of strings
-
-
-Command-line program markup
-~~~~~~~~~~~~~~~~~~~~~~~~~~~
-
-There is a set of directives allowing documenting command-line programs:
-
-.. directive:: .. cmdoption:: name args, name args, ...
-
- Describes a command line option or switch. Option argument names should be
- enclosed in angle brackets. Example::
-
- .. cmdoption:: -m <module>, --module <module>
-
- Run a module as a script.
-
- The directive will create a cross-reference target named after the *first*
- option, referencable by :role:`option` (in the example case, you'd use
- something like ``:option:`-m```).
-
-.. directive:: .. envvar:: name
-
- Describes an environment variable that the documented code or program uses or
- defines.
-
-
-.. directive:: .. program:: name
-
- Like :dir:`currentmodule`, this directive produces no output. Instead, it
- serves to notify Sphinx that all following :dir:`cmdoption` directives
- document options for the program called *name*.
-
- If you use :dir:`program`, you have to qualify the references in your
- :role:`option` roles by the program name, so if you have the following
- situation ::
-
- .. program:: rm
-
- .. cmdoption:: -r
-
- Work recursively.
-
- .. program:: svn
-
- .. cmdoption:: -r revision
-
- Specify the revision to work upon.
-
- then ``:option:`rm -r``` would refer to the first option, while
- ``:option:`svn -r``` would refer to the second one.
-
- The program name may contain spaces (in case you want to document subcommands
- like ``svn add`` and ``svn commit`` separately).
-
- .. versionadded:: 0.5
-
-
-Custom description units
-~~~~~~~~~~~~~~~~~~~~~~~~
-
-There is also a generic version of these directives:
-
-.. directive:: .. describe:: text
-
- This directive produces the same formatting as the specific ones explained
- above but does not create index entries or cross-referencing targets. It is
- used, for example, to describe the directives in this document. Example::
-
- .. describe:: opcode
-
- Describes a Python bytecode instruction.
-
-Extensions may add more directives like that, using the
-:func:`~sphinx.application.Sphinx.add_description_unit` method.
diff --git a/doc/markup/index.rst b/doc/markup/index.rst
index 1127fa739..9492456d0 100644
--- a/doc/markup/index.rst
+++ b/doc/markup/index.rst
@@ -1,3 +1,5 @@
+.. _sphinxmarkup:
+
Sphinx Markup Constructs
========================
@@ -6,8 +8,10 @@ markup. This section contains the reference material for these facilities.
.. toctree::
- desc
+ toctree
para
code
inline
misc
+
+More markup is added by :ref:`domains`.
diff --git a/doc/markup/inline.rst b/doc/markup/inline.rst
index 9b4b26e3a..4d4ebe24d 100644
--- a/doc/markup/inline.rst
+++ b/doc/markup/inline.rst
@@ -1,5 +1,7 @@
.. highlight:: rest
+.. _inline-markup:
+
Inline markup
=============
@@ -12,11 +14,13 @@ They are written as ``:rolename:`content```.
free to use it for anything you like, e.g. variable names; use the
:confval:`default_role` config value to set it to a known role.
+See :ref:`domains` for roles added by domains.
+
.. _xref-syntax:
Cross-referencing syntax
-------------------------
+~~~~~~~~~~~~~~~~~~~~~~~~
Cross-references are generated by many semantic interpreted text roles.
Basically, you only need to write ``:role:`target```, and a link will be created
@@ -32,195 +36,60 @@ more versatile:
* If you prefix the content with ``!``, no reference/hyperlink will be created.
-* For the Python object roles, if you prefix the content with ``~``, the link
- text will only be the last component of the target. For example,
- ``:meth:`~Queue.Queue.get``` will refer to ``Queue.Queue.get`` but only
- display ``get`` as the link text.
+* If you prefix the content with ``~``, the link text will only be the last
+ component of the target. For example, ``:py:meth:`~Queue.Queue.get``` will
+ refer to ``Queue.Queue.get`` but only display ``get`` as the link text.
In HTML output, the link's ``title`` attribute (that is e.g. shown as a
tool-tip on mouse-hover) will always be the full target name.
-Cross-referencing Python objects
---------------------------------
-
-The following roles refer to objects in modules and are possibly hyperlinked if
-a matching identifier is found:
-
-.. role:: mod
-
- The name of a module; a dotted name may be used. This should also be used for
- package names.
-
-.. role:: func
-
- The name of a Python function; dotted names may be used. The role text
- needs not include trailing parentheses to enhance readability; they will be
- added automatically by Sphinx if the :confval:`add_function_parentheses`
- config value is true (the default).
-
-.. role:: data
-
- The name of a module-level variable.
-
-.. role:: const
-
- The name of a "defined" constant. This may be a C-language ``#define``
- or a Python variable that is not intended to be changed.
-
-.. role:: class
-
- A class name; a dotted name may be used.
-
-.. role:: meth
-
- The name of a method of an object. The role text should include the type
- name and the method name; if it occurs within the description of a type,
- the type name can be omitted. A dotted name may be used.
-
-.. role:: attr
-
- The name of a data attribute of an object.
-
-.. role:: exc
-
- The name of an exception. A dotted name may be used.
-
-.. role:: obj
-
- The name of an object of unspecified type. Useful e.g. as the
- :confval:`default_role`.
-
- .. versionadded:: 0.4
-
-The name enclosed in this markup can include a module name and/or a class name.
-For example, ``:func:`filter``` could refer to a function named ``filter`` in
-the current module, or the built-in function of that name. In contrast,
-``:func:`foo.filter``` clearly refers to the ``filter`` function in the ``foo``
-module.
-
-Normally, names in these roles are searched first without any further
-qualification, then with the current module name prepended, then with the
-current module and class name (if any) prepended. If you prefix the name with a
-dot, this order is reversed. For example, in the documentation of Python's
-:mod:`codecs` module, ``:func:`open``` always refers to the built-in function,
-while ``:func:`.open``` refers to :func:`codecs.open`.
-
-A similar heuristic is used to determine whether the name is an attribute of
-the currently documented class.
-
-
-Cross-referencing C constructs
-------------------------------
-
-The following roles create cross-references to C-language constructs if they
-are defined in the documentation:
-
-.. role:: cdata
-
- The name of a C-language variable.
-
-.. role:: cfunc
-
- The name of a C-language function. Should include trailing parentheses.
-
-.. role:: cmacro
-
- The name of a "simple" C macro, as defined above.
-
-.. role:: ctype
-
- The name of a C-language type.
-
-
-Cross-referencing other items of interest
------------------------------------------
-
-The following roles do possibly create a cross-reference, but do not refer to
-objects:
-
-.. role:: envvar
-
- An environment variable. Index entries are generated. Also generates a link
- to the matching :dir:`envvar` directive, if it exists.
-
-.. role:: token
-
- The name of a grammar token (used to create links between
- :dir:`productionlist` directives).
-
-.. role:: keyword
-
- The name of a keyword in Python. This creates a link to a reference label
- with that name, if it exists.
-
-.. role:: option
-
- A command-line option to an executable program. The leading hyphen(s) must
- be included. This generates a link to a :dir:`cmdoption` directive, if it
- exists.
-
-
-The following role creates a cross-reference to the term in the glossary:
-
-.. role:: term
-
- Reference to a term in the glossary. The glossary is created using the
- ``glossary`` directive containing a definition list with terms and
- definitions. It does not have to be in the same file as the ``term`` markup,
- for example the Python docs have one global glossary in the ``glossary.rst``
- file.
-
- If you use a term that's not explained in a glossary, you'll get a warning
- during build.
-
-
.. _ref-role:
Cross-referencing arbitrary locations
-------------------------------------
-.. index:: pair: ref; role
+.. rst:role:: ref
-To support cross-referencing to arbitrary locations in any document, the
-standard reST labels are used. For this to work label names must be unique
-throughout the entire documentation. There are two ways in which you can refer
-to labels:
+ To support cross-referencing to arbitrary locations in any document, the
+ standard reST labels are used. For this to work label names must be unique
+ throughout the entire documentation. There are two ways in which you can
+ refer to labels:
-* If you place a label directly before a section title, you can reference to it
- with ``:ref:`label-name```. Example::
+ * If you place a label directly before a section title, you can reference to
+ it with ``:ref:`label-name```. Example::
- .. _my-reference-label:
+ .. _my-reference-label:
- Section to cross-reference
- --------------------------
+ Section to cross-reference
+ --------------------------
- This is the text of the section.
+ This is the text of the section.
- It refers to the section itself, see :ref:`my-reference-label`.
+ It refers to the section itself, see :ref:`my-reference-label`.
- The ``:ref:`` role would then generate a link to the section, with the link
- title being "Section to cross-reference". This works just as well when
- section and reference are in different source files.
+ The ``:ref:`` role would then generate a link to the section, with the link
+ title being "Section to cross-reference". This works just as well when
+ section and reference are in different source files.
- Automatic labels also work with figures: given ::
+ Automatic labels also work with figures: given ::
- .. _my-figure:
+ .. _my-figure:
- .. figure:: whatever
+ .. figure:: whatever
- Figure caption
+ Figure caption
- a reference ``:ref:`my-figure``` would insert a reference to the figure with
- link text "Figure caption".
+ a reference ``:ref:`my-figure``` would insert a reference to the figure
+ with link text "Figure caption".
-* Labels that aren't placed before a section title can still be referenced to,
- but you must give the link an explicit title, using this syntax: ``:ref:`Link
- title <label-name>```.
+ * Labels that aren't placed before a section title can still be referenced
+ to, but you must give the link an explicit title, using this syntax:
+ ``:ref:`Link title <label-name>```.
-Using :role:`ref` is advised over standard reStructuredText links to sections
-(like ```Section title`_``) because it works across files, when section headings
-are changed, and for all builders that support cross-references.
+ Using :rst:role:`ref` is advised over standard reStructuredText links to sections
+ (like ```Section title`_``) because it works across files, when section
+ headings are changed, and for all builders that support cross-references.
Cross-referencing documents
@@ -230,7 +99,7 @@ Cross-referencing documents
There is also a way to directly link to documents:
-.. role:: doc
+.. rst:role:: doc
Link to the specified document; the document name can be specified in
absolute or relative fashion. For example, if the reference
@@ -247,7 +116,7 @@ Referencing downloadable files
.. versionadded:: 0.6
-.. role:: download
+.. rst:role:: download
This role lets you link to files within your source tree that are not reST
documents that can be viewed, but files that can be downloaded.
@@ -275,7 +144,7 @@ Other semantic markup
The following roles don't do anything special except formatting the text
in a different style:
-.. role:: abbr
+.. rst:role:: abbr
An abbreviation. If the role content contains a parenthesized explanation,
it will be treated specially: it will be shown in a tool-tip in HTML, and
@@ -285,16 +154,16 @@ in a different style:
.. versionadded:: 0.6
-.. role:: command
+.. rst:role:: command
The name of an OS-level command, such as ``rm``.
-.. role:: dfn
+.. rst:role:: dfn
Mark the defining instance of a term in the text. (No index entries are
generated.)
-.. role:: file
+.. rst:role:: file
The name of a file or directory. Within the contents, you can use curly
braces to indicate a "variable" part, for example::
@@ -304,7 +173,7 @@ in a different style:
In the built documentation, the ``x`` will be displayed differently to
indicate that it is to be replaced by the Python minor version.
-.. role:: guilabel
+.. rst:role:: guilabel
Labels presented as part of an interactive user interface should be marked
using ``guilabel``. This includes labels from text-based interfaces such as
@@ -313,7 +182,12 @@ in a different style:
labels, window titles, field names, menu and menu selection names, and even
values in selection lists.
-.. role:: kbd
+ .. versionchanged:: 1.0
+ An accelerator key for the GUI label can be included using an ampersand;
+ this will be stripped and displayed underlined in the output (example:
+ ``:guilabel:`&Cancel```). To include a literal ampersand, double it.
+
+.. rst:role:: kbd
Mark a sequence of keystrokes. What form the key sequence takes may depend
on platform- or application-specific conventions. When there are no relevant
@@ -323,7 +197,7 @@ in a different style:
reference to a specific application or platform, the same sequence should be
marked as ``:kbd:`Control-x Control-f```.
-.. role:: mailheader
+.. rst:role:: mailheader
The name of an RFC 822-style mail header. This markup does not imply that
the header is being used in an email message, but can be used to refer to any
@@ -333,16 +207,16 @@ in a different style:
being preferred where there is more than one common usage. For example:
``:mailheader:`Content-Type```.
-.. role:: makevar
+.. rst:role:: makevar
The name of a :command:`make` variable.
-.. role:: manpage
+.. rst:role:: manpage
A reference to a Unix manual page including the section,
e.g. ``:manpage:`ls(1)```.
-.. role:: menuselection
+.. rst:role:: menuselection
Menu selections should be marked using the ``menuselection`` role. This is
used to mark a complete sequence of menu selections, including selecting
@@ -358,29 +232,34 @@ in a different style:
ellipsis some operating systems use to indicate that the command opens a
dialog, the indicator should be omitted from the selection name.
-.. role:: mimetype
+ ``menuselection`` also supports ampersand accelerators just like
+ :rst:role:`guilabel`.
+
+.. rst:role:: mimetype
The name of a MIME type, or a component of a MIME type (the major or minor
portion, taken alone).
-.. role:: newsgroup
+.. rst:role:: newsgroup
The name of a Usenet newsgroup.
-.. role:: program
+.. rst:role:: program
The name of an executable program. This may differ from the file name for
the executable for some platforms. In particular, the ``.exe`` (or other)
extension should be omitted for Windows programs.
-.. role:: regexp
+.. rst:role:: regexp
A regular expression. Quotes should not be included.
-.. role:: samp
+.. rst:role:: samp
A piece of literal text, such as code. Within the contents, you can use
- curly braces to indicate a "variable" part, as in ``:file:``.
+ curly braces to indicate a "variable" part, as in :rst:dir:`file`. For
+ example, in ``:samp:`print 1+{variable}```, the part ``variable`` would be
+ emphasized.
If you don't need the "variable part" indication, use the standard
````code```` instead.
@@ -388,13 +267,13 @@ in a different style:
The following roles generate external links:
-.. role:: pep
+.. rst:role:: pep
A reference to a Python Enhancement Proposal. This generates appropriate
index entries. The text "PEP *number*\ " is generated; in the HTML output,
this text is a hyperlink to an online copy of the specified PEP.
-.. role:: rfc
+.. rst:role:: rfc
A reference to an Internet Request for Comments. This generates appropriate
index entries. The text "RFC *number*\ " is generated; in the HTML output,
@@ -405,6 +284,48 @@ Note that there are no special roles for including hyperlinks as you can use
the standard reST markup for that purpose.
+Cross-referencing other items of interest
+-----------------------------------------
+
+The following roles do possibly create a cross-reference, but do not refer to
+objects:
+
+.. rst:role:: envvar
+
+ An environment variable. Index entries are generated. Also generates a link
+ to the matching :rst:dir:`envvar` directive, if it exists.
+
+.. rst:role:: token
+
+ The name of a grammar token (used to create links between
+ :rst:dir:`productionlist` directives).
+
+.. rst:role:: keyword
+
+ The name of a keyword in Python. This creates a link to a reference label
+ with that name, if it exists.
+
+.. rst:role:: option
+
+ A command-line option to an executable program. The leading hyphen(s) must
+ be included. This generates a link to a :rst:dir:`option` directive, if it
+ exists.
+
+
+The following role creates a cross-reference to the term in the glossary:
+
+.. rst:role:: term
+
+ Reference to a term in the glossary. The glossary is created using the
+ ``glossary`` directive containing a definition list with terms and
+ definitions. It does not have to be in the same file as the ``term`` markup,
+ for example the Python docs have one global glossary in the ``glossary.rst``
+ file.
+
+ If you use a term that's not explained in a glossary, you'll get a warning
+ during build.
+
+
.. _default-substitutions:
Substitutions
diff --git a/doc/markup/misc.rst b/doc/markup/misc.rst
index 01e5a3f18..6173589b3 100644
--- a/doc/markup/misc.rst
+++ b/doc/markup/misc.rst
@@ -11,12 +11,12 @@ File-wide metadata
reST has the concept of "field lists"; these are a sequence of fields marked up
like this::
- :Field name: Field content
+ :fieldname: Field content
-A field list at the very top of a file is parsed as the "docinfo", which in
-normal documents can be used to record the author, date of publication and
-other metadata. In Sphinx, the docinfo is used as metadata, too, but not
-displayed in the output.
+A field list at the very top of a file is parsed by docutils as the "docinfo",
+which is normally used to record the author, date of publication and other
+metadata. *In Sphinx*, the docinfo is used as metadata, too, but not displayed
+in the output.
At the moment, these metadata fields are recognized:
@@ -29,11 +29,17 @@ At the moment, these metadata fields are recognized:
If set, the web application won't display a comment form for a page generated
from this source file.
+``orphan``
+ If set, warnings about this file not being included in any toctree will be
+ suppressed.
+
+ .. versionadded:: 1.0
+
Meta-information markup
-----------------------
-.. directive:: sectionauthor
+.. rst:directive:: .. sectionauthor:: name <email>
Identifies the author of the current section. The argument should include
the author's name such that it can be used for presentation and email
@@ -48,12 +54,20 @@ Meta-information markup
output.
+.. rst:directive:: .. codeauthor:: name <email>
+
+ The :rst:dir:`codeauthor` directive, which can appear multiple times, names the
+ authors of the described code, just like :rst:dir:`sectionauthor` names the
+ author(s) of a piece of documentation. It too only produces output if the
+ :confval:`show_authors` configuration value is True.
+
+
.. _tags:
Including content based on tags
-------------------------------
-.. directive:: .. only:: <expression>
+.. rst:directive:: .. only:: <expression>
Include the content of the directive only if the *expression* is true. The
expression should consist of tags, like this::
@@ -73,12 +87,12 @@ Including content based on tags
Tables
------
-Use standard reStructuredText tables. They work fine in HTML output, however
-there are some gotchas when using tables in LaTeX: the column width is hard to
-determine correctly automatically. For this reason, the following directive
-exists:
+Use :ref:`standard reStructuredText tables <rst-tables>`. They work fine in
+HTML output, however there are some gotchas when using tables in LaTeX: the
+column width is hard to determine correctly automatically. For this reason, the
+following directive exists:
-.. directive:: .. tabularcolumns:: column spec
+.. rst:directive:: .. tabularcolumns:: column spec
This directive gives a "column spec" for the next table occurring in the
source file. The spec is the second argument to the LaTeX ``tabulary``
@@ -114,5 +128,5 @@ exists:
therefore set with the standard LaTeX ``tabular`` environment. Also, the
verbatim environment used for literal blocks only works in ``p{width}``
columns, which means that by default, Sphinx generates such column specs for
- such tables. Use the :dir:`tabularcolumns` directive to get finer control
+ such tables. Use the :rst:dir:`tabularcolumns` directive to get finer control
over such tables.
diff --git a/doc/markup/para.rst b/doc/markup/para.rst
index 774b0f518..be06f6365 100644
--- a/doc/markup/para.rst
+++ b/doc/markup/para.rst
@@ -9,7 +9,7 @@ Paragraph-level markup
These directives create short paragraphs and can be used inside information
units as well as normal text:
-.. directive:: note
+.. rst:directive:: .. note::
An especially important bit of information about an API that a user should be
aware of when using whatever bit of API the note pertains to. The content of
@@ -22,15 +22,15 @@ units as well as normal text:
This function is not suitable for sending spam e-mails.
-.. directive:: warning
+.. rst:directive:: .. warning::
An important bit of information about an API that a user should be very aware
of when using whatever bit of API the warning pertains to. The content of
the directive should be written in complete sentences and include all
- appropriate punctuation. This differs from ``note`` in that it is recommended
- over ``note`` for information regarding security.
+ appropriate punctuation. This differs from :rst:dir:`note` in that it is
+ recommended over :rst:dir:`note` for information regarding security.
-.. directive:: .. versionadded:: version
+.. rst:directive:: .. versionadded:: version
This directive documents the version of the project which added the described
feature to the library or C API. When this applies to an entire module, it
@@ -47,41 +47,42 @@ units as well as normal text:
Note that there must be no blank line between the directive head and the
explanation; this is to make these blocks visually continuous in the markup.
-.. directive:: .. versionchanged:: version
+.. rst:directive:: .. versionchanged:: version
- Similar to ``versionadded``, but describes when and what changed in the named
+ Similar to :rst:dir:`versionadded`, but describes when and what changed in the named
feature in some way (new parameters, changed side effects, etc.).
--------------
-.. directive:: seealso
+.. rst:directive:: seealso
Many sections include a list of references to module documentation or
- external documents. These lists are created using the ``seealso`` directive.
+ external documents. These lists are created using the :rst:dir:`seealso`
+ directive.
- The ``seealso`` directive is typically placed in a section just before any
+ The :rst:dir:`seealso` directive is typically placed in a section just before any
sub-sections. For the HTML output, it is shown boxed off from the main flow
of the text.
- The content of the ``seealso`` directive should be a reST definition list.
+ The content of the :rst:dir:`seealso` directive should be a reST definition list.
Example::
.. seealso::
- Module :mod:`zipfile`
- Documentation of the :mod:`zipfile` standard module.
+ Module :py:mod:`zipfile`
+ Documentation of the :py:mod:`zipfile` standard module.
`GNU tar manual, Basic Tar Format <http://link>`_
Documentation for tar archive files, including GNU tar extensions.
There's also a "short form" allowed that looks like this::
- .. seealso:: modules :mod:`zipfile`, :mod:`tarfile`
+ .. seealso:: modules :py:mod:`zipfile`, :py:mod:`tarfile`
.. versionadded:: 0.5
The short form.
-.. directive:: .. rubric:: title
+.. rst:directive:: .. rubric:: title
This directive creates a paragraph heading that is not used to create a
table of contents node.
@@ -94,14 +95,15 @@ units as well as normal text:
empty heading.
-.. directive:: centered
+.. rst:directive:: centered
- This directive creates a centered boldfaced line of text. Use it as follows::
+ This directive creates a centered boldfaced line of text. Use it as
+ follows::
.. centered:: LICENSE AGREEMENT
-.. directive:: hlist
+.. rst:directive:: hlist
This directive must contain a bullet list. It will transform it into a more
compact list by either distributing more than one item horizontally, or
@@ -125,23 +127,24 @@ units as well as normal text:
Table-of-contents markup
------------------------
-The :dir:`toctree` directive, which generates tables of contents of
-subdocuments, is described in "Sphinx concepts".
+The :rst:dir:`toctree` directive, which generates tables of contents of
+subdocuments, is described in :ref:`toctree-directive`.
-For local tables of contents, use the standard reST :dir:`contents` directive.
+For local tables of contents, use the standard reST :dudir:`contents directive
+<contents>`.
Index-generating markup
-----------------------
-Sphinx automatically creates index entries from all information units (like
-functions, classes or attributes) like discussed before.
+Sphinx automatically creates index entries from all object descriptions (like
+functions, classes or attributes) like discussed in :ref:`domains`.
However, there is also an explicit directive available, to make the index more
comprehensive and enable index entries in documents where information is not
mainly contained in information units, such as the language reference.
-.. directive:: .. index:: <entries>
+.. rst:directive:: .. index:: <entries>
This directive contains one or more index entries. Each entry consists of a
type and a value, separated by a colon.
@@ -159,9 +162,9 @@ mainly contained in information units, such as the language reference.
...
- This directive contains five entries, which will be converted to entries in the
- generated index which link to the exact location of the index statement (or, in
- case of offline media, the corresponding page number).
+ This directive contains five entries, which will be converted to entries in
+ the generated index which link to the exact location of the index statement
+ (or, in case of offline media, the corresponding page number).
Since index directives generate cross-reference targets at their location in
the source, it makes sense to put them *before* the thing they refer to --
@@ -171,18 +174,19 @@ mainly contained in information units, such as the language reference.
single
Creates a single index entry. Can be made a subentry by separating the
- subentry text with a semicolon (this notation is also used below to describe
- what entries are created).
+ subentry text with a semicolon (this notation is also used below to
+ describe what entries are created).
pair
``pair: loop; statement`` is a shortcut that creates two index entries,
namely ``loop; statement`` and ``statement; loop``.
triple
- Likewise, ``triple: module; search; path`` is a shortcut that creates three
- index entries, which are ``module; search path``, ``search; path, module`` and
- ``path; module search``.
+ Likewise, ``triple: module; search; path`` is a shortcut that creates
+ three index entries, which are ``module; search path``, ``search; path,
+ module`` and ``path; module search``.
module, keyword, operator, object, exception, statement, builtin
- These all create two index entries. For example, ``module: hashlib`` creates
- the entries ``module; hashlib`` and ``hashlib; module``.
+ These all create two index entries. For example, ``module: hashlib``
+ creates the entries ``module; hashlib`` and ``hashlib; module``. (These
+ are Python-specific and therefore deprecated.)
For index directives containing only "single" entries, there is a shorthand
notation::
@@ -195,10 +199,10 @@ mainly contained in information units, such as the language reference.
Glossary
--------
-.. directive:: glossary
+.. rst:directive:: .. glossary::
This directive must contain a reST definition list with terms and
- definitions. The definitions will then be referencable with the :role:`term`
+ definitions. The definitions will then be referencable with the :rst:role:`term`
role. Example::
.. glossary::
@@ -227,7 +231,7 @@ derived forms), but provides enough to allow context-free grammars to be
displayed in a way that causes uses of a symbol to be rendered as hyperlinks to
the definition of the symbol. There is this directive:
-.. directive:: productionlist
+.. rst:directive:: .. productionlist:: [name]
This directive is used to enclose a group of productions. Each production is
given on a single line and consists of a name, separated by a colon from the
@@ -235,17 +239,19 @@ the definition of the symbol. There is this directive:
continuation line must begin with a colon placed at the same column as in the
first line.
+ The argument to :rst:dir:`productionlist` serves to distinguish different sets of
+ production lists that belong to different grammars.
+
Blank lines are not allowed within ``productionlist`` directive arguments.
The definition can contain token names which are marked as interpreted text
(e.g. ``sum ::= `integer` "+" `integer```) -- this generates cross-references
- to the productions of these tokens.
+ to the productions of these tokens. Outside of the production list, you can
+ reference to token productions using :rst:role:`token`.
Note that no further reST parsing is done in the production, so that you
don't have to escape ``*`` or ``|`` characters.
-.. XXX describe optional first parameter
-
The following is an example taken from the Python Reference Manual::
.. productionlist::
diff --git a/doc/concepts.rst b/doc/markup/toctree.rst
index d9979d3fc..9b987a2e2 100644
--- a/doc/concepts.rst
+++ b/doc/markup/toctree.rst
@@ -1,27 +1,8 @@
-.. highlight:: rest
-
-.. _concepts:
-
-Sphinx concepts
-===============
-
-Document names
---------------
-
-Since the reST source files can have different extensions (some people like
-``.txt``, some like ``.rst`` -- the extension can be configured with
-:confval:`source_suffix`) and different OSes have different path separators,
-Sphinx abstracts them: all "document names" are relative to the :term:`source
-directory`, the extension is stripped, and path separators are converted to
-slashes. All values, parameters and suchlike referring to "documents" expect
-such a document name.
-
-Examples for document names are ``index``, ``library/zipfile``, or
-``reference/datamodel/types``. Note that there is no leading slash.
-
+.. highlight:: rst
+.. _toctree-directive:
The TOC tree
-------------
+============
.. index:: pair: table of; contents
@@ -30,7 +11,7 @@ documents into multiple output files, Sphinx uses a custom directive to add
relations between the single files the documentation is made of, as well as
tables of contents. The ``toctree`` directive is the central element.
-.. directive:: toctree
+.. rst:directive:: toctree
This directive inserts a "TOC tree" at the current location, using the
individual TOCs (including "sub-TOC trees") of the documents given in the
@@ -59,7 +40,7 @@ tables of contents. The ``toctree`` directive is the central element.
document, the library index. From this information it generates "next
chapter", "previous chapter" and "parent chapter" links.
- Document titles in the :dir:`toctree` will be automatically read from the
+ Document titles in the :rst:dir:`toctree` will be automatically read from the
title of the referenced document. If that isn't what you want, you can
specify an explicit title and target using a similar syntax to reST
hyperlinks (and Sphinx's :ref:`cross-referencing syntax <xref-syntax>`). This
@@ -89,6 +70,15 @@ tables of contents. The ``toctree`` directive is the central element.
Numbering then starts at the heading of ``foo``. Sub-toctrees are
automatically numbered (don't give the ``numbered`` flag to those).
+ If you want only the titles of documents in the tree to show up, not other
+ headings of the same level, you can use the ``titlesonly`` option::
+
+ .. toctree::
+ :titlesonly:
+
+ foo
+ bar
+
You can use "globbing" in toctree directives, by giving the ``glob`` flag
option. All entries are then matched against the list of available
documents, and matches are inserted into the list alphabetically. Example::
@@ -139,6 +129,9 @@ tables of contents. The ``toctree`` directive is the central element.
Added "numbered" and "hidden" options as well as external links and
support for "self" references.
+ .. versionchanged:: 1.0
+ Added "titlesonly" option.
+
Special names
-------------
@@ -150,13 +143,14 @@ The special document names (and pages generated for them) are:
* ``genindex``, ``modindex``, ``search``
- These are used for the general index, the module index, and the search page,
- respectively.
+ These are used for the general index, the Python module index, and the search
+ page, respectively.
The general index is populated with entries from modules, all index-generating
- :ref:`description units <desc-units>`, and from :dir:`index` directives.
+ :ref:`object descriptions <basic-domain-markup>`, and from :rst:dir:`index`
+ directives.
- The module index contains one entry per :dir:`module` directive.
+ The module index contains one entry per :rst:dir:`module` directive.
The search page contains a form that uses the generated JSON search index and
JavaScript to full-text search the generated documents for search words; it
diff --git a/doc/more.png b/doc/more.png
new file mode 100644
index 000000000..3eb7b05c8
--- /dev/null
+++ b/doc/more.png
Binary files differ
diff --git a/doc/rest.rst b/doc/rest.rst
index e70fa105b..3a14ac183 100644
--- a/doc/rest.rst
+++ b/doc/rest.rst
@@ -1,5 +1,7 @@
.. highlightlang:: rest
+.. _rst-primer:
+
reStructuredText Primer
=======================
@@ -10,18 +12,22 @@ language, this will not take too long.
.. seealso::
- The authoritative `reStructuredText User
- Documentation <http://docutils.sourceforge.net/rst.html>`_.
+ The authoritative `reStructuredText User Documentation
+ <http://docutils.sourceforge.net/rst.html>`_. The "ref" links in this
+ document link to the description of the individual constructs in the reST
+ reference.
Paragraphs
----------
-The paragraph is the most basic block in a reST document. Paragraphs are simply
-chunks of text separated by one or more blank lines. As in Python, indentation
-is significant in reST, so all lines of the same paragraph must be left-aligned
-to the same level of indentation.
+The paragraph (:duref:`ref <paragraphs>`) is the most basic block in a reST
+document. Paragraphs are simply chunks of text separated by one or more blank
+lines. As in Python, indentation is significant in reST, so all lines of the
+same paragraph must be left-aligned to the same level of indentation.
+
+.. _inlinemarkup:
Inline markup
-------------
@@ -49,13 +55,25 @@ enclosed text should be interpreted in a specific way. Sphinx uses this to
provide semantic markup and cross-referencing of identifiers, as described in
the appropriate section. The general syntax is ``:rolename:`content```.
+Standard reST provides the following roles:
+
+* :durole:`emphasis` -- alternate spelling for ``*emphasis*``
+* :durole:`strong` -- alternate spelling for ``**strong**``
+* :durole:`literal` -- alternate spelling for ````literal````
+* :durole:`subscript` -- subscript text
+* :durole:`superscript` -- superscript text
+* :durole:`title-reference` -- for titles of books, periodicals, and other
+ materials
+
+See :ref:`inline-markup` for roles added by Sphinx.
+
-Lists and Quotes
-----------------
+Lists and Quote-like blocks
+---------------------------
-List markup is natural: just place an asterisk at the start of a paragraph and
-indent properly. The same goes for numbered lists; they can also be
-autonumbered using a ``#`` sign::
+List markup (:duref:`ref <bullet-lists>`) is natural: just place an asterisk at
+the start of a paragraph and indent properly. The same goes for numbered lists;
+they can also be autonumbered using a ``#`` sign::
* This is a bulleted list.
* It has two items, the second
@@ -79,7 +97,7 @@ parent list items by blank lines::
* and here the parent list continues
-Definition lists are created as follows::
+Definition lists (:duref:`ref <definition-lists>`) are created as follows::
term (up to a line of text)
Definition of the term, which must be indented
@@ -89,17 +107,31 @@ Definition lists are created as follows::
next term
Description.
+Note that the term cannot have more than one line of text.
-Paragraphs are quoted by just indenting them more than the surrounding
-paragraphs.
+Quoted paragraphs (:duref:`ref <block-quotes>`) are created by just indenting
+them more than the surrounding paragraphs.
+
+Line blocks (:duref:`ref <line-blocks>`) are a way of preserving line breaks::
+
+ | These lines are
+ | broken exactly like in
+ | the source file.
+
+There are also several more special blocks available:
+
+* field lists (:duref:`ref <field-lists>`)
+* option lists (:duref:`ref <option-lists>`)
+* quoted literal blocks (:duref:`ref <quoted-literal-blocks>`)
+* doctest blocks (:duref:`ref <doctest-blocks>`)
Source Code
-----------
-Literal code blocks are introduced by ending a paragraph with the special marker
-``::``. The literal block must be indented (and, like all paragraphs, separated
-from the surrounding ones by blank lines)::
+Literal code blocks (:duref:`ref <literal-blocks>`) are introduced by ending a
+paragraph with the special marker ``::``. The literal block must be indented
+(and, like all paragraphs, separated from the surrounding ones by blank lines)::
This is a normal text paragraph. The next paragraph is a code sample::
@@ -122,28 +154,69 @@ That way, the second sentence in the above example's first paragraph would be
rendered as "The next paragraph is a code sample:".
+.. _rst-tables:
+
+Tables
+------
+
+Two forms of tables are supported. For *grid tables* (:duref:`ref
+<grid-tables>`), you have to "paint" the cell grid yourself. They look like
+this::
+
+ +------------------------+------------+----------+----------+
+ | Header row, column 1 | Header 2 | Header 3 | Header 4 |
+ | (header rows optional) | | | |
+ +========================+============+==========+==========+
+ | body row 1, column 1 | column 2 | column 3 | column 4 |
+ +------------------------+------------+----------+----------+
+ | body row 2 | ... | ... | |
+ +------------------------+------------+----------+----------+
+
+*Simple tables* (:duref:`ref <simple-tables>`) are easier to write, but
+limited: they must contain more than one row, and the first column cannot
+contain multiple lines. They look like this::
+
+ ===== ===== =======
+ A B A and B
+ ===== ===== =======
+ False False False
+ True False False
+ False True False
+ True True True
+ ===== ===== =======
+
+
Hyperlinks
----------
External links
^^^^^^^^^^^^^^
-Use ```Link text <http://target>`_`` for inline web links. If the link text
-should be the web address, you don't need special markup at all, the parser
+Use ```Link text <http://example.com/>`_`` for inline web links. If the link
+text should be the web address, you don't need special markup at all, the parser
finds links and mail addresses in ordinary text.
+You can also separate the link and the target definition (:duref:`ref
+<hyperlink-targets>`), like this::
+
+ This is a paragraph that contains `a link`_.
+
+ .. _a link: http://example.com/
+
+
Internal links
^^^^^^^^^^^^^^
-Internal linking is done via a special reST role, see the section on specific
-markup, :ref:`ref-role`.
+Internal linking is done via a special reST role provided by Sphinx, see the
+section on specific markup, :ref:`ref-role`.
Sections
--------
-Section headers are created by underlining (and optionally overlining) the
-section title with a punctuation character, at least as long as the text::
+Section headers (:duref:`ref <sections>`) are created by underlining (and
+optionally overlining) the section title with a punctuation character, at least
+as long as the text::
=================
This is a heading
@@ -168,9 +241,9 @@ target formats (HTML, LaTeX) have a limited supported nesting depth.
Explicit Markup
---------------
-"Explicit markup" is used in reST for most constructs that need special
-handling, such as footnotes, specially-highlighted paragraphs, comments, and
-generic directives.
+"Explicit markup" (:duref:`ref <explicit-markup-blocks>`) is used in reST for
+most constructs that need special handling, such as footnotes,
+specially-highlighted paragraphs, comments, and generic directives.
An explicit markup block begins with a line starting with ``..`` followed by
whitespace and is terminated by the next paragraph at the same level of
@@ -179,11 +252,70 @@ paragraphs. This may all sound a bit complicated, but it is intuitive enough
when you write it.)
+.. _directives:
+
Directives
----------
-A directive is a generic block of explicit markup. Besides roles, it is one of
-the extension mechanisms of reST, and Sphinx makes heavy use of it.
+A directive (:duref:`ref <directives>`) is a generic block of explicit markup.
+Besides roles, it is one of the extension mechanisms of reST, and Sphinx makes
+heavy use of it.
+
+Docutils supports the following directives:
+
+* Admonitions: :dudir:`attention`, :dudir:`caution`, :dudir:`danger`,
+ :dudir:`error`, :dudir:`hint`, :dudir:`important`, :dudir:`note`,
+ :dudir:`tip`, :dudir:`warning` and the generic :dudir:`admonition`.
+ (Most themes style only "note" and "warning" specially.)
+
+* Images:
+
+ - :dudir:`image` (see also Images_ below)
+ - :dudir:`figure` (an image with caption and optional legend)
+
+* Additional body elements:
+
+ - :dudir:`contents` (a local, i.e. for the current file only, table of
+ contents)
+ - :dudir:`container` (a container with a custom class, useful to generate an
+ outer ``<div>`` in HTML)
+ - :dudir:`rubric` (a heading without relation to the document sectioning)
+ - :dudir:`topic`, :dudir:`sidebar` (special highlighted body elements)
+ - :dudir:`parsed-literal` (literal block that supports inline markup)
+ - :dudir:`epigraph` (a block quote with optional attribution line)
+ - :dudir:`highlights`, :dudir:`pull-quote` (block quotes with their own
+ class attribute)
+ - :dudir:`compound` (a compound paragraph)
+
+* Special tables:
+
+ - :dudir:`table` (a table with title)
+ - :dudir:`csv-table` (a table generated from comma-separated values)
+ - :dudir:`list-table` (a table generated from a list of lists)
+
+* Special directives:
+
+ - :dudir:`raw` (include raw target-format markup)
+ - :dudir:`include` (include reStructuredText from another file)
+ - :dudir:`class` (assign a class attribute to the next element) [1]_
+
+* HTML specifics:
+
+ - :dudir:`meta` (generation of HTML ``<meta>`` tags)
+ - :dudir:`title` (override document title)
+
+* Influencing markup:
+
+ - :dudir:`default-role` (set a new default role)
+ - :dudir:`role` (create a new role)
+
+ Since these are only per-file, better use Sphinx' facilities for setting the
+ :confval:`default_role`.
+
+Do *not* use the directives :dudir:`sectnum`, :dudir:`header` and
+:dudir:`footer`.
+
+Directives added by Sphinx are described in :ref:`sphinxmarkup`.
Basically, a directive consists of a name, arguments, options and content. (Keep
this terminology in mind, it is used in the next chapter describing custom
@@ -207,7 +339,7 @@ directive start.
Images
------
-reST supports an image directive, used like so::
+reST supports an image directive (:dudir:`ref <image>`), used like so::
.. image:: gnu.png
(options)
@@ -247,9 +379,9 @@ the former, while the HTML builder would prefer the latter.
Footnotes
---------
-For footnotes, use ``[#name]_`` to mark the footnote location, and add the
-footnote body at the bottom of the document after a "Footnotes" rubric heading,
-like so::
+For footnotes (:duref:`ref <footnotes>`), use ``[#name]_`` to mark the footnote
+location, and add the footnote body at the bottom of the document after a
+"Footnotes" rubric heading, like so::
Lorem ipsum [#f1]_ dolor sit amet ... [#f2]_
@@ -265,9 +397,9 @@ footnotes without names (``[#]_``).
Citations
---------
-Standard reST citations are supported, with the additional feature that they are
-"global", i.e. all citations can be referenced from all files. Use them like
-so::
+Standard reST citations (:duref:`ref <citations>`) are supported, with the
+additional feature that they are "global", i.e. all citations can be referenced
+from all files. Use them like so::
Lorem ipsum [Ref]_ dolor sit amet.
@@ -280,19 +412,23 @@ numeric or begins with ``#``.
Substitutions
-------------
-reST supports "substitutions", which are pieces of text and/or markup referred
-to in the text by ``|name|``. They are defined like footnotes with explicit
-markup blocks, like this::
+reST supports "substitutions" (:duref:`ref <substitution-definitions>`), which
+are pieces of text and/or markup referred to in the text by ``|name|``. They
+are defined like footnotes with explicit markup blocks, like this::
.. |name| replace:: replacement *text*
-See the `reST reference for substitutions
-<http://docutils.sourceforge.net/docs/ref/rst/restructuredtext.html#substitution-definitions>`_
+or this::
+
+ .. |caution| image:: warning.png
+ :alt: Warning!
+
+See the :duref:`reST reference for substitutions <substitution-definitions>`
for details.
If you want to use some substitutions for all documents, put them into a
separate file and include it into all documents you want to use them in, using
-the :dir:`include` directive. Be sure to give the include file a file name
+the :rst:dir:`include` directive. Be sure to give the include file a file name
extension differing from that of other source files, to avoid Sphinx finding it
as a standalone document.
@@ -303,7 +439,8 @@ Comments
--------
Every explicit markup block which isn't a valid markup construct (like the
-footnotes above) is regarded as a comment. For example::
+footnotes above) is regarded as a comment (:duref:`ref <comments>`). For
+example::
.. This is a comment.
@@ -331,10 +468,16 @@ Gotchas
There are some problems one commonly runs into while authoring reST documents:
* **Separation of inline markup:** As said above, inline markup spans must be
- separated from the surrounding text by non-word characters, you have to use
- a backslash-escaped space to get around that.
+ separated from the surrounding text by non-word characters, you have to use a
+ backslash-escaped space to get around that. See `the reference
+ <http://docutils.sf.net/docs/ref/rst/restructuredtext.html#inline-markup>`_
+ for the details.
* **No nested inline markup:** Something like ``*see :func:`foo`*`` is not
possible.
-.. XXX more?
+
+.. rubric:: Footnotes
+
+.. [1] When the default domain contains a :rst:dir:`class` directive, this directive
+ will be shadowed. Therefore, Sphinx re-exports it as :rst:dir:`rst-class`.
diff --git a/doc/sphinx-build.1 b/doc/sphinx-build.1
deleted file mode 100644
index 498771c92..000000000
--- a/doc/sphinx-build.1
+++ /dev/null
@@ -1,102 +0,0 @@
-.TH sphinx-build 1 "Jan 2009" "Sphinx 0.6" "User Commands"
-.SH NAME
-sphinx-build \- Sphinx documentation generator tool
-.SH SYNOPSIS
-.B sphinx-build
-[\fIoptions\fR] <\fIsourcedir\fR> <\fIoutdir\fR> [\fIfilenames\fR...]
-.SH DESCRIPTION
-sphinx-build generates documentation from the files in <sourcedir> and places it
-in the <outdir>.
-
-sphinx-build looks for <sourcedir>/conf.py for the configuration settings.
-.B sphinx-quickstart(1)
-may be used to generate template files, including conf.py.
-
-sphinx-build can create documentation in different formats. A format is
-selected by specifying the builder name on the command line; it defaults to
-HTML. Builders can also perform other tasks related to documentation
-processing.
-
-By default, everything that is outdated is built. Output only for selected
-files can be built by specifying individual filenames.
-
-List of available builders:
-.TP
-\fBhtml\fR
-HTML files generation. This is default builder.
-.TP
-\fBhtmlhelp\fR
-Generates files for CHM generation.
-.TP
-\fBqthelp\fR
-Generates files for Qt help collection generation.
-.TP
-\fBlatex\fR
-Generates a LaTeX version of the documentation.
-.TP
-\fBtext\fR
-Generates a plain-text version of the documentation.
-.TP
-\fBchanges\fR
-Generates HTML files listing changed/added/deprecated items for the
-current version.
-.TP
-\fBlinkcheck\fR
-Checks the integrity of all external links in the documentation.
-.TP
-\fBpickle / json\fR
-Generates serialized HTML files in the selected format.
-
-.SH OPTIONS
-.TP
-\fB-b\fR <builder>
-Builder to use; defaults to html. See the full list of builders above.
-.TP
-\fB-a\fR
-Generates output for all files; without this option only output for
-new and changed files is generated.
-.TP
-\fB-E\fR
-Ignores cached files, forces to re-read all source files from disk.
-.TP
-\fB-c\fR <path>
-Locates the conf.py file in the specified path instead of <sourcedir>.
-.TP
-\fB-C\fR
-Specifies that no conf.py file at all is to be used. Configuration can
-only be set with the -D option.
-.TP
-\fB-D\fR <setting>=<value>
-Overrides a setting from the configuration file.
-.TP
-\fB-d\fR <path>
-Path to cached files; defaults to <outdir>/.doctrees.
-.TP
-\fB-A\fR <name>=<value>
-Passes a value into the HTML templates (only for html builders).
-.TP
-\fB-N\fR
-Prevents colored output.
-.TP
-\fB-q\fR
-Quiet operation, just prints warnings and errors on stderr.
-.TP
-\fB-Q\fR
-Very quiet operation, doesn't print anything except for errors.
-.TP
-\fB-w\fR <file>
-Write warnings and errors into the given file, in addition to stderr.
-.TP
-\fB-W\fR
-Turn warnings into errors.
-.TP
-\fB-P\fR
-Runs Pdb on exception.
-.SH "SEE ALSO"
-.BR sphinx-quickstart(1)
-.SH AUTHOR
-Georg Brandl <georg@python.org>, Armin Ronacher <armin.ronacher@active-4.com> et
-al.
-.PP
-This manual page was initially written by Mikhail Gusarov
-<dottedmag@dottedmag.net>, for the Debian project.
diff --git a/doc/sphinx-quickstart.1 b/doc/sphinx-quickstart.1
deleted file mode 100644
index 93b0a4a51..000000000
--- a/doc/sphinx-quickstart.1
+++ /dev/null
@@ -1,17 +0,0 @@
-.TH sphinx-quickstart 1 "Jan 2009" "Sphinx 0.6" "User Commands"
-.SH NAME
-sphinx-quickstart \- Sphinx documentation template generator
-.SH SYNOPSIS
-.B sphinx-quickstart
-.SH DESCRIPTION
-sphinx-quickstart is an interactive tool that asks some questions about your
-project and then generates a complete documentation directory and sample
-Makefile to be used with \fBsphinx-build(1)\fR.
-.SH "SEE ALSO"
-.BR sphinx-build(1)
-.SH AUTHOR
-Georg Brandl <georg@python.org>, Armin Ronacher <armin.ronacher@active-4.com> et
-al.
-.PP
-This manual page was initially written by Mikhail Gusarov
-<dottedmag@dottedmag.net> for the Debian project.
diff --git a/doc/templating.rst b/doc/templating.rst
index cccc0a77c..5bf09dbde 100644
--- a/doc/templating.rst
+++ b/doc/templating.rst
@@ -139,23 +139,36 @@ The following blocks exist in the ``layout.html`` template:
The logo location within the sidebar. Override this if you want to place
some content at the top of the sidebar.
+`footer`
+ The block for the footer div. If you want a custom footer or markup before
+ or after it, override this one.
+
+The following four blocks are *only* used for pages that do not have assigned a
+list of custom sidebars in the :confval:`html_sidebars` config value. Their use
+is deprecated in favor of separate sidebar templates, which can be included via
+:confval:`html_sidebars`.
+
`sidebartoc`
The table of contents within the sidebar.
+ .. deprecated:: 1.0
+
`sidebarrel`
The relation links (previous, next document) within the sidebar.
+ .. deprecated:: 1.0
+
`sidebarsourcelink`
The "Show source" link within the sidebar (normally only shown if this is
enabled by :confval:`html_show_sourcelink`).
+ .. deprecated:: 1.0
+
`sidebarsearch`
The search box within the sidebar. Override this if you want to place some
content at the bottom of the sidebar.
-`footer`
- The block for the footer div. If you want a custom footer or markup before
- or after it, override this one.
+ .. deprecated:: 1.0
Configuration Variables
@@ -305,9 +318,9 @@ in the future.
.. data:: rellinks
A list of links to put at the left side of the relbar, next to "next" and
- "prev". This usually contains links to the index and the modindex. If you
- add something yourself, it must be a tuple ``(pagename, link title,
- accesskey, link text)``.
+ "prev". This usually contains links to the general index and other indices,
+ such as the Python module index. If you add something yourself, it must be a
+ tuple ``(pagename, link title, accesskey, link text)``.
.. data:: shorttitle
@@ -364,6 +377,10 @@ are in HTML form), these variables are also available:
.. data:: toctree
A callable yielding the global TOC tree containing the current page, rendered
- as HTML bullet lists. If the optional keyword argument ``collapse`` is true
- (the default), all TOC entries that are not ancestors of the current page are
- collapsed.
+ as HTML bullet lists. Optional keyword arguments:
+
+ * ``collapse`` (true by default): if true, all TOC entries that are not
+ ancestors of the current page are collapsed
+
+ * ``maxdepth`` (defaults to the max depth selected in the toctree directive):
+ the maximum depth of the tree; set it to ``-1`` to allow unlimited depth
diff --git a/doc/themes/agogo.png b/doc/themes/agogo.png
new file mode 100644
index 000000000..d29aa45cc
--- /dev/null
+++ b/doc/themes/agogo.png
Binary files differ
diff --git a/doc/themes/default.png b/doc/themes/default.png
new file mode 100644
index 000000000..93d8526c8
--- /dev/null
+++ b/doc/themes/default.png
Binary files differ
diff --git a/doc/themes/fullsize/agogo.png b/doc/themes/fullsize/agogo.png
new file mode 100644
index 000000000..93fadfcbe
--- /dev/null
+++ b/doc/themes/fullsize/agogo.png
Binary files differ
diff --git a/doc/themes/fullsize/default.png b/doc/themes/fullsize/default.png
new file mode 100644
index 000000000..b6af8bc3a
--- /dev/null
+++ b/doc/themes/fullsize/default.png
Binary files differ
diff --git a/doc/themes/fullsize/haiku.png b/doc/themes/fullsize/haiku.png
new file mode 100644
index 000000000..1590da5d4
--- /dev/null
+++ b/doc/themes/fullsize/haiku.png
Binary files differ
diff --git a/doc/themes/fullsize/nature.png b/doc/themes/fullsize/nature.png
new file mode 100644
index 000000000..d42957e3b
--- /dev/null
+++ b/doc/themes/fullsize/nature.png
Binary files differ
diff --git a/doc/themes/fullsize/scrolls.png b/doc/themes/fullsize/scrolls.png
new file mode 100644
index 000000000..7d46f7ed1
--- /dev/null
+++ b/doc/themes/fullsize/scrolls.png
Binary files differ
diff --git a/doc/themes/fullsize/sphinxdoc.png b/doc/themes/fullsize/sphinxdoc.png
new file mode 100644
index 000000000..722fb9004
--- /dev/null
+++ b/doc/themes/fullsize/sphinxdoc.png
Binary files differ
diff --git a/doc/themes/fullsize/traditional.png b/doc/themes/fullsize/traditional.png
new file mode 100644
index 000000000..103fd3ca0
--- /dev/null
+++ b/doc/themes/fullsize/traditional.png
Binary files differ
diff --git a/doc/themes/haiku.png b/doc/themes/haiku.png
new file mode 100644
index 000000000..a8ae85579
--- /dev/null
+++ b/doc/themes/haiku.png
Binary files differ
diff --git a/doc/themes/nature.png b/doc/themes/nature.png
new file mode 100644
index 000000000..3d4f587f7
--- /dev/null
+++ b/doc/themes/nature.png
Binary files differ
diff --git a/doc/themes/scrolls.png b/doc/themes/scrolls.png
new file mode 100644
index 000000000..8073c10e0
--- /dev/null
+++ b/doc/themes/scrolls.png
Binary files differ
diff --git a/doc/themes/sphinxdoc.png b/doc/themes/sphinxdoc.png
new file mode 100644
index 000000000..f4b59ecdb
--- /dev/null
+++ b/doc/themes/sphinxdoc.png
Binary files differ
diff --git a/doc/themes/traditional.png b/doc/themes/traditional.png
new file mode 100644
index 000000000..4ad2b5ce1
--- /dev/null
+++ b/doc/themes/traditional.png
Binary files differ
diff --git a/doc/theming.rst b/doc/theming.rst
index d1d3b27a3..fc8ef236d 100644
--- a/doc/theming.rst
+++ b/doc/theming.rst
@@ -52,17 +52,50 @@ file :file:`blue.zip`, you can put it right in the directory containing
Builtin themes
--------------
-Sphinx comes with a selection of themes to choose from:
+.. cssclass:: right
+
++--------------------+--------------------+
+| **Theme overview** | |
++--------------------+--------------------+
+| |default| | |sphinxdoc| |
+| | |
+| *default* | *sphinxdoc* |
++--------------------+--------------------+
+| |scrolls| | |agogo| |
+| | |
+| *scrolls* | *agogo* |
++--------------------+--------------------+
+| |traditional| | |nature| |
+| | |
+| *traditional* | *nature* |
++--------------------+--------------------+
+| |haiku| | |
+| | |
+| *haiku* | |
++--------------------+--------------------+
+
+.. |default| image:: themes/default.png
+.. |sphinxdoc| image:: themes/sphinxdoc.png
+.. |scrolls| image:: themes/scrolls.png
+.. |agogo| image:: themes/agogo.png
+.. |traditional| image:: themes/traditional.png
+.. |nature| image:: themes/nature.png
+.. |haiku| image:: themes/haiku.png
+
+Sphinx comes with a selection of themes to choose from.
+
+These themes are:
* **basic** -- This is a basically unstyled layout used as the base for the
- *default* and *sphinxdoc* themes, and usable as the base for custom themes as
- well. The HTML contains all important elements like sidebar and relation bar.
- There is one option (which is inherited by *default* and *sphinxdoc*):
+ other themes, and usable as the base for custom themes as well. The HTML
+ contains all important elements like sidebar and relation bar. There is one
+ option (which is inherited by the other themes):
- **nosidebar** (true or false): Don't include the sidebar. Defaults to
false.
-* **default** -- This is the default theme. It can be customized via these
+* **default** -- This is the default theme, which looks like `the Python
+ documentation <http://docs.python.org/>`_. It can be customized via these
options:
- **rightsidebar** (true or false): Put the sidebar on the right side.
@@ -72,6 +105,14 @@ Sphinx comes with a selection of themes to choose from:
doesn't scroll out of view for long body content. This may not work well
with all browsers. Defaults to false.
+ - **collapsiblesidebar** (true or false): Add an *experimental* JavaScript
+ snippet that makes the sidebar collapsible via a button on its side.
+ *Doesn't work together with "rightsidebar" or "stickysidebar".* Defaults to
+ false.
+
+ - **externalrefs** (true or false): Display external links differently from
+ internal links. Defaults to false.
+
There are also various color and font options that can change the color scheme
without having to write a custom stylesheet:
@@ -86,6 +127,7 @@ Sphinx comes with a selection of themes to choose from:
- **bgcolor** (CSS color): Body background color.
- **textcolor** (CSS color): Body text color.
- **linkcolor** (CSS color): Body link color.
+ - **visitedlinkcolor** (CSS color): Body color for visited links.
- **headbgcolor** (CSS color): Background color for headings.
- **headtextcolor** (CSS color): Text color for headings.
- **headlinkcolor** (CSS color): Link color for headings.
@@ -99,9 +141,59 @@ Sphinx comes with a selection of themes to choose from:
* **sphinxdoc** -- The theme used for this documentation. It features a sidebar
on the right side. There are currently no options beyond *nosidebar*.
+* **scrolls** -- A more lightweight theme, based on `the Jinja documentation
+ <http://jinja.pocoo.org/2/documentation/>`_. The following color options are
+ available:
+
+ - **headerbordercolor**
+ - **subheadlinecolor**
+ - **linkcolor**
+ - **visitedlinkcolor**
+ - **admonitioncolor**
+
+* **agogo** -- A theme created by Andi Albrecht. The following options are
+ supported:
+
+ - **bodyfont** (CSS font family): Font for normal text.
+ - **headerfont** (CSS font family): Font for headings.
+ - **pagewidth** (CSS length): Width of the page content, default 70em.
+ - **documentwidth** (CSS length): Width of the document (without sidebar),
+ default 50em.
+ - **sidebarwidth** (CSS length): Width of the sidebar, default 20em.
+ - **bgcolor** (CSS color): Background color.
+ - **headerbg** (CSS value for "background"): background for the header area,
+ default a grayish gradient.
+ - **footerbg** (CSS value for "background"): background for the footer area,
+ default a light gray gradient.
+ - **linkcolor** (CSS color): Body link color.
+ - **headercolor1**, **headercolor2** (CSS color): colors for <h1> and <h2>
+ headings.
+ - **headerlinkcolor** (CSS color): Color for the backreference link in
+ headings.
+ - **textalign** (CSS *text-align* value): Text alignment for the body, default
+ is ``justify``.
+
+* **nature** -- A greenish theme. There are currently no options beyond
+ *nosidebar*.
+
+* **haiku** -- A theme without sidebar inspired by the `Haiku OS user guide
+ <http://www.haiku-os.org/docs/userguide/en/contents.html>`_. The following
+ options are supported:
+
+ - **full_logo** (true or false, default false): If this is true, the header
+ will only show the :confval:`html_logo`. Use this for large logos. If this
+ is false, the logo (if present) will be shown floating right, and the
+ documentation title will be put in the header.
+ - **textcolor**, **headingcolor**, **linkcolor**, **visitedlinkcolor**,
+ **hoverlinkcolor** (CSS colors): Colors for various body elements.
+
* **traditional** -- A theme resembling the old Python documentation. There are
currently no options beyond *nosidebar*.
+* **epub** -- A theme for the epub builder. There are currently no options.
+ This theme tries to save visual space which is a sparse resource on ebook
+ readers.
+
Creating themes
---------------
diff --git a/doc/tutorial.rst b/doc/tutorial.rst
new file mode 100644
index 000000000..fa6ee2ab6
--- /dev/null
+++ b/doc/tutorial.rst
@@ -0,0 +1,262 @@
+.. highlight:: rst
+
+First Steps with Sphinx
+=======================
+
+This document is meant to give a tutorial-like overview of all common tasks
+while using Sphinx.
+
+The green arrows designate "more info" links leading to advanced sections about
+the described task.
+
+
+Setting up the documentation sources
+------------------------------------
+
+The root directory of a documentation collection is called the :term:`source
+directory`. This directory also contains the Sphinx configuration file
+:file:`conf.py`, where you can configure all aspects of how Sphinx reads your
+sources and builds your documentation. [#]_
+
+Sphinx comes with a script called :program:`sphinx-quickstart` that sets up a
+source directory and creates a default :file:`conf.py` with the most useful
+configuration values from a few questions it asks you. Just run ::
+
+ $ sphinx-quickstart
+
+and answer its questions. (Be sure to say yes to the "autodoc" extension.)
+
+
+Defining document structure
+---------------------------
+
+Let's assume you've run :program:`sphinx-quickstart`. It created a source
+directory with :file:`conf.py` and a master document, :file:`index.rst` (if you
+accepted the defaults). The main function of the :term:`master document` is to
+serve as a welcome page, and to contain the root of the "table of contents tree"
+(or *toctree*). This is one of the main things that Sphinx adds to
+reStructuredText, a way to connect multiple files to a single hierarchy of
+documents.
+
+.. sidebar:: reStructuredText directives
+
+ ``toctree`` is a reStructuredText :dfn:`directive`, a very versatile piece of
+ markup. Directives can have arguments, options and content.
+
+ *Arguments* are given directly after the double colon following the
+ directive's name. Each directive decides whether it can have arguments, and
+ how many.
+
+ *Options* are given after the arguments, in form of a "field list". The
+ ``maxdepth`` is such an option for the ``toctree`` directive.
+
+ *Content* follows the options or arguments after a blank line. Each
+ directive decides whether to allow content, and what to do with it.
+
+ A common gotcha with directives is that **the first line of the content must
+ be indented to the same level as the options are**.
+
+
+The toctree directive initially is empty, and looks like this::
+
+ .. toctree::
+ :maxdepth: 2
+
+You add documents listing them in the *content* of the directive::
+
+ .. toctree::
+ :maxdepth: 2
+
+ intro
+ tutorial
+ ...
+
+This is exactly how the toctree for this documentation looks. The documents to
+include are given as :term:`document name`\ s, which in short means that you
+leave off the file name extension and use slashes as directory separators.
+
+|more| Read more about :ref:`the toctree directive <toctree-directive>`.
+
+You can now create the files you listed in the toctree and add content, and
+their section titles will be inserted (up to the "maxdepth" level) at the place
+where the toctree directive is placed. Also, Sphinx now knows about the order
+and hierarchy of your documents. (They may contain ``toctree`` directives
+themselves, which means you can create deeply nested hierarchies if necessary.)
+
+
+Adding content
+--------------
+
+In Sphinx source files, you can use most features of standard reStructuredText.
+There are also several features added by Sphinx. For example, you can add
+cross-file references in a portable way (which works for all output types) using
+the :rst:role:`ref` role.
+
+For an example, if you are viewing the HTML version you can look at the source
+for this document -- use the "Show Source" link in the sidebar.
+
+|more| See :ref:`rst-primer` for a more in-depth introduction to
+reStructuredText and :ref:`sphinxmarkup` for a full list of markup added by
+Sphinx.
+
+
+Running the build
+-----------------
+
+Now that you have added some files and content, let's make a first build of the
+docs. A build is started with the :program:`sphinx-build` program, called like
+this::
+
+ $ sphinx-build -b html sourcedir builddir
+
+where *sourcedir* is the :term:`source directory`, and *builddir* is the
+directory in which you want to place the built documentation. The :option:`-b`
+option selects a builder; in this example Sphinx will build HTML files.
+
+|more| See :ref:`invocation` for all options that :program:`sphinx-build`
+supports.
+
+However, :program:`sphinx-quickstart` script creates a :file:`Makefile` and a
+:file:`make.bat` which make life even easier for you: with them you only need
+to run ::
+
+ $ make html
+
+to build HTML docs in the build directory you chose. Execute ``make`` without
+an argument to see which targets are available.
+
+
+Documenting objects
+-------------------
+
+One of Sphinx' main objectives is easy documentation of :dfn:`objects` (in a
+very general sense) in any :dfn:`domain`. A domain is a collection of object
+types that belong together, complete with markup to create and reference
+descriptions of these objects.
+
+The most prominent domain is the Python domain. To e.g. document the Python
+built-in function ``enumerate()``, you would add this to one of your source
+files::
+
+ .. py:function:: enumerate(sequence[, start=0])
+
+ Return an iterator that yields tuples of an index and an item of the
+ *sequence*. (And so on.)
+
+This is rendered like this:
+
+.. py:function:: enumerate(sequence[, start=0])
+
+ Return an iterator that yields tuples of an index and an item of the
+ *sequence*. (And so on.)
+
+The argument of the directive is the :dfn:`signature` of the object you
+describe, the content is the documentation for it. Multiple signatures can be
+given, each in its own line.
+
+The Python domain also happens to be the default domain, so you don't need to
+prefix the markup with the domain name::
+
+ .. function:: enumerate(sequence[, start=0])
+
+ ...
+
+does the same job if you keep the default setting for the default domain.
+
+There are several more directives for documenting other types of Python objects,
+for example :rst:dir:`py:class` or :rst:dir:`py:method`. There is also a
+cross-referencing :dfn:`role` for each of these object types. This markup will
+create a link to the documentation of ``enumerate()``::
+
+ The :py:func:`enumerate` function can be used for ...
+
+And here is the proof: A link to :func:`enumerate`.
+
+Again, the ``py:`` can be left out if the Python domain is the default one. It
+doesn't matter which file contains the actual documentation for ``enumerate()``;
+Sphinx will find it and create a link to it.
+
+Each domain will have special rules for how the signatures can look like, and
+make the formatted output look pretty, or add specific features like links to
+parameter types, e.g. in the C/C++ domains.
+
+|more| See :ref:`domains` for all the available domains and their
+directives/roles.
+
+
+Basic configuration
+-------------------
+
+Earlier we mentioned that the :file:`conf.py` file controls how Sphinx processes
+your documents. In that file, which is executed as a Python source file, you
+assign configuration values. For advanced users: since it is executed by
+Sphinx, you can do non-trivial tasks in it, like extending :data:`sys.path` or
+importing a module to find out the version your are documenting.
+
+The config values that you probably want to change are already put into the
+:file:`conf.py` by :program:`sphinx-quickstart` and initially commented out
+(with standard Python syntax: a ``#`` comments the rest of the line). To change
+the default value, remove the hash sign and modify the value. To customize a
+config value that is not automatically added by :program:`sphinx-quickstart`,
+just add an additional assignment.
+
+Keep in mind that the file uses Python syntax for strings, numbers, lists and so
+on. The file is saved in UTF-8 by default, as indicated by the encoding
+declaration in the first line. If you use non-ASCII characters in any string
+value, you need to use Python Unicode strings (like ``project = u'Exposé'``).
+
+|more| See :ref:`build-config` for documentation of all available config values.
+
+
+Autodoc
+-------
+
+When documenting Python code, it is common to put a lot of documentation in the
+source files, in documentation strings. Sphinx supports the inclusion of
+docstrings from your modules with an :dfn:`extension` (an extension is a Python
+module that provides additional features for Sphinx projects) called "autodoc".
+
+In order to use autodoc, you need to activate it in :file:`conf.py` by putting
+the string ``'sphinx.ext.autodoc'`` into the list assigned to the
+:confval:`extensions` config value. Then, you have a few additional directives
+at your disposal.
+
+For example, to document the function ``io.open()``, reading its
+signature and docstring from the source file, you'd write this::
+
+ .. autofunction:: io.open
+
+You can also document whole classes or even modules automatically, using member
+options for the auto directives, like ::
+
+ .. automodule:: io
+ :members:
+
+autodoc needs to import your modules in order to extract the docstrings.
+Therefore, you must add the appropriate path to :py:data:`sys.path` in your
+:file:`conf.py`.
+
+|more| See :mod:`sphinx.ext.autodoc` for the complete description of the
+features of autodoc.
+
+
+More topics to be covered
+-------------------------
+
+- Other extensions (math, intersphinx, viewcode, doctest)
+- Static files
+- Selecting a theme
+- Templating
+- Using extensions
+- Writing extensions
+
+
+.. rubric:: Footnotes
+
+.. [#] This is the usual lay-out. However, :file:`conf.py` can also live in
+ another directory, the :term:`configuration directory`. See
+ :ref:`invocation`.
+
+.. |more| image:: more.png
+ :align: middle
+ :alt: more info
diff --git a/setup.cfg b/setup.cfg
index 23986bcff..525e24ea3 100644
--- a/setup.cfg
+++ b/setup.cfg
@@ -8,6 +8,7 @@ release = egg_info -RDb ''
[extract_messages]
mapping_file = babel.cfg
output_file = sphinx/locale/sphinx.pot
+keywords = _ l_ lazy_gettext
[update_catalog]
input_file = sphinx/locale/sphinx.pot
diff --git a/setup.py b/setup.py
index f16aa4173..eccb06380 100644
--- a/setup.py
+++ b/setup.py
@@ -14,35 +14,37 @@ import sphinx
long_desc = '''
Sphinx is a tool that makes it easy to create intelligent and beautiful
-documentation for Python projects (or other documents consisting of
-multiple reStructuredText sources), written by Georg Brandl.
-It was originally created to translate the new Python documentation,
-but has now been cleaned up in the hope that it will be useful to many
-other projects.
+documentation for Python projects (or other documents consisting of multiple
+reStructuredText sources), written by Georg Brandl. It was originally created
+for the new Python documentation, and has excellent facilities for Python
+project documentation, but C/C++ is supported as well, and more languages are
+planned.
Sphinx uses reStructuredText as its markup language, and many of its strengths
-come from the power and straightforwardness of reStructuredText and its
-parsing and translating suite, the Docutils.
+come from the power and straightforwardness of reStructuredText and its parsing
+and translating suite, the Docutils.
-Although it is still under constant development, the following features
-are already present, work fine and can be seen "in action" in the Python docs:
+Among its features are the following:
-* Output formats: HTML (including Windows HTML Help), plain text and LaTeX,
- for printable PDF versions
+* Output formats: HTML (including derivative formats such as HTML Help, Epub
+ and Qt Help), plain text, manual pages and LaTeX or direct PDF output
+ using rst2pdf
* Extensive cross-references: semantic markup and automatic links
for functions, classes, glossary terms and similar pieces of information
* Hierarchical structure: easy definition of a document tree, with automatic
links to siblings, parents and children
* Automatic indices: general index as well as a module index
* Code handling: automatic highlighting using the Pygments highlighter
+* Flexible HTML output using the Jinja 2 templating engine
* Various extensions are available, e.g. for automatic testing of snippets
- and inclusion of appropriately formatted docstrings.
+ and inclusion of appropriately formatted docstrings
+* Setuptools integration
A development egg can be found `here
<http://bitbucket.org/birkenfeld/sphinx/get/tip.gz#egg=Sphinx-dev>`_.
'''
-requires = ['Pygments>=0.8', 'Jinja2>=2.1', 'docutils>=0.4']
+requires = ['Pygments>=0.8', 'Jinja2>=2.2', 'docutils>=0.4']
if sys.version_info < (2, 4):
print 'ERROR: Sphinx requires at least Python 2.4 to run.'
@@ -168,14 +170,16 @@ setup(
long_description=long_desc,
zip_safe=False,
classifiers=[
- 'Development Status :: 4 - Beta',
+ 'Development Status :: 5 - Production/Stable',
'Environment :: Console',
'Environment :: Web Environment',
'Intended Audience :: Developers',
+ 'Intended Audience :: Education',
'License :: OSI Approved :: BSD License',
'Operating System :: OS Independent',
'Programming Language :: Python',
'Topic :: Documentation',
+ 'Topic :: Text Processing',
'Topic :: Utilities',
],
platforms='any',
diff --git a/sphinx/__init__.py b/sphinx/__init__.py
index c5c5a4bfd..6fd96bdc1 100644
--- a/sphinx/__init__.py
+++ b/sphinx/__init__.py
@@ -12,8 +12,8 @@
import sys
from os import path
-__version__ = '0.6.6+'
-__released__ = '0.6.6' # used when Sphinx builds its own docs
+__version__ = '1.0pre'
+__released__ = '1.0 (hg)' # used when Sphinx builds its own docs
package_dir = path.abspath(path.dirname(__file__))
diff --git a/sphinx/addnodes.py b/sphinx/addnodes.py
index 83ba8a004..0a2f0f7f8 100644
--- a/sphinx/addnodes.py
+++ b/sphinx/addnodes.py
@@ -14,7 +14,7 @@ from docutils import nodes
# index markup
class index(nodes.Invisible, nodes.Inline, nodes.TextElement): pass
-# description units (classdesc, funcdesc etc.)
+# domain-specific object descriptions (class, function etc.)
# parent node for signature and content
class desc(nodes.Admonition, nodes.Element): pass
@@ -90,9 +90,6 @@ class abbreviation(nodes.Inline, nodes.TextElement): pass
# glossary
class glossary(nodes.Element): pass
-# module declaration
-class module(nodes.Element): pass
-
# start of a file, used in the LaTeX builder only
class start_of_file(nodes.Element): pass
diff --git a/sphinx/application.py b/sphinx/application.py
index 3817009f7..b5ba514c3 100644
--- a/sphinx/application.py
+++ b/sphinx/application.py
@@ -14,21 +14,26 @@
import sys
import types
import posixpath
+from os import path
from cStringIO import StringIO
from docutils import nodes
-from docutils.parsers.rst import directives, roles
+from docutils.parsers.rst import Directive, convert_directive_function, \
+ directives, roles
import sphinx
-from sphinx.roles import xfileref_role, innernodetypes
+from sphinx import package_dir, locale
+from sphinx.roles import XRefRole
from sphinx.config import Config
-from sphinx.errors import SphinxError, SphinxWarning, ExtensionError
+from sphinx.errors import SphinxError, SphinxWarning, ExtensionError, \
+ VersionRequirementError
+from sphinx.domains import ObjType, BUILTIN_DOMAINS
+from sphinx.domains.std import GenericObject, Target, StandardDomain
from sphinx.builders import BUILTIN_BUILDERS
-from sphinx.directives import GenericDesc, Target, additional_xref_types
-from sphinx.environment import SphinxStandaloneReader
+from sphinx.environment import BuildEnvironment, SphinxStandaloneReader
from sphinx.util import pycompat # imported for side-effects
from sphinx.util.tags import Tags
-from sphinx.util.compat import Directive, directive_dwim
+from sphinx.util.osutil import ENOENT
from sphinx.util.console import bold
@@ -44,23 +49,27 @@ events = {
'missing-reference': 'env, node, contnode',
'doctree-resolved': 'doctree, docname',
'env-updated': 'env',
+ 'html-collect-pages': 'builder',
'html-page-context': 'pagename, context, doctree or None',
'build-finished': 'exception',
}
CONFIG_FILENAME = 'conf.py'
+ENV_PICKLE_FILENAME = 'environment.pickle'
class Sphinx(object):
def __init__(self, srcdir, confdir, outdir, doctreedir, buildername,
- confoverrides, status, warning=sys.stderr, freshenv=False,
- warningiserror=False, tags=None):
+ confoverrides=None, status=sys.stdout, warning=sys.stderr,
+ freshenv=False, warningiserror=False, tags=None):
self.next_listener_id = 0
self._extensions = {}
self._listeners = {}
+ self.domains = BUILTIN_DOMAINS.copy()
self.builderclasses = BUILTIN_BUILDERS.copy()
self.builder = None
+ self.env = None
self.srcdir = srcdir
self.confdir = confdir
@@ -91,7 +100,8 @@ class Sphinx(object):
# read config
self.tags = Tags(tags)
- self.config = Config(confdir, CONFIG_FILENAME, confoverrides, self.tags)
+ self.config = Config(confdir, CONFIG_FILENAME,
+ confoverrides or {}, self.tags)
self.config.check_unicode(self.warn)
# set confdir to srcdir if -C given (!= no confdir); a few pieces
@@ -109,8 +119,69 @@ 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)
+
+ # set up translation infrastructure
+ self._init_i18n()
+ # set up the build environment
+ self._init_env(freshenv)
+ # set up the builder
+ self._init_builder(buildername)
+
+ def _init_i18n(self):
+ """
+ Load translated strings from the configured localedirs if
+ enabled in the configuration.
+ """
+ if self.config.language is not None:
+ self.info(bold('loading translations [%s]... ' %
+ self.config.language), nonl=True)
+ locale_dirs = [None, path.join(package_dir, 'locale')] + \
+ [path.join(self.srcdir, x) for x in self.config.locale_dirs]
+ else:
+ locale_dirs = []
+ self.translator, has_translation = locale.init(locale_dirs,
+ self.config.language)
+ if self.config.language is not None:
+ if has_translation:
+ self.info('done')
+ else:
+ self.info('locale not available')
+
+ def _init_env(self, freshenv):
+ if freshenv:
+ self.env = BuildEnvironment(self.srcdir, self.doctreedir,
+ self.config)
+ self.env.find_files(self.config)
+ for domain in self.domains.keys():
+ self.env.domains[domain] = self.domains[domain](self.env)
+ else:
+ try:
+ self.info(bold('loading pickled environment... '), nonl=True)
+ self.env = BuildEnvironment.frompickle(self.config,
+ path.join(self.doctreedir, ENV_PICKLE_FILENAME))
+ self.env.domains = {}
+ for domain in self.domains.keys():
+ # this can raise if the data version doesn't fit
+ self.env.domains[domain] = self.domains[domain](self.env)
+ self.info('done')
+ except Exception, err:
+ if type(err) is IOError and err.errno == ENOENT:
+ self.info('not yet created')
+ else:
+ self.info('failed: %s' % err)
+ return self._init_env(freshenv=True)
+
+ self.env.set_warnfunc(self.warn)
+
+ def _init_builder(self, buildername):
if buildername is None:
- print >>status, 'No builder selected, using default: html'
+ print >>self._status, 'No builder selected, using default: html'
buildername = 'html'
if buildername not in self.builderclasses:
raise SphinxError('Builder name %s not registered' % buildername)
@@ -121,14 +192,12 @@ class Sphinx(object):
mod, cls = builderclass
builderclass = getattr(
__import__('sphinx.builders.' + mod, None, None, [cls]), cls)
- self.builder = builderclass(self, freshenv=freshenv)
- self.builder.tags = self.tags
- self.builder.tags.add(self.builder.format)
+ self.builder = builderclass(self)
self.emit('builder-inited')
- def build(self, all_files, filenames):
+ def build(self, force_all=False, filenames=None):
try:
- if all_files:
+ if force_all:
self.builder.build_all()
elif filenames:
self.builder.build_specific(filenames)
@@ -178,9 +247,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:
@@ -222,11 +303,11 @@ class Sphinx(object):
event.pop(listener_id, None)
def emit(self, event, *args):
- result = []
+ results = []
if event in self._listeners:
for _, callback in self._listeners[event].iteritems():
- result.append(callback(self, *args))
- return result
+ results.append(callback(self, *args))
+ return results
def emit_firstresult(self, event, *args):
for result in self.emit(event, *args):
@@ -276,6 +357,9 @@ class Sphinx(object):
from sphinx.writers.latex import LaTeXTranslator as translator
elif key == 'text':
from sphinx.writers.text import TextTranslator as translator
+ elif key == 'man':
+ from sphinx.writers.manpage import ManualPageTranslator \
+ as translator
else:
# ignore invalid keys for compatibility
continue
@@ -283,17 +367,21 @@ class Sphinx(object):
if depart:
setattr(translator, 'depart_'+node.__name__, depart)
- def add_directive(self, name, obj, content=None, arguments=None, **options):
+ def _directive_helper(self, obj, content=None, arguments=None, **options):
if isinstance(obj, clstypes) and issubclass(obj, Directive):
if content or arguments or options:
raise ExtensionError('when adding directive classes, no '
'additional arguments may be given')
- directives.register_directive(name, directive_dwim(obj))
+ return obj
else:
obj.content = content
- obj.arguments = arguments
+ obj.arguments = arguments or (0, 0, False)
obj.options = options
- directives.register_directive(name, obj)
+ return convert_directive_function(obj)
+
+ def add_directive(self, name, obj, content=None, arguments=None, **options):
+ directives.register_directive(
+ name, self._directive_helper(obj, content, arguments, **options))
def add_role(self, name, role):
roles.register_local_role(name, role)
@@ -304,23 +392,62 @@ class Sphinx(object):
role = roles.GenericRole(name, nodeclass)
roles.register_local_role(name, role)
- def add_description_unit(self, directivename, rolename, indextemplate='',
- parse_node=None, ref_nodeclass=None):
- additional_xref_types[directivename] = (rolename, indextemplate,
- parse_node)
- directives.register_directive(directivename,
- directive_dwim(GenericDesc))
- roles.register_local_role(rolename, xfileref_role)
- if ref_nodeclass is not None:
- innernodetypes[rolename] = ref_nodeclass
+ def add_domain(self, domain):
+ if domain.name in self.domains:
+ raise ExtensionError('domain %s already registered' % domain.name)
+ self.domains[domain.name] = domain
+
+ def override_domain(self, domain):
+ if domain.name not in self.domains:
+ raise ExtensionError('domain %s not yet registered' % domain.name)
+ if not issubclass(domain, self.domains[domain.name]):
+ raise ExtensionError('new domain not a subclass of registered '
+ 'domain' % domain.name)
+ self.domains[domain.name] = domain
+
+ def add_directive_to_domain(self, domain, name, obj,
+ content=None, arguments=None, **options):
+ if domain not in self.domains:
+ raise ExtensionError('domain %s not yet registered' % domain)
+ self.domains[domain].directives[name] = \
+ self._directive_helper(obj, content, arguments, **options)
+
+ def add_role_to_domain(self, domain, name, role):
+ if domain not in self.domains:
+ raise ExtensionError('domain %s not yet registered' % domain)
+ self.domains[domain].roles[name] = role
+
+ def add_index_to_domain(self, domain, name, localname, shortname, func):
+ if domain not in self.domains:
+ raise ExtensionError('domain %s not yet registered' % domain)
+ self.domains[domain].indices.append((name, localname, shortname))
+ setattr(self.domains[domain], 'get_%s_index' % name, func)
+
+ def add_object_type(self, directivename, rolename, indextemplate='',
+ parse_node=None, ref_nodeclass=None, objname=''):
+ StandardDomain.object_types[directivename] = \
+ ObjType(objname or directivename, rolename)
+ # create a subclass of GenericObject as the new directive
+ new_directive = type(directivename, (GenericObject, object),
+ {'indextemplate': indextemplate,
+ 'parse_node': staticmethod(parse_node)})
+ StandardDomain.directives[directivename] = new_directive
+ # XXX support more options?
+ StandardDomain.roles[rolename] = XRefRole(innernodeclass=ref_nodeclass)
+
+ # backwards compatible alias
+ add_description_unit = add_object_type
def add_crossref_type(self, directivename, rolename, indextemplate='',
- ref_nodeclass=None):
- additional_xref_types[directivename] = (rolename, indextemplate, None)
- directives.register_directive(directivename, directive_dwim(Target))
- roles.register_local_role(rolename, xfileref_role)
- if ref_nodeclass is not None:
- innernodetypes[rolename] = ref_nodeclass
+ ref_nodeclass=None, objname=''):
+ StandardDomain.object_types[directivename] = \
+ ObjType(objname or directivename, rolename)
+ # create a subclass of Target as the new directive
+ new_directive = type(directivename, (Target, object),
+ {'indextemplate': indextemplate})
+ StandardDomain.directives[directivename] = new_directive
+ # XXX support more options?
+ StandardDomain.roles[rolename] = XRefRole(innernodeclass=ref_nodeclass)
def add_transform(self, transform):
SphinxStandaloneReader.transforms.append(transform)
@@ -330,6 +457,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 2625ec8af..000000000
--- 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 5d75a8865..e345d570f 100644
--- a/sphinx/builders/__init__.py
+++ b/sphinx/builders/__init__.py
@@ -10,14 +10,11 @@
"""
import os
-import gettext
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, relative_uri
from sphinx.util.console import bold, purple, darkgreen, term_width_line
# side effect: registers roles and directives
@@ -25,9 +22,6 @@ from sphinx import roles
from sphinx import directives
-ENV_PICKLE_FILENAME = 'environment.pickle'
-
-
class Builder(object):
"""
Builds target formats from the reST sources.
@@ -38,7 +32,8 @@ class Builder(object):
# builder's output format, or '' if no document output is produced
format = ''
- def __init__(self, app, env=None, freshenv=False):
+ def __init__(self, app):
+ self.env = app.env
self.srcdir = app.srcdir
self.confdir = app.confdir
self.outdir = app.outdir
@@ -50,21 +45,15 @@ class Builder(object):
self.warn = app.warn
self.info = app.info
self.config = app.config
-
- self.load_i18n()
+ self.tags = app.tags
+ self.tags.add(self.format)
# images that need to be copied over (source -> dest)
self.images = {}
- # if None, this is set in load_env()
- self.env = env
- self.freshenv = freshenv
-
self.init()
- self.load_env()
# helper methods
-
def init(self):
"""
Load necessary templates and perform initialization. The default
@@ -167,62 +156,6 @@ class Builder(object):
# build methods
- def load_i18n(self):
- """
- Load translated strings from the configured localedirs if
- enabled in the configuration.
- """
- self.translator = None
- if self.config.language is not None:
- self.info(bold('loading translations [%s]... ' %
- self.config.language), nonl=True)
- # the None entry is the system's default locale path
- locale_dirs = [None, path.join(package_dir, 'locale')] + \
- [path.join(self.srcdir, x) for x in self.config.locale_dirs]
- for dir_ in locale_dirs:
- try:
- trans = gettext.translation('sphinx', localedir=dir_,
- languages=[self.config.language])
- if self.translator is None:
- self.translator = trans
- else:
- self.translator._catalog.update(trans._catalog)
- except Exception:
- # Language couldn't be found in the specified path
- pass
- if self.translator is not None:
- self.info('done')
- else:
- self.info('locale not available')
- if self.translator is None:
- self.translator = gettext.NullTranslations()
- self.translator.install(unicode=True)
- locale.init() # translate common labels
-
- def load_env(self):
- """Set up the build environment."""
- if self.env:
- return
- if not self.freshenv:
- try:
- self.info(bold('loading pickled environment... '), nonl=True)
- self.env = BuildEnvironment.frompickle(self.config,
- path.join(self.doctreedir, ENV_PICKLE_FILENAME))
- self.info('done')
- except Exception, err:
- if type(err) is IOError and err.errno == ENOENT:
- self.info('not found')
- else:
- self.info('failed: %s' % err)
- self.env = BuildEnvironment(self.srcdir, self.doctreedir,
- self.config)
- self.env.find_files(self.config)
- else:
- self.env = BuildEnvironment(self.srcdir, self.doctreedir,
- self.config)
- self.env.find_files(self.config)
- self.env.set_warnfunc(self.warn)
-
def build_all(self):
"""Build all source files."""
self.build(None, summary='all source files', method='all')
@@ -302,6 +235,7 @@ class Builder(object):
if updated_docnames:
# save the environment
+ from sphinx.application import ENV_PICKLE_FILENAME
self.info(bold('pickling environment... '), nonl=True)
self.env.topickle(path.join(self.doctreedir, ENV_PICKLE_FILENAME))
self.info('done')
@@ -380,15 +314,19 @@ 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'),
+ 'man': ('manpage', 'ManualPageBuilder'),
+ 'changes': ('changes', 'ChangesBuilder'),
+ 'linkcheck': ('linkcheck', 'CheckExternalLinksBuilder'),
}
diff --git a/sphinx/builders/changes.py b/sphinx/builders/changes.py
index 1844354ab..980ed7606 100644
--- a/sphinx/builders/changes.py
+++ b/sphinx/builders/changes.py
@@ -14,9 +14,11 @@ 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.locale import _
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 +95,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 +141,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 000000000..a5a0f280a
--- /dev/null
+++ b/sphinx/builders/devhelp.py
@@ -0,0 +1,133 @@
+# -*- 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 re
+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 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="[%d] %s" % (i, title),
+ link=ref)
+
+ if subitems:
+ parent_title = re.sub(r'\s*\(.*\)\s*$', '', title)
+ for subitem in subitems:
+ write_index("%s %s" % (parent_title, 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 000000000..9767391e0
--- /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 322b9df30..94665dcf7 100644
--- a/sphinx/builders/html.py
+++ b/sphinx/builders/html.py
@@ -11,6 +11,7 @@
import os
import sys
+import zlib
import codecs
import posixpath
import cPickle as pickle
@@ -23,20 +24,26 @@ 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.locale import _
from sphinx.search import js_index
from sphinx.theming import Theme
-from sphinx.builders import Builder, ENV_PICKLE_FILENAME
+from sphinx.builders import Builder
+from sphinx.application import 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
@@ -71,7 +78,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
@@ -102,9 +118,14 @@ class StandaloneHTMLBuilder(Builder):
self.script_files.append('_static/translations.js')
break
+ 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)
@@ -116,7 +137,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:
@@ -187,13 +209,24 @@ class StandaloneHTMLBuilder(Builder):
return {'fragment': ''}
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
@@ -204,6 +237,27 @@ class StandaloneHTMLBuilder(Builder):
self.docsettings = OptionParser(
defaults=self.env.settings,
components=(self.docwriter,)).get_default_values()
+ self.docsettings.compact_lists = bool(self.config.html_compact_lists)
+
+ # determine the additional indices to include
+ self.domain_indices = []
+ # html_domain_indices can be False/True or a list of index names
+ indices_config = self.config.html_domain_indices
+ if indices_config:
+ for domain in self.env.domains.itervalues():
+ for indexcls in domain.indices:
+ indexname = '%s-%s' % (domain.name, indexcls.name)
+ if isinstance(indices_config, list):
+ if indexname not in indices_config:
+ continue
+ # deprecated config value
+ if indexname == 'py-modindex' and \
+ not self.config.html_use_modindex:
+ continue
+ content, collapse = indexcls(domain).generate()
+ if content:
+ self.domain_indices.append(
+ (indexname, indexcls, content, collapse))
# format the "last updated on" string, only once is enough since it
# typically doesn't include the time of day
@@ -229,9 +283,11 @@ class StandaloneHTMLBuilder(Builder):
rellinks = []
if self.config.html_use_index:
rellinks.append(('genindex', _('General Index'), 'I', _('index')))
- if self.config.html_use_modindex and self.env.modules:
- rellinks.append(('modindex', _('Global Module Index'),
- 'M', _('modules')))
+ for indexname, indexcls, content, collapse in self.domain_indices:
+ # if it has a short name
+ if indexcls.shortname:
+ rellinks.append((indexname, indexcls.localname,
+ '', indexcls.shortname))
if self.config.html_style is not None:
stylename = self.config.html_style
@@ -251,11 +307,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,
@@ -267,8 +325,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):
@@ -359,128 +416,17 @@ class StandaloneHTMLBuilder(Builder):
def finish(self):
self.info(bold('writing additional files...'), nonl=1)
- # the global general index
+ # pages from extensions
+ for pagelist in self.app.emit('html-collect-pages'):
+ for pagename, context, template in pagelist:
+ self.handle_page(pagename, context, template)
+ # 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')
-
- # 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_genindex()
+
+ # the global domain-specific indices
+ self.write_domain_indices()
# the search page
if self.name != 'htmlhelp':
@@ -499,6 +445,54 @@ 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_domain_indices(self):
+ for indexname, indexcls, content, collapse in self.domain_indices:
+ indexcontext = dict(
+ indextitle = indexcls.localname,
+ content = content,
+ collapse_index = collapse,
+ )
+ self.info(' ' + indexname, nonl=1)
+ self.handle_page(indexname, indexcontext, 'domainindex.html')
+
+ def copy_image_files(self):
# copy image files
if self.images:
self.info(bold('copying images...'), nonl=True)
@@ -513,6 +507,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)
@@ -527,6 +522,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'))
@@ -545,31 +541,42 @@ class StandaloneHTMLBuilder(Builder):
copyfile(jsfile, path.join(self.outdir, '_static',
'translations.js'))
break
- # 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:
@@ -581,11 +588,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:
@@ -605,7 +607,7 @@ class StandaloneHTMLBuilder(Builder):
# the parent node here.
continue
uri = node['uri']
- reference = nodes.reference()
+ reference = nodes.reference('', '', internal=True)
if uri in self.images:
reference['refuri'] = posixpath.join(self.imgpath,
self.images[uri])
@@ -635,13 +637,43 @@ class StandaloneHTMLBuilder(Builder):
if self.indexer is not None and title:
self.indexer.feed(pagename, title, doctree)
- def _get_local_toctree(self, docname, collapse=True):
+ def _get_local_toctree(self, docname, collapse=True, maxdepth=0):
return self.render_partial(self.env.get_toctree_for(
docname, self, collapse))['fragment']
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):
@@ -661,8 +693,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,
@@ -681,7 +714,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:
@@ -696,6 +729,36 @@ class StandaloneHTMLBuilder(Builder):
copyfile(self.env.doc2path(pagename), source_name)
def handle_finish(self):
+ 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), 'wb')
+ try:
+ f.write('# Sphinx inventory version 2\n')
+ f.write('# Project: %s\n' % self.config.project.encode('utf-8'))
+ f.write('# Version: %s\n' % self.config.version)
+ f.write('# The remainder of this file is compressed using zlib.\n')
+ compressor = zlib.compressobj(9)
+ for domainname, domain in self.env.domains.iteritems():
+ for name, dispname, type, docname, anchor, prio in \
+ domain.get_objects():
+ if anchor.endswith(name):
+ # this can shorten the inventory by as much as 25%
+ anchor = anchor[:-len(name)] + '$'
+ uri = self.get_target_uri(docname) + '#' + anchor
+ if dispname == name:
+ dispname = '-'
+ f.write(compressor.compress(
+ '%s %s:%s %s %s %s\n' % (name, domainname, type, prio,
+ uri, dispname)))
+ f.write(compressor.flush())
+ finally:
+ 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)
@@ -709,21 +772,6 @@ class StandaloneHTMLBuilder(Builder):
movefile(searchindexfn + '.tmp', searchindexfn)
self.info('done')
- self.info(bold('dumping object inventory... '), nonl=True)
- f = open(path.join(self.outdir, INVENTORY_FILENAME), 'w')
- try:
- f.write('# Sphinx inventory version 1\n')
- f.write('# Project: %s\n' % self.config.project.encode('utf-8'))
- f.write('# Version: %s\n' % self.config.version)
- for modname, info in self.env.modules.iteritems():
- f.write('%s mod %s\n' % (modname, self.get_target_uri(info[0])))
- for refname, (docname, desctype) in self.env.descrefs.iteritems():
- f.write('%s %s %s\n' % (refname, desctype,
- self.get_target_uri(docname)))
- finally:
- f.close()
- self.info('done')
-
class DirectoryHTMLBuilder(StandaloneHTMLBuilder):
"""
@@ -751,6 +799,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.
@@ -784,9 +936,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/htmlhelp.py b/sphinx/builders/htmlhelp.py
index bf486fc93..538f4c848 100644
--- a/sphinx/builders/htmlhelp.py
+++ b/sphinx/builders/htmlhelp.py
@@ -216,9 +216,9 @@ class HTMLHelpBuilder(StandaloneHTMLBuilder):
# special books
f.write('<LI> ' + object_sitemap % (self.config.html_short_title,
'index.html'))
- if self.config.html_use_modindex:
- f.write('<LI> ' + object_sitemap % (_('Global Module Index'),
- 'modindex.html'))
+ for indexname, indexcls, content, collapse in self.domain_indices:
+ f.write('<LI> ' + object_sitemap % (indexcls.localname,
+ '%s.html' % indexname))
# the TOC
tocdoc = self.env.get_and_resolve_doctree(
self.config.master_doc, self, prune_toctrees=False)
diff --git a/sphinx/builders/latex.py b/sphinx/builders/latex.py
index 751bf28cd..0481b308b 100644
--- a/sphinx/builders/latex.py
+++ b/sphinx/builders/latex.py
@@ -18,9 +18,12 @@ 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.locale import _
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 +117,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 +130,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 1fead717a..c9bc363d1 100644
--- a/sphinx/builders/linkcheck.py
+++ b/sphinx/builders/linkcheck.py
@@ -72,6 +72,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/manpage.py b/sphinx/builders/manpage.py
new file mode 100644
index 000000000..756e4732f
--- /dev/null
+++ b/sphinx/builders/manpage.py
@@ -0,0 +1,92 @@
+# -*- coding: utf-8 -*-
+"""
+ sphinx.builders.manpage
+ ~~~~~~~~~~~~~~~~~~~~~~~
+
+ Manual pages builder.
+
+ :copyright: Copyright 2007-2010 by the Sphinx team, see AUTHORS.
+ :license: BSD, see LICENSE for details.
+"""
+
+from os import path
+
+from docutils.io import FileOutput
+from docutils.frontend import OptionParser
+
+from sphinx import addnodes
+from sphinx.errors import SphinxError
+from sphinx.builders import Builder
+from sphinx.environment import NoUri
+from sphinx.util.nodes import inline_all_toctrees
+from sphinx.util.console import bold, darkgreen
+from sphinx.writers.manpage import ManualPageWriter, has_manpage_writer
+
+
+class ManualPageBuilder(Builder):
+ """
+ Builds groff output in manual page format.
+ """
+ name = 'man'
+ format = 'man'
+ supported_image_types = []
+
+ def init(self):
+ if not has_manpage_writer:
+ raise SphinxError('The docutils manual page writer can\'t be '
+ 'found; it is only available as of docutils 0.6.')
+ if not self.config.man_pages:
+ self.warn('no "man_pages" config value found; no manual pages '
+ 'will be written')
+
+ def get_outdated_docs(self):
+ return 'all manpages' # for now
+
+ def get_target_uri(self, docname, typ=None):
+ if typ == 'token':
+ return ''
+ raise NoUri
+
+ def write(self, *ignored):
+ docwriter = ManualPageWriter(self)
+ docsettings = OptionParser(
+ defaults=self.env.settings,
+ components=(docwriter,)).get_default_values()
+
+ self.info(bold('writing... '), nonl=True)
+
+ for info in self.config.man_pages:
+ docname, name, description, authors, section = info
+ if isinstance(authors, basestring):
+ if authors:
+ authors = [authors]
+ else:
+ authors = []
+
+ targetname = '%s.%s' % (name, section)
+ self.info(darkgreen(targetname) + ' { ', nonl=True)
+ destination = FileOutput(
+ destination_path=path.join(self.outdir, targetname),
+ encoding='utf-8')
+
+ tree = self.env.get_doctree(docname)
+ docnames = set()
+ largetree = inline_all_toctrees(self, docnames, docname, tree,
+ darkgreen)
+ self.info('} ', nonl=True)
+ self.env.resolve_references(largetree, docname, self)
+ # remove pending_xref nodes
+ for pendingnode in largetree.traverse(addnodes.pending_xref):
+ pendingnode.replace_self(pendingnode.children)
+
+ largetree.settings = docsettings
+ largetree.settings.title = name
+ largetree.settings.subtitle = description
+ largetree.settings.authors = authors
+ largetree.settings.section = section
+
+ docwriter.write(largetree, destination)
+ self.info()
+
+ def finish(self):
+ pass
diff --git a/sphinx/builders/qthelp.py b/sphinx/builders/qthelp.py
index 89bda0dcf..ffc52334c 100644
--- a/sphinx/builders/qthelp.py
+++ b/sphinx/builders/qthelp.py
@@ -21,6 +21,7 @@ from docutils import nodes
from sphinx import addnodes
from sphinx.builders.html import StandaloneHTMLBuilder
+
_idpattern = re.compile(
r'(?P<title>.+) (\((?P<id>[\w\.]+)( (?P<descr>\w+))?\))$')
@@ -126,9 +127,9 @@ class QtHelpBuilder(StandaloneHTMLBuilder):
for node in tocdoc.traverse(istoctree):
sections.extend(self.write_toc(node))
- if self.config.html_use_modindex:
- item = section_template % {'title': _('Global Module Index'),
- 'ref': 'modindex.html'}
+ for indexname, indexcls, content, collapse in self.domain_indices:
+ item = section_template % {'title': indexcls.localname,
+ 'ref': '%s.html' % indexname}
sections.append(' '*4*4 + item)
sections = '\n'.join(sections)
@@ -251,7 +252,7 @@ class QtHelpBuilder(StandaloneHTMLBuilder):
shortname = shortname[:-2]
id = '%s.%s' % (id, shortname)
else:
- id = descr = None
+ id = None
if id:
item = ' '*12 + '<keyword name="%s" id="%s" ref="%s"/>' % (
diff --git a/sphinx/builders/text.py b/sphinx/builders/text.py
index d8451371d..092a1d97a 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/cmdline.py b/sphinx/cmdline.py
index dc3269e23..e3e944656 100644
--- a/sphinx/cmdline.py
+++ b/sphinx/cmdline.py
@@ -43,6 +43,7 @@ new and changed files
-C -- use no config file at all, only -D options
-D <setting=value> -- override a setting in configuration
-A <name=value> -- pass a value into the templates, for HTML builder
+ -n -- nit-picky mode, warn about all missing references
-N -- do not do colored output
-q -- no output on stdout, just warnings on stderr
-Q -- no output at all, not even warnings
@@ -61,7 +62,7 @@ def main(argv):
nocolor()
try:
- opts, args = getopt.getopt(argv[1:], 'ab:t:d:c:CD:A:g:NEqQWw:P')
+ opts, args = getopt.getopt(argv[1:], 'ab:t:d:c:CD:A:ng:NEqQWw:P')
allopts = set(opt[0] for opt in opts)
srcdir = confdir = path.abspath(args[0])
if not path.isdir(srcdir):
@@ -89,8 +90,8 @@ def main(argv):
if err:
return 1
- buildername = all_files = None
- freshenv = warningiserror = use_pdb = False
+ buildername = None
+ force_all = freshenv = warningiserror = use_pdb = False
status = sys.stdout
warning = sys.stderr
error = sys.stderr
@@ -105,7 +106,7 @@ def main(argv):
if filenames:
usage(argv, 'Cannot combine -a option and filenames.')
return 1
- all_files = True
+ force_all = True
elif opt == '-t':
tags.append(val)
elif opt == '-d':
@@ -142,6 +143,8 @@ def main(argv):
except ValueError:
pass
confoverrides['html_context.%s' % key] = val
+ elif opt == '-n':
+ confoverrides['nitpicky'] = True
elif opt == '-N':
nocolor()
elif opt == '-E':
@@ -167,7 +170,7 @@ def main(argv):
app = Sphinx(srcdir, confdir, outdir, doctreedir, buildername,
confoverrides, status, warning, freshenv,
warningiserror, tags)
- app.build(all_files, filenames)
+ app.build(force_all, filenames)
return app.statuscode
except KeyboardInterrupt:
if use_pdb:
diff --git a/sphinx/config.py b/sphinx/config.py
index 4cd514921..e25427828 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,11 @@ class Config(object):
keep_warnings = (False, 'env'),
modindex_common_prefix = ([], 'html'),
rst_epilog = (None, 'env'),
+ rst_prolog = (None, 'env'),
+ trim_doctest_flags = (True, 'env'),
+ primary_domain = ('py', 'env'),
+ needs_sphinx = (None, None),
+ nitpicky = (False, 'env'),
# HTML options
html_theme = ('default', 'html'),
@@ -77,7 +83,8 @@ class Config(object):
html_translator_class = (None, 'html'),
html_sidebars = ({}, 'html'),
html_additional_pages = ({}, 'html'),
- html_use_modindex = (True, 'html'),
+ html_use_modindex = (True, 'html'), # deprecated
+ html_domain_indices = (True, 'html'),
html_add_permalinks = (True, 'html'),
html_use_index = (True, 'html'),
html_split_index = (False, 'html'),
@@ -86,8 +93,12 @@ 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_compact_lists = (True, 'html'),
+ html_secnumber_suffix = ('. ', 'html'),
# HTML help only options
htmlhelp_basename = (lambda self: make_filename(self.project), None),
@@ -95,20 +106,50 @@ 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),
latex_appendices = ([], None),
latex_use_parts = (False, None),
- latex_use_modindex = (True, None),
+ latex_use_modindex = (True, None), # deprecated
+ latex_domain_indices = (True, None),
+ latex_show_urls = (False, None),
+ latex_show_pagerefs = (False, None),
# paper_size and font_size are still separate values
# so that you can give them easily on the command line
latex_paper_size = ('letter', None),
latex_font_size = ('10pt', None),
latex_elements = ({}, None),
latex_additional_files = ([], None),
+ latex_docclass = ({}, None),
# now deprecated - use latex_elements
latex_preamble = ('', None),
+
+ # text options
+ text_sectionchars = ('*=-~"+`', 'text'),
+ text_windows_newlines = (False, 'text'),
+
+ # manpage options
+ man_pages = ([], None),
)
def __init__(self, dirname, filename, overrides, tags):
diff --git a/sphinx/directives/__init__.py b/sphinx/directives/__init__.py
index 00bb55ecc..6c03b8e5f 100644
--- a/sphinx/directives/__init__.py
+++ b/sphinx/directives/__init__.py
@@ -9,11 +9,15 @@
:license: BSD, see LICENSE for details.
"""
-from docutils.parsers.rst import directives
+import re
+
+from docutils.parsers.rst import Directive, directives
from docutils.parsers.rst.directives import images
+from sphinx import addnodes
+from sphinx.util.docfields import DocFieldTransformer
+
# import and register directives
-from sphinx.directives.desc import *
from sphinx.directives.code import *
from sphinx.directives.other import *
@@ -25,3 +29,171 @@ try:
except AttributeError:
images.figure.options['figwidth'] = \
directives.length_or_percentage_or_unitless
+
+
+# RE to strip backslash escapes
+strip_backslash_re = re.compile(r'\\(?=[^\\])')
+
+
+class ObjectDescription(Directive):
+ """
+ Directive to describe a class, function or similar object. Not used
+ directly, but subclassed (in domain-specific directives) to add custom
+ behavior.
+ """
+
+ has_content = True
+ required_arguments = 1
+ optional_arguments = 0
+ final_argument_whitespace = True
+ option_spec = {
+ 'noindex': directives.flag,
+ }
+
+ # types of doc fields that this directive handles, see sphinx.util.docfields
+ doc_field_types = []
+
+ def get_signatures(self):
+ """
+ Retrieve the signatures to document from the directive arguments. By
+ default, signatures are given as arguments, one per line.
+ """
+ # remove backslashes to support (dummy) escapes; helps Vim highlighting
+ return [strip_backslash_re.sub('', sig.strip())
+ for sig in self.arguments[0].split('\n')]
+
+ def handle_signature(self, sig, signode):
+ """
+ Parse the signature *sig* into individual nodes and append them to
+ *signode*. If ValueError is raised, parsing is aborted and the whole
+ *sig* is put into a single desc_name node.
+
+ The return value should be a value that identifies the object. It is
+ passed to :meth:`add_target_and_index()` unchanged, and otherwise only
+ used to skip duplicates.
+ """
+ raise ValueError
+
+ def add_target_and_index(self, name, sig, signode):
+ """
+ Add cross-reference IDs and entries to self.indexnode, if applicable.
+
+ *name* is whatever :meth:`handle_signature()` returned.
+ """
+ return # do nothing by default
+
+ def before_content(self):
+ """
+ Called before parsing content. Used to set information about the current
+ directive context on the build environment.
+ """
+ pass
+
+ def after_content(self):
+ """
+ Called after parsing content. Used to reset information about the
+ current directive context on the build environment.
+ """
+ pass
+
+ def run(self):
+ """
+ Main directive entry function, called by docutils upon encountering the
+ directive.
+
+ This directive is meant to be quite easily subclassable, so it delegates
+ to several additional methods. What it does:
+
+ * find out if called as a domain-specific directive, set self.domain
+ * create a `desc` node to fit all description inside
+ * parse standard options, currently `noindex`
+ * create an index node if needed as self.indexnode
+ * parse all given signatures (as returned by self.get_signatures())
+ using self.handle_signature(), which should either return a name
+ or raise ValueError
+ * add index entries using self.add_target_and_index()
+ * parse the content and handle doc fields in it
+ """
+ if ':' in self.name:
+ self.domain, self.objtype = self.name.split(':', 1)
+ else:
+ self.domain, self.objtype = '', self.name
+ self.env = self.state.document.settings.env
+ self.indexnode = addnodes.index(entries=[])
+
+ node = addnodes.desc()
+ node.document = self.state.document
+ node['domain'] = self.domain
+ # 'desctype' is a backwards compatible attribute
+ node['objtype'] = node['desctype'] = self.objtype
+ node['noindex'] = noindex = ('noindex' in self.options)
+
+ self.names = []
+ signatures = self.get_signatures()
+ for i, sig in enumerate(signatures):
+ # add a signature node for each signature in the current unit
+ # and add a reference target for it
+ signode = addnodes.desc_signature(sig, '')
+ signode['first'] = False
+ node.append(signode)
+ try:
+ # name can also be a tuple, e.g. (classname, objname);
+ # this is strictly domain-specific (i.e. no assumptions may
+ # be made in this base class)
+ name = self.handle_signature(sig, signode)
+ except ValueError:
+ # signature parsing failed
+ signode.clear()
+ signode += addnodes.desc_name(sig, sig)
+ continue # we don't want an index entry here
+ if not noindex and name not in self.names:
+ # only add target and index entry if this is the first
+ # description of the object with this name in this desc block
+ self.names.append(name)
+ self.add_target_and_index(name, sig, signode)
+
+ contentnode = addnodes.desc_content()
+ node.append(contentnode)
+ if self.names:
+ # needed for association of version{added,changed} directives
+ self.env.temp_data['object'] = self.names[0]
+ self.before_content()
+ self.state.nested_parse(self.content, self.content_offset, contentnode)
+ #self.handle_doc_fields(contentnode)
+ DocFieldTransformer(self).transform_all(contentnode)
+ self.env.temp_data['object'] = None
+ self.after_content()
+ return [self.indexnode, node]
+
+# backwards compatible old name
+DescDirective = ObjectDescription
+
+
+class DefaultDomain(Directive):
+ """
+ Directive to (re-)set the default domain for this source file.
+ """
+
+ has_content = False
+ required_arguments = 1
+ optional_arguments = 0
+ final_argument_whitespace = False
+ option_spec = {}
+
+ def run(self):
+ env = self.state.document.settings.env
+ domain_name = self.arguments[0].lower()
+ # if domain_name not in env.domains:
+ # # try searching by label
+ # for domain in env.domains.itervalues():
+ # if domain.label.lower() == domain_name:
+ # domain_name = domain.name
+ # break
+ env.temp_data['default_domain'] = env.domains.get(domain_name)
+ return []
+
+
+directives.register_directive('default-domain', DefaultDomain)
+directives.register_directive('describe', ObjectDescription)
+# new, more consistent, name
+directives.register_directive('object', ObjectDescription)
diff --git a/sphinx/directives/code.py b/sphinx/directives/code.py
index b4375a98c..d82dd76d0 100644
--- a/sphinx/directives/code.py
+++ b/sphinx/directives/code.py
@@ -13,11 +13,10 @@ import codecs
from os import path
from docutils import nodes
-from docutils.parsers.rst import directives
+from docutils.parsers.rst import Directive, directives
from sphinx import addnodes
from sphinx.util import parselinenos
-from sphinx.util.compat import Directive, directive_dwim
class Highlight(Directive):
@@ -81,12 +80,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):
@@ -152,7 +154,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 = []
@@ -166,7 +170,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', ''):
@@ -177,8 +188,8 @@ class LiteralInclude(Directive):
return [retnode]
-directives.register_directive('highlight', directive_dwim(Highlight))
-directives.register_directive('highlightlang', directive_dwim(Highlight)) # old
-directives.register_directive('code-block', directive_dwim(CodeBlock))
-directives.register_directive('sourcecode', directive_dwim(CodeBlock))
-directives.register_directive('literalinclude', directive_dwim(LiteralInclude))
+directives.register_directive('highlight', Highlight)
+directives.register_directive('highlightlang', Highlight) # old
+directives.register_directive('code-block', CodeBlock)
+directives.register_directive('sourcecode', CodeBlock)
+directives.register_directive('literalinclude', LiteralInclude)
diff --git a/sphinx/directives/desc.py b/sphinx/directives/desc.py
deleted file mode 100644
index 5a8ed7914..000000000
--- a/sphinx/directives/desc.py
+++ /dev/null
@@ -1,771 +0,0 @@
-# -*- coding: utf-8 -*-
-"""
- sphinx.directives.desc
- ~~~~~~~~~~~~~~~~~~~~~~
-
- :copyright: Copyright 2007-2010 by the Sphinx team, see AUTHORS.
- :license: BSD, see LICENSE for details.
-"""
-
-import re
-import string
-
-from docutils import nodes
-from docutils.parsers.rst import directives
-
-from sphinx import addnodes
-from sphinx.util import ws_re
-from sphinx.util.compat import Directive, directive_dwim
-
-
-def _is_only_paragraph(node):
- """True if the node only contains one paragraph (and system messages)."""
- if len(node) == 0:
- return False
- elif len(node) > 1:
- for subnode in node[1:]:
- if not isinstance(subnode, nodes.system_message):
- return False
- if isinstance(node[0], nodes.paragraph):
- return True
- return False
-
-
-# REs for Python signatures
-py_sig_re = re.compile(
- r'''^ ([\w.]*\.)? # class name(s)
- (\w+) \s* # thing name
- (?: \((.*)\) # optional: arguments
- (?:\s* -> \s* (.*))? # return annotation
- )? $ # and nothing more
- ''', re.VERBOSE)
-
-py_paramlist_re = re.compile(r'([\[\],])') # split at '[', ']' and ','
-
-# REs for C signatures
-c_sig_re = re.compile(
- r'''^([^(]*?) # return type
- ([\w:]+) \s* # thing name (colon allowed for C++ class names)
- (?: \((.*)\) )? # optionally arguments
- (\s+const)? $ # const specifier
- ''', re.VERBOSE)
-c_funcptr_sig_re = re.compile(
- r'''^([^(]+?) # return type
- (\( [^()]+ \)) \s* # name in parentheses
- \( (.*) \) # arguments
- (\s+const)? $ # const specifier
- ''', re.VERBOSE)
-c_funcptr_name_re = re.compile(r'^\(\s*\*\s*(.*?)\s*\)$')
-
-# RE for option descriptions
-option_desc_re = re.compile(
- r'((?:/|-|--)[-_a-zA-Z0-9]+)(\s*.*?)(?=,\s+(?:/|-|--)|$)')
-
-# RE to split at word boundaries
-wsplit_re = re.compile(r'(\W+)')
-
-# RE to strip backslash escapes
-strip_backslash_re = re.compile(r'\\(?=[^\\])')
-
-
-class DescDirective(Directive):
- """
- Directive to describe a class, function or similar object. Not used
- directly, but subclassed to add custom behavior.
- """
-
- has_content = True
- required_arguments = 1
- optional_arguments = 0
- final_argument_whitespace = True
- option_spec = {
- 'noindex': directives.flag,
- 'module': directives.unchanged,
- }
-
- _ = lambda x: x # make gettext extraction in constants possible
-
- doc_fields_with_arg = {
- 'param': '%param',
- 'parameter': '%param',
- 'arg': '%param',
- 'argument': '%param',
- 'keyword': '%param',
- 'kwarg': '%param',
- 'kwparam': '%param',
- 'type': '%type',
- 'raises': _('Raises'),
- 'raise': 'Raises',
- 'exception': 'Raises',
- 'except': 'Raises',
- 'var': _('Variable'),
- 'ivar': 'Variable',
- 'cvar': 'Variable',
- 'returns': _('Returns'),
- 'return': 'Returns',
- }
-
- doc_fields_with_linked_arg = ('raises', 'raise', 'exception', 'except')
-
- doc_fields_without_arg = {
- 'returns': 'Returns',
- 'return': 'Returns',
- 'rtype': _('Return type'),
- }
-
- def handle_doc_fields(self, node):
- """
- Convert field lists with known keys inside the description content into
- better-looking equivalents.
- """
- # don't traverse, only handle field lists that are immediate children
- for child in node.children:
- if not isinstance(child, nodes.field_list):
- continue
- params = []
- pfield = None
- param_nodes = {}
- param_types = {}
- new_list = nodes.field_list()
- for field in child:
- fname, fbody = field
- try:
- typ, obj = fname.astext().split(None, 1)
- typdesc = _(self.doc_fields_with_arg[typ])
- if _is_only_paragraph(fbody):
- children = fbody.children[0].children
- else:
- children = fbody.children
- if typdesc == '%param':
- if not params:
- # add the field that later gets all the parameters
- pfield = nodes.field()
- new_list += pfield
- dlitem = nodes.list_item()
- dlpar = nodes.paragraph()
- dlpar += nodes.emphasis(obj, obj)
- dlpar += nodes.Text(' -- ', ' -- ')
- dlpar += children
- param_nodes[obj] = dlpar
- dlitem += dlpar
- params.append(dlitem)
- elif typdesc == '%type':
- typenodes = fbody.children
- if _is_only_paragraph(fbody):
- typenodes = ([nodes.Text(' (')] +
- typenodes[0].children +
- [nodes.Text(')')])
- param_types[obj] = typenodes
- else:
- fieldname = typdesc + ' '
- nfield = nodes.field()
- nfieldname = nodes.field_name(fieldname, fieldname)
- nfield += nfieldname
- node = nfieldname
- if typ in self.doc_fields_with_linked_arg:
- node = addnodes.pending_xref(
- obj, reftype='obj', refcaption=False,
- reftarget=obj, modname=self.env.currmodule,
- classname=self.env.currclass)
- nfieldname += node
- node += nodes.Text(obj, obj)
- nfield += nodes.field_body()
- nfield[1] += fbody.children
- new_list += nfield
- except (KeyError, ValueError):
- fnametext = fname.astext()
- try:
- typ = _(self.doc_fields_without_arg[fnametext])
- except KeyError:
- # at least capitalize the field name
- typ = fnametext.capitalize()
- fname[0] = nodes.Text(typ)
- new_list += field
- if params:
- if len(params) == 1:
- pfield += nodes.field_name('', _('Parameter'))
- pfield += nodes.field_body()
- pfield[1] += params[0][0]
- else:
- pfield += nodes.field_name('', _('Parameters'))
- pfield += nodes.field_body()
- pfield[1] += nodes.bullet_list()
- pfield[1][0].extend(params)
-
- for param, type in param_types.iteritems():
- if param in param_nodes:
- param_nodes[param][1:1] = type
- child.replace_self(new_list)
-
- def get_signatures(self):
- """
- Retrieve the signatures to document from the directive arguments.
- """
- # remove backslashes to support (dummy) escapes; helps Vim highlighting
- return [strip_backslash_re.sub('', sig.strip())
- for sig in self.arguments[0].split('\n')]
-
- def parse_signature(self, sig, signode):
- """
- Parse the signature *sig* into individual nodes and append them to
- *signode*. If ValueError is raised, parsing is aborted and the whole
- *sig* is put into a single desc_name node.
- """
- raise ValueError
-
- def add_target_and_index(self, name, sig, signode):
- """
- Add cross-reference IDs and entries to self.indexnode, if applicable.
- """
- return # do nothing by default
-
- def before_content(self):
- """
- Called before parsing content. Used to set information about the current
- directive context on the build environment.
- """
- pass
-
- def after_content(self):
- """
- Called after parsing content. Used to reset information about the
- current directive context on the build environment.
- """
- pass
-
- def run(self):
- self.desctype = self.name
- self.env = self.state.document.settings.env
- self.indexnode = addnodes.index(entries=[])
-
- node = addnodes.desc()
- node.document = self.state.document
- node['desctype'] = self.desctype
- node['noindex'] = noindex = ('noindex' in self.options)
-
- self.names = []
- signatures = self.get_signatures()
- for i, sig in enumerate(signatures):
- # add a signature node for each signature in the current unit
- # and add a reference target for it
- signode = addnodes.desc_signature(sig, '')
- signode['first'] = False
- node.append(signode)
- try:
- # name can also be a tuple, e.g. (classname, objname)
- name = self.parse_signature(sig, signode)
- except ValueError, err:
- # signature parsing failed
- signode.clear()
- signode += addnodes.desc_name(sig, sig)
- continue # we don't want an index entry here
- if not noindex and name not in self.names:
- # only add target and index entry if this is the first
- # description of the object with this name in this desc block
- self.names.append(name)
- self.add_target_and_index(name, sig, signode)
-
- contentnode = addnodes.desc_content()
- node.append(contentnode)
- if self.names:
- # needed for association of version{added,changed} directives
- self.env.currdesc = self.names[0]
- self.before_content()
- self.state.nested_parse(self.content, self.content_offset, contentnode)
- self.handle_doc_fields(contentnode)
- self.env.currdesc = None
- self.after_content()
- return [self.indexnode, node]
-
-
-class PythonDesc(DescDirective):
- """
- Description of a general Python object.
- """
-
- def get_signature_prefix(self, sig):
- """
- May return a prefix to put before the object name in the signature.
- """
- return ''
-
- def needs_arglist(self):
- """
- May return true if an empty argument list is to be generated even if
- the document contains none.
- """
- return False
-
- def parse_signature(self, sig, signode):
- """
- Transform a Python signature into RST nodes.
- Returns (fully qualified name of the thing, classname if any).
-
- If inside a class, the current class name is handled intelligently:
- * it is stripped from the displayed name if present
- * it is added to the full name (return value) if not present
- """
- m = py_sig_re.match(sig)
- if m is None:
- raise ValueError
- classname, name, arglist, retann = m.groups()
-
- if self.env.currclass:
- add_module = False
- if classname and classname.startswith(self.env.currclass):
- fullname = classname + name
- # class name is given again in the signature
- classname = classname[len(self.env.currclass):].lstrip('.')
- elif classname:
- # class name is given in the signature, but different
- # (shouldn't happen)
- fullname = self.env.currclass + '.' + classname + name
- else:
- # class name is not given in the signature
- fullname = self.env.currclass + '.' + name
- else:
- add_module = True
- fullname = classname and classname + name or name
-
- prefix = self.get_signature_prefix(sig)
- if prefix:
- signode += addnodes.desc_annotation(prefix, prefix)
-
- if classname:
- signode += addnodes.desc_addname(classname, classname)
- # exceptions are a special case, since they are documented in the
- # 'exceptions' module.
- elif add_module and self.env.config.add_module_names:
- modname = self.options.get('module', self.env.currmodule)
- if modname and modname != 'exceptions':
- nodetext = modname + '.'
- signode += addnodes.desc_addname(nodetext, nodetext)
-
- signode += addnodes.desc_name(name, name)
- if not arglist:
- if self.needs_arglist():
- # for callables, add an empty parameter list
- signode += addnodes.desc_parameterlist()
- if retann:
- signode += addnodes.desc_returns(retann, retann)
- return fullname, classname
- signode += addnodes.desc_parameterlist()
-
- stack = [signode[-1]]
- for token in py_paramlist_re.split(arglist):
- if token == '[':
- opt = addnodes.desc_optional()
- stack[-1] += opt
- stack.append(opt)
- elif token == ']':
- try:
- stack.pop()
- except IndexError:
- raise ValueError
- elif not token or token == ',' or token.isspace():
- pass
- else:
- token = token.strip()
- stack[-1] += addnodes.desc_parameter(token, token)
- if len(stack) != 1:
- raise ValueError
- if retann:
- signode += addnodes.desc_returns(retann, retann)
- return fullname, classname
-
- def get_index_text(self, modname, name):
- """
- Return the text for the index entry of the object.
- """
- raise NotImplementedError('must be implemented in subclasses')
-
- def add_target_and_index(self, name_cls, sig, signode):
- modname = self.options.get('module', self.env.currmodule)
- fullname = (modname and modname + '.' or '') + name_cls[0]
- # note target
- if fullname not in self.state.document.ids:
- signode['names'].append(fullname)
- signode['ids'].append(fullname)
- signode['first'] = (not self.names)
- self.state.document.note_explicit_target(signode)
- self.env.note_descref(fullname, self.desctype, self.lineno)
-
- indextext = self.get_index_text(modname, name_cls)
- if indextext:
- self.indexnode['entries'].append(('single', indextext,
- fullname, fullname))
-
- def before_content(self):
- # needed for automatic qualification of members (reset in subclasses)
- self.clsname_set = False
-
- def after_content(self):
- if self.clsname_set:
- self.env.currclass = None
-
-
-class ModulelevelDesc(PythonDesc):
- """
- Description of an object on module level (functions, data).
- """
-
- def needs_arglist(self):
- return self.desctype == 'function'
-
- def get_index_text(self, modname, name_cls):
- if self.desctype == 'function':
- if not modname:
- return _('%s() (built-in function)') % name_cls[0]
- return _('%s() (in module %s)') % (name_cls[0], modname)
- elif self.desctype == 'data':
- if not modname:
- return _('%s (built-in variable)') % name_cls[0]
- return _('%s (in module %s)') % (name_cls[0], modname)
- else:
- return ''
-
-
-class ClasslikeDesc(PythonDesc):
- """
- Description of a class-like object (classes, interfaces, exceptions).
- """
-
- def get_signature_prefix(self, sig):
- return self.desctype + ' '
-
- def get_index_text(self, modname, name_cls):
- if self.desctype == 'class':
- if not modname:
- return _('%s (built-in class)') % name_cls[0]
- return _('%s (class in %s)') % (name_cls[0], modname)
- elif self.desctype == 'exception':
- return name_cls[0]
- else:
- return ''
-
- def before_content(self):
- PythonDesc.before_content(self)
- if self.names:
- self.env.currclass = self.names[0][0]
- self.clsname_set = True
-
-
-class ClassmemberDesc(PythonDesc):
- """
- Description of a class member (methods, attributes).
- """
-
- def needs_arglist(self):
- return self.desctype.endswith('method')
-
- def get_signature_prefix(self, sig):
- if self.desctype == 'staticmethod':
- return 'static '
- elif self.desctype == 'classmethod':
- return 'classmethod '
- return ''
-
- def get_index_text(self, modname, name_cls):
- name, cls = name_cls
- add_modules = self.env.config.add_module_names
- if self.desctype == 'method':
- try:
- clsname, methname = name.rsplit('.', 1)
- except ValueError:
- if modname:
- return _('%s() (in module %s)') % (name, modname)
- else:
- return '%s()' % name
- if modname and add_modules:
- return _('%s() (%s.%s method)') % (methname, modname, clsname)
- else:
- return _('%s() (%s method)') % (methname, clsname)
- elif self.desctype == 'staticmethod':
- try:
- clsname, methname = name.rsplit('.', 1)
- except ValueError:
- if modname:
- return _('%s() (in module %s)') % (name, modname)
- else:
- return '%s()' % name
- if modname and add_modules:
- return _('%s() (%s.%s static method)') % (methname, modname,
- clsname)
- else:
- return _('%s() (%s static method)') % (methname, clsname)
- elif self.desctype == 'classmethod':
- try:
- clsname, methname = name.rsplit('.', 1)
- except ValueError:
- if modname:
- return '%s() (in module %s)' % (name, modname)
- else:
- return '%s()' % name
- if modname:
- return '%s() (%s.%s class method)' % (methname, modname,
- clsname)
- else:
- return '%s() (%s class method)' % (methname, clsname)
- elif self.desctype == 'attribute':
- try:
- clsname, attrname = name.rsplit('.', 1)
- except ValueError:
- if modname:
- return _('%s (in module %s)') % (name, modname)
- else:
- return name
- if modname and add_modules:
- return _('%s (%s.%s attribute)') % (attrname, modname, clsname)
- else:
- return _('%s (%s attribute)') % (attrname, clsname)
- else:
- return ''
-
- def before_content(self):
- PythonDesc.before_content(self)
- if self.names and self.names[-1][1] and not self.env.currclass:
- self.env.currclass = self.names[-1][1].strip('.')
- self.clsname_set = True
-
-
-class CDesc(DescDirective):
- """
- Description of a C language object.
- """
-
- # These C types aren't described anywhere, so don't try to create
- # a cross-reference to them
- stopwords = set(('const', 'void', 'char', 'int', 'long', 'FILE', 'struct'))
-
- def _parse_type(self, node, ctype):
- # add cross-ref nodes for all words
- for part in filter(None, wsplit_re.split(ctype)):
- tnode = nodes.Text(part, part)
- if part[0] in string.ascii_letters+'_' and \
- part not in self.stopwords:
- pnode = addnodes.pending_xref(
- '', reftype='ctype', reftarget=part,
- modname=None, classname=None)
- pnode += tnode
- node += pnode
- else:
- node += tnode
-
- def parse_signature(self, sig, signode):
- """Transform a C (or C++) signature into RST nodes."""
- # first try the function pointer signature regex, it's more specific
- m = c_funcptr_sig_re.match(sig)
- if m is None:
- m = c_sig_re.match(sig)
- if m is None:
- raise ValueError('no match')
- rettype, name, arglist, const = m.groups()
-
- signode += addnodes.desc_type('', '')
- self._parse_type(signode[-1], rettype)
- try:
- classname, funcname = name.split('::', 1)
- classname += '::'
- signode += addnodes.desc_addname(classname, classname)
- signode += addnodes.desc_name(funcname, funcname)
- # name (the full name) is still both parts
- except ValueError:
- signode += addnodes.desc_name(name, name)
- # clean up parentheses from canonical name
- m = c_funcptr_name_re.match(name)
- if m:
- name = m.group(1)
- if not arglist:
- if self.desctype == 'cfunction':
- # for functions, add an empty parameter list
- signode += addnodes.desc_parameterlist()
- if const:
- signode += addnodes.desc_addname(const, const)
- return name
-
- paramlist = addnodes.desc_parameterlist()
- arglist = arglist.replace('`', '').replace('\\ ', '') # remove markup
- # this messes up function pointer types, but not too badly ;)
- args = arglist.split(',')
- for arg in args:
- arg = arg.strip()
- param = addnodes.desc_parameter('', '', noemph=True)
- try:
- ctype, argname = arg.rsplit(' ', 1)
- except ValueError:
- # no argument name given, only the type
- self._parse_type(param, arg)
- else:
- self._parse_type(param, ctype)
- param += nodes.emphasis(' '+argname, ' '+argname)
- paramlist += param
- signode += paramlist
- if const:
- signode += addnodes.desc_addname(const, const)
- return name
-
- def get_index_text(self, name):
- if self.desctype == 'cfunction':
- return _('%s (C function)') % name
- elif self.desctype == 'cmember':
- return _('%s (C member)') % name
- elif self.desctype == 'cmacro':
- return _('%s (C macro)') % name
- elif self.desctype == 'ctype':
- return _('%s (C type)') % name
- elif self.desctype == 'cvar':
- return _('%s (C variable)') % name
- else:
- return ''
-
- def add_target_and_index(self, name, sig, signode):
- # note target
- if name not in self.state.document.ids:
- signode['names'].append(name)
- signode['ids'].append(name)
- signode['first'] = (not self.names)
- self.state.document.note_explicit_target(signode)
- self.env.note_descref(name, self.desctype, self.lineno)
-
- indextext = self.get_index_text(name)
- if indextext:
- self.indexnode['entries'].append(('single', indextext, name, name))
-
-
-class CmdoptionDesc(DescDirective):
- """
- Description of a command-line option (.. cmdoption).
- """
-
- def parse_signature(self, sig, signode):
- """Transform an option description into RST nodes."""
- count = 0
- firstname = ''
- for m in option_desc_re.finditer(sig):
- optname, args = m.groups()
- if count:
- signode += addnodes.desc_addname(', ', ', ')
- signode += addnodes.desc_name(optname, optname)
- signode += addnodes.desc_addname(args, args)
- if not count:
- firstname = optname
- count += 1
- if not firstname:
- raise ValueError
- return firstname
-
- def add_target_and_index(self, name, sig, signode):
- targetname = name.replace('/', '-')
- if self.env.currprogram:
- targetname = '-' + self.env.currprogram + targetname
- targetname = 'cmdoption' + targetname
- signode['ids'].append(targetname)
- self.state.document.note_explicit_target(signode)
- self.indexnode['entries'].append(
- ('pair', _('%scommand line option; %s') %
- ((self.env.currprogram and
- self.env.currprogram + ' ' or ''), sig),
- targetname, targetname))
- self.env.note_progoption(name, targetname)
-
-
-class GenericDesc(DescDirective):
- """
- A generic x-ref directive registered with Sphinx.add_description_unit().
- """
-
- def parse_signature(self, sig, signode):
- parse_node = additional_xref_types[self.desctype][2]
- if parse_node:
- name = parse_node(self.env, sig, signode)
- else:
- signode.clear()
- signode += addnodes.desc_name(sig, sig)
- # normalize whitespace like xfileref_role does
- name = ws_re.sub('', sig)
- return name
-
- def add_target_and_index(self, name, sig, signode):
- rolename, indextemplate = additional_xref_types[self.desctype][:2]
- targetname = '%s-%s' % (rolename, name)
- signode['ids'].append(targetname)
- self.state.document.note_explicit_target(signode)
- if indextemplate:
- indexentry = _(indextemplate) % (name,)
- indextype = 'single'
- colon = indexentry.find(':')
- if colon != -1:
- indextype = indexentry[:colon].strip()
- indexentry = indexentry[colon+1:].strip()
- self.indexnode['entries'].append((indextype, indexentry,
- targetname, targetname))
- self.env.note_reftarget(rolename, name, targetname)
-
-
-class Target(Directive):
- """
- Generic target for user-defined cross-reference types.
- """
-
- has_content = False
- required_arguments = 1
- optional_arguments = 0
- final_argument_whitespace = True
- option_spec = {}
-
- def run(self):
- env = self.state.document.settings.env
- rolename, indextemplate, foo = additional_xref_types[self.name]
- # normalize whitespace in fullname like xfileref_role does
- fullname = ws_re.sub('', self.arguments[0].strip())
- targetname = '%s-%s' % (rolename, fullname)
- node = nodes.target('', '', ids=[targetname])
- self.state.document.note_explicit_target(node)
- ret = [node]
- if indextemplate:
- indexentry = indextemplate % (fullname,)
- indextype = 'single'
- colon = indexentry.find(':')
- if colon != -1:
- indextype = indexentry[:colon].strip()
- indexentry = indexentry[colon+1:].strip()
- inode = addnodes.index(entries=[(indextype, indexentry,
- targetname, targetname)])
- ret.insert(0, inode)
- env.note_reftarget(rolename, fullname, targetname)
- return ret
-
-# Note: the target directive is not registered here, it is used by the
-# application when registering additional xref types.
-
-_ = lambda x: x
-
-# Generic cross-reference types; they can be registered in the application;
-# the directives are either desc_directive or target_directive.
-additional_xref_types = {
- # directive name: (role name, index text, function to parse the desc node)
- 'envvar': ('envvar', _('environment variable; %s'), None),
-}
-
-del _
-
-
-directives.register_directive('describe', directive_dwim(DescDirective))
-
-directives.register_directive('function', directive_dwim(ModulelevelDesc))
-directives.register_directive('data', directive_dwim(ModulelevelDesc))
-directives.register_directive('class', directive_dwim(ClasslikeDesc))
-directives.register_directive('exception', directive_dwim(ClasslikeDesc))
-directives.register_directive('method', directive_dwim(ClassmemberDesc))
-directives.register_directive('classmethod', directive_dwim(ClassmemberDesc))
-directives.register_directive('staticmethod', directive_dwim(ClassmemberDesc))
-directives.register_directive('attribute', directive_dwim(ClassmemberDesc))
-
-directives.register_directive('cfunction', directive_dwim(CDesc))
-directives.register_directive('cmember', directive_dwim(CDesc))
-directives.register_directive('cmacro', directive_dwim(CDesc))
-directives.register_directive('ctype', directive_dwim(CDesc))
-directives.register_directive('cvar', directive_dwim(CDesc))
-
-directives.register_directive('cmdoption', directive_dwim(CmdoptionDesc))
-directives.register_directive('envvar', directive_dwim(GenericDesc))
diff --git a/sphinx/directives/other.py b/sphinx/directives/other.py
index b11d6b2ab..138d10c8b 100644
--- a/sphinx/directives/other.py
+++ b/sphinx/directives/other.py
@@ -7,15 +7,15 @@
:license: BSD, see LICENSE for details.
"""
-import re
-
from docutils import nodes
-from docutils.parsers.rst import directives
+from docutils.parsers.rst import Directive, 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.compat import Directive, directive_dwim, make_admonition
+from sphinx.locale import pairindextypes, _
+from sphinx.util import url_re, docname_join
+from sphinx.util.nodes import explicit_title_re
+from sphinx.util.compat import make_admonition
+from sphinx.util.matching import patfilter
class TocTree(Directive):
@@ -33,6 +33,7 @@ class TocTree(Directive):
'glob': directives.flag,
'hidden': directives.flag,
'numbered': directives.flag,
+ 'titlesonly': directives.flag,
}
def run(self):
@@ -45,7 +46,6 @@ class TocTree(Directive):
# and title may be None if the document's title is to be used
entries = []
includefiles = []
- includetitles = {}
all_docnames = env.found_docs.copy()
# don't add the currently visited file in catch-all patterns
all_docnames.remove(env.docname)
@@ -54,7 +54,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,79 +97,13 @@ class TocTree(Directive):
subnode['glob'] = glob
subnode['hidden'] = 'hidden' in self.options
subnode['numbered'] = 'numbered' in self.options
- ret.append(subnode)
- return ret
-
-
-class Module(Directive):
- """
- Directive to mark description of a new module.
- """
-
- has_content = False
- required_arguments = 1
- optional_arguments = 0
- final_argument_whitespace = False
- option_spec = {
- 'platform': lambda x: x,
- 'synopsis': lambda x: x,
- 'noindex': directives.flag,
- 'deprecated': directives.flag,
- }
-
- def run(self):
- env = self.state.document.settings.env
- modname = self.arguments[0].strip()
- noindex = 'noindex' in self.options
- env.currmodule = modname
- env.note_module(modname, self.options.get('synopsis', ''),
- self.options.get('platform', ''),
- 'deprecated' in self.options)
- modulenode = addnodes.module()
- modulenode['modname'] = modname
- modulenode['synopsis'] = self.options.get('synopsis', '')
- targetnode = nodes.target('', '', ids=['module-' + modname], ismod=True)
- self.state.document.note_explicit_target(targetnode)
- ret = [modulenode, targetnode]
- if 'platform' in self.options:
- platform = self.options['platform']
- modulenode['platform'] = platform
- node = nodes.paragraph()
- node += nodes.emphasis('', _('Platforms: '))
- node += nodes.Text(platform, platform)
- ret.append(node)
- # the synopsis isn't printed; in fact, it is only used in the
- # modindex currently
- if not noindex:
- indextext = _('%s (module)') % modname
- inode = addnodes.index(entries=[('single', indextext,
- 'module-' + modname, modname)])
- ret.insert(0, inode)
+ subnode['titlesonly'] = 'titlesonly' in self.options
+ wrappernode = nodes.compound(classes=['toctree-wrapper'])
+ wrappernode.append(subnode)
+ ret.append(wrappernode)
return ret
-class CurrentModule(Directive):
- """
- This directive is just to tell Sphinx that we're documenting
- stuff in module foo, but links to module foo won't lead here.
- """
-
- has_content = False
- required_arguments = 1
- optional_arguments = 0
- final_argument_whitespace = False
- option_spec = {}
-
- def run(self):
- env = self.state.document.settings.env
- modname = self.arguments[0].strip()
- if modname == 'None':
- env.currmodule = None
- else:
- env.currmodule = modname
- return []
-
-
class Author(Directive):
"""
Directive to give the name of the author of the current document
@@ -193,6 +127,8 @@ class Author(Directive):
text = _('Section author: ')
elif self.name == 'moduleauthor':
text = _('Module author: ')
+ elif self.name == 'codeauthor':
+ text = _('Code author: ')
else:
text = _('Author: ')
emph += nodes.Text(text, text)
@@ -202,27 +138,6 @@ class Author(Directive):
return [para] + messages
-class Program(Directive):
- """
- Directive to name the program for which options are documented.
- """
-
- has_content = False
- required_arguments = 1
- optional_arguments = 0
- final_argument_whitespace = True
- option_spec = {}
-
- def run(self):
- env = self.state.document.settings.env
- program = ws_re.sub('-', self.arguments[0].strip())
- if program == 'None':
- env.currprogram = None
- else:
- env.currprogram = program
- return []
-
-
class Index(Directive):
"""
Directive to add entries to the index.
@@ -241,8 +156,7 @@ class Index(Directive):
def run(self):
arguments = self.arguments[0].split('\n')
env = self.state.document.settings.env
- targetid = 'index-%s' % env.index_num
- env.index_num += 1
+ targetid = 'index-%s' % env.new_serialno('index')
targetnode = nodes.target('', '', ids=[targetid])
self.state.document.note_explicit_target(targetnode)
indexnode = addnodes.index()
@@ -299,7 +213,12 @@ class VersionChange(Directive):
else:
ret = [node]
env = self.state.document.settings.env
- env.note_versionchange(node['type'], node['version'], node, self.lineno)
+ env.versionchanges.setdefault(node['version'], []).append(
+ (node['type'], env.temp_data['docname'], self.lineno,
+ # XXX: python domain specific
+ env.temp_data.get('py:module'),
+ env.temp_data.get('object'),
+ node.astext()))
return ret
@@ -329,66 +248,6 @@ class SeeAlso(Directive):
return ret
-token_re = re.compile('`([a-z_]+)`')
-
-def token_xrefs(text, env):
- retnodes = []
- pos = 0
- for m in token_re.finditer(text):
- if m.start() > pos:
- txt = text[pos:m.start()]
- retnodes.append(nodes.Text(txt, txt))
- refnode = addnodes.pending_xref(m.group(1))
- refnode['reftype'] = 'token'
- refnode['reftarget'] = m.group(1)
- refnode['modname'] = env.currmodule
- refnode['classname'] = env.currclass
- refnode += nodes.literal(m.group(1), m.group(1), classes=['xref'])
- retnodes.append(refnode)
- pos = m.end()
- if pos < len(text):
- retnodes.append(nodes.Text(text[pos:], text[pos:]))
- return retnodes
-
-class ProductionList(Directive):
- """
- Directive to list grammar productions.
- """
-
- has_content = False
- required_arguments = 1
- optional_arguments = 0
- final_argument_whitespace = True
- option_spec = {}
-
- def run(self):
- env = self.state.document.settings.env
- node = addnodes.productionlist()
- messages = []
- i = 0
-
- for rule in self.arguments[0].split('\n'):
- if i == 0 and ':' not in rule:
- # production group
- continue
- i += 1
- try:
- name, tokens = rule.split(':', 1)
- except ValueError:
- break
- subnode = addnodes.production()
- subnode['tokenname'] = name.strip()
- if subnode['tokenname']:
- idname = 'grammar-token-%s' % subnode['tokenname']
- if idname not in self.state.document.ids:
- subnode['ids'].append(idname)
- self.state.document.note_implicit_target(subnode, subnode)
- env.note_reftarget('token', subnode['tokenname'], idname)
- subnode.extend(token_xrefs(tokens, env))
- node.append(subnode)
- return [node] + messages
-
-
class TabularColumns(Directive):
"""
Directive to give an explicit tabulary column definition to LaTeX.
@@ -406,57 +265,6 @@ class TabularColumns(Directive):
return [node]
-class Glossary(Directive):
- """
- Directive to create a glossary with cross-reference targets
- for :term: roles.
- """
-
- has_content = True
- required_arguments = 0
- optional_arguments = 0
- final_argument_whitespace = False
- option_spec = {
- 'sorted': directives.flag,
- }
-
- def run(self):
- env = self.state.document.settings.env
- node = addnodes.glossary()
- node.document = self.state.document
- self.state.nested_parse(self.content, self.content_offset, node)
-
- # the content should be definition lists
- dls = [child for child in node
- if isinstance(child, nodes.definition_list)]
- # now, extract definition terms to enable cross-reference creation
- new_dl = nodes.definition_list()
- new_dl['classes'].append('glossary')
- items = []
- for dl in dls:
- for li in dl.children:
- if not li.children or not isinstance(li[0], nodes.term):
- continue
- termtext = li.children[0].astext()
- new_id = 'term-' + nodes.make_id(termtext)
- if new_id in env.gloss_entries:
- new_id = 'term-' + str(len(env.gloss_entries))
- env.gloss_entries.add(new_id)
- li[0]['names'].append(new_id)
- li[0]['ids'].append(new_id)
- env.note_reftarget('term', termtext.lower(), new_id)
- # add an index entry too
- indexnode = addnodes.index()
- indexnode['entries'] = [('single', termtext, new_id, termtext)]
- li.insert(0, indexnode)
- items.append((termtext, li))
- if 'sorted' in self.options:
- items.sort(key=lambda x: x[0].lower())
- new_dl.extend(item[1] for item in items)
- node.children = [new_dl]
- return [node]
-
-
class Centered(Directive):
"""
Directive to create a centered line of bold text.
@@ -559,36 +367,24 @@ class Only(Directive):
return [node]
-directives.register_directive('toctree', directive_dwim(TocTree))
-directives.register_directive('module', directive_dwim(Module))
-directives.register_directive('currentmodule', directive_dwim(CurrentModule))
-directives.register_directive('sectionauthor', directive_dwim(Author))
-directives.register_directive('moduleauthor', directive_dwim(Author))
-directives.register_directive('program', directive_dwim(Program))
-directives.register_directive('index', directive_dwim(Index))
-directives.register_directive('deprecated', directive_dwim(VersionChange))
-directives.register_directive('versionadded', directive_dwim(VersionChange))
-directives.register_directive('versionchanged', directive_dwim(VersionChange))
-directives.register_directive('seealso', directive_dwim(SeeAlso))
-directives.register_directive('productionlist', directive_dwim(ProductionList))
-directives.register_directive('tabularcolumns', directive_dwim(TabularColumns))
-directives.register_directive('glossary', directive_dwim(Glossary))
-directives.register_directive('centered', directive_dwim(Centered))
-directives.register_directive('acks', directive_dwim(Acks))
-directives.register_directive('hlist', directive_dwim(HList))
-directives.register_directive('only', directive_dwim(Only))
+directives.register_directive('toctree', TocTree)
+directives.register_directive('sectionauthor', Author)
+directives.register_directive('moduleauthor', Author)
+directives.register_directive('codeauthor', Author)
+directives.register_directive('index', Index)
+directives.register_directive('deprecated', VersionChange)
+directives.register_directive('versionadded', VersionChange)
+directives.register_directive('versionchanged', VersionChange)
+directives.register_directive('seealso', SeeAlso)
+directives.register_directive('tabularcolumns', TabularColumns)
+directives.register_directive('centered', Centered)
+directives.register_directive('acks', Acks)
+directives.register_directive('hlist', HList)
+directives.register_directive('only', Only)
# register the standard rst class directive under a different name
-
-try:
- # docutils 0.4
- from docutils.parsers.rst.directives.misc import class_directive
- directives.register_directive('cssclass', class_directive)
-except ImportError:
- try:
- # docutils 0.5
- from docutils.parsers.rst.directives.misc import Class
- directives.register_directive('cssclass', Class)
- except ImportError:
- # whatever :)
- pass
+from docutils.parsers.rst.directives.misc import Class
+# only for backwards compatibility now
+directives.register_directive('cssclass', Class)
+# new standard name when default-domain with "class" is in effect
+directives.register_directive('rst-class', Class)
diff --git a/sphinx/domains/__init__.py b/sphinx/domains/__init__.py
new file mode 100644
index 000000000..d133a8123
--- /dev/null
+++ b/sphinx/domains/__init__.py
@@ -0,0 +1,270 @@
+# -*- coding: utf-8 -*-
+"""
+ sphinx.domains
+ ~~~~~~~~~~~~~~
+
+ Support for domains, which are groupings of description directives
+ and roles describing e.g. constructs of one programming language.
+
+ :copyright: Copyright 2007-2010 by the Sphinx team, see AUTHORS.
+ :license: BSD, see LICENSE for details.
+"""
+
+from sphinx.errors import SphinxError
+from sphinx.locale import _
+
+
+class ObjType(object):
+ """
+ An ObjType is the description for a type of object that a domain can
+ document. In the object_types attribute of Domain subclasses, object type
+ names are mapped to instances of this class.
+
+ Constructor arguments:
+
+ - *lname*: localized name of the type (do not include domain name)
+ - *roles*: all the roles that can refer to an object of this type
+ - *attrs*: object attributes -- currently only "searchprio" is known,
+ which defines the object's priority in the full-text search index,
+ see :meth:`Domain.get_objects()`.
+ """
+
+ known_attrs = {
+ 'searchprio': 1,
+ }
+
+ def __init__(self, lname, *roles, **attrs):
+ self.lname = lname
+ self.roles = roles
+ self.attrs = self.known_attrs.copy()
+ self.attrs.update(attrs)
+
+
+class Index(object):
+ """
+ An Index is the description for a domain-specific index. To add an index to
+ a domain, subclass Index, overriding the three name attributes:
+
+ * `name` is an identifier used for generating file names.
+ * `localname` is the section title for the index.
+ * `shortname` is a short name for the index, for use in the relation bar in
+ HTML output. Can be empty to disable entries in the relation bar.
+
+ and providing a :meth:`generate()` method. Then, add the index class to
+ your domain's `indices` list. Extensions can add indices to existing
+ domains using :meth:`~sphinx.application.Sphinx.add_index_to_domain()`.
+ """
+
+ name = None
+ localname = None
+ shortname = None
+
+ def __init__(self, domain):
+ if self.name is None or self.localname is None:
+ raise SphinxError('Index subclass %s has no valid name or localname'
+ % self.__class__.__name__)
+ self.domain = domain
+
+ def generate(self, docnames=None):
+ """
+ Return entries for the index given by *name*. If *docnames* is given,
+ restrict to entries referring to these docnames.
+
+ The return value is a tuple of ``(content, collapse)``, where *collapse*
+ is a boolean that determines if sub-entries should start collapsed (for
+ output formats that support collapsing sub-entries).
+
+ *content* is a sequence of ``(letter, entries)`` tuples, where *letter*
+ is the "heading" for the given *entries*, usually the starting letter.
+
+ *entries* is a sequence of single entries, where a single entry is a
+ sequence ``[name, subtype, docname, anchor, extra, qualifier, descr]``.
+ The items in this sequence have the following meaning:
+
+ - `name` -- the name of the index entry to be displayed
+ - `subtype` -- sub-entry related type:
+ 0 -- normal entry
+ 1 -- entry with sub-entries
+ 2 -- sub-entry
+ - `docname` -- docname where the entry is located
+ - `anchor` -- anchor for the entry within `docname`
+ - `extra` -- extra info for the entry
+ - `qualifier` -- qualifier for the description
+ - `descr` -- description for the entry
+
+ Qualifier and description are not rendered e.g. in LaTeX output.
+ """
+ return []
+
+
+class Domain(object):
+ """
+ A Domain is meant to be a group of "object" description directives for
+ objects of a similar nature, and corresponding roles to create references to
+ them. Examples would be Python modules, classes, functions etc., elements
+ of a templating language, Sphinx roles and directives, etc.
+
+ Each domain has a separate storage for information about existing objects
+ and how to reference them in `self.data`, which must be a dictionary. It
+ also must implement several functions that expose the object information in
+ a uniform way to parts of Sphinx that allow the user to reference or search
+ for objects in a domain-agnostic way.
+
+ About `self.data`: since all object and cross-referencing information is
+ stored on a BuildEnvironment instance, the `domain.data` object is also
+ stored in the `env.domaindata` dict under the key `domain.name`. Before the
+ build process starts, every active domain is instantiated and given the
+ environment object; the `domaindata` dict must then either be nonexistent or
+ a dictionary whose 'version' key is equal to the domain class'
+ :attr:`data_version` attribute. Otherwise, `IOError` is raised and the
+ pickled environment is discarded.
+ """
+
+ #: domain name: should be short, but unique
+ name = ''
+ #: domain label: longer, more descriptive (used in messages)
+ label = ''
+ #: type (usually directive) name -> ObjType instance
+ object_types = {}
+ #: directive name -> directive class
+ directives = {}
+ #: role name -> role callable
+ roles = {}
+ #: a list of Index subclasses
+ indices = []
+
+ #: data value for a fresh environment
+ initial_data = {}
+ #: data version, bump this when the format of `self.data` changes
+ data_version = 0
+
+ def __init__(self, env):
+ self.env = env
+ if self.name not in env.domaindata:
+ assert isinstance(self.initial_data, dict)
+ new_data = self.initial_data.copy()
+ new_data['version'] = self.data_version
+ self.data = env.domaindata[self.name] = new_data
+ else:
+ self.data = env.domaindata[self.name]
+ if self.data['version'] != self.data_version:
+ raise IOError('data of %r domain out of date' % self.label)
+ self._role_cache = {}
+ self._directive_cache = {}
+ self._role2type = {}
+ for name, obj in self.object_types.iteritems():
+ for rolename in obj.roles:
+ self._role2type.setdefault(rolename, []).append(name)
+ self.objtypes_for_role = self._role2type.get
+
+ def role(self, name):
+ """
+ Return a role adapter function that always gives the registered
+ role its full name ('domain:name') as the first argument.
+ """
+ if name in self._role_cache:
+ return self._role_cache[name]
+ if name not in self.roles:
+ return None
+ fullname = '%s:%s' % (self.name, name)
+ def role_adapter(typ, rawtext, text, lineno, inliner,
+ options={}, content=[]):
+ return self.roles[name](fullname, rawtext, text, lineno,
+ inliner, options, content)
+ self._role_cache[name] = role_adapter
+ return role_adapter
+
+ def directive(self, name):
+ """
+ Return a directive adapter class that always gives the registered
+ directive its full name ('domain:name') as ``self.name``.
+ """
+ if name in self._directive_cache:
+ return self._directive_cache[name]
+ if name not in self.directives:
+ return None
+ fullname = '%s:%s' % (self.name, name)
+ BaseDirective = self.directives[name]
+ class DirectiveAdapter(BaseDirective):
+ def run(self):
+ self.name = fullname
+ return BaseDirective.run(self)
+ self._directive_cache[name] = DirectiveAdapter
+ return DirectiveAdapter
+
+ # methods that should be overwritten
+
+ def clear_doc(self, docname):
+ """
+ Remove traces of a document in the domain-specific inventories.
+ """
+ pass
+
+ def process_doc(self, env, docname, document):
+ """
+ Process a document after it is read by the environment.
+ """
+ pass
+
+ def resolve_xref(self, env, fromdocname, builder,
+ typ, target, node, contnode):
+ """
+ Resolve the ``pending_xref`` *node* with the given *typ* and *target*.
+
+ This method should return a new node, to replace the xref node,
+ containing the *contnode* which is the markup content of the
+ cross-reference.
+
+ If no resolution can be found, None can be returned; the xref node will
+ then given to the 'missing-reference' event, and if that yields no
+ resolution, replaced by *contnode*.
+
+ The method can also raise :exc:`sphinx.environment.NoUri` to suppress
+ the 'missing-reference' event being emitted.
+ """
+ pass
+
+ def get_objects(self):
+ """
+ Return an iterable of "object descriptions", which are tuples with
+ five items:
+
+ * `name` -- fully qualified name
+ * `dispname` -- name to display when searching/linking
+ * `type` -- object type, a key in ``self.object_types``
+ * `docname` -- the document where it is to be found
+ * `anchor` -- the anchor name for the object
+ * `priority` -- how "important" the object is (determines placement
+ in search results)
+
+ - 1: default priority (placed before full-text matches)
+ - 0: object is important (placed before default-priority objects)
+ - 2: object is unimportant (placed after full-text matches)
+ - -1: object should not show up in search at all
+ """
+ return []
+
+ def get_type_name(self, type, primary=False):
+ """
+ Return full name for given ObjType.
+ """
+ if primary:
+ return type.lname
+ return _('%s %s') % (self.label, type.lname)
+
+
+from sphinx.domains.c import CDomain
+from sphinx.domains.cpp import CPPDomain
+from sphinx.domains.std import StandardDomain
+from sphinx.domains.python import PythonDomain
+from sphinx.domains.javascript import JavaScriptDomain
+from sphinx.domains.rst import ReSTDomain
+
+BUILTIN_DOMAINS = {
+ 'std': StandardDomain,
+ 'py': PythonDomain,
+ 'c': CDomain,
+ 'cpp': CPPDomain,
+ 'js': JavaScriptDomain,
+ 'rst': ReSTDomain,
+}
diff --git a/sphinx/domains/c.py b/sphinx/domains/c.py
new file mode 100644
index 000000000..c49dc2843
--- /dev/null
+++ b/sphinx/domains/c.py
@@ -0,0 +1,213 @@
+# -*- coding: utf-8 -*-
+"""
+ sphinx.domains.c
+ ~~~~~~~~~~~~~~~~
+
+ The C language domain.
+
+ :copyright: Copyright 2007-2010 by the Sphinx team, see AUTHORS.
+ :license: BSD, see LICENSE for details.
+"""
+
+import re
+import string
+
+from docutils import nodes
+
+from sphinx import addnodes
+from sphinx.roles import XRefRole
+from sphinx.locale import l_, _
+from sphinx.domains import Domain, ObjType
+from sphinx.directives import ObjectDescription
+from sphinx.util.nodes import make_refnode
+from sphinx.util.docfields import Field, TypedField
+
+
+# RE to split at word boundaries
+wsplit_re = re.compile(r'(\W+)')
+
+# REs for C signatures
+c_sig_re = re.compile(
+ r'''^([^(]*?) # return type
+ ([\w:.]+) \s* # thing name (colon allowed for C++)
+ (?: \((.*)\) )? # optionally arguments
+ (\s+const)? $ # const specifier
+ ''', re.VERBOSE)
+c_funcptr_sig_re = re.compile(
+ r'''^([^(]+?) # return type
+ (\( [^()]+ \)) \s* # name in parentheses
+ \( (.*) \) # arguments
+ (\s+const)? $ # const specifier
+ ''', re.VERBOSE)
+c_funcptr_name_re = re.compile(r'^\(\s*\*\s*(.*?)\s*\)$')
+
+
+class CObject(ObjectDescription):
+ """
+ Description of a C language object.
+ """
+
+ doc_field_types = [
+ TypedField('parameter', label=l_('Parameters'),
+ names=('param', 'parameter', 'arg', 'argument'),
+ typerolename='type', typenames=('type',)),
+ Field('returnvalue', label=l_('Returns'), has_arg=False,
+ names=('returns', 'return')),
+ Field('returntype', label=l_('Return type'), has_arg=False,
+ names=('rtype',)),
+ ]
+
+ # These C types aren't described anywhere, so don't try to create
+ # a cross-reference to them
+ stopwords = set(('const', 'void', 'char', 'int', 'long', 'FILE', 'struct'))
+
+ def _parse_type(self, node, ctype):
+ # add cross-ref nodes for all words
+ for part in filter(None, wsplit_re.split(ctype)):
+ tnode = nodes.Text(part, part)
+ if part[0] in string.ascii_letters+'_' and \
+ part not in self.stopwords:
+ pnode = addnodes.pending_xref(
+ '', refdomain='c', reftype='type', reftarget=part,
+ modname=None, classname=None)
+ pnode += tnode
+ node += pnode
+ else:
+ node += tnode
+
+ def handle_signature(self, sig, signode):
+ """Transform a C signature into RST nodes."""
+ # first try the function pointer signature regex, it's more specific
+ m = c_funcptr_sig_re.match(sig)
+ if m is None:
+ m = c_sig_re.match(sig)
+ if m is None:
+ raise ValueError('no match')
+ rettype, name, arglist, const = m.groups()
+
+ signode += addnodes.desc_type('', '')
+ self._parse_type(signode[-1], rettype)
+ try:
+ classname, funcname = name.split('::', 1)
+ classname += '::'
+ signode += addnodes.desc_addname(classname, classname)
+ signode += addnodes.desc_name(funcname, funcname)
+ # name (the full name) is still both parts
+ except ValueError:
+ signode += addnodes.desc_name(name, name)
+ # clean up parentheses from canonical name
+ m = c_funcptr_name_re.match(name)
+ if m:
+ name = m.group(1)
+ if not arglist:
+ if self.objtype == 'function':
+ # for functions, add an empty parameter list
+ signode += addnodes.desc_parameterlist()
+ if const:
+ signode += addnodes.desc_addname(const, const)
+ return name
+
+ paramlist = addnodes.desc_parameterlist()
+ arglist = arglist.replace('`', '').replace('\\ ', '') # remove markup
+ # this messes up function pointer types, but not too badly ;)
+ args = arglist.split(',')
+ for arg in args:
+ arg = arg.strip()
+ param = addnodes.desc_parameter('', '', noemph=True)
+ try:
+ ctype, argname = arg.rsplit(' ', 1)
+ except ValueError:
+ # no argument name given, only the type
+ self._parse_type(param, arg)
+ else:
+ self._parse_type(param, ctype)
+ param += nodes.emphasis(' '+argname, ' '+argname)
+ paramlist += param
+ signode += paramlist
+ if const:
+ signode += addnodes.desc_addname(const, const)
+ return name
+
+ def get_index_text(self, name):
+ if self.objtype == 'function':
+ return _('%s (C function)') % name
+ elif self.objtype == 'member':
+ return _('%s (C member)') % name
+ elif self.objtype == 'macro':
+ return _('%s (C macro)') % name
+ elif self.objtype == 'type':
+ return _('%s (C type)') % name
+ elif self.objtype == 'var':
+ return _('%s (C variable)') % name
+ else:
+ return ''
+
+ def add_target_and_index(self, name, sig, signode):
+ # note target
+ if name not in self.state.document.ids:
+ signode['names'].append(name)
+ signode['ids'].append(name)
+ signode['first'] = (not self.names)
+ self.state.document.note_explicit_target(signode)
+ inv = self.env.domaindata['c']['objects']
+ if name in inv:
+ self.env.warn(
+ self.env.docname,
+ 'duplicate C object description of %s, ' % name +
+ 'other instance in ' + self.env.doc2path(inv[name][0]),
+ self.lineno)
+ inv[name] = (self.env.docname, self.objtype)
+
+ indextext = self.get_index_text(name)
+ if indextext:
+ self.indexnode['entries'].append(('single', indextext, name, name))
+
+
+class CDomain(Domain):
+ """C language domain."""
+ name = 'c'
+ label = 'C'
+ object_types = {
+ 'function': ObjType(l_('function'), 'func'),
+ 'member': ObjType(l_('member'), 'member'),
+ 'macro': ObjType(l_('macro'), 'macro'),
+ 'type': ObjType(l_('type'), 'type'),
+ 'var': ObjType(l_('variable'), 'data'),
+ }
+
+ directives = {
+ 'function': CObject,
+ 'member': CObject,
+ 'macro': CObject,
+ 'type': CObject,
+ 'var': CObject,
+ }
+ roles = {
+ 'func' : XRefRole(fix_parens=True),
+ 'member': XRefRole(),
+ 'macro': XRefRole(),
+ 'data': XRefRole(),
+ 'type': XRefRole(),
+ }
+ initial_data = {
+ 'objects': {}, # fullname -> docname, objtype
+ }
+
+ def clear_doc(self, docname):
+ for fullname, (fn, _) in self.data['objects'].items():
+ if fn == docname:
+ del self.data['objects'][fullname]
+
+ def resolve_xref(self, env, fromdocname, builder,
+ typ, target, node, contnode):
+ # strip pointer asterisk
+ target = target.rstrip(' *')
+ if target not in self.data['objects']:
+ return None
+ obj = self.data['objects'][target]
+ return make_refnode(builder, fromdocname, obj[0], target,
+ contnode, target)
+
+ def get_objects(self):
+ for refname, (docname, type) in self.data['objects'].iteritems():
+ yield (refname, refname, type, docname, refname, 1)
diff --git a/sphinx/domains/cpp.py b/sphinx/domains/cpp.py
new file mode 100644
index 000000000..62dec4ac8
--- /dev/null
+++ b/sphinx/domains/cpp.py
@@ -0,0 +1,1096 @@
+# -*- coding: utf-8 -*-
+"""
+ sphinx.domains.cpp
+ ~~~~~~~~~~~~~~~~~~
+
+ The C++ language domain.
+
+ :copyright: Copyright 2007-2010 by the Sphinx team, see AUTHORS.
+ :license: BSD, see LICENSE for details.
+"""
+
+import re
+from copy import deepcopy
+
+from docutils import nodes
+
+from sphinx import addnodes
+from sphinx.roles import XRefRole
+from sphinx.locale import l_, _
+from sphinx.domains import Domain, ObjType
+from sphinx.directives import ObjectDescription
+from sphinx.util.nodes import make_refnode
+from sphinx.util.compat import Directive
+from sphinx.util.docfields import TypedField
+
+
+_identifier_re = re.compile(r'\b(~?[a-zA-Z_][a-zA-Z0-9_]*)\b')
+_whitespace_re = re.compile(r'\s+(?u)')
+_string_re = re.compile(r"[LuU8]?('([^'\\]*(?:\\.[^'\\]*)*)'"
+ r'|"([^"\\]*(?:\\.[^"\\]*)*)")', re.S)
+_visibility_re = re.compile(r'\b(public|private|protected)\b')
+_operator_re = re.compile(r'''(?x)
+ \[\s*\]
+ | \(\s*\)
+ | [!<>=/*%+|&^-]=?
+ | \+\+ | --
+ | (<<|>>)=? | ~ | && | \| | \|\|
+ | ->\*? | \,
+''')
+
+_id_shortwords = {
+ 'char': 'c',
+ 'signed char': 'c',
+ 'unsigned char': 'C',
+ 'int': 'i',
+ 'signed int': 'i',
+ 'unsigned int': 'U',
+ 'long': 'l',
+ 'signed long': 'l',
+ 'unsigned long': 'L',
+ 'bool': 'b',
+ 'size_t': 's',
+ 'std::string': 'ss',
+ 'std::ostream': 'os',
+ 'std::istream': 'is',
+ 'std::iostream': 'ios',
+ 'std::vector': 'v',
+ 'std::map': 'm',
+ 'operator[]': 'subscript-operator',
+ 'operator()': 'call-operator',
+ 'operator!': 'not-operator',
+ 'operator<': 'lt-operator',
+ 'operator<=': 'lte-operator',
+ 'operator>': 'gt-operator',
+ 'operator>=': 'gte-operator',
+ 'operator=': 'assign-operator',
+ 'operator/': 'div-operator',
+ 'operator*': 'mul-operator',
+ 'operator%': 'mod-operator',
+ 'operator+': 'add-operator',
+ 'operator-': 'sub-operator',
+ 'operator|': 'or-operator',
+ 'operator&': 'and-operator',
+ 'operator^': 'xor-operator',
+ 'operator&&': 'sand-operator',
+ 'operator||': 'sor-operator',
+ 'operator==': 'eq-operator',
+ 'operator!=': 'neq-operator',
+ 'operator<<': 'lshift-operator',
+ 'operator>>': 'rshift-operator',
+ 'operator-=': 'sub-assign-operator',
+ 'operator+=': 'add-assign-operator',
+ 'operator*-': 'mul-assign-operator',
+ 'operator/=': 'div-assign-operator',
+ 'operator%=': 'mod-assign-operator',
+ 'operator&=': 'and-assign-operator',
+ 'operator|=': 'or-assign-operator',
+ 'operator<<=': 'lshift-assign-operator',
+ 'operator>>=': 'rshift-assign-operator',
+ 'operator^=': 'xor-assign-operator',
+ 'operator,': 'comma-operator',
+ 'operator->': 'pointer-operator',
+ 'operator->*': 'pointer-by-pointer-operator',
+ 'operator~': 'inv-operator',
+ 'operator++': 'inc-operator',
+ 'operator--': 'dec-operator',
+ 'operator new': 'new-operator',
+ 'operator new[]': 'new-array-operator',
+ 'operator delete': 'delete-operator',
+ 'operator delete[]': 'delete-array-operator'
+}
+
+
+class DefinitionError(Exception):
+
+ def __init__(self, description):
+ self.description = description
+
+ def __unicode__(self):
+ return self.description
+
+ def __str__(self):
+ return unicode(self.encode('utf-8'))
+
+
+class DefExpr(object):
+
+ def __unicode__(self):
+ raise NotImplementedError()
+
+ def __eq__(self, other):
+ if type(self) is not type(other):
+ return False
+ try:
+ for key, value in self.__dict__.iteritems():
+ if value != getattr(other, value):
+ return False
+ except AttributeError:
+ return False
+ return True
+
+ def __ne__(self, other):
+ return not self.__eq__(other)
+
+ def clone(self):
+ """Close a definition expression node"""
+ return deepcopy(self)
+
+ def get_id(self):
+ """Returns the id for the node"""
+ return u''
+
+ def get_name(self):
+ """Returns the name. Returns either `None` or a node with
+ a name you might call :meth:`split_owner` on.
+ """
+ return None
+
+ def split_owner(self):
+ """Nodes returned by :meth:`get_name` can split off their
+ owning parent. This function returns the owner and the
+ name as a tuple of two items. If a node does not support
+ it, :exc:`NotImplementedError` is raised.
+ """
+ raise NotImplementedError()
+
+ def prefix(self, prefix):
+ """Prefixes a name node (a node returned by :meth:`get_name`)."""
+ raise NotImplementedError()
+
+ def __str__(self):
+ return unicode(self).encode('utf-8')
+
+ def __repr__(self):
+ return '<defexpr %s>' % self
+
+
+class PrimaryDefExpr(DefExpr):
+
+ def get_name(self):
+ return self
+
+ def split_owner(self):
+ return None, self
+
+ def prefix(self, prefix):
+ if isinstance(prefix, PathDefExpr):
+ prefix = prefix.clone()
+ prefix.path.append(self)
+ return prefix
+ return PathDefExpr([prefix, self])
+
+
+class NameDefExpr(PrimaryDefExpr):
+
+ def __init__(self, name):
+ self.name = name
+
+ def get_id(self):
+ name = _id_shortwords.get(self.name)
+ if name is not None:
+ return name
+ return self.name.replace(u' ', u'-')
+
+ def __unicode__(self):
+ return unicode(self.name)
+
+
+class PathDefExpr(PrimaryDefExpr):
+
+ def __init__(self, parts):
+ self.path = parts
+
+ def get_id(self):
+ rv = u'::'.join(x.get_id() for x in self.path)
+ return _id_shortwords.get(rv, rv)
+
+ def split_owner(self):
+ if len(self.path) > 1:
+ return PathDefExpr(self.path[:-1]), self.path[-1]
+ return None, self
+
+ def prefix(self, prefix):
+ if isinstance(prefix, PathDefExpr):
+ prefix = prefix.clone()
+ prefix.path.extend(self.path)
+ return prefix
+ return PathDefExpr([prefix] + self.path)
+
+ def __unicode__(self):
+ return u'::'.join(map(unicode, self.path))
+
+
+class TemplateDefExpr(PrimaryDefExpr):
+
+ def __init__(self, typename, args):
+ self.typename = typename
+ self.args = args
+
+ def split_owner(self):
+ owner, typename = self.typename.split_owner()
+ return owner, TemplateDefExpr(typename, self.args)
+
+ def get_id(self):
+ return u'%s:%s:' % (self.typename.get_id(),
+ u'.'.join(x.get_id() for x in self.args))
+
+ def __unicode__(self):
+ return u'%s<%s>' % (self.typename, u', '.join(map(unicode, self.args)))
+
+
+class WrappingDefExpr(DefExpr):
+
+ def __init__(self, typename):
+ self.typename = typename
+
+ def get_name(self):
+ return self.typename.get_name()
+
+
+class ModifierDefExpr(WrappingDefExpr):
+
+ def __init__(self, typename, modifiers):
+ WrappingDefExpr.__init__(self, typename)
+ self.modifiers = modifiers
+
+ def get_id(self):
+ pieces = [_id_shortwords.get(unicode(x), unicode(x))
+ for x in self.modifiers]
+ pieces.append(self.typename.get_id())
+ return u'-'.join(pieces)
+
+ def __unicode__(self):
+ return u' '.join(map(unicode, list(self.modifiers) + [self.typename]))
+
+
+class PtrDefExpr(WrappingDefExpr):
+
+ def get_id(self):
+ return self.typename.get_id() + u'P'
+
+ def __unicode__(self):
+ return u'%s*' % self.typename
+
+
+class RefDefExpr(WrappingDefExpr):
+
+ def get_id(self):
+ return self.typename.get_id() + u'R'
+
+ def __unicode__(self):
+ return u'%s&' % self.typename
+
+
+class ConstDefExpr(WrappingDefExpr):
+
+ def __init__(self, typename, prefix=False):
+ WrappingDefExpr.__init__(self, typename)
+ self.prefix = prefix
+
+ def get_id(self):
+ return self.typename.get_id() + u'C'
+
+ def __unicode__(self):
+ return (self.prefix and u'const %s' or u'%s const') % self.typename
+
+
+class CastOpDefExpr(PrimaryDefExpr):
+
+ def __init__(self, typename):
+ self.typename = typename
+
+ def get_id(self):
+ return u'castto-%s-operator' % self.typename.get_id()
+
+ def __unicode__(self):
+ return u'operator %s' % self.typename
+
+
+class ArgumentDefExpr(DefExpr):
+
+ def __init__(self, type, name, default=None):
+ self.name = name
+ self.type = type
+ self.default = default
+
+ def get_name(self):
+ return self.name.get_name()
+
+ def get_id(self):
+ return self.type.get_id()
+
+ def __unicode__(self):
+ return (self.type is not None and u'%s %s' % (self.type, self.name)
+ or unicode(self.name)) + (self.default is not None and
+ u'=%s' % self.default or u'')
+
+
+class NamedDefExpr(DefExpr):
+
+ def __init__(self, name, visibility, static):
+ self.name = name
+ self.visibility = visibility
+ self.static = static
+
+ def get_name(self):
+ return self.name.get_name()
+
+ def get_modifiers(self):
+ rv = []
+ if self.visibility != 'public':
+ rv.append(self.visibility)
+ if self.static:
+ rv.append(u'static')
+ return rv
+
+
+class TypeObjDefExpr(NamedDefExpr):
+
+ def __init__(self, name, visibility, static, typename):
+ NamedDefExpr.__init__(self, name, visibility, static)
+ self.typename = typename
+
+ def get_id(self):
+ if self.typename is None:
+ return self.name.get_id()
+ return u'%s__%s' % (self.name.get_id(), self.typename.get_id())
+
+ def __unicode__(self):
+ buf = self.get_modifiers()
+ if self.typename is None:
+ buf.append(unicode(self.name))
+ else:
+ buf.extend(map(unicode, (self.typename, self.name)))
+ return u' '.join(buf)
+
+
+class MemberObjDefExpr(NamedDefExpr):
+
+ def __init__(self, name, visibility, static, typename, value):
+ NamedDefExpr.__init__(self, name, visibility, static)
+ self.typename = typename
+ self.value = value
+
+ def get_id(self):
+ return u'%s__%s' % (self.name.get_id(), self.typename.get_id())
+
+ def __unicode__(self):
+ buf = self.get_modifiers()
+ buf.append(u'%s %s' % (self.typename, self.name))
+ if self.value is not None:
+ buf.append(u'= %s' % self.value)
+ return u' '.join(buf)
+
+
+class FuncDefExpr(NamedDefExpr):
+
+ def __init__(self, name, visibility, static, explicit, rv,
+ signature, const, pure_virtual):
+ NamedDefExpr.__init__(self, name, visibility, static)
+ self.rv = rv
+ self.signature = signature
+ self.explicit = explicit
+ self.const = const
+ self.pure_virtual = pure_virtual
+
+ def get_id(self):
+ return u'%s%s%s' % (
+ self.name.get_id(),
+ self.signature and u'__' +
+ u'.'.join(x.get_id() for x in self.signature) or u'',
+ self.const and u'C' or u''
+ )
+
+ def __unicode__(self):
+ buf = self.get_modifiers()
+ if self.explicit:
+ buf.append(u'explicit')
+ if self.rv is not None:
+ buf.append(unicode(self.rv))
+ buf.append(u'%s(%s)' % (self.name, u', '.join(
+ map(unicode, self.signature))))
+ if self.const:
+ buf.append(u'const')
+ if self.pure_virtual:
+ buf.append(u'= 0')
+ return u' '.join(buf)
+
+
+class ClassDefExpr(NamedDefExpr):
+
+ def __init__(self, name, visibility, static):
+ NamedDefExpr.__init__(self, name, visibility, static)
+
+ def get_id(self):
+ return self.name.get_id()
+
+ def __unicode__(self):
+ buf = self.get_modifiers()
+ buf.append(unicode(self.name))
+ return u' '.join(buf)
+
+
+class DefinitionParser(object):
+
+ # mapping of valid type modifiers. if the set is None it means
+ # the modifier can prefix all types, otherwise only the types
+ # (actually more keywords) in the set. Also check
+ # _guess_typename when changing this.
+ _modifiers = {
+ 'volatile': None,
+ 'register': None,
+ 'mutable': None,
+ 'const': None,
+ 'typename': None,
+ 'unsigned': set(('char', 'int', 'long')),
+ 'signed': set(('char', 'int', 'long')),
+ 'short': set(('int', 'short')),
+ 'long': set(('int', 'long', 'double'))
+ }
+
+ def __init__(self, definition):
+ self.definition = definition.strip()
+ self.pos = 0
+ self.end = len(self.definition)
+ self.last_match = None
+ self._previous_state = (0, None)
+
+ def fail(self, msg):
+ raise DefinitionError('Invalid definition: %s [error at %d]\n %s' %
+ (msg, self.pos, self.definition))
+
+ def match(self, regex):
+ match = regex.match(self.definition, self.pos)
+ if match is not None:
+ self._previous_state = (self.pos, self.last_match)
+ self.pos = match.end()
+ self.last_match = match
+ return True
+ return False
+
+ def backout(self):
+ self.pos, self.last_match = self._previous_state
+
+ def skip_string(self, string):
+ strlen = len(string)
+ if self.definition[self.pos:self.pos + strlen] == string:
+ self.pos += strlen
+ return True
+ return False
+
+ def skip_word(self, word):
+ return self.match(re.compile(r'\b%s\b' % re.escape(word)))
+
+ def skip_ws(self):
+ return self.match(_whitespace_re)
+
+ @property
+ def eof(self):
+ return self.pos >= self.end
+
+ @property
+ def current_char(self):
+ try:
+ return self.definition[self.pos]
+ except IndexError:
+ return 'EOF'
+
+ @property
+ def matched_text(self):
+ if self.last_match is not None:
+ return self.last_match.group()
+
+ def _parse_operator(self):
+ self.skip_ws()
+ # thank god, a regular operator definition
+ if self.match(_operator_re):
+ return NameDefExpr('operator' +
+ _whitespace_re.sub('', self.matched_text))
+
+ # new/delete operator?
+ for allocop in 'new', 'delete':
+ if not self.skip_word(allocop):
+ continue
+ self.skip_ws()
+ if self.skip_string('['):
+ self.skip_ws()
+ if not self.skip_string(']'):
+ self.fail('expected "]" for ' + allocop)
+ allocop += '[]'
+ return NameDefExpr('operator ' + allocop)
+
+ # oh well, looks like a cast operator definition.
+ # In that case, eat another type.
+ type = self._parse_type()
+ return CastOpDefExpr(type)
+
+ def _parse_name(self):
+ if not self.match(_identifier_re):
+ self.fail('expected name')
+ identifier = self.matched_text
+
+ # strictly speaking, operators are not regular identifiers
+ # but because operator is a keyword, it might not be used
+ # for variable names anyways, so we can safely parse the
+ # operator here as identifier
+ if identifier == 'operator':
+ return self._parse_operator()
+
+ return NameDefExpr(identifier)
+
+ def _guess_typename(self, path):
+ if not path:
+ return [], 'int'
+ # for the long type, we don't want the int in there
+ if 'long' in path:
+ path = [x for x in path if x != 'int']
+ # remove one long
+ path.remove('long')
+ return path, 'long'
+ if path[-1] in ('int', 'char'):
+ return path[:-1], path[-1]
+ return path, 'int'
+
+ def _attach_crefptr(self, expr, is_const=False):
+ if is_const:
+ expr = ConstDefExpr(expr, prefix=True)
+ while 1:
+ self.skip_ws()
+ if self.skip_word('const'):
+ expr = ConstDefExpr(expr)
+ elif self.skip_string('*'):
+ expr = PtrDefExpr(expr)
+ elif self.skip_string('&'):
+ expr = RefDefExpr(expr)
+ else:
+ return expr
+
+ def _peek_const(self, path):
+ try:
+ path.remove('const')
+ return True
+ except ValueError:
+ return False
+
+ def _parse_builtin(self, modifier):
+ path = [modifier]
+ following = self._modifiers[modifier]
+ while 1:
+ self.skip_ws()
+ if not self.match(_identifier_re):
+ break
+ identifier = self.matched_text
+ if identifier in following:
+ path.append(identifier)
+ following = self._modifiers[modifier]
+ assert following
+ else:
+ self.backout()
+ break
+
+ is_const = self._peek_const(path)
+ modifiers, typename = self._guess_typename(path)
+ rv = ModifierDefExpr(NameDefExpr(typename), modifiers)
+ return self._attach_crefptr(rv, is_const)
+
+ def _parse_type_expr(self):
+ typename = self._parse_name()
+ self.skip_ws()
+ if not self.skip_string('<'):
+ return typename
+
+ args = []
+ while 1:
+ self.skip_ws()
+ if self.skip_string('>'):
+ break
+ if args:
+ if not self.skip_string(','):
+ self.fail('"," or ">" in template expected')
+ self.skip_ws()
+ args.append(self._parse_type(True))
+ return TemplateDefExpr(typename, args)
+
+ def _parse_type(self, in_template=False):
+ self.skip_ws()
+ result = []
+ modifiers = []
+
+ # if there is a leading :: or not, we don't care because we
+ # treat them exactly the same. Buf *if* there is one, we
+ # don't have to check for type modifiers
+ if not self.skip_string('::'):
+ self.skip_ws()
+ while self.match(_identifier_re):
+ modifier = self.matched_text
+ if modifier in self._modifiers:
+ following = self._modifiers[modifier]
+ # if the set is not none, there is a limited set
+ # of types that might follow. It is technically
+ # impossible for a template to follow, so what
+ # we do is go to a different function that just
+ # eats types
+ if following is not None:
+ return self._parse_builtin(modifier)
+ modifiers.append(modifier)
+ else:
+ self.backout()
+ break
+
+ while 1:
+ self.skip_ws()
+ if (in_template and self.current_char in ',>') or \
+ (result and not self.skip_string('::')) or \
+ self.eof:
+ break
+ result.append(self._parse_type_expr())
+
+ if not result:
+ self.fail('expected type')
+ if len(result) == 1:
+ rv = result[0]
+ else:
+ rv = PathDefExpr(result)
+ is_const = self._peek_const(modifiers)
+ if modifiers:
+ rv = ModifierDefExpr(rv, modifiers)
+ return self._attach_crefptr(rv, is_const)
+
+ def _parse_default_expr(self):
+ self.skip_ws()
+ if self.match(_string_re):
+ return self.matched_text
+ idx1 = self.definition.find(',', self.pos)
+ idx2 = self.definition.find(')', self.pos)
+ if idx1 < 0:
+ idx = idx2
+ elif idx2 < 0:
+ idx = idx1
+ else:
+ idx = min(idx1, idx2)
+ if idx < 0:
+ self.fail('unexpected end in default expression')
+ rv = self.definition[self.pos:idx]
+ self.pos = idx
+ return rv
+
+ def _parse_signature(self):
+ self.skip_ws()
+ if not self.skip_string('('):
+ self.fail('expected parentheses for function')
+
+ args = []
+ while 1:
+ self.skip_ws()
+ if self.eof:
+ self.fail('missing closing parentheses')
+ if self.skip_string(')'):
+ break
+ if args:
+ if not self.skip_string(','):
+ self.fail('expected comma between arguments')
+ self.skip_ws()
+
+ argname = self._parse_type()
+ argtype = default = None
+ self.skip_ws()
+ if self.skip_string('='):
+ self.pos += 1
+ default = self._parse_default_expr()
+ elif self.current_char not in ',)':
+ argtype = argname
+ argname = self._parse_name()
+ self.skip_ws()
+ if self.skip_string('='):
+ default = self._parse_default_expr()
+
+ args.append(ArgumentDefExpr(argtype, argname, default))
+ self.skip_ws()
+ const = self.skip_word('const')
+ if const:
+ self.skip_ws()
+ if self.skip_string('='):
+ self.skip_ws()
+ if not (self.skip_string('0') or \
+ self.skip_word('NULL') or \
+ self.skip_word('nullptr')):
+ self.fail('pure virtual functions must be defined with '
+ 'either 0, NULL or nullptr, other macros are '
+ 'not allowed')
+ pure_virtual = True
+ else:
+ pure_virtual = False
+ return args, const, pure_virtual
+
+ def _parse_visibility_static(self):
+ visibility = 'public'
+ if self.match(_visibility_re):
+ visibility = self.matched_text
+ static = self.skip_word('static')
+ return visibility, static
+
+ def parse_type(self):
+ return self._parse_type()
+
+ def parse_type_object(self):
+ visibility, static = self._parse_visibility_static()
+ typename = self._parse_type()
+ self.skip_ws()
+ if not self.eof:
+ name = self._parse_type()
+ else:
+ name = typename
+ typename = None
+ return TypeObjDefExpr(name, visibility, static, typename)
+
+ def parse_member_object(self):
+ visibility, static = self._parse_visibility_static()
+ typename = self._parse_type()
+ name = self._parse_type()
+ self.skip_ws()
+ if self.skip_string('='):
+ value = self.read_rest().strip()
+ else:
+ value = None
+ return MemberObjDefExpr(name, visibility, static, typename, value)
+
+ def parse_function(self):
+ visibility, static = self._parse_visibility_static()
+ if self.skip_word('explicit'):
+ explicit = True
+ self.skip_ws()
+ else:
+ explicit = False
+ rv = self._parse_type()
+ self.skip_ws()
+ # some things just don't have return values
+ if self.current_char == '(':
+ name = rv
+ rv = None
+ else:
+ name = self._parse_type()
+ return FuncDefExpr(name, visibility, static, explicit, rv,
+ *self._parse_signature())
+
+ def parse_class(self):
+ visibility, static = self._parse_visibility_static()
+ return ClassDefExpr(self._parse_type(), visibility, static)
+
+ def read_rest(self):
+ rv = self.definition[self.pos:]
+ self.pos = self.end
+ return rv
+
+ def assert_end(self):
+ self.skip_ws()
+ if not self.eof:
+ self.fail('expected end of definition, got %r' %
+ self.definition[self.pos:])
+
+
+class CPPObject(ObjectDescription):
+ """Description of a C++ language object."""
+
+ def attach_name(self, node, name):
+ owner, name = name.split_owner()
+ varname = unicode(name)
+ if owner is not None:
+ owner = unicode(owner) + '::'
+ node += addnodes.desc_addname(owner, owner)
+ node += addnodes.desc_name(varname, varname)
+
+ def attach_type(self, node, type):
+ # XXX: link to c?
+ text = unicode(type)
+ pnode = addnodes.pending_xref(
+ '', refdomain='cpp', reftype='type',
+ reftarget=text, modname=None, classname=None)
+ pnode['cpp:parent'] = self.env.temp_data.get('cpp:parent')
+ pnode += nodes.Text(text)
+ node += pnode
+
+ def attach_modifiers(self, node, obj):
+ if obj.visibility != 'public':
+ node += addnodes.desc_annotation(obj.visibility,
+ obj.visibility)
+ node += nodes.Text(' ')
+ if obj.static:
+ node += addnodes.desc_annotation('static', 'static')
+ node += nodes.Text(' ')
+
+ def add_target_and_index(self, sigobj, sig, signode):
+ theid = sigobj.get_id()
+ name = unicode(sigobj.name)
+ signode['names'].append(theid)
+ signode['ids'].append(theid)
+ signode['first'] = (not self.names)
+ self.state.document.note_explicit_target(signode)
+ self.env.domaindata['cpp']['objects'][name] = \
+ (self.env.docname, self.objtype)
+
+ indextext = self.get_index_text(name)
+ if indextext:
+ self.indexnode['entries'].append(('single', indextext, name, name))
+
+ def before_content(self):
+ lastname = self.names and self.names[-1]
+ if lastname and not self.env.temp_data.get('cpp:parent'):
+ assert isinstance(lastname, NamedDefExpr)
+ self.env.temp_data['cpp:parent'] = lastname.name
+ self.parentname_set = True
+ else:
+ self.parentname_set = False
+
+ def after_content(self):
+ if self.parentname_set:
+ self.env.temp_data['cpp:parent'] = None
+
+ def parse_definition(self, parser):
+ raise NotImplementedError()
+
+ def describe_signature(self, signode, arg):
+ raise NotImplementedError()
+
+ def handle_signature(self, sig, signode):
+ parser = DefinitionParser(sig)
+ try:
+ rv = self.parse_definition(parser)
+ parser.assert_end()
+ except DefinitionError, e:
+ self.env.warn(self.env.docname,
+ e.description, self.lineno)
+ raise ValueError
+ self.describe_signature(signode, rv)
+
+ parent = self.env.temp_data.get('cpp:parent')
+ if parent is not None:
+ rv = rv.clone()
+ rv.name = rv.name.prefix(parent)
+ return rv
+
+
+class CPPClassObject(CPPObject):
+
+ def get_index_text(self, name):
+ return _('%s (C++ class)') % name
+
+ def parse_definition(self, parser):
+ return parser.parse_class()
+
+ def describe_signature(self, signode, cls):
+ self.attach_modifiers(signode, cls)
+ signode += addnodes.desc_annotation('class ', 'class ')
+ self.attach_name(signode, cls.name)
+
+
+class CPPTypeObject(CPPObject):
+
+ def get_index_text(self, name):
+ if self.objtype == 'type':
+ return _('%s (C++ type)') % name
+ return ''
+
+ def parse_definition(self, parser):
+ return parser.parse_type_object()
+
+ def describe_signature(self, signode, obj):
+ self.attach_modifiers(signode, obj)
+ signode += addnodes.desc_annotation('type ', 'type ')
+ if obj.typename is not None:
+ self.attach_type(signode, obj.typename)
+ signode += nodes.Text(' ')
+ self.attach_name(signode, obj.name)
+
+
+class CPPMemberObject(CPPObject):
+
+ def get_index_text(self, name):
+ if self.objtype == 'member':
+ return _('%s (C++ member)') % name
+ return ''
+
+ def parse_definition(self, parser):
+ return parser.parse_member_object()
+
+ def describe_signature(self, signode, obj):
+ self.attach_modifiers(signode, obj)
+ self.attach_type(signode, obj.typename)
+ signode += nodes.Text(' ')
+ self.attach_name(signode, obj.name)
+ if obj.value is not None:
+ signode += nodes.Text(u' = ' + obj.value)
+
+
+class CPPFunctionObject(CPPObject):
+
+ def attach_function(self, node, func):
+ owner, name = func.name.split_owner()
+ if owner is not None:
+ owner = unicode(owner) + '::'
+ node += addnodes.desc_addname(owner, owner)
+
+ # cast operator is special. in this case the return value
+ # is reversed.
+ if isinstance(name, CastOpDefExpr):
+ node += addnodes.desc_name('operator', 'operator')
+ node += nodes.Text(u' ')
+ self.attach_type(node, name.typename)
+ else:
+ funcname = unicode(name)
+ node += addnodes.desc_name(funcname, funcname)
+
+ paramlist = addnodes.desc_parameterlist()
+ for arg in func.signature:
+ param = addnodes.desc_parameter('', '', noemph=True)
+ if arg.type is not None:
+ self.attach_type(param, arg.type)
+ param += nodes.Text(u' ')
+ param += nodes.emphasis(unicode(arg.name), unicode(arg.name))
+ if arg.default is not None:
+ def_ = u'=' + unicode(arg.default)
+ param += nodes.emphasis(def_, def_)
+ paramlist += param
+
+ node += paramlist
+ if func.const:
+ node += addnodes.desc_addname(' const', ' const')
+ if func.pure_virtual:
+ node += addnodes.desc_addname(' = 0', ' = 0')
+
+ def get_index_text(self, name):
+ return _('%s (C++ function)') % name
+
+ def parse_definition(self, parser):
+ return parser.parse_function()
+
+ def describe_signature(self, signode, func):
+ self.attach_modifiers(signode, func)
+ if func.explicit:
+ signode += addnodes.desc_annotation('explicit', 'explicit')
+ signode += nodes.Text(' ')
+ # return value is None for things with a reverse return value
+ # such as casting operator definitions or constructors
+ # and destructors.
+ if func.rv is not None:
+ self.attach_type(signode, func.rv)
+ signode += nodes.Text(u' ')
+ self.attach_function(signode, func)
+
+
+class CPPCurrentNamespace(Directive):
+ """This directive is just to tell Sphinx that we're documenting
+ stuff in namespace foo.
+ """
+
+ has_content = False
+ required_arguments = 1
+ optional_arguments = 0
+ final_argument_whitespace = True
+ option_spec = {}
+
+ def run(self):
+ env = self.state.document.settings.env
+ if self.arguments[0].strip() in ('NULL', '0', 'nullptr'):
+ env.temp_data['cpp:prefix'] = None
+ else:
+ parser = DefinitionParser(self.arguments[0])
+ try:
+ prefix = parser.parse_type()
+ parser.assert_end()
+ except DefinitionError, e:
+ self.env.warn(self.env.docname,
+ e.description, self.lineno)
+ else:
+ env.temp_data['cpp:prefix'] = prefix
+ return []
+
+
+class CPPXRefRole(XRefRole):
+
+ def process_link(self, env, refnode, has_explicit_title, title, target):
+ refnode['cpp:parent'] = env.temp_data.get('cpp:parent')
+ if not has_explicit_title:
+ target = target.lstrip('~') # only has a meaning for the title
+ # if the first character is a tilde, don't display the module/class
+ # parts of the contents
+ if title[:1] == '~':
+ title = title[1:]
+ dcolon = title.rfind('::')
+ if dcolon != -1:
+ title = title[dcolon + 2:]
+ return title, target
+
+
+class CPPDomain(Domain):
+ """C++ language domain."""
+ name = 'cpp'
+ label = 'C++'
+ object_types = {
+ 'class': ObjType(l_('class'), 'class'),
+ 'function': ObjType(l_('function'), 'func'),
+ 'member': ObjType(l_('member'), 'member'),
+ 'type': ObjType(l_('type'), 'type')
+ }
+
+ directives = {
+ 'class': CPPClassObject,
+ 'function': CPPFunctionObject,
+ 'member': CPPMemberObject,
+ 'type': CPPTypeObject,
+ 'namespace': CPPCurrentNamespace
+ }
+ roles = {
+ 'class': CPPXRefRole(),
+ 'func' : CPPXRefRole(fix_parens=True),
+ 'member': CPPXRefRole(),
+ 'type': CPPXRefRole()
+ }
+ initial_data = {
+ 'objects': {}, # fullname -> docname, objtype
+ }
+
+ def clear_doc(self, docname):
+ for fullname, (fn, _) in self.data['objects'].items():
+ if fn == docname:
+ del self.data['objects'][fullname]
+
+ def resolve_xref(self, env, fromdocname, builder,
+ typ, target, node, contnode):
+ def _create_refnode(expr):
+ name = unicode(expr)
+ if name not in self.data['objects']:
+ return None
+ obj = self.data['objects'][name]
+ if obj[1] != typ:
+ return None
+ return make_refnode(builder, fromdocname, obj[0], expr.get_id(),
+ contnode, name)
+
+ parser = DefinitionParser(target)
+ # XXX: warn?
+ try:
+ expr = parser.parse_type().get_name()
+ parser.skip_ws()
+ if not parser.eof or expr is None:
+ return None
+ except DefinitionError:
+ return None
+
+ parent = node['cpp:parent']
+
+ rv = _create_refnode(expr)
+ if rv is not None or parent is None:
+ return rv
+ parent = parent.get_name()
+
+ rv = _create_refnode(expr.prefix(parent))
+ if rv is not None:
+ return rv
+
+ parent, name = parent.split_owner()
+ return _create_refnode(expr.prefix(parent))
+
+ def get_objects(self):
+ for refname, (docname, type) in self.data['objects'].iteritems():
+ yield (refname, refname, type, docname, refname, 1)
diff --git a/sphinx/domains/javascript.py b/sphinx/domains/javascript.py
new file mode 100644
index 000000000..31a769873
--- /dev/null
+++ b/sphinx/domains/javascript.py
@@ -0,0 +1,217 @@
+# -*- coding: utf-8 -*-
+"""
+ sphinx.domains.javascript
+ ~~~~~~~~~~~~~~~~~~~~~~~~~
+
+ The JavaScript domain.
+
+ :copyright: Copyright 2007-2010 by the Sphinx team, see AUTHORS.
+ :license: BSD, see LICENSE for details.
+"""
+
+from sphinx import addnodes
+from sphinx.domains import Domain, ObjType
+from sphinx.locale import l_, _
+from sphinx.directives import ObjectDescription
+from sphinx.domains.python import py_paramlist_re as js_paramlist_re
+from sphinx.roles import XRefRole
+from sphinx.util.nodes import make_refnode
+from sphinx.util.docfields import Field, GroupedField, TypedField
+
+
+class JSObject(ObjectDescription):
+ """
+ Description of a JavaScript object.
+ """
+ #: If set to ``True`` this object is callable and a `desc_parameterlist` is
+ #: added
+ has_arguments = False
+
+ def handle_signature(self, sig, signode):
+ sig = sig.strip()
+ if '(' in sig and sig[-1:] == ')':
+ prefix, arglist = sig.split('(', 1)
+ arglist = arglist[:-1].strip()
+ else:
+ prefix = sig
+ arglist = None
+ if '.' in prefix:
+ nameprefix, name = prefix.rsplit('.', 1)
+ else:
+ nameprefix = None
+ name = prefix
+
+ objectname = self.env.temp_data.get('js:object')
+ if nameprefix:
+ if objectname:
+ # someone documenting the method of an attribute of the current
+ # object? shouldn't happen but who knows...
+ nameprefix = objectname + '.' + nameprefix
+ fullname = nameprefix + '.' + name
+ elif objectname:
+ fullname = objectname + '.' + name
+ else:
+ # just a function or constructor
+ objectname = ''
+ fullname = ''
+
+ signode['object'] = objectname
+ signode['fullname'] = fullname
+
+ if nameprefix:
+ signode += addnodes.desc_addname(nameprefix + '.', nameprefix + '.')
+ signode += addnodes.desc_name(name, name)
+ if self.has_arguments:
+ signode += addnodes.desc_parameterlist()
+ if not arglist:
+ return fullname, nameprefix
+
+ stack = [signode[-1]]
+ for token in js_paramlist_re.split(arglist):
+ if token == '[':
+ opt = addnodes.desc_optional()
+ stack[-1] += opt
+ stack.append(opt)
+ elif token == ']':
+ try:
+ stack.pop()
+ except IndexError:
+ raise ValueError()
+ elif not token or token == ',' or token.isspace():
+ pass
+ else:
+ token = token.strip()
+ stack[-1] += addnodes.desc_parameter(token, token)
+ if len(stack) != 1:
+ raise ValueError()
+ return fullname, nameprefix
+
+ def add_target_and_index(self, name_obj, sig, signode):
+ objectname = self.options.get(
+ 'object', self.env.temp_data.get('js:object'))
+ fullname = name_obj[0]
+ if fullname not in self.state.document.ids:
+ signode['names'].append(fullname)
+ signode['ids'].append(fullname.replace('$', '_S_'))
+ signode['first'] = not self.names
+ self.state.document.note_explicit_target(signode)
+ objects = self.env.domaindata['js']['objects']
+ if fullname in objects:
+ self.env.warn(
+ self.env.docname,
+ 'duplicate object description of %s, ' % fullname +
+ 'other instance in ' +
+ self.env.doc2path(objects[fullname][0]),
+ self.lineno)
+ objects[fullname] = self.env.docname, self.objtype
+
+ indextext = self.get_index_text(objectname, name_obj)
+ if indextext:
+ self.indexnode['entries'].append(('single', indextext,
+ fullname, fullname))
+
+ def get_index_text(self, objectname, name_obj):
+ name, obj = name_obj
+ if self.objtype == 'function':
+ if not obj:
+ return _('%s() (built-in function)') % name
+ return _('%s() (%s method)') % (name, obj)
+ elif self.objtype == 'data':
+ return _('%s (global variable or constant)') % name
+ elif self.objtype == 'attribute':
+ return _('%s (%s attribute)') % (name, obj)
+ return ''
+
+
+class JSCallable(JSObject):
+ """Description of a JavaScript function, method or constructor."""
+ has_arguments = True
+
+ doc_field_types = [
+ TypedField('arguments', label=l_('Arguments'),
+ names=('argument', 'arg', 'parameter', 'param'),
+ typerolename='func', typenames=('paramtype', 'type')),
+ GroupedField('errors', label=l_('Throws'), rolename='err',
+ names=('throws', ),
+ can_collapse=True),
+ Field('returnvalue', label=l_('Returns'), has_arg=False,
+ names=('returns', 'return')),
+ ]
+
+
+class JSXRefRole(XRefRole):
+ def process_link(self, env, refnode, has_explicit_title, title, target):
+ # basically what sphinx.domains.python.PyXRefRole does
+ refnode['js:object'] = env.temp_data.get('js:object')
+ if not has_explicit_title:
+ title = title.lstrip('.')
+ target = target.lstrip('~')
+ if title[0:1] == '~':
+ title = title[1:]
+ dot = title.rfind('.')
+ if dot != -1:
+ title = title[dot+1:]
+ if target[0:1] == '.':
+ target = target[1:]
+ refnode['refspecific'] = True
+ return title, target
+
+
+class JavaScriptDomain(Domain):
+ """JavaScript language domain."""
+ name = 'js'
+ label = 'JavaScript'
+ # if you add a new object type make sure to edit JSObject.get_index_string
+ object_types = {
+ 'function': ObjType(l_('function'), 'func'),
+ 'data': ObjType(l_('data'), 'data'),
+ 'attribute': ObjType(l_('attribute'), 'attr'),
+ }
+ directives = {
+ 'function': JSCallable,
+ 'data': JSObject,
+ 'attribute': JSObject,
+ }
+ roles = {
+ 'func': JSXRefRole(fix_parens=True),
+ 'data': JSXRefRole(),
+ 'attr': JSXRefRole(),
+ }
+ initial_data = {
+ 'objects': {}, # fullname -> docname, objtype
+ }
+
+ def clear_doc(self, docname):
+ for fullname, (fn, _) in self.data['objects'].items():
+ if fn == docname:
+ del self.data['objects'][fullname]
+
+ def find_obj(self, env, obj, name, typ, searchorder=0):
+ if name[-2:] == '()':
+ name = name[:-2]
+ objects = self.data['objects']
+ newname = None
+ if searchorder == 1:
+ if obj and obj + '.' + name in objects:
+ newname = obj + '.' + name
+ else:
+ newname = name
+ else:
+ if name in objects:
+ newname = name
+ elif obj and obj + '.' + name in objects:
+ newname = obj + '.' + name
+ return newname, objects.get(newname)
+
+ def resolve_xref(self, env, fromdocname, builder, typ, target, node,
+ contnode):
+ objectname = node.get('js:object')
+ searchorder = node.hasattr('refspecific') and 1 or 0
+ name, obj = self.find_obj(env, objectname, target, typ, searchorder)
+ if not obj:
+ return None
+ return make_refnode(builder, fromdocname, obj[0], name, contnode, name)
+
+ def get_objects(self):
+ for refname, (docname, type) in self.data['objects'].iteritems():
+ yield refname, refname, type, docname, refname, 1
diff --git a/sphinx/domains/python.py b/sphinx/domains/python.py
new file mode 100644
index 000000000..b97b9b422
--- /dev/null
+++ b/sphinx/domains/python.py
@@ -0,0 +1,622 @@
+# -*- coding: utf-8 -*-
+"""
+ sphinx.domains.python
+ ~~~~~~~~~~~~~~~~~~~~~
+
+ The Python domain.
+
+ :copyright: Copyright 2007-2010 by the Sphinx team, see AUTHORS.
+ :license: BSD, see LICENSE for details.
+"""
+
+import re
+
+from docutils import nodes
+from docutils.parsers.rst import directives
+
+from sphinx import addnodes
+from sphinx.roles import XRefRole
+from sphinx.locale import l_, _
+from sphinx.domains import Domain, ObjType, Index
+from sphinx.directives import ObjectDescription
+from sphinx.util.nodes import make_refnode
+from sphinx.util.compat import Directive
+from sphinx.util.docfields import Field, GroupedField, TypedField
+
+
+# REs for Python signatures
+py_sig_re = re.compile(
+ r'''^ ([\w.]*\.)? # class name(s)
+ (\w+) \s* # thing name
+ (?: \((.*)\) # optional: arguments
+ (?:\s* -> \s* (.*))? # return annotation
+ )? $ # and nothing more
+ ''', re.VERBOSE)
+
+py_paramlist_re = re.compile(r'([\[\],])') # split at '[', ']' and ','
+
+
+class PyObject(ObjectDescription):
+ """
+ Description of a general Python object.
+ """
+ option_spec = {
+ 'noindex': directives.flag,
+ 'module': directives.unchanged,
+ }
+
+ doc_field_types = [
+ TypedField('parameter', label=l_('Parameters'),
+ names=('param', 'parameter', 'arg', 'argument',
+ 'keyword', 'kwarg', 'kwparam'),
+ typerolename='obj', typenames=('paramtype', 'type')),
+ TypedField('variable', label=l_('Variables'), rolename='obj',
+ names=('var', 'ivar', 'cvar'),
+ typerolename='obj', typenames=('vartype',)),
+ GroupedField('exceptions', label=l_('Raises'), rolename='exc',
+ names=('raises', 'raise', 'exception', 'except'),
+ can_collapse=True),
+ Field('returnvalue', label=l_('Returns'), has_arg=False,
+ names=('returns', 'return')),
+ Field('returntype', label=l_('Return type'), has_arg=False,
+ names=('rtype',)),
+ ]
+
+ def get_signature_prefix(self, sig):
+ """
+ May return a prefix to put before the object name in the signature.
+ """
+ return ''
+
+ def needs_arglist(self):
+ """
+ May return true if an empty argument list is to be generated even if
+ the document contains none.
+ """
+ return False
+
+ def handle_signature(self, sig, signode):
+ """
+ Transform a Python signature into RST nodes.
+ Returns (fully qualified name of the thing, classname if any).
+
+ If inside a class, the current class name is handled intelligently:
+ * it is stripped from the displayed name if present
+ * it is added to the full name (return value) if not present
+ """
+ m = py_sig_re.match(sig)
+ if m is None:
+ raise ValueError
+ name_prefix, name, arglist, retann = m.groups()
+
+ # determine module and class name (if applicable), as well as full name
+ modname = self.options.get(
+ 'module', self.env.temp_data.get('py:module'))
+ classname = self.env.temp_data.get('py:class')
+ if classname:
+ add_module = False
+ if name_prefix and name_prefix.startswith(classname):
+ fullname = name_prefix + name
+ # class name is given again in the signature
+ name_prefix = name_prefix[len(classname):].lstrip('.')
+ elif name_prefix:
+ # class name is given in the signature, but different
+ # (shouldn't happen)
+ fullname = classname + '.' + name_prefix + name
+ else:
+ # class name is not given in the signature
+ fullname = classname + '.' + name
+ else:
+ add_module = True
+ if name_prefix:
+ classname = name_prefix.rstrip('.')
+ fullname = name_prefix + name
+ else:
+ classname = ''
+ fullname = name
+
+ signode['module'] = modname
+ signode['class'] = classname
+ signode['fullname'] = fullname
+
+ sig_prefix = self.get_signature_prefix(sig)
+ if sig_prefix:
+ signode += addnodes.desc_annotation(sig_prefix, sig_prefix)
+
+ if name_prefix:
+ signode += addnodes.desc_addname(name_prefix, name_prefix)
+ # exceptions are a special case, since they are documented in the
+ # 'exceptions' module.
+ elif add_module and self.env.config.add_module_names:
+ modname = self.options.get(
+ 'module', self.env.temp_data.get('py:module'))
+ if modname and modname != 'exceptions':
+ nodetext = modname + '.'
+ signode += addnodes.desc_addname(nodetext, nodetext)
+
+ signode += addnodes.desc_name(name, name)
+ if not arglist:
+ if self.needs_arglist():
+ # for callables, add an empty parameter list
+ signode += addnodes.desc_parameterlist()
+ if retann:
+ signode += addnodes.desc_returns(retann, retann)
+ return fullname, name_prefix
+ signode += addnodes.desc_parameterlist()
+
+ stack = [signode[-1]]
+ for token in py_paramlist_re.split(arglist):
+ if token == '[':
+ opt = addnodes.desc_optional()
+ stack[-1] += opt
+ stack.append(opt)
+ elif token == ']':
+ try:
+ stack.pop()
+ except IndexError:
+ raise ValueError
+ elif not token or token == ',' or token.isspace():
+ pass
+ else:
+ token = token.strip()
+ stack[-1] += addnodes.desc_parameter(token, token)
+ if len(stack) != 1:
+ raise ValueError
+ if retann:
+ signode += addnodes.desc_returns(retann, retann)
+ return fullname, name_prefix
+
+ def get_index_text(self, modname, name):
+ """
+ Return the text for the index entry of the object.
+ """
+ raise NotImplementedError('must be implemented in subclasses')
+
+ def add_target_and_index(self, name_cls, sig, signode):
+ modname = self.options.get(
+ 'module', self.env.temp_data.get('py:module'))
+ fullname = (modname and modname + '.' or '') + name_cls[0]
+ # note target
+ if fullname not in self.state.document.ids:
+ signode['names'].append(fullname)
+ signode['ids'].append(fullname)
+ signode['first'] = (not self.names)
+ self.state.document.note_explicit_target(signode)
+ objects = self.env.domaindata['py']['objects']
+ if fullname in objects:
+ self.env.warn(
+ self.env.docname,
+ 'duplicate object description of %s, ' % fullname +
+ 'other instance in ' +
+ self.env.doc2path(objects[fullname][0]) +
+ ', use :noindex: for one of them',
+ self.lineno)
+ objects[fullname] = (self.env.docname, self.objtype)
+
+ indextext = self.get_index_text(modname, name_cls)
+ if indextext:
+ self.indexnode['entries'].append(('single', indextext,
+ fullname, fullname))
+
+ def before_content(self):
+ # needed for automatic qualification of members (reset in subclasses)
+ self.clsname_set = False
+
+ def after_content(self):
+ if self.clsname_set:
+ self.env.temp_data['py:class'] = None
+
+
+class PyModulelevel(PyObject):
+ """
+ Description of an object on module level (functions, data).
+ """
+
+ def needs_arglist(self):
+ return self.objtype == 'function'
+
+ def get_index_text(self, modname, name_cls):
+ if self.objtype == 'function':
+ if not modname:
+ return _('%s() (built-in function)') % name_cls[0]
+ return _('%s() (in module %s)') % (name_cls[0], modname)
+ elif self.objtype == 'data':
+ if not modname:
+ return _('%s (built-in variable)') % name_cls[0]
+ return _('%s (in module %s)') % (name_cls[0], modname)
+ else:
+ return ''
+
+
+class PyClasslike(PyObject):
+ """
+ Description of a class-like object (classes, interfaces, exceptions).
+ """
+
+ def get_signature_prefix(self, sig):
+ return self.objtype + ' '
+
+ def get_index_text(self, modname, name_cls):
+ if self.objtype == 'class':
+ if not modname:
+ return _('%s (built-in class)') % name_cls[0]
+ return _('%s (class in %s)') % (name_cls[0], modname)
+ elif self.objtype == 'exception':
+ return name_cls[0]
+ else:
+ return ''
+
+ def before_content(self):
+ PyObject.before_content(self)
+ if self.names:
+ self.env.temp_data['py:class'] = self.names[0][0]
+ self.clsname_set = True
+
+
+class PyClassmember(PyObject):
+ """
+ Description of a class member (methods, attributes).
+ """
+
+ def needs_arglist(self):
+ return self.objtype.endswith('method')
+
+ def get_signature_prefix(self, sig):
+ if self.objtype == 'staticmethod':
+ return 'static '
+ elif self.objtype == 'classmethod':
+ return 'classmethod '
+ return ''
+
+ def get_index_text(self, modname, name_cls):
+ name, cls = name_cls
+ add_modules = self.env.config.add_module_names
+ if self.objtype == 'method':
+ try:
+ clsname, methname = name.rsplit('.', 1)
+ except ValueError:
+ if modname:
+ return _('%s() (in module %s)') % (name, modname)
+ else:
+ return '%s()' % name
+ if modname and add_modules:
+ return _('%s() (%s.%s method)') % (methname, modname, clsname)
+ else:
+ return _('%s() (%s method)') % (methname, clsname)
+ elif self.objtype == 'staticmethod':
+ try:
+ clsname, methname = name.rsplit('.', 1)
+ except ValueError:
+ if modname:
+ return _('%s() (in module %s)') % (name, modname)
+ else:
+ return '%s()' % name
+ if modname and add_modules:
+ return _('%s() (%s.%s static method)') % (methname, modname,
+ clsname)
+ else:
+ return _('%s() (%s static method)') % (methname, clsname)
+ elif self.objtype == 'classmethod':
+ try:
+ clsname, methname = name.rsplit('.', 1)
+ except ValueError:
+ if modname:
+ return _('%s() (in module %s)') % (name, modname)
+ else:
+ return '%s()' % name
+ if modname:
+ return _('%s() (%s.%s class method)') % (methname, modname,
+ clsname)
+ else:
+ return _('%s() (%s class method)') % (methname, clsname)
+ elif self.objtype == 'attribute':
+ try:
+ clsname, attrname = name.rsplit('.', 1)
+ except ValueError:
+ if modname:
+ return _('%s (in module %s)') % (name, modname)
+ else:
+ return name
+ if modname and add_modules:
+ return _('%s (%s.%s attribute)') % (attrname, modname, clsname)
+ else:
+ return _('%s (%s attribute)') % (attrname, clsname)
+ else:
+ return ''
+
+ def before_content(self):
+ PyObject.before_content(self)
+ lastname = self.names and self.names[-1][1]
+ if lastname and not self.env.temp_data.get('py:class'):
+ self.env.temp_data['py:class'] = lastname.strip('.')
+ self.clsname_set = True
+
+
+class PyModule(Directive):
+ """
+ Directive to mark description of a new module.
+ """
+
+ has_content = False
+ required_arguments = 1
+ optional_arguments = 0
+ final_argument_whitespace = False
+ option_spec = {
+ 'platform': lambda x: x,
+ 'synopsis': lambda x: x,
+ 'noindex': directives.flag,
+ 'deprecated': directives.flag,
+ }
+
+ def run(self):
+ env = self.state.document.settings.env
+ modname = self.arguments[0].strip()
+ noindex = 'noindex' in self.options
+ env.temp_data['py:module'] = modname
+ env.domaindata['py']['modules'][modname] = \
+ (env.docname, self.options.get('synopsis', ''),
+ self.options.get('platform', ''), 'deprecated' in self.options)
+ targetnode = nodes.target('', '', ids=['module-' + modname], ismod=True)
+ self.state.document.note_explicit_target(targetnode)
+ ret = [targetnode]
+ # XXX this behavior of the module directive is a mess...
+ if 'platform' in self.options:
+ platform = self.options['platform']
+ node = nodes.paragraph()
+ node += nodes.emphasis('', _('Platforms: '))
+ node += nodes.Text(platform, platform)
+ ret.append(node)
+ # the synopsis isn't printed; in fact, it is only used in the
+ # modindex currently
+ if not noindex:
+ indextext = _('%s (module)') % modname
+ inode = addnodes.index(entries=[('single', indextext,
+ 'module-' + modname, modname)])
+ ret.append(inode)
+ return ret
+
+
+class PyCurrentModule(Directive):
+ """
+ This directive is just to tell Sphinx that we're documenting
+ stuff in module foo, but links to module foo won't lead here.
+ """
+
+ has_content = False
+ required_arguments = 1
+ optional_arguments = 0
+ final_argument_whitespace = False
+ option_spec = {}
+
+ def run(self):
+ env = self.state.document.settings.env
+ modname = self.arguments[0].strip()
+ if modname == 'None':
+ env.temp_data['py:module'] = None
+ else:
+ env.temp_data['py:module'] = modname
+ return []
+
+
+class PyXRefRole(XRefRole):
+ def process_link(self, env, refnode, has_explicit_title, title, target):
+ refnode['py:module'] = env.temp_data.get('py:module')
+ refnode['py:class'] = env.temp_data.get('py:class')
+ 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
+ # if the first character is a tilde, don't display the module/class
+ # parts of the contents
+ if title[0:1] == '~':
+ title = title[1:]
+ dot = title.rfind('.')
+ if dot != -1:
+ title = title[dot+1:]
+ # if the first character is a dot, search more specific namespaces first
+ # else search builtins first
+ if target[0:1] == '.':
+ target = target[1:]
+ refnode['refspecific'] = True
+ return title, target
+
+
+class PythonModuleIndex(Index):
+ """
+ Index subclass to provide the Python module index.
+ """
+
+ name = 'modindex'
+ localname = l_('Python Module Index')
+ shortname = l_('modules')
+
+ def generate(self, docnames=None):
+ content = {}
+ # list of prefixes to ignore
+ ignores = self.domain.env.config['modindex_common_prefix']
+ ignores = sorted(ignores, key=len, reverse=True)
+ # list of all modules, sorted by module name
+ modules = sorted(self.domain.data['modules'].iteritems(),
+ key=lambda x: x[0].lower())
+ # sort out collapsable modules
+ prev_modname = ''
+ num_toplevels = 0
+ for modname, (docname, synopsis, platforms, deprecated) in modules:
+ if docnames and docname not in docnames:
+ continue
+
+ for ignore in ignores:
+ if modname.startswith(ignore):
+ modname = modname[len(ignore):]
+ stripped = ignore
+ break
+ else:
+ stripped = ''
+
+ # we stripped the whole module name?
+ if not modname:
+ modname, stripped = stripped, ''
+
+ entries = content.setdefault(modname[0].lower(), [])
+
+ package = modname.split('.')[0]
+ if package != modname:
+ # it's a submodule
+ if prev_modname == package:
+ # first submodule - make parent a group head
+ entries[-1][1] = 1
+ elif not prev_modname.startswith(package):
+ # submodule without parent in list, add dummy entry
+ entries.append([stripped + package, 1, '', '', '', '', ''])
+ subtype = 2
+ else:
+ num_toplevels += 1
+ subtype = 0
+
+ qualifier = deprecated and _('Deprecated') or ''
+ entries.append([stripped + modname, subtype, docname,
+ 'module-' + stripped + modname, platforms,
+ qualifier, synopsis])
+ prev_modname = modname
+
+ # 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
+
+ # sort by first letter
+ content = sorted(content.iteritems())
+
+ return content, collapse
+
+
+class PythonDomain(Domain):
+ """Python language domain."""
+ name = 'py'
+ label = 'Python'
+ object_types = {
+ 'function': ObjType(l_('function'), 'func', 'obj'),
+ 'data': ObjType(l_('data'), 'data', 'obj'),
+ 'class': ObjType(l_('class'), 'class', 'obj'),
+ 'exception': ObjType(l_('exception'), 'exc', 'obj'),
+ 'method': ObjType(l_('method'), 'meth', 'obj'),
+ 'classmethod': ObjType(l_('class method'), 'meth', 'obj'),
+ 'staticmethod': ObjType(l_('static method'), 'meth', 'obj'),
+ 'attribute': ObjType(l_('attribute'), 'attr', 'obj'),
+ 'module': ObjType(l_('module'), 'mod', 'obj'),
+ }
+
+ directives = {
+ 'function': PyModulelevel,
+ 'data': PyModulelevel,
+ 'class': PyClasslike,
+ 'exception': PyClasslike,
+ 'method': PyClassmember,
+ 'classmethod': PyClassmember,
+ 'staticmethod': PyClassmember,
+ 'attribute': PyClassmember,
+ 'module': PyModule,
+ 'currentmodule': PyCurrentModule,
+ }
+ roles = {
+ 'data': PyXRefRole(),
+ 'exc': PyXRefRole(),
+ 'func': PyXRefRole(fix_parens=True),
+ 'class': PyXRefRole(),
+ 'const': PyXRefRole(),
+ 'attr': PyXRefRole(),
+ 'meth': PyXRefRole(fix_parens=True),
+ 'mod': PyXRefRole(),
+ 'obj': PyXRefRole(),
+ }
+ initial_data = {
+ 'objects': {}, # fullname -> docname, objtype
+ 'modules': {}, # modname -> docname, synopsis, platform, deprecated
+ }
+ indices = [
+ PythonModuleIndex,
+ ]
+
+ def clear_doc(self, docname):
+ for fullname, (fn, _) in self.data['objects'].items():
+ if fn == docname:
+ del self.data['objects'][fullname]
+ for modname, (fn, _, _, _) in self.data['modules'].items():
+ if fn == docname:
+ del self.data['modules'][modname]
+
+ def find_obj(self, env, modname, classname, name, type, searchorder=0):
+ """
+ Find a Python object for "name", perhaps using the given module and/or
+ classname.
+ """
+ # skip parens
+ if name[-2:] == '()':
+ name = name[:-2]
+
+ if not name:
+ return None, None
+
+ objects = self.data['objects']
+
+ newname = None
+ if searchorder == 1:
+ if modname and classname and \
+ modname + '.' + classname + '.' + name in objects:
+ newname = modname + '.' + classname + '.' + name
+ elif modname and modname + '.' + name in objects:
+ newname = modname + '.' + name
+ elif name in objects:
+ newname = name
+ else:
+ if name in objects:
+ newname = name
+ elif classname and classname + '.' + name in objects:
+ newname = classname + '.' + name
+ elif modname and modname + '.' + name in objects:
+ newname = modname + '.' + name
+ elif modname and classname and \
+ modname + '.' + classname + '.' + name in objects:
+ newname = modname + '.' + classname + '.' + name
+ # special case: builtin exceptions have module "exceptions" set
+ elif type == 'exc' and '.' not in name and \
+ 'exceptions.' + name in objects:
+ newname = 'exceptions.' + name
+ # special case: object methods
+ elif type in ('func', 'meth') and '.' not in name and \
+ 'object.' + name in objects:
+ newname = 'object.' + name
+ if newname is None:
+ return None, None
+ return newname, objects[newname]
+
+ def resolve_xref(self, env, fromdocname, builder,
+ typ, target, node, contnode):
+ if (typ == 'mod' or
+ typ == 'obj' and target in self.data['modules']):
+ docname, synopsis, platform, deprecated = \
+ self.data['modules'].get(target, ('','','', ''))
+ if not docname:
+ return None
+ else:
+ title = '%s%s%s' % ((platform and '(%s) ' % platform),
+ synopsis,
+ (deprecated and ' (deprecated)' or ''))
+ return make_refnode(builder, fromdocname, docname,
+ 'module-' + target, contnode, title)
+ else:
+ modname = node.get('py:module')
+ clsname = node.get('py:class')
+ searchorder = node.hasattr('refspecific') and 1 or 0
+ name, obj = self.find_obj(env, modname, clsname,
+ target, typ, searchorder)
+ if not obj:
+ return None
+ else:
+ return make_refnode(builder, fromdocname, obj[0], name,
+ contnode, name)
+
+ def get_objects(self):
+ for modname, info in self.data['modules'].iteritems():
+ yield (modname, modname, 'module', info[0], 'module-' + modname, 0)
+ for refname, (docname, type) in self.data['objects'].iteritems():
+ yield (refname, refname, type, docname, refname, 1)
diff --git a/sphinx/domains/rst.py b/sphinx/domains/rst.py
new file mode 100644
index 000000000..5c25e085a
--- /dev/null
+++ b/sphinx/domains/rst.py
@@ -0,0 +1,134 @@
+# -*- coding: utf-8 -*-
+"""
+ sphinx.domains.rst
+ ~~~~~~~~~~~~~~~~~~
+
+ The reStructuredText domain.
+
+ :copyright: Copyright 2007-2010 by the Sphinx team, see AUTHORS.
+ :license: BSD, see LICENSE for details.
+"""
+
+import re
+
+from sphinx import addnodes
+from sphinx.domains import Domain, ObjType
+from sphinx.locale import l_, _
+from sphinx.directives import ObjectDescription
+from sphinx.roles import XRefRole
+from sphinx.util.nodes import make_refnode
+
+
+dir_sig_re = re.compile(r'\.\. (.+?)::(.*)$')
+
+
+class ReSTMarkup(ObjectDescription):
+ """
+ Description of generic reST markup.
+ """
+
+ def add_target_and_index(self, name, sig, signode):
+ if name not in self.state.document.ids:
+ signode['names'].append(name)
+ signode['ids'].append(name)
+ signode['first'] = (not self.names)
+ self.state.document.note_explicit_target(signode)
+
+ objects = self.env.domaindata['rst']['objects']
+ if (self.objtype, name) in objects:
+ self.env.warn(self.env.docname,
+ 'duplicate description of %s %s, ' %
+ (self.objtype, name) +
+ 'other instance in ' +
+ self.env.doc2path(objects[name][0]),
+ self.lineno)
+ objects[self.objtype, name] = self.env.docname
+ indextext = self.get_index_text(self.objtype, name)
+ if indextext:
+ self.indexnode['entries'].append(('single', indextext,
+ name, name))
+
+ def get_index_text(self, objectname, name):
+ if self.objtype == 'directive':
+ return _('%s (directive)') % name
+ elif self.objtype == 'role':
+ return _('%s (role)') % name
+ return ''
+
+
+def parse_directive(d):
+ """
+ Parses a directive signature. Returns (directive, arguments) string tuple.
+ if no arguments are given, returns (directive, '').
+ """
+ dir = d.strip()
+ if not dir.startswith('.'):
+ # Assume it is a directive without syntax
+ return (dir, '')
+ m = dir_sig_re.match(dir)
+ if not m:
+ return (dir, '')
+ parsed_dir, parsed_args = m.groups()
+ return (parsed_dir.strip(), ' ' + parsed_args.strip())
+
+
+class ReSTDirective(ReSTMarkup):
+ """
+ Description of a reST directive.
+ """
+ def handle_signature(self, sig, signode):
+ name, args = parse_directive(sig)
+ desc_name = '.. %s::' % name
+ signode += addnodes.desc_name(desc_name, desc_name)
+ if len(args) > 0:
+ signode += addnodes.desc_addname(args, args)
+ return name
+
+
+class ReSTRole(ReSTMarkup):
+ """
+ Description of a reST role.
+ """
+ def handle_signature(self, sig, signode):
+ signode += addnodes.desc_name(':%s:' % sig, ':%s:' % sig)
+ return sig
+
+
+class ReSTDomain(Domain):
+ """ReStructuredText domain."""
+ name = 'rst'
+ label = 'reStructuredText'
+
+ object_types = {
+ 'directive': ObjType(l_('directive'), 'dir'),
+ 'role': ObjType(l_('role'), 'role'),
+ }
+ directives = {
+ 'directive': ReSTDirective,
+ 'role': ReSTRole,
+ }
+ roles = {
+ 'dir': XRefRole(),
+ 'role': XRefRole(),
+ }
+ initial_data = {
+ 'objects': {}, # fullname -> docname, objtype
+ }
+
+ def clear_doc(self, docname):
+ for (typ, name), doc in self.data['objects'].items():
+ if doc == docname:
+ del self.data['objects'][typ, name]
+
+ def resolve_xref(self, env, fromdocname, builder, typ, target, node,
+ contnode):
+ objects = self.data['objects']
+
+ if not (typ, target) in objects:
+ return None
+ return make_refnode(builder, fromdocname, objects[typ, target][0],
+ target, contnode, target)
+
+ def get_objects(self):
+ for (typ, name), docname in self.data['objects'].iteritems():
+ yield name, name, typ, docname, name, 1
diff --git a/sphinx/domains/std.py b/sphinx/domains/std.py
new file mode 100644
index 000000000..68bff15e2
--- /dev/null
+++ b/sphinx/domains/std.py
@@ -0,0 +1,501 @@
+# -*- coding: utf-8 -*-
+"""
+ sphinx.domains.std
+ ~~~~~~~~~~~~~~~~~~
+
+ The standard domain.
+
+ :copyright: Copyright 2007-2010 by the Sphinx team, see AUTHORS.
+ :license: BSD, see LICENSE for details.
+"""
+
+import re
+
+from docutils import nodes
+from docutils.parsers.rst import directives
+
+from sphinx import addnodes
+from sphinx.roles import XRefRole
+from sphinx.locale import l_, _
+from sphinx.domains import Domain, ObjType
+from sphinx.directives import ObjectDescription
+from sphinx.util import ws_re
+from sphinx.util.nodes import clean_astext, make_refnode
+from sphinx.util.compat import Directive
+
+
+# RE for option descriptions
+option_desc_re = re.compile(
+ r'((?:/|-|--)[-_a-zA-Z0-9]+)(\s*.*?)(?=,\s+(?:/|-|--)|$)')
+
+
+class GenericObject(ObjectDescription):
+ """
+ A generic x-ref directive registered with Sphinx.add_object_type().
+ """
+ indextemplate = ''
+ parse_node = None
+
+ def handle_signature(self, sig, signode):
+ if self.parse_node:
+ name = self.parse_node(self.env, sig, signode)
+ else:
+ signode.clear()
+ signode += addnodes.desc_name(sig, sig)
+ # normalize whitespace like XRefRole does
+ name = ws_re.sub('', sig)
+ return name
+
+ def add_target_and_index(self, name, sig, signode):
+ targetname = '%s-%s' % (self.objtype, name)
+ signode['ids'].append(targetname)
+ self.state.document.note_explicit_target(signode)
+ if self.indextemplate:
+ colon = self.indextemplate.find(':')
+ if colon != -1:
+ indextype = self.indextemplate[:colon].strip()
+ indexentry = self.indextemplate[colon+1:].strip() % (name,)
+ else:
+ indextype = 'single'
+ indexentry = self.indextemplate % (name,)
+ self.indexnode['entries'].append((indextype, indexentry,
+ targetname, targetname))
+ self.env.domaindata['std']['objects'][self.objtype, name] = \
+ self.env.docname, targetname
+
+
+class EnvVar(GenericObject):
+ indextemplate = l_('environment variable; %s')
+
+
+class EnvVarXRefRole(XRefRole):
+ """
+ Cross-referencing role for environment variables (adds an index entry).
+ """
+
+ def result_nodes(self, document, env, node, is_ref):
+ if not is_ref:
+ return [node], []
+ varname = node['reftarget']
+ tgtid = 'index-%s' % env.new_serialno('index')
+ indexnode = addnodes.index()
+ indexnode['entries'] = [
+ ('single', varname, tgtid, varname),
+ ('single', _('environment variable; %s') % varname, tgtid, varname)
+ ]
+ targetnode = nodes.target('', '', ids=[tgtid])
+ document.note_explicit_target(targetnode)
+ return [indexnode, targetnode, node], []
+
+
+class Target(Directive):
+ """
+ Generic target for user-defined cross-reference types.
+ """
+ indextemplate = ''
+
+ has_content = False
+ required_arguments = 1
+ optional_arguments = 0
+ final_argument_whitespace = True
+ option_spec = {}
+
+ def run(self):
+ env = self.state.document.settings.env
+ # normalize whitespace in fullname like XRefRole does
+ fullname = ws_re.sub(' ', self.arguments[0].strip())
+ targetname = '%s-%s' % (self.name, fullname)
+ node = nodes.target('', '', ids=[targetname])
+ self.state.document.note_explicit_target(node)
+ ret = [node]
+ if self.indextemplate:
+ indexentry = self.indextemplate % (fullname,)
+ indextype = 'single'
+ colon = indexentry.find(':')
+ if colon != -1:
+ indextype = indexentry[:colon].strip()
+ indexentry = indexentry[colon+1:].strip()
+ inode = addnodes.index(entries=[(indextype, indexentry,
+ targetname, targetname)])
+ ret.insert(0, inode)
+ name = self.name
+ if ':' in self.name:
+ _, name = self.name.split(':', 1)
+ env.domaindata['std']['objects'][name, fullname] = \
+ env.docname, targetname
+ return ret
+
+
+class Cmdoption(ObjectDescription):
+ """
+ Description of a command-line option (.. cmdoption).
+ """
+
+ def handle_signature(self, sig, signode):
+ """Transform an option description into RST nodes."""
+ count = 0
+ firstname = ''
+ for m in option_desc_re.finditer(sig):
+ optname, args = m.groups()
+ if count:
+ signode += addnodes.desc_addname(', ', ', ')
+ signode += addnodes.desc_name(optname, optname)
+ signode += addnodes.desc_addname(args, args)
+ if not count:
+ firstname = optname
+ count += 1
+ if not firstname:
+ raise ValueError
+ return firstname
+
+ def add_target_and_index(self, name, sig, signode):
+ targetname = name.replace('/', '-')
+ currprogram = self.env.temp_data.get('std:program')
+ if currprogram:
+ targetname = '-' + currprogram + targetname
+ targetname = 'cmdoption' + targetname
+ signode['ids'].append(targetname)
+ self.state.document.note_explicit_target(signode)
+ self.indexnode['entries'].append(
+ ('pair', _('%scommand line option; %s') %
+ ((currprogram and currprogram + ' ' or ''), sig),
+ targetname, targetname))
+ self.env.domaindata['std']['progoptions'][currprogram, name] = \
+ self.env.docname, targetname
+
+
+class Program(Directive):
+ """
+ Directive to name the program for which options are documented.
+ """
+
+ has_content = False
+ required_arguments = 1
+ optional_arguments = 0
+ final_argument_whitespace = True
+ option_spec = {}
+
+ def run(self):
+ env = self.state.document.settings.env
+ program = ws_re.sub('-', self.arguments[0].strip())
+ if program == 'None':
+ env.temp_data['std:program'] = None
+ else:
+ env.temp_data['std:program'] = program
+ return []
+
+
+class OptionXRefRole(XRefRole):
+ innernodeclass = addnodes.literal_emphasis
+
+ def process_link(self, env, refnode, has_explicit_title, title, target):
+ program = env.temp_data.get('std:program')
+ if not has_explicit_title:
+ if ' ' in title and not (title.startswith('/') or
+ title.startswith('-')):
+ program, target = re.split(' (?=-|--|/)', title, 1)
+ program = ws_re.sub('-', program)
+ target = target.strip()
+ elif ' ' in target:
+ program, target = re.split(' (?=-|--|/)', target, 1)
+ program = ws_re.sub('-', program)
+ refnode['refprogram'] = program
+ return title, target
+
+
+class Glossary(Directive):
+ """
+ Directive to create a glossary with cross-reference targets
+ for :term: roles.
+ """
+
+ has_content = True
+ required_arguments = 0
+ optional_arguments = 0
+ final_argument_whitespace = False
+ option_spec = {
+ 'sorted': directives.flag,
+ }
+
+ def run(self):
+ env = self.state.document.settings.env
+ objects = env.domaindata['std']['objects']
+ gloss_entries = env.temp_data.setdefault('gloss_entries', set())
+ node = addnodes.glossary()
+ node.document = self.state.document
+ self.state.nested_parse(self.content, self.content_offset, node)
+
+ # the content should be definition lists
+ dls = [child for child in node
+ if isinstance(child, nodes.definition_list)]
+ # now, extract definition terms to enable cross-reference creation
+ new_dl = nodes.definition_list()
+ new_dl['classes'].append('glossary')
+ items = []
+ for dl in dls:
+ for li in dl.children:
+ if not li.children or not isinstance(li[0], nodes.term):
+ continue
+ termtext = li.children[0].astext()
+ new_id = 'term-' + nodes.make_id(termtext)
+ if new_id in gloss_entries:
+ new_id = 'term-' + str(len(gloss_entries))
+ gloss_entries.add(new_id)
+ li[0]['names'].append(new_id)
+ li[0]['ids'].append(new_id)
+ objects['term', termtext.lower()] = env.docname, new_id
+ # add an index entry too
+ indexnode = addnodes.index()
+ indexnode['entries'] = [('single', termtext, new_id, termtext)]
+ li.insert(0, indexnode)
+ items.append((termtext, li))
+ if 'sorted' in self.options:
+ items.sort(key=lambda x: x[0].lower())
+ new_dl.extend(item[1] for item in items)
+ node.children = [new_dl]
+ return [node]
+
+
+token_re = re.compile('`([a-z_][a-z0-9_]*)`')
+
+def token_xrefs(text):
+ retnodes = []
+ pos = 0
+ for m in token_re.finditer(text):
+ if m.start() > pos:
+ txt = text[pos:m.start()]
+ retnodes.append(nodes.Text(txt, txt))
+ refnode = addnodes.pending_xref(
+ m.group(1), reftype='token', refdomain='std', reftarget=m.group(1))
+ refnode += nodes.literal(m.group(1), m.group(1), classes=['xref'])
+ retnodes.append(refnode)
+ pos = m.end()
+ if pos < len(text):
+ retnodes.append(nodes.Text(text[pos:], text[pos:]))
+ return retnodes
+
+
+class ProductionList(Directive):
+ """
+ Directive to list grammar productions.
+ """
+
+ has_content = False
+ required_arguments = 1
+ optional_arguments = 0
+ final_argument_whitespace = True
+ option_spec = {}
+
+ def run(self):
+ env = self.state.document.settings.env
+ objects = env.domaindata['std']['objects']
+ node = addnodes.productionlist()
+ messages = []
+ i = 0
+
+ for rule in self.arguments[0].split('\n'):
+ if i == 0 and ':' not in rule:
+ # production group
+ continue
+ i += 1
+ try:
+ name, tokens = rule.split(':', 1)
+ except ValueError:
+ break
+ subnode = addnodes.production()
+ subnode['tokenname'] = name.strip()
+ if subnode['tokenname']:
+ idname = 'grammar-token-%s' % subnode['tokenname']
+ if idname not in self.state.document.ids:
+ subnode['ids'].append(idname)
+ self.state.document.note_implicit_target(subnode, subnode)
+ objects['token', subnode['tokenname']] = env.docname, idname
+ subnode.extend(token_xrefs(tokens))
+ node.append(subnode)
+ return [node] + messages
+
+
+class StandardDomain(Domain):
+ """
+ Domain for all objects that don't fit into another domain or are added
+ via the application interface.
+ """
+
+ name = 'std'
+ label = 'Default'
+
+ object_types = {
+ 'term': ObjType(l_('glossary term'), 'term', searchprio=-1),
+ 'token': ObjType(l_('grammar token'), 'token', searchprio=-1),
+ 'label': ObjType(l_('reference label'), 'ref', searchprio=-1),
+ 'envvar': ObjType(l_('environment variable'), 'envvar'),
+ 'cmdoption': ObjType(l_('program option'), 'option'),
+ }
+
+ directives = {
+ 'program': Program,
+ 'cmdoption': Cmdoption, # old name for backwards compatibility
+ 'option': Cmdoption,
+ 'envvar': EnvVar,
+ 'glossary': Glossary,
+ 'productionlist': ProductionList,
+ }
+ roles = {
+ 'option': OptionXRefRole(innernodeclass=addnodes.literal_emphasis),
+ 'envvar': EnvVarXRefRole(),
+ # links to tokens in grammar productions
+ 'token': XRefRole(),
+ # links to terms in glossary
+ 'term': XRefRole(lowercase=True, innernodeclass=nodes.emphasis),
+ # links to headings or arbitrary labels
+ 'ref': XRefRole(lowercase=True, innernodeclass=nodes.emphasis),
+ # links to labels, without a different title
+ 'keyword': XRefRole(),
+ }
+
+ initial_data = {
+ 'progoptions': {}, # (program, name) -> docname, labelid
+ 'objects': {}, # (type, name) -> docname, labelid
+ 'labels': { # labelname -> docname, labelid, sectionname
+ 'genindex': ('genindex', '', l_('Index')),
+ 'modindex': ('py-modindex', '', l_('Module Index')),
+ 'search': ('search', '', l_('Search Page')),
+ },
+ 'anonlabels': { # labelname -> docname, labelid
+ 'genindex': ('genindex', ''),
+ 'modindex': ('py-modindex', ''),
+ 'search': ('search', ''),
+ },
+ }
+
+ def clear_doc(self, docname):
+ for key, (fn, _) in self.data['progoptions'].items():
+ if fn == docname:
+ del self.data['progoptions'][key]
+ for key, (fn, _) in self.data['objects'].items():
+ if fn == docname:
+ del self.data['objects'][key]
+ for key, (fn, _, _) in self.data['labels'].items():
+ if fn == docname:
+ del self.data['labels'][key]
+ for key, (fn, _) in self.data['anonlabels'].items():
+ if fn == docname:
+ del self.data['anonlabels'][key]
+
+ def process_doc(self, env, docname, document):
+ labels, anonlabels = self.data['labels'], self.data['anonlabels']
+ for name, explicit in document.nametypes.iteritems():
+ if not explicit:
+ continue
+ labelid = document.nameids[name]
+ if labelid is None:
+ continue
+ node = document.ids[labelid]
+ if name.isdigit() or node.has_key('refuri') or \
+ node.tagname.startswith('desc_'):
+ # ignore footnote labels, labels automatically generated from a
+ # link and object descriptions
+ continue
+ if name in labels:
+ env.warn(docname, 'duplicate label %s, ' % name +
+ 'other instance in ' + env.doc2path(labels[name][0]),
+ node.line)
+ anonlabels[name] = docname, labelid
+ if node.tagname == 'section':
+ sectname = clean_astext(node[0]) # node[0] == title node
+ elif node.tagname == 'figure':
+ for n in node:
+ if n.tagname == 'caption':
+ sectname = clean_astext(n)
+ break
+ else:
+ continue
+ else:
+ # anonymous-only labels
+ continue
+ labels[name] = docname, labelid, sectname
+
+ def resolve_xref(self, env, fromdocname, builder,
+ typ, target, node, contnode):
+ if typ == 'ref':
+ #refdoc = node.get('refdoc', fromdocname)
+ if node['refexplicit']:
+ # reference to anonymous label; the reference uses
+ # the supplied link caption
+ docname, labelid = self.data['anonlabels'].get(target, ('',''))
+ sectname = node.astext()
+ # XXX warn somehow if not resolved by intersphinx
+ #if not docname:
+ # env.warn(refdoc, 'undefined label: %s' %
+ # target, node.line)
+ else:
+ # reference to named label; the final node will
+ # contain the section name after the label
+ docname, labelid, sectname = self.data['labels'].get(target,
+ ('','',''))
+ # XXX warn somehow if not resolved by intersphinx
+ #if not docname:
+ # env.warn(refdoc,
+ # 'undefined label: %s' % target + ' -- if you '
+ # 'don\'t give a link caption the label must '
+ # 'precede a section header.', node.line)
+ if not docname:
+ return None
+ newnode = nodes.reference('', '', internal=True)
+ innernode = nodes.emphasis(sectname, sectname)
+ if docname == fromdocname:
+ newnode['refid'] = labelid
+ else:
+ # set more info in contnode; in case the
+ # get_relative_uri call raises NoUri,
+ # the builder will then have to resolve these
+ contnode = addnodes.pending_xref('')
+ contnode['refdocname'] = docname
+ contnode['refsectname'] = sectname
+ newnode['refuri'] = builder.get_relative_uri(
+ fromdocname, docname)
+ if labelid:
+ newnode['refuri'] += '#' + labelid
+ newnode.append(innernode)
+ return newnode
+ elif typ == 'keyword':
+ # keywords are oddballs: they are referenced by named labels
+ docname, labelid, _ = self.data['labels'].get(target, ('','',''))
+ if not docname:
+ #env.warn(refdoc, 'unknown keyword: %s' % target)
+ return None
+ else:
+ return make_refnode(builder, fromdocname, docname,
+ labelid, contnode)
+ elif typ == 'option':
+ progname = node['refprogram']
+ docname, labelid = self.data['progoptions'].get((progname, target),
+ ('', ''))
+ if not docname:
+ return None
+ else:
+ return make_refnode(builder, fromdocname, docname,
+ labelid, contnode)
+ else:
+ docname, labelid = self.data['objects'].get((typ, target), ('', ''))
+ if not docname:
+ if typ == 'term':
+ env.warn(node.get('refdoc', fromdocname),
+ 'term not in glossary: %s' % target, node.line)
+ return None
+ else:
+ return make_refnode(builder, fromdocname, docname,
+ labelid, contnode)
+
+ def get_objects(self):
+ for (prog, option), info in self.data['progoptions'].iteritems():
+ yield (option, option, 'option', info[0], info[1], 1)
+ for (type, name), info in self.data['objects'].iteritems():
+ yield (name, name, type, info[0], info[1],
+ self.object_types[type].attrs['searchprio'])
+ for name, info in self.data['labels'].iteritems():
+ yield (name, info[2], 'label', info[0], info[1], -1)
+
+ def get_type_name(self, type, primary=False):
+ # never prepend "Default"
+ return type.lname
diff --git a/sphinx/environment.py b/sphinx/environment.py
index 96eb3b0a0..c8b3f018c 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
@@ -28,7 +26,7 @@ from docutils.io import FileInput, NullOutput
from docutils.core import Publisher
from docutils.utils import Reporter, relative_path
from docutils.readers import standalone
-from docutils.parsers.rst import roles
+from docutils.parsers.rst import roles, directives
from docutils.parsers.rst.languages import en as english
from docutils.parsers.rst.directives.html import MetaBody
from docutils.writers import UnfilteredWriter
@@ -36,10 +34,20 @@ 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.errors import SphinxError
-from sphinx.directives import additional_xref_types
+from sphinx.util import url_re, get_matching_docs, docname_join, \
+ FilenameUniqDict
+from sphinx.util.nodes import clean_astext, make_refnode
+from sphinx.util.osutil import movefile, SEP, ustrftime
+from sphinx.util.matching import compile_matchers
+from sphinx.errors import SphinxError, ExtensionError
+from sphinx.locale import _
+
+
+orig_role_function = roles.role
+orig_directive_function = directives.directive
+
+class ElementLookupError(Exception): pass
+
default_settings = {
'embed_stylesheet': False,
@@ -53,7 +61,7 @@ default_settings = {
# This is increased every time an environment attribute is added
# or changed to properly invalidate pickle files.
-ENV_VERSION = 31
+ENV_VERSION = 36
default_substitutions = set([
@@ -101,7 +109,10 @@ class DefaultSubstitutions(Transform):
class MoveModuleTargets(Transform):
"""
- Move module targets to their nearest enclosing section title.
+ Move module targets that are the first thing in a section to the section
+ title.
+
+ XXX Python specific
"""
default_priority = 210
@@ -109,10 +120,11 @@ class MoveModuleTargets(Transform):
for node in self.document.traverse(nodes.target):
if not node['ids']:
continue
- if node['ids'][0].startswith('module-') and \
- node.parent.__class__ is nodes.section and \
- node.has_key('ismod'):
- node.parent['ids'] = node['ids']
+ if (node.has_key('ismod') and
+ node.parent.__class__ is nodes.section and
+ # index 0 is the section title node
+ node.parent.index(node) == 1):
+ node.parent['ids'][0:0] = node['ids']
node.parent.remove(node)
@@ -143,7 +155,8 @@ class SortIds(Transform):
class CitationReferences(Transform):
"""
- Handle citation references before the default docutils transform does.
+ Replace citation references by pending_xref nodes before the default
+ docutils transform tries to resolve them.
"""
default_priority = 619
@@ -204,9 +217,9 @@ class BuildEnvironment:
env = pickle.load(picklefile)
finally:
picklefile.close()
- env.config.values = config.values
if env.version != ENV_VERSION:
raise IOError('env version not current')
+ env.config.values = config.values
return env
def topickle(self, filename):
@@ -215,6 +228,8 @@ class BuildEnvironment:
self.set_warnfunc(None)
values = self.config.values
del self.config.values
+ domains = self.domains
+ del self.domains
# first write to a temporary file, so that if dumping fails,
# the existing environment won't be overwritten
picklefile = open(filename + '.tmp', 'wb')
@@ -231,6 +246,7 @@ class BuildEnvironment:
picklefile.close()
movefile(filename + '.tmp', filename)
# reset attributes
+ self.domains = domains
self.config.values = values
self.set_warnfunc(warnfunc)
@@ -244,6 +260,9 @@ class BuildEnvironment:
# the application object; only set while update() runs
self.app = None
+ # all the registered domains, set by the application
+ self.domains = {}
+
# the docutils settings for building
self.settings = default_settings.copy()
self.settings['env'] = self
@@ -282,18 +301,11 @@ class BuildEnvironment:
self.glob_toctrees = set() # docnames that have :glob: toctrees
self.numbered_toctrees = set() # docnames that have :numbered: toctrees
- # X-ref target inventory
- self.descrefs = {} # fullname -> docname, desctype
- self.filemodules = {} # docname -> [modules]
- self.modules = {} # modname -> docname, synopsis,
- # platform, deprecated
- self.labels = {} # labelname -> docname, labelid, sectionname
- self.anonlabels = {} # labelname -> docname, labelid
- self.progoptions = {} # (program, name) -> docname, labelid
- self.reftargets = {} # (type, name) -> docname, labelid
- # type: term, token, envvar, citation
+ # domain-specific inventories, here to be pickled
+ self.domaindata = {} # domainname -> domain-specific dict
# Other inventories
+ self.citations = {} # citation name -> docname, labelid
self.indexentries = {} # docname -> list of
# (type, string, target, aliasname)
self.versionchanges = {} # version -> list of (type, docname,
@@ -303,22 +315,8 @@ class BuildEnvironment:
self.images = FilenameUniqDict()
self.dlfiles = FilenameUniqDict()
- # These are set while parsing a file
- self.docname = None # current document name
- self.currmodule = None # current module name
- self.currclass = None # current class name
- self.currdesc = None # current descref name
- self.currprogram = None # current program name
- self.index_num = 0 # autonumber for index targets
- self.gloss_entries = set() # existing definition labels
-
- # Some magically present labels
- def add_magic_label(name, description):
- self.labels[name] = (name, '', description)
- self.anonlabels[name] = (name, '')
- add_magic_label('genindex', _('Index'))
- add_magic_label('modindex', _('Module Index'))
- add_magic_label('search', _('Search Page'))
+ # temporary data storage while reading a document
+ self.temp_data = {}
def set_warnfunc(self, func):
self._warnfunc = func
@@ -344,7 +342,6 @@ class BuildEnvironment:
self.toc_secnumbers.pop(docname, None)
self.toc_num_entries.pop(docname, None)
self.toctree_includes.pop(docname, None)
- self.filemodules.pop(docname, None)
self.indexentries.pop(docname, None)
self.glob_toctrees.discard(docname)
self.numbered_toctrees.discard(docname)
@@ -355,25 +352,16 @@ class BuildEnvironment:
fnset.discard(docname)
if not fnset:
del self.files_to_rebuild[subfn]
- for fullname, (fn, _) in self.descrefs.items():
+ for key, (fn, _) in self.citations.items():
if fn == docname:
- del self.descrefs[fullname]
- for modname, (fn, _, _, _) in self.modules.items():
- if fn == docname:
- del self.modules[modname]
- for labelname, (fn, _, _) in self.labels.items():
- if fn == docname:
- del self.labels[labelname]
- for key, (fn, _) in self.reftargets.items():
- if fn == docname:
- del self.reftargets[key]
- for key, (fn, _) in self.progoptions.items():
- if fn == docname:
- del self.progoptions[key]
+ del self.citations[key]
for version, changes in self.versionchanges.items():
new = [change for change in changes if change[1] != docname]
changes[:] = new
+ for domain in self.domains.values():
+ domain.clear_doc(docname)
+
def doc2path(self, docname, base=True, suffix=None):
"""
Return the filename for the document name.
@@ -395,14 +383,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):
"""
@@ -531,9 +520,7 @@ class BuildEnvironment:
# --------- SINGLE FILE READING --------------------------------------------
def warn_and_replace(self, error):
- """
- Custom decoding error handler that warns and replaces.
- """
+ """Custom decoding error handler that warns and replaces."""
linestart = error.object.rfind('\n', 0, error.start)
lineend = error.object.find('\n', error.start)
if lineend == -1: lineend = len(error.object)
@@ -545,6 +532,51 @@ class BuildEnvironment:
error.object[error.end:lineend]), lineno)
return (u'?', error.end)
+ def lookup_domain_element(self, type, name):
+ """Lookup a markup element (directive or role), given its name which can
+ be a full name (with domain).
+ """
+ name = name.lower()
+ # explicit domain given?
+ if ':' in name:
+ domain_name, name = name.split(':', 1)
+ if domain_name in self.domains:
+ domain = self.domains[domain_name]
+ element = getattr(domain, type)(name)
+ if element is not None:
+ return element, []
+ # else look in the default domain
+ else:
+ def_domain = self.temp_data.get('default_domain')
+ if def_domain is not None:
+ element = getattr(def_domain, type)(name)
+ if element is not None:
+ return element, []
+ # always look in the std domain
+ element = getattr(self.domains['std'], type)(name)
+ if element is not None:
+ return element, []
+ raise ElementLookupError
+
+ def patch_lookup_functions(self):
+ """Monkey-patch directive and role dispatch, so that domain-specific
+ markup takes precedence.
+ """
+ def directive(name, lang_module, document):
+ try:
+ return self.lookup_domain_element('directive', name)
+ except ElementLookupError:
+ return orig_directive_function(name, lang_module, document)
+
+ def role(name, lang_module, lineno, reporter):
+ try:
+ return self.lookup_domain_element('role', name)
+ except ElementLookupError:
+ return orig_role_function(name, lang_module, lineno, reporter)
+
+ directives.directive = directive
+ roles.role = role
+
def read_doc(self, docname, src_path=None, save_parsed=True, app=None):
"""
Parse a file and add/update inventory entries for the doctree.
@@ -553,11 +585,23 @@ class BuildEnvironment:
# remove all inventory entries for that file
if app:
app.emit('env-purge-doc', self, docname)
+
self.clear_doc(docname)
if src_path is None:
src_path = self.doc2path(docname)
+ self.temp_data['docname'] = docname
+ # defaults to the global default, but can be re-set in a document
+ self.temp_data['default_domain'] = \
+ self.domains.get(self.config.primary_domain)
+
+ self.settings['input_encoding'] = self.config.source_encoding
+ self.settings['trim_footnote_reference_space'] = \
+ self.config.trim_footnote_reference_space
+
+ self.patch_lookup_functions()
+
if self.config.default_role:
role_fn, messages = roles.role(self.config.default_role, english,
0, dummy_reporter)
@@ -567,13 +611,6 @@ class BuildEnvironment:
self.warn(docname, 'default role %s not found' %
self.config.default_role)
- self.docname = docname
- self.settings['input_encoding'] = self.config.source_encoding
- self.settings['trim_footnote_reference_space'] = \
- self.config.trim_footnote_reference_space
-
- codecs.register_error('sphinx', self.warn_and_replace)
-
codecs.register_error('sphinx', self.warn_and_replace)
class SphinxSourceClass(FileInput):
@@ -587,9 +624,10 @@ class BuildEnvironment:
app.emit('source-read', docname, arg)
data = arg[0]
if self.config.rst_epilog:
- return data + '\n' + self.config.rst_epilog + '\n'
- else:
- return data
+ data = data + '\n' + self.config.rst_epilog + '\n'
+ if self.config.rst_prolog:
+ data = self.config.rst_prolog + '\n' + data
+ return data
# publish manually
pub = Publisher(reader=SphinxStandaloneReader(),
@@ -605,23 +643,28 @@ class BuildEnvironment:
doctree = pub.document
except UnicodeError, err:
raise SphinxError(str(err))
+
+ # post-processing
self.filter_messages(doctree)
self.process_dependencies(docname, doctree)
self.process_images(docname, doctree)
self.process_downloads(docname, doctree)
self.process_metadata(docname, doctree)
+ self.process_refonly_bullet_lists(docname, doctree)
self.create_title_from(docname, doctree)
- self.note_labels_from(docname, doctree)
self.note_indexentries_from(docname, doctree)
self.note_citations_from(docname, doctree)
self.build_toc_from(docname, doctree)
+ for domain in self.domains.itervalues():
+ domain.process_doc(self, docname, doctree)
- # store time of build, for outdated files detection
- self.all_docs[docname] = time.time()
-
+ # allow extension-specific post-processing
if app:
app.emit('doctree-read', doctree)
+ # store time of build, for outdated files detection
+ self.all_docs[docname] = time.time()
+
# make it picklable
doctree.reporter = None
doctree.transformer = None
@@ -633,10 +676,7 @@ class BuildEnvironment:
metanode.__class__ = addnodes.meta
# cleanup
- self.docname = None
- self.currmodule = None
- self.currclass = None
- self.gloss_entries = set()
+ self.temp_data.clear()
if save_parsed:
# save the parsed doctree
@@ -653,6 +693,35 @@ class BuildEnvironment:
else:
return doctree
+ # utilities to use while reading a document
+
+ @property
+ def docname(self):
+ """Backwards compatible alias."""
+ return self.temp_data['docname']
+
+ @property
+ def currmodule(self):
+ """Backwards compatible alias."""
+ return self.temp_data.get('py:module')
+
+ @property
+ def currclass(self):
+ """Backwards compatible alias."""
+ return self.temp_data.get('py:class')
+
+ def new_serialno(self, category=''):
+ """Return a serial number, e.g. for index entry targets."""
+ key = category + 'serialno'
+ cur = self.temp_data.get(key, 0)
+ self.temp_data[key] = cur + 1
+ return cur
+
+ def note_dependency(self, filename):
+ self.dependencies.setdefault(self.docname, set()).add(filename)
+
+ # post-processing of read doctrees
+
def filter_messages(self, doctree):
"""
Filter system messages from a doctree.
@@ -757,6 +826,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,14 +838,77 @@ 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]
+ def process_refonly_bullet_lists(self, docname, doctree):
+ """Change refonly bullet lists to use compact_paragraphs.
+
+ Specifically implemented for 'Indices and Tables' section, which looks
+ odd when html_compact_lists is false.
+ """
+ if self.config.html_compact_lists:
+ return
+
+ class RefOnlyListChecker(nodes.GenericNodeVisitor):
+ """Raise `nodes.NodeFound` if non-simple list item is encountered.
+
+ Here 'simple' means a list item containing only a paragraph with a
+ single reference in it.
+ """
+
+ def default_visit(self, node):
+ raise nodes.NodeFound
+
+ def visit_bullet_list(self, node):
+ pass
+
+ def visit_list_item(self, node):
+ children = []
+ for child in node.children:
+ if not isinstance(child, nodes.Invisible):
+ children.append(child)
+ if len(children) != 1:
+ raise nodes.NodeFound
+ if not isinstance(children[0], nodes.paragraph):
+ raise nodes.NodeFound
+ para = children[0]
+ if len(para) != 1:
+ raise nodes.NodeFound
+ if not isinstance(para[0], addnodes.pending_xref):
+ raise nodes.NodeFound
+ raise nodes.SkipChildren
+
+ def invisible_visit(self, node):
+ """Invisible nodes should be ignored."""
+ pass
+
+ def check_refonly_list(node):
+ """Check for list with only references in it."""
+ visitor = RefOnlyListChecker(doctree)
+ try:
+ node.walk(visitor)
+ except nodes.NodeFound:
+ return False
+ else:
+ return True
+
+ for node in doctree.traverse(nodes.bullet_list):
+ if check_refonly_list(node):
+ for item in node.traverse(nodes.list_item):
+ para = item[0]
+ ref = para[0]
+ compact_para = addnodes.compact_paragraph()
+ compact_para += ref
+ item.replace(para, compact_para)
+
def create_title_from(self, docname, document):
"""
Add a title node to the document (just copy the first section title),
@@ -800,39 +933,6 @@ class BuildEnvironment:
self.titles[docname] = titlenode
self.longtitles[docname] = longtitlenode
- def note_labels_from(self, docname, document):
- for name, explicit in document.nametypes.iteritems():
- if not explicit:
- continue
- labelid = document.nameids[name]
- if labelid is None:
- continue
- node = document.ids[labelid]
- if name.isdigit() or node.has_key('refuri') or \
- node.tagname.startswith('desc_'):
- # ignore footnote labels, labels automatically generated from a
- # link and description units
- continue
- if name in self.labels:
- self.warn(docname, 'duplicate label %s, ' % name +
- 'other instance in ' +
- self.doc2path(self.labels[name][0]),
- node.line)
- self.anonlabels[name] = docname, labelid
- if node.tagname == 'section':
- sectname = clean_astext(node[0]) # node[0] == title node
- elif node.tagname == 'figure':
- for n in node:
- if n.tagname == 'caption':
- sectname = clean_astext(n)
- break
- else:
- continue
- else:
- # anonymous-only labels
- continue
- self.labels[name] = docname, labelid, sectname
-
def note_indexentries_from(self, docname, document):
entries = self.indexentries[docname] = []
for node in document.traverse(addnodes.index):
@@ -841,11 +941,11 @@ class BuildEnvironment:
def note_citations_from(self, docname, document):
for node in document.traverse(nodes.citation):
label = node[0].astext()
- if ('citation', label) in self.reftargets:
+ if label in self.citations:
self.warn(docname, 'duplicate citation %s, ' % label +
'other instance in %s' % self.doc2path(
- self.reftargets['citation', label][0]), node.line)
- self.reftargets['citation', label] = (docname, node['ids'][0])
+ self.citations[label][0]), node.line)
+ self.citations[label] = (docname, node['ids'][0])
def note_toctree(self, docname, toctreenode):
"""Note a TOC tree directive in a document and gather information about
@@ -908,9 +1008,9 @@ class BuildEnvironment:
else:
anchorname = '#' + sectionnode['ids'][0]
numentries[0] += 1
- reference = nodes.reference('', '', refuri=docname,
- anchorname=anchorname,
- *nodetext)
+ reference = nodes.reference(
+ '', '', internal=True, refuri=docname,
+ anchorname=anchorname, *nodetext)
para = addnodes.compact_paragraph('', '', reference)
item = nodes.list_item('', para)
if maxdepth == 0 or depth < maxdepth:
@@ -933,13 +1033,14 @@ class BuildEnvironment:
node['refuri'] = node['anchorname'] or '#'
return toc
- def get_toctree_for(self, docname, builder, collapse):
+ def get_toctree_for(self, docname, builder, collapse, maxdepth=0):
"""Return the global TOC nodetree."""
doctree = self.get_doctree(self.config.master_doc)
toctrees = []
for toctreenode in doctree.traverse(addnodes.toctree):
toctree = self.resolve_toctree(docname, builder, toctreenode,
prune=True, collapse=collapse,
+ maxdepth=maxdepth,
includehidden=True)
toctrees.append(toctree)
if not toctrees:
@@ -949,37 +1050,13 @@ class BuildEnvironment:
result.extend(toctree.children)
return result
- # -------
- # these are called from docutils directives and therefore use self.docname
- #
- def note_descref(self, fullname, desctype, line):
- if fullname in self.descrefs:
- self.warn(self.docname,
- 'duplicate canonical description name %s, ' % fullname +
- 'other instance in ' +
- self.doc2path(self.descrefs[fullname][0]) +
- ', use :noindex: for one of them',
- line)
- self.descrefs[fullname] = (self.docname, desctype)
-
- def note_module(self, modname, synopsis, platform, deprecated):
- self.modules[modname] = (self.docname, synopsis, platform, deprecated)
- self.filemodules.setdefault(self.docname, []).append(modname)
-
- def note_progoption(self, optname, labelid):
- self.progoptions[self.currprogram, optname] = (self.docname, labelid)
-
- def note_reftarget(self, type, name, labelid):
- self.reftargets[type, name] = (self.docname, labelid)
-
- def note_versionchange(self, type, version, node, lineno):
- self.versionchanges.setdefault(version, []).append(
- (type, self.docname, lineno, self.currmodule, self.currdesc,
- node.astext()))
-
- def note_dependency(self, filename):
- self.dependencies.setdefault(self.docname, set()).add(filename)
- # -------
+ def get_domain(self, domainname):
+ """Return the domain instance with the specified name.
+ Raises an ExtensionError if the domain is not registered."""
+ try:
+ return self.domains[domainname]
+ except KeyError:
+ raise ExtensionError('Domain %r is not registered' % domainname)
# --------- RESOLVING REFERENCES AND TOCTREES ------------------------------
@@ -1071,7 +1148,7 @@ class BuildEnvironment:
for (title, ref) in refs:
try:
if url_re.match(ref):
- reference = nodes.reference('', '',
+ reference = nodes.reference('', '', internal=False,
refuri=ref, anchorname='',
*[nodes.Text(title)])
para = addnodes.compact_paragraph('', '', reference)
@@ -1083,7 +1160,7 @@ class BuildEnvironment:
ref = toctreenode['parent']
if not title:
title = clean_astext(self.titles[ref])
- reference = nodes.reference('', '',
+ reference = nodes.reference('', '', internal=True,
refuri=ref,
anchorname='',
*[nodes.Text(title)])
@@ -1139,6 +1216,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
@@ -1161,180 +1240,68 @@ class BuildEnvironment:
docname, refnode['refuri']) + refnode['anchorname']
return newnode
- descroles = frozenset(('data', 'exc', 'func', 'class', 'const',
- 'attr', 'obj', 'meth', 'cfunc', 'cmember',
- 'cdata', 'ctype', 'cmacro'))
-
def resolve_references(self, doctree, fromdocname, builder):
- reftarget_roles = set(('token', 'term', 'citation'))
- # add all custom xref types too
- reftarget_roles.update(i[0] for i in additional_xref_types.values())
-
for node in doctree.traverse(addnodes.pending_xref):
contnode = node[0].deepcopy()
newnode = None
typ = node['reftype']
target = node['reftarget']
+ refdoc = node.get('refdoc', fromdocname)
+ warned = False
try:
- if typ == 'ref':
- if node['refcaption']:
- # reference to anonymous label; the reference uses
- # the supplied link caption
- docname, labelid = self.anonlabels.get(target, ('',''))
- sectname = node.astext()
- if not docname:
- self.warn(node['refdoc'], 'undefined label: %s' %
- target, node.line)
- else:
- # reference to the named label; the final node will
- # contain the section name after the label
- docname, labelid, sectname = self.labels.get(target,
- ('','',''))
- if not docname:
- self.warn(
- node['refdoc'],
- 'undefined label: %s' % target + ' -- if you '
- 'don\'t give a link caption the label must '
- 'precede a section header.', node.line)
- if docname:
- newnode = nodes.reference('', '')
- innernode = nodes.emphasis(sectname, sectname)
- if docname == fromdocname:
- newnode['refid'] = labelid
- else:
- # set more info in contnode; in case the
- # get_relative_uri call raises NoUri,
- # the builder will then have to resolve these
- contnode = addnodes.pending_xref('')
- contnode['refdocname'] = docname
- contnode['refsectname'] = sectname
- newnode['refuri'] = builder.get_relative_uri(
- fromdocname, docname)
- if labelid:
- newnode['refuri'] += '#' + labelid
- newnode.append(innernode)
- else:
- newnode = contnode
+ if node.has_key('refdomain') and node['refdomain']:
+ # let the domain try to resolve the reference
+ try:
+ domain = self.domains[node['refdomain']]
+ except KeyError:
+ raise NoUri
+ newnode = domain.resolve_xref(self, fromdocname, builder,
+ typ, target, node, contnode)
+ # really hardwired reference types
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'],
+ self.warn(refdoc,
'unknown document: %s' % docname, node.line)
- newnode = contnode
+ warned = True
else:
- if node['refcaption']:
+ if node['refexplicit']:
# reference with explicit title
caption = node.astext()
else:
caption = clean_astext(self.titles[docname])
innernode = nodes.emphasis(caption, caption)
- newnode = nodes.reference('', '')
+ newnode = nodes.reference('', '', internal=True)
newnode['refuri'] = builder.get_relative_uri(
fromdocname, docname)
newnode.append(innernode)
- elif typ == 'keyword':
- # keywords are referenced by named labels
- docname, labelid, _ = self.labels.get(target, ('','',''))
- if not docname:
- #self.warn(node['refdoc'],
- # 'unknown keyword: %s' % target)
- newnode = contnode
- else:
- newnode = nodes.reference('', '')
- if docname == fromdocname:
- newnode['refid'] = labelid
- else:
- newnode['refuri'] = builder.get_relative_uri(
- fromdocname, docname) + '#' + labelid
- newnode.append(contnode)
- elif typ == 'option':
- progname = node['refprogram']
- docname, labelid = self.progoptions.get((progname, target),
- ('', ''))
- if not docname:
- newnode = contnode
- else:
- newnode = nodes.reference('', '')
- if docname == fromdocname:
- newnode['refid'] = labelid
- else:
- newnode['refuri'] = builder.get_relative_uri(
- fromdocname, docname) + '#' + labelid
- newnode.append(contnode)
- elif typ in reftarget_roles:
- docname, labelid = self.reftargets.get((typ, target),
- ('', ''))
- if not docname:
- if typ == 'term':
- self.warn(node['refdoc'],
- 'term not in glossary: %s' % target,
- node.line)
- elif typ == 'citation':
- self.warn(node['refdoc'],
- 'citation not found: %s' % target,
- node.line)
- newnode = contnode
- else:
- newnode = nodes.reference('', '')
- if docname == fromdocname:
- newnode['refid'] = labelid
- else:
- newnode['refuri'] = builder.get_relative_uri(
- fromdocname, docname, typ) + '#' + labelid
- newnode.append(contnode)
- elif typ == 'mod' or \
- typ == 'obj' and target in self.modules:
- docname, synopsis, platform, deprecated = \
- self.modules.get(target, ('','','', ''))
+ elif typ == 'citation':
+ docname, labelid = self.citations.get(target, ('', ''))
if not docname:
- newnode = builder.app.emit_firstresult(
- 'missing-reference', self, node, contnode)
- if not newnode:
- newnode = contnode
- elif docname == fromdocname:
- # don't link to self
- newnode = contnode
+ self.warn(refdoc,
+ 'citation not found: %s' % target, node.line)
+ warned = True
else:
- newnode = nodes.reference('', '')
- newnode['refuri'] = builder.get_relative_uri(
- fromdocname, docname) + '#module-' + target
- newnode['reftitle'] = '%s%s%s' % (
- (platform and '(%s) ' % platform),
- synopsis, (deprecated and ' (deprecated)' or ''))
- newnode.append(contnode)
- elif typ in self.descroles:
- # "descrefs"
- modname = node['modname']
- clsname = node['classname']
- searchorder = node.hasattr('refspecific') and 1 or 0
- name, desc = self.find_desc(modname, clsname,
- target, typ, searchorder)
- if not desc:
- newnode = builder.app.emit_firstresult(
- 'missing-reference', self, node, contnode)
- if not newnode:
- newnode = contnode
- else:
- newnode = nodes.reference('', '')
- if desc[0] == fromdocname:
- newnode['refid'] = name
- else:
- newnode['refuri'] = (
- builder.get_relative_uri(fromdocname, desc[0])
- + '#' + name)
- newnode['reftitle'] = name
- newnode.append(contnode)
- else:
- raise RuntimeError('unknown xfileref node encountered: %s'
- % node)
+ newnode = make_refnode(builder, fromdocname, docname,
+ labelid, contnode)
+ # no new node found? try the missing-reference event
+ if newnode is None:
+ newnode = builder.app.emit_firstresult(
+ 'missing-reference', self, node, contnode)
+ # still not found? warn if in nit-picky mode
+ if newnode is None and not warned and self.config.nitpicky:
+ self.warn(refdoc,
+ 'reference target not found: %stype %s, target %s'
+ % (node.get('refdomain') and
+ 'domain %s, ' % node['refdomain'] or '',
+ typ, target))
except NoUri:
newnode = contnode
- if newnode:
- node.replace_self(newnode)
+ node.replace_self(newnode or contnode)
for node in doctree.traverse(addnodes.only):
try:
@@ -1498,7 +1465,7 @@ class BuildEnvironment:
i += 1
# group the entries by letter
- def keyfunc((k, v), letters=string.ascii_uppercase + '_'):
+ def keyfunc2((k, v), letters=string.ascii_uppercase + '_'):
# hack: mutating the subitems dicts to a list in the keyfunc
v[1] = sorted((si, se) for (si, (se, void)) in v[1].iteritems())
# now calculate the key
@@ -1509,7 +1476,7 @@ class BuildEnvironment:
# get all other symbols under one heading
return 'Symbols'
return [(key, list(group))
- for (key, group) in groupby(newlist, keyfunc)]
+ for (key, group) in groupby(newlist, keyfunc2)]
def collect_relations(self):
relations = {}
@@ -1564,119 +1531,6 @@ class BuildEnvironment:
if docname == self.config.master_doc:
# the master file is not included anywhere ;)
continue
+ if 'orphan' in self.metadata[docname]:
+ continue
self.warn(docname, 'document isn\'t included in any toctree')
-
- # --------- QUERYING -------------------------------------------------------
-
- def find_desc(self, modname, classname, name, type, searchorder=0):
- """Find a description node matching "name", perhaps using
- the given module and/or classname."""
- # skip parens
- if name[-2:] == '()':
- name = name[:-2]
-
- if not name:
- return None, None
-
- # don't add module and class names for C things
- if type[0] == 'c' and type not in ('class', 'const'):
- # skip trailing star and whitespace
- name = name.rstrip(' *')
- if name in self.descrefs and self.descrefs[name][1][0] == 'c':
- return name, self.descrefs[name]
- return None, None
-
- newname = None
- if searchorder == 1:
- if modname and classname and \
- modname + '.' + classname + '.' + name in self.descrefs:
- newname = modname + '.' + classname + '.' + name
- elif modname and modname + '.' + name in self.descrefs:
- newname = modname + '.' + name
- elif name in self.descrefs:
- newname = name
- else:
- if name in self.descrefs:
- newname = name
- elif classname and classname + '.' + name in self.descrefs:
- newname = classname + '.' + name
- elif modname and modname + '.' + name in self.descrefs:
- newname = modname + '.' + name
- elif modname and classname and \
- modname + '.' + classname + '.' + name in self.descrefs:
- newname = modname + '.' + classname + '.' + name
- # special case: builtin exceptions have module "exceptions" set
- elif type == 'exc' and '.' not in name and \
- 'exceptions.' + name in self.descrefs:
- newname = 'exceptions.' + name
- # special case: object methods
- elif type in ('func', 'meth') and '.' not in name and \
- 'object.' + name in self.descrefs:
- newname = 'object.' + name
- if newname is None:
- return None, None
- return newname, self.descrefs[newname]
-
- def find_keyword(self, keyword, avoid_fuzzy=False, cutoff=0.6, n=20):
- """
- Find keyword matches for a keyword. If there's an exact match,
- just return it, else return a list of fuzzy matches if avoid_fuzzy
- isn't True.
-
- Keywords searched are: first modules, then descrefs.
-
- Returns: None if nothing found
- (type, docname, anchorname) if exact match found
- list of (quality, type, docname, anchorname, description)
- if fuzzy
- """
-
- if keyword in self.modules:
- docname, title, system, deprecated = self.modules[keyword]
- return 'module', docname, 'module-' + keyword
- if keyword in self.descrefs:
- docname, ref_type = self.descrefs[keyword]
- return ref_type, docname, keyword
- # special cases
- if '.' not in keyword:
- # exceptions are documented in the exceptions module
- if 'exceptions.'+keyword in self.descrefs:
- docname, ref_type = self.descrefs['exceptions.'+keyword]
- return ref_type, docname, 'exceptions.'+keyword
- # special methods are documented as object methods
- if 'object.'+keyword in self.descrefs:
- docname, ref_type = self.descrefs['object.'+keyword]
- return ref_type, docname, 'object.'+keyword
-
- if avoid_fuzzy:
- return
-
- # find fuzzy matches
- s = difflib.SequenceMatcher()
- s.set_seq2(keyword.lower())
-
- def possibilities():
- for title, (fn, desc, _, _) in self.modules.iteritems():
- yield ('module', fn, 'module-'+title, desc)
- for title, (fn, desctype) in self.descrefs.iteritems():
- yield (desctype, fn, title, '')
-
- def dotsearch(string):
- parts = string.lower().split('.')
- for idx in xrange(0, len(parts)):
- yield '.'.join(parts[idx:])
-
- result = []
- for type, docname, title, desc in possibilities():
- best_res = 0
- for part in dotsearch(title):
- s.set_seq1(part)
- if s.real_quick_ratio() >= cutoff and \
- s.quick_ratio() >= cutoff and \
- s.ratio() >= cutoff and \
- s.ratio() > best_res:
- best_res = s.ratio()
- if best_res:
- result.append((best_res, type, docname, title, desc))
-
- return heapq.nlargest(n, result)
diff --git a/sphinx/errors.py b/sphinx/errors.py
index 4e62b1af1..b614d9ab0 100644
--- a/sphinx/errors.py
+++ b/sphinx/errors.py
@@ -50,3 +50,15 @@ class ConfigError(SphinxError):
class ThemeError(SphinxError):
category = 'Theme error'
+
+
+class VersionRequirementError(SphinxError):
+ category = 'Sphinx version error'
+
+
+class PycodeError(Exception):
+ def __str__(self):
+ res = self.args[0]
+ if len(self.args) > 1:
+ res += ' (exception was: %r)' % self.args[1]
+ return res
diff --git a/sphinx/ext/autodoc.py b/sphinx/ext/autodoc.py
index 084ae1552..8e5c5ce94 100644
--- a/sphinx/ext/autodoc.py
+++ b/sphinx/ext/autodoc.py
@@ -20,9 +20,11 @@ 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.locale import _
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 +74,7 @@ class Options(dict):
ALL = object()
+INSTANCEATTR = object()
def members_option(arg):
"""Used to convert the :members: option to auto directives."""
@@ -355,6 +358,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.
@@ -387,11 +400,10 @@ class Documenter(object):
def add_directive_header(self, sig):
"""Add the directive header and options to the generated content."""
+ domain = getattr(self, 'domain', 'py')
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),
+ name = self.format_name()
+ self.add_line(u'.. %s:%s:: %s%s' % (domain, directive, name, sig),
'<autodoc>')
if self.options.noindex:
self.add_line(u' :noindex:', '<autodoc>')
@@ -472,19 +484,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):
"""
@@ -546,9 +569,9 @@ class Documenter(object):
do all members, else those given by *self.options.members*.
"""
# set current namespace for finding members
- self.env.autodoc_current_module = self.modname
+ self.env.temp_data['autodoc:module'] = self.modname
if self.objpath:
- self.env.autodoc_current_class = self.objpath[0]
+ self.env.temp_data['autodoc:class'] = self.objpath[0]
want_all = all_members or self.options.inherited_members or \
self.options.members is ALL
@@ -576,12 +599,19 @@ class Documenter(object):
'.'.join(self.objpath + [mname])
documenter = classes[-1](self.directive, full_mname, self.indent)
memberdocumenters.append((documenter, isattr))
-
- if (self.options.member_order or self.env.config.autodoc_member_order) \
- == 'groupwise':
+ member_order = self.options.member_order or \
+ self.env.config.autodoc_member_order
+ if member_order == 'groupwise':
# sort by group; relies on stable sort to keep items in the
# same group sorted alphabetically
- memberdocumenters.sort(key=lambda d: d[0].member_order)
+ memberdocumenters.sort(key=lambda e: e[0].member_order)
+ elif member_order == 'bysource' and self.analyzer:
+ # sort by source order, by virtue of the module analyzer
+ tagorder = self.analyzer.tagorder
+ def keyfunc(entry):
+ fullname = entry[0].name.split('::')[1]
+ return tagorder.get(fullname, len(tagorder))
+ memberdocumenters.sort(key=keyfunc)
for documenter, isattr in memberdocumenters:
documenter.generate(
@@ -589,8 +619,8 @@ class Documenter(object):
check_module=members_check_module and not isattr)
# reset current objects
- self.env.autodoc_current_module = None
- self.env.autodoc_current_class = None
+ self.env.temp_data['autodoc:module'] = None
+ self.env.temp_data['autodoc:class'] = None
def generate(self, more_content=None, real_modname=None,
check_module=False, all_members=False):
@@ -743,11 +773,10 @@ class ModuleLevelDocumenter(Documenter):
else:
# if documenting a toplevel object without explicit module,
# it can be contained in another auto directive ...
- if hasattr(self.env, 'autodoc_current_module'):
- modname = self.env.autodoc_current_module
+ modname = self.env.temp_data.get('autodoc:module')
# ... or in the scope of a module directive
if not modname:
- modname = self.env.currmodule
+ modname = self.env.temp_data.get('py:module')
# ... else, it stays None, which means invalid
return modname, parents + [base]
@@ -766,21 +795,20 @@ class ClassLevelDocumenter(Documenter):
# if documenting a class-level object without path,
# there must be a current class, either from a parent
# auto directive ...
- if hasattr(self.env, 'autodoc_current_class'):
- mod_cls = self.env.autodoc_current_class
+ mod_cls = self.env.temp_data.get('autodoc:class')
# ... or from a class directive
if mod_cls is None:
- mod_cls = self.env.currclass
+ mod_cls = self.env.temp_data.get('py:class')
# ... if still None, there's no way to know
if mod_cls is None:
return None, []
modname, cls = rpartition(mod_cls, '.')
parents = [cls]
# if the module name is still missing, get it like above
- if not modname and hasattr(self.env, 'autodoc_current_module'):
- modname = self.env.autodoc_current_module
if not modname:
- modname = self.env.currmodule
+ modname = self.env.temp_data.get('autodoc:module')
+ if not modname:
+ modname = self.env.temp_data.get('py:module')
# ... else, it stays None, which means invalid
return modname, parents + [base]
@@ -1032,6 +1060,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
@@ -1053,6 +1109,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
@@ -1075,6 +1135,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))
@@ -1087,7 +1155,7 @@ class AutoDirective(Directive):
# record all filenames as dependencies -- this will at least
# partially make automatic invalidation possible
for fn in self.filename_set:
- self.env.note_dependency(fn)
+ self.state.document.settings.record_dependencies.add(fn)
# use a custom reporter that correctly assigns lines to source
# filename/description and lineno
@@ -1128,9 +1196,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 0d7505898..cf67c7fb4 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 import addnodes
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,37 @@ 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
+ 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 +213,168 @@ 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 = ['']
+ currmodule = env.temp_data.get('py:module')
+ if currmodule:
+ prefixes.insert(0, 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
- *names* is a list of names of Python objects to be imported and added to the
- table. *document* is the Docutils document object.
+ # 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)
+
+ 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*.
+
+ If the string overflows this limit, replace the last fitting item by
+ *overflow_marker*.
- real_names[name] = real_name
+ 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
@@ -284,8 +441,9 @@ def autolink_role(typ, rawtext, etext, lineno, inliner,
Expands to ':obj:`text`' if `text` is an object that can be imported;
otherwise expands to '*text*'.
"""
- r = roles.xfileref_role('obj', rawtext, etext, lineno, inliner,
- options, content)
+ env = inliner.document.settings.env
+ r = env.get_domain('py').role('obj')(
+ 'obj', rawtext, etext, lineno, inliner, options, content)
pnode = r[0][0]
prefixes = [None]
@@ -301,16 +459,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,8 +485,14 @@ 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),
- text=(autosummary_noop, autosummary_noop))
+ latex=(autosummary_noop, autosummary_noop),
+ text=(autosummary_noop, autosummary_noop),
+ man=(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),
+ man=(autosummary_noop, autosummary_noop))
app.add_directive('autosummary', Autosummary)
app.add_role('autolink', autolink_role)
app.connect('doctree-read', process_autosummary_toc)
diff --git a/sphinx/ext/autosummary/generate.py b/sphinx/ext/autosummary/generate.py
index 26cf1a7c3..66a124d27 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 000000000..21a0ccd83
--- /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 000000000..40494dadb
--- /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 000000000..c14456ba1
--- /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 0cbc8266f..000000000
--- 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/coverage.py b/sphinx/ext/coverage.py
index 0d2487f08..4924d30b0 100644
--- a/sphinx/ext/coverage.py
+++ b/sphinx/ext/coverage.py
@@ -79,6 +79,7 @@ class CoverageBuilder(Builder):
def build_c_coverage(self):
# Fetch all the info from the header files
+ c_objects = self.env.domaindata['c']['objects']
for filename in self.c_sourcefiles:
undoc = []
f = open(filename, 'r')
@@ -88,7 +89,7 @@ class CoverageBuilder(Builder):
match = regex.match(line)
if match:
name = match.groups()[0]
- if name not in self.env.descrefs:
+ if name not in c_objects:
for exp in self.c_ignorexps.get(key, ()):
if exp.match(name):
break
@@ -116,7 +117,10 @@ class CoverageBuilder(Builder):
op.close()
def build_py_coverage(self):
- for mod_name in self.env.modules:
+ objects = self.env.domaindata['py']['objects']
+ modules = self.env.domaindata['py']['modules']
+
+ for mod_name in modules:
ignore = False
for exp in self.mod_ignorexps:
if exp.match(mod_name):
@@ -151,7 +155,7 @@ class CoverageBuilder(Builder):
full_name = '%s.%s' % (mod_name, name)
if inspect.isfunction(obj):
- if full_name not in self.env.descrefs:
+ if full_name not in objects:
for exp in self.fun_ignorexps:
if exp.match(name):
break
@@ -162,7 +166,7 @@ class CoverageBuilder(Builder):
if exp.match(name):
break
else:
- if full_name not in self.env.descrefs:
+ if full_name not in objects:
# not documented at all
classes[name] = []
continue
@@ -176,7 +180,7 @@ class CoverageBuilder(Builder):
continue
full_attr_name = '%s.%s' % (full_name, attr_name)
- if full_attr_name not in self.env.descrefs:
+ if full_attr_name not in objects:
attrs.append(attr_name)
if attrs:
diff --git a/sphinx/ext/extlinks.py b/sphinx/ext/extlinks.py
new file mode 100644
index 000000000..9a29918a5
--- /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, internal=False, 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 b7cf93d24..106de7a65 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 8129a8e1c..cdb6e2c3c 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/inheritance_diagram.py b/sphinx/ext/inheritance_diagram.py
index a271e1014..b930d8cab 100644
--- a/sphinx/ext/inheritance_diagram.py
+++ b/sphinx/ext/inheritance_diagram.py
@@ -47,7 +47,6 @@ except ImportError:
from docutils import nodes
from docutils.parsers.rst import directives
-from sphinx.roles import xfileref_role
from sphinx.ext.graphviz import render_dot_html, render_dot_latex
from sphinx.util.compat import Directive
@@ -97,7 +96,7 @@ class InheritanceGraph(object):
# two possibilities: either it is a module, then import it
try:
- module = __import__(fullname)
+ __import__(fullname)
todoc = sys.modules[fullname]
except ImportError:
# else it is a class, then import the module
@@ -110,7 +109,7 @@ class InheritanceGraph(object):
'Could not import class %r specified for '
'inheritance diagram' % base)
try:
- module = __import__(path)
+ __import__(path)
todoc = getattr(sys.modules[path], base)
except (ImportError, AttributeError):
raise InheritanceException(
@@ -280,10 +279,12 @@ class InheritanceDiagram(Directive):
node.document = self.state.document
env = self.state.document.settings.env
class_names = self.arguments[0].split()
+ class_role = env.get_domain('py').role('class')
# Create a graph starting with the list of classes
try:
- graph = InheritanceGraph(class_names, env.currmodule)
+ graph = InheritanceGraph(class_names,
+ env.temp_data.get('py:module'))
except InheritanceException, err:
return [node.document.reporter.warning(err.args[0],
line=self.lineno)]
@@ -293,7 +294,7 @@ class InheritanceDiagram(Directive):
# references to real URLs later. These nodes will eventually be
# removed from the doctree after we're done with them.
for name in graph.get_all_class_names():
- refnodes, x = xfileref_role(
+ refnodes, x = class_role(
'class', ':class:`%s`' % name, name, 0, self.state)
node.extend(refnodes)
# Store the graph object so we can use it to generate the
@@ -360,7 +361,8 @@ def setup(app):
inheritance_diagram,
latex=(latex_visit_inheritance_diagram, None),
html=(html_visit_inheritance_diagram, None),
- text=(skip, None))
+ text=(skip, None),
+ man=(skip, None))
app.add_directive('inheritance-diagram', InheritanceDiagram)
app.add_config_value('inheritance_graph_attrs', {}, False),
app.add_config_value('inheritance_node_attrs', {}, False),
diff --git a/sphinx/ext/intersphinx.py b/sphinx/ext/intersphinx.py
index e20cc266d..1608c2307 100644
--- a/sphinx/ext/intersphinx.py
+++ b/sphinx/ext/intersphinx.py
@@ -3,17 +3,17 @@
sphinx.ext.intersphinx
~~~~~~~~~~~~~~~~~~~~~~
- Insert links to Python objects documented in remote Sphinx documentation.
+ Insert links to objects documented in remote Sphinx documentation.
This works as follows:
- * Each Sphinx HTML build creates a file named "objects.inv" that contains
- a mapping from Python identifiers to URIs relative to the HTML set's root.
+ * Each Sphinx HTML build creates a file named "objects.inv" that contains a
+ mapping from object names to URIs relative to the HTML set's root.
* Projects using the Intersphinx extension can specify links to such mapping
files in the `intersphinx_mapping` config value. The mapping will then be
- used to resolve otherwise missing references to Python objects into links
- to the other documentation.
+ used to resolve otherwise missing references to objects into links to the
+ other documentation.
* By default, the mapping file is assumed to be at the same location as the
rest of the documentation; however, the location of the mapping file can
@@ -25,6 +25,7 @@
"""
import time
+import zlib
import urllib2
import posixpath
from os import path
@@ -41,12 +42,69 @@ if hasattr(urllib2, 'HTTPSHandler'):
urllib2.install_opener(urllib2.build_opener(*handlers))
+def read_inventory_v1(f, uri, join):
+ invdata = {}
+ line = f.next()
+ projname = line.rstrip()[11:].decode('utf-8')
+ line = f.next()
+ version = line.rstrip()[11:]
+ for line in f:
+ name, type, location = line.rstrip().split(None, 2)
+ location = join(uri, location)
+ # version 1 did not add anchors to the location
+ if type == 'mod':
+ type = 'py:module'
+ location += '#module-' + name
+ else:
+ type = 'py:' + type
+ location += '#' + name
+ invdata.setdefault(type, {})[name] = (projname, version, location, '-')
+ return invdata
+
+
+def read_inventory_v2(f, uri, join, bufsize=16*1024):
+ invdata = {}
+ line = f.readline()
+ projname = line.rstrip()[11:].decode('utf-8')
+ line = f.readline()
+ version = line.rstrip()[11:]
+ line = f.readline()
+ if 'zlib' not in line:
+ raise ValueError
+
+ def read_chunks():
+ decompressor = zlib.decompressobj()
+ for chunk in iter(lambda: f.read(bufsize), ''):
+ yield decompressor.decompress(chunk)
+ yield decompressor.flush()
+
+ def split_lines(iter):
+ buf = ''
+ for chunk in iter:
+ buf += chunk
+ lineend = buf.find('\n')
+ while lineend != -1:
+ yield buf[:lineend]
+ buf = buf[lineend+1:]
+ lineend = buf.find('\n')
+ assert not buf
+
+ for line in split_lines(read_chunks()):
+ name, type, prio, location, dispname = line.rstrip().split(None, 4)
+ if location.endswith('$'):
+ location = location[:-1] + name
+ location = join(uri, location)
+ invdata.setdefault(type, {})[name] = (projname, version,
+ location, dispname)
+ return invdata
+
+
def fetch_inventory(app, uri, inv):
"""Fetch, parse and return an intersphinx inventory file."""
- invdata = {}
# both *uri* (base URI of the links to generate) and *inv* (actual
# location of the inventory file) can be local or remote URIs
localuri = uri.find('://') == -1
+ join = localuri and path.join or posixpath.join
try:
if inv.find('://') != -1:
f = urllib2.urlopen(inv)
@@ -57,24 +115,21 @@ def fetch_inventory(app, uri, inv):
'%s: %s' % (inv, err.__class__, err))
return
try:
- line = f.next()
- if line.rstrip() != '# Sphinx inventory version 1':
- raise ValueError('unknown or unsupported inventory version')
- line = f.next()
- projname = line.rstrip()[11:].decode('utf-8')
- line = f.next()
- version = line.rstrip()[11:]
- for line in f:
- name, type, location = line.rstrip().split(None, 2)
- if localuri:
- location = path.join(uri, location)
+ line = f.readline().rstrip()
+ try:
+ if line == '# Sphinx inventory version 1':
+ invdata = read_inventory_v1(f, uri, join)
+ elif line == '# Sphinx inventory version 2':
+ invdata = read_inventory_v2(f, uri, join)
else:
- location = posixpath.join(uri, location)
- invdata[name] = (type, projname, version, location)
- f.close()
+ raise ValueError
+ f.close()
+ except ValueError:
+ f.close()
+ raise ValueError('unknown or unsupported inventory version')
except Exception, err:
app.warn('intersphinx inventory %r not readable due to '
- '%s: %s' % (inv, err.__class__, err))
+ '%s: %s' % (inv, err.__class__.__name__, err))
else:
return invdata
@@ -88,7 +143,15 @@ def load_mappings(app):
env.intersphinx_cache = {}
cache = env.intersphinx_cache
update = False
- for uri, inv in app.config.intersphinx_mapping.iteritems():
+ for key, value in app.config.intersphinx_mapping.iteritems():
+ if isinstance(value, tuple):
+ # new format
+ name, (uri, inv) = key, value
+ if not name.isalnum():
+ env.warn('intersphinx identifier %r is not alphanumeric' % name)
+ else:
+ # old format, no name
+ name, uri, inv = None, key, value
# we can safely assume that the uri<->inv mapping is not changed
# during partial rebuilds since a changed intersphinx_mapping
# setting will cause a full environment reread
@@ -98,47 +161,53 @@ def load_mappings(app):
# files; remote ones only if the cache time is expired
if '://' not in inv or uri not in cache \
or cache[uri][0] < cache_time:
+ app.info('loading intersphinx inventory from %s...' % inv)
invdata = fetch_inventory(app, uri, inv)
- cache[uri] = (now, invdata)
+ if invdata:
+ cache[uri] = (name, now, invdata)
+ else:
+ cache.pop(uri, None)
update = True
if update:
env.intersphinx_inventory = {}
- for _, invdata in cache.itervalues():
- if invdata:
- env.intersphinx_inventory.update(invdata)
+ env.intersphinx_named_inventory = {}
+ for name, _, invdata in cache.itervalues():
+ if name:
+ env.intersphinx_named_inventory[name] = invdata
+ for type, objects in invdata.iteritems():
+ env.intersphinx_inventory.setdefault(
+ type, {}).update(objects)
def missing_reference(app, env, node, contnode):
"""Attempt to resolve a missing reference via intersphinx references."""
- type = node['reftype']
+ domain = node.get('refdomain')
+ if not domain:
+ # only objects in domains are in the inventory
+ return
target = node['reftarget']
- if type == 'mod':
- type, proj, version, uri = env.intersphinx_inventory.get(target,
- ('','','',''))
- if type != 'mod':
- return None
- target = 'module-' + target # for link anchor
- else:
- if target[-2:] == '()':
- target = target[:-2]
- target = target.rstrip(' *')
- # special case: exceptions and object methods
- if type == 'exc' and '.' not in target and \
- 'exceptions.' + target in env.intersphinx_inventory:
- target = 'exceptions.' + target
- elif type in ('func', 'meth') and '.' not in target and \
- 'object.' + target in env.intersphinx_inventory:
- target = 'object.' + target
- if target not in env.intersphinx_inventory:
- return None
- type, proj, version, uri = env.intersphinx_inventory[target]
- # print "Intersphinx hit:", target, uri
- newnode = nodes.reference('', '')
- newnode['refuri'] = uri + '#' + target
- newnode['reftitle'] = '(in %s v%s)' % (proj, version)
- newnode['class'] = 'external-xref'
- newnode.append(contnode)
- return newnode
+ objtypes = env.domains[domain].objtypes_for_role(node['reftype'])
+ if not objtypes:
+ return
+ objtypes = ['%s:%s' % (domain, objtype) for objtype in objtypes]
+ to_try = [(env.intersphinx_inventory, target)]
+ if ':' in target:
+ # first part may be the foreign doc set name
+ setname, newtarget = target.split(':', 1)
+ if setname in env.intersphinx_named_inventory:
+ to_try.append((env.intersphinx_named_inventory[setname], newtarget))
+ for inventory, target in to_try:
+ for objtype in objtypes:
+ if objtype not in inventory or target not in inventory[objtype]:
+ continue
+ proj, version, uri, dispname = inventory[objtype][target]
+ newnode = nodes.reference('', '', internal=False, refuri=uri,
+ reftitle='(in %s v%s)' % (proj, version))
+ if dispname == '-':
+ newnode.append(contnode)
+ else:
+ newnode.append(contnode.__class__(dispname, dispname))
+ return newnode
def setup(app):
diff --git a/sphinx/ext/mathbase.py b/sphinx/ext/mathbase.py
index 774f5608f..8a5b75d34 100644
--- a/sphinx/ext/mathbase.py
+++ b/sphinx/ext/mathbase.py
@@ -108,6 +108,20 @@ def text_visit_eqref(self, node):
raise nodes.SkipNode
+def man_visit_math(self, node):
+ self.body.append(node['latex'])
+ raise nodes.SkipNode
+
+def man_visit_displaymath(self, node):
+ self.visit_centered(node)
+def man_depart_displaymath(self, node):
+ self.depart_centered(node)
+
+def man_visit_eqref(self, node):
+ self.body.append(node['target'])
+ raise nodes.SkipNode
+
+
def html_visit_eqref(self, node):
self.body.append('<a href="#equation-%s">' % node['target'])
@@ -136,14 +150,17 @@ def setup_math(app, htmlinlinevisitors, htmldisplayvisitors):
app.add_node(math,
latex=(latex_visit_math, None),
text=(text_visit_math, None),
+ man=(man_visit_math, None),
html=htmlinlinevisitors)
app.add_node(displaymath,
latex=(latex_visit_displaymath, None),
text=(text_visit_displaymath, None),
+ man=(man_visit_displaymath, man_depart_displaymath),
html=htmldisplayvisitors)
app.add_node(eqref,
latex=(latex_visit_eqref, None),
text=(text_visit_eqref, None),
+ man=(man_visit_eqref, None),
html=(html_visit_eqref, html_depart_eqref))
app.add_role('math', math_role)
app.add_role('eq', eq_role)
diff --git a/sphinx/ext/oldcmarkup.py b/sphinx/ext/oldcmarkup.py
new file mode 100644
index 000000000..62f5ee28d
--- /dev/null
+++ b/sphinx/ext/oldcmarkup.py
@@ -0,0 +1,52 @@
+# -*- coding: utf-8 -*-
+"""
+ sphinx.ext.oldcmarkup
+ ~~~~~~~~~~~~~~~~~~~~~
+
+ Extension for compatibility with old C markup (directives and roles).
+
+ :copyright: Copyright 2007-2010 by the Sphinx team, see AUTHORS.
+ :license: BSD, see LICENSE for details.
+"""
+
+from docutils.parsers.rst import directives
+
+from sphinx.util.compat import Directive
+
+
+class OldCDirective(Directive):
+ has_content = True
+ required_arguments = 1
+ optional_arguments = 0
+ final_argument_whitespace = True
+ option_spec = {
+ 'noindex': directives.flag,
+ 'module': directives.unchanged,
+ }
+
+ def run(self):
+ env = self.state.document.settings.env
+ newname = 'c:' + self.name[1:]
+ newdir = env.lookup_domain_element('directive', newname)[0]
+ return newdir(newname, self.arguments, self.options,
+ self.content, self.lineno, self.content_offset,
+ self.block_text, self.state, self.state_machine).run()
+
+
+def old_crole(typ, rawtext, text, lineno, inliner, options={}, content=[]):
+ env = inliner.document.settings.env
+ newtyp = 'c:' + typ[1:]
+ newrole = env.lookup_domain_element('role', newtyp)[0]
+ return newrole(newtyp, rawtext, text, lineno, inliner, options, content)
+
+
+def setup(app):
+ app.add_directive('cfunction', OldCDirective)
+ app.add_directive('cmember', OldCDirective)
+ app.add_directive('cmacro', OldCDirective)
+ app.add_directive('ctype', OldCDirective)
+ app.add_directive('cvar', OldCDirective)
+ app.add_role('cdata', old_crole)
+ app.add_role('cfunc', old_crole)
+ app.add_role('cmacro', old_crole)
+ app.add_role('ctype', old_crole)
diff --git a/sphinx/ext/pngmath.py b/sphinx/ext/pngmath.py
index d7a19ba4a..7f3997543 100644
--- a/sphinx/ext/pngmath.py
+++ b/sphinx/ext/pngmath.py
@@ -24,8 +24,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/refcounting.py b/sphinx/ext/refcounting.py
index 398520b8c..6ab9fe4ba 100644
--- a/sphinx/ext/refcounting.py
+++ b/sphinx/ext/refcounting.py
@@ -69,7 +69,7 @@ class Refcounts(dict):
def add_refcount_annotations(self, app, doctree):
for node in doctree.traverse(addnodes.desc_content):
par = node.parent
- if par['desctype'] != 'cfunction':
+ if par['domain'] != 'c' or par['objtype'] != 'function':
continue
if not par[0].has_key('names') or not par[0]['names']:
continue
diff --git a/sphinx/ext/todo.py b/sphinx/ext/todo.py
index 95246af38..a6c33202e 100644
--- a/sphinx/ext/todo.py
+++ b/sphinx/ext/todo.py
@@ -14,6 +14,7 @@
from docutils import nodes
+from sphinx.locale import _
from sphinx.environment import NoUri
from sphinx.util.compat import Directive, make_admonition
@@ -34,9 +35,7 @@ class Todo(Directive):
def run(self):
env = self.state.document.settings.env
-
- targetid = "todo-%s" % env.index_num
- env.index_num += 1
+ targetid = 'index-%s' % env.new_serialno('index')
targetnode = nodes.target('', '', ids=[targetid])
ad = make_admonition(todo_node, self.name, [_('Todo')], self.options,
@@ -105,17 +104,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'))
- newnode['refdocname'] = todo_info['docname']
+ newnode = nodes.reference('', '', internal=True)
+ innernode = nodes.emphasis(_('original entry'), _('original entry'))
try:
newnode['refuri'] = app.builder.get_relative_uri(
fromdocname, todo_info['docname'])
@@ -125,7 +124,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']
@@ -159,7 +158,8 @@ def setup(app):
app.add_node(todo_node,
html=(visit_todo_node, depart_todo_node),
latex=(visit_todo_node, depart_todo_node),
- text=(visit_todo_node, depart_todo_node))
+ text=(visit_todo_node, depart_todo_node),
+ man=(visit_todo_node, depart_todo_node))
app.add_directive('todo', Todo)
app.add_directive('todolist', TodoList)
diff --git a/sphinx/ext/viewcode.py b/sphinx/ext/viewcode.py
new file mode 100644
index 000000000..ac2a957fe
--- /dev/null
+++ b/sphinx/ext/viewcode.py
@@ -0,0 +1,169 @@
+# -*- coding: utf-8 -*-
+"""
+ sphinx.ext.viewcode
+ ~~~~~~~~~~~~~~~~~~~
+
+ Add links to module code in Python object descriptions.
+
+ :copyright: Copyright 2007-2010 by the Sphinx team, see AUTHORS.
+ :license: BSD, see LICENSE for details.
+"""
+
+from docutils import nodes
+
+from sphinx import addnodes
+from sphinx.locale import _
+from sphinx.pycode import ModuleAnalyzer
+from sphinx.util.nodes import make_refnode
+
+
+def doctree_read(app, doctree):
+ env = app.builder.env
+ if not hasattr(env, '_viewcode_modules'):
+ env._viewcode_modules = {}
+
+ def has_tag(modname, fullname, docname):
+ entry = env._viewcode_modules.get(modname, None)
+ if entry is None:
+ try:
+ analyzer = ModuleAnalyzer.for_module(modname)
+ except Exception:
+ env._viewcode_modules[modname] = False
+ return
+ analyzer.find_tags()
+ entry = analyzer.code, analyzer.tags, {}
+ env._viewcode_modules[modname] = entry
+ elif entry is False:
+ return
+ code, tags, used = entry
+ if fullname in tags:
+ used[fullname] = docname
+ return True
+
+ for objnode in doctree.traverse(addnodes.desc):
+ if objnode['domain'] != 'py':
+ continue
+ names = set()
+ for signode in objnode:
+ if not isinstance(signode, addnodes.desc_signature):
+ continue
+ modname = signode['module']
+ if not modname:
+ continue
+ fullname = signode['fullname']
+ if not has_tag(modname, fullname, env.docname):
+ continue
+ if fullname in names:
+ # only one link per name, please
+ continue
+ names.add(fullname)
+ pagename = '_modules/' + modname.replace('.', '/')
+ onlynode = addnodes.only(expr='html')
+ onlynode += addnodes.pending_xref(
+ '', reftype='viewcode', refdomain='std', refexplicit=False,
+ reftarget=pagename, refid=fullname,
+ refdoc=env.docname)
+ onlynode[0] += nodes.inline('', _('[source]'),
+ classes=['viewcode-link'])
+ signode += onlynode
+
+
+def missing_reference(app, env, node, contnode):
+ # resolve our "viewcode" reference nodes -- they need special treatment
+ if node['reftype'] == 'viewcode':
+ return make_refnode(app.builder, node['refdoc'], node['reftarget'],
+ node['refid'], contnode)
+
+
+def collect_pages(app):
+ env = app.builder.env
+ if not hasattr(env, '_viewcode_modules'):
+ return
+ highlighter = app.builder.highlighter
+ urito = app.builder.get_relative_uri
+
+ modnames = set(env._viewcode_modules)
+
+ app.builder.info(' (%d module code pages)' %
+ len(env._viewcode_modules), nonl=1)
+
+ for modname, (code, tags, used) in env._viewcode_modules.iteritems():
+ # construct a page name for the highlighted source
+ pagename = '_modules/' + modname.replace('.', '/')
+ # highlight the source using the builder's highlighter
+ highlighted = highlighter.highlight_block(code, 'python', False)
+ # split the code into lines
+ lines = highlighted.splitlines()
+ # split off wrap markup from the first line of the actual code
+ before, after = lines[0].split('<pre>')
+ lines[0:1] = [before + '<pre>', after]
+ # nothing to do for the last line; it always starts with </pre> anyway
+ # now that we have code lines (starting at index 1), insert anchors for
+ # the collected tags (HACK: this only works if the tag boundaries are
+ # properly nested!)
+ for name, docname in used.iteritems():
+ type, start, end = tags[name]
+ backlink = urito(pagename, docname) + '#' + modname + '.' + name
+ lines[start] = (
+ '<div class="viewcode-block" id="%s"><a class="viewcode-back" '
+ 'href="%s">%s</a>' % (name, backlink, _('[docs]'))
+ + lines[start])
+ lines[end - 1] += '</div>'
+ # try to find parents (for submodules)
+ parents = []
+ parent = modname
+ while '.' in parent:
+ parent = parent.rsplit('.', 1)[0]
+ if parent in modnames:
+ parents.append({
+ 'link': urito(pagename, '_modules/' +
+ parent.replace('.', '/')),
+ 'title': parent})
+ parents.append({'link': urito(pagename, '_modules/index'),
+ 'title': _('Module code')})
+ parents.reverse()
+ # putting it all together
+ context = {
+ 'parents': parents,
+ 'title': modname,
+ 'body': _('<h1>Source code for %s</h1>') % modname + \
+ '\n'.join(lines)
+ }
+ yield (pagename, context, 'page.html')
+
+ if not modnames:
+ return
+
+ app.builder.info(' _modules/index')
+ html = ['\n']
+ # the stack logic is needed for using nested lists for submodules
+ stack = ['']
+ for modname in sorted(modnames):
+ if modname.startswith(stack[-1]):
+ stack.append(modname + '.')
+ html.append('<ul>')
+ else:
+ stack.pop()
+ while not modname.startswith(stack[-1]):
+ stack.pop()
+ html.append('</ul>')
+ stack.append(modname + '.')
+ html.append('<li><a href="%s">%s</a></li>\n' % (
+ urito('_modules/index', '_modules/' + modname.replace('.', '/')),
+ modname))
+ html.append('</ul>' * (len(stack) - 1))
+ context = {
+ 'title': _('Overview: module code'),
+ 'body': _('<h1>All modules for which code is available</h1>') + \
+ ''.join(html),
+ }
+
+ yield ('_modules/index', context, 'page.html')
+
+
+def setup(app):
+ app.connect('doctree-read', doctree_read)
+ app.connect('html-collect-pages', collect_pages)
+ app.connect('missing-reference', missing_reference)
+ #app.add_config_value('viewcode_include_modules', [], 'env')
+ #app.add_config_value('viewcode_exclude_modules', [], 'env')
diff --git a/sphinx/highlighting.py b/sphinx/highlighting.py
index 0c48eadf9..f5ea859cb 100644
--- a/sphinx/highlighting.py
+++ b/sphinx/highlighting.py
@@ -84,6 +84,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):
@@ -98,7 +99,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
@@ -112,6 +114,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)}
@@ -176,6 +179,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
@@ -208,6 +213,12 @@ class PygmentsBridge(object):
raise
else:
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 baeb7c330..a6f1a853e 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):
@@ -30,7 +30,7 @@ def accesskey(context, key):
"""Helper to output each access key only once."""
if '_accesskeys' not in context:
context.vars['_accesskeys'] = {}
- if key not in context.vars['_accesskeys']:
+ if key and key not in context.vars['_accesskeys']:
context.vars['_accesskeys'][key] = 1
return 'accesskey="%s"' % key
return ''
@@ -93,7 +93,7 @@ class BuiltinTemplateLoader(TemplateBridge, BaseLoader):
# make the paths into loaders
self.loaders = map(SphinxFileSystemLoader, chain)
- use_i18n = builder.translator is not None
+ use_i18n = builder.app.translator is not None
extensions = use_i18n and ['jinja2.ext.i18n'] or []
self.environment = SandboxedEnvironment(loader=self,
extensions=extensions)
@@ -101,7 +101,8 @@ class BuiltinTemplateLoader(TemplateBridge, BaseLoader):
self.environment.globals['debug'] = contextfunction(pformat)
self.environment.globals['accesskey'] = contextfunction(accesskey)
if use_i18n:
- self.environment.install_gettext_translations(builder.translator)
+ self.environment.install_gettext_translations(
+ builder.app.translator)
def render(self, template, context):
return self.environment.get_template(template).render(context)
diff --git a/sphinx/locale/__init__.py b/sphinx/locale/__init__.py
index 4ad3f4c6b..43e0942cd 100644
--- a/sphinx/locale/__init__.py
+++ b/sphinx/locale/__init__.py
@@ -8,41 +8,183 @@
:copyright: Copyright 2007-2010 by the Sphinx team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
+import gettext
+import UserString
+
+
+class _TranslationProxy(UserString.UserString, object):
+ """Class for proxy strings from gettext translations. This is a helper
+ for the lazy_* functions from this module.
+
+ The proxy implementation attempts to be as complete as possible, so that
+ the lazy objects should mostly work as expected, for example for sorting.
+
+ This inherits from UserString because some docutils versions use UserString
+ for their Text nodes, which then checks its argument for being either a
+ basestring or UserString, otherwise calls str() -- not unicode() -- on it.
+ This also inherits from object to make the __new__ method work.
+ """
+ __slots__ = ('_func', '_args')
+
+ def __new__(cls, func, *args):
+ if not args:
+ # not called with "function" and "arguments", but a plain string
+ return unicode(func)
+ return object.__new__(cls)
+
+ def __getnewargs__(self):
+ return (self._func,) + self._args
+
+ def __init__(self, func, *args):
+ self._func = func
+ self._args = args
+
+ data = property(lambda x: x._func(*x._args))
+
+ def __contains__(self, key):
+ return key in self.data
+
+ def __nonzero__(self):
+ return bool(self.data)
+
+ def __dir__(self):
+ return dir(unicode)
+
+ def __iter__(self):
+ return iter(self.data)
+
+ def __len__(self):
+ return len(self.data)
+
+ def __str__(self):
+ return str(self.data)
+
+ def __unicode__(self):
+ return unicode(self.data)
+
+ def __add__(self, other):
+ return self.data + other
+
+ def __radd__(self, other):
+ return other + self.data
+
+ def __mod__(self, other):
+ return self.data % other
+
+ def __rmod__(self, other):
+ return other % self.data
+
+ def __mul__(self, other):
+ return self.data * other
+
+ def __rmul__(self, other):
+ return other * self.data
+
+ def __lt__(self, other):
+ return self.data < other
+
+ def __le__(self, other):
+ return self.data <= other
+
+ def __eq__(self, other):
+ return self.data == other
+
+ def __ne__(self, other):
+ return self.data != other
+
+ def __gt__(self, other):
+ return self.data > other
+
+ def __ge__(self, other):
+ return self.data >= other
+
+ def __getattr__(self, name):
+ if name == '__members__':
+ return self.__dir__()
+ return getattr(self.data, name)
+
+ def __getstate__(self):
+ return self._func, self._args
+
+ def __setstate__(self, tup):
+ self._func, self._args = tup
+
+ def __getitem__(self, key):
+ return self.data[key]
+
+ def __copy__(self):
+ return self
+
+ def __repr__(self):
+ try:
+ return 'i' + repr(unicode(self.data))
+ except:
+ return '<%s broken>' % self.__class__.__name__
+
+def mygettext(string):
+ """Used instead of _ when creating TranslationProxies, because _ is
+ not bound yet at that time."""
+ return _(string)
+
+def lazy_gettext(string):
+ """A lazy version of `gettext`."""
+ #if isinstance(string, _TranslationProxy):
+ # return string
+ return _TranslationProxy(mygettext, string)
+
+l_ = lazy_gettext
-_ = lambda x: x
admonitionlabels = {
- 'attention': _('Attention'),
- 'caution': _('Caution'),
- 'danger': _('Danger'),
- 'error': _('Error'),
- 'hint': _('Hint'),
- 'important': _('Important'),
- 'note': _('Note'),
- 'seealso': _('See Also'),
- 'tip': _('Tip'),
- 'warning': _('Warning'),
+ 'attention': l_('Attention'),
+ 'caution': l_('Caution'),
+ 'danger': l_('Danger'),
+ 'error': l_('Error'),
+ 'hint': l_('Hint'),
+ 'important': l_('Important'),
+ 'note': l_('Note'),
+ 'seealso': l_('See Also'),
+ 'tip': l_('Tip'),
+ 'warning': l_('Warning'),
}
versionlabels = {
- 'versionadded': _('New in version %s'),
- 'versionchanged': _('Changed in version %s'),
- 'deprecated': _('Deprecated since version %s'),
+ 'versionadded': l_('New in version %s'),
+ 'versionchanged': l_('Changed in version %s'),
+ 'deprecated': l_('Deprecated since version %s'),
}
pairindextypes = {
- 'module': _('module'),
- 'keyword': _('keyword'),
- 'operator': _('operator'),
- 'object': _('object'),
- 'exception': _('exception'),
- 'statement': _('statement'),
- 'builtin': _('built-in function'),
+ 'module': l_('module'),
+ 'keyword': l_('keyword'),
+ 'operator': l_('operator'),
+ 'object': l_('object'),
+ 'exception': l_('exception'),
+ 'statement': l_('statement'),
+ 'builtin': l_('built-in function'),
}
-del _
+translator = None
+
+def _(message):
+ return translator.gettext(message)
-def init():
- for dct in (admonitionlabels, versionlabels, pairindextypes):
- for key in dct:
- dct[key] = _(dct[key])
+def init(locale_dirs, language):
+ global translator
+ # the None entry is the system's default locale path
+ has_translation = True
+ for dir_ in locale_dirs:
+ try:
+ trans = gettext.translation('sphinx', localedir=dir_,
+ languages=[language])
+ if translator is None:
+ translator = trans
+ else:
+ translator._catalog.update(trans._catalog)
+ except Exception:
+ # Language couldn't be found in the specified path
+ pass
+ if translator is None:
+ translator = gettext.NullTranslations()
+ has_translation = False
+ return translator, has_translation
diff --git a/sphinx/locale/ca/LC_MESSAGES/sphinx.js b/sphinx/locale/ca/LC_MESSAGES/sphinx.js
new file mode 100644
index 000000000..71a50776a
--- /dev/null
+++ b/sphinx/locale/ca/LC_MESSAGES/sphinx.js
@@ -0,0 +1 @@
+Documentation.addTranslations({"locale": "ca", "plural_expr": "(n != 1)", "messages": {"Search Results": "Resultats de la Cerca", "Preparing search...": "Preparant la cerca...", "Your search did not match any documents. Please make sure that all words are spelled correctly and that you've selected enough categories.": "La teva cerca no ha donat resultats. Assegura't que totes les paraules estan ben escrites i que has seleccionat prou categories.", "Search finished, found %s page(s) matching the search query.": "Cerca finalitzada, s'han trobat %s p\u00e0gin(a/es) de resultats.", ", in ": ", a ", "Expand sidebar": "", "Permalink to this headline": "Link permanent a aquest t\u00edtol", "Searching": "Cercant", "Collapse sidebar": "", "Permalink to this definition": "Link permanent a aquesta definici\u00f3", "Hide Search Matches": "Oculta Resultats de Cerca"}}); \ No newline at end of file
diff --git a/sphinx/locale/ca/LC_MESSAGES/sphinx.mo b/sphinx/locale/ca/LC_MESSAGES/sphinx.mo
new file mode 100644
index 000000000..339c787f6
--- /dev/null
+++ b/sphinx/locale/ca/LC_MESSAGES/sphinx.mo
Binary files differ
diff --git a/sphinx/locale/ca/LC_MESSAGES/sphinx.po b/sphinx/locale/ca/LC_MESSAGES/sphinx.po
new file mode 100644
index 000000000..7bfb66427
--- /dev/null
+++ b/sphinx/locale/ca/LC_MESSAGES/sphinx.po
@@ -0,0 +1,783 @@
+# Catalan translations for Sphinx.
+# Copyright (C) 2009 ORGANIZATION
+# This file is distributed under the same license as the Sphinx project.
+# FIRST AUTHOR <EMAIL@ADDRESS>, 2009.
+#
+msgid ""
+msgstr ""
+"Project-Id-Version: Sphinx 1.0\n"
+"Report-Msgid-Bugs-To: pau.fernandez@upc.edu\n"
+"POT-Creation-Date: 2009-05-22 18:51+0200\n"
+"PO-Revision-Date: 2010-05-24 23:54+0200\n"
+"Last-Translator: Pau Fernández <pau.fernandez@upc.edu>\n"
+"Language-Team: ca <LL@li.org>\n"
+"Plural-Forms: nplurals=2; plural=(n != 1)\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:106 sphinx/writers/latex.py:184
+#: sphinx/writers/manpage.py:67
+#, python-format
+msgid "%B %d, %Y"
+msgstr "%d de %B de %Y"
+
+#: sphinx/roles.py:174
+#, python-format
+msgid "Python Enhancement Proposals!PEP %s"
+msgstr "Python Enhancement Proposals!PEP %s"
+
+#: sphinx/builders/changes.py:72
+msgid "Builtins"
+msgstr "Mòduls Interns"
+
+#: sphinx/builders/changes.py:74
+msgid "Module level"
+msgstr "Nivell de mòdul"
+
+#: sphinx/builders/html.py:266
+#, python-format
+msgid "%b %d, %Y"
+msgstr "%d %b, %Y"
+
+#: sphinx/builders/html.py:285 sphinx/themes/basic/defindex.html:30
+msgid "General Index"
+msgstr "Índex General"
+
+#: sphinx/builders/html.py:285
+msgid "index"
+msgstr "índex"
+
+#: sphinx/builders/html.py:345
+msgid "next"
+msgstr "següent"
+
+#: sphinx/builders/html.py:354
+msgid "previous"
+msgstr "anterior"
+
+#: sphinx/builders/latex.py:151
+msgid " (in "
+msgstr " (a "
+
+#: sphinx/directives/other.py:127
+msgid "Section author: "
+msgstr "Autor de la secció:"
+
+#: sphinx/directives/other.py:129
+msgid "Module author: "
+msgstr "Autor del mòdul: "
+
+#: sphinx/directives/other.py:131
+#, fuzzy
+msgid "Code author: "
+msgstr "Autor del mòdul: "
+
+#: sphinx/directives/other.py:133
+msgid "Author: "
+msgstr "Autor: "
+
+#: sphinx/directives/other.py:238
+msgid "See also"
+msgstr "Vegeu també"
+
+#: sphinx/domains/__init__.py:253
+#, python-format
+msgid "%s %s"
+msgstr ""
+
+#: sphinx/domains/c.py:51 sphinx/domains/python.py:49
+msgid "Parameters"
+msgstr "Paràmetres"
+
+#: sphinx/domains/c.py:54 sphinx/domains/javascript.py:137
+#: sphinx/domains/python.py:59
+msgid "Returns"
+msgstr "Retorna"
+
+#: sphinx/domains/c.py:56 sphinx/domains/python.py:61
+msgid "Return type"
+msgstr "Tipus de retorn"
+
+#: sphinx/domains/c.py:133
+#, python-format
+msgid "%s (C function)"
+msgstr "%s (funció de C)"
+
+#: sphinx/domains/c.py:135
+#, python-format
+msgid "%s (C member)"
+msgstr "%s (membre de C)"
+
+#: sphinx/domains/c.py:137
+#, python-format
+msgid "%s (C macro)"
+msgstr "%s (macro de C)"
+
+#: sphinx/domains/c.py:139
+#, python-format
+msgid "%s (C type)"
+msgstr "%s (tipus de C)"
+
+#: sphinx/domains/c.py:141
+#, python-format
+msgid "%s (C variable)"
+msgstr "%s (variable de C)"
+
+#: sphinx/domains/c.py:171 sphinx/domains/cpp.py:1031
+#: sphinx/domains/javascript.py:166 sphinx/domains/python.py:497
+msgid "function"
+msgstr "funció"
+
+#: sphinx/domains/c.py:172 sphinx/domains/cpp.py:1032
+msgid "member"
+msgstr "membre"
+
+#: sphinx/domains/c.py:173
+msgid "macro"
+msgstr "macro"
+
+#: sphinx/domains/c.py:174 sphinx/domains/cpp.py:1033
+msgid "type"
+msgstr "tipus"
+
+#: sphinx/domains/c.py:175
+#, fuzzy
+msgid "variable"
+msgstr "Variable"
+
+#: sphinx/domains/cpp.py:876
+#, python-format
+msgid "%s (C++ class)"
+msgstr "%s (class de C++)"
+
+#: sphinx/domains/cpp.py:891
+#, python-format
+msgid "%s (C++ type)"
+msgstr "%s (tipus de C++)"
+
+#: sphinx/domains/cpp.py:910
+#, python-format
+msgid "%s (C++ member)"
+msgstr "%s (membre de C++)"
+
+#: sphinx/domains/cpp.py:962
+#, python-format
+msgid "%s (C++ function)"
+msgstr "%s (funció de C++)"
+
+#: sphinx/domains/cpp.py:1030 sphinx/domains/python.py:499
+msgid "class"
+msgstr "class"
+
+#: sphinx/domains/javascript.py:117 sphinx/domains/python.py:221
+#, python-format
+msgid "%s() (built-in function)"
+msgstr "%s() (funció interna)"
+
+#: sphinx/domains/javascript.py:118 sphinx/domains/python.py:285
+#, python-format
+msgid "%s() (%s method)"
+msgstr "%s() (mètode %s)"
+
+#: sphinx/domains/javascript.py:120
+#, python-format
+msgid "%s (global variable or constant)"
+msgstr ""
+
+#: sphinx/domains/javascript.py:122 sphinx/domains/python.py:323
+#, python-format
+msgid "%s (%s attribute)"
+msgstr "%s (atribut %s)"
+
+#: sphinx/domains/javascript.py:131
+#, fuzzy
+msgid "Arguments"
+msgstr "Paràmetres"
+
+#: sphinx/domains/javascript.py:134
+msgid "Throws"
+msgstr ""
+
+#: sphinx/domains/javascript.py:167 sphinx/domains/python.py:498
+msgid "data"
+msgstr ""
+
+#: sphinx/domains/javascript.py:168 sphinx/domains/python.py:504
+msgid "attribute"
+msgstr "atribut"
+
+#: sphinx/domains/python.py:53
+#, fuzzy
+msgid "Variables"
+msgstr "Variable"
+
+#: sphinx/domains/python.py:56
+msgid "Raises"
+msgstr "Llença"
+
+#: sphinx/domains/python.py:222 sphinx/domains/python.py:279
+#: sphinx/domains/python.py:291 sphinx/domains/python.py:304
+#, python-format
+msgid "%s() (in module %s)"
+msgstr "%s() (al mòdul %s)"
+
+#: sphinx/domains/python.py:225
+#, python-format
+msgid "%s (built-in variable)"
+msgstr "%s (variable interna)"
+
+#: sphinx/domains/python.py:226 sphinx/domains/python.py:317
+#, python-format
+msgid "%s (in module %s)"
+msgstr "%s (al mòdul %s)"
+
+#: sphinx/domains/python.py:242
+#, python-format
+msgid "%s (built-in class)"
+msgstr "%s (classe interna)"
+
+#: sphinx/domains/python.py:243
+#, python-format
+msgid "%s (class in %s)"
+msgstr "%s (class a %s)"
+
+#: sphinx/domains/python.py:283
+#, python-format
+msgid "%s() (%s.%s method)"
+msgstr "%s() (mètode %s.%s)"
+
+#: sphinx/domains/python.py:295
+#, python-format
+msgid "%s() (%s.%s static method)"
+msgstr "%s() (mètode estàtic %s.%s)"
+
+#: sphinx/domains/python.py:298
+#, python-format
+msgid "%s() (%s static method)"
+msgstr "%s() (mètode estàtic %s)"
+
+#: sphinx/domains/python.py:308
+#, fuzzy, python-format
+msgid "%s() (%s.%s class method)"
+msgstr "%s() (mètode %s.%s)"
+
+#: sphinx/domains/python.py:311
+#, fuzzy, python-format
+msgid "%s() (%s class method)"
+msgstr "%s() (mètode %s)"
+
+#: sphinx/domains/python.py:321
+#, python-format
+msgid "%s (%s.%s attribute)"
+msgstr "%s (atribut %s.%s)"
+
+#: sphinx/domains/python.py:366
+msgid "Platforms: "
+msgstr "Plataformes: "
+
+#: sphinx/domains/python.py:372
+#, python-format
+msgid "%s (module)"
+msgstr "%s (mòdul)"
+
+#: sphinx/domains/python.py:429
+#, fuzzy
+msgid "Python Module Index"
+msgstr "Índex de Mòduls"
+
+#: sphinx/domains/python.py:430
+msgid "modules"
+msgstr "mòduls"
+
+#: sphinx/domains/python.py:475
+msgid "Deprecated"
+msgstr "Obsolet"
+
+#: sphinx/domains/python.py:500 sphinx/locale/__init__.py:162
+msgid "exception"
+msgstr "excepció"
+
+#: sphinx/domains/python.py:501
+msgid "method"
+msgstr ""
+
+#: sphinx/domains/python.py:502
+#, fuzzy, python-format
+msgid "class method"
+msgstr "%s() (mètode %s)"
+
+#: sphinx/domains/python.py:503
+msgid "static method"
+msgstr "mètode estàtic"
+
+#: sphinx/domains/python.py:505 sphinx/locale/__init__.py:158
+msgid "module"
+msgstr "mòdul"
+
+#: sphinx/domains/rst.py:53
+#, python-format
+msgid "%s (directive)"
+msgstr ""
+
+#: sphinx/domains/rst.py:55
+#, fuzzy, python-format
+msgid "%s (role)"
+msgstr "%s (mòdul)"
+
+#: sphinx/domains/rst.py:103
+msgid "directive"
+msgstr ""
+
+#: sphinx/domains/rst.py:104
+#, fuzzy
+msgid "role"
+msgstr "mòdul"
+
+#: sphinx/domains/std.py:68 sphinx/domains/std.py:84
+#, python-format
+msgid "environment variable; %s"
+msgstr "variable d'entorn; %s"
+
+#: sphinx/domains/std.py:160
+#, python-format
+msgid "%scommand line option; %s"
+msgstr "opció de línia de comandes %s; %s"
+
+#: sphinx/domains/std.py:328
+msgid "glossary term"
+msgstr ""
+
+#: sphinx/domains/std.py:329
+msgid "grammar token"
+msgstr ""
+
+#: sphinx/domains/std.py:330
+msgid "reference label"
+msgstr ""
+
+#: sphinx/domains/std.py:331
+msgid "environment variable"
+msgstr "variable d'entorn"
+
+#: sphinx/domains/std.py:332
+msgid "program option"
+msgstr ""
+
+#: sphinx/domains/std.py:360 sphinx/themes/basic/genindex-single.html:11
+#: sphinx/themes/basic/genindex-split.html:11
+#: sphinx/themes/basic/genindex-split.html:14
+#: sphinx/themes/basic/genindex.html:11 sphinx/themes/basic/genindex.html:14
+#: sphinx/themes/basic/genindex.html:50 sphinx/themes/basic/layout.html:125
+#: sphinx/writers/latex.py:173
+msgid "Index"
+msgstr "Índex"
+
+#: sphinx/domains/std.py:361
+msgid "Module Index"
+msgstr "Índex de Mòduls"
+
+#: sphinx/domains/std.py:362 sphinx/themes/basic/defindex.html:25
+msgid "Search Page"
+msgstr "Pàgina de Cerca"
+
+#: sphinx/ext/autodoc.py:917
+#, python-format
+msgid " Bases: %s"
+msgstr " Bases: %s"
+
+#: sphinx/ext/autodoc.py:950
+#, python-format
+msgid "alias of :class:`%s`"
+msgstr "àlies de :class:`%s`"
+
+#: sphinx/ext/todo.py:41
+msgid "Todo"
+msgstr "Pendent"
+
+#: sphinx/ext/todo.py:109
+#, python-format
+msgid "(The <<original entry>> is located in %s, line %d.)"
+msgstr "(La <<entrada original>> està a %s, línia %d i.)"
+
+#: sphinx/ext/todo.py:117
+msgid "original entry"
+msgstr ""
+
+#: sphinx/ext/viewcode.py:66
+msgid "[source]"
+msgstr ""
+
+#: sphinx/ext/viewcode.py:109
+msgid "[docs]"
+msgstr ""
+
+#: sphinx/ext/viewcode.py:123
+#, fuzzy
+msgid "Module code"
+msgstr "mòdul"
+
+#: sphinx/ext/viewcode.py:129
+#, python-format
+msgid "<h1>Source code for %s</h1>"
+msgstr ""
+
+#: sphinx/ext/viewcode.py:156
+msgid "Overview: module code"
+msgstr ""
+
+#: sphinx/ext/viewcode.py:157
+msgid "<h1>All modules for which code is available</h1>"
+msgstr ""
+
+#: sphinx/locale/__init__.py:139
+msgid "Attention"
+msgstr "Atenció"
+
+#: sphinx/locale/__init__.py:140
+msgid "Caution"
+msgstr "Compte"
+
+#: sphinx/locale/__init__.py:141
+msgid "Danger"
+msgstr "Perill"
+
+#: sphinx/locale/__init__.py:142
+msgid "Error"
+msgstr "Error"
+
+#: sphinx/locale/__init__.py:143
+msgid "Hint"
+msgstr "Suggerència"
+
+#: sphinx/locale/__init__.py:144
+msgid "Important"
+msgstr "Important"
+
+#: sphinx/locale/__init__.py:145
+msgid "Note"
+msgstr "Nota"
+
+#: sphinx/locale/__init__.py:146
+msgid "See Also"
+msgstr "Vegeu També"
+
+#: sphinx/locale/__init__.py:147
+msgid "Tip"
+msgstr "Truc"
+
+#: sphinx/locale/__init__.py:148
+msgid "Warning"
+msgstr "Avís"
+
+#: sphinx/locale/__init__.py:152
+#, python-format
+msgid "New in version %s"
+msgstr "Novetat de la versió %s"
+
+#: sphinx/locale/__init__.py:153
+#, python-format
+msgid "Changed in version %s"
+msgstr "Canviat a la versió %s"
+
+#: sphinx/locale/__init__.py:154
+#, python-format
+msgid "Deprecated since version %s"
+msgstr "Obsolet desde la versió %s"
+
+#: sphinx/locale/__init__.py:159
+msgid "keyword"
+msgstr "paraula clau"
+
+#: sphinx/locale/__init__.py:160
+msgid "operator"
+msgstr "operador"
+
+#: sphinx/locale/__init__.py:161
+msgid "object"
+msgstr "objecte"
+
+#: sphinx/locale/__init__.py:163
+msgid "statement"
+msgstr "sentència"
+
+#: sphinx/locale/__init__.py:164
+msgid "built-in function"
+msgstr "funció interna"
+
+#: sphinx/themes/agogo/layout.html:45 sphinx/themes/basic/globaltoc.html:10
+#: sphinx/themes/basic/localtoc.html:11
+msgid "Table Of Contents"
+msgstr "Taula de Contingut"
+
+#: sphinx/themes/agogo/layout.html:49 sphinx/themes/basic/layout.html:128
+#: sphinx/themes/basic/search.html:11 sphinx/themes/basic/search.html:14
+msgid "Search"
+msgstr "Cerca"
+
+#: sphinx/themes/agogo/layout.html:52 sphinx/themes/basic/searchbox.html:15
+msgid "Go"
+msgstr "Ves a"
+
+#: sphinx/themes/agogo/layout.html:57 sphinx/themes/basic/searchbox.html:20
+msgid "Enter search terms or a module, class or function name."
+msgstr "Entra paraules de cerca o el nom d'un mòdul, classe o funció."
+
+#: sphinx/themes/agogo/layout.html:78 sphinx/themes/basic/sourcelink.html:14
+msgid "Show Source"
+msgstr "Mostra Codi Font"
+
+#: sphinx/themes/basic/defindex.html:11
+msgid "Overview"
+msgstr "Resum"
+
+#: sphinx/themes/basic/defindex.html:20
+msgid "Indices and tables:"
+msgstr "Índexs i taules:"
+
+#: sphinx/themes/basic/defindex.html:23
+msgid "Complete Table of Contents"
+msgstr "Taula de Contingut Completa"
+
+#: sphinx/themes/basic/defindex.html:24
+msgid "lists all sections and subsections"
+msgstr "llista totes les seccions i subseccions"
+
+#: sphinx/themes/basic/defindex.html:26
+msgid "search this documentation"
+msgstr "cerca aquesta documentació"
+
+#: sphinx/themes/basic/defindex.html:28
+msgid "Global Module Index"
+msgstr "Índex Global de Mòduls"
+
+#: sphinx/themes/basic/defindex.html:29
+msgid "quick access to all modules"
+msgstr "accés ràpid a tots els mòduls"
+
+#: sphinx/themes/basic/defindex.html:31
+msgid "all functions, classes, terms"
+msgstr "totes les funcions, classes, termes"
+
+#: sphinx/themes/basic/genindex-single.html:14
+#, python-format
+msgid "Index &ndash; %(key)s"
+msgstr "Índes &ndash; %(key)s"
+
+#: sphinx/themes/basic/genindex-single.html:46
+#: sphinx/themes/basic/genindex-split.html:24
+#: sphinx/themes/basic/genindex-split.html:38
+#: sphinx/themes/basic/genindex.html:56
+msgid "Full index on one page"
+msgstr "Índex complet en una pàgina"
+
+#: sphinx/themes/basic/genindex-split.html:16
+msgid "Index pages by letter"
+msgstr "Pàgines d'índex per lletra"
+
+#: sphinx/themes/basic/genindex-split.html:25
+msgid "can be huge"
+msgstr "pot ser gegant"
+
+#: sphinx/themes/basic/layout.html:23
+msgid "Navigation"
+msgstr "Navegació"
+
+#: sphinx/themes/basic/layout.html:113
+#, python-format
+msgid "Search within %(docstitle)s"
+msgstr "Cerca dins de %(docstitle)s"
+
+#: sphinx/themes/basic/layout.html:122
+msgid "About these documents"
+msgstr "Quant a aquests documents"
+
+#: sphinx/themes/basic/layout.html:131
+msgid "Copyright"
+msgstr "Copyright"
+
+#: sphinx/themes/basic/layout.html:180
+#, 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:182
+#, python-format
+msgid "&copy; Copyright %(copyright)s."
+msgstr "&copy; Copyright %(copyright)s."
+
+#: sphinx/themes/basic/layout.html:186
+#, python-format
+msgid "Last updated on %(last_updated)s."
+msgstr "Última actualització el %(last_updated)s."
+
+#: sphinx/themes/basic/layout.html:189
+#, python-format
+msgid ""
+"Created using <a href=\"http://sphinx.pocoo.org/\">Sphinx</a> "
+"%(sphinx_version)s."
+msgstr ""
+"Creat amb <a href=\"http://sphinx.pocoo.org/\">Sphinx</a> "
+"%(sphinx_version)s."
+
+#: sphinx/themes/basic/opensearch.xml:4
+#, python-format
+msgid "Search %(docstitle)s"
+msgstr "Cercar a %(docstitle)s"
+
+#: sphinx/themes/basic/relations.html:11
+msgid "Previous topic"
+msgstr "Tema anterior"
+
+#: sphinx/themes/basic/relations.html:13
+msgid "previous chapter"
+msgstr "capítol anterior"
+
+#: sphinx/themes/basic/relations.html:16
+msgid "Next topic"
+msgstr "Tema següent"
+
+#: sphinx/themes/basic/relations.html:18
+msgid "next chapter"
+msgstr "capítol següent"
+
+#: sphinx/themes/basic/search.html:18
+msgid ""
+"Please activate JavaScript to enable the search\n"
+" functionality."
+msgstr ""
+"Activa JavaScript per utilitzar la funcionalitat\n"
+"de cerca."
+
+#: sphinx/themes/basic/search.html:23
+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 ""
+"Des d'aquí pots fer cerques en aquests documents. Entra les \n"
+"paraules de la teva cerca i clica el botó \"cerca\". Tingues en compte\n"
+"que la cerca inclourà totes les paraules que posis. Les pàgines que no\n"
+"tenen totes les paraules no sortiràn."
+
+#: sphinx/themes/basic/search.html:30
+msgid "search"
+msgstr "cerca"
+
+#: sphinx/themes/basic/search.html:34
+#: sphinx/themes/basic/static/searchtools.js:489
+msgid "Search Results"
+msgstr "Resultats de la Cerca"
+
+#: sphinx/themes/basic/search.html:36
+msgid "Your search did not match any results."
+msgstr "La teva cerca no té resultats."
+
+#: sphinx/themes/basic/searchbox.html:12
+msgid "Quick search"
+msgstr "Cerca ràpida"
+
+#: sphinx/themes/basic/sourcelink.html:11
+msgid "This Page"
+msgstr "Aquesta Pàgina"
+
+#: 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 "Canvis a la Versió %(version)s &mdash; %(docstitle)s"
+
+#: sphinx/themes/basic/changes/rstsource.html:5
+#, python-format
+msgid "%(filename)s &mdash; %(docstitle)s"
+msgstr "%(filename)s &mdash; %(docstitle)s"
+
+#: sphinx/themes/basic/changes/versionchanges.html:17
+#, python-format
+msgid "Automatically generated list of changes in version %(version)s"
+msgstr "Llista de canvis de la versió %(version)s generada automàticament"
+
+#: sphinx/themes/basic/changes/versionchanges.html:18
+msgid "Library changes"
+msgstr "Canvis a la llibreria"
+
+#: sphinx/themes/basic/changes/versionchanges.html:23
+msgid "C API changes"
+msgstr "Canvis a la API de C"
+
+#: sphinx/themes/basic/changes/versionchanges.html:25
+msgid "Other changes"
+msgstr "Altres canvis"
+
+#: sphinx/themes/basic/static/doctools.js:154 sphinx/writers/html.py:482
+#: sphinx/writers/html.py:487
+msgid "Permalink to this headline"
+msgstr "Link permanent a aquest títol"
+
+#: sphinx/themes/basic/static/doctools.js:160 sphinx/writers/html.py:87
+msgid "Permalink to this definition"
+msgstr "Link permanent a aquesta definició"
+
+#: sphinx/themes/basic/static/doctools.js:189
+msgid "Hide Search Matches"
+msgstr "Oculta Resultats de Cerca"
+
+#: sphinx/themes/basic/static/searchtools.js:285
+msgid "Searching"
+msgstr "Cercant"
+
+#: sphinx/themes/basic/static/searchtools.js:290
+msgid "Preparing search..."
+msgstr "Preparant la cerca..."
+
+#: sphinx/themes/basic/static/searchtools.js:364
+msgid ", in "
+msgstr ", a "
+
+#: sphinx/themes/basic/static/searchtools.js:491
+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 ""
+"La teva cerca no ha donat resultats. Assegura't que totes les paraules "
+"estan ben escrites i que has seleccionat prou categories."
+
+#: sphinx/themes/basic/static/searchtools.js:493
+#, python-format
+msgid "Search finished, found %s page(s) matching the search query."
+msgstr "Cerca finalitzada, s'han trobat %s pàgin(a/es) de resultats."
+
+#: sphinx/themes/default/static/sidebar.js:66
+msgid "Expand sidebar"
+msgstr ""
+
+#: sphinx/themes/default/static/sidebar.js:79
+#: sphinx/themes/default/static/sidebar.js:106
+msgid "Collapse sidebar"
+msgstr ""
+
+#: sphinx/themes/haiku/layout.html:26
+msgid "Contents"
+msgstr ""
+
+#: sphinx/writers/latex.py:171
+msgid "Release"
+msgstr "Versió"
+
+#: sphinx/writers/latex.py:572 sphinx/writers/manpage.py:178
+msgid "Footnotes"
+msgstr ""
+
+#: sphinx/writers/latex.py:641
+msgid "continued from previous page"
+msgstr "ve de la pàgina anterior"
+
+#: sphinx/writers/latex.py:646
+msgid "Continued on next page"
+msgstr "Continua a la pàgina següent"
+
+#: sphinx/writers/text.py:422
+msgid "[image]"
+msgstr "[imatge]"
diff --git a/sphinx/locale/cs/LC_MESSAGES/sphinx.js b/sphinx/locale/cs/LC_MESSAGES/sphinx.js
index d36ff3a67..8fdd489aa 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": {"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
+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", "Expand sidebar": "", "Permalink to this headline": "Trval\u00fd odkaz na tento nadpis", "Searching": "Hled\u00e1m", "Collapse sidebar": "", "Permalink to this definition": "Trval\u00fd odkaz na tuto definici", "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 2501ddca8..8092a9927 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 c05571112..535d4b9fb 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: 2010-05-24 23:54+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,228 +18,377 @@ 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:106 sphinx/writers/latex.py:184
+#: sphinx/writers/manpage.py:67
#, python-format
msgid "%B %d, %Y"
msgstr "%d.%m.%Y"
-#: 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
-msgid "Index"
-msgstr "Index"
-
-#: sphinx/environment.py:325 sphinx/writers/latex.py:187
-msgid "Module Index"
-msgstr "Rejstřík modulů "
-
-#: sphinx/environment.py:326 sphinx/themes/basic/defindex.html:16
-msgid "Search Page"
-msgstr "Vyhledávací stránka"
-
-#: sphinx/roles.py:55 sphinx/directives/desc.py:747
-#, python-format
-msgid "environment variable; %s"
-msgstr "promměná prostředí, %s"
-
-#: sphinx/roles.py:62
+#: sphinx/roles.py:174
#, python-format
msgid "Python Enhancement Proposals!PEP %s"
msgstr "Python Enhancement Proposals!PEP %s"
-#: sphinx/builders/changes.py:71
+#: sphinx/builders/changes.py:72
msgid "Builtins"
msgstr "Vestavěné funkce "
-#: sphinx/builders/changes.py:73
+#: sphinx/builders/changes.py:74
msgid "Module level"
msgstr "Úroveň modulů"
-#: sphinx/builders/html.py:205
+#: sphinx/builders/html.py:266
#, 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:285 sphinx/themes/basic/defindex.html:30
msgid "General Index"
msgstr "Rejstřík indexů"
-#: sphinx/builders/html.py:224
+#: sphinx/builders/html.py:285
msgid "index"
msgstr "index"
-#: 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
-msgid "Global Module Index"
-msgstr "Celkový rejstřík modulů"
-
-#: sphinx/builders/html.py:227
-msgid "modules"
-msgstr "moduly"
-
-#: sphinx/builders/html.py:281
+#: sphinx/builders/html.py:345
msgid "next"
msgstr "další"
-#: sphinx/builders/html.py:290
+#: sphinx/builders/html.py:354
msgid "previous"
msgstr "předchozí"
-#: sphinx/builders/latex.py:162
+#: sphinx/builders/latex.py:151
msgid " (in "
msgstr "(v"
-#: sphinx/directives/desc.py:97
-msgid "Raises"
-msgstr "Vyvolá"
+#: sphinx/directives/other.py:127
+msgid "Section author: "
+msgstr "Autor sekce: "
-#: sphinx/directives/desc.py:101
-msgid "Variable"
-msgstr "Proměnná"
+#: sphinx/directives/other.py:129
+msgid "Module author: "
+msgstr "Autor modulu: "
+
+#: sphinx/directives/other.py:131
+#, fuzzy
+msgid "Code author: "
+msgstr "Autor modulu: "
+
+#: sphinx/directives/other.py:133
+msgid "Author: "
+msgstr "Autor: "
+
+#: sphinx/directives/other.py:238
+msgid "See also"
+msgstr "Viz také"
+
+#: sphinx/domains/__init__.py:253
+#, python-format
+msgid "%s %s"
+msgstr ""
-#: sphinx/directives/desc.py:104
+#: sphinx/domains/c.py:51 sphinx/domains/python.py:49
+msgid "Parameters"
+msgstr "Parametry"
+
+#: sphinx/domains/c.py:54 sphinx/domains/javascript.py:137
+#: sphinx/domains/python.py:59
msgid "Returns"
msgstr "Vrací"
-#: sphinx/directives/desc.py:113
+#: sphinx/domains/c.py:56 sphinx/domains/python.py:61
msgid "Return type"
msgstr "Typ navrácené hodnoty"
-#: sphinx/directives/desc.py:186
+#: sphinx/domains/c.py:133
+#, python-format
+msgid "%s (C function)"
+msgstr "%s (C funkce)"
+
+#: sphinx/domains/c.py:135
+#, python-format
+msgid "%s (C member)"
+msgstr "%s (člen C)"
+
+#: sphinx/domains/c.py:137
+#, python-format
+msgid "%s (C macro)"
+msgstr "%s (C makro)"
+
+#: sphinx/domains/c.py:139
+#, python-format
+msgid "%s (C type)"
+msgstr "%s (C typ)"
+
+#: sphinx/domains/c.py:141
+#, python-format
+msgid "%s (C variable)"
+msgstr "%s (C proměnná)"
+
+#: sphinx/domains/c.py:171 sphinx/domains/cpp.py:1031
+#: sphinx/domains/javascript.py:166 sphinx/domains/python.py:497
+msgid "function"
+msgstr "funkce"
+
+#: sphinx/domains/c.py:172 sphinx/domains/cpp.py:1032
+msgid "member"
+msgstr "člen"
+
+#: sphinx/domains/c.py:173
+msgid "macro"
+msgstr ""
+
+#: sphinx/domains/c.py:174 sphinx/domains/cpp.py:1033
+msgid "type"
+msgstr "typ"
+
+#: sphinx/domains/c.py:175
#, fuzzy
-msgid "Parameter"
-msgstr "Parametry"
+msgid "variable"
+msgstr "Proměnná"
-#: sphinx/directives/desc.py:190
-msgid "Parameters"
-msgstr "Parametry"
+#: sphinx/domains/cpp.py:876
+#, python-format
+msgid "%s (C++ class)"
+msgstr "%s (C++ třída)"
+
+#: sphinx/domains/cpp.py:891
+#, python-format
+msgid "%s (C++ type)"
+msgstr "%s (C++ typ)"
+
+#: sphinx/domains/cpp.py:910
+#, python-format
+msgid "%s (C++ member)"
+msgstr "%s (člen C++)"
-#: sphinx/directives/desc.py:418
+#: sphinx/domains/cpp.py:962
+#, python-format
+msgid "%s (C++ function)"
+msgstr "%s (C++ funkce)"
+
+#: sphinx/domains/cpp.py:1030 sphinx/domains/python.py:499
+msgid "class"
+msgstr "třída"
+
+#: sphinx/domains/javascript.py:117 sphinx/domains/python.py:221
#, python-format
msgid "%s() (built-in function)"
msgstr "%s() (vestavěná funkce)"
-#: sphinx/directives/desc.py:419 sphinx/directives/desc.py:476
-#: sphinx/directives/desc.py:488
+#: sphinx/domains/javascript.py:118 sphinx/domains/python.py:285
+#, python-format
+msgid "%s() (%s method)"
+msgstr "%s() (metoda %s)"
+
+#: sphinx/domains/javascript.py:120
+#, python-format
+msgid "%s (global variable or constant)"
+msgstr ""
+
+#: sphinx/domains/javascript.py:122 sphinx/domains/python.py:323
+#, python-format
+msgid "%s (%s attribute)"
+msgstr "%s() (atribut %s)"
+
+#: sphinx/domains/javascript.py:131
+#, fuzzy
+msgid "Arguments"
+msgstr "Parametry"
+
+#: sphinx/domains/javascript.py:134
+msgid "Throws"
+msgstr ""
+
+#: sphinx/domains/javascript.py:167 sphinx/domains/python.py:498
+msgid "data"
+msgstr ""
+
+#: sphinx/domains/javascript.py:168 sphinx/domains/python.py:504
+msgid "attribute"
+msgstr "atribut"
+
+#: sphinx/domains/python.py:53
+#, fuzzy
+msgid "Variables"
+msgstr "Proměnná"
+
+#: sphinx/domains/python.py:56
+msgid "Raises"
+msgstr "Vyvolá"
+
+#: sphinx/domains/python.py:222 sphinx/domains/python.py:279
+#: sphinx/domains/python.py:291 sphinx/domains/python.py:304
#, python-format
msgid "%s() (in module %s)"
msgstr "%s() (v modulu %s)"
-#: sphinx/directives/desc.py:422
+#: sphinx/domains/python.py:225
#, python-format
msgid "%s (built-in variable)"
msgstr "%s() (vestavěná proměnná)"
-#: sphinx/directives/desc.py:423 sphinx/directives/desc.py:514
+#: sphinx/domains/python.py:226 sphinx/domains/python.py:317
#, python-format
msgid "%s (in module %s)"
msgstr "%s() (v modulu %s)"
-#: sphinx/directives/desc.py:439
+#: sphinx/domains/python.py:242
#, python-format
msgid "%s (built-in class)"
msgstr "%s () (vestavěná proměnná)"
-#: sphinx/directives/desc.py:440
+#: sphinx/domains/python.py:243
#, python-format
msgid "%s (class in %s)"
msgstr "%s() (třída v %s)"
-#: sphinx/directives/desc.py:480
+#: sphinx/domains/python.py:283
#, python-format
msgid "%s() (%s.%s method)"
msgstr "%s() (metoda %s.%s)"
-#: sphinx/directives/desc.py:482
-#, python-format
-msgid "%s() (%s method)"
-msgstr "%s() (metoda %s)"
-
-#: sphinx/directives/desc.py:492
+#: sphinx/domains/python.py:295
#, python-format
msgid "%s() (%s.%s static method)"
msgstr "%s() (statická metoda %s.%s)"
-#: sphinx/directives/desc.py:495
+#: sphinx/domains/python.py:298
#, python-format
msgid "%s() (%s static method)"
msgstr "%s() (statická metoda %s)"
-#: sphinx/directives/desc.py:518
+#: sphinx/domains/python.py:308
+#, fuzzy, python-format
+msgid "%s() (%s.%s class method)"
+msgstr "%s() (metoda %s.%s)"
+
+#: sphinx/domains/python.py:311
+#, fuzzy, python-format
+msgid "%s() (%s class method)"
+msgstr "%s() (metoda %s)"
+
+#: sphinx/domains/python.py:321
#, python-format
msgid "%s (%s.%s attribute)"
msgstr "%s() (atribut %s.%s)"
-#: sphinx/directives/desc.py:520
-#, python-format
-msgid "%s (%s attribute)"
-msgstr "%s() (atribut %s)"
+#: sphinx/domains/python.py:366
+msgid "Platforms: "
+msgstr "Platformy: "
-#: sphinx/directives/desc.py:609
+#: sphinx/domains/python.py:372
#, python-format
-msgid "%s (C function)"
-msgstr "%s (C funkce)"
+msgid "%s (module)"
+msgstr "%s (module)"
-#: sphinx/directives/desc.py:611
-#, python-format
-msgid "%s (C member)"
-msgstr "%s (člen C)"
+#: sphinx/domains/python.py:429
+#, fuzzy
+msgid "Python Module Index"
+msgstr "Rejstřík modulů "
-#: sphinx/directives/desc.py:613
-#, python-format
-msgid "%s (C macro)"
-msgstr "%s (C makro)"
+#: sphinx/domains/python.py:430
+msgid "modules"
+msgstr "moduly"
-#: sphinx/directives/desc.py:615
+#: sphinx/domains/python.py:475
+msgid "Deprecated"
+msgstr "Zastaralé"
+
+#: sphinx/domains/python.py:500 sphinx/locale/__init__.py:162
+msgid "exception"
+msgstr "výjimka"
+
+#: sphinx/domains/python.py:501
+msgid "method"
+msgstr ""
+
+#: sphinx/domains/python.py:502
+#, fuzzy, python-format
+msgid "class method"
+msgstr "%s() (metoda %s)"
+
+#: sphinx/domains/python.py:503
+msgid "static method"
+msgstr "statická metoda"
+
+#: sphinx/domains/python.py:505 sphinx/locale/__init__.py:158
+msgid "module"
+msgstr "modul"
+
+#: sphinx/domains/rst.py:53
#, python-format
-msgid "%s (C type)"
-msgstr "%s (C typ)"
+msgid "%s (directive)"
+msgstr ""
-#: sphinx/directives/desc.py:617
+#: sphinx/domains/rst.py:55
+#, fuzzy, python-format
+msgid "%s (role)"
+msgstr "%s (module)"
+
+#: sphinx/domains/rst.py:103
+msgid "directive"
+msgstr ""
+
+#: sphinx/domains/rst.py:104
+#, fuzzy
+msgid "role"
+msgstr "modul"
+
+#: sphinx/domains/std.py:68 sphinx/domains/std.py:84
#, python-format
-msgid "%s (C variable)"
-msgstr "%s (C proměnná)"
+msgid "environment variable; %s"
+msgstr "promměná prostředí, %s"
-#: sphinx/directives/desc.py:665
+#: sphinx/domains/std.py:160
#, python-format
msgid "%scommand line option; %s"
msgstr "%s parametry příkazového řádku; %s"
-#: sphinx/directives/other.py:138
-msgid "Platforms: "
-msgstr "Platformy: "
+#: sphinx/domains/std.py:328
+msgid "glossary term"
+msgstr ""
-#: sphinx/directives/other.py:144
-#, python-format
-msgid "%s (module)"
-msgstr "%s (module)"
+#: sphinx/domains/std.py:329
+msgid "grammar token"
+msgstr ""
-#: sphinx/directives/other.py:193
-msgid "Section author: "
-msgstr "Autor sekce: "
+#: sphinx/domains/std.py:330
+msgid "reference label"
+msgstr ""
-#: sphinx/directives/other.py:195
-msgid "Module author: "
-msgstr "Autor modulu: "
+#: sphinx/domains/std.py:331
+msgid "environment variable"
+msgstr "promměná prostředí"
-#: sphinx/directives/other.py:197
-msgid "Author: "
-msgstr "Autor: "
+#: sphinx/domains/std.py:332
+msgid "program option"
+msgstr ""
-#: sphinx/directives/other.py:317
-msgid "See also"
-msgstr "Viz také"
+#: sphinx/domains/std.py:360 sphinx/themes/basic/genindex-single.html:11
+#: sphinx/themes/basic/genindex-split.html:11
+#: sphinx/themes/basic/genindex-split.html:14
+#: sphinx/themes/basic/genindex.html:11 sphinx/themes/basic/genindex.html:14
+#: sphinx/themes/basic/genindex.html:50 sphinx/themes/basic/layout.html:125
+#: sphinx/writers/latex.py:173
+msgid "Index"
+msgstr "Index"
+
+#: sphinx/domains/std.py:361
+msgid "Module Index"
+msgstr "Rejstřík modulů "
-#: sphinx/ext/autodoc.py:883
+#: sphinx/domains/std.py:362 sphinx/themes/basic/defindex.html:25
+msgid "Search Page"
+msgstr "Vyhledávací stránka"
+
+#: sphinx/ext/autodoc.py:917
#, python-format
msgid " Bases: %s"
msgstr ""
-#: sphinx/ext/autodoc.py:916
+#: sphinx/ext/autodoc.py:950
#, python-format
msgid "alias of :class:`%s`"
msgstr ""
@@ -248,225 +397,224 @@ msgstr ""
msgid "Todo"
msgstr "Todo"
-#: sphinx/ext/todo.py:99
-#, python-format
-msgid "(The original entry is located in %s, line %d and can be found "
+#: sphinx/ext/todo.py:109
+#, fuzzy, python-format
+msgid "(The <<original entry>> is located in %s, line %d.)"
msgstr "(Původní záznam je v %s, řádka %d a lze jej nalézt"
-#: sphinx/ext/todo.py:105
-msgid "here"
-msgstr "zde"
+#: sphinx/ext/todo.py:117
+msgid "original entry"
+msgstr ""
+
+#: sphinx/ext/viewcode.py:66
+msgid "[source]"
+msgstr ""
+
+#: sphinx/ext/viewcode.py:109
+msgid "[docs]"
+msgstr ""
-#: sphinx/locale/__init__.py:15
+#: sphinx/ext/viewcode.py:123
+#, fuzzy
+msgid "Module code"
+msgstr "modul"
+
+#: sphinx/ext/viewcode.py:129
+#, python-format
+msgid "<h1>Source code for %s</h1>"
+msgstr ""
+
+#: sphinx/ext/viewcode.py:156
+msgid "Overview: module code"
+msgstr ""
+
+#: sphinx/ext/viewcode.py:157
+msgid "<h1>All modules for which code is available</h1>"
+msgstr ""
+
+#: sphinx/locale/__init__.py:139
msgid "Attention"
msgstr "Výstraha"
-#: sphinx/locale/__init__.py:16
+#: sphinx/locale/__init__.py:140
msgid "Caution"
msgstr "Upozornění"
-#: sphinx/locale/__init__.py:17
+#: sphinx/locale/__init__.py:141
msgid "Danger"
msgstr "Nebezpečí"
-#: sphinx/locale/__init__.py:18
+#: sphinx/locale/__init__.py:142
msgid "Error"
msgstr "Chyba"
-#: sphinx/locale/__init__.py:19
+#: sphinx/locale/__init__.py:143
msgid "Hint"
msgstr "Rada"
-#: sphinx/locale/__init__.py:20
+#: sphinx/locale/__init__.py:144
msgid "Important"
msgstr "Důležité"
-#: sphinx/locale/__init__.py:21
+#: sphinx/locale/__init__.py:145
msgid "Note"
msgstr "Poznámka"
-#: sphinx/locale/__init__.py:22
+#: sphinx/locale/__init__.py:146
msgid "See Also"
msgstr "Viz také"
-#: sphinx/locale/__init__.py:23
+#: sphinx/locale/__init__.py:147
msgid "Tip"
msgstr "Tip"
-#: sphinx/locale/__init__.py:24
+#: sphinx/locale/__init__.py:148
msgid "Warning"
msgstr "Varování"
-#: sphinx/locale/__init__.py:28
+#: sphinx/locale/__init__.py:152
#, python-format
msgid "New in version %s"
msgstr "Nové ve verzi %s"
-#: sphinx/locale/__init__.py:29
+#: sphinx/locale/__init__.py:153
#, python-format
msgid "Changed in version %s"
msgstr "Změněno ve verzi %s"
-#: sphinx/locale/__init__.py:30
+#: sphinx/locale/__init__.py:154
#, python-format
msgid "Deprecated since version %s"
msgstr "Zastaralé od verze %s"
-#: sphinx/locale/__init__.py:34
-msgid "module"
-msgstr "modul"
-
-#: sphinx/locale/__init__.py:35
+#: sphinx/locale/__init__.py:159
msgid "keyword"
msgstr "klíčové slovo"
-#: sphinx/locale/__init__.py:36
+#: sphinx/locale/__init__.py:160
msgid "operator"
msgstr "operátor"
-#: sphinx/locale/__init__.py:37
+#: sphinx/locale/__init__.py:161
msgid "object"
msgstr "objekt"
-#: sphinx/locale/__init__.py:38
-msgid "exception"
-msgstr "výjimka"
-
-#: sphinx/locale/__init__.py:39
+#: sphinx/locale/__init__.py:163
msgid "statement"
msgstr "příkaz"
-#: sphinx/locale/__init__.py:40
+#: sphinx/locale/__init__.py:164
msgid "built-in function"
msgstr "vestavěná funkce"
-#: sphinx/themes/basic/defindex.html:2
+#: sphinx/themes/agogo/layout.html:45 sphinx/themes/basic/globaltoc.html:10
+#: sphinx/themes/basic/localtoc.html:11
+msgid "Table Of Contents"
+msgstr "Obsah"
+
+#: sphinx/themes/agogo/layout.html:49 sphinx/themes/basic/layout.html:128
+#: sphinx/themes/basic/search.html:11 sphinx/themes/basic/search.html:14
+msgid "Search"
+msgstr "Hledání"
+
+#: sphinx/themes/agogo/layout.html:52 sphinx/themes/basic/searchbox.html:15
+msgid "Go"
+msgstr "hledej"
+
+#: sphinx/themes/agogo/layout.html:57 sphinx/themes/basic/searchbox.html:20
+#, fuzzy
+msgid "Enter search terms or a module, class or function name."
+msgstr "Zadej jméno modulu, třídy nebo funkce."
+
+#: sphinx/themes/agogo/layout.html:78 sphinx/themes/basic/sourcelink.html:14
+msgid "Show Source"
+msgstr "Ukázat zdroj"
+
+#: sphinx/themes/basic/defindex.html:11
msgid "Overview"
msgstr "Přehled"
-#: sphinx/themes/basic/defindex.html:11
+#: sphinx/themes/basic/defindex.html:20
msgid "Indices and tables:"
msgstr "Rejstříky a tabulky:"
-#: sphinx/themes/basic/defindex.html:14
+#: sphinx/themes/basic/defindex.html:23
msgid "Complete Table of Contents"
msgstr "Celkový obsah"
-#: sphinx/themes/basic/defindex.html:15
+#: sphinx/themes/basic/defindex.html:24
msgid "lists all sections and subsections"
msgstr "seznam všech sekcí a podsekcí"
-#: sphinx/themes/basic/defindex.html:17
+#: sphinx/themes/basic/defindex.html:26
msgid "search this documentation"
msgstr "prohledej tuto dokumentaci"
-#: sphinx/themes/basic/defindex.html:20
+#: sphinx/themes/basic/defindex.html:28
+msgid "Global Module Index"
+msgstr "Celkový rejstřík modulů"
+
+#: sphinx/themes/basic/defindex.html:29
msgid "quick access to all modules"
msgstr "rychlý přístup ke všem modulům"
-#: sphinx/themes/basic/defindex.html:22
+#: sphinx/themes/basic/defindex.html:31
msgid "all functions, classes, terms"
msgstr "všechny funkce, třídy, termíny"
-#: sphinx/themes/basic/genindex-single.html:5
+#: sphinx/themes/basic/genindex-single.html:14
#, python-format
msgid "Index &ndash; %(key)s"
msgstr "Index &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
+#: sphinx/themes/basic/genindex-single.html:46
+#: sphinx/themes/basic/genindex-split.html:24
+#: sphinx/themes/basic/genindex-split.html:38
+#: sphinx/themes/basic/genindex.html:56
msgid "Full index on one page"
msgstr "Plný index na jedné stránce"
-#: sphinx/themes/basic/genindex-split.html:7
+#: sphinx/themes/basic/genindex-split.html:16
msgid "Index pages by letter"
msgstr "Index podle písmene"
-#: sphinx/themes/basic/genindex-split.html:15
+#: sphinx/themes/basic/genindex-split.html:25
msgid "can be huge"
msgstr "může být obrovský"
-#: sphinx/themes/basic/layout.html:10
+#: sphinx/themes/basic/layout.html:23
msgid "Navigation"
msgstr "Navigace"
-#: sphinx/themes/basic/layout.html:42
-msgid "Table Of Contents"
-msgstr "Obsah"
-
-#: sphinx/themes/basic/layout.html:48
-msgid "Previous topic"
-msgstr "Přechozí téma"
-
-#: sphinx/themes/basic/layout.html:50
-msgid "previous chapter"
-msgstr "předchozí kapitola"
-
-#: sphinx/themes/basic/layout.html:53
-msgid "Next topic"
-msgstr "Další téma"
-
-#: sphinx/themes/basic/layout.html:55
-msgid "next chapter"
-msgstr "další kapitola"
-
-#: sphinx/themes/basic/layout.html:60
-msgid "This Page"
-msgstr "Tato stránka"
-
-#: sphinx/themes/basic/layout.html:63
-msgid "Show Source"
-msgstr "Ukázat zdroj"
-
-#: sphinx/themes/basic/layout.html:73
-msgid "Quick search"
-msgstr "Rychlé vyhledávání"
-
-#: sphinx/themes/basic/layout.html:76
-msgid "Go"
-msgstr "hledej"
-
-#: sphinx/themes/basic/layout.html:81
-#, fuzzy
-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:113
#, python-format
msgid "Search within %(docstitle)s"
msgstr "Hledání uvnitř %(docstitle)s"
-#: sphinx/themes/basic/layout.html:128
+#: sphinx/themes/basic/layout.html:122
msgid "About these documents"
msgstr "O těchto dokumentech"
-#: sphinx/themes/basic/layout.html:134 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:131
msgid "Copyright"
msgstr "Veškerá práva vyhrazena"
-#: sphinx/themes/basic/layout.html:183
+#: sphinx/themes/basic/layout.html:180
#, 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:182
#, python-format
msgid "&copy; Copyright %(copyright)s."
msgstr "&copy; Copyright %(copyright)s."
-#: sphinx/themes/basic/layout.html:188
+#: sphinx/themes/basic/layout.html:186
#, 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:189
#, python-format
msgid ""
"Created using <a href=\"http://sphinx.pocoo.org/\">Sphinx</a> "
@@ -475,22 +623,34 @@ msgstr ""
"Vytvořeno pomocí <a href=\"http://sphinx.pocoo.org/\">Sphinx</a> "
"%(sphinx_version)s."
-#: sphinx/themes/basic/modindex.html:36
-msgid "Deprecated"
-msgstr "Zastaralé"
-
#: sphinx/themes/basic/opensearch.xml:4
#, python-format
msgid "Search %(docstitle)s"
msgstr "Prohledat %(docstitle)s"
-#: sphinx/themes/basic/search.html:9
+#: sphinx/themes/basic/relations.html:11
+msgid "Previous topic"
+msgstr "Přechozí téma"
+
+#: sphinx/themes/basic/relations.html:13
+msgid "previous chapter"
+msgstr "předchozí kapitola"
+
+#: sphinx/themes/basic/relations.html:16
+msgid "Next topic"
+msgstr "Další téma"
+
+#: sphinx/themes/basic/relations.html:18
+msgid "next chapter"
+msgstr "další kapitola"
+
+#: sphinx/themes/basic/search.html:18
msgid ""
"Please activate JavaScript to enable the search\n"
" functionality."
msgstr ""
-#: sphinx/themes/basic/search.html:14
+#: sphinx/themes/basic/search.html:23
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"
@@ -502,19 +662,27 @@ msgstr ""
"Vyhledávání hledá automaticky všechna slova. Nebudou tedy nalezeny "
"stránky, obsahující méně slov."
-#: sphinx/themes/basic/search.html:21
+#: sphinx/themes/basic/search.html:30
msgid "search"
msgstr "hledej"
-#: sphinx/themes/basic/search.html:25
-#: sphinx/themes/basic/static/searchtools.js:453
+#: sphinx/themes/basic/search.html:34
+#: sphinx/themes/basic/static/searchtools.js:489
msgid "Search Results"
msgstr "Výsledky hledání"
-#: sphinx/themes/basic/search.html:27
+#: sphinx/themes/basic/search.html:36
msgid "Your search did not match any results."
msgstr "Nic jsme nenašli."
+#: sphinx/themes/basic/searchbox.html:12
+msgid "Quick search"
+msgstr "Rychlé vyhledávání"
+
+#: sphinx/themes/basic/sourcelink.html:11
+msgid "This Page"
+msgstr "Tato stránka"
+
#: sphinx/themes/basic/changes/frameset.html:5
#: sphinx/themes/basic/changes/versionchanges.html:12
#, python-format
@@ -543,36 +711,32 @@ msgstr "Změny API"
msgid "Other changes"
msgstr "Ostatní změny"
-#: sphinx/themes/basic/static/doctools.js:139 sphinx/writers/html.py:473
-#: sphinx/writers/html.py:478
+#: sphinx/themes/basic/static/doctools.js:154 sphinx/writers/html.py:482
+#: sphinx/writers/html.py:487
msgid "Permalink to this headline"
msgstr "Trvalý odkaz na tento nadpis"
-#: sphinx/themes/basic/static/doctools.js:145 sphinx/writers/html.py:80
+#: sphinx/themes/basic/static/doctools.js:160 sphinx/writers/html.py:87
msgid "Permalink to this definition"
msgstr "Trvalý odkaz na tuto definici"
-#: sphinx/themes/basic/static/doctools.js:174
+#: sphinx/themes/basic/static/doctools.js:189
msgid "Hide Search Matches"
msgstr "Skrýt výsledky vyhledávání"
-#: sphinx/themes/basic/static/searchtools.js:274
+#: sphinx/themes/basic/static/searchtools.js:285
msgid "Searching"
msgstr "Hledám"
-#: sphinx/themes/basic/static/searchtools.js:279
+#: sphinx/themes/basic/static/searchtools.js:290
msgid "Preparing search..."
msgstr "Připravuji vyhledávání...."
-#: sphinx/themes/basic/static/searchtools.js:338
-msgid "module, in "
-msgstr "modul, v"
-
-#: sphinx/themes/basic/static/searchtools.js:347
+#: sphinx/themes/basic/static/searchtools.js:364
msgid ", in "
msgstr ", v"
-#: sphinx/themes/basic/static/searchtools.js:455
+#: sphinx/themes/basic/static/searchtools.js:491
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,34 +744,41 @@ 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:493
#, 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/themes/default/static/sidebar.js:66
+msgid "Expand sidebar"
+msgstr ""
+
+#: sphinx/themes/default/static/sidebar.js:79
+#: sphinx/themes/default/static/sidebar.js:106
+msgid "Collapse sidebar"
+msgstr ""
+
+#: sphinx/themes/haiku/layout.html:26
+msgid "Contents"
+msgstr ""
+
+#: sphinx/writers/latex.py:171
msgid "Release"
msgstr "Vydání"
-#: sphinx/writers/latex.py:571
+#: sphinx/writers/latex.py:572 sphinx/writers/manpage.py:178
msgid "Footnotes"
msgstr ""
-#: sphinx/writers/latex.py:639
+#: sphinx/writers/latex.py:641
msgid "continued from previous page"
msgstr ""
-#: sphinx/writers/latex.py:644
+#: sphinx/writers/latex.py:646
#, fuzzy
msgid "Continued on next page"
msgstr "Plný index na jedné stránce"
-#: sphinx/writers/text.py:166
-#, python-format
-msgid "Platform: %s"
-msgstr "Platforma: %s"
-
-#: sphinx/writers/text.py:428
+#: sphinx/writers/text.py:422
msgid "[image]"
msgstr "[obrázek]"
-
diff --git a/sphinx/locale/de/LC_MESSAGES/sphinx.js b/sphinx/locale/de/LC_MESSAGES/sphinx.js
index 48cd3af50..5409d6d9d 100644
--- a/sphinx/locale/de/LC_MESSAGES/sphinx.js
+++ b/sphinx/locale/de/LC_MESSAGES/sphinx.js
@@ -1 +1 @@
-Documentation.addTranslations({"locale": "de", "plural_expr": "(n != 1)", "messages": {"Search Results": "Suchergebnisse", "Preparing search...": "Suche wird vorbereitet...", "Your search did not match any documents. Please make sure that all words are spelled correctly and that you've selected enough categories.": "Es wurden keine zutreffenden Dokumente gefunden. Haben Sie alle Suchbegriffe richtig geschrieben und gen\u00fcgend Kategorien ausgew\u00e4hlt?", "Search finished, found %s page(s) matching the search query.": "Suche beendet, %s zutreffende Seite(n) gefunden.", ", in ": ", in ", "Permalink to this headline": "Permalink zu dieser \u00dcberschrift", "Searching": "Suche...", "Permalink to this definition": "Permalink zu dieser Definition", "module, in ": "Modul, in ", "Hide Search Matches": "Suchergebnisse ausblenden"}}); \ No newline at end of file
+Documentation.addTranslations({"locale": "de", "plural_expr": "(n != 1)", "messages": {"Search Results": "Suchergebnisse", "Preparing search...": "Suche wird vorbereitet...", "Your search did not match any documents. Please make sure that all words are spelled correctly and that you've selected enough categories.": "Es wurden keine zutreffenden Dokumente gefunden. Haben Sie alle Suchbegriffe richtig geschrieben und gen\u00fcgend Kategorien ausgew\u00e4hlt?", "Search finished, found %s page(s) matching the search query.": "Suche beendet, %s zutreffende Seite(n) gefunden.", ", in ": ", in ", "Expand sidebar": "Sidebar ausklappen", "Permalink to this headline": "Permalink zu dieser \u00dcberschrift", "Searching": "Suche...", "Collapse sidebar": "Sidebar einklappen", "Permalink to this definition": "Permalink zu dieser Definition", "Hide Search Matches": "Suchergebnisse ausblenden"}}); \ No newline at end of file
diff --git a/sphinx/locale/de/LC_MESSAGES/sphinx.mo b/sphinx/locale/de/LC_MESSAGES/sphinx.mo
index 9b88a673a..5657b0ab8 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 d0f922966..f92ba23cd 100644
--- a/sphinx/locale/de/LC_MESSAGES/sphinx.po
+++ b/sphinx/locale/de/LC_MESSAGES/sphinx.po
@@ -7,8 +7,8 @@ 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"
-"Last-Translator: Horst Gutmann <zerok@zerokspot.com>\n"
+"PO-Revision-Date: 2010-05-24 23:54+0200\n"
+"Last-Translator: Georg Brandl <georg@python.org>\n"
"Language-Team: de <LL@li.org>\n"
"Plural-Forms: nplurals=2; plural=(n != 1)\n"
"MIME-Version: 1.0\n"
@@ -16,227 +16,373 @@ 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:106 sphinx/writers/latex.py:184
+#: sphinx/writers/manpage.py:67
#, python-format
msgid "%B %d, %Y"
msgstr "%d. %m. %Y"
-#: 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
-msgid "Index"
-msgstr "Stichwortverzeichnis"
-
-#: sphinx/environment.py:325 sphinx/writers/latex.py:187
-msgid "Module Index"
-msgstr "Modulindex"
-
-#: sphinx/environment.py:326 sphinx/themes/basic/defindex.html:16
-msgid "Search Page"
-msgstr "Suche"
-
-#: sphinx/roles.py:55 sphinx/directives/desc.py:747
-#, python-format
-msgid "environment variable; %s"
-msgstr "Umgebungsvariable; %s"
-
-#: sphinx/roles.py:62
+#: sphinx/roles.py:174
#, python-format
msgid "Python Enhancement Proposals!PEP %s"
msgstr "Python Enhancement Proposals!PEP %s"
-#: sphinx/builders/changes.py:71
+#: sphinx/builders/changes.py:72
msgid "Builtins"
msgstr "Builtins"
-#: sphinx/builders/changes.py:73
+#: sphinx/builders/changes.py:74
msgid "Module level"
msgstr "Modulebene"
-#: sphinx/builders/html.py:205
+#: sphinx/builders/html.py:266
#, 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:285 sphinx/themes/basic/defindex.html:30
msgid "General Index"
msgstr "Allgemeiner Index"
-#: sphinx/builders/html.py:224
+#: sphinx/builders/html.py:285
msgid "index"
msgstr "Index"
-#: 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
-msgid "Global Module Index"
-msgstr "Globaler Modulindex"
-
-#: sphinx/builders/html.py:227
-msgid "modules"
-msgstr "Module"
-
-#: sphinx/builders/html.py:281
+#: sphinx/builders/html.py:345
msgid "next"
msgstr "weiter"
-#: sphinx/builders/html.py:290
+#: sphinx/builders/html.py:354
msgid "previous"
msgstr "zurück"
-#: sphinx/builders/latex.py:162
+#: sphinx/builders/latex.py:151
msgid " (in "
msgstr " (in "
-#: sphinx/directives/desc.py:97
-msgid "Raises"
-msgstr "Verursacht:"
+#: sphinx/directives/other.py:127
+msgid "Section author: "
+msgstr "Autor des Abschnitts: "
-#: sphinx/directives/desc.py:101
-msgid "Variable"
-msgstr "Variable"
+#: sphinx/directives/other.py:129
+msgid "Module author: "
+msgstr "Autor des Moduls: "
-#: sphinx/directives/desc.py:104
+#: sphinx/directives/other.py:131
+msgid "Code author: "
+msgstr "Autor des Quellcode: "
+
+#: sphinx/directives/other.py:133
+msgid "Author: "
+msgstr "Autor: "
+
+#: sphinx/directives/other.py:238
+msgid "See also"
+msgstr "Siehe auch"
+
+#: sphinx/domains/__init__.py:253
+#, python-format
+msgid "%s %s"
+msgstr "%s-%s"
+
+#: sphinx/domains/c.py:51 sphinx/domains/python.py:49
+msgid "Parameters"
+msgstr "Parameter"
+
+#: sphinx/domains/c.py:54 sphinx/domains/javascript.py:137
+#: sphinx/domains/python.py:59
msgid "Returns"
msgstr "Rückgabe"
-#: sphinx/directives/desc.py:113
+#: sphinx/domains/c.py:56 sphinx/domains/python.py:61
msgid "Return type"
msgstr "Rückgabetyp"
-#: sphinx/directives/desc.py:186
-msgid "Parameter"
-msgstr "Parameter"
+#: sphinx/domains/c.py:133
+#, python-format
+msgid "%s (C function)"
+msgstr "%s (C-Funktion)"
-#: sphinx/directives/desc.py:190
-msgid "Parameters"
-msgstr "Parameter"
+#: sphinx/domains/c.py:135
+#, python-format
+msgid "%s (C member)"
+msgstr "%s (C-Member)"
+
+#: sphinx/domains/c.py:137
+#, python-format
+msgid "%s (C macro)"
+msgstr "%s (C-Makro)"
+
+#: sphinx/domains/c.py:139
+#, python-format
+msgid "%s (C type)"
+msgstr "%s (C-Typ)"
+
+#: sphinx/domains/c.py:141
+#, python-format
+msgid "%s (C variable)"
+msgstr "%s (C-Variable)"
+
+#: sphinx/domains/c.py:171 sphinx/domains/cpp.py:1031
+#: sphinx/domains/javascript.py:166 sphinx/domains/python.py:497
+msgid "function"
+msgstr "Funktion"
+
+#: sphinx/domains/c.py:172 sphinx/domains/cpp.py:1032
+msgid "member"
+msgstr "Member"
+
+#: sphinx/domains/c.py:173
+msgid "macro"
+msgstr "Makro"
-#: sphinx/directives/desc.py:418
+#: sphinx/domains/c.py:174 sphinx/domains/cpp.py:1033
+msgid "type"
+msgstr "Typ"
+
+#: sphinx/domains/c.py:175
+msgid "variable"
+msgstr "Variable"
+
+#: sphinx/domains/cpp.py:876
+#, python-format
+msgid "%s (C++ class)"
+msgstr "%s (C++-Klasse)"
+
+#: sphinx/domains/cpp.py:891
+#, python-format
+msgid "%s (C++ type)"
+msgstr "%s (C++-Typ)"
+
+#: sphinx/domains/cpp.py:910
+#, python-format
+msgid "%s (C++ member)"
+msgstr "%s (C++-Member)"
+
+#: sphinx/domains/cpp.py:962
+#, python-format
+msgid "%s (C++ function)"
+msgstr "%s (C++-Funktion)"
+
+#: sphinx/domains/cpp.py:1030 sphinx/domains/python.py:499
+msgid "class"
+msgstr "Klasse"
+
+#: sphinx/domains/javascript.py:117 sphinx/domains/python.py:221
#, python-format
msgid "%s() (built-in function)"
msgstr "%s() (Standard-Funktion)"
-#: sphinx/directives/desc.py:419 sphinx/directives/desc.py:476
-#: sphinx/directives/desc.py:488
+#: sphinx/domains/javascript.py:118 sphinx/domains/python.py:285
+#, python-format
+msgid "%s() (%s method)"
+msgstr "%s() (Methode von %s)"
+
+#: sphinx/domains/javascript.py:120
+#, python-format
+msgid "%s (global variable or constant)"
+msgstr "%s (globale Variable oder Konstante)"
+
+#: sphinx/domains/javascript.py:122 sphinx/domains/python.py:323
+#, python-format
+msgid "%s (%s attribute)"
+msgstr "%s (Attribut von %s)"
+
+#: sphinx/domains/javascript.py:131
+msgid "Arguments"
+msgstr "Parameter"
+
+#: sphinx/domains/javascript.py:134
+msgid "Throws"
+msgstr "Wirft"
+
+#: sphinx/domains/javascript.py:167 sphinx/domains/python.py:498
+msgid "data"
+msgstr "Daten"
+
+#: sphinx/domains/javascript.py:168 sphinx/domains/python.py:504
+#, python-format
+msgid "attribute"
+msgstr "Attribut"
+
+#: sphinx/domains/python.py:53
+msgid "Variables"
+msgstr "Variablen"
+
+#: sphinx/domains/python.py:56
+msgid "Raises"
+msgstr "Verursacht"
+
+#: sphinx/domains/python.py:222 sphinx/domains/python.py:279
+#: sphinx/domains/python.py:291 sphinx/domains/python.py:304
#, python-format
msgid "%s() (in module %s)"
msgstr "%s() (in Modul %s)"
-#: sphinx/directives/desc.py:422
+#: sphinx/domains/python.py:225
#, python-format
msgid "%s (built-in variable)"
msgstr "%s (Standard-Variable)"
-#: sphinx/directives/desc.py:423 sphinx/directives/desc.py:514
+#: sphinx/domains/python.py:226 sphinx/domains/python.py:317
#, python-format
msgid "%s (in module %s)"
msgstr "%s (in Modul %s)"
-#: sphinx/directives/desc.py:439
+#: sphinx/domains/python.py:242
#, python-format
msgid "%s (built-in class)"
msgstr "%s (Standard-Klasse)"
-#: sphinx/directives/desc.py:440
+#: sphinx/domains/python.py:243
#, python-format
msgid "%s (class in %s)"
msgstr "%s (Klasse in %s)"
-#: sphinx/directives/desc.py:480
+#: sphinx/domains/python.py:283
#, python-format
msgid "%s() (%s.%s method)"
msgstr "%s() (Methode von %s.%s)"
-#: sphinx/directives/desc.py:482
-#, python-format
-msgid "%s() (%s method)"
-msgstr "%s() (Methode von %s)"
-
-#: sphinx/directives/desc.py:492
+#: sphinx/domains/python.py:295
#, python-format
msgid "%s() (%s.%s static method)"
msgstr "%s() (statische Methode von %s.%s)"
-#: sphinx/directives/desc.py:495
+#: sphinx/domains/python.py:298
#, python-format
msgid "%s() (%s static method)"
msgstr "%s() (statische Methode von %s)"
-#: sphinx/directives/desc.py:518
+#: sphinx/domains/python.py:308
+#, python-format
+msgid "%s() (%s.%s class method)"
+msgstr "%s() (Klassenmethode von %s.%s)"
+
+#: sphinx/domains/python.py:311
+#, python-format
+msgid "%s() (%s class method)"
+msgstr "%s() (Klassenmethode von %s)"
+
+#: sphinx/domains/python.py:321
#, python-format
msgid "%s (%s.%s attribute)"
msgstr "%s (Attribut von %s.%s)"
-#: sphinx/directives/desc.py:520
-#, python-format
-msgid "%s (%s attribute)"
-msgstr "%s (Attribut von %s)"
+#: sphinx/domains/python.py:366
+msgid "Platforms: "
+msgstr "Plattformen: "
-#: sphinx/directives/desc.py:609
+#: sphinx/domains/python.py:372
#, python-format
-msgid "%s (C function)"
-msgstr "%s (C-Funktion)"
+msgid "%s (module)"
+msgstr "%s (Modul)"
+
+#: sphinx/domains/python.py:429
+msgid "Python Module Index"
+msgstr "Python-Modulindex"
+
+#: sphinx/domains/python.py:430
+msgid "modules"
+msgstr "Module"
-#: sphinx/directives/desc.py:611
+#: sphinx/domains/python.py:475
+msgid "Deprecated"
+msgstr "Veraltet"
+
+#: sphinx/domains/python.py:500 sphinx/locale/__init__.py:162
+msgid "exception"
+msgstr "Exception"
+
+#: sphinx/domains/python.py:501
+msgid "method"
+msgstr "Methode"
+
+#: sphinx/domains/python.py:502
#, python-format
-msgid "%s (C member)"
-msgstr "%s (C-Member)"
+msgid "class method"
+msgstr "Klassenmethode"
+
+#: sphinx/domains/python.py:503
+msgid "static method"
+msgstr "statische Methode"
+
+#: sphinx/domains/python.py:505 sphinx/locale/__init__.py:158
+msgid "module"
+msgstr "Module"
-#: sphinx/directives/desc.py:613
+#: sphinx/domains/rst.py:53
#, python-format
-msgid "%s (C macro)"
-msgstr "%s (C-Makro)"
+msgid "%s (directive)"
+msgstr "%s (Direktive)"
-#: sphinx/directives/desc.py:615
+#: sphinx/domains/rst.py:55
#, python-format
-msgid "%s (C type)"
-msgstr "%s (C-Typ)"
+msgid "%s (role)"
+msgstr "%s (Rolle)"
+
+#: sphinx/domains/rst.py:103
+msgid "directive"
+msgstr "Direktive"
+
+#: sphinx/domains/rst.py:104
+msgid "role"
+msgstr "Rolle"
-#: sphinx/directives/desc.py:617
+#: sphinx/domains/std.py:68 sphinx/domains/std.py:84
#, python-format
-msgid "%s (C variable)"
-msgstr "%s (C-Variable)"
+msgid "environment variable; %s"
+msgstr "Umgebungsvariable; %s"
-#: sphinx/directives/desc.py:665
+#: sphinx/domains/std.py:160
#, python-format
msgid "%scommand line option; %s"
msgstr "%sKommandozeilenoption; %s"
-#: sphinx/directives/other.py:138
-msgid "Platforms: "
-msgstr "Plattformen: "
+#: sphinx/domains/std.py:328
+msgid "glossary term"
+msgstr "Glossareintrag"
-#: sphinx/directives/other.py:144
+#: sphinx/domains/std.py:329
+msgid "grammar token"
+msgstr "Grammatik-Token"
+
+#: sphinx/domains/std.py:330
+msgid "reference label"
+msgstr "Referenz-Label"
+
+#: sphinx/domains/std.py:331
#, python-format
-msgid "%s (module)"
-msgstr "%s (Modul)"
+msgid "environment variable"
+msgstr "Umgebungsvariable"
-#: sphinx/directives/other.py:193
-msgid "Section author: "
-msgstr "Autor des Abschnitts: "
+#: sphinx/domains/std.py:332
+msgid "program option"
+msgstr "Programmoption"
-#: sphinx/directives/other.py:195
-msgid "Module author: "
-msgstr "Autor des Moduls: "
+#: sphinx/domains/std.py:360 sphinx/themes/basic/genindex-single.html:11
+#: sphinx/themes/basic/genindex-split.html:11
+#: sphinx/themes/basic/genindex-split.html:14
+#: sphinx/themes/basic/genindex.html:11 sphinx/themes/basic/genindex.html:14
+#: sphinx/themes/basic/genindex.html:50 sphinx/themes/basic/layout.html:125
+#: sphinx/writers/latex.py:173
+msgid "Index"
+msgstr "Stichwortverzeichnis"
-#: sphinx/directives/other.py:197
-msgid "Author: "
-msgstr "Autor: "
+#: sphinx/domains/std.py:361
+msgid "Module Index"
+msgstr "Modulindex"
-#: sphinx/directives/other.py:317
-msgid "See also"
-msgstr "Siehe auch"
+#: sphinx/domains/std.py:362 sphinx/themes/basic/defindex.html:25
+msgid "Search Page"
+msgstr "Suche"
-#: sphinx/ext/autodoc.py:883
+#: sphinx/ext/autodoc.py:917
#, python-format
msgid " Bases: %s"
msgstr " Basisklassen: %s"
-#: sphinx/ext/autodoc.py:916
+#: sphinx/ext/autodoc.py:950
#, python-format
msgid "alias of :class:`%s`"
msgstr "Alias von :class:`%s`"
@@ -245,226 +391,224 @@ msgstr "Alias von :class:`%s`"
msgid "Todo"
msgstr "Zu tun"
-#: sphinx/ext/todo.py:99
+#: sphinx/ext/todo.py:109
#, 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 %d, siehe "
+msgid "(The <<original entry>> is located in %s, line %d.)"
+msgstr "(Der <<ursprüngliche Eintrag>> steht in %s, Zeile %d.)"
+
+#: sphinx/ext/todo.py:117
+msgid "original entry"
+msgstr "ursprüngliche Eintrag"
-#: sphinx/ext/todo.py:105
-msgid "here"
-msgstr "hier"
+#: sphinx/ext/viewcode.py:66
+msgid "[source]"
+msgstr "[Quelle]"
+
+#: sphinx/ext/viewcode.py:109
+msgid "[docs]"
+msgstr "[Doku]"
+
+#: sphinx/ext/viewcode.py:123
+msgid "Module code"
+msgstr "Modul-Quellcode"
+
+#: sphinx/ext/viewcode.py:129
+#, python-format
+msgid "<h1>Source code for %s</h1>"
+msgstr "<h1>Quellcode für %s</h1>"
-#: sphinx/locale/__init__.py:15
+#: sphinx/ext/viewcode.py:156
+msgid "Overview: module code"
+msgstr "Überblick: Modul-Quellcode"
+
+#: sphinx/ext/viewcode.py:157
+msgid "<h1>All modules for which code is available</h1>"
+msgstr "<h1>Alle Module, für die Quellcode verfügbar ist</h1>"
+
+#: sphinx/locale/__init__.py:139
msgid "Attention"
msgstr "Achtung"
-#: sphinx/locale/__init__.py:16
+#: sphinx/locale/__init__.py:140
msgid "Caution"
msgstr "Vorsicht"
-#: sphinx/locale/__init__.py:17
+#: sphinx/locale/__init__.py:141
msgid "Danger"
msgstr "Gefahr"
-#: sphinx/locale/__init__.py:18
+#: sphinx/locale/__init__.py:142
msgid "Error"
msgstr "Fehler"
-#: sphinx/locale/__init__.py:19
+#: sphinx/locale/__init__.py:143
msgid "Hint"
msgstr "Hinweis"
-#: sphinx/locale/__init__.py:20
+#: sphinx/locale/__init__.py:144
msgid "Important"
msgstr "Wichtig"
-#: sphinx/locale/__init__.py:21
+#: sphinx/locale/__init__.py:145
msgid "Note"
msgstr "Bemerkung"
-#: sphinx/locale/__init__.py:22
+#: sphinx/locale/__init__.py:146
msgid "See Also"
msgstr "Siehe auch"
-#: sphinx/locale/__init__.py:23
+#: sphinx/locale/__init__.py:147
msgid "Tip"
msgstr "Tipp"
-#: sphinx/locale/__init__.py:24
+#: sphinx/locale/__init__.py:148
msgid "Warning"
msgstr "Warnung"
-#: sphinx/locale/__init__.py:28
+#: sphinx/locale/__init__.py:152
#, python-format
msgid "New in version %s"
msgstr "Neu in Version %s"
-#: sphinx/locale/__init__.py:29
+#: sphinx/locale/__init__.py:153
#, python-format
msgid "Changed in version %s"
msgstr "Geändert in Version %s"
-#: sphinx/locale/__init__.py:30
+#: sphinx/locale/__init__.py:154
#, python-format
msgid "Deprecated since version %s"
msgstr "Veraltet ab Version %s"
-#: sphinx/locale/__init__.py:34
-msgid "module"
-msgstr "Module"
-
-#: sphinx/locale/__init__.py:35
+#: sphinx/locale/__init__.py:159
msgid "keyword"
msgstr "Schlüsselwort"
-#: sphinx/locale/__init__.py:36
+#: sphinx/locale/__init__.py:160
msgid "operator"
msgstr "Operator"
-#: sphinx/locale/__init__.py:37
+#: sphinx/locale/__init__.py:161
msgid "object"
msgstr "Objekt"
-#: sphinx/locale/__init__.py:38
-msgid "exception"
-msgstr "Exception"
-
-#: sphinx/locale/__init__.py:39
+#: sphinx/locale/__init__.py:163
msgid "statement"
msgstr "Anweisung"
-#: sphinx/locale/__init__.py:40
+#: sphinx/locale/__init__.py:164
msgid "built-in function"
msgstr "Standard-Funktion"
-#: sphinx/themes/basic/defindex.html:2
+#: sphinx/themes/agogo/layout.html:45 sphinx/themes/basic/globaltoc.html:10
+#: sphinx/themes/basic/localtoc.html:11
+msgid "Table Of Contents"
+msgstr "Inhalt"
+
+#: sphinx/themes/agogo/layout.html:49 sphinx/themes/basic/layout.html:128
+#: sphinx/themes/basic/search.html:11 sphinx/themes/basic/search.html:14
+msgid "Search"
+msgstr "Suche"
+
+#: sphinx/themes/agogo/layout.html:52 sphinx/themes/basic/searchbox.html:15
+msgid "Go"
+msgstr "Los"
+
+#: sphinx/themes/agogo/layout.html:57 sphinx/themes/basic/searchbox.html:20
+msgid "Enter search terms or a module, class or function name."
+msgstr ""
+"Geben Sie Suchbegriffe oder einen Modul-, Klassen- oder Funktionsnamen "
+"ein."
+
+#: sphinx/themes/agogo/layout.html:78 sphinx/themes/basic/sourcelink.html:14
+msgid "Show Source"
+msgstr "Quelltext anzeigen"
+
+#: sphinx/themes/basic/defindex.html:11
msgid "Overview"
msgstr "Übersicht"
-#: sphinx/themes/basic/defindex.html:11
+#: sphinx/themes/basic/defindex.html:20
msgid "Indices and tables:"
msgstr "Indizes und Tabellen:"
-#: sphinx/themes/basic/defindex.html:14
+#: sphinx/themes/basic/defindex.html:23
msgid "Complete Table of Contents"
msgstr "Vollständiges Inhaltsverzeichnis"
-#: sphinx/themes/basic/defindex.html:15
+#: sphinx/themes/basic/defindex.html:24
msgid "lists all sections and subsections"
msgstr "Liste aller Kapitel und Unterkapitel"
-#: sphinx/themes/basic/defindex.html:17
+#: sphinx/themes/basic/defindex.html:26
msgid "search this documentation"
msgstr "Durchsuche diese Dokumentation"
-#: sphinx/themes/basic/defindex.html:20
+#: sphinx/themes/basic/defindex.html:28
+msgid "Global Module Index"
+msgstr "Globaler Modulindex"
+
+#: sphinx/themes/basic/defindex.html:29
msgid "quick access to all modules"
msgstr "Schneller Zugriff auf alle Module"
-#: sphinx/themes/basic/defindex.html:22
+#: sphinx/themes/basic/defindex.html:31
msgid "all functions, classes, terms"
msgstr "Alle Funktionen, Klassen, Begriffe"
-#: sphinx/themes/basic/genindex-single.html:5
+#: sphinx/themes/basic/genindex-single.html:14
#, python-format
msgid "Index &ndash; %(key)s"
msgstr "Stichwortverzeichnis &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
+#: sphinx/themes/basic/genindex-single.html:46
+#: sphinx/themes/basic/genindex-split.html:24
+#: sphinx/themes/basic/genindex-split.html:38
+#: sphinx/themes/basic/genindex.html:56
msgid "Full index on one page"
msgstr "Gesamtes Stichwortverzeichnis auf einer Seite"
-#: sphinx/themes/basic/genindex-split.html:7
+#: sphinx/themes/basic/genindex-split.html:16
msgid "Index pages by letter"
msgstr "Stichwortverzeichnis nach Anfangsbuchstabe"
-#: sphinx/themes/basic/genindex-split.html:15
+#: sphinx/themes/basic/genindex-split.html:25
msgid "can be huge"
msgstr "kann groß sein"
-#: sphinx/themes/basic/layout.html:10
+#: sphinx/themes/basic/layout.html:23
msgid "Navigation"
msgstr "Navigation"
-#: sphinx/themes/basic/layout.html:42
-msgid "Table Of Contents"
-msgstr "Inhalt"
-
-#: sphinx/themes/basic/layout.html:48
-msgid "Previous topic"
-msgstr "Vorheriges Thema"
-
-#: sphinx/themes/basic/layout.html:50
-msgid "previous chapter"
-msgstr "vorheriges Kapitel"
-
-#: sphinx/themes/basic/layout.html:53
-msgid "Next topic"
-msgstr "Nächstes Thema"
-
-#: sphinx/themes/basic/layout.html:55
-msgid "next chapter"
-msgstr "nächstes Kapitel"
-
-#: sphinx/themes/basic/layout.html:60
-msgid "This Page"
-msgstr "Diese Seite"
-
-#: sphinx/themes/basic/layout.html:63
-msgid "Show Source"
-msgstr "Quelltext anzeigen"
-
-#: sphinx/themes/basic/layout.html:73
-msgid "Quick search"
-msgstr "Schnellsuche"
-
-#: sphinx/themes/basic/layout.html:76
-msgid "Go"
-msgstr "Los"
-
-#: sphinx/themes/basic/layout.html:81
-msgid "Enter search terms or a module, class or function name."
-msgstr ""
-"Geben Sie Suchbegriffe oder einen Modul-, Klassen- oder Funktionsnamen "
-"ein."
-
-#: sphinx/themes/basic/layout.html:119
+#: sphinx/themes/basic/layout.html:113
#, python-format
msgid "Search within %(docstitle)s"
msgstr "Suche in %(docstitle)s"
-#: sphinx/themes/basic/layout.html:128
+#: sphinx/themes/basic/layout.html:122
msgid "About these documents"
msgstr "Über diese Dokumentation"
-#: sphinx/themes/basic/layout.html:134 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:131
msgid "Copyright"
msgstr "Copyright"
-#: sphinx/themes/basic/layout.html:183
+#: sphinx/themes/basic/layout.html:180
#, 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:182
#, python-format
msgid "&copy; Copyright %(copyright)s."
msgstr "&copy; Copyright %(copyright)s."
-#: sphinx/themes/basic/layout.html:188
+#: sphinx/themes/basic/layout.html:186
#, 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:189
#, python-format
msgid ""
"Created using <a href=\"http://sphinx.pocoo.org/\">Sphinx</a> "
@@ -473,22 +617,34 @@ msgstr ""
"Mit <a href=\"http://sphinx.pocoo.org/\">Sphinx</a> %(sphinx_version)s "
"erstellt."
-#: sphinx/themes/basic/modindex.html:36
-msgid "Deprecated"
-msgstr "Veraltet"
-
#: sphinx/themes/basic/opensearch.xml:4
#, python-format
msgid "Search %(docstitle)s"
msgstr "Suche in %(docstitle)s"
-#: sphinx/themes/basic/search.html:9
+#: sphinx/themes/basic/relations.html:11
+msgid "Previous topic"
+msgstr "Vorheriges Thema"
+
+#: sphinx/themes/basic/relations.html:13
+msgid "previous chapter"
+msgstr "vorheriges Kapitel"
+
+#: sphinx/themes/basic/relations.html:16
+msgid "Next topic"
+msgstr "Nächstes Thema"
+
+#: sphinx/themes/basic/relations.html:18
+msgid "next chapter"
+msgstr "nächstes Kapitel"
+
+#: sphinx/themes/basic/search.html:18
msgid ""
"Please activate JavaScript to enable the search\n"
" functionality."
msgstr "Bitte aktivieren Sie JavaScript, wenn Sie die Suchfunktion nutzen wollen."
-#: sphinx/themes/basic/search.html:14
+#: sphinx/themes/basic/search.html:23
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"
@@ -501,19 +657,27 @@ msgstr ""
"all diesen Worten suchen wird. Seiten, die nicht alle Worte enthalten, "
"werden nicht in der Ergebnisliste erscheinen."
-#: sphinx/themes/basic/search.html:21
+#: sphinx/themes/basic/search.html:30
msgid "search"
msgstr "suchen"
-#: sphinx/themes/basic/search.html:25
-#: sphinx/themes/basic/static/searchtools.js:453
+#: sphinx/themes/basic/search.html:34
+#: sphinx/themes/basic/static/searchtools.js:489
msgid "Search Results"
msgstr "Suchergebnisse"
-#: sphinx/themes/basic/search.html:27
+#: sphinx/themes/basic/search.html:36
msgid "Your search did not match any results."
msgstr "Deine Suche ergab leider keine Treffer."
+#: sphinx/themes/basic/searchbox.html:12
+msgid "Quick search"
+msgstr "Schnellsuche"
+
+#: sphinx/themes/basic/sourcelink.html:11
+msgid "This Page"
+msgstr "Diese Seite"
+
#: sphinx/themes/basic/changes/frameset.html:5
#: sphinx/themes/basic/changes/versionchanges.html:12
#, python-format
@@ -542,36 +706,32 @@ msgstr "C API-Änderungen"
msgid "Other changes"
msgstr "Andere Änderungen"
-#: sphinx/themes/basic/static/doctools.js:139 sphinx/writers/html.py:473
-#: sphinx/writers/html.py:478
+#: sphinx/themes/basic/static/doctools.js:154 sphinx/writers/html.py:482
+#: sphinx/writers/html.py:487
msgid "Permalink to this headline"
msgstr "Permalink zu dieser Überschrift"
-#: sphinx/themes/basic/static/doctools.js:145 sphinx/writers/html.py:80
+#: sphinx/themes/basic/static/doctools.js:160 sphinx/writers/html.py:87
msgid "Permalink to this definition"
msgstr "Permalink zu dieser Definition"
-#: sphinx/themes/basic/static/doctools.js:174
+#: sphinx/themes/basic/static/doctools.js:189
msgid "Hide Search Matches"
msgstr "Suchergebnisse ausblenden"
-#: sphinx/themes/basic/static/searchtools.js:274
+#: sphinx/themes/basic/static/searchtools.js:285
msgid "Searching"
msgstr "Suche..."
-#: sphinx/themes/basic/static/searchtools.js:279
+#: sphinx/themes/basic/static/searchtools.js:290
msgid "Preparing search..."
msgstr "Suche wird vorbereitet..."
-#: sphinx/themes/basic/static/searchtools.js:338
-msgid "module, in "
-msgstr "Modul, in "
-
-#: sphinx/themes/basic/static/searchtools.js:347
+#: sphinx/themes/basic/static/searchtools.js:364
msgid ", in "
msgstr ", in "
-#: sphinx/themes/basic/static/searchtools.js:455
+#: sphinx/themes/basic/static/searchtools.js:491
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,33 +739,41 @@ 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:493
#, 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/themes/default/static/sidebar.js:66
+msgid "Expand sidebar"
+msgstr "Sidebar ausklappen"
+
+#: sphinx/themes/default/static/sidebar.js:79
+#: sphinx/themes/default/static/sidebar.js:106
+msgid "Collapse sidebar"
+msgstr "Sidebar einklappen"
+
+#: sphinx/themes/haiku/layout.html:26
+msgid "Contents"
+msgstr "Inhalt"
+
+#: sphinx/writers/latex.py:171
msgid "Release"
msgstr "Release"
-#: sphinx/writers/latex.py:571
+#: sphinx/writers/latex.py:572 sphinx/writers/manpage.py:178
msgid "Footnotes"
msgstr "Fußnoten"
-#: sphinx/writers/latex.py:639
+#: sphinx/writers/latex.py:641
msgid "continued from previous page"
msgstr "Fortsetzung der vorherigen Seite"
-#: sphinx/writers/latex.py:644
+#: sphinx/writers/latex.py:646
msgid "Continued on next page"
msgstr "Fortsetzung auf der nächsten Seite"
-#: sphinx/writers/text.py:166
-#, python-format
-msgid "Platform: %s"
-msgstr "Plattform: %s"
-
-#: sphinx/writers/text.py:428
+#: sphinx/writers/text.py:422
msgid "[image]"
msgstr "[Bild]"
diff --git a/sphinx/locale/es/LC_MESSAGES/sphinx.js b/sphinx/locale/es/LC_MESSAGES/sphinx.js
index f43c642a4..098e8b5df 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": {"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
+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 ": "", "Expand sidebar": "", "Permalink to this headline": "Enlazar permanentemente con este t\u00edtulo", "Searching": "Buscando", "Collapse sidebar": "", "Permalink to this definition": "Enlazar permanentemente con esta definici\u00f3n", "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 85c0b1b38..c1ee0bfe1 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 b7718a10a..a380a416f 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: 2010-05-24 23:54+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,231 +17,380 @@ 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:106 sphinx/writers/latex.py:184
+#: sphinx/writers/manpage.py:67
#, fuzzy, python-format
msgid "%B %d, %Y"
msgstr "%d de %B de %Y"
-#: 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
-msgid "Index"
-msgstr "Índice"
-
-#: sphinx/environment.py:325 sphinx/writers/latex.py:187
-msgid "Module Index"
-msgstr "Índice de Módulos"
-
-#: sphinx/environment.py:326 sphinx/themes/basic/defindex.html:16
-msgid "Search Page"
-msgstr "Página de Búsqueda"
-
-#: sphinx/roles.py:55 sphinx/directives/desc.py:747
-#, python-format
-msgid "environment variable; %s"
-msgstr "variables de entorno; %s"
-
-#: sphinx/roles.py:62
+#: sphinx/roles.py:174
#, python-format
msgid "Python Enhancement Proposals!PEP %s"
msgstr "Python Enhancement Proposals!PEP %s"
-#: sphinx/builders/changes.py:71
+#: sphinx/builders/changes.py:72
#, fuzzy
msgid "Builtins"
msgstr "Funciones de base"
-#: sphinx/builders/changes.py:73
+#: sphinx/builders/changes.py:74
#, fuzzy
msgid "Module level"
msgstr "Módulos"
-#: sphinx/builders/html.py:205
+#: sphinx/builders/html.py:266
#, 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:285 sphinx/themes/basic/defindex.html:30
msgid "General Index"
msgstr "Índice General"
-#: sphinx/builders/html.py:224
+#: sphinx/builders/html.py:285
msgid "index"
msgstr "índice"
-#: 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
-msgid "Global Module Index"
-msgstr "Índice Global de Módulos"
-
-#: sphinx/builders/html.py:227
-msgid "modules"
-msgstr "módulos"
-
-#: sphinx/builders/html.py:281
+#: sphinx/builders/html.py:345
msgid "next"
msgstr "siguiente"
-#: sphinx/builders/html.py:290
+#: sphinx/builders/html.py:354
msgid "previous"
msgstr "anterior"
-#: sphinx/builders/latex.py:162
+#: sphinx/builders/latex.py:151
msgid " (in "
msgstr ""
-#: sphinx/directives/desc.py:97
-msgid "Raises"
-msgstr "Muestra"
+#: sphinx/directives/other.py:127
+msgid "Section author: "
+msgstr "Autor de la sección: "
-#: sphinx/directives/desc.py:101
-msgid "Variable"
-msgstr "Variable"
+#: sphinx/directives/other.py:129
+msgid "Module author: "
+msgstr "Autor del módulo: "
+
+#: sphinx/directives/other.py:131
+#, fuzzy
+msgid "Code author: "
+msgstr "Autor del módulo: "
+
+#: sphinx/directives/other.py:133
+msgid "Author: "
+msgstr "Autor:"
-#: sphinx/directives/desc.py:104
+#: sphinx/directives/other.py:238
+msgid "See also"
+msgstr "Ver también"
+
+#: sphinx/domains/__init__.py:253
+#, python-format
+msgid "%s %s"
+msgstr ""
+
+#: sphinx/domains/c.py:51 sphinx/domains/python.py:49
+msgid "Parameters"
+msgstr "Parámetros"
+
+#: sphinx/domains/c.py:54 sphinx/domains/javascript.py:137
+#: sphinx/domains/python.py:59
msgid "Returns"
msgstr "Devuelve"
-#: sphinx/directives/desc.py:113
+#: sphinx/domains/c.py:56 sphinx/domains/python.py:61
#, fuzzy
msgid "Return type"
msgstr "Tipo del argumento devuelto"
-#: sphinx/directives/desc.py:186
+#: sphinx/domains/c.py:133
+#, python-format
+msgid "%s (C function)"
+msgstr "%s (función C)"
+
+#: sphinx/domains/c.py:135
+#, python-format
+msgid "%s (C member)"
+msgstr "%s (miembro C)"
+
+#: sphinx/domains/c.py:137
+#, python-format
+msgid "%s (C macro)"
+msgstr "%s (macro C)"
+
+#: sphinx/domains/c.py:139
+#, python-format
+msgid "%s (C type)"
+msgstr "%s (tipo C)"
+
+#: sphinx/domains/c.py:141
+#, python-format
+msgid "%s (C variable)"
+msgstr "%s (variable C)"
+
+#: sphinx/domains/c.py:171 sphinx/domains/cpp.py:1031
+#: sphinx/domains/javascript.py:166 sphinx/domains/python.py:497
+msgid "function"
+msgstr "función"
+
+#: sphinx/domains/c.py:172 sphinx/domains/cpp.py:1032
+msgid "member"
+msgstr "miembro"
+
+#: sphinx/domains/c.py:173
+msgid "macro"
+msgstr ""
+
+#: sphinx/domains/c.py:174 sphinx/domains/cpp.py:1033
+msgid "type"
+msgstr "tipo"
+
+#: sphinx/domains/c.py:175
#, fuzzy
-msgid "Parameter"
-msgstr "Parámetros"
+msgid "variable"
+msgstr "Variable"
-#: sphinx/directives/desc.py:190
-msgid "Parameters"
-msgstr "Parámetros"
+#: sphinx/domains/cpp.py:876
+#, python-format
+msgid "%s (C++ class)"
+msgstr "%s (clase C++)"
+
+#: sphinx/domains/cpp.py:891
+#, python-format
+msgid "%s (C++ type)"
+msgstr "%s (tipo C++)"
+
+#: sphinx/domains/cpp.py:910
+#, fuzzy, python-format
+msgid "%s (C++ member)"
+msgstr "%s (miembro C++)"
+
+#: sphinx/domains/cpp.py:962
+#, fuzzy, python-format
+msgid "%s (C++ function)"
+msgstr "%s (función C++)"
+
+#: sphinx/domains/cpp.py:1030 sphinx/domains/python.py:499
+msgid "class"
+msgstr "clase"
-#: sphinx/directives/desc.py:418
+#: sphinx/domains/javascript.py:117 sphinx/domains/python.py:221
#, fuzzy, python-format
msgid "%s() (built-in function)"
msgstr "%s() (función de base)"
-#: sphinx/directives/desc.py:419 sphinx/directives/desc.py:476
-#: sphinx/directives/desc.py:488
+#: sphinx/domains/javascript.py:118 sphinx/domains/python.py:285
+#, python-format
+msgid "%s() (%s method)"
+msgstr "%s() (%s método)"
+
+#: sphinx/domains/javascript.py:120
+#, python-format
+msgid "%s (global variable or constant)"
+msgstr ""
+
+#: sphinx/domains/javascript.py:122 sphinx/domains/python.py:323
+#, python-format
+msgid "%s (%s attribute)"
+msgstr "%s (%s atributo)"
+
+#: sphinx/domains/javascript.py:131
+#, fuzzy
+msgid "Arguments"
+msgstr "Parámetros"
+
+#: sphinx/domains/javascript.py:134
+msgid "Throws"
+msgstr ""
+
+#: sphinx/domains/javascript.py:167 sphinx/domains/python.py:498
+msgid "data"
+msgstr ""
+
+#: sphinx/domains/javascript.py:168 sphinx/domains/python.py:504
+msgid "attribute"
+msgstr "atributo"
+
+#: sphinx/domains/python.py:53
+#, fuzzy
+msgid "Variables"
+msgstr "Variable"
+
+#: sphinx/domains/python.py:56
+msgid "Raises"
+msgstr "Muestra"
+
+#: sphinx/domains/python.py:222 sphinx/domains/python.py:279
+#: sphinx/domains/python.py:291 sphinx/domains/python.py:304
#, python-format
msgid "%s() (in module %s)"
msgstr "%s() (en el módulo %s)"
-#: sphinx/directives/desc.py:422
+#: sphinx/domains/python.py:225
#, fuzzy, python-format
msgid "%s (built-in variable)"
msgstr "%s (variable de base)"
-#: sphinx/directives/desc.py:423 sphinx/directives/desc.py:514
+#: sphinx/domains/python.py:226 sphinx/domains/python.py:317
#, python-format
msgid "%s (in module %s)"
msgstr "%s (en el módulo %s)"
-#: sphinx/directives/desc.py:439
+#: sphinx/domains/python.py:242
#, fuzzy, python-format
msgid "%s (built-in class)"
msgstr "%s (variable de base)"
-#: sphinx/directives/desc.py:440
+#: sphinx/domains/python.py:243
#, python-format
msgid "%s (class in %s)"
msgstr "%s (clase en %s)"
-#: sphinx/directives/desc.py:480
+#: sphinx/domains/python.py:283
#, python-format
msgid "%s() (%s.%s method)"
msgstr "%s() (%s.%s método)"
-#: sphinx/directives/desc.py:482
-#, python-format
-msgid "%s() (%s method)"
-msgstr "%s() (%s método)"
-
-#: sphinx/directives/desc.py:492
+#: sphinx/domains/python.py:295
#, python-format
msgid "%s() (%s.%s static method)"
msgstr "%s() (%s.%s método estático)"
-#: sphinx/directives/desc.py:495
+#: sphinx/domains/python.py:298
#, python-format
msgid "%s() (%s static method)"
msgstr "%s() (%s método estático)"
-#: sphinx/directives/desc.py:518
+#: sphinx/domains/python.py:308
+#, fuzzy, python-format
+msgid "%s() (%s.%s class method)"
+msgstr "%s() (%s.%s método)"
+
+#: sphinx/domains/python.py:311
+#, fuzzy, python-format
+msgid "%s() (%s class method)"
+msgstr "%s() (%s método)"
+
+#: sphinx/domains/python.py:321
#, python-format
msgid "%s (%s.%s attribute)"
msgstr "%s (%s.%s atributo)"
-#: sphinx/directives/desc.py:520
-#, python-format
-msgid "%s (%s attribute)"
-msgstr "%s (%s atributo)"
+#: sphinx/domains/python.py:366
+msgid "Platforms: "
+msgstr "Plataformas:"
-#: sphinx/directives/desc.py:609
+#: sphinx/domains/python.py:372
#, python-format
-msgid "%s (C function)"
-msgstr "%s (función C)"
+msgid "%s (module)"
+msgstr "%s (módulo)"
-#: sphinx/directives/desc.py:611
-#, python-format
-msgid "%s (C member)"
-msgstr "%s (miembro C)"
+#: sphinx/domains/python.py:429
+#, fuzzy
+msgid "Python Module Index"
+msgstr "Índice de Módulos"
-#: sphinx/directives/desc.py:613
-#, python-format
-msgid "%s (C macro)"
-msgstr "%s (macro C)"
+#: sphinx/domains/python.py:430
+msgid "modules"
+msgstr "módulos"
+
+#: sphinx/domains/python.py:475
+msgid "Deprecated"
+msgstr "Obsoleto"
+
+#: sphinx/domains/python.py:500 sphinx/locale/__init__.py:162
+msgid "exception"
+msgstr "excepción"
+
+#: sphinx/domains/python.py:501
+msgid "method"
+msgstr ""
-#: sphinx/directives/desc.py:615
+#: sphinx/domains/python.py:502
+#, fuzzy, python-format
+msgid "class method"
+msgstr "%s() (%s método)"
+
+#: sphinx/domains/python.py:503
+msgid "static method"
+msgstr "método estático"
+
+#: sphinx/domains/python.py:505 sphinx/locale/__init__.py:158
+msgid "module"
+msgstr "módulo"
+
+#: sphinx/domains/rst.py:53
#, python-format
-msgid "%s (C type)"
-msgstr "%s (tipo C)"
+msgid "%s (directive)"
+msgstr ""
+
+#: sphinx/domains/rst.py:55
+#, fuzzy, python-format
+msgid "%s (role)"
+msgstr "%s (módulo)"
+
+#: sphinx/domains/rst.py:103
+msgid "directive"
+msgstr ""
-#: sphinx/directives/desc.py:617
+#: sphinx/domains/rst.py:104
+#, fuzzy
+msgid "role"
+msgstr "módulo"
+
+#: sphinx/domains/std.py:68 sphinx/domains/std.py:84
#, python-format
-msgid "%s (C variable)"
-msgstr "%s (variable C)"
+msgid "environment variable; %s"
+msgstr "variables de entorno; %s"
-#: sphinx/directives/desc.py:665
+#: sphinx/domains/std.py:160
#, fuzzy, python-format
msgid "%scommand line option; %s"
msgstr "%sOpciones en línea de comandos; %s"
-#: sphinx/directives/other.py:138
-msgid "Platforms: "
-msgstr "Plataformas:"
+#: sphinx/domains/std.py:328
+msgid "glossary term"
+msgstr ""
-#: sphinx/directives/other.py:144
-#, python-format
-msgid "%s (module)"
-msgstr "%s (módulo)"
+#: sphinx/domains/std.py:329
+msgid "grammar token"
+msgstr ""
-#: sphinx/directives/other.py:193
-msgid "Section author: "
-msgstr "Autor de la sección"
+#: sphinx/domains/std.py:330
+msgid "reference label"
+msgstr ""
-#: sphinx/directives/other.py:195
-msgid "Module author: "
-msgstr "Autor del módulo"
+#: sphinx/domains/std.py:331
+msgid "environment variable"
+msgstr "variables de entorno"
-#: sphinx/directives/other.py:197
-msgid "Author: "
-msgstr "Autor:"
+#: sphinx/domains/std.py:332
+msgid "program option"
+msgstr ""
-#: sphinx/directives/other.py:317
-msgid "See also"
-msgstr "Ver también"
+#: sphinx/domains/std.py:360 sphinx/themes/basic/genindex-single.html:11
+#: sphinx/themes/basic/genindex-split.html:11
+#: sphinx/themes/basic/genindex-split.html:14
+#: sphinx/themes/basic/genindex.html:11 sphinx/themes/basic/genindex.html:14
+#: sphinx/themes/basic/genindex.html:50 sphinx/themes/basic/layout.html:125
+#: sphinx/writers/latex.py:173
+msgid "Index"
+msgstr "Índice"
+
+#: sphinx/domains/std.py:361
+msgid "Module Index"
+msgstr "Índice de Módulos"
+
+#: sphinx/domains/std.py:362 sphinx/themes/basic/defindex.html:25
+msgid "Search Page"
+msgstr "Página de Búsqueda"
-#: sphinx/ext/autodoc.py:883
+#: sphinx/ext/autodoc.py:917
#, python-format
msgid " Bases: %s"
msgstr ""
-#: sphinx/ext/autodoc.py:916
+#: sphinx/ext/autodoc.py:950
#, python-format
msgid "alias of :class:`%s`"
msgstr ""
@@ -250,226 +399,225 @@ msgstr ""
msgid "Todo"
msgstr ""
-#: sphinx/ext/todo.py:99
+#: sphinx/ext/todo.py:109
#, python-format
-msgid "(The original entry is located in %s, line %d and can be found "
+msgid "(The <<original entry>> is located in %s, line %d.)"
msgstr ""
-#: sphinx/ext/todo.py:105
-msgid "here"
+#: sphinx/ext/todo.py:117
+msgid "original entry"
msgstr ""
-#: sphinx/locale/__init__.py:15
+#: sphinx/ext/viewcode.py:66
+msgid "[source]"
+msgstr ""
+
+#: sphinx/ext/viewcode.py:109
+msgid "[docs]"
+msgstr ""
+
+#: sphinx/ext/viewcode.py:123
+#, fuzzy
+msgid "Module code"
+msgstr "módulo"
+
+#: sphinx/ext/viewcode.py:129
+#, python-format
+msgid "<h1>Source code for %s</h1>"
+msgstr ""
+
+#: sphinx/ext/viewcode.py:156
+msgid "Overview: module code"
+msgstr ""
+
+#: sphinx/ext/viewcode.py:157
+msgid "<h1>All modules for which code is available</h1>"
+msgstr ""
+
+#: sphinx/locale/__init__.py:139
msgid "Attention"
msgstr "Atención"
-#: sphinx/locale/__init__.py:16
+#: sphinx/locale/__init__.py:140
msgid "Caution"
msgstr "Prudencia"
-#: sphinx/locale/__init__.py:17
+#: sphinx/locale/__init__.py:141
msgid "Danger"
msgstr "Peligro"
-#: sphinx/locale/__init__.py:18
+#: sphinx/locale/__init__.py:142
msgid "Error"
msgstr "Error"
-#: sphinx/locale/__init__.py:19
+#: sphinx/locale/__init__.py:143
msgid "Hint"
msgstr "Consejo"
-#: sphinx/locale/__init__.py:20
+#: sphinx/locale/__init__.py:144
msgid "Important"
msgstr "Importante"
-#: sphinx/locale/__init__.py:21
+#: sphinx/locale/__init__.py:145
msgid "Note"
msgstr "Nota"
-#: sphinx/locale/__init__.py:22
+#: sphinx/locale/__init__.py:146
msgid "See Also"
msgstr "Ver También"
-#: sphinx/locale/__init__.py:23
+#: sphinx/locale/__init__.py:147
msgid "Tip"
msgstr "Truco"
-#: sphinx/locale/__init__.py:24
+#: sphinx/locale/__init__.py:148
msgid "Warning"
msgstr "Advertencia"
-#: sphinx/locale/__init__.py:28
+#: sphinx/locale/__init__.py:152
#, python-format
msgid "New in version %s"
msgstr "Nuevo en la versión %s"
-#: sphinx/locale/__init__.py:29
+#: sphinx/locale/__init__.py:153
#, python-format
msgid "Changed in version %s"
msgstr "Distinto en la versión %s"
-#: sphinx/locale/__init__.py:30
+#: sphinx/locale/__init__.py:154
#, python-format
msgid "Deprecated since version %s"
msgstr "Obsoleto desde la versión %s"
-#: sphinx/locale/__init__.py:34
-msgid "module"
-msgstr "módulo"
-
-#: sphinx/locale/__init__.py:35
+#: sphinx/locale/__init__.py:159
msgid "keyword"
msgstr "palabra clave"
-#: sphinx/locale/__init__.py:36
+#: sphinx/locale/__init__.py:160
msgid "operator"
msgstr "operador"
-#: sphinx/locale/__init__.py:37
+#: sphinx/locale/__init__.py:161
msgid "object"
msgstr "objeto"
-#: sphinx/locale/__init__.py:38
-msgid "exception"
-msgstr "excepción"
-
-#: sphinx/locale/__init__.py:39
+#: sphinx/locale/__init__.py:163
msgid "statement"
msgstr "sentencia"
-#: sphinx/locale/__init__.py:40
+#: sphinx/locale/__init__.py:164
#, fuzzy
msgid "built-in function"
msgstr "función de base"
-#: sphinx/themes/basic/defindex.html:2
+#: sphinx/themes/agogo/layout.html:45 sphinx/themes/basic/globaltoc.html:10
+#: sphinx/themes/basic/localtoc.html:11
+msgid "Table Of Contents"
+msgstr "Contenidos"
+
+#: sphinx/themes/agogo/layout.html:49 sphinx/themes/basic/layout.html:128
+#: sphinx/themes/basic/search.html:11 sphinx/themes/basic/search.html:14
+msgid "Search"
+msgstr "Búsqueda"
+
+#: sphinx/themes/agogo/layout.html:52 sphinx/themes/basic/searchbox.html:15
+msgid "Go"
+msgstr "Ir a"
+
+#: sphinx/themes/agogo/layout.html:57 sphinx/themes/basic/searchbox.html:20
+#, fuzzy
+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/agogo/layout.html:78 sphinx/themes/basic/sourcelink.html:14
+msgid "Show Source"
+msgstr "Enseñar el código"
+
+#: sphinx/themes/basic/defindex.html:11
msgid "Overview"
msgstr "Resumen"
-#: sphinx/themes/basic/defindex.html:11
+#: sphinx/themes/basic/defindex.html:20
msgid "Indices and tables:"
msgstr "Índices y tablas:"
-#: sphinx/themes/basic/defindex.html:14
+#: sphinx/themes/basic/defindex.html:23
msgid "Complete Table of Contents"
msgstr "Índice de contenidos completo"
-#: sphinx/themes/basic/defindex.html:15
+#: sphinx/themes/basic/defindex.html:24
msgid "lists all sections and subsections"
msgstr "Muestra todas las secciones"
-#: sphinx/themes/basic/defindex.html:17
+#: sphinx/themes/basic/defindex.html:26
msgid "search this documentation"
msgstr "buscar en esta documentación"
-#: sphinx/themes/basic/defindex.html:20
+#: sphinx/themes/basic/defindex.html:28
+msgid "Global Module Index"
+msgstr "Índice Global de Módulos"
+
+#: sphinx/themes/basic/defindex.html:29
msgid "quick access to all modules"
msgstr "acceso rápido a todos los módulos"
-#: sphinx/themes/basic/defindex.html:22
+#: sphinx/themes/basic/defindex.html:31
msgid "all functions, classes, terms"
msgstr "todas las funciones, clases, términos"
-#: sphinx/themes/basic/genindex-single.html:5
+#: sphinx/themes/basic/genindex-single.html:14
#, python-format
msgid "Index &ndash; %(key)s"
msgstr "Índice &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
+#: sphinx/themes/basic/genindex-single.html:46
+#: sphinx/themes/basic/genindex-split.html:24
+#: sphinx/themes/basic/genindex-split.html:38
+#: sphinx/themes/basic/genindex.html:56
msgid "Full index on one page"
msgstr "Índice completo en una página"
-#: sphinx/themes/basic/genindex-split.html:7
+#: sphinx/themes/basic/genindex-split.html:16
msgid "Index pages by letter"
msgstr "Índice alfabético"
-#: sphinx/themes/basic/genindex-split.html:15
+#: sphinx/themes/basic/genindex-split.html:25
msgid "can be huge"
msgstr "puede ser muy grande"
-#: sphinx/themes/basic/layout.html:10
+#: sphinx/themes/basic/layout.html:23
msgid "Navigation"
msgstr "Navegación"
-#: sphinx/themes/basic/layout.html:42
-msgid "Table Of Contents"
-msgstr "Contenidos"
-
-#: sphinx/themes/basic/layout.html:48
-msgid "Previous topic"
-msgstr "Tema anterior"
-
-#: sphinx/themes/basic/layout.html:50
-msgid "previous chapter"
-msgstr "Capítulo anterior"
-
-#: sphinx/themes/basic/layout.html:53
-msgid "Next topic"
-msgstr "Próximo tema"
-
-#: sphinx/themes/basic/layout.html:55
-msgid "next chapter"
-msgstr "Próximo capítulo"
-
-#: sphinx/themes/basic/layout.html:60
-msgid "This Page"
-msgstr "Esta página"
-
-#: sphinx/themes/basic/layout.html:63
-msgid "Show Source"
-msgstr "Enseñar el código"
-
-#: sphinx/themes/basic/layout.html:73
-msgid "Quick search"
-msgstr "Búsqueda rápida"
-
-#: sphinx/themes/basic/layout.html:76
-msgid "Go"
-msgstr "Ir a"
-
-#: sphinx/themes/basic/layout.html:81
-#, fuzzy
-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:113
#, python-format
msgid "Search within %(docstitle)s"
msgstr "Buscar en %(docstitle)s"
-#: sphinx/themes/basic/layout.html:128
+#: sphinx/themes/basic/layout.html:122
msgid "About these documents"
msgstr "Sobre este documento"
-#: sphinx/themes/basic/layout.html:134 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:131
msgid "Copyright"
msgstr "Copyright"
-#: sphinx/themes/basic/layout.html:183
+#: sphinx/themes/basic/layout.html:180
#, 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:182
#, python-format
msgid "&copy; Copyright %(copyright)s."
msgstr "&copy; Copyright %(copyright)s."
-#: sphinx/themes/basic/layout.html:188
+#: sphinx/themes/basic/layout.html:186
#, 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:189
#, python-format
msgid ""
"Created using <a href=\"http://sphinx.pocoo.org/\">Sphinx</a> "
@@ -478,22 +626,34 @@ msgstr ""
"Creado con <a href=\"http://sphinx.pocoo.org/\">Sphinx</a> "
"%(sphinx_version)s."
-#: sphinx/themes/basic/modindex.html:36
-msgid "Deprecated"
-msgstr "Obsoleto"
-
#: sphinx/themes/basic/opensearch.xml:4
#, python-format
msgid "Search %(docstitle)s"
msgstr "Buscar en %(docstitle)s"
-#: sphinx/themes/basic/search.html:9
+#: sphinx/themes/basic/relations.html:11
+msgid "Previous topic"
+msgstr "Tema anterior"
+
+#: sphinx/themes/basic/relations.html:13
+msgid "previous chapter"
+msgstr "Capítulo anterior"
+
+#: sphinx/themes/basic/relations.html:16
+msgid "Next topic"
+msgstr "Próximo tema"
+
+#: sphinx/themes/basic/relations.html:18
+msgid "next chapter"
+msgstr "Próximo capítulo"
+
+#: sphinx/themes/basic/search.html:18
msgid ""
"Please activate JavaScript to enable the search\n"
" functionality."
msgstr ""
-#: sphinx/themes/basic/search.html:14
+#: sphinx/themes/basic/search.html:23
#, fuzzy
msgid ""
"From here you can search these documents. Enter your search\n"
@@ -506,19 +666,27 @@ msgstr ""
" las palabras. Las páginas que contengan menos palabras no aparecerán en"
" la lista de resultados."
-#: sphinx/themes/basic/search.html:21
+#: sphinx/themes/basic/search.html:30
msgid "search"
msgstr "buscar"
-#: sphinx/themes/basic/search.html:25
-#: sphinx/themes/basic/static/searchtools.js:453
+#: sphinx/themes/basic/search.html:34
+#: sphinx/themes/basic/static/searchtools.js:489
msgid "Search Results"
msgstr "Resultados de la búsqueda"
-#: sphinx/themes/basic/search.html:27
+#: sphinx/themes/basic/search.html:36
msgid "Your search did not match any results."
msgstr "Tu consulta no obtuvo ningún resultado"
+#: sphinx/themes/basic/searchbox.html:12
+msgid "Quick search"
+msgstr "Búsqueda rápida"
+
+#: sphinx/themes/basic/sourcelink.html:11
+msgid "This Page"
+msgstr "Esta página"
+
#: sphinx/themes/basic/changes/frameset.html:5
#: sphinx/themes/basic/changes/versionchanges.html:12
#, python-format
@@ -547,38 +715,33 @@ msgstr "Cambios en la API C"
msgid "Other changes"
msgstr "Otros cambios"
-#: sphinx/themes/basic/static/doctools.js:139 sphinx/writers/html.py:473
-#: sphinx/writers/html.py:478
+#: sphinx/themes/basic/static/doctools.js:154 sphinx/writers/html.py:482
+#: sphinx/writers/html.py:487
msgid "Permalink to this headline"
msgstr "Enlazar permanentemente con este título"
-#: sphinx/themes/basic/static/doctools.js:145 sphinx/writers/html.py:80
+#: sphinx/themes/basic/static/doctools.js:160 sphinx/writers/html.py:87
msgid "Permalink to this definition"
msgstr "Enlazar permanentemente con esta definición"
-#: sphinx/themes/basic/static/doctools.js:174
+#: sphinx/themes/basic/static/doctools.js:189
#, fuzzy
msgid "Hide Search Matches"
msgstr "Coincidencias de la búsqueda"
-#: sphinx/themes/basic/static/searchtools.js:274
+#: sphinx/themes/basic/static/searchtools.js:285
msgid "Searching"
msgstr "Buscando"
-#: sphinx/themes/basic/static/searchtools.js:279
+#: sphinx/themes/basic/static/searchtools.js:290
msgid "Preparing search..."
msgstr "Preparando la búsqueda"
-#: sphinx/themes/basic/static/searchtools.js:338
-#, fuzzy
-msgid "module, in "
-msgstr "módulo"
-
-#: sphinx/themes/basic/static/searchtools.js:347
+#: sphinx/themes/basic/static/searchtools.js:364
msgid ", in "
msgstr ""
-#: sphinx/themes/basic/static/searchtools.js:455
+#: sphinx/themes/basic/static/searchtools.js:491
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,37 +750,44 @@ 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:493
#, 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/themes/default/static/sidebar.js:66
+msgid "Expand sidebar"
+msgstr ""
+
+#: sphinx/themes/default/static/sidebar.js:79
+#: sphinx/themes/default/static/sidebar.js:106
+msgid "Collapse sidebar"
+msgstr ""
+
+#: sphinx/themes/haiku/layout.html:26
+msgid "Contents"
+msgstr ""
+
+#: sphinx/writers/latex.py:171
#, fuzzy
msgid "Release"
msgstr "Versión"
-#: sphinx/writers/latex.py:571
+#: sphinx/writers/latex.py:572 sphinx/writers/manpage.py:178
msgid "Footnotes"
msgstr ""
-#: sphinx/writers/latex.py:639
+#: sphinx/writers/latex.py:641
msgid "continued from previous page"
msgstr ""
-#: sphinx/writers/latex.py:644
+#: sphinx/writers/latex.py:646
#, fuzzy
msgid "Continued on next page"
msgstr "Índice completo en una página"
-#: sphinx/writers/text.py:166
-#, python-format
-msgid "Platform: %s"
-msgstr "Plataforma: %s"
-
-#: sphinx/writers/text.py:428
+#: sphinx/writers/text.py:422
msgid "[image]"
msgstr "[imagen]"
-
diff --git a/sphinx/locale/fi/LC_MESSAGES/sphinx.js b/sphinx/locale/fi/LC_MESSAGES/sphinx.js
index 82f02c292..9d2cc6f47 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": {"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
+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 ": "", "Expand sidebar": "", "Permalink to this headline": "", "Searching": "Etsit\u00e4\u00e4n", "Collapse sidebar": "", "Permalink to this definition": "", "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 b5fdd7100..7c3000060 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 1cbd8e74f..04839bba6 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: 2010-05-24 23:54+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,227 +17,374 @@ 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:106 sphinx/writers/latex.py:184
+#: sphinx/writers/manpage.py:67
#, python-format
msgid "%B %d, %Y"
msgstr "%d.%m.%Y"
-#: 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
-msgid "Index"
-msgstr "Sisällysluettelo"
-
-#: sphinx/environment.py:325 sphinx/writers/latex.py:187
-msgid "Module Index"
-msgstr "Moduuli sisällysluettelo"
-
-#: sphinx/environment.py:326 sphinx/themes/basic/defindex.html:16
-msgid "Search Page"
-msgstr "Etsi sivu"
-
-#: sphinx/roles.py:55 sphinx/directives/desc.py:747
-#, python-format
-msgid "environment variable; %s"
-msgstr ""
-
-#: sphinx/roles.py:62
+#: sphinx/roles.py:174
#, python-format
msgid "Python Enhancement Proposals!PEP %s"
msgstr ""
-#: sphinx/builders/changes.py:71
+#: sphinx/builders/changes.py:72
msgid "Builtins"
msgstr ""
-#: sphinx/builders/changes.py:73
+#: sphinx/builders/changes.py:74
msgid "Module level"
msgstr "Moduulitaso"
-#: sphinx/builders/html.py:205
+#: sphinx/builders/html.py:266
#, 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:285 sphinx/themes/basic/defindex.html:30
msgid "General Index"
msgstr "Yleinen sisällysluettelo"
-#: sphinx/builders/html.py:224
+#: sphinx/builders/html.py:285
msgid "index"
msgstr "hakemisto"
-#: 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
-msgid "Global Module Index"
-msgstr "Yleinen moduulien sisällysluettelo"
-
-#: sphinx/builders/html.py:227
-msgid "modules"
-msgstr "moduulit"
-
-#: sphinx/builders/html.py:281
+#: sphinx/builders/html.py:345
msgid "next"
msgstr ">"
-#: sphinx/builders/html.py:290
+#: sphinx/builders/html.py:354
msgid "previous"
msgstr "<"
-#: sphinx/builders/latex.py:162
+#: sphinx/builders/latex.py:151
msgid " (in "
msgstr ""
-#: sphinx/directives/desc.py:97
-msgid "Raises"
+#: sphinx/directives/other.py:127
+msgid "Section author: "
+msgstr "Luvun kirjoittaja: "
+
+#: sphinx/directives/other.py:129
+msgid "Module author: "
+msgstr "Moduulin kirjoittaja: "
+
+#: sphinx/directives/other.py:131
+#, fuzzy
+msgid "Code author: "
+msgstr "Moduulin kirjoittaja: "
+
+#: sphinx/directives/other.py:133
+msgid "Author: "
+msgstr "Tekijä: "
+
+#: sphinx/directives/other.py:238
+msgid "See also"
+msgstr "Katso myös"
+
+#: sphinx/domains/__init__.py:253
+#, python-format
+msgid "%s %s"
msgstr ""
-#: sphinx/directives/desc.py:101
-msgid "Variable"
+#: sphinx/domains/c.py:51 sphinx/domains/python.py:49
+msgid "Parameters"
msgstr ""
-#: sphinx/directives/desc.py:104
+#: sphinx/domains/c.py:54 sphinx/domains/javascript.py:137
+#: sphinx/domains/python.py:59
msgid "Returns"
msgstr ""
-#: sphinx/directives/desc.py:113
+#: sphinx/domains/c.py:56 sphinx/domains/python.py:61
msgid "Return type"
msgstr ""
-#: sphinx/directives/desc.py:186
-msgid "Parameter"
+#: sphinx/domains/c.py:133
+#, python-format
+msgid "%s (C function)"
msgstr ""
-#: sphinx/directives/desc.py:190
-msgid "Parameters"
+#: sphinx/domains/c.py:135
+#, python-format
+msgid "%s (C member)"
msgstr ""
-#: sphinx/directives/desc.py:418
+#: sphinx/domains/c.py:137
#, python-format
-msgid "%s() (built-in function)"
+msgid "%s (C macro)"
msgstr ""
-#: sphinx/directives/desc.py:419 sphinx/directives/desc.py:476
-#: sphinx/directives/desc.py:488
+#: sphinx/domains/c.py:139
#, python-format
-msgid "%s() (in module %s)"
+msgid "%s (C type)"
msgstr ""
-#: sphinx/directives/desc.py:422
+#: sphinx/domains/c.py:141
#, python-format
-msgid "%s (built-in variable)"
+msgid "%s (C variable)"
msgstr ""
-#: sphinx/directives/desc.py:423 sphinx/directives/desc.py:514
+#: sphinx/domains/c.py:171 sphinx/domains/cpp.py:1031
+#: sphinx/domains/javascript.py:166 sphinx/domains/python.py:497
+#, fuzzy
+msgid "function"
+msgstr "Varoitus"
+
+#: sphinx/domains/c.py:172 sphinx/domains/cpp.py:1032
+msgid "member"
+msgstr ""
+
+#: sphinx/domains/c.py:173
+msgid "macro"
+msgstr ""
+
+#: sphinx/domains/c.py:174 sphinx/domains/cpp.py:1033
+msgid "type"
+msgstr ""
+
+#: sphinx/domains/c.py:175
+msgid "variable"
+msgstr ""
+
+#: sphinx/domains/cpp.py:876
#, python-format
-msgid "%s (in module %s)"
+msgid "%s (C++ class)"
msgstr ""
-#: sphinx/directives/desc.py:439
+#: sphinx/domains/cpp.py:891
#, python-format
-msgid "%s (built-in class)"
+msgid "%s (C++ type)"
msgstr ""
-#: sphinx/directives/desc.py:440
+#: sphinx/domains/cpp.py:910
#, python-format
-msgid "%s (class in %s)"
+msgid "%s (C++ member)"
msgstr ""
-#: sphinx/directives/desc.py:480
+#: sphinx/domains/cpp.py:962
#, python-format
-msgid "%s() (%s.%s method)"
+msgid "%s (C++ function)"
msgstr ""
-#: sphinx/directives/desc.py:482
+#: sphinx/domains/cpp.py:1030 sphinx/domains/python.py:499
+msgid "class"
+msgstr ""
+
+#: sphinx/domains/javascript.py:117 sphinx/domains/python.py:221
+#, python-format
+msgid "%s() (built-in function)"
+msgstr ""
+
+#: sphinx/domains/javascript.py:118 sphinx/domains/python.py:285
#, python-format
msgid "%s() (%s method)"
msgstr ""
-#: sphinx/directives/desc.py:492
+#: sphinx/domains/javascript.py:120
#, python-format
-msgid "%s() (%s.%s static method)"
+msgid "%s (global variable or constant)"
msgstr ""
-#: sphinx/directives/desc.py:495
+#: sphinx/domains/javascript.py:122 sphinx/domains/python.py:323
#, python-format
-msgid "%s() (%s static method)"
+msgid "%s (%s attribute)"
+msgstr ""
+
+#: sphinx/domains/javascript.py:131
+msgid "Arguments"
+msgstr ""
+
+#: sphinx/domains/javascript.py:134
+msgid "Throws"
+msgstr ""
+
+#: sphinx/domains/javascript.py:167 sphinx/domains/python.py:498
+msgid "data"
+msgstr ""
+
+#: sphinx/domains/javascript.py:168 sphinx/domains/python.py:504
+msgid "attribute"
msgstr ""
-#: sphinx/directives/desc.py:518
+#: sphinx/domains/python.py:53
+msgid "Variables"
+msgstr ""
+
+#: sphinx/domains/python.py:56
+msgid "Raises"
+msgstr ""
+
+#: sphinx/domains/python.py:222 sphinx/domains/python.py:279
+#: sphinx/domains/python.py:291 sphinx/domains/python.py:304
#, python-format
-msgid "%s (%s.%s attribute)"
+msgid "%s() (in module %s)"
msgstr ""
-#: sphinx/directives/desc.py:520
+#: sphinx/domains/python.py:225
#, python-format
-msgid "%s (%s attribute)"
+msgid "%s (built-in variable)"
msgstr ""
-#: sphinx/directives/desc.py:609
+#: sphinx/domains/python.py:226 sphinx/domains/python.py:317
#, python-format
-msgid "%s (C function)"
+msgid "%s (in module %s)"
msgstr ""
-#: sphinx/directives/desc.py:611
+#: sphinx/domains/python.py:242
#, python-format
-msgid "%s (C member)"
+msgid "%s (built-in class)"
msgstr ""
-#: sphinx/directives/desc.py:613
+#: sphinx/domains/python.py:243
#, python-format
-msgid "%s (C macro)"
+msgid "%s (class in %s)"
msgstr ""
-#: sphinx/directives/desc.py:615
+#: sphinx/domains/python.py:283
#, python-format
-msgid "%s (C type)"
+msgid "%s() (%s.%s method)"
msgstr ""
-#: sphinx/directives/desc.py:617
+#: sphinx/domains/python.py:295
#, python-format
-msgid "%s (C variable)"
+msgid "%s() (%s.%s static method)"
msgstr ""
-#: sphinx/directives/desc.py:665
+#: sphinx/domains/python.py:298
#, python-format
-msgid "%scommand line option; %s"
+msgid "%s() (%s static method)"
+msgstr ""
+
+#: sphinx/domains/python.py:308
+#, python-format
+msgid "%s() (%s.%s class method)"
+msgstr ""
+
+#: sphinx/domains/python.py:311
+#, python-format
+msgid "%s() (%s class method)"
+msgstr ""
+
+#: sphinx/domains/python.py:321
+#, python-format
+msgid "%s (%s.%s attribute)"
msgstr ""
-#: sphinx/directives/other.py:138
+#: sphinx/domains/python.py:366
msgid "Platforms: "
msgstr "Ympäristö"
-#: sphinx/directives/other.py:144
+#: sphinx/domains/python.py:372
#, python-format
msgid "%s (module)"
msgstr "%s (moduuli)"
-#: sphinx/directives/other.py:193
-msgid "Section author: "
-msgstr "Luvun kirjoittaja: "
+#: sphinx/domains/python.py:429
+#, fuzzy
+msgid "Python Module Index"
+msgstr "Moduuli sisällysluettelo"
-#: sphinx/directives/other.py:195
-msgid "Module author: "
-msgstr "Moduulin kirjoittaja: "
+#: sphinx/domains/python.py:430
+msgid "modules"
+msgstr "moduulit"
-#: sphinx/directives/other.py:197
-msgid "Author: "
-msgstr "Tekijä: "
+#: sphinx/domains/python.py:475
+msgid "Deprecated"
+msgstr "Poistettu"
-#: sphinx/directives/other.py:317
-msgid "See also"
-msgstr "Katso myös"
+#: sphinx/domains/python.py:500 sphinx/locale/__init__.py:162
+msgid "exception"
+msgstr ""
+
+#: sphinx/domains/python.py:501
+msgid "method"
+msgstr ""
+
+#: sphinx/domains/python.py:502
+msgid "class method"
+msgstr ""
+
+#: sphinx/domains/python.py:503
+msgid "static method"
+msgstr ""
+
+#: sphinx/domains/python.py:505 sphinx/locale/__init__.py:158
+msgid "module"
+msgstr "moduuli"
+
+#: sphinx/domains/rst.py:53
+#, python-format
+msgid "%s (directive)"
+msgstr ""
+
+#: sphinx/domains/rst.py:55
+#, fuzzy, python-format
+msgid "%s (role)"
+msgstr "%s (moduuli)"
-#: sphinx/ext/autodoc.py:883
+#: sphinx/domains/rst.py:103
+msgid "directive"
+msgstr ""
+
+#: sphinx/domains/rst.py:104
+#, fuzzy
+msgid "role"
+msgstr "moduuli"
+
+#: sphinx/domains/std.py:68 sphinx/domains/std.py:84
+#, python-format
+msgid "environment variable; %s"
+msgstr ""
+
+#: sphinx/domains/std.py:160
+#, python-format
+msgid "%scommand line option; %s"
+msgstr ""
+
+#: sphinx/domains/std.py:328
+msgid "glossary term"
+msgstr ""
+
+#: sphinx/domains/std.py:329
+msgid "grammar token"
+msgstr ""
+
+#: sphinx/domains/std.py:330
+msgid "reference label"
+msgstr ""
+
+#: sphinx/domains/std.py:331
+msgid "environment variable"
+msgstr ""
+
+#: sphinx/domains/std.py:332
+msgid "program option"
+msgstr ""
+
+#: sphinx/domains/std.py:360 sphinx/themes/basic/genindex-single.html:11
+#: sphinx/themes/basic/genindex-split.html:11
+#: sphinx/themes/basic/genindex-split.html:14
+#: sphinx/themes/basic/genindex.html:11 sphinx/themes/basic/genindex.html:14
+#: sphinx/themes/basic/genindex.html:50 sphinx/themes/basic/layout.html:125
+#: sphinx/writers/latex.py:173
+msgid "Index"
+msgstr "Sisällysluettelo"
+
+#: sphinx/domains/std.py:361
+msgid "Module Index"
+msgstr "Moduuli sisällysluettelo"
+
+#: sphinx/domains/std.py:362 sphinx/themes/basic/defindex.html:25
+msgid "Search Page"
+msgstr "Etsi sivu"
+
+#: sphinx/ext/autodoc.py:917
#, python-format
msgid " Bases: %s"
msgstr ""
-#: sphinx/ext/autodoc.py:916
+#: sphinx/ext/autodoc.py:950
#, python-format
msgid "alias of :class:`%s`"
msgstr ""
@@ -246,246 +393,257 @@ msgstr ""
msgid "Todo"
msgstr "Tehtävä vielä"
-#: sphinx/ext/todo.py:99
+#: sphinx/ext/todo.py:109
#, python-format
-msgid "(The original entry is located in %s, line %d and can be found "
+msgid "(The <<original entry>> is located in %s, line %d.)"
+msgstr ""
+
+#: sphinx/ext/todo.py:117
+msgid "original entry"
msgstr ""
-#: sphinx/ext/todo.py:105
-msgid "here"
-msgstr "tässä"
+#: sphinx/ext/viewcode.py:66
+msgid "[source]"
+msgstr ""
-#: sphinx/locale/__init__.py:15
+#: sphinx/ext/viewcode.py:109
+msgid "[docs]"
+msgstr ""
+
+#: sphinx/ext/viewcode.py:123
+#, fuzzy
+msgid "Module code"
+msgstr "moduuli"
+
+#: sphinx/ext/viewcode.py:129
+#, python-format
+msgid "<h1>Source code for %s</h1>"
+msgstr ""
+
+#: sphinx/ext/viewcode.py:156
+msgid "Overview: module code"
+msgstr ""
+
+#: sphinx/ext/viewcode.py:157
+msgid "<h1>All modules for which code is available</h1>"
+msgstr ""
+
+#: sphinx/locale/__init__.py:139
msgid "Attention"
msgstr "Huom"
-#: sphinx/locale/__init__.py:16
+#: sphinx/locale/__init__.py:140
msgid "Caution"
msgstr "Varoitus"
-#: sphinx/locale/__init__.py:17
+#: sphinx/locale/__init__.py:141
msgid "Danger"
msgstr "Vaara"
-#: sphinx/locale/__init__.py:18
+#: sphinx/locale/__init__.py:142
msgid "Error"
msgstr "Virhe"
-#: sphinx/locale/__init__.py:19
+#: sphinx/locale/__init__.py:143
msgid "Hint"
msgstr "Vihje"
-#: sphinx/locale/__init__.py:20
+#: sphinx/locale/__init__.py:144
msgid "Important"
msgstr "Tärkeä"
-#: sphinx/locale/__init__.py:21
+#: sphinx/locale/__init__.py:145
msgid "Note"
msgstr "Muista"
-#: sphinx/locale/__init__.py:22
+#: sphinx/locale/__init__.py:146
msgid "See Also"
msgstr "Katso myös"
-#: sphinx/locale/__init__.py:23
+#: sphinx/locale/__init__.py:147
msgid "Tip"
msgstr "Vihje"
-#: sphinx/locale/__init__.py:24
+#: sphinx/locale/__init__.py:148
msgid "Warning"
msgstr "Varoitus"
-#: sphinx/locale/__init__.py:28
+#: sphinx/locale/__init__.py:152
#, python-format
msgid "New in version %s"
msgstr "Uusi versiossa %s"
-#: sphinx/locale/__init__.py:29
+#: sphinx/locale/__init__.py:153
#, python-format
msgid "Changed in version %s"
msgstr "Muutettu versiossa %s"
-#: sphinx/locale/__init__.py:30
+#: sphinx/locale/__init__.py:154
#, python-format
msgid "Deprecated since version %s"
msgstr "Poistettu versiosta %s alkaen"
-#: sphinx/locale/__init__.py:34
-msgid "module"
-msgstr "moduuli"
-
-#: sphinx/locale/__init__.py:35
+#: sphinx/locale/__init__.py:159
msgid "keyword"
msgstr ""
-#: sphinx/locale/__init__.py:36
+#: sphinx/locale/__init__.py:160
msgid "operator"
msgstr ""
-#: sphinx/locale/__init__.py:37
+#: sphinx/locale/__init__.py:161
msgid "object"
msgstr ""
-#: sphinx/locale/__init__.py:38
-msgid "exception"
-msgstr ""
-
-#: sphinx/locale/__init__.py:39
+#: sphinx/locale/__init__.py:163
msgid "statement"
msgstr ""
-#: sphinx/locale/__init__.py:40
+#: sphinx/locale/__init__.py:164
msgid "built-in function"
msgstr ""
-#: sphinx/themes/basic/defindex.html:2
+#: sphinx/themes/agogo/layout.html:45 sphinx/themes/basic/globaltoc.html:10
+#: sphinx/themes/basic/localtoc.html:11
+msgid "Table Of Contents"
+msgstr "Sisällysluettelo"
+
+#: sphinx/themes/agogo/layout.html:49 sphinx/themes/basic/layout.html:128
+#: sphinx/themes/basic/search.html:11 sphinx/themes/basic/search.html:14
+msgid "Search"
+msgstr "Etsi"
+
+#: sphinx/themes/agogo/layout.html:52 sphinx/themes/basic/searchbox.html:15
+msgid "Go"
+msgstr "Siirry"
+
+#: sphinx/themes/agogo/layout.html:57 sphinx/themes/basic/searchbox.html:20
+msgid "Enter search terms or a module, class or function name."
+msgstr "Anna etsittävä termi tai moduuli, luokka tai funktio"
+
+#: sphinx/themes/agogo/layout.html:78 sphinx/themes/basic/sourcelink.html:14
+msgid "Show Source"
+msgstr "Näytä lähdekoodina"
+
+#: sphinx/themes/basic/defindex.html:11
msgid "Overview"
msgstr "Yhteenveto"
-#: sphinx/themes/basic/defindex.html:11
+#: sphinx/themes/basic/defindex.html:20
msgid "Indices and tables:"
msgstr ""
-#: sphinx/themes/basic/defindex.html:14
+#: sphinx/themes/basic/defindex.html:23
msgid "Complete Table of Contents"
msgstr ""
-#: sphinx/themes/basic/defindex.html:15
+#: sphinx/themes/basic/defindex.html:24
msgid "lists all sections and subsections"
msgstr ""
-#: sphinx/themes/basic/defindex.html:17
+#: sphinx/themes/basic/defindex.html:26
msgid "search this documentation"
msgstr ""
-#: sphinx/themes/basic/defindex.html:20
+#: sphinx/themes/basic/defindex.html:28
+msgid "Global Module Index"
+msgstr "Yleinen moduulien sisällysluettelo"
+
+#: sphinx/themes/basic/defindex.html:29
msgid "quick access to all modules"
msgstr ""
-#: sphinx/themes/basic/defindex.html:22
+#: sphinx/themes/basic/defindex.html:31
msgid "all functions, classes, terms"
msgstr ""
-#: sphinx/themes/basic/genindex-single.html:5
+#: sphinx/themes/basic/genindex-single.html:14
#, python-format
msgid "Index &ndash; %(key)s"
msgstr ""
-#: 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
+#: sphinx/themes/basic/genindex-single.html:46
+#: sphinx/themes/basic/genindex-split.html:24
+#: sphinx/themes/basic/genindex-split.html:38
+#: sphinx/themes/basic/genindex.html:56
msgid "Full index on one page"
msgstr "Hakemisto yhtenä luettelona"
-#: sphinx/themes/basic/genindex-split.html:7
+#: sphinx/themes/basic/genindex-split.html:16
msgid "Index pages by letter"
msgstr "Hakemisto aakkostus sivuttain"
-#: sphinx/themes/basic/genindex-split.html:15
+#: sphinx/themes/basic/genindex-split.html:25
msgid "can be huge"
msgstr "voi olla iso"
-#: sphinx/themes/basic/layout.html:10
+#: sphinx/themes/basic/layout.html:23
msgid "Navigation"
msgstr "Navikointi"
-#: sphinx/themes/basic/layout.html:42
-msgid "Table Of Contents"
-msgstr "Sisällysluettelo"
-
-#: 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 "Tämä sivu"
-
-#: sphinx/themes/basic/layout.html:63
-msgid "Show Source"
-msgstr "Näytä lähdekoodina"
-
-#: sphinx/themes/basic/layout.html:73
-msgid "Quick search"
-msgstr "Pikahaku"
-
-#: sphinx/themes/basic/layout.html:76
-msgid "Go"
-msgstr "Siirry"
-
-#: sphinx/themes/basic/layout.html:81
-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:113
#, python-format
msgid "Search within %(docstitle)s"
msgstr ""
-#: sphinx/themes/basic/layout.html:128
+#: sphinx/themes/basic/layout.html:122
msgid "About these documents"
msgstr "Tietoja tästä documentistä"
-#: sphinx/themes/basic/layout.html:134 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:131
msgid "Copyright"
msgstr ""
-#: sphinx/themes/basic/layout.html:183
+#: sphinx/themes/basic/layout.html:180
#, python-format
msgid "&copy; <a href=\"%(path)s\">Copyright</a> %(copyright)s."
msgstr ""
-#: sphinx/themes/basic/layout.html:185
+#: sphinx/themes/basic/layout.html:182
#, python-format
msgid "&copy; Copyright %(copyright)s."
msgstr ""
-#: sphinx/themes/basic/layout.html:188
+#: sphinx/themes/basic/layout.html:186
#, python-format
msgid "Last updated on %(last_updated)s."
msgstr ""
-#: sphinx/themes/basic/layout.html:191
+#: sphinx/themes/basic/layout.html:189
#, python-format
msgid ""
"Created using <a href=\"http://sphinx.pocoo.org/\">Sphinx</a> "
"%(sphinx_version)s."
msgstr ""
-#: sphinx/themes/basic/modindex.html:36
-msgid "Deprecated"
-msgstr "Poistettu"
-
#: sphinx/themes/basic/opensearch.xml:4
#, python-format
msgid "Search %(docstitle)s"
msgstr ""
-#: sphinx/themes/basic/search.html:9
+#: sphinx/themes/basic/relations.html:11
+msgid "Previous topic"
+msgstr "<<"
+
+#: sphinx/themes/basic/relations.html:13
+msgid "previous chapter"
+msgstr "<<"
+
+#: sphinx/themes/basic/relations.html:16
+msgid "Next topic"
+msgstr ">>"
+
+#: sphinx/themes/basic/relations.html:18
+msgid "next chapter"
+msgstr ">>"
+
+#: sphinx/themes/basic/search.html:18
msgid ""
"Please activate JavaScript to enable the search\n"
" functionality."
msgstr "Javascript pitää olla sallittu, jotta etsintä toimii."
-#: sphinx/themes/basic/search.html:14
+#: sphinx/themes/basic/search.html:23
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"
@@ -493,19 +651,27 @@ msgid ""
" containing fewer words won't appear in the result list."
msgstr "Anna hakusanat kokonaan, osasanoilla ei haeta."
-#: sphinx/themes/basic/search.html:21
+#: sphinx/themes/basic/search.html:30
msgid "search"
msgstr "etsi"
-#: sphinx/themes/basic/search.html:25
-#: sphinx/themes/basic/static/searchtools.js:453
+#: sphinx/themes/basic/search.html:34
+#: sphinx/themes/basic/static/searchtools.js:489
msgid "Search Results"
msgstr "Etsinnän tulos"
-#: sphinx/themes/basic/search.html:27
+#: sphinx/themes/basic/search.html:36
msgid "Your search did not match any results."
msgstr "Ei löytynyt ko. ehdoilla yhtään."
+#: sphinx/themes/basic/searchbox.html:12
+msgid "Quick search"
+msgstr "Pikahaku"
+
+#: sphinx/themes/basic/sourcelink.html:11
+msgid "This Page"
+msgstr "Tämä sivu"
+
#: sphinx/themes/basic/changes/frameset.html:5
#: sphinx/themes/basic/changes/versionchanges.html:12
#, python-format
@@ -534,69 +700,73 @@ msgstr ""
msgid "Other changes"
msgstr ""
-#: sphinx/themes/basic/static/doctools.js:139 sphinx/writers/html.py:473
-#: sphinx/writers/html.py:478
+#: sphinx/themes/basic/static/doctools.js:154 sphinx/writers/html.py:482
+#: sphinx/writers/html.py:487
msgid "Permalink to this headline"
msgstr ""
-#: sphinx/themes/basic/static/doctools.js:145 sphinx/writers/html.py:80
+#: sphinx/themes/basic/static/doctools.js:160 sphinx/writers/html.py:87
msgid "Permalink to this definition"
msgstr ""
-#: sphinx/themes/basic/static/doctools.js:174
+#: sphinx/themes/basic/static/doctools.js:189
msgid "Hide Search Matches"
msgstr "Piilota löydetyt"
-#: sphinx/themes/basic/static/searchtools.js:274
+#: sphinx/themes/basic/static/searchtools.js:285
msgid "Searching"
msgstr "Etsitään"
-#: sphinx/themes/basic/static/searchtools.js:279
+#: sphinx/themes/basic/static/searchtools.js:290
msgid "Preparing search..."
msgstr "Valmistellaan etsintää..."
-#: sphinx/themes/basic/static/searchtools.js:338
-msgid "module, in "
-msgstr ""
-
-#: sphinx/themes/basic/static/searchtools.js:347
+#: sphinx/themes/basic/static/searchtools.js:364
msgid ", in "
msgstr ""
-#: sphinx/themes/basic/static/searchtools.js:455
+#: sphinx/themes/basic/static/searchtools.js:491
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:493
#, 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/themes/default/static/sidebar.js:66
+msgid "Expand sidebar"
+msgstr ""
+
+#: sphinx/themes/default/static/sidebar.js:79
+#: sphinx/themes/default/static/sidebar.js:106
+msgid "Collapse sidebar"
+msgstr ""
+
+#: sphinx/themes/haiku/layout.html:26
+msgid "Contents"
+msgstr ""
+
+#: sphinx/writers/latex.py:171
msgid "Release"
msgstr ""
-#: sphinx/writers/latex.py:571
+#: sphinx/writers/latex.py:572 sphinx/writers/manpage.py:178
msgid "Footnotes"
msgstr ""
-#: sphinx/writers/latex.py:639
+#: sphinx/writers/latex.py:641
msgid "continued from previous page"
msgstr ""
-#: sphinx/writers/latex.py:644
+#: sphinx/writers/latex.py:646
#, fuzzy
msgid "Continued on next page"
msgstr ""
-#: sphinx/writers/text.py:166
-#, python-format
-msgid "Platform: %s"
-msgstr "Ympäristö: %s"
-
-#: sphinx/writers/text.py:428
+#: sphinx/writers/text.py:422
msgid "[image]"
msgstr ""
diff --git a/sphinx/locale/fr/LC_MESSAGES/sphinx.js b/sphinx/locale/fr/LC_MESSAGES/sphinx.js
index 430ad87bd..d50b9fd79 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": {"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
+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", "Expand sidebar": "", "Permalink to this headline": "Lien permanent vers ce titre", "Searching": "En cours de recherche", "Collapse sidebar": "", "Permalink to this definition": "Lien permanent vers cette d\u00e9finition", "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 0e420dfb6..43199405a 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 a8960ada1..a378f3b06 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: 2010-05-24 23:54+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,228 +18,377 @@ 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:106 sphinx/writers/latex.py:184
+#: sphinx/writers/manpage.py:67
#, python-format
msgid "%B %d, %Y"
msgstr "%d %B %Y"
-#: 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
-msgid "Index"
-msgstr "Index"
-
-#: sphinx/environment.py:325 sphinx/writers/latex.py:187
-msgid "Module Index"
-msgstr "Index du module"
-
-#: sphinx/environment.py:326 sphinx/themes/basic/defindex.html:16
-msgid "Search Page"
-msgstr "Page de recherche"
-
-#: sphinx/roles.py:55 sphinx/directives/desc.py:747
-#, python-format
-msgid "environment variable; %s"
-msgstr "variable d'environnement; %s"
-
-#: sphinx/roles.py:62
+#: sphinx/roles.py:174
#, python-format
msgid "Python Enhancement Proposals!PEP %s"
msgstr "Python Enhancement Proposals!PEP %s"
-#: sphinx/builders/changes.py:71
+#: sphinx/builders/changes.py:72
msgid "Builtins"
msgstr "Fonctions de base"
-#: sphinx/builders/changes.py:73
+#: sphinx/builders/changes.py:74
msgid "Module level"
msgstr "Module"
-#: sphinx/builders/html.py:205
+#: sphinx/builders/html.py:266
#, 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:285 sphinx/themes/basic/defindex.html:30
msgid "General Index"
msgstr "Index général"
-#: sphinx/builders/html.py:224
+#: sphinx/builders/html.py:285
msgid "index"
msgstr "index"
-#: 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
-msgid "Global Module Index"
-msgstr "Index général des modules"
-
-#: sphinx/builders/html.py:227
-msgid "modules"
-msgstr "modules"
-
-#: sphinx/builders/html.py:281
+#: sphinx/builders/html.py:345
msgid "next"
msgstr "suivant"
-#: sphinx/builders/html.py:290
+#: sphinx/builders/html.py:354
msgid "previous"
msgstr "précédent"
-#: sphinx/builders/latex.py:162
+#: sphinx/builders/latex.py:151
msgid " (in "
msgstr "(dans"
-#: sphinx/directives/desc.py:97
-msgid "Raises"
-msgstr "Lève"
+#: sphinx/directives/other.py:127
+msgid "Section author: "
+msgstr "Auteur de la section : "
-#: sphinx/directives/desc.py:101
-msgid "Variable"
-msgstr "Variable"
+#: sphinx/directives/other.py:129
+msgid "Module author: "
+msgstr "Auteur du module : "
+
+#: sphinx/directives/other.py:131
+#, fuzzy
+msgid "Code author: "
+msgstr "Auteur du module : "
+
+#: sphinx/directives/other.py:133
+msgid "Author: "
+msgstr "Auteur : "
+
+#: sphinx/directives/other.py:238
+msgid "See also"
+msgstr "Voir aussi"
+
+#: sphinx/domains/__init__.py:253
+#, python-format
+msgid "%s %s"
+msgstr ""
-#: sphinx/directives/desc.py:104
+#: sphinx/domains/c.py:51 sphinx/domains/python.py:49
+msgid "Parameters"
+msgstr "Paramètres"
+
+#: sphinx/domains/c.py:54 sphinx/domains/javascript.py:137
+#: sphinx/domains/python.py:59
msgid "Returns"
msgstr "Retourne"
-#: sphinx/directives/desc.py:113
+#: sphinx/domains/c.py:56 sphinx/domains/python.py:61
msgid "Return type"
msgstr "Type retourné"
-#: sphinx/directives/desc.py:186
+#: sphinx/domains/c.py:133
+#, python-format
+msgid "%s (C function)"
+msgstr "%s (fonction C)"
+
+#: sphinx/domains/c.py:135
+#, python-format
+msgid "%s (C member)"
+msgstr "%s (membre C)"
+
+#: sphinx/domains/c.py:137
+#, python-format
+msgid "%s (C macro)"
+msgstr "%s (macro C)"
+
+#: sphinx/domains/c.py:139
+#, python-format
+msgid "%s (C type)"
+msgstr "%s (type C)"
+
+#: sphinx/domains/c.py:141
+#, python-format
+msgid "%s (C variable)"
+msgstr "%s (variable C)"
+
+#: sphinx/domains/c.py:171 sphinx/domains/cpp.py:1031
+#: sphinx/domains/javascript.py:166 sphinx/domains/python.py:497
+msgid "function"
+msgstr "fonction"
+
+#: sphinx/domains/c.py:172 sphinx/domains/cpp.py:1032
+msgid "member"
+msgstr "membre"
+
+#: sphinx/domains/c.py:173
+msgid "macro"
+msgstr ""
+
+#: sphinx/domains/c.py:174 sphinx/domains/cpp.py:1033
+msgid "type"
+msgstr "type"
+
+#: sphinx/domains/c.py:175
#, fuzzy
-msgid "Parameter"
-msgstr "Paramètres"
+msgid "variable"
+msgstr "Variable"
-#: sphinx/directives/desc.py:190
-msgid "Parameters"
-msgstr "Paramètres"
+#: sphinx/domains/cpp.py:876
+#, python-format
+msgid "%s (C++ class)"
+msgstr "%s (classe C++)"
+
+#: sphinx/domains/cpp.py:891
+#, python-format
+msgid "%s (C++ type)"
+msgstr "%s (type C++)"
+
+#: sphinx/domains/cpp.py:910
+#, python-format
+msgid "%s (C++ member)"
+msgstr "%s (membre C++)"
-#: sphinx/directives/desc.py:418
+#: sphinx/domains/cpp.py:962
+#, python-format
+msgid "%s (C++ function)"
+msgstr "%s (fonction C++)"
+
+#: sphinx/domains/cpp.py:1030 sphinx/domains/python.py:499
+msgid "class"
+msgstr "classe"
+
+#: sphinx/domains/javascript.py:117 sphinx/domains/python.py:221
#, python-format
msgid "%s() (built-in function)"
msgstr "%s() (fonction de base)"
-#: sphinx/directives/desc.py:419 sphinx/directives/desc.py:476
-#: sphinx/directives/desc.py:488
+#: sphinx/domains/javascript.py:118 sphinx/domains/python.py:285
+#, python-format
+msgid "%s() (%s method)"
+msgstr "%s() (méthode %s)"
+
+#: sphinx/domains/javascript.py:120
+#, python-format
+msgid "%s (global variable or constant)"
+msgstr ""
+
+#: sphinx/domains/javascript.py:122 sphinx/domains/python.py:323
+#, python-format
+msgid "%s (%s attribute)"
+msgstr "%s (attribut %s)"
+
+#: sphinx/domains/javascript.py:131
+#, fuzzy
+msgid "Arguments"
+msgstr "Paramètres"
+
+#: sphinx/domains/javascript.py:134
+msgid "Throws"
+msgstr ""
+
+#: sphinx/domains/javascript.py:167 sphinx/domains/python.py:498
+msgid "data"
+msgstr ""
+
+#: sphinx/domains/javascript.py:168 sphinx/domains/python.py:504
+msgid "attribute"
+msgstr "attribut"
+
+#: sphinx/domains/python.py:53
+#, fuzzy
+msgid "Variables"
+msgstr "Variable"
+
+#: sphinx/domains/python.py:56
+msgid "Raises"
+msgstr "Lève"
+
+#: sphinx/domains/python.py:222 sphinx/domains/python.py:279
+#: sphinx/domains/python.py:291 sphinx/domains/python.py:304
#, python-format
msgid "%s() (in module %s)"
msgstr "%s() (dans le module %s)"
-#: sphinx/directives/desc.py:422
+#: sphinx/domains/python.py:225
#, python-format
msgid "%s (built-in variable)"
msgstr "%s (variable de base)"
-#: sphinx/directives/desc.py:423 sphinx/directives/desc.py:514
+#: sphinx/domains/python.py:226 sphinx/domains/python.py:317
#, python-format
msgid "%s (in module %s)"
msgstr "%s (dans le module %s)"
-#: sphinx/directives/desc.py:439
+#: sphinx/domains/python.py:242
#, python-format
msgid "%s (built-in class)"
msgstr "%s (classe de base)"
-#: sphinx/directives/desc.py:440
+#: sphinx/domains/python.py:243
#, python-format
msgid "%s (class in %s)"
msgstr "%s (classe dans %s)"
-#: sphinx/directives/desc.py:480
+#: sphinx/domains/python.py:283
#, python-format
msgid "%s() (%s.%s method)"
msgstr "%s() (méthode %s.%s)"
-#: sphinx/directives/desc.py:482
-#, python-format
-msgid "%s() (%s method)"
-msgstr "%s() (méthode %s)"
-
-#: sphinx/directives/desc.py:492
+#: sphinx/domains/python.py:295
#, python-format
msgid "%s() (%s.%s static method)"
msgstr "%s() (méthode statique %s.%s)"
-#: sphinx/directives/desc.py:495
+#: sphinx/domains/python.py:298
#, python-format
msgid "%s() (%s static method)"
msgstr "%s() (méthode statique %s)"
-#: sphinx/directives/desc.py:518
+#: sphinx/domains/python.py:308
+#, fuzzy, python-format
+msgid "%s() (%s.%s class method)"
+msgstr "%s() (méthode %s.%s)"
+
+#: sphinx/domains/python.py:311
+#, fuzzy, python-format
+msgid "%s() (%s class method)"
+msgstr "%s() (méthode %s)"
+
+#: sphinx/domains/python.py:321
#, python-format
msgid "%s (%s.%s attribute)"
msgstr "%s (attribut %s.%s)"
-#: sphinx/directives/desc.py:520
-#, python-format
-msgid "%s (%s attribute)"
-msgstr "%s (attribut %s)"
+#: sphinx/domains/python.py:366
+msgid "Platforms: "
+msgstr "Plateformes : "
-#: sphinx/directives/desc.py:609
+#: sphinx/domains/python.py:372
#, python-format
-msgid "%s (C function)"
-msgstr "%s (fonction C)"
+msgid "%s (module)"
+msgstr "%s (module)"
-#: sphinx/directives/desc.py:611
-#, python-format
-msgid "%s (C member)"
-msgstr "%s (membre C)"
+#: sphinx/domains/python.py:429
+#, fuzzy
+msgid "Python Module Index"
+msgstr "Index du module"
-#: sphinx/directives/desc.py:613
-#, python-format
-msgid "%s (C macro)"
-msgstr "%s (macro C)"
+#: sphinx/domains/python.py:430
+msgid "modules"
+msgstr "modules"
-#: sphinx/directives/desc.py:615
+#: sphinx/domains/python.py:475
+msgid "Deprecated"
+msgstr "Obsolète"
+
+#: sphinx/domains/python.py:500 sphinx/locale/__init__.py:162
+msgid "exception"
+msgstr "exception"
+
+#: sphinx/domains/python.py:501
+msgid "method"
+msgstr ""
+
+#: sphinx/domains/python.py:502
+#, fuzzy, python-format
+msgid "class method"
+msgstr "%s() (méthode %s)"
+
+#: sphinx/domains/python.py:503
+msgid "static method"
+msgstr "méthode statique"
+
+#: sphinx/domains/python.py:505 sphinx/locale/__init__.py:158
+msgid "module"
+msgstr "module"
+
+#: sphinx/domains/rst.py:53
#, python-format
-msgid "%s (C type)"
-msgstr "%s (type C)"
+msgid "%s (directive)"
+msgstr ""
+
+#: sphinx/domains/rst.py:55
+#, fuzzy, python-format
+msgid "%s (role)"
+msgstr "%s (module)"
+
+#: sphinx/domains/rst.py:103
+msgid "directive"
+msgstr ""
+
+#: sphinx/domains/rst.py:104
+#, fuzzy
+msgid "role"
+msgstr "module"
-#: sphinx/directives/desc.py:617
+#: sphinx/domains/std.py:68 sphinx/domains/std.py:84
#, python-format
-msgid "%s (C variable)"
-msgstr "%s (variable C)"
+msgid "environment variable; %s"
+msgstr "variable d'environnement; %s"
-#: sphinx/directives/desc.py:665
+#: sphinx/domains/std.py:160
#, python-format
msgid "%scommand line option; %s"
msgstr "%soption de ligne de commande; %s"
-#: sphinx/directives/other.py:138
-msgid "Platforms: "
-msgstr "Plateformes : "
+#: sphinx/domains/std.py:328
+msgid "glossary term"
+msgstr ""
-#: sphinx/directives/other.py:144
-#, python-format
-msgid "%s (module)"
-msgstr "%s (module)"
+#: sphinx/domains/std.py:329
+msgid "grammar token"
+msgstr ""
-#: sphinx/directives/other.py:193
-msgid "Section author: "
-msgstr "Auteur de la section : "
+#: sphinx/domains/std.py:330
+msgid "reference label"
+msgstr ""
-#: sphinx/directives/other.py:195
-msgid "Module author: "
-msgstr "Auteur du module : "
+#: sphinx/domains/std.py:331
+msgid "environment variable"
+msgstr "variable d'environnement"
-#: sphinx/directives/other.py:197
-msgid "Author: "
-msgstr "Auteur : "
+#: sphinx/domains/std.py:332
+msgid "program option"
+msgstr ""
-#: sphinx/directives/other.py:317
-msgid "See also"
-msgstr "Voir aussi"
+#: sphinx/domains/std.py:360 sphinx/themes/basic/genindex-single.html:11
+#: sphinx/themes/basic/genindex-split.html:11
+#: sphinx/themes/basic/genindex-split.html:14
+#: sphinx/themes/basic/genindex.html:11 sphinx/themes/basic/genindex.html:14
+#: sphinx/themes/basic/genindex.html:50 sphinx/themes/basic/layout.html:125
+#: sphinx/writers/latex.py:173
+msgid "Index"
+msgstr "Index"
+
+#: sphinx/domains/std.py:361
+msgid "Module Index"
+msgstr "Index du module"
-#: sphinx/ext/autodoc.py:883
+#: sphinx/domains/std.py:362 sphinx/themes/basic/defindex.html:25
+msgid "Search Page"
+msgstr "Page de recherche"
+
+#: sphinx/ext/autodoc.py:917
#, python-format
msgid " Bases: %s"
msgstr ""
-#: sphinx/ext/autodoc.py:916
+#: sphinx/ext/autodoc.py:950
#, python-format
msgid "alias of :class:`%s`"
msgstr ""
@@ -248,225 +397,224 @@ msgstr ""
msgid "Todo"
msgstr "A faire"
-#: sphinx/ext/todo.py:99
+#: sphinx/ext/todo.py:109
+#, python-format
+msgid "(The <<original entry>> is located in %s, line %d.)"
+msgstr "(L'<<entrée orginale>> se trouve dans %s, à la ligne %d.)"
+
+#: sphinx/ext/todo.py:117
+msgid "original entry"
+msgstr "entrée orginale"
+
+#: sphinx/ext/viewcode.py:66
+msgid "[source]"
+msgstr ""
+
+#: sphinx/ext/viewcode.py:109
+msgid "[docs]"
+msgstr ""
+
+#: sphinx/ext/viewcode.py:123
+#, fuzzy
+msgid "Module code"
+msgstr "module"
+
+#: sphinx/ext/viewcode.py:129
#, python-format
-msgid "(The original entry is located in %s, line %d and can be found "
-msgstr "(L'entrée orginale se trouve dans %s, à la ligne %d et peut être trouvé"
+msgid "<h1>Source code for %s</h1>"
+msgstr ""
-#: sphinx/ext/todo.py:105
-msgid "here"
-msgstr "ici"
+#: sphinx/ext/viewcode.py:156
+msgid "Overview: module code"
+msgstr ""
+
+#: sphinx/ext/viewcode.py:157
+msgid "<h1>All modules for which code is available</h1>"
+msgstr ""
-#: sphinx/locale/__init__.py:15
+#: sphinx/locale/__init__.py:139
msgid "Attention"
msgstr "Attention"
-#: sphinx/locale/__init__.py:16
+#: sphinx/locale/__init__.py:140
msgid "Caution"
msgstr "Prudence"
-#: sphinx/locale/__init__.py:17
+#: sphinx/locale/__init__.py:141
msgid "Danger"
msgstr "Danger"
-#: sphinx/locale/__init__.py:18
+#: sphinx/locale/__init__.py:142
msgid "Error"
msgstr "Erreur"
-#: sphinx/locale/__init__.py:19
+#: sphinx/locale/__init__.py:143
msgid "Hint"
msgstr "Indice"
-#: sphinx/locale/__init__.py:20
+#: sphinx/locale/__init__.py:144
msgid "Important"
msgstr "Important"
-#: sphinx/locale/__init__.py:21
+#: sphinx/locale/__init__.py:145
msgid "Note"
msgstr "Note"
-#: sphinx/locale/__init__.py:22
+#: sphinx/locale/__init__.py:146
msgid "See Also"
msgstr "Voir aussi"
-#: sphinx/locale/__init__.py:23
+#: sphinx/locale/__init__.py:147
msgid "Tip"
msgstr "Astuce"
-#: sphinx/locale/__init__.py:24
+#: sphinx/locale/__init__.py:148
msgid "Warning"
msgstr "Warning"
-#: sphinx/locale/__init__.py:28
+#: sphinx/locale/__init__.py:152
#, python-format
msgid "New in version %s"
msgstr "Introduit dans la version %s"
-#: sphinx/locale/__init__.py:29
+#: sphinx/locale/__init__.py:153
#, python-format
msgid "Changed in version %s"
msgstr "Modifié dans la version %s"
-#: sphinx/locale/__init__.py:30
+#: sphinx/locale/__init__.py:154
#, python-format
msgid "Deprecated since version %s"
msgstr "Obsolète depuis la version %s"
-#: sphinx/locale/__init__.py:34
-msgid "module"
-msgstr "module"
-
-#: sphinx/locale/__init__.py:35
+#: sphinx/locale/__init__.py:159
msgid "keyword"
msgstr "mot-clé"
-#: sphinx/locale/__init__.py:36
+#: sphinx/locale/__init__.py:160
msgid "operator"
msgstr "opérateur"
-#: sphinx/locale/__init__.py:37
+#: sphinx/locale/__init__.py:161
msgid "object"
msgstr "objet"
-#: sphinx/locale/__init__.py:38
-msgid "exception"
-msgstr "exception"
-
-#: sphinx/locale/__init__.py:39
+#: sphinx/locale/__init__.py:163
msgid "statement"
msgstr "état"
-#: sphinx/locale/__init__.py:40
+#: sphinx/locale/__init__.py:164
msgid "built-in function"
msgstr "fonction de base"
-#: sphinx/themes/basic/defindex.html:2
+#: sphinx/themes/agogo/layout.html:45 sphinx/themes/basic/globaltoc.html:10
+#: sphinx/themes/basic/localtoc.html:11
+msgid "Table Of Contents"
+msgstr "Table des matières"
+
+#: sphinx/themes/agogo/layout.html:49 sphinx/themes/basic/layout.html:128
+#: sphinx/themes/basic/search.html:11 sphinx/themes/basic/search.html:14
+msgid "Search"
+msgstr "Recherche"
+
+#: sphinx/themes/agogo/layout.html:52 sphinx/themes/basic/searchbox.html:15
+msgid "Go"
+msgstr "Go"
+
+#: sphinx/themes/agogo/layout.html:57 sphinx/themes/basic/searchbox.html:20
+#, fuzzy
+msgid "Enter search terms or a module, class or function name."
+msgstr "Saisissez un nom de module, classe ou fonction."
+
+#: sphinx/themes/agogo/layout.html:78 sphinx/themes/basic/sourcelink.html:14
+msgid "Show Source"
+msgstr "Montrer la source"
+
+#: sphinx/themes/basic/defindex.html:11
msgid "Overview"
msgstr "Résumé"
-#: sphinx/themes/basic/defindex.html:11
+#: sphinx/themes/basic/defindex.html:20
msgid "Indices and tables:"
msgstr "Indices et tables :"
-#: sphinx/themes/basic/defindex.html:14
+#: sphinx/themes/basic/defindex.html:23
msgid "Complete Table of Contents"
msgstr "Table des matières complète"
-#: sphinx/themes/basic/defindex.html:15
+#: sphinx/themes/basic/defindex.html:24
msgid "lists all sections and subsections"
msgstr "lister l'ensemble des sections et sous-sections"
-#: sphinx/themes/basic/defindex.html:17
+#: sphinx/themes/basic/defindex.html:26
msgid "search this documentation"
msgstr "rechercher dans cette documentation"
-#: sphinx/themes/basic/defindex.html:20
+#: sphinx/themes/basic/defindex.html:28
+msgid "Global Module Index"
+msgstr "Index général des modules"
+
+#: sphinx/themes/basic/defindex.html:29
msgid "quick access to all modules"
msgstr "accès rapide à l'ensemble des modules"
-#: sphinx/themes/basic/defindex.html:22
+#: sphinx/themes/basic/defindex.html:31
msgid "all functions, classes, terms"
msgstr "toutes les fonctions, classes, termes"
-#: sphinx/themes/basic/genindex-single.html:5
+#: sphinx/themes/basic/genindex-single.html:14
#, python-format
msgid "Index &ndash; %(key)s"
msgstr "Index &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
+#: sphinx/themes/basic/genindex-single.html:46
+#: sphinx/themes/basic/genindex-split.html:24
+#: sphinx/themes/basic/genindex-split.html:38
+#: sphinx/themes/basic/genindex.html:56
msgid "Full index on one page"
msgstr "Index complet sur une seule page"
-#: sphinx/themes/basic/genindex-split.html:7
+#: sphinx/themes/basic/genindex-split.html:16
msgid "Index pages by letter"
msgstr "Indexer les pages par lettre"
-#: sphinx/themes/basic/genindex-split.html:15
+#: sphinx/themes/basic/genindex-split.html:25
msgid "can be huge"
msgstr "peut être énorme"
-#: sphinx/themes/basic/layout.html:10
+#: sphinx/themes/basic/layout.html:23
msgid "Navigation"
msgstr "Navigation"
-#: sphinx/themes/basic/layout.html:42
-msgid "Table Of Contents"
-msgstr "Table des matières"
-
-#: sphinx/themes/basic/layout.html:48
-msgid "Previous topic"
-msgstr "Sujet précédent"
-
-#: sphinx/themes/basic/layout.html:50
-msgid "previous chapter"
-msgstr "Chapitre précédent"
-
-#: sphinx/themes/basic/layout.html:53
-msgid "Next topic"
-msgstr "Sujet suivant"
-
-#: sphinx/themes/basic/layout.html:55
-msgid "next chapter"
-msgstr "Chapitre suivant"
-
-#: sphinx/themes/basic/layout.html:60
-msgid "This Page"
-msgstr "Cette page"
-
-#: sphinx/themes/basic/layout.html:63
-msgid "Show Source"
-msgstr "Montrer la source"
-
-#: sphinx/themes/basic/layout.html:73
-msgid "Quick search"
-msgstr "Recherche rapide"
-
-#: sphinx/themes/basic/layout.html:76
-msgid "Go"
-msgstr "Go"
-
-#: sphinx/themes/basic/layout.html:81
-#, fuzzy
-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:113
#, python-format
msgid "Search within %(docstitle)s"
msgstr "Recherchez dans %(docstitle)s"
-#: sphinx/themes/basic/layout.html:128
+#: sphinx/themes/basic/layout.html:122
msgid "About these documents"
msgstr "À propos de ces documents"
-#: sphinx/themes/basic/layout.html:134 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:131
msgid "Copyright"
msgstr "Copyright"
-#: sphinx/themes/basic/layout.html:183
+#: sphinx/themes/basic/layout.html:180
#, 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:182
#, python-format
msgid "&copy; Copyright %(copyright)s."
msgstr "&copy; Copyright %(copyright)s."
-#: sphinx/themes/basic/layout.html:188
+#: sphinx/themes/basic/layout.html:186
#, 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:189
#, python-format
msgid ""
"Created using <a href=\"http://sphinx.pocoo.org/\">Sphinx</a> "
@@ -475,22 +623,34 @@ msgstr ""
"Créé avec <a href=\"http://sphinx.pocoo.org/\">Sphinx</a> "
"%(sphinx_version)s."
-#: sphinx/themes/basic/modindex.html:36
-msgid "Deprecated"
-msgstr "Obsolète"
-
#: sphinx/themes/basic/opensearch.xml:4
#, python-format
msgid "Search %(docstitle)s"
msgstr "Rechercher %(docstitle)s"
-#: sphinx/themes/basic/search.html:9
+#: sphinx/themes/basic/relations.html:11
+msgid "Previous topic"
+msgstr "Sujet précédent"
+
+#: sphinx/themes/basic/relations.html:13
+msgid "previous chapter"
+msgstr "Chapitre précédent"
+
+#: sphinx/themes/basic/relations.html:16
+msgid "Next topic"
+msgstr "Sujet suivant"
+
+#: sphinx/themes/basic/relations.html:18
+msgid "next chapter"
+msgstr "Chapitre suivant"
+
+#: sphinx/themes/basic/search.html:18
msgid ""
"Please activate JavaScript to enable the search\n"
" functionality."
msgstr ""
-#: sphinx/themes/basic/search.html:14
+#: sphinx/themes/basic/search.html:23
#, fuzzy
msgid ""
"From here you can search these documents. Enter your search\n"
@@ -506,19 +666,27 @@ msgstr ""
" contenant moins de mots n'apparaîtront pas dans la liste des "
"résultats."
-#: sphinx/themes/basic/search.html:21
+#: sphinx/themes/basic/search.html:30
msgid "search"
msgstr "rechercher"
-#: sphinx/themes/basic/search.html:25
-#: sphinx/themes/basic/static/searchtools.js:453
+#: sphinx/themes/basic/search.html:34
+#: sphinx/themes/basic/static/searchtools.js:489
msgid "Search Results"
msgstr "Résultats de la recherche"
-#: sphinx/themes/basic/search.html:27
+#: sphinx/themes/basic/search.html:36
msgid "Your search did not match any results."
msgstr "Votre recherche n'a retourné aucun résultat"
+#: sphinx/themes/basic/searchbox.html:12
+msgid "Quick search"
+msgstr "Recherche rapide"
+
+#: sphinx/themes/basic/sourcelink.html:11
+msgid "This Page"
+msgstr "Cette page"
+
#: sphinx/themes/basic/changes/frameset.html:5
#: sphinx/themes/basic/changes/versionchanges.html:12
#, python-format
@@ -547,36 +715,32 @@ msgstr "Modifications de l'API C"
msgid "Other changes"
msgstr "Autres modifications"
-#: sphinx/themes/basic/static/doctools.js:139 sphinx/writers/html.py:473
-#: sphinx/writers/html.py:478
+#: sphinx/themes/basic/static/doctools.js:154 sphinx/writers/html.py:482
+#: sphinx/writers/html.py:487
msgid "Permalink to this headline"
msgstr "Lien permanent vers ce titre"
-#: sphinx/themes/basic/static/doctools.js:145 sphinx/writers/html.py:80
+#: sphinx/themes/basic/static/doctools.js:160 sphinx/writers/html.py:87
msgid "Permalink to this definition"
msgstr "Lien permanent vers cette définition"
-#: sphinx/themes/basic/static/doctools.js:174
+#: sphinx/themes/basic/static/doctools.js:189
msgid "Hide Search Matches"
msgstr "Cacher les résultats de la recherche"
-#: sphinx/themes/basic/static/searchtools.js:274
+#: sphinx/themes/basic/static/searchtools.js:285
msgid "Searching"
msgstr "En cours de recherche"
-#: sphinx/themes/basic/static/searchtools.js:279
+#: sphinx/themes/basic/static/searchtools.js:290
msgid "Preparing search..."
msgstr "Préparation de la recherche..."
-#: sphinx/themes/basic/static/searchtools.js:338
-msgid "module, in "
-msgstr "module, dans"
-
-#: sphinx/themes/basic/static/searchtools.js:347
+#: sphinx/themes/basic/static/searchtools.js:364
msgid ", in "
msgstr ", dans"
-#: sphinx/themes/basic/static/searchtools.js:455
+#: sphinx/themes/basic/static/searchtools.js:491
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,34 +749,54 @@ 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:493
#, 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/themes/default/static/sidebar.js:66
+msgid "Expand sidebar"
+msgstr ""
+
+#: sphinx/themes/default/static/sidebar.js:79
+#: sphinx/themes/default/static/sidebar.js:106
+msgid "Collapse sidebar"
+msgstr ""
+
+#: sphinx/themes/haiku/layout.html:26
+msgid "Contents"
+msgstr ""
+
+#: sphinx/writers/latex.py:171
msgid "Release"
msgstr "Version"
-#: sphinx/writers/latex.py:571
+#: sphinx/writers/latex.py:572 sphinx/writers/manpage.py:178
msgid "Footnotes"
msgstr ""
-#: sphinx/writers/latex.py:639
+#: sphinx/writers/latex.py:641
msgid "continued from previous page"
msgstr ""
-#: sphinx/writers/latex.py:644
+#: sphinx/writers/latex.py:646
#, fuzzy
msgid "Continued on next page"
msgstr "Index complet sur une seule page"
-#: sphinx/writers/text.py:166
-#, python-format
-msgid "Platform: %s"
-msgstr "Plateforme : %s"
-
-#: sphinx/writers/text.py:428
+#: sphinx/writers/text.py:422
msgid "[image]"
msgstr "[image]"
+#~ msgid "Parameter"
+#~ msgstr "Paramètres"
+
+#~ msgid "here"
+#~ msgstr "ici"
+
+#~ msgid "module, in "
+#~ msgstr "module, dans"
+
+#~ msgid "Platform: %s"
+#~ msgstr "Plateforme : %s"
+
diff --git a/sphinx/locale/hr/LC_MESSAGES/sphinx.js b/sphinx/locale/hr/LC_MESSAGES/sphinx.js
new file mode 100644
index 000000000..b9d1f7af9
--- /dev/null
+++ b/sphinx/locale/hr/LC_MESSAGES/sphinx.js
@@ -0,0 +1 @@
+Documentation.addTranslations({"locale": "hr", "plural_expr": "0", "messages": {"Search Results": "Rezultati pretrage", "Preparing search...": "Pripremam pretra\u017eivanje...", "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\u0161u pretragu nema rezultata. Molimo pregledajte da li so sve rije\u010di ispravno napisane i da li ste izbrali dovoljno kategorija.", "Search finished, found %s page(s) matching the search query.": "Pretra\u017eivanje je zaklju\u010deno, prona\u0111eno %s stranica, koje odgovaraju tra\u017eenom nizu.", ", in ": ", u ", "Expand sidebar": "", "Permalink to this headline": "Link na taj naslov", "Searching": "Tra\u017eim", "Collapse sidebar": "", "Permalink to this definition": "Link na tu definiciju", "Hide Search Matches": "Sakrij rezultate pretrage"}}); \ No newline at end of file
diff --git a/sphinx/locale/hr/LC_MESSAGES/sphinx.mo b/sphinx/locale/hr/LC_MESSAGES/sphinx.mo
new file mode 100644
index 000000000..e032adeb1
--- /dev/null
+++ b/sphinx/locale/hr/LC_MESSAGES/sphinx.mo
Binary files differ
diff --git a/sphinx/locale/hr/LC_MESSAGES/sphinx.po b/sphinx/locale/hr/LC_MESSAGES/sphinx.po
new file mode 100644
index 000000000..ddcf2299a
--- /dev/null
+++ b/sphinx/locale/hr/LC_MESSAGES/sphinx.po
@@ -0,0 +1,795 @@
+
+msgid ""
+msgstr ""
+"Project-Id-Version: Sphinx\n"
+"Report-Msgid-Bugs-To: EMAIL@ADDRESS\n"
+"POT-Creation-Date: 2010-09-11 23:58+0200\n"
+"PO-Revision-Date: 2010-05-24 23:54+0200\n"
+"Last-Translator: Bojan Mihelač <bmihelac@mihelac.org>\n"
+"Language-Team: Bojan Mihelač <bmihelac@mihelac.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:106 sphinx/writers/latex.py:184
+#: sphinx/writers/manpage.py:67
+#, python-format
+msgid "%B %d, %Y"
+msgstr "%d %B, %Y"
+
+#: sphinx/roles.py:174
+#, python-format
+msgid "Python Enhancement Proposals!PEP %s"
+msgstr "Python Enhancement Proposals!PEP %s"
+
+#: sphinx/builders/changes.py:72
+msgid "Builtins"
+msgstr "Ugrađeni dijelovi"
+
+#: sphinx/builders/changes.py:74
+msgid "Module level"
+msgstr "Nivo modula"
+
+#: sphinx/builders/html.py:266
+#, python-format
+msgid "%b %d, %Y"
+msgstr "%d %b, %Y"
+
+#: sphinx/builders/html.py:285 sphinx/themes/basic/defindex.html:30
+msgid "General Index"
+msgstr "Opceniti abecedni indeks"
+
+#: sphinx/builders/html.py:285
+msgid "index"
+msgstr "abecedni indeks"
+
+#: sphinx/builders/html.py:345
+msgid "next"
+msgstr "naprijed"
+
+#: sphinx/builders/html.py:354
+msgid "previous"
+msgstr "nazad"
+
+#: sphinx/builders/latex.py:151
+msgid " (in "
+msgstr " (u "
+
+#: sphinx/directives/other.py:127
+msgid "Section author: "
+msgstr "Autor sekcije:"
+
+#: sphinx/directives/other.py:129
+msgid "Module author: "
+msgstr "Autor modula:"
+
+#: sphinx/directives/other.py:131
+#, fuzzy
+msgid "Code author: "
+msgstr "Autor modula:"
+
+#: sphinx/directives/other.py:133
+msgid "Author: "
+msgstr "Autor:"
+
+#: sphinx/directives/other.py:238
+msgid "See also"
+msgstr "Pogledaj i"
+
+#: sphinx/domains/__init__.py:253
+#, python-format
+msgid "%s %s"
+msgstr ""
+
+#: sphinx/domains/c.py:51 sphinx/domains/python.py:49
+msgid "Parameters"
+msgstr "Parametri"
+
+#: sphinx/domains/c.py:54 sphinx/domains/javascript.py:137
+#: sphinx/domains/python.py:59
+msgid "Returns"
+msgstr "Vraća"
+
+#: sphinx/domains/c.py:56 sphinx/domains/python.py:61
+msgid "Return type"
+msgstr "Vraća tip"
+
+#: sphinx/domains/c.py:133
+#, python-format
+msgid "%s (C function)"
+msgstr "%s (C funkcija)"
+
+#: sphinx/domains/c.py:135
+#, python-format
+msgid "%s (C member)"
+msgstr "%s (C član)"
+
+#: sphinx/domains/c.py:137
+#, python-format
+msgid "%s (C macro)"
+msgstr "%s (C makro)"
+
+#: sphinx/domains/c.py:139
+#, python-format
+msgid "%s (C type)"
+msgstr "%s (C tip)"
+
+#: sphinx/domains/c.py:141
+#, python-format
+msgid "%s (C variable)"
+msgstr "%s (C varijabla)"
+
+#: sphinx/domains/c.py:171 sphinx/domains/cpp.py:1031
+#: sphinx/domains/javascript.py:166 sphinx/domains/python.py:497
+msgid "function"
+msgstr "funkcija"
+
+#: sphinx/domains/c.py:172 sphinx/domains/cpp.py:1032
+msgid "member"
+msgstr "član"
+
+#: sphinx/domains/c.py:173
+msgid "macro"
+msgstr ""
+
+#: sphinx/domains/c.py:174 sphinx/domains/cpp.py:1033
+msgid "type"
+msgstr "tip"
+
+#: sphinx/domains/c.py:175
+#, fuzzy
+msgid "variable"
+msgstr "Varijabla"
+
+#: sphinx/domains/cpp.py:876
+#, python-format
+msgid "%s (C++ class)"
+msgstr "%s (C++ razred)"
+
+#: sphinx/domains/cpp.py:891
+#, python-format
+msgid "%s (C++ type)"
+msgstr "%s (C++ tip)"
+
+#: sphinx/domains/cpp.py:910
+#, python-format
+msgid "%s (C++ member)"
+msgstr "%s (C++ član)"
+
+#: sphinx/domains/cpp.py:962
+#, python-format
+msgid "%s (C++ function)"
+msgstr "%s (C++ funkcija)"
+
+#: sphinx/domains/cpp.py:1030 sphinx/domains/python.py:499
+#, fuzzy
+msgid "class"
+msgstr "razred"
+
+#: sphinx/domains/javascript.py:117 sphinx/domains/python.py:221
+#, python-format
+msgid "%s() (built-in function)"
+msgstr "%s() (ugrađene funkcije)"
+
+#: sphinx/domains/javascript.py:118 sphinx/domains/python.py:285
+#, python-format
+msgid "%s() (%s method)"
+msgstr "%s() (%s metoda)"
+
+#: sphinx/domains/javascript.py:120
+#, python-format
+msgid "%s (global variable or constant)"
+msgstr ""
+
+#: sphinx/domains/javascript.py:122 sphinx/domains/python.py:323
+#, python-format
+msgid "%s (%s attribute)"
+msgstr "%s (%s atribut)"
+
+#: sphinx/domains/javascript.py:131
+#, fuzzy
+msgid "Arguments"
+msgstr "Parametri"
+
+#: sphinx/domains/javascript.py:134
+msgid "Throws"
+msgstr ""
+
+#: sphinx/domains/javascript.py:167 sphinx/domains/python.py:498
+msgid "data"
+msgstr ""
+
+#: sphinx/domains/javascript.py:168 sphinx/domains/python.py:504
+msgid "attribute"
+msgstr "atribut"
+
+#: sphinx/domains/python.py:53
+#, fuzzy
+msgid "Variables"
+msgstr "Varijabla"
+
+#: sphinx/domains/python.py:56
+msgid "Raises"
+msgstr "Podiže"
+
+#: sphinx/domains/python.py:222 sphinx/domains/python.py:279
+#: sphinx/domains/python.py:291 sphinx/domains/python.py:304
+#, python-format
+msgid "%s() (in module %s)"
+msgstr "%s() (u modulu %s)"
+
+#: sphinx/domains/python.py:225
+#, python-format
+msgid "%s (built-in variable)"
+msgstr "%s (ugrađene variable)"
+
+#: sphinx/domains/python.py:226 sphinx/domains/python.py:317
+#, python-format
+msgid "%s (in module %s)"
+msgstr "%s (u modulu %s)"
+
+#: sphinx/domains/python.py:242
+#, python-format
+msgid "%s (built-in class)"
+msgstr "%s (ugrađen razred)"
+
+#: sphinx/domains/python.py:243
+#, python-format
+msgid "%s (class in %s)"
+msgstr "%s (razred u %s)"
+
+#: sphinx/domains/python.py:283
+#, python-format
+msgid "%s() (%s.%s method)"
+msgstr "%s() (%s.%s metoda)"
+
+#: sphinx/domains/python.py:295
+#, python-format
+msgid "%s() (%s.%s static method)"
+msgstr "%s() (%s.%s statična metoda)"
+
+#: sphinx/domains/python.py:298
+#, python-format
+msgid "%s() (%s static method)"
+msgstr "%s() (%s statična metoda)"
+
+#: sphinx/domains/python.py:308
+#, fuzzy, python-format
+msgid "%s() (%s.%s class method)"
+msgstr "%s() (%s.%s metoda)"
+
+#: sphinx/domains/python.py:311
+#, fuzzy, python-format
+msgid "%s() (%s class method)"
+msgstr "%s() (%s metoda)"
+
+#: sphinx/domains/python.py:321
+#, python-format
+msgid "%s (%s.%s attribute)"
+msgstr "%s (%s.%s atribut)"
+
+#: sphinx/domains/python.py:366
+msgid "Platforms: "
+msgstr "Platforme:"
+
+#: sphinx/domains/python.py:372
+#, python-format
+msgid "%s (module)"
+msgstr "%s (modul)"
+
+#: sphinx/domains/python.py:429
+#, fuzzy
+msgid "Python Module Index"
+msgstr "Popis modula"
+
+#: sphinx/domains/python.py:430
+msgid "modules"
+msgstr "Moduli"
+
+#: sphinx/domains/python.py:475
+msgid "Deprecated"
+msgstr "Zastarjelo"
+
+#: sphinx/domains/python.py:500 sphinx/locale/__init__.py:162
+msgid "exception"
+msgstr "izuzetak"
+
+#: sphinx/domains/python.py:501
+msgid "method"
+msgstr ""
+
+#: sphinx/domains/python.py:502
+#, fuzzy, python-format
+msgid "class method"
+msgstr "%s() (%s metoda)"
+
+#: sphinx/domains/python.py:503
+msgid "static method"
+msgstr "statična metoda"
+
+#: sphinx/domains/python.py:505 sphinx/locale/__init__.py:158
+msgid "module"
+msgstr "modul"
+
+#: sphinx/domains/rst.py:53
+#, python-format
+msgid "%s (directive)"
+msgstr ""
+
+#: sphinx/domains/rst.py:55
+#, fuzzy, python-format
+msgid "%s (role)"
+msgstr "%s (modul)"
+
+#: sphinx/domains/rst.py:103
+msgid "directive"
+msgstr ""
+
+#: sphinx/domains/rst.py:104
+#, fuzzy
+msgid "role"
+msgstr "modul"
+
+#: sphinx/domains/std.py:68 sphinx/domains/std.py:84
+#, python-format
+msgid "environment variable; %s"
+msgstr "varijabla okruženja; %s"
+
+#: sphinx/domains/std.py:160
+#, python-format
+msgid "%scommand line option; %s"
+msgstr "%scommand line parameter; %s"
+
+#: sphinx/domains/std.py:328
+msgid "glossary term"
+msgstr ""
+
+#: sphinx/domains/std.py:329
+msgid "grammar token"
+msgstr ""
+
+#: sphinx/domains/std.py:330
+msgid "reference label"
+msgstr ""
+
+#: sphinx/domains/std.py:331
+msgid "environment variable"
+msgstr "varijabla okruženja"
+
+#: sphinx/domains/std.py:332
+msgid "program option"
+msgstr ""
+
+#: sphinx/domains/std.py:360 sphinx/themes/basic/genindex-single.html:11
+#: sphinx/themes/basic/genindex-split.html:11
+#: sphinx/themes/basic/genindex-split.html:14
+#: sphinx/themes/basic/genindex.html:11 sphinx/themes/basic/genindex.html:14
+#: sphinx/themes/basic/genindex.html:50 sphinx/themes/basic/layout.html:125
+#: sphinx/writers/latex.py:173
+msgid "Index"
+msgstr "Abecedni popis"
+
+#: sphinx/domains/std.py:361
+msgid "Module Index"
+msgstr "Popis modula"
+
+#: sphinx/domains/std.py:362 sphinx/themes/basic/defindex.html:25
+msgid "Search Page"
+msgstr "Tražilica"
+
+#: sphinx/ext/autodoc.py:917
+#, python-format
+msgid " Bases: %s"
+msgstr " Osnove: %s"
+
+#: sphinx/ext/autodoc.py:950
+#, python-format
+msgid "alias of :class:`%s`"
+msgstr "nadimak za :class:`%s`"
+
+#: sphinx/ext/todo.py:41
+msgid "Todo"
+msgstr "Todo"
+
+#: sphinx/ext/todo.py:109
+#, fuzzy, python-format
+msgid "(The <<original entry>> is located in %s, line %d.)"
+msgstr "(Originalan unos se nalazi u %s, u retku %d, i može biti pronađen "
+
+#: sphinx/ext/todo.py:117
+msgid "original entry"
+msgstr ""
+
+#: sphinx/ext/viewcode.py:66
+msgid "[source]"
+msgstr ""
+
+#: sphinx/ext/viewcode.py:109
+msgid "[docs]"
+msgstr ""
+
+#: sphinx/ext/viewcode.py:123
+#, fuzzy
+msgid "Module code"
+msgstr "modul"
+
+#: sphinx/ext/viewcode.py:129
+#, python-format
+msgid "<h1>Source code for %s</h1>"
+msgstr ""
+
+#: sphinx/ext/viewcode.py:156
+msgid "Overview: module code"
+msgstr ""
+
+#: sphinx/ext/viewcode.py:157
+msgid "<h1>All modules for which code is available</h1>"
+msgstr ""
+
+#: sphinx/locale/__init__.py:139
+msgid "Attention"
+msgstr "Pozor"
+
+#: sphinx/locale/__init__.py:140
+msgid "Caution"
+msgstr "Pažnja"
+
+#: sphinx/locale/__init__.py:141
+msgid "Danger"
+msgstr "Opasnost"
+
+#: sphinx/locale/__init__.py:142
+msgid "Error"
+msgstr "Greška"
+
+#: sphinx/locale/__init__.py:143
+msgid "Hint"
+msgstr "Savjet"
+
+#: sphinx/locale/__init__.py:144
+msgid "Important"
+msgstr "Važno"
+
+#: sphinx/locale/__init__.py:145
+msgid "Note"
+msgstr "Napomena"
+
+#: sphinx/locale/__init__.py:146
+msgid "See Also"
+msgstr "Pogledaj i"
+
+#: sphinx/locale/__init__.py:147
+msgid "Tip"
+msgstr "Savjet"
+
+#: sphinx/locale/__init__.py:148
+msgid "Warning"
+msgstr "Upozorenje"
+
+#: sphinx/locale/__init__.py:152
+#, python-format
+msgid "New in version %s"
+msgstr "Novo u verziji %s"
+
+#: sphinx/locale/__init__.py:153
+#, python-format
+msgid "Changed in version %s"
+msgstr "Promijenjeno u verziji %s"
+
+#: sphinx/locale/__init__.py:154
+#, python-format
+msgid "Deprecated since version %s"
+msgstr "Zastarijelo od verzije %s"
+
+#: sphinx/locale/__init__.py:159
+msgid "keyword"
+msgstr "ključna riječ"
+
+#: sphinx/locale/__init__.py:160
+msgid "operator"
+msgstr "operator"
+
+#: sphinx/locale/__init__.py:161
+msgid "object"
+msgstr "objekt"
+
+#: sphinx/locale/__init__.py:163
+msgid "statement"
+msgstr "izjava"
+
+#: sphinx/locale/__init__.py:164
+msgid "built-in function"
+msgstr "ugrađen funkcije"
+
+#: sphinx/themes/agogo/layout.html:45 sphinx/themes/basic/globaltoc.html:10
+#: sphinx/themes/basic/localtoc.html:11
+msgid "Table Of Contents"
+msgstr "Pregled sadržaja"
+
+#: sphinx/themes/agogo/layout.html:49 sphinx/themes/basic/layout.html:128
+#: sphinx/themes/basic/search.html:11 sphinx/themes/basic/search.html:14
+msgid "Search"
+msgstr "Traži"
+
+#: sphinx/themes/agogo/layout.html:52 sphinx/themes/basic/searchbox.html:15
+msgid "Go"
+msgstr "Naprijed"
+
+#: sphinx/themes/agogo/layout.html:57 sphinx/themes/basic/searchbox.html:20
+msgid "Enter search terms or a module, class or function name."
+msgstr "Unesi ime modula, razreda ili funkcije."
+
+#: sphinx/themes/agogo/layout.html:78 sphinx/themes/basic/sourcelink.html:14
+msgid "Show Source"
+msgstr "Prikaži izvorni kod"
+
+#: sphinx/themes/basic/defindex.html:11
+msgid "Overview"
+msgstr "Pregled"
+
+#: sphinx/themes/basic/defindex.html:20
+msgid "Indices and tables:"
+msgstr "Kazala i tabele:"
+
+#: sphinx/themes/basic/defindex.html:23
+msgid "Complete Table of Contents"
+msgstr "Potpuna tabela sadržaja"
+
+#: sphinx/themes/basic/defindex.html:24
+msgid "lists all sections and subsections"
+msgstr "prikaži sve sekcije i podsekcije"
+
+#: sphinx/themes/basic/defindex.html:26
+msgid "search this documentation"
+msgstr "traži po dokumentaciji"
+
+#: sphinx/themes/basic/defindex.html:28
+msgid "Global Module Index"
+msgstr "Općeniti popis modula"
+
+#: sphinx/themes/basic/defindex.html:29
+msgid "quick access to all modules"
+msgstr "brz dostup do svih modulov"
+
+#: sphinx/themes/basic/defindex.html:31
+msgid "all functions, classes, terms"
+msgstr "sve funkcije, razredi, izrazi"
+
+#: sphinx/themes/basic/genindex-single.html:14
+#, python-format
+msgid "Index &ndash; %(key)s"
+msgstr "Index &ndash; %(key)s"
+
+#: sphinx/themes/basic/genindex-single.html:46
+#: sphinx/themes/basic/genindex-split.html:24
+#: sphinx/themes/basic/genindex-split.html:38
+#: sphinx/themes/basic/genindex.html:56
+msgid "Full index on one page"
+msgstr "Potpun indeks na jednoj strani"
+
+#: sphinx/themes/basic/genindex-split.html:16
+msgid "Index pages by letter"
+msgstr "Indeksiraj stranice po slovu"
+
+#: sphinx/themes/basic/genindex-split.html:25
+msgid "can be huge"
+msgstr "može biti veliko"
+
+#: sphinx/themes/basic/layout.html:23
+msgid "Navigation"
+msgstr "Navigacija"
+
+#: sphinx/themes/basic/layout.html:113
+#, python-format
+msgid "Search within %(docstitle)s"
+msgstr "Traži između %(docstitle)s"
+
+#: sphinx/themes/basic/layout.html:122
+msgid "About these documents"
+msgstr "O ovim dokumentima"
+
+#: sphinx/themes/basic/layout.html:131
+msgid "Copyright"
+msgstr "Sva prava zadržana"
+
+#: sphinx/themes/basic/layout.html:180
+#, python-format
+msgid "&copy; <a href=\"%(path)s\">Copyright</a> %(copyright)s."
+msgstr "&copy; <a href=\"%(path)s\">Sva prava zadržana</a> %(copyright)s."
+
+#: sphinx/themes/basic/layout.html:182
+#, python-format
+msgid "&copy; Copyright %(copyright)s."
+msgstr "&copy; Sva prava zadržana %(copyright)s."
+
+#: sphinx/themes/basic/layout.html:186
+#, python-format
+msgid "Last updated on %(last_updated)s."
+msgstr "Zadnji put ažurirano %(last_updated)s."
+
+#: sphinx/themes/basic/layout.html:189
+#, python-format
+msgid ""
+"Created using <a href=\"http://sphinx.pocoo.org/\">Sphinx</a> "
+"%(sphinx_version)s."
+msgstr ""
+"Izrađeno sa <a href=\"http://sphinx.pocoo.org/\">Sphinx</a> "
+"%(sphinx_version)s."
+
+#: sphinx/themes/basic/opensearch.xml:4
+#, python-format
+msgid "Search %(docstitle)s"
+msgstr "Traži %(docstitle)s"
+
+#: sphinx/themes/basic/relations.html:11
+msgid "Previous topic"
+msgstr "Prijašnja tema"
+
+#: sphinx/themes/basic/relations.html:13
+msgid "previous chapter"
+msgstr "Prijašnje poglavje"
+
+#: sphinx/themes/basic/relations.html:16
+msgid "Next topic"
+msgstr "Slijedeća tema"
+
+#: sphinx/themes/basic/relations.html:18
+msgid "next chapter"
+msgstr "slijedeće poglavje"
+
+#: sphinx/themes/basic/search.html:18
+msgid ""
+"Please activate JavaScript to enable the search\n"
+" functionality."
+msgstr ""
+"Molimo omogućite JavaScript\n"
+" za djelovanje tražilice."
+
+#: sphinx/themes/basic/search.html:23
+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 ""
+"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."
+
+#: sphinx/themes/basic/search.html:30
+msgid "search"
+msgstr "traži"
+
+#: sphinx/themes/basic/search.html:34
+#: sphinx/themes/basic/static/searchtools.js:489
+msgid "Search Results"
+msgstr "Rezultati pretrage"
+
+#: sphinx/themes/basic/search.html:36
+msgid "Your search did not match any results."
+msgstr "Your search did not match any results."
+
+#: sphinx/themes/basic/searchbox.html:12
+msgid "Quick search"
+msgstr "Brzo pretraživanje"
+
+#: sphinx/themes/basic/sourcelink.html:11
+msgid "This Page"
+msgstr "Trenutna stranica"
+
+#: 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 "Changes in Version %(version)s &mdash; %(docstitle)s"
+
+#: sphinx/themes/basic/changes/rstsource.html:5
+#, python-format
+msgid "%(filename)s &mdash; %(docstitle)s"
+msgstr "%(filename)s &mdash; %(docstitle)s"
+
+#: sphinx/themes/basic/changes/versionchanges.html:17
+#, python-format
+msgid "Automatically generated list of changes in version %(version)s"
+msgstr "Automatically generated list of changes in version %(version)s"
+
+#: sphinx/themes/basic/changes/versionchanges.html:18
+msgid "Library changes"
+msgstr "Library changes"
+
+#: sphinx/themes/basic/changes/versionchanges.html:23
+msgid "C API changes"
+msgstr "C API changes"
+
+#: sphinx/themes/basic/changes/versionchanges.html:25
+msgid "Other changes"
+msgstr "Ostale promjene"
+
+#: sphinx/themes/basic/static/doctools.js:154 sphinx/writers/html.py:482
+#: sphinx/writers/html.py:487
+msgid "Permalink to this headline"
+msgstr "Link na taj naslov"
+
+#: sphinx/themes/basic/static/doctools.js:160 sphinx/writers/html.py:87
+msgid "Permalink to this definition"
+msgstr "Link na tu definiciju"
+
+#: sphinx/themes/basic/static/doctools.js:189
+msgid "Hide Search Matches"
+msgstr "Sakrij rezultate pretrage"
+
+#: sphinx/themes/basic/static/searchtools.js:285
+msgid "Searching"
+msgstr "Tražim"
+
+#: sphinx/themes/basic/static/searchtools.js:290
+msgid "Preparing search..."
+msgstr "Pripremam pretraživanje..."
+
+#: sphinx/themes/basic/static/searchtools.js:364
+msgid ", in "
+msgstr ", u "
+
+#: sphinx/themes/basic/static/searchtools.js:491
+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 ""
+"Za vašu pretragu nema rezultata. Molimo pregledajte da li so sve riječi "
+"ispravno napisane i da li ste izbrali dovoljno kategorija."
+
+#: sphinx/themes/basic/static/searchtools.js:493
+#, python-format
+msgid "Search finished, found %s page(s) matching the search query."
+msgstr ""
+"Pretraživanje je zaključeno, pronađeno %s stranica, koje odgovaraju "
+"traženom nizu."
+
+#: sphinx/themes/default/static/sidebar.js:66
+msgid "Expand sidebar"
+msgstr ""
+
+#: sphinx/themes/default/static/sidebar.js:79
+#: sphinx/themes/default/static/sidebar.js:106
+msgid "Collapse sidebar"
+msgstr ""
+
+#: sphinx/themes/haiku/layout.html:26
+msgid "Contents"
+msgstr ""
+
+#: sphinx/writers/latex.py:171
+msgid "Release"
+msgstr "Distribucija"
+
+#: sphinx/writers/latex.py:572 sphinx/writers/manpage.py:178
+msgid "Footnotes"
+msgstr ""
+
+#: sphinx/writers/latex.py:641
+msgid "continued from previous page"
+msgstr "nastavak sa prethodne stranice"
+
+#: sphinx/writers/latex.py:646
+msgid "Continued on next page"
+msgstr "nastavak na slijedećoj stranici"
+
+#: sphinx/writers/text.py:422
+msgid "[image]"
+msgstr "[slika]"
+
+#~ msgid "Parameter"
+#~ msgstr "Parametar"
+
+#~ msgid "here"
+#~ msgstr "ovdje"
+
+#~ msgid "module, in "
+#~ msgstr "modul, u "
+
+#~ msgid "Platform: %s"
+#~ msgstr "Platforma: %s"
+
diff --git a/sphinx/locale/it/LC_MESSAGES/sphinx.js b/sphinx/locale/it/LC_MESSAGES/sphinx.js
index 9120c41e7..f9b193fe3 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": {"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
+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 ", "Expand sidebar": "", "Permalink to this headline": "link permanente per questa intestazione", "Searching": "Ricerca in corso", "Collapse sidebar": "", "Permalink to this definition": "link permanente per questa definizione", "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 6a55d16dc..10ca29a50 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 f0e981c99..40a2ca2a3 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: 2010-05-24 23:54+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,227 +16,377 @@ 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:106 sphinx/writers/latex.py:184
+#: sphinx/writers/manpage.py:67
#, python-format
msgid "%B %d, %Y"
msgstr "%d %B %Y"
-#: 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
-msgid "Index"
-msgstr "Indice"
-
-#: sphinx/environment.py:325 sphinx/writers/latex.py:187
-msgid "Module Index"
-msgstr "Indice dei Moduli"
-
-#: sphinx/environment.py:326 sphinx/themes/basic/defindex.html:16
-msgid "Search Page"
-msgstr "Cerca"
-
-#: sphinx/roles.py:55 sphinx/directives/desc.py:747
-#, python-format
-msgid "environment variable; %s"
-msgstr "variabile d'ambiente, %s"
-
-#: sphinx/roles.py:62
+#: sphinx/roles.py:174
#, python-format
msgid "Python Enhancement Proposals!PEP %s"
msgstr "Python Enhancement Proposals!PEP %s"
-#: sphinx/builders/changes.py:71
+#: sphinx/builders/changes.py:72
msgid "Builtins"
msgstr "Builtin"
-#: sphinx/builders/changes.py:73
+#: sphinx/builders/changes.py:74
msgid "Module level"
msgstr "Modulo"
-#: sphinx/builders/html.py:205
+#: sphinx/builders/html.py:266
#, 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:285 sphinx/themes/basic/defindex.html:30
msgid "General Index"
msgstr "Indice generale"
-#: sphinx/builders/html.py:224
+#: sphinx/builders/html.py:285
msgid "index"
msgstr "indice"
-#: 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
-msgid "Global Module Index"
-msgstr "Indice dei moduli"
-
-#: sphinx/builders/html.py:227
-msgid "modules"
-msgstr "moduli"
-
-#: sphinx/builders/html.py:281
+#: sphinx/builders/html.py:345
msgid "next"
msgstr "successivo"
-#: sphinx/builders/html.py:290
+#: sphinx/builders/html.py:354
msgid "previous"
msgstr "precedente"
-#: sphinx/builders/latex.py:162
+#: sphinx/builders/latex.py:151
msgid " (in "
msgstr " (in "
-#: sphinx/directives/desc.py:97
-msgid "Raises"
-msgstr "Solleva"
+#: sphinx/directives/other.py:127
+msgid "Section author: "
+msgstr "Autore della sezione: "
-#: sphinx/directives/desc.py:101
-msgid "Variable"
-msgstr "Variabile"
+#: sphinx/directives/other.py:129
+msgid "Module author: "
+msgstr "Autore del modulo: "
+
+#: sphinx/directives/other.py:131
+#, fuzzy
+msgid "Code author: "
+msgstr "Autore del modulo: "
+
+#: sphinx/directives/other.py:133
+msgid "Author: "
+msgstr "Autore: "
+
+#: sphinx/directives/other.py:238
+msgid "See also"
+msgstr "Vedi anche"
+
+#: sphinx/domains/__init__.py:253
+#, python-format
+msgid "%s %s"
+msgstr ""
+
+#: sphinx/domains/c.py:51 sphinx/domains/python.py:49
+msgid "Parameters"
+msgstr "Parametri"
-#: sphinx/directives/desc.py:104
+#: sphinx/domains/c.py:54 sphinx/domains/javascript.py:137
+#: sphinx/domains/python.py:59
msgid "Returns"
msgstr "Ritorna"
-#: sphinx/directives/desc.py:113
+#: sphinx/domains/c.py:56 sphinx/domains/python.py:61
msgid "Return type"
msgstr "Tipo di ritorno"
-#: sphinx/directives/desc.py:186
-msgid "Parameter"
-msgstr "Parametri"
+#: sphinx/domains/c.py:133
+#, python-format
+msgid "%s (C function)"
+msgstr "%s (funzione C)"
-#: sphinx/directives/desc.py:190
-msgid "Parameters"
-msgstr "Parametri"
+#: sphinx/domains/c.py:135
+#, python-format
+msgid "%s (C member)"
+msgstr "%s (membro C )"
+
+#: sphinx/domains/c.py:137
+#, python-format
+msgid "%s (C macro)"
+msgstr "%s (macro C)"
+
+#: sphinx/domains/c.py:139
+#, python-format
+msgid "%s (C type)"
+msgstr "%s (tipo C)"
+
+#: sphinx/domains/c.py:141
+#, python-format
+msgid "%s (C variable)"
+msgstr "%s (variabile C)"
+
+#: sphinx/domains/c.py:171 sphinx/domains/cpp.py:1031
+#: sphinx/domains/javascript.py:166 sphinx/domains/python.py:497
+msgid "function"
+msgstr "funzione"
+
+#: sphinx/domains/c.py:172 sphinx/domains/cpp.py:1032
+msgid "member"
+msgstr "membro"
+
+#: sphinx/domains/c.py:173
+msgid "macro"
+msgstr ""
+
+#: sphinx/domains/c.py:174 sphinx/domains/cpp.py:1033
+msgid "type"
+msgstr "tipo"
+
+#: sphinx/domains/c.py:175
+#, fuzzy
+msgid "variable"
+msgstr "Variabile"
+
+#: sphinx/domains/cpp.py:876
+#, python-format
+msgid "%s (C++ class)"
+msgstr "%s (classe C++)"
+
+#: sphinx/domains/cpp.py:891
+#, python-format
+msgid "%s (C++ type)"
+msgstr "%s (tipo C++)"
+
+#: sphinx/domains/cpp.py:910
+#, python-format
+msgid "%s (C++ member)"
+msgstr "%s (membro C++)"
+
+#: sphinx/domains/cpp.py:962
+#, python-format
+msgid "%s (C++ function)"
+msgstr "%s (funzione C++)"
+
+#: sphinx/domains/cpp.py:1030 sphinx/domains/python.py:499
+msgid "class"
+msgstr ""
-#: sphinx/directives/desc.py:418
+#: sphinx/domains/javascript.py:117 sphinx/domains/python.py:221
#, python-format
msgid "%s() (built-in function)"
msgstr "%s() (funzione built-in)"
-#: sphinx/directives/desc.py:419 sphinx/directives/desc.py:476
-#: sphinx/directives/desc.py:488
+#: sphinx/domains/javascript.py:118 sphinx/domains/python.py:285
+#, python-format
+msgid "%s() (%s method)"
+msgstr "%s() (%s metodo)"
+
+#: sphinx/domains/javascript.py:120
+#, python-format
+msgid "%s (global variable or constant)"
+msgstr ""
+
+#: sphinx/domains/javascript.py:122 sphinx/domains/python.py:323
+#, python-format
+msgid "%s (%s attribute)"
+msgstr "%s (%s attributo)"
+
+#: sphinx/domains/javascript.py:131
+#, fuzzy
+msgid "Arguments"
+msgstr "Parametri"
+
+#: sphinx/domains/javascript.py:134
+msgid "Throws"
+msgstr ""
+
+#: sphinx/domains/javascript.py:167 sphinx/domains/python.py:498
+msgid "data"
+msgstr ""
+
+#: sphinx/domains/javascript.py:168 sphinx/domains/python.py:504
+msgid "attribute"
+msgstr "attributo"
+
+#: sphinx/domains/python.py:53
+#, fuzzy
+msgid "Variables"
+msgstr "Variabile"
+
+#: sphinx/domains/python.py:56
+msgid "Raises"
+msgstr "Solleva"
+
+#: sphinx/domains/python.py:222 sphinx/domains/python.py:279
+#: sphinx/domains/python.py:291 sphinx/domains/python.py:304
#, python-format
msgid "%s() (in module %s)"
msgstr "%s() (nel modulo %s)"
-#: sphinx/directives/desc.py:422
+#: sphinx/domains/python.py:225
#, python-format
msgid "%s (built-in variable)"
msgstr "%s (variabile built-in)"
-#: sphinx/directives/desc.py:423 sphinx/directives/desc.py:514
+#: sphinx/domains/python.py:226 sphinx/domains/python.py:317
#, python-format
msgid "%s (in module %s)"
msgstr "%s (nel modulo %s)"
-#: sphinx/directives/desc.py:439
+#: sphinx/domains/python.py:242
#, python-format
msgid "%s (built-in class)"
msgstr "%s (classe built-in)"
-#: sphinx/directives/desc.py:440
+#: sphinx/domains/python.py:243
#, python-format
msgid "%s (class in %s)"
msgstr "%s (classe in %s)"
-#: sphinx/directives/desc.py:480
+#: sphinx/domains/python.py:283
#, python-format
msgid "%s() (%s.%s method)"
msgstr "%s() (%s.%s metodo)"
-#: sphinx/directives/desc.py:482
-#, python-format
-msgid "%s() (%s method)"
-msgstr "%s() (%s metodo)"
-
-#: sphinx/directives/desc.py:492
+#: sphinx/domains/python.py:295
#, python-format
msgid "%s() (%s.%s static method)"
msgstr "%s() (%s.%s metodo statico)"
-#: sphinx/directives/desc.py:495
+#: sphinx/domains/python.py:298
#, python-format
msgid "%s() (%s static method)"
msgstr "%s() (%s metodo statico)"
-#: sphinx/directives/desc.py:518
+#: sphinx/domains/python.py:308
+#, fuzzy, python-format
+msgid "%s() (%s.%s class method)"
+msgstr "%s() (%s.%s metodo)"
+
+#: sphinx/domains/python.py:311
+#, fuzzy, python-format
+msgid "%s() (%s class method)"
+msgstr "%s() (%s metodo)"
+
+#: sphinx/domains/python.py:321
#, python-format
msgid "%s (%s.%s attribute)"
msgstr "%s (%s.%s attributo)"
-#: sphinx/directives/desc.py:520
-#, python-format
-msgid "%s (%s attribute)"
-msgstr "%s (%s attributo)"
+#: sphinx/domains/python.py:366
+msgid "Platforms: "
+msgstr "Piattaforme:"
-#: sphinx/directives/desc.py:609
+#: sphinx/domains/python.py:372
#, python-format
-msgid "%s (C function)"
-msgstr "%s (funzione C)"
+msgid "%s (module)"
+msgstr "%s (modulo)"
-#: sphinx/directives/desc.py:611
-#, python-format
-msgid "%s (C member)"
-msgstr "%s (membro C )"
+#: sphinx/domains/python.py:429
+#, fuzzy
+msgid "Python Module Index"
+msgstr "Indice dei Moduli"
-#: sphinx/directives/desc.py:613
-#, python-format
-msgid "%s (C macro)"
-msgstr "%s (macro C)"
+#: sphinx/domains/python.py:430
+msgid "modules"
+msgstr "moduli"
+
+#: sphinx/domains/python.py:475
+msgid "Deprecated"
+msgstr "Deprecato"
+
+#: sphinx/domains/python.py:500 sphinx/locale/__init__.py:162
+msgid "exception"
+msgstr "eccezione"
-#: sphinx/directives/desc.py:615
+#: sphinx/domains/python.py:501
+msgid "method"
+msgstr ""
+
+#: sphinx/domains/python.py:502
+#, fuzzy, python-format
+msgid "class method"
+msgstr "%s() (%s metodo)"
+
+#: sphinx/domains/python.py:503
+msgid "static method"
+msgstr "metodo statico"
+
+#: sphinx/domains/python.py:505 sphinx/locale/__init__.py:158
+msgid "module"
+msgstr "modulo"
+
+#: sphinx/domains/rst.py:53
#, python-format
-msgid "%s (C type)"
-msgstr "%s (tipo C)"
+msgid "%s (directive)"
+msgstr ""
+
+#: sphinx/domains/rst.py:55
+#, fuzzy, python-format
+msgid "%s (role)"
+msgstr "%s (modulo)"
+
+#: sphinx/domains/rst.py:103
+msgid "directive"
+msgstr ""
+
+#: sphinx/domains/rst.py:104
+#, fuzzy
+msgid "role"
+msgstr "modulo"
-#: sphinx/directives/desc.py:617
+#: sphinx/domains/std.py:68 sphinx/domains/std.py:84
#, python-format
-msgid "%s (C variable)"
-msgstr "%s (variabile C)"
+msgid "environment variable; %s"
+msgstr "variabile d'ambiente, %s"
-#: sphinx/directives/desc.py:665
+#: sphinx/domains/std.py:160
#, python-format
msgid "%scommand line option; %s"
msgstr "%sopzione di linea di comando; %s"
-#: sphinx/directives/other.py:138
-msgid "Platforms: "
-msgstr "Piattaforme:"
+#: sphinx/domains/std.py:328
+msgid "glossary term"
+msgstr ""
-#: sphinx/directives/other.py:144
-#, python-format
-msgid "%s (module)"
-msgstr "%s (modulo)"
+#: sphinx/domains/std.py:329
+msgid "grammar token"
+msgstr ""
-#: sphinx/directives/other.py:193
-msgid "Section author: "
-msgstr "Autore della sezione"
+#: sphinx/domains/std.py:330
+msgid "reference label"
+msgstr ""
-#: sphinx/directives/other.py:195
-msgid "Module author: "
-msgstr "Autore del modulo"
+#: sphinx/domains/std.py:331
+msgid "environment variable"
+msgstr "variabile d'ambiente"
-#: sphinx/directives/other.py:197
-msgid "Author: "
-msgstr "Autore: "
+#: sphinx/domains/std.py:332
+msgid "program option"
+msgstr ""
-#: sphinx/directives/other.py:317
-msgid "See also"
-msgstr "Vedi anche"
+#: sphinx/domains/std.py:360 sphinx/themes/basic/genindex-single.html:11
+#: sphinx/themes/basic/genindex-split.html:11
+#: sphinx/themes/basic/genindex-split.html:14
+#: sphinx/themes/basic/genindex.html:11 sphinx/themes/basic/genindex.html:14
+#: sphinx/themes/basic/genindex.html:50 sphinx/themes/basic/layout.html:125
+#: sphinx/writers/latex.py:173
+msgid "Index"
+msgstr "Indice"
+
+#: sphinx/domains/std.py:361
+msgid "Module Index"
+msgstr "Indice dei Moduli"
+
+#: sphinx/domains/std.py:362 sphinx/themes/basic/defindex.html:25
+msgid "Search Page"
+msgstr "Cerca"
-#: sphinx/ext/autodoc.py:883
+#: sphinx/ext/autodoc.py:917
#, python-format
msgid " Bases: %s"
msgstr ""
-#: sphinx/ext/autodoc.py:916
+#: sphinx/ext/autodoc.py:950
#, python-format
msgid "alias of :class:`%s`"
msgstr "alias per :class:`%s`"
@@ -245,224 +395,223 @@ msgstr "alias per :class:`%s`"
msgid "Todo"
msgstr "Da fare"
-#: sphinx/ext/todo.py:99
+#: sphinx/ext/todo.py:109
+#, python-format
+msgid "(The <<original entry>> is located in %s, line %d.)"
+msgstr "(La <<riga originale>> si trova in %s, linea %d.)"
+
+#: sphinx/ext/todo.py:117
+msgid "original entry"
+msgstr "riga originale"
+
+#: sphinx/ext/viewcode.py:66
+msgid "[source]"
+msgstr ""
+
+#: sphinx/ext/viewcode.py:109
+msgid "[docs]"
+msgstr ""
+
+#: sphinx/ext/viewcode.py:123
+#, fuzzy
+msgid "Module code"
+msgstr "modulo"
+
+#: sphinx/ext/viewcode.py:129
#, python-format
-msgid "(The original entry is located in %s, line %d and can be found "
-msgstr "(La riga originale si trova in %s, linea %d e può essere trovata "
+msgid "<h1>Source code for %s</h1>"
+msgstr ""
-#: sphinx/ext/todo.py:105
-msgid "here"
-msgstr "qui"
+#: sphinx/ext/viewcode.py:156
+msgid "Overview: module code"
+msgstr ""
-#: sphinx/locale/__init__.py:15
+#: sphinx/ext/viewcode.py:157
+msgid "<h1>All modules for which code is available</h1>"
+msgstr ""
+
+#: sphinx/locale/__init__.py:139
msgid "Attention"
msgstr "Attenzione"
-#: sphinx/locale/__init__.py:16
+#: sphinx/locale/__init__.py:140
msgid "Caution"
msgstr "Attenzione"
-#: sphinx/locale/__init__.py:17
+#: sphinx/locale/__init__.py:141
msgid "Danger"
msgstr "Pericolo"
-#: sphinx/locale/__init__.py:18
+#: sphinx/locale/__init__.py:142
msgid "Error"
msgstr "Errore"
-#: sphinx/locale/__init__.py:19
+#: sphinx/locale/__init__.py:143
msgid "Hint"
msgstr "Consiglio"
-#: sphinx/locale/__init__.py:20
+#: sphinx/locale/__init__.py:144
msgid "Important"
msgstr "Importante"
-#: sphinx/locale/__init__.py:21
+#: sphinx/locale/__init__.py:145
msgid "Note"
msgstr "Nota"
-#: sphinx/locale/__init__.py:22
+#: sphinx/locale/__init__.py:146
msgid "See Also"
msgstr "Vedi anche"
-#: sphinx/locale/__init__.py:23
+#: sphinx/locale/__init__.py:147
msgid "Tip"
msgstr "Suggerimento"
-#: sphinx/locale/__init__.py:24
+#: sphinx/locale/__init__.py:148
msgid "Warning"
msgstr "Avvertimento"
-#: sphinx/locale/__init__.py:28
+#: sphinx/locale/__init__.py:152
#, python-format
msgid "New in version %s"
msgstr "Nuovo nella versione %s"
-#: sphinx/locale/__init__.py:29
+#: sphinx/locale/__init__.py:153
#, python-format
msgid "Changed in version %s"
msgstr "Cambiato nella versione %s"
-#: sphinx/locale/__init__.py:30
+#: sphinx/locale/__init__.py:154
#, python-format
msgid "Deprecated since version %s"
msgstr "Deprecato dalla versione %s"
-#: sphinx/locale/__init__.py:34
-msgid "module"
-msgstr "modulo"
-
-#: sphinx/locale/__init__.py:35
+#: sphinx/locale/__init__.py:159
msgid "keyword"
msgstr "keyword"
-#: sphinx/locale/__init__.py:36
+#: sphinx/locale/__init__.py:160
msgid "operator"
msgstr "operatore"
-#: sphinx/locale/__init__.py:37
+#: sphinx/locale/__init__.py:161
msgid "object"
msgstr "oggetto"
-#: sphinx/locale/__init__.py:38
-msgid "exception"
-msgstr "eccezione"
-
-#: sphinx/locale/__init__.py:39
+#: sphinx/locale/__init__.py:163
msgid "statement"
msgstr "statement"
-#: sphinx/locale/__init__.py:40
+#: sphinx/locale/__init__.py:164
msgid "built-in function"
msgstr "funzione built-in"
-#: sphinx/themes/basic/defindex.html:2
+#: sphinx/themes/agogo/layout.html:45 sphinx/themes/basic/globaltoc.html:10
+#: sphinx/themes/basic/localtoc.html:11
+msgid "Table Of Contents"
+msgstr "Tabella dei contenuti"
+
+#: sphinx/themes/agogo/layout.html:49 sphinx/themes/basic/layout.html:128
+#: sphinx/themes/basic/search.html:11 sphinx/themes/basic/search.html:14
+msgid "Search"
+msgstr "Cerca"
+
+#: sphinx/themes/agogo/layout.html:52 sphinx/themes/basic/searchbox.html:15
+msgid "Go"
+msgstr "Vai"
+
+#: sphinx/themes/agogo/layout.html:57 sphinx/themes/basic/searchbox.html:20
+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/agogo/layout.html:78 sphinx/themes/basic/sourcelink.html:14
+msgid "Show Source"
+msgstr "Mostra sorgente"
+
+#: sphinx/themes/basic/defindex.html:11
msgid "Overview"
msgstr "Sintesi"
-#: sphinx/themes/basic/defindex.html:11
+#: sphinx/themes/basic/defindex.html:20
msgid "Indices and tables:"
msgstr "Indici e tabelle:"
-#: sphinx/themes/basic/defindex.html:14
+#: sphinx/themes/basic/defindex.html:23
msgid "Complete Table of Contents"
msgstr "Tabella dei contenuti completa"
-#: sphinx/themes/basic/defindex.html:15
+#: sphinx/themes/basic/defindex.html:24
msgid "lists all sections and subsections"
msgstr "elenca l'insieme delle sezioni e sottosezioni"
-#: sphinx/themes/basic/defindex.html:17
+#: sphinx/themes/basic/defindex.html:26
msgid "search this documentation"
msgstr "cerca in questa documentazione"
-#: sphinx/themes/basic/defindex.html:20
+#: sphinx/themes/basic/defindex.html:28
+msgid "Global Module Index"
+msgstr "Indice dei moduli"
+
+#: sphinx/themes/basic/defindex.html:29
msgid "quick access to all modules"
msgstr "accesso veloce ai moduli"
-#: sphinx/themes/basic/defindex.html:22
+#: sphinx/themes/basic/defindex.html:31
msgid "all functions, classes, terms"
msgstr "tutte le funzioni, classi e moduli"
-#: sphinx/themes/basic/genindex-single.html:5
+#: sphinx/themes/basic/genindex-single.html:14
#, python-format
msgid "Index &ndash; %(key)s"
msgstr "Indice &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
+#: sphinx/themes/basic/genindex-single.html:46
+#: sphinx/themes/basic/genindex-split.html:24
+#: sphinx/themes/basic/genindex-split.html:38
+#: sphinx/themes/basic/genindex.html:56
msgid "Full index on one page"
msgstr "Indice completo in una pagina"
-#: sphinx/themes/basic/genindex-split.html:7
+#: sphinx/themes/basic/genindex-split.html:16
msgid "Index pages by letter"
msgstr "Indice delle pagine per lettera"
-#: sphinx/themes/basic/genindex-split.html:15
+#: sphinx/themes/basic/genindex-split.html:25
msgid "can be huge"
msgstr "può essere enorme"
-#: sphinx/themes/basic/layout.html:10
+#: sphinx/themes/basic/layout.html:23
msgid "Navigation"
msgstr "Navigazione"
-#: sphinx/themes/basic/layout.html:42
-msgid "Table Of Contents"
-msgstr "Tabella dei contenuti"
-
-#: sphinx/themes/basic/layout.html:48
-msgid "Previous topic"
-msgstr "Argomento precedente"
-
-#: sphinx/themes/basic/layout.html:50
-msgid "previous chapter"
-msgstr "capitolo precedente"
-
-#: sphinx/themes/basic/layout.html:53
-msgid "Next topic"
-msgstr "Argomento successivo"
-
-#: sphinx/themes/basic/layout.html:55
-msgid "next chapter"
-msgstr "capitolo successivo"
-
-#: sphinx/themes/basic/layout.html:60
-msgid "This Page"
-msgstr "Questa pagina"
-
-#: sphinx/themes/basic/layout.html:63
-msgid "Show Source"
-msgstr "Mostra sorgente"
-
-#: sphinx/themes/basic/layout.html:73
-msgid "Quick search"
-msgstr "Ricerca veloce"
-
-#: sphinx/themes/basic/layout.html:76
-msgid "Go"
-msgstr "Vai"
-
-#: sphinx/themes/basic/layout.html:81
-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:113
#, python-format
msgid "Search within %(docstitle)s"
msgstr "Cerca in %(docstitle)s"
-#: sphinx/themes/basic/layout.html:128
+#: sphinx/themes/basic/layout.html:122
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/search.html:5
-msgid "Search"
-msgstr "Cerca"
-
-#: sphinx/themes/basic/layout.html:137
+#: sphinx/themes/basic/layout.html:131
msgid "Copyright"
msgstr "Copyright"
-#: sphinx/themes/basic/layout.html:183
+#: sphinx/themes/basic/layout.html:180
#, 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:182
#, python-format
msgid "&copy; Copyright %(copyright)s."
msgstr "&copy; Copyright %(copyright)s."
-#: sphinx/themes/basic/layout.html:188
+#: sphinx/themes/basic/layout.html:186
#, 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:189
#, python-format
msgid ""
"Created using <a href=\"http://sphinx.pocoo.org/\">Sphinx</a> "
@@ -471,22 +620,34 @@ msgstr ""
"Creato con <a href=\"http://sphinx.pocoo.org/\">Sphinx</a> "
"%(sphinx_version)s."
-#: sphinx/themes/basic/modindex.html:36
-msgid "Deprecated"
-msgstr "Deprecato"
-
#: sphinx/themes/basic/opensearch.xml:4
#, python-format
msgid "Search %(docstitle)s"
msgstr "Cerca %(docstitle)s"
-#: sphinx/themes/basic/search.html:9
+#: sphinx/themes/basic/relations.html:11
+msgid "Previous topic"
+msgstr "Argomento precedente"
+
+#: sphinx/themes/basic/relations.html:13
+msgid "previous chapter"
+msgstr "capitolo precedente"
+
+#: sphinx/themes/basic/relations.html:16
+msgid "Next topic"
+msgstr "Argomento successivo"
+
+#: sphinx/themes/basic/relations.html:18
+msgid "next chapter"
+msgstr "capitolo successivo"
+
+#: sphinx/themes/basic/search.html:18
msgid ""
"Please activate JavaScript to enable the search\n"
" functionality."
msgstr ""
-#: sphinx/themes/basic/search.html:14
+#: sphinx/themes/basic/search.html:23
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"
@@ -500,19 +661,27 @@ msgstr ""
" di ricerca cerca automaticamente per tutte le parole. Le pagine\n"
" che contendono meno parole non compariranno nei risultati di ricerca."
-#: sphinx/themes/basic/search.html:21
+#: sphinx/themes/basic/search.html:30
msgid "search"
msgstr "cerca"
-#: sphinx/themes/basic/search.html:25
-#: sphinx/themes/basic/static/searchtools.js:453
+#: sphinx/themes/basic/search.html:34
+#: sphinx/themes/basic/static/searchtools.js:489
msgid "Search Results"
msgstr "Risultati della ricerca"
-#: sphinx/themes/basic/search.html:27
+#: sphinx/themes/basic/search.html:36
msgid "Your search did not match any results."
msgstr "La tua ricerca non ha ottenuto risultati"
+#: sphinx/themes/basic/searchbox.html:12
+msgid "Quick search"
+msgstr "Ricerca veloce"
+
+#: sphinx/themes/basic/sourcelink.html:11
+msgid "This Page"
+msgstr "Questa pagina"
+
#: sphinx/themes/basic/changes/frameset.html:5
#: sphinx/themes/basic/changes/versionchanges.html:12
#, python-format
@@ -541,36 +710,32 @@ msgstr "Modifiche nelle API C"
msgid "Other changes"
msgstr "Altre modifiche"
-#: sphinx/themes/basic/static/doctools.js:139 sphinx/writers/html.py:473
-#: sphinx/writers/html.py:478
+#: sphinx/themes/basic/static/doctools.js:154 sphinx/writers/html.py:482
+#: sphinx/writers/html.py:487
msgid "Permalink to this headline"
msgstr "link permanente per questa intestazione"
-#: sphinx/themes/basic/static/doctools.js:145 sphinx/writers/html.py:80
+#: sphinx/themes/basic/static/doctools.js:160 sphinx/writers/html.py:87
msgid "Permalink to this definition"
msgstr "link permanente per questa definizione"
-#: sphinx/themes/basic/static/doctools.js:174
+#: sphinx/themes/basic/static/doctools.js:189
msgid "Hide Search Matches"
msgstr "Nascondi i risultati della ricerca"
-#: sphinx/themes/basic/static/searchtools.js:274
+#: sphinx/themes/basic/static/searchtools.js:285
msgid "Searching"
msgstr "Ricerca in corso"
-#: sphinx/themes/basic/static/searchtools.js:279
+#: sphinx/themes/basic/static/searchtools.js:290
msgid "Preparing search..."
msgstr "Preparazione della ricerca"
-#: sphinx/themes/basic/static/searchtools.js:338
-msgid "module, in "
-msgstr "modulo, in"
-
-#: sphinx/themes/basic/static/searchtools.js:347
+#: sphinx/themes/basic/static/searchtools.js:364
msgid ", in "
msgstr ", in "
-#: sphinx/themes/basic/static/searchtools.js:455
+#: sphinx/themes/basic/static/searchtools.js:491
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,34 +744,41 @@ 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:493
#, 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/themes/default/static/sidebar.js:66
+msgid "Expand sidebar"
+msgstr ""
+
+#: sphinx/themes/default/static/sidebar.js:79
+#: sphinx/themes/default/static/sidebar.js:106
+msgid "Collapse sidebar"
+msgstr ""
+
+#: sphinx/themes/haiku/layout.html:26
+msgid "Contents"
+msgstr ""
+
+#: sphinx/writers/latex.py:171
msgid "Release"
msgstr "Release"
-#: sphinx/writers/latex.py:571
+#: sphinx/writers/latex.py:572 sphinx/writers/manpage.py:178
msgid "Footnotes"
msgstr ""
-#: sphinx/writers/latex.py:639
+#: sphinx/writers/latex.py:641
msgid "continued from previous page"
msgstr ""
-#: sphinx/writers/latex.py:644
+#: sphinx/writers/latex.py:646
#, fuzzy
msgid "Continued on next page"
msgstr "Indice completo in una pagina"
-#: sphinx/writers/text.py:166
-#, python-format
-msgid "Platform: %s"
-msgstr "Piattaforma: %s"
-
-#: sphinx/writers/text.py:428
+#: sphinx/writers/text.py:422
msgid "[image]"
msgstr "[immagine]"
-
diff --git a/sphinx/locale/ja/LC_MESSAGES/sphinx.js b/sphinx/locale/ja/LC_MESSAGES/sphinx.js
index 5a0f9ac64..6b63245ef 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": {"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
+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 ": "", "Expand sidebar": "", "Permalink to this headline": "\u3053\u306e\u30d8\u30c3\u30c9\u30e9\u30a4\u30f3\u3078\u306e\u30d1\u30fc\u30de\u30ea\u30f3\u30af", "Searching": "\u691c\u7d22\u4e2d", "Collapse sidebar": "", "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"}}); \ 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 fcfb0cba7..b0284f918 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 afaedfdcd..5f65a6c3e 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: 2010-05-24 23:54+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,455 +17,602 @@ 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:106 sphinx/writers/latex.py:184
+#: sphinx/writers/manpage.py:67
#, 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:131
-#: sphinx/writers/latex.py:188
-msgid "Index"
-msgstr "索引"
-
-#: sphinx/environment.py:325 sphinx/writers/latex.py:187
-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
+#: sphinx/roles.py:174
#, python-format
msgid "Python Enhancement Proposals!PEP %s"
msgstr "Python Enhancement Proposals!PEP %s"
-#: sphinx/builders/changes.py:71
+#: sphinx/builders/changes.py:72
msgid "Builtins"
msgstr "組み込み"
-#: sphinx/builders/changes.py:73
+#: sphinx/builders/changes.py:74
msgid "Module level"
msgstr "モジュールレベル"
-#: sphinx/builders/html.py:205
+#: sphinx/builders/html.py:266
#, 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:285 sphinx/themes/basic/defindex.html:30
msgid "General Index"
msgstr "総合索引"
-#: sphinx/builders/html.py:224
+#: sphinx/builders/html.py:285
msgid "index"
msgstr "索引"
-#: 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
-msgid "Global Module Index"
-msgstr "モジュール総索引"
-
-#: sphinx/builders/html.py:227
-msgid "modules"
-msgstr "モジュール"
-
-#: sphinx/builders/html.py:281
+#: sphinx/builders/html.py:345
msgid "next"
msgstr "次へ"
-#: sphinx/builders/html.py:290
+#: sphinx/builders/html.py:354
msgid "previous"
msgstr "前へ"
-#: sphinx/builders/latex.py:162
+#: sphinx/builders/latex.py:151
msgid " (in "
msgstr ""
-#: sphinx/directives/desc.py:97
-msgid "Raises"
-msgstr "例外"
+#: sphinx/directives/other.py:127
+msgid "Section author: "
+msgstr "この節の作者: "
-#: sphinx/directives/desc.py:101
-msgid "Variable"
-msgstr "変数"
+#: sphinx/directives/other.py:129
+msgid "Module author: "
+msgstr "モジュールの作者: "
-#: sphinx/directives/desc.py:104
+#: sphinx/directives/other.py:131
+#, fuzzy
+msgid "Code author: "
+msgstr "モジュールの作者: "
+
+#: sphinx/directives/other.py:133
+msgid "Author: "
+msgstr "作者: "
+
+#: sphinx/directives/other.py:238
+msgid "See also"
+msgstr "参考"
+
+#: sphinx/domains/__init__.py:253
+#, python-format
+msgid "%s %s"
+msgstr ""
+
+#: sphinx/domains/c.py:51 sphinx/domains/python.py:49
+msgid "Parameters"
+msgstr "パラメタ"
+
+#: sphinx/domains/c.py:54 sphinx/domains/javascript.py:137
+#: sphinx/domains/python.py:59
msgid "Returns"
msgstr "戻り値"
-#: sphinx/directives/desc.py:113
+#: sphinx/domains/c.py:56 sphinx/domains/python.py:61
msgid "Return type"
msgstr "戻り値の型"
-#: sphinx/directives/desc.py:186
+#: sphinx/domains/c.py:133
+#, python-format
+msgid "%s (C function)"
+msgstr "%s (C の関数)"
+
+#: sphinx/domains/c.py:135
+#, python-format
+msgid "%s (C member)"
+msgstr "%s (C のメンバ変数)"
+
+#: sphinx/domains/c.py:137
+#, python-format
+msgid "%s (C macro)"
+msgstr "%s (C のマクロ)"
+
+#: sphinx/domains/c.py:139
+#, python-format
+msgid "%s (C type)"
+msgstr "%s (C のデータ型)"
+
+#: sphinx/domains/c.py:141
+#, python-format
+msgid "%s (C variable)"
+msgstr "%s (C の変数)"
+
+#: sphinx/domains/c.py:171 sphinx/domains/cpp.py:1031
+#: sphinx/domains/javascript.py:166 sphinx/domains/python.py:497
+msgid "function"
+msgstr "の関数"
+
+#: sphinx/domains/c.py:172 sphinx/domains/cpp.py:1032
+msgid "member"
+msgstr "のメンバ変数"
+
+#: sphinx/domains/c.py:173
+msgid "macro"
+msgstr "のマクロ"
+
+#: sphinx/domains/c.py:174 sphinx/domains/cpp.py:1033
+msgid "type"
+msgstr "のデータ型"
+
+#: sphinx/domains/c.py:175
#, fuzzy
-msgid "Parameter"
-msgstr "パラメタ"
+msgid "variable"
+msgstr "変数"
-#: sphinx/directives/desc.py:190
-msgid "Parameters"
-msgstr "パラメタ"
+#: sphinx/domains/cpp.py:876
+#, fuzzy, python-format
+msgid "%s (C++ class)"
+msgstr "%s (のクラス)"
+
+#: sphinx/domains/cpp.py:891
+#, python-format
+msgid "%s (C++ type)"
+msgstr "%s (C++ のデータ型)"
+
+#: sphinx/domains/cpp.py:910
+#, python-format
+msgid "%s (C++ member)"
+msgstr "%s (C++ のメンバ変数)"
+
+#: sphinx/domains/cpp.py:962
+#, python-format
+msgid "%s (C++ function)"
+msgstr "%s (C++ の関数)"
+
+#: sphinx/domains/cpp.py:1030 sphinx/domains/python.py:499
+msgid "class"
+msgstr ""
-#: sphinx/directives/desc.py:418
+#: sphinx/domains/javascript.py:117 sphinx/domains/python.py:221
#, python-format
msgid "%s() (built-in function)"
msgstr "%s() (組み込み関数)"
-#: sphinx/directives/desc.py:419 sphinx/directives/desc.py:476
-#: sphinx/directives/desc.py:488
+#: sphinx/domains/javascript.py:118 sphinx/domains/python.py:285
+#, python-format
+msgid "%s() (%s method)"
+msgstr "%s() (%s のメソッド)"
+
+#: sphinx/domains/javascript.py:120
+#, python-format
+msgid "%s (global variable or constant)"
+msgstr ""
+
+#: sphinx/domains/javascript.py:122 sphinx/domains/python.py:323
+#, python-format
+msgid "%s (%s attribute)"
+msgstr "%s (%s の属性)"
+
+#: sphinx/domains/javascript.py:131
+#, fuzzy
+msgid "Arguments"
+msgstr "パラメタ"
+
+#: sphinx/domains/javascript.py:134
+msgid "Throws"
+msgstr ""
+
+#: sphinx/domains/javascript.py:167 sphinx/domains/python.py:498
+msgid "data"
+msgstr ""
+
+#: sphinx/domains/javascript.py:168 sphinx/domains/python.py:504
+msgid "attribute"
+msgstr "の属性"
+
+#: sphinx/domains/python.py:53
+#, fuzzy
+msgid "Variables"
+msgstr "変数"
+
+#: sphinx/domains/python.py:56
+msgid "Raises"
+msgstr "例外"
+
+#: sphinx/domains/python.py:222 sphinx/domains/python.py:279
+#: sphinx/domains/python.py:291 sphinx/domains/python.py:304
#, python-format
msgid "%s() (in module %s)"
msgstr "%s() (%s モジュール)"
-#: sphinx/directives/desc.py:422
+#: sphinx/domains/python.py:225
#, python-format
msgid "%s (built-in variable)"
msgstr "%s (組み込み変数)"
-#: sphinx/directives/desc.py:423 sphinx/directives/desc.py:514
+#: sphinx/domains/python.py:226 sphinx/domains/python.py:317
#, python-format
msgid "%s (in module %s)"
msgstr "%s (%s モジュール)"
-#: sphinx/directives/desc.py:439
-#, fuzzy, python-format
+#: sphinx/domains/python.py:242
+#, python-format
msgid "%s (built-in class)"
msgstr "%s (組み込み変数)"
-#: sphinx/directives/desc.py:440
+#: sphinx/domains/python.py:243
#, python-format
msgid "%s (class in %s)"
msgstr "%s (%s のクラス)"
-#: sphinx/directives/desc.py:480
+#: sphinx/domains/python.py:283
#, 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
+#: sphinx/domains/python.py:295
#, python-format
msgid "%s() (%s.%s static method)"
msgstr "%s() (%s.%s の静的メソッド)"
-#: sphinx/directives/desc.py:495
+#: sphinx/domains/python.py:298
#, python-format
msgid "%s() (%s static method)"
msgstr "%s() (%s の静的メソッド)"
-#: sphinx/directives/desc.py:518
+#: sphinx/domains/python.py:308
+#, fuzzy, python-format
+msgid "%s() (%s.%s class method)"
+msgstr "%s() (%s.%s のメソッド)"
+
+#: sphinx/domains/python.py:311
+#, fuzzy, python-format
+msgid "%s() (%s class method)"
+msgstr "%s() (%s のメソッド)"
+
+#: sphinx/domains/python.py:321
#, 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/domains/python.py:366
+msgid "Platforms: "
+msgstr "プラットフォーム: "
-#: sphinx/directives/desc.py:609
+#: sphinx/domains/python.py:372
#, python-format
-msgid "%s (C function)"
-msgstr "%s (C の関数)"
+msgid "%s (module)"
+msgstr "%s (モジュール)"
-#: sphinx/directives/desc.py:611
-#, python-format
-msgid "%s (C member)"
-msgstr "%s (C のメンバ変数)"
+#: sphinx/domains/python.py:429
+#, fuzzy
+msgid "Python Module Index"
+msgstr "モジュール索引"
-#: sphinx/directives/desc.py:613
-#, python-format
-msgid "%s (C macro)"
-msgstr "%s (C のマクロ)"
+#: sphinx/domains/python.py:430
+msgid "modules"
+msgstr "モジュール"
-#: sphinx/directives/desc.py:615
-#, python-format
-msgid "%s (C type)"
-msgstr "%s (C のデータ型)"
+#: sphinx/domains/python.py:475
+msgid "Deprecated"
+msgstr "撤廃"
+
+#: sphinx/domains/python.py:500 sphinx/locale/__init__.py:162
+msgid "exception"
+msgstr "例外"
-#: sphinx/directives/desc.py:617
+#: sphinx/domains/python.py:501
+msgid "method"
+msgstr ""
+
+#: sphinx/domains/python.py:502
+#, fuzzy, python-format
+msgid "class method"
+msgstr "%s() (%s のメソッド)"
+
+#: sphinx/domains/python.py:503
+msgid "static method"
+msgstr "の静的メソッド"
+
+#: sphinx/domains/python.py:505 sphinx/locale/__init__.py:158
+msgid "module"
+msgstr "モジュール"
+
+#: sphinx/domains/rst.py:53
#, python-format
-msgid "%s (C variable)"
-msgstr "%s (C の変数)"
+msgid "%s (directive)"
+msgstr ""
-#: sphinx/directives/desc.py:665
+#: sphinx/domains/rst.py:55
#, fuzzy, python-format
+msgid "%s (role)"
+msgstr "%s (モジュール)"
+
+#: sphinx/domains/rst.py:103
+msgid "directive"
+msgstr ""
+
+#: sphinx/domains/rst.py:104
+#, fuzzy
+msgid "role"
+msgstr "モジュール"
+
+#: sphinx/domains/std.py:68 sphinx/domains/std.py:84
+#, python-format
+msgid "environment variable; %s"
+msgstr "環境変数; %s"
+
+#: sphinx/domains/std.py:160
+#, python-format
msgid "%scommand line option; %s"
msgstr "%sコマンドラインオプション; %s"
-#: sphinx/directives/other.py:138
-msgid "Platforms: "
-msgstr "プラットフォーム: "
+#: sphinx/domains/std.py:328
+msgid "glossary term"
+msgstr ""
-#: sphinx/directives/other.py:144
-#, python-format
-msgid "%s (module)"
-msgstr "%s (モジュール)"
+#: sphinx/domains/std.py:329
+msgid "grammar token"
+msgstr ""
-#: sphinx/directives/other.py:193
-msgid "Section author: "
-msgstr "この節の作者: "
+#: sphinx/domains/std.py:330
+msgid "reference label"
+msgstr ""
-#: sphinx/directives/other.py:195
-msgid "Module author: "
-msgstr "モジュールの作者: "
+#: sphinx/domains/std.py:331
+msgid "environment variable"
+msgstr "環境変数"
-#: sphinx/directives/other.py:197
-msgid "Author: "
-msgstr "作者: "
+#: sphinx/domains/std.py:332
+msgid "program option"
+msgstr ""
-#: sphinx/directives/other.py:317
-msgid "See also"
-msgstr "参考"
+#: sphinx/domains/std.py:360 sphinx/themes/basic/genindex-single.html:11
+#: sphinx/themes/basic/genindex-split.html:11
+#: sphinx/themes/basic/genindex-split.html:14
+#: sphinx/themes/basic/genindex.html:11 sphinx/themes/basic/genindex.html:14
+#: sphinx/themes/basic/genindex.html:50 sphinx/themes/basic/layout.html:125
+#: sphinx/writers/latex.py:173
+msgid "Index"
+msgstr "索引"
+
+#: sphinx/domains/std.py:361
+msgid "Module Index"
+msgstr "モジュール索引"
-#: sphinx/ext/autodoc.py:883
+#: sphinx/domains/std.py:362 sphinx/themes/basic/defindex.html:25
+msgid "Search Page"
+msgstr "検索ページ"
+
+#: sphinx/ext/autodoc.py:917
#, python-format
msgid " Bases: %s"
-msgstr ""
+msgstr " ベースクラス: %s"
-#: sphinx/ext/autodoc.py:916
+#: sphinx/ext/autodoc.py:950
#, python-format
msgid "alias of :class:`%s`"
-msgstr ""
+msgstr ":class:`%s` のエイリアス"
#: sphinx/ext/todo.py:41
msgid "Todo"
+msgstr "課題"
+
+#: sphinx/ext/todo.py:109
+#, python-format
+msgid "(The <<original entry>> is located in %s, line %d.)"
+msgstr ""
+
+#: sphinx/ext/todo.py:117
+msgid "original entry"
msgstr ""
-#: sphinx/ext/todo.py:99
+#: sphinx/ext/viewcode.py:66
+msgid "[source]"
+msgstr ""
+
+#: sphinx/ext/viewcode.py:109
+msgid "[docs]"
+msgstr ""
+
+#: sphinx/ext/viewcode.py:123
+#, fuzzy
+msgid "Module code"
+msgstr "モジュール"
+
+#: sphinx/ext/viewcode.py:129
#, python-format
-msgid "(The original entry is located in %s, line %d and can be found "
+msgid "<h1>Source code for %s</h1>"
msgstr ""
-#: sphinx/ext/todo.py:105
-msgid "here"
+#: sphinx/ext/viewcode.py:156
+msgid "Overview: module code"
msgstr ""
-#: sphinx/locale/__init__.py:15
+#: sphinx/ext/viewcode.py:157
+msgid "<h1>All modules for which code is available</h1>"
+msgstr ""
+
+#: sphinx/locale/__init__.py:139
msgid "Attention"
msgstr "注意"
-#: sphinx/locale/__init__.py:16
+#: sphinx/locale/__init__.py:140
msgid "Caution"
msgstr "ご用心"
-#: sphinx/locale/__init__.py:17
+#: sphinx/locale/__init__.py:141
msgid "Danger"
msgstr "危険"
-#: sphinx/locale/__init__.py:18
+#: sphinx/locale/__init__.py:142
msgid "Error"
msgstr "エラー"
-#: sphinx/locale/__init__.py:19
+#: sphinx/locale/__init__.py:143
msgid "Hint"
msgstr "ヒント"
-#: sphinx/locale/__init__.py:20
+#: sphinx/locale/__init__.py:144
msgid "Important"
msgstr "重要"
-#: sphinx/locale/__init__.py:21
+#: sphinx/locale/__init__.py:145
msgid "Note"
msgstr "ノート"
-#: sphinx/locale/__init__.py:22
+#: sphinx/locale/__init__.py:146
msgid "See Also"
msgstr "参考"
-#: sphinx/locale/__init__.py:23
+#: sphinx/locale/__init__.py:147
msgid "Tip"
msgstr "ちなみに"
-#: sphinx/locale/__init__.py:24
+#: sphinx/locale/__init__.py:148
msgid "Warning"
msgstr "警告"
-#: sphinx/locale/__init__.py:28
+#: sphinx/locale/__init__.py:152
#, python-format
msgid "New in version %s"
msgstr "バージョン %s で追加"
-#: sphinx/locale/__init__.py:29
+#: sphinx/locale/__init__.py:153
#, python-format
msgid "Changed in version %s"
msgstr "バージョン %s で変更"
-#: sphinx/locale/__init__.py:30
+#: sphinx/locale/__init__.py:154
#, python-format
msgid "Deprecated since version %s"
msgstr "バージョン %s で撤廃"
-#: sphinx/locale/__init__.py:34
-msgid "module"
-msgstr "モジュール"
-
-#: sphinx/locale/__init__.py:35
+#: sphinx/locale/__init__.py:159
msgid "keyword"
msgstr "キーワード"
-#: sphinx/locale/__init__.py:36
+#: sphinx/locale/__init__.py:160
msgid "operator"
msgstr "演算子"
-#: sphinx/locale/__init__.py:37
+#: sphinx/locale/__init__.py:161
msgid "object"
msgstr "オブジェクト"
-#: sphinx/locale/__init__.py:38
-msgid "exception"
-msgstr "例外"
-
-#: sphinx/locale/__init__.py:39
+#: sphinx/locale/__init__.py:163
msgid "statement"
msgstr "文"
-#: sphinx/locale/__init__.py:40
+#: sphinx/locale/__init__.py:164
msgid "built-in function"
msgstr "組み込み関数"
-#: sphinx/themes/basic/defindex.html:2
+#: sphinx/themes/agogo/layout.html:45 sphinx/themes/basic/globaltoc.html:10
+#: sphinx/themes/basic/localtoc.html:11
+msgid "Table Of Contents"
+msgstr "目次"
+
+#: sphinx/themes/agogo/layout.html:49 sphinx/themes/basic/layout.html:128
+#: sphinx/themes/basic/search.html:11 sphinx/themes/basic/search.html:14
+msgid "Search"
+msgstr "検索"
+
+#: sphinx/themes/agogo/layout.html:52 sphinx/themes/basic/searchbox.html:15
+msgid "Go"
+msgstr "検索"
+
+#: sphinx/themes/agogo/layout.html:57 sphinx/themes/basic/searchbox.html:20
+msgid "Enter search terms or a module, class or function name."
+msgstr "モジュール、クラス、または関数名を入力してください"
+
+#: sphinx/themes/agogo/layout.html:78 sphinx/themes/basic/sourcelink.html:14
+msgid "Show Source"
+msgstr "ソースコードを表示"
+
+#: sphinx/themes/basic/defindex.html:11
msgid "Overview"
msgstr "概要"
-#: sphinx/themes/basic/defindex.html:11
+#: sphinx/themes/basic/defindex.html:20
msgid "Indices and tables:"
msgstr "索引と表一覧:"
-#: sphinx/themes/basic/defindex.html:14
+#: sphinx/themes/basic/defindex.html:23
msgid "Complete Table of Contents"
msgstr "総合目次"
-#: sphinx/themes/basic/defindex.html:15
+#: sphinx/themes/basic/defindex.html:24
msgid "lists all sections and subsections"
msgstr "章/節一覧"
-#: sphinx/themes/basic/defindex.html:17
+#: sphinx/themes/basic/defindex.html:26
msgid "search this documentation"
msgstr "ドキュメントを検索"
-#: sphinx/themes/basic/defindex.html:20
+#: sphinx/themes/basic/defindex.html:28
+msgid "Global Module Index"
+msgstr "モジュール総索引"
+
+#: sphinx/themes/basic/defindex.html:29
msgid "quick access to all modules"
msgstr "全モジュール早見表"
-#: sphinx/themes/basic/defindex.html:22
+#: sphinx/themes/basic/defindex.html:31
msgid "all functions, classes, terms"
msgstr "関数、クラスおよび用語総覧"
-#: sphinx/themes/basic/genindex-single.html:5
+#: sphinx/themes/basic/genindex-single.html:14
#, 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
+#: sphinx/themes/basic/genindex-single.html:46
+#: sphinx/themes/basic/genindex-split.html:24
+#: sphinx/themes/basic/genindex-split.html:38
+#: sphinx/themes/basic/genindex.html:56
msgid "Full index on one page"
msgstr "総索引"
-#: sphinx/themes/basic/genindex-split.html:7
+#: sphinx/themes/basic/genindex-split.html:16
msgid "Index pages by letter"
msgstr "頭文字別索引"
-#: sphinx/themes/basic/genindex-split.html:15
+#: sphinx/themes/basic/genindex-split.html:25
msgid "can be huge"
msgstr "大きい場合があるので注意"
-#: sphinx/themes/basic/layout.html:10
+#: sphinx/themes/basic/layout.html:23
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
-#, fuzzy
-msgid "Enter search terms or a module, class or function name."
-msgstr "モジュール、クラス、または関数名を入力してください"
-
-#: sphinx/themes/basic/layout.html:119
+#: sphinx/themes/basic/layout.html:113
#, python-format
msgid "Search within %(docstitle)s"
msgstr "%(docstitle)s 内を検索"
-#: sphinx/themes/basic/layout.html:128
+#: sphinx/themes/basic/layout.html:122
msgid "About these documents"
msgstr "このドキュメントについて"
-#: sphinx/themes/basic/layout.html:134 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:131
msgid "Copyright"
msgstr "著作権"
-#: sphinx/themes/basic/layout.html:183
+#: sphinx/themes/basic/layout.html:180
#, 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:182
#, python-format
msgid "&copy; Copyright %(copyright)s."
msgstr "&copy; Copyright %(copyright)s."
-#: sphinx/themes/basic/layout.html:188
+#: sphinx/themes/basic/layout.html:186
#, python-format
msgid "Last updated on %(last_updated)s."
msgstr "最終更新: %(last_updated)s"
-#: sphinx/themes/basic/layout.html:191
+#: sphinx/themes/basic/layout.html:189
#, python-format
msgid ""
"Created using <a href=\"http://sphinx.pocoo.org/\">Sphinx</a> "
@@ -474,23 +621,34 @@ 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
+#: sphinx/themes/basic/relations.html:11
+msgid "Previous topic"
+msgstr "前のトピックへ"
+
+#: sphinx/themes/basic/relations.html:13
+msgid "previous chapter"
+msgstr "前の章へ"
+
+#: sphinx/themes/basic/relations.html:16
+msgid "Next topic"
+msgstr "次のトピックへ"
+
+#: sphinx/themes/basic/relations.html:18
+msgid "next chapter"
+msgstr "次の章へ"
+
+#: sphinx/themes/basic/search.html:18
msgid ""
"Please activate JavaScript to enable the search\n"
" functionality."
-msgstr ""
+msgstr "検索機能を使うには JavaScript を有効にしてください。"
-#: sphinx/themes/basic/search.html:14
-#, fuzzy
+#: sphinx/themes/basic/search.html:23
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"
@@ -498,19 +656,27 @@ msgid ""
" containing fewer words won't appear in the result list."
msgstr "このページからドキュメントを検索できます。キーワードを下のボックスに入力して、「検索」をクリックしてください。入力された全てのキーワードを含むページが検索されます。一部のキーワードしか含まないページは検索結果に表示されないので注意してください。"
-#: sphinx/themes/basic/search.html:21
+#: sphinx/themes/basic/search.html:30
msgid "search"
msgstr "検索"
-#: sphinx/themes/basic/search.html:25
-#: sphinx/themes/basic/static/searchtools.js:453
+#: sphinx/themes/basic/search.html:34
+#: sphinx/themes/basic/static/searchtools.js:489
msgid "Search Results"
msgstr "検索結果"
-#: sphinx/themes/basic/search.html:27
+#: sphinx/themes/basic/search.html:36
msgid "Your search did not match any results."
msgstr "検索条件に一致する項目がありませんでした。"
+#: sphinx/themes/basic/searchbox.html:12
+msgid "Quick search"
+msgstr "クイック検索"
+
+#: sphinx/themes/basic/sourcelink.html:11
+msgid "This Page"
+msgstr "このページ"
+
#: sphinx/themes/basic/changes/frameset.html:5
#: sphinx/themes/basic/changes/versionchanges.html:12
#, python-format
@@ -539,70 +705,71 @@ msgstr "C API に関する変更"
msgid "Other changes"
msgstr "その多の変更"
-#: sphinx/themes/basic/static/doctools.js:139 sphinx/writers/html.py:473
-#: sphinx/writers/html.py:478
+#: sphinx/themes/basic/static/doctools.js:154 sphinx/writers/html.py:482
+#: sphinx/writers/html.py:487
msgid "Permalink to this headline"
msgstr "このヘッドラインへのパーマリンク"
-#: sphinx/themes/basic/static/doctools.js:145 sphinx/writers/html.py:80
+#: sphinx/themes/basic/static/doctools.js:160 sphinx/writers/html.py:87
msgid "Permalink to this definition"
msgstr "この定義へのパーマリンク"
-#: sphinx/themes/basic/static/doctools.js:174
+#: sphinx/themes/basic/static/doctools.js:189
msgid "Hide Search Matches"
msgstr "検索結果を隠す"
-#: sphinx/themes/basic/static/searchtools.js:274
+#: sphinx/themes/basic/static/searchtools.js:285
msgid "Searching"
msgstr "検索中"
-#: sphinx/themes/basic/static/searchtools.js:279
+#: sphinx/themes/basic/static/searchtools.js:290
msgid "Preparing search..."
msgstr "検索の準備中..."
-#: sphinx/themes/basic/static/searchtools.js:338
-#, fuzzy
-msgid "module, in "
-msgstr "モジュール"
-
-#: sphinx/themes/basic/static/searchtools.js:347
+#: sphinx/themes/basic/static/searchtools.js:364
msgid ", in "
msgstr ""
-#: sphinx/themes/basic/static/searchtools.js:455
+#: sphinx/themes/basic/static/searchtools.js:491
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:493
#, python-format
msgid "Search finished, found %s page(s) matching the search query."
msgstr "検索が終了し、条件に一致するページが %s 個みつかりました。"
-#: sphinx/writers/latex.py:185
+#: sphinx/themes/default/static/sidebar.js:66
+msgid "Expand sidebar"
+msgstr ""
+
+#: sphinx/themes/default/static/sidebar.js:79
+#: sphinx/themes/default/static/sidebar.js:106
+msgid "Collapse sidebar"
+msgstr ""
+
+#: sphinx/themes/haiku/layout.html:26
+msgid "Contents"
+msgstr ""
+
+#: sphinx/writers/latex.py:171
msgid "Release"
msgstr "リリース"
-#: sphinx/writers/latex.py:571
+#: sphinx/writers/latex.py:572 sphinx/writers/manpage.py:178
msgid "Footnotes"
-msgstr ""
+msgstr "注記"
-#: sphinx/writers/latex.py:639
+#: sphinx/writers/latex.py:641
msgid "continued from previous page"
-msgstr ""
+msgstr "前のページからの続き"
-#: sphinx/writers/latex.py:644
-#, fuzzy
+#: sphinx/writers/latex.py:646
msgid "Continued on next page"
msgstr "総索引"
-#: sphinx/writers/text.py:166
-#, python-format
-msgid "Platform: %s"
-msgstr "プラットフォーム: %s"
-
-#: sphinx/writers/text.py:428
+#: sphinx/writers/text.py:422
msgid "[image]"
msgstr "[画像]"
-
diff --git a/sphinx/locale/nl/LC_MESSAGES/sphinx.js b/sphinx/locale/nl/LC_MESSAGES/sphinx.js
index 7a7a821a0..a1e81fa47 100644
--- a/sphinx/locale/nl/LC_MESSAGES/sphinx.js
+++ b/sphinx/locale/nl/LC_MESSAGES/sphinx.js
@@ -1 +1 @@
-Documentation.addTranslations({"locale": "nl", "plural_expr": "(n != 1)", "messages": {"Search Results": "Zoekresultaten", "Preparing search...": "Het zoeken wordt voorbereid...", "Your search did not match any documents. Please make sure that all words are spelled correctly and that you've selected enough categories.": "Uw zoekopdracht leverde geen resultaten op. Controleer of alle woorden correct gespeld zijn en dat u genoeg categori\u00ebn hebt geselecteerd.", "Search finished, found %s page(s) matching the search query.": "Zoeken voltooid, %s pagina(s) gevonden.", ", in ": ", in ", "Permalink to this headline": "Permanente link naar deze titel", "Searching": "Zoeken", "Permalink to this definition": "Permanente link naar deze definitie", "module, in ": "module, in", "Hide Search Matches": "Zoekresultaten verbergen"}}); \ No newline at end of file
+Documentation.addTranslations({"locale": "nl", "plural_expr": "(n != 1)", "messages": {"Search Results": "Zoekresultaten", "Preparing search...": "Het zoeken wordt voorbereid...", "Your search did not match any documents. Please make sure that all words are spelled correctly and that you've selected enough categories.": "Uw zoekopdracht leverde geen resultaten op. Controleer of alle woorden correct gespeld zijn en dat u genoeg categori\u00ebn hebt geselecteerd.", "Search finished, found %s page(s) matching the search query.": "Zoeken voltooid, %s pagina(s) gevonden.", ", in ": ", in ", "Expand sidebar": "", "Permalink to this headline": "Permanente link naar deze titel", "Searching": "Zoeken", "Collapse sidebar": "", "Permalink to this definition": "Permanente link naar deze definitie", "Hide Search Matches": "Zoekresultaten verbergen"}}); \ No newline at end of file
diff --git a/sphinx/locale/nl/LC_MESSAGES/sphinx.mo b/sphinx/locale/nl/LC_MESSAGES/sphinx.mo
index d951b578c..8469d9894 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/nl/LC_MESSAGES/sphinx.po b/sphinx/locale/nl/LC_MESSAGES/sphinx.po
index a522d75d9..2ae2471df 100644
--- a/sphinx/locale/nl/LC_MESSAGES/sphinx.po
+++ b/sphinx/locale/nl/LC_MESSAGES/sphinx.po
@@ -7,249 +7,386 @@ msgstr ""
"Project-Id-Version: Sphinx 0.5\n"
"Report-Msgid-Bugs-To: EMAIL@ADDRESS\n"
"POT-Creation-Date: 2009-08-06 23:04+0200\n"
-"PO-Revision-Date: 2009-11-03 15:55+0100\n"
+"PO-Revision-Date: 2010-05-24 23:54+0200\n"
"Last-Translator: Marijn van der Zee <marijn.vanderzee@gmail.com>\n"
"Language-Team: nl <LL@li.org>\n"
+"Plural-Forms: nplurals=2; plural=(n != 1)\n"
"MIME-Version: 1.0\n"
-"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Type: text/plain; charset=utf-8\n"
"Content-Transfer-Encoding: 8bit\n"
-"Plural-Forms: nplurals=2; plural=(n != 1)\n"
"Generated-By: Babel 0.9.4\n"
-#: sphinx/environment.py:103
-#: sphinx/writers/latex.py:184
+#: sphinx/environment.py:106 sphinx/writers/latex.py:184
+#: sphinx/writers/manpage.py:67
#, python-format
msgid "%B %d, %Y"
msgstr "%d. %B %Y"
-#: 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 "Index"
-
-#: sphinx/environment.py:325
-#: sphinx/writers/latex.py:189
-msgid "Module Index"
-msgstr "Module-index"
-
-#: sphinx/environment.py:326
-#: sphinx/themes/basic/defindex.html:16
-msgid "Search Page"
-msgstr "Zoekpagina"
-
-#: sphinx/roles.py:55
-#: sphinx/directives/desc.py:747
-#, python-format
-msgid "environment variable; %s"
-msgstr "omgevingsvariabele; %s"
-
-#: sphinx/roles.py:62
+#: sphinx/roles.py:174
#, python-format
msgid "Python Enhancement Proposals!PEP %s"
msgstr "Python Enhancement Proposals!PEP %s"
-#: sphinx/builders/changes.py:71
+#: sphinx/builders/changes.py:72
msgid "Builtins"
msgstr "Builtins"
-#: sphinx/builders/changes.py:73
+#: sphinx/builders/changes.py:74
msgid "Module level"
msgstr "Moduleniveau"
-#: sphinx/builders/html.py:222
+#: sphinx/builders/html.py:266
#, python-format
msgid "%b %d, %Y"
msgstr "%d.%b.%Y"
-#: sphinx/builders/html.py:241
-#: sphinx/themes/basic/defindex.html:21
+#: sphinx/builders/html.py:285 sphinx/themes/basic/defindex.html:30
msgid "General Index"
msgstr "Algemene index"
-#: sphinx/builders/html.py:241
+#: sphinx/builders/html.py:285
msgid "index"
msgstr "Index"
-#: 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 "Globale Module-index"
-
-#: sphinx/builders/html.py:244
-msgid "modules"
-msgstr "modules"
-
-#: sphinx/builders/html.py:300
+#: sphinx/builders/html.py:345
msgid "next"
msgstr "volgende"
-#: sphinx/builders/html.py:309
+#: sphinx/builders/html.py:354
msgid "previous"
msgstr "vorige"
-#: sphinx/builders/latex.py:162
+#: sphinx/builders/latex.py:151
msgid " (in "
msgstr ""
-#: sphinx/directives/desc.py:97
-msgid "Raises"
-msgstr "Veroorzaakt"
+#: sphinx/directives/other.py:127
+msgid "Section author: "
+msgstr "Auteur van deze sectie: "
-#: sphinx/directives/desc.py:101
-msgid "Variable"
-msgstr "Variabele"
+#: sphinx/directives/other.py:129
+msgid "Module author: "
+msgstr "Auteur van deze module: "
+
+#: sphinx/directives/other.py:131
+#, fuzzy
+msgid "Code author: "
+msgstr "Auteur van deze module: "
+
+#: sphinx/directives/other.py:133
+msgid "Author: "
+msgstr "Auteur: "
+
+#: sphinx/directives/other.py:238
+msgid "See also"
+msgstr "Zie ook"
+
+#: sphinx/domains/__init__.py:253
+#, python-format
+msgid "%s %s"
+msgstr ""
-#: sphinx/directives/desc.py:104
+#: sphinx/domains/c.py:51 sphinx/domains/python.py:49
+msgid "Parameters"
+msgstr "Parameters"
+
+#: sphinx/domains/c.py:54 sphinx/domains/javascript.py:137
+#: sphinx/domains/python.py:59
msgid "Returns"
msgstr "Returns"
-#: sphinx/directives/desc.py:113
+#: sphinx/domains/c.py:56 sphinx/domains/python.py:61
msgid "Return type"
msgstr "Return type"
-#: sphinx/directives/desc.py:186
-msgid "Parameter"
-msgstr "Parameter"
+#: sphinx/domains/c.py:133
+#, python-format
+msgid "%s (C function)"
+msgstr "%s (C-functie)"
-#: sphinx/directives/desc.py:190
-msgid "Parameters"
-msgstr "Parameters"
+#: sphinx/domains/c.py:135
+#, python-format
+msgid "%s (C member)"
+msgstr "%s (C member)"
+
+#: sphinx/domains/c.py:137
+#, python-format
+msgid "%s (C macro)"
+msgstr "%s (C-macro)"
+
+#: sphinx/domains/c.py:139
+#, python-format
+msgid "%s (C type)"
+msgstr "%s (C type)"
-#: sphinx/directives/desc.py:418
+#: sphinx/domains/c.py:141
+#, python-format
+msgid "%s (C variable)"
+msgstr "%s (C-variabele)"
+
+#: sphinx/domains/c.py:171 sphinx/domains/cpp.py:1031
+#: sphinx/domains/javascript.py:166 sphinx/domains/python.py:497
+msgid "function"
+msgstr "functie"
+
+#: sphinx/domains/c.py:172 sphinx/domains/cpp.py:1032
+msgid "member"
+msgstr "member"
+
+#: sphinx/domains/c.py:173
+msgid "macro"
+msgstr ""
+
+#: sphinx/domains/c.py:174 sphinx/domains/cpp.py:1033
+msgid "type"
+msgstr "type"
+
+#: sphinx/domains/c.py:175
+#, fuzzy
+msgid "variable"
+msgstr "Variabele"
+
+#: sphinx/domains/cpp.py:876
+#, python-format
+msgid "%s (C++ class)"
+msgstr "%s (C++ klasse)"
+
+#: sphinx/domains/cpp.py:891
+#, python-format
+msgid "%s (C++ type)"
+msgstr "%s (C++ type)"
+
+#: sphinx/domains/cpp.py:910
+#, python-format
+msgid "%s (C++ member)"
+msgstr "%s (C++ member)"
+
+#: sphinx/domains/cpp.py:962
+#, python-format
+msgid "%s (C++ function)"
+msgstr "%s (C++ functie)"
+
+#: sphinx/domains/cpp.py:1030 sphinx/domains/python.py:499
+msgid "class"
+msgstr "klasse"
+
+#: sphinx/domains/javascript.py:117 sphinx/domains/python.py:221
#, python-format
msgid "%s() (built-in function)"
msgstr "%s() (geïntegreerde functie)"
-#: sphinx/directives/desc.py:419
-#: sphinx/directives/desc.py:476
-#: sphinx/directives/desc.py:488
+#: sphinx/domains/javascript.py:118 sphinx/domains/python.py:285
+#, python-format
+msgid "%s() (%s method)"
+msgstr "%s() (%s methode)"
+
+#: sphinx/domains/javascript.py:120
+#, python-format
+msgid "%s (global variable or constant)"
+msgstr ""
+
+#: sphinx/domains/javascript.py:122 sphinx/domains/python.py:323
+#, python-format
+msgid "%s (%s attribute)"
+msgstr "%s (%s attribuut)"
+
+#: sphinx/domains/javascript.py:131
+#, fuzzy
+msgid "Arguments"
+msgstr "Parameters"
+
+#: sphinx/domains/javascript.py:134
+msgid "Throws"
+msgstr ""
+
+#: sphinx/domains/javascript.py:167 sphinx/domains/python.py:498
+msgid "data"
+msgstr ""
+
+#: sphinx/domains/javascript.py:168 sphinx/domains/python.py:504
+msgid "attribute"
+msgstr "attribuut"
+
+#: sphinx/domains/python.py:53
+#, fuzzy
+msgid "Variables"
+msgstr "Variabele"
+
+#: sphinx/domains/python.py:56
+msgid "Raises"
+msgstr "Veroorzaakt"
+
+#: sphinx/domains/python.py:222 sphinx/domains/python.py:279
+#: sphinx/domains/python.py:291 sphinx/domains/python.py:304
#, python-format
msgid "%s() (in module %s)"
msgstr "%s() (in module %s)"
-#: sphinx/directives/desc.py:422
+#: sphinx/domains/python.py:225
#, python-format
msgid "%s (built-in variable)"
msgstr "%s (geïntegreerde variabele)"
-#: sphinx/directives/desc.py:423
-#: sphinx/directives/desc.py:514
+#: sphinx/domains/python.py:226 sphinx/domains/python.py:317
#, python-format
msgid "%s (in module %s)"
msgstr "%s (in module %s)"
-#: sphinx/directives/desc.py:439
+#: sphinx/domains/python.py:242
#, python-format
msgid "%s (built-in class)"
msgstr "%s (geïntegreerde klasse)"
-#: sphinx/directives/desc.py:440
+#: sphinx/domains/python.py:243
#, python-format
msgid "%s (class in %s)"
msgstr "%s (klasse in %s)"
-#: sphinx/directives/desc.py:480
+#: sphinx/domains/python.py:283
#, python-format
msgid "%s() (%s.%s method)"
msgstr "%s() (%s.%s methode)"
-#: sphinx/directives/desc.py:482
-#, python-format
-msgid "%s() (%s method)"
-msgstr "%s() (%s methode)"
-
-#: sphinx/directives/desc.py:492
+#: sphinx/domains/python.py:295
#, python-format
msgid "%s() (%s.%s static method)"
msgstr "%s() (%s.%s statische methode)"
-#: sphinx/directives/desc.py:495
+#: sphinx/domains/python.py:298
#, python-format
msgid "%s() (%s static method)"
msgstr "%s() (%s statische methode)"
-#: sphinx/directives/desc.py:518
+#: sphinx/domains/python.py:308
+#, fuzzy, python-format
+msgid "%s() (%s.%s class method)"
+msgstr "%s() (%s.%s methode)"
+
+#: sphinx/domains/python.py:311
+#, fuzzy, python-format
+msgid "%s() (%s class method)"
+msgstr "%s() (%s methode)"
+
+#: sphinx/domains/python.py:321
#, python-format
msgid "%s (%s.%s attribute)"
msgstr "%s (%s.%s attribuut)"
-#: sphinx/directives/desc.py:520
-#, python-format
-msgid "%s (%s attribute)"
-msgstr "%s (%s attribuut)"
+#: sphinx/domains/python.py:366
+msgid "Platforms: "
+msgstr "Platformen: "
-#: sphinx/directives/desc.py:609
+#: sphinx/domains/python.py:372
#, python-format
-msgid "%s (C function)"
-msgstr "%s (C-functie)"
+msgid "%s (module)"
+msgstr "%s (module)"
-#: sphinx/directives/desc.py:611
-#, python-format
-msgid "%s (C member)"
-msgstr "%s (C member)"
+#: sphinx/domains/python.py:429
+#, fuzzy
+msgid "Python Module Index"
+msgstr "Module-index"
-#: sphinx/directives/desc.py:613
-#, python-format
-msgid "%s (C macro)"
-msgstr "%s (C-macro)"
+#: sphinx/domains/python.py:430
+msgid "modules"
+msgstr "modules"
+
+#: sphinx/domains/python.py:475
+msgid "Deprecated"
+msgstr "Verouderd"
+
+#: sphinx/domains/python.py:500 sphinx/locale/__init__.py:162
+msgid "exception"
+msgstr "foutmelding"
-#: sphinx/directives/desc.py:615
+#: sphinx/domains/python.py:501
+msgid "method"
+msgstr ""
+
+#: sphinx/domains/python.py:502
+#, fuzzy, python-format
+msgid "class method"
+msgstr "%s() (%s methode)"
+
+#: sphinx/domains/python.py:503
+msgid "static method"
+msgstr "statische methode"
+
+#: sphinx/domains/python.py:505 sphinx/locale/__init__.py:158
+msgid "module"
+msgstr "module"
+
+#: sphinx/domains/rst.py:53
#, python-format
-msgid "%s (C type)"
-msgstr "%s (C type)"
+msgid "%s (directive)"
+msgstr ""
-#: sphinx/directives/desc.py:617
+#: sphinx/domains/rst.py:55
+#, fuzzy, python-format
+msgid "%s (role)"
+msgstr "%s (module)"
+
+#: sphinx/domains/rst.py:103
+msgid "directive"
+msgstr ""
+
+#: sphinx/domains/rst.py:104
+#, fuzzy
+msgid "role"
+msgstr "module"
+
+#: sphinx/domains/std.py:68 sphinx/domains/std.py:84
#, python-format
-msgid "%s (C variable)"
-msgstr "%s (C-variabele)"
+msgid "environment variable; %s"
+msgstr "omgevingsvariabele; %s"
-#: sphinx/directives/desc.py:665
+#: sphinx/domains/std.py:160
#, python-format
msgid "%scommand line option; %s"
msgstr "%sopdrachtregel optie; %s"
-#: sphinx/directives/other.py:140
-msgid "Platforms: "
-msgstr "Platformen: "
+#: sphinx/domains/std.py:328
+msgid "glossary term"
+msgstr ""
-#: sphinx/directives/other.py:146
-#, python-format
-msgid "%s (module)"
-msgstr "%s (module)"
+#: sphinx/domains/std.py:329
+msgid "grammar token"
+msgstr ""
-#: sphinx/directives/other.py:195
-msgid "Section author: "
-msgstr "Auteur van deze sectie: "
+#: sphinx/domains/std.py:330
+msgid "reference label"
+msgstr ""
-#: sphinx/directives/other.py:197
-msgid "Module author: "
-msgstr "Auteur van deze module: "
+#: sphinx/domains/std.py:331
+msgid "environment variable"
+msgstr "omgevingsvariabele"
-#: sphinx/directives/other.py:199
-msgid "Author: "
-msgstr "Auteur: "
+#: sphinx/domains/std.py:332
+msgid "program option"
+msgstr ""
-#: sphinx/directives/other.py:319
-msgid "See also"
-msgstr "Zie ook"
+#: sphinx/domains/std.py:360 sphinx/themes/basic/genindex-single.html:11
+#: sphinx/themes/basic/genindex-split.html:11
+#: sphinx/themes/basic/genindex-split.html:14
+#: sphinx/themes/basic/genindex.html:11 sphinx/themes/basic/genindex.html:14
+#: sphinx/themes/basic/genindex.html:50 sphinx/themes/basic/layout.html:125
+#: sphinx/writers/latex.py:173
+msgid "Index"
+msgstr "Index"
+
+#: sphinx/domains/std.py:361
+msgid "Module Index"
+msgstr "Module-index"
+
+#: sphinx/domains/std.py:362 sphinx/themes/basic/defindex.html:25
+msgid "Search Page"
+msgstr "Zoekpagina"
-#: sphinx/ext/autodoc.py:889
+#: sphinx/ext/autodoc.py:917
#, python-format
msgid " Bases: %s"
msgstr ""
-#: sphinx/ext/autodoc.py:922
+#: sphinx/ext/autodoc.py:950
#, python-format
msgid "alias of :class:`%s`"
msgstr ""
@@ -258,245 +395,259 @@ msgstr ""
msgid "Todo"
msgstr "Te doen"
-#: sphinx/ext/todo.py:99
+#: sphinx/ext/todo.py:109
#, python-format
-msgid "(The original entry is located in %s, line %d and can be found "
-msgstr "(Het originele item is te vinden in %s, regel %d en kan gevonden worden hier"
+msgid "(The <<original entry>> is located in %s, line %d.)"
+msgstr "(Het <<originele item>> is te vinden in %s, regel %d.)"
-#: sphinx/ext/todo.py:105
-msgid "here"
-msgstr "hier"
+#: sphinx/ext/todo.py:117
+msgid "original entry"
+msgstr "originele item"
+
+#: sphinx/ext/viewcode.py:66
+msgid "[source]"
+msgstr ""
+
+#: sphinx/ext/viewcode.py:109
+msgid "[docs]"
+msgstr ""
+
+#: sphinx/ext/viewcode.py:123
+#, fuzzy
+msgid "Module code"
+msgstr "module"
+
+#: sphinx/ext/viewcode.py:129
+#, python-format
+msgid "<h1>Source code for %s</h1>"
+msgstr ""
-#: sphinx/locale/__init__.py:15
+#: sphinx/ext/viewcode.py:156
+msgid "Overview: module code"
+msgstr ""
+
+#: sphinx/ext/viewcode.py:157
+msgid "<h1>All modules for which code is available</h1>"
+msgstr ""
+
+#: sphinx/locale/__init__.py:139
msgid "Attention"
msgstr "Let op!"
-#: sphinx/locale/__init__.py:16
+#: sphinx/locale/__init__.py:140
msgid "Caution"
msgstr "Pas op!"
-#: sphinx/locale/__init__.py:17
+#: sphinx/locale/__init__.py:141
msgid "Danger"
msgstr "Gevaar"
-#: sphinx/locale/__init__.py:18
+#: sphinx/locale/__init__.py:142
msgid "Error"
msgstr "Fout"
-#: sphinx/locale/__init__.py:19
+#: sphinx/locale/__init__.py:143
msgid "Hint"
msgstr "Hint"
-#: sphinx/locale/__init__.py:20
+#: sphinx/locale/__init__.py:144
msgid "Important"
msgstr "Belangrijk"
-#: sphinx/locale/__init__.py:21
+#: sphinx/locale/__init__.py:145
msgid "Note"
msgstr "Notitie"
-#: sphinx/locale/__init__.py:22
+#: sphinx/locale/__init__.py:146
msgid "See Also"
msgstr "Zie ook"
-#: sphinx/locale/__init__.py:23
+#: sphinx/locale/__init__.py:147
msgid "Tip"
msgstr "Tip"
-#: sphinx/locale/__init__.py:24
+#: sphinx/locale/__init__.py:148
msgid "Warning"
msgstr "Waarschuwing"
-#: sphinx/locale/__init__.py:28
+#: sphinx/locale/__init__.py:152
#, python-format
msgid "New in version %s"
msgstr "Nieuw in versie %s"
-#: sphinx/locale/__init__.py:29
+#: sphinx/locale/__init__.py:153
#, python-format
msgid "Changed in version %s"
msgstr "Veranderd in versie %s"
-#: sphinx/locale/__init__.py:30
+#: sphinx/locale/__init__.py:154
#, python-format
msgid "Deprecated since version %s"
msgstr "Verouderd sinds versie %s"
-#: sphinx/locale/__init__.py:34
-msgid "module"
-msgstr "module"
-
-#: sphinx/locale/__init__.py:35
+#: sphinx/locale/__init__.py:159
msgid "keyword"
msgstr "trefwoord"
-#: sphinx/locale/__init__.py:36
+#: sphinx/locale/__init__.py:160
msgid "operator"
msgstr "operator"
-#: sphinx/locale/__init__.py:37
+#: sphinx/locale/__init__.py:161
msgid "object"
msgstr "object"
-#: sphinx/locale/__init__.py:38
-msgid "exception"
-msgstr "foutmelding"
-
-#: sphinx/locale/__init__.py:39
+#: sphinx/locale/__init__.py:163
msgid "statement"
msgstr "statement"
-#: sphinx/locale/__init__.py:40
+#: sphinx/locale/__init__.py:164
msgid "built-in function"
msgstr "geïntegreerde functie"
-#: sphinx/themes/basic/defindex.html:2
+#: sphinx/themes/agogo/layout.html:45 sphinx/themes/basic/globaltoc.html:10
+#: sphinx/themes/basic/localtoc.html:11
+msgid "Table Of Contents"
+msgstr "Inhoudsopgave"
+
+#: sphinx/themes/agogo/layout.html:49 sphinx/themes/basic/layout.html:128
+#: sphinx/themes/basic/search.html:11 sphinx/themes/basic/search.html:14
+msgid "Search"
+msgstr "Zoeken"
+
+#: sphinx/themes/agogo/layout.html:52 sphinx/themes/basic/searchbox.html:15
+msgid "Go"
+msgstr "Ga"
+
+#: sphinx/themes/agogo/layout.html:57 sphinx/themes/basic/searchbox.html:20
+msgid "Enter search terms or a module, class or function name."
+msgstr "Geef zoekterm of de naam van een module, klasse of functie."
+
+#: sphinx/themes/agogo/layout.html:78 sphinx/themes/basic/sourcelink.html:14
+msgid "Show Source"
+msgstr "Broncode weergeven"
+
+#: sphinx/themes/basic/defindex.html:11
msgid "Overview"
msgstr "Overzicht"
-#: sphinx/themes/basic/defindex.html:11
+#: sphinx/themes/basic/defindex.html:20
msgid "Indices and tables:"
msgstr "Indices en tabellen:"
-#: sphinx/themes/basic/defindex.html:14
+#: sphinx/themes/basic/defindex.html:23
msgid "Complete Table of Contents"
msgstr "Volledige inhoudsopgave"
-#: sphinx/themes/basic/defindex.html:15
+#: sphinx/themes/basic/defindex.html:24
msgid "lists all sections and subsections"
msgstr "geeft alle secties en subsecties weer"
-#: sphinx/themes/basic/defindex.html:17
+#: sphinx/themes/basic/defindex.html:26
msgid "search this documentation"
msgstr "zoeken in deze documentatie"
-#: sphinx/themes/basic/defindex.html:20
+#: sphinx/themes/basic/defindex.html:28
+msgid "Global Module Index"
+msgstr "Globale Module-index"
+
+#: sphinx/themes/basic/defindex.html:29
msgid "quick access to all modules"
msgstr "sneltoegang naar alle modules"
-#: sphinx/themes/basic/defindex.html:22
+#: sphinx/themes/basic/defindex.html:31
msgid "all functions, classes, terms"
msgstr "alle functies, klasses en begrippen"
-#: sphinx/themes/basic/genindex-single.html:5
+#: sphinx/themes/basic/genindex-single.html:14
#, python-format
msgid "Index &ndash; %(key)s"
msgstr "Index &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
+#: sphinx/themes/basic/genindex-single.html:46
+#: sphinx/themes/basic/genindex-split.html:24
+#: sphinx/themes/basic/genindex-split.html:38
+#: sphinx/themes/basic/genindex.html:56
msgid "Full index on one page"
msgstr "Volledige index op een pagina"
-#: sphinx/themes/basic/genindex-split.html:7
+#: sphinx/themes/basic/genindex-split.html:16
msgid "Index pages by letter"
msgstr "Index pagineerd per letter"
-#: sphinx/themes/basic/genindex-split.html:15
+#: sphinx/themes/basic/genindex-split.html:25
msgid "can be huge"
msgstr "kan heel groot zijn"
-#: sphinx/themes/basic/layout.html:10
+#: sphinx/themes/basic/layout.html:23
msgid "Navigation"
msgstr "Navigatie"
-#: sphinx/themes/basic/layout.html:42
-msgid "Table Of Contents"
-msgstr "Inhoudsopgave"
-
-#: sphinx/themes/basic/layout.html:48
-msgid "Previous topic"
-msgstr "Vorig onderwerp"
-
-#: sphinx/themes/basic/layout.html:50
-msgid "previous chapter"
-msgstr "Vorig hoofdstuk"
-
-#: sphinx/themes/basic/layout.html:53
-msgid "Next topic"
-msgstr "Volgend onderwerp"
-
-#: sphinx/themes/basic/layout.html:55
-msgid "next chapter"
-msgstr "volgend hoofdstuk"
-
-#: sphinx/themes/basic/layout.html:60
-msgid "This Page"
-msgstr "Deze pagina"
-
-#: sphinx/themes/basic/layout.html:63
-msgid "Show Source"
-msgstr "Broncode weergeven"
-
-#: sphinx/themes/basic/layout.html:73
-msgid "Quick search"
-msgstr "Snel zoeken"
-
-#: sphinx/themes/basic/layout.html:76
-msgid "Go"
-msgstr "Ga"
-
-#: sphinx/themes/basic/layout.html:81
-msgid "Enter search terms or a module, class or function name."
-msgstr "Geef zoekterm of de naam van een module, klasse of functie."
-
-#: sphinx/themes/basic/layout.html:122
+#: sphinx/themes/basic/layout.html:113
#, python-format
msgid "Search within %(docstitle)s"
msgstr "Zoeken in %(docstitle)s"
-#: sphinx/themes/basic/layout.html:131
+#: sphinx/themes/basic/layout.html:122
msgid "About these documents"
msgstr "Over deze documenten"
-#: sphinx/themes/basic/layout.html:137
-#: sphinx/themes/basic/search.html:2
-#: sphinx/themes/basic/search.html:5
-msgid "Search"
-msgstr "Zoeken"
-
-#: sphinx/themes/basic/layout.html:140
+#: sphinx/themes/basic/layout.html:131
msgid "Copyright"
msgstr "Copyright"
-#: sphinx/themes/basic/layout.html:187
+#: sphinx/themes/basic/layout.html:180
#, 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:189
+#: sphinx/themes/basic/layout.html:182
#, python-format
msgid "&copy; Copyright %(copyright)s."
msgstr "&copy; Copyright %(copyright)s."
-#: sphinx/themes/basic/layout.html:193
+#: sphinx/themes/basic/layout.html:186
#, python-format
msgid "Last updated on %(last_updated)s."
msgstr "Laatste aanpassing op %(last_updated)s."
-#: sphinx/themes/basic/layout.html:196
+#: sphinx/themes/basic/layout.html:189
#, python-format
-msgid "Created using <a href=\"http://sphinx.pocoo.org/\">Sphinx</a> %(sphinx_version)s."
-msgstr "Aangemaakt met <a href=\"http://sphinx.pocoo.org/\">Sphinx</a> %(sphinx_version)s."
-
-#: sphinx/themes/basic/modindex.html:36
-msgid "Deprecated"
-msgstr "Verouderd"
+msgid ""
+"Created using <a href=\"http://sphinx.pocoo.org/\">Sphinx</a> "
+"%(sphinx_version)s."
+msgstr ""
+"Aangemaakt met <a href=\"http://sphinx.pocoo.org/\">Sphinx</a> "
+"%(sphinx_version)s."
#: sphinx/themes/basic/opensearch.xml:4
#, python-format
msgid "Search %(docstitle)s"
msgstr "Zoeken %(docstitle)s"
-#: sphinx/themes/basic/search.html:9
+#: sphinx/themes/basic/relations.html:11
+msgid "Previous topic"
+msgstr "Vorig onderwerp"
+
+#: sphinx/themes/basic/relations.html:13
+msgid "previous chapter"
+msgstr "Vorig hoofdstuk"
+
+#: sphinx/themes/basic/relations.html:16
+msgid "Next topic"
+msgstr "Volgend onderwerp"
+
+#: sphinx/themes/basic/relations.html:18
+msgid "next chapter"
+msgstr "volgend hoofdstuk"
+
+#: sphinx/themes/basic/search.html:18
msgid ""
"Please activate JavaScript to enable the search\n"
" functionality."
msgstr "Activeer JavaSscript om de zoekfunctionaliteit in te schakelen."
-#: sphinx/themes/basic/search.html:14
+#: sphinx/themes/basic/search.html:23
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"
@@ -504,23 +655,33 @@ msgid ""
" containing fewer words won't appear in the result list."
msgstr ""
"Hier kan u de documenten doorzoeken. Geef enkele trefwoorden\n"
-" in het veld hieronder en klik \"zoeken\". Merk op dat de zoekfunctie\n"
-" steeds naar alle woorden zoekt. Pagina's die minder woorden bevatten\n"
+" in het veld hieronder en klik \"zoeken\". Merk op dat de zoekfunctie"
+"\n"
+" steeds naar alle woorden zoekt. Pagina's die minder woorden bevatten"
+"\n"
" zullen niet tussen de resultaten verschijnen."
-#: sphinx/themes/basic/search.html:21
+#: sphinx/themes/basic/search.html:30
msgid "search"
msgstr "zoeken"
-#: sphinx/themes/basic/search.html:25
-#: sphinx/themes/basic/static/searchtools.js:462
+#: sphinx/themes/basic/search.html:34
+#: sphinx/themes/basic/static/searchtools.js:489
msgid "Search Results"
msgstr "Zoekresultaten"
-#: sphinx/themes/basic/search.html:27
+#: sphinx/themes/basic/search.html:36
msgid "Your search did not match any results."
msgstr "Uw zoekopdracht leverde geen resultaten op."
+#: sphinx/themes/basic/searchbox.html:12
+msgid "Quick search"
+msgstr "Snel zoeken"
+
+#: sphinx/themes/basic/sourcelink.html:11
+msgid "This Page"
+msgstr "Deze pagina"
+
#: sphinx/themes/basic/changes/frameset.html:5
#: sphinx/themes/basic/changes/versionchanges.html:12
#, python-format
@@ -549,68 +710,86 @@ msgstr "Veranderingen in de C-API"
msgid "Other changes"
msgstr "Andere veranderingen"
-#: sphinx/themes/basic/static/doctools.js:139
-#: sphinx/writers/html.py:473
-#: sphinx/writers/html.py:478
+#: sphinx/themes/basic/static/doctools.js:154 sphinx/writers/html.py:482
+#: sphinx/writers/html.py:487
msgid "Permalink to this headline"
msgstr "Permanente link naar deze titel"
-#: sphinx/themes/basic/static/doctools.js:145
-#: sphinx/writers/html.py:80
+#: sphinx/themes/basic/static/doctools.js:160 sphinx/writers/html.py:87
msgid "Permalink to this definition"
msgstr "Permanente link naar deze definitie"
-#: sphinx/themes/basic/static/doctools.js:174
+#: sphinx/themes/basic/static/doctools.js:189
msgid "Hide Search Matches"
msgstr "Zoekresultaten verbergen"
-#: sphinx/themes/basic/static/searchtools.js:274
+#: sphinx/themes/basic/static/searchtools.js:285
msgid "Searching"
msgstr "Zoeken"
-#: sphinx/themes/basic/static/searchtools.js:279
+#: sphinx/themes/basic/static/searchtools.js:290
msgid "Preparing search..."
msgstr "Het zoeken wordt voorbereid..."
-#: sphinx/themes/basic/static/searchtools.js:347
-msgid "module, in "
-msgstr "module, in"
-
-#: sphinx/themes/basic/static/searchtools.js:356
+#: sphinx/themes/basic/static/searchtools.js:364
msgid ", in "
msgstr ", in "
-#: 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 "Uw zoekopdracht leverde geen resultaten op. Controleer of alle woorden correct gespeld zijn en dat u genoeg categoriën hebt geselecteerd."
+#: sphinx/themes/basic/static/searchtools.js:491
+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 ""
+"Uw zoekopdracht leverde geen resultaten op. Controleer of alle woorden "
+"correct gespeld zijn en dat u genoeg categoriën hebt geselecteerd."
-#: sphinx/themes/basic/static/searchtools.js:466
+#: sphinx/themes/basic/static/searchtools.js:493
#, python-format
msgid "Search finished, found %s page(s) matching the search query."
msgstr "Zoeken voltooid, %s pagina(s) gevonden."
-#: sphinx/writers/latex.py:187
+#: sphinx/themes/default/static/sidebar.js:66
+msgid "Expand sidebar"
+msgstr ""
+
+#: sphinx/themes/default/static/sidebar.js:79
+#: sphinx/themes/default/static/sidebar.js:106
+msgid "Collapse sidebar"
+msgstr ""
+
+#: sphinx/themes/haiku/layout.html:26
+msgid "Contents"
+msgstr ""
+
+#: sphinx/writers/latex.py:171
msgid "Release"
msgstr "Release"
-#: sphinx/writers/latex.py:578
+#: sphinx/writers/latex.py:572 sphinx/writers/manpage.py:178
msgid "Footnotes"
msgstr "Voetnoten"
-#: sphinx/writers/latex.py:646
+#: sphinx/writers/latex.py:641
msgid "continued from previous page"
msgstr "Vervolgd van vorige pagina"
-#: sphinx/writers/latex.py:651
+#: sphinx/writers/latex.py:646
msgid "Continued on next page"
msgstr "Vervolgd op volgende pagina"
-#: sphinx/writers/text.py:166
-#, python-format
-msgid "Platform: %s"
-msgstr "Platform: %s"
-
-#: sphinx/writers/text.py:428
+#: sphinx/writers/text.py:422
msgid "[image]"
msgstr "[afbeelding]"
+#~ msgid "Parameter"
+#~ msgstr "Parameter"
+
+#~ msgid "here"
+#~ msgstr "hier"
+
+#~ msgid "module, in "
+#~ msgstr "module, in"
+
+#~ msgid "Platform: %s"
+#~ msgstr "Platform: %s"
+
diff --git a/sphinx/locale/pl/LC_MESSAGES/sphinx.js b/sphinx/locale/pl/LC_MESSAGES/sphinx.js
index 2b7b66e0d..5823053fe 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": {"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 ": "", "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", "Hide Search Matches": "Ukryj 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 ", "Expand sidebar": "", "Permalink to this headline": "Sta\u0142y odno\u015bnik do tego nag\u0142\u00f3wka", "Searching": "Wyszukiwanie", "Collapse sidebar": "", "Permalink to this definition": "Sta\u0142y odno\u015bnik do tej definicji", "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 56ecb26f4..3c6105cdb 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 350280b33..6044e8eef 100644
--- a/sphinx/locale/pl/LC_MESSAGES/sphinx.po
+++ b/sphinx/locale/pl/LC_MESSAGES/sphinx.po
@@ -4,7 +4,7 @@ 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: 2010-05-24 23:54+0200\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 && "
@@ -14,455 +14,604 @@ 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:106 sphinx/writers/latex.py:184
+#: sphinx/writers/manpage.py:67
#, python-format
msgid "%B %d, %Y"
msgstr "%B %d %Y"
-#: 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
-msgid "Index"
-msgstr "Indeks"
-
-#: sphinx/environment.py:325 sphinx/writers/latex.py:187
-msgid "Module Index"
-msgstr "Indeks modułów"
-
-#: sphinx/environment.py:326 sphinx/themes/basic/defindex.html:16
-msgid "Search Page"
-msgstr "Wyszukiwanie"
-
-#: sphinx/roles.py:55 sphinx/directives/desc.py:747
-#, python-format
-msgid "environment variable; %s"
-msgstr "zmienna środowiskowa; %s"
-
-#: sphinx/roles.py:62
+#: sphinx/roles.py:174
#, python-format
msgid "Python Enhancement Proposals!PEP %s"
msgstr "Python Enhancement Proposals!PEP %s"
-#: sphinx/builders/changes.py:71
+#: sphinx/builders/changes.py:72
msgid "Builtins"
msgstr "Wbudowane"
-#: sphinx/builders/changes.py:73
+#: sphinx/builders/changes.py:74
msgid "Module level"
msgstr "Poziom modułu"
-#: sphinx/builders/html.py:205
+#: sphinx/builders/html.py:266
#, 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:285 sphinx/themes/basic/defindex.html:30
msgid "General Index"
msgstr "Indeks ogólny"
-#: sphinx/builders/html.py:224
+#: sphinx/builders/html.py:285
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
-msgid "Global Module Index"
-msgstr "Indeks modułów"
-
-#: sphinx/builders/html.py:227
-msgid "modules"
-msgstr "moduły"
-
-#: sphinx/builders/html.py:281
+#: sphinx/builders/html.py:345
msgid "next"
msgstr "dalej"
-#: sphinx/builders/html.py:290
+#: sphinx/builders/html.py:354
msgid "previous"
msgstr "wstecz"
-#: sphinx/builders/latex.py:162
+#: sphinx/builders/latex.py:151
msgid " (in "
-msgstr ""
+msgstr " (w "
-#: sphinx/directives/desc.py:97
-msgid "Raises"
-msgstr "Wyrzuca"
+#: sphinx/directives/other.py:127
+msgid "Section author: "
+msgstr "Autor rozdziału: "
-#: sphinx/directives/desc.py:101
-msgid "Variable"
-msgstr "Zmienna"
+#: sphinx/directives/other.py:129
+msgid "Module author: "
+msgstr "Autor modułu: "
+
+#: sphinx/directives/other.py:131
+#, fuzzy
+msgid "Code author: "
+msgstr "Autor modułu: "
-#: sphinx/directives/desc.py:104
+#: sphinx/directives/other.py:133
+msgid "Author: "
+msgstr "Autor: "
+
+#: sphinx/directives/other.py:238
+msgid "See also"
+msgstr "Zobacz także"
+
+#: sphinx/domains/__init__.py:253
+#, python-format
+msgid "%s %s"
+msgstr ""
+
+#: sphinx/domains/c.py:51 sphinx/domains/python.py:49
+msgid "Parameters"
+msgstr "Parametry"
+
+#: sphinx/domains/c.py:54 sphinx/domains/javascript.py:137
+#: sphinx/domains/python.py:59
msgid "Returns"
msgstr "Zwraca"
-#: sphinx/directives/desc.py:113
+#: sphinx/domains/c.py:56 sphinx/domains/python.py:61
msgid "Return type"
msgstr "Typ zwracany"
-#: sphinx/directives/desc.py:186
+#: sphinx/domains/c.py:133
+#, python-format
+msgid "%s (C function)"
+msgstr "%s (funkcja C)"
+
+#: sphinx/domains/c.py:135
+#, python-format
+msgid "%s (C member)"
+msgstr "%s (pole C)"
+
+#: sphinx/domains/c.py:137
+#, python-format
+msgid "%s (C macro)"
+msgstr "%s (makro C)"
+
+#: sphinx/domains/c.py:139
+#, python-format
+msgid "%s (C type)"
+msgstr "%s (typ C)"
+
+#: sphinx/domains/c.py:141
+#, python-format
+msgid "%s (C variable)"
+msgstr "%s (zmienna C)"
+
+#: sphinx/domains/c.py:171 sphinx/domains/cpp.py:1031
+#: sphinx/domains/javascript.py:166 sphinx/domains/python.py:497
+msgid "function"
+msgstr "funkcja"
+
+#: sphinx/domains/c.py:172 sphinx/domains/cpp.py:1032
+msgid "member"
+msgstr "pole"
+
+#: sphinx/domains/c.py:173
+msgid "macro"
+msgstr ""
+
+#: sphinx/domains/c.py:174 sphinx/domains/cpp.py:1033
+msgid "type"
+msgstr "typ"
+
+#: sphinx/domains/c.py:175
#, fuzzy
-msgid "Parameter"
-msgstr "Parametry"
+msgid "variable"
+msgstr "Zmienna"
-#: sphinx/directives/desc.py:190
-msgid "Parameters"
-msgstr "Parametry"
+#: sphinx/domains/cpp.py:876
+#, python-format
+msgid "%s (C++ class)"
+msgstr "%s (klasie C++)"
+
+#: sphinx/domains/cpp.py:891
+#, python-format
+msgid "%s (C++ type)"
+msgstr "%s (typ C++)"
+
+#: sphinx/domains/cpp.py:910
+#, python-format
+msgid "%s (C++ member)"
+msgstr "%s (pole C++)"
+
+#: sphinx/domains/cpp.py:962
+#, python-format
+msgid "%s (C++ function)"
+msgstr "%s (funkcja C++)"
+
+#: sphinx/domains/cpp.py:1030 sphinx/domains/python.py:499
+msgid "class"
+msgstr "klasie"
-#: sphinx/directives/desc.py:418
+#: sphinx/domains/javascript.py:117 sphinx/domains/python.py:221
#, python-format
msgid "%s() (built-in function)"
msgstr "%s() (funkcja wbudowana)"
-#: sphinx/directives/desc.py:419 sphinx/directives/desc.py:476
-#: sphinx/directives/desc.py:488
+#: sphinx/domains/javascript.py:118 sphinx/domains/python.py:285
+#, python-format
+msgid "%s() (%s method)"
+msgstr "%s() (%s metoda)"
+
+#: sphinx/domains/javascript.py:120
+#, python-format
+msgid "%s (global variable or constant)"
+msgstr ""
+
+#: sphinx/domains/javascript.py:122 sphinx/domains/python.py:323
+#, python-format
+msgid "%s (%s attribute)"
+msgstr "%s (%s atrybut)"
+
+#: sphinx/domains/javascript.py:131
+#, fuzzy
+msgid "Arguments"
+msgstr "Parametry"
+
+#: sphinx/domains/javascript.py:134
+msgid "Throws"
+msgstr ""
+
+#: sphinx/domains/javascript.py:167 sphinx/domains/python.py:498
+msgid "data"
+msgstr ""
+
+#: sphinx/domains/javascript.py:168 sphinx/domains/python.py:504
+msgid "attribute"
+msgstr "atrybut"
+
+#: sphinx/domains/python.py:53
+#, fuzzy
+msgid "Variables"
+msgstr "Zmienna"
+
+#: sphinx/domains/python.py:56
+msgid "Raises"
+msgstr "Wyrzuca"
+
+#: sphinx/domains/python.py:222 sphinx/domains/python.py:279
+#: sphinx/domains/python.py:291 sphinx/domains/python.py:304
#, python-format
msgid "%s() (in module %s)"
msgstr "%s() (w module %s)"
-#: sphinx/directives/desc.py:422
+#: sphinx/domains/python.py:225
#, python-format
msgid "%s (built-in variable)"
msgstr "%s (zmienna wbudowana)"
-#: sphinx/directives/desc.py:423 sphinx/directives/desc.py:514
+#: sphinx/domains/python.py:226 sphinx/domains/python.py:317
#, python-format
msgid "%s (in module %s)"
msgstr "%s (w module %s)"
-#: sphinx/directives/desc.py:439
-#, fuzzy, python-format
+#: sphinx/domains/python.py:242
+#, python-format
msgid "%s (built-in class)"
-msgstr "%s (zmienna wbudowana)"
+msgstr "%s (klasa wbudowana)"
-#: sphinx/directives/desc.py:440
+#: sphinx/domains/python.py:243
#, python-format
msgid "%s (class in %s)"
msgstr "%s (w klasie %s)"
-#: sphinx/directives/desc.py:480
+#: sphinx/domains/python.py:283
#, python-format
msgid "%s() (%s.%s method)"
msgstr "%s() (%s.%s metoda)"
-#: sphinx/directives/desc.py:482
-#, python-format
-msgid "%s() (%s method)"
-msgstr "%s() (%s metoda)"
-
-#: sphinx/directives/desc.py:492
+#: sphinx/domains/python.py:295
#, python-format
msgid "%s() (%s.%s static method)"
msgstr "%s() (%s.%s statyczna metoda)"
-#: sphinx/directives/desc.py:495
+#: sphinx/domains/python.py:298
#, python-format
msgid "%s() (%s static method)"
msgstr "%s() (%s statyczna metoda)"
-#: sphinx/directives/desc.py:518
+#: sphinx/domains/python.py:308
+#, fuzzy, python-format
+msgid "%s() (%s.%s class method)"
+msgstr "%s() (%s.%s metoda)"
+
+#: sphinx/domains/python.py:311
+#, fuzzy, python-format
+msgid "%s() (%s class method)"
+msgstr "%s() (%s metoda)"
+
+#: sphinx/domains/python.py:321
#, python-format
msgid "%s (%s.%s attribute)"
msgstr "%s (%s.%s atrybut)"
-#: sphinx/directives/desc.py:520
-#, python-format
-msgid "%s (%s attribute)"
-msgstr "%s (%s atrybut)"
+#: sphinx/domains/python.py:366
+msgid "Platforms: "
+msgstr "Platformy: "
-#: sphinx/directives/desc.py:609
+#: sphinx/domains/python.py:372
#, python-format
-msgid "%s (C function)"
-msgstr "%s (funkcja C)"
+msgid "%s (module)"
+msgstr "%s (moduł)"
-#: sphinx/directives/desc.py:611
-#, python-format
-msgid "%s (C member)"
-msgstr "%s (pole C)"
+#: sphinx/domains/python.py:429
+#, fuzzy
+msgid "Python Module Index"
+msgstr "Indeks modułów"
-#: sphinx/directives/desc.py:613
-#, python-format
-msgid "%s (C macro)"
-msgstr "%s (makro C)"
+#: sphinx/domains/python.py:430
+msgid "modules"
+msgstr "moduły"
-#: sphinx/directives/desc.py:615
-#, python-format
-msgid "%s (C type)"
-msgstr "%s (typ C)"
+#: sphinx/domains/python.py:475
+msgid "Deprecated"
+msgstr "Niezalecane"
+
+#: sphinx/domains/python.py:500 sphinx/locale/__init__.py:162
+msgid "exception"
+msgstr "wyjątek"
+
+#: sphinx/domains/python.py:501
+msgid "method"
+msgstr ""
-#: sphinx/directives/desc.py:617
+#: sphinx/domains/python.py:502
+#, fuzzy, python-format
+msgid "class method"
+msgstr "%s() (%s metoda)"
+
+#: sphinx/domains/python.py:503
+msgid "static method"
+msgstr "statyczna metoda"
+
+#: sphinx/domains/python.py:505 sphinx/locale/__init__.py:158
+msgid "module"
+msgstr "moduł"
+
+#: sphinx/domains/rst.py:53
#, python-format
-msgid "%s (C variable)"
-msgstr "%s (zmienna C)"
+msgid "%s (directive)"
+msgstr ""
-#: sphinx/directives/desc.py:665
+#: sphinx/domains/rst.py:55
#, fuzzy, python-format
+msgid "%s (role)"
+msgstr "%s (moduł)"
+
+#: sphinx/domains/rst.py:103
+msgid "directive"
+msgstr ""
+
+#: sphinx/domains/rst.py:104
+#, fuzzy
+msgid "role"
+msgstr "moduł"
+
+#: sphinx/domains/std.py:68 sphinx/domains/std.py:84
+#, python-format
+msgid "environment variable; %s"
+msgstr "zmienna środowiskowa; %s"
+
+#: sphinx/domains/std.py:160
+#, python-format
msgid "%scommand line option; %s"
msgstr "%sopcja linii komend; %s"
-#: sphinx/directives/other.py:138
-msgid "Platforms: "
-msgstr "Platformy: "
+#: sphinx/domains/std.py:328
+msgid "glossary term"
+msgstr ""
-#: sphinx/directives/other.py:144
-#, python-format
-msgid "%s (module)"
-msgstr "%s (moduł)"
+#: sphinx/domains/std.py:329
+msgid "grammar token"
+msgstr ""
-#: sphinx/directives/other.py:193
-msgid "Section author: "
-msgstr "Autor rozdziału: "
+#: sphinx/domains/std.py:330
+msgid "reference label"
+msgstr ""
-#: sphinx/directives/other.py:195
-msgid "Module author: "
-msgstr "Autor modułu: "
+#: sphinx/domains/std.py:331
+msgid "environment variable"
+msgstr "zmienna środowiskowa"
-#: sphinx/directives/other.py:197
-msgid "Author: "
-msgstr "Autor: "
+#: sphinx/domains/std.py:332
+msgid "program option"
+msgstr ""
-#: sphinx/directives/other.py:317
-msgid "See also"
-msgstr "Zobacz także"
+#: sphinx/domains/std.py:360 sphinx/themes/basic/genindex-single.html:11
+#: sphinx/themes/basic/genindex-split.html:11
+#: sphinx/themes/basic/genindex-split.html:14
+#: sphinx/themes/basic/genindex.html:11 sphinx/themes/basic/genindex.html:14
+#: sphinx/themes/basic/genindex.html:50 sphinx/themes/basic/layout.html:125
+#: sphinx/writers/latex.py:173
+msgid "Index"
+msgstr "Indeks"
-#: sphinx/ext/autodoc.py:883
+#: sphinx/domains/std.py:361
+msgid "Module Index"
+msgstr "Indeks modułów"
+
+#: sphinx/domains/std.py:362 sphinx/themes/basic/defindex.html:25
+msgid "Search Page"
+msgstr "Wyszukiwanie"
+
+#: sphinx/ext/autodoc.py:917
#, python-format
msgid " Bases: %s"
-msgstr ""
+msgstr " Klasy bazowe: %s"
-#: sphinx/ext/autodoc.py:916
+#: sphinx/ext/autodoc.py:950
#, python-format
msgid "alias of :class:`%s`"
-msgstr ""
+msgstr "alias klasy :class:`%s`"
#: sphinx/ext/todo.py:41
msgid "Todo"
+msgstr "Do zrobienia"
+
+#: sphinx/ext/todo.py:109
+#, fuzzy, python-format
+msgid "(The <<original entry>> is located in %s, line %d.)"
+msgstr ""
+"(Oryginalny wpis znajduje się w pliku %s, w linii %d i może być "
+"odnaleziony "
+
+#: sphinx/ext/todo.py:117
+msgid "original entry"
+msgstr ""
+
+#: sphinx/ext/viewcode.py:66
+msgid "[source]"
+msgstr ""
+
+#: sphinx/ext/viewcode.py:109
+msgid "[docs]"
msgstr ""
-#: sphinx/ext/todo.py:99
+#: sphinx/ext/viewcode.py:123
+#, fuzzy
+msgid "Module code"
+msgstr "moduł"
+
+#: sphinx/ext/viewcode.py:129
#, python-format
-msgid "(The original entry is located in %s, line %d and can be found "
+msgid "<h1>Source code for %s</h1>"
+msgstr ""
+
+#: sphinx/ext/viewcode.py:156
+msgid "Overview: module code"
msgstr ""
-#: sphinx/ext/todo.py:105
-msgid "here"
+#: sphinx/ext/viewcode.py:157
+msgid "<h1>All modules for which code is available</h1>"
msgstr ""
-#: sphinx/locale/__init__.py:15
+#: sphinx/locale/__init__.py:139
msgid "Attention"
msgstr "Uwaga"
-#: sphinx/locale/__init__.py:16
+#: sphinx/locale/__init__.py:140
msgid "Caution"
msgstr "Ostrożnie"
-#: sphinx/locale/__init__.py:17
+#: sphinx/locale/__init__.py:141
msgid "Danger"
msgstr "Niebezpieczeństwo"
-#: sphinx/locale/__init__.py:18
+#: sphinx/locale/__init__.py:142
msgid "Error"
msgstr "Błąd"
-#: sphinx/locale/__init__.py:19
+#: sphinx/locale/__init__.py:143
msgid "Hint"
msgstr "Podpowiedź"
-#: sphinx/locale/__init__.py:20
+#: sphinx/locale/__init__.py:144
msgid "Important"
msgstr "Ważne"
-#: sphinx/locale/__init__.py:21
+#: sphinx/locale/__init__.py:145
msgid "Note"
msgstr "Uwaga"
-#: sphinx/locale/__init__.py:22
+#: sphinx/locale/__init__.py:146
msgid "See Also"
msgstr "Zobacz także"
-#: sphinx/locale/__init__.py:23
+#: sphinx/locale/__init__.py:147
msgid "Tip"
msgstr "Wskazówka"
-#: sphinx/locale/__init__.py:24
+#: sphinx/locale/__init__.py:148
msgid "Warning"
msgstr "Ostrzeżenie"
-#: sphinx/locale/__init__.py:28
+#: sphinx/locale/__init__.py:152
#, python-format
msgid "New in version %s"
msgstr "Nowe w wersji %s"
-#: sphinx/locale/__init__.py:29
+#: sphinx/locale/__init__.py:153
#, python-format
msgid "Changed in version %s"
msgstr "Zmienione w wersji %s"
-#: sphinx/locale/__init__.py:30
+#: sphinx/locale/__init__.py:154
#, python-format
msgid "Deprecated since version %s"
msgstr "Niezalecane od wersji %s"
-#: sphinx/locale/__init__.py:34
-msgid "module"
-msgstr "moduł"
-
-#: sphinx/locale/__init__.py:35
+#: sphinx/locale/__init__.py:159
msgid "keyword"
msgstr "słowo kluczowe"
-#: sphinx/locale/__init__.py:36
+#: sphinx/locale/__init__.py:160
msgid "operator"
msgstr "operator"
-#: sphinx/locale/__init__.py:37
+#: sphinx/locale/__init__.py:161
msgid "object"
msgstr "obiekt"
-#: sphinx/locale/__init__.py:38
-msgid "exception"
-msgstr "wyjątek"
-
-#: sphinx/locale/__init__.py:39
+#: sphinx/locale/__init__.py:163
msgid "statement"
msgstr "instrukcja"
-#: sphinx/locale/__init__.py:40
+#: sphinx/locale/__init__.py:164
msgid "built-in function"
msgstr "funkcja wbudowana"
-#: sphinx/themes/basic/defindex.html:2
+#: sphinx/themes/agogo/layout.html:45 sphinx/themes/basic/globaltoc.html:10
+#: sphinx/themes/basic/localtoc.html:11
+msgid "Table Of Contents"
+msgstr "Spis treści"
+
+#: sphinx/themes/agogo/layout.html:49 sphinx/themes/basic/layout.html:128
+#: sphinx/themes/basic/search.html:11 sphinx/themes/basic/search.html:14
+msgid "Search"
+msgstr "Szukaj"
+
+#: sphinx/themes/agogo/layout.html:52 sphinx/themes/basic/searchbox.html:15
+msgid "Go"
+msgstr "Szukaj"
+
+#: sphinx/themes/agogo/layout.html:57 sphinx/themes/basic/searchbox.html:20
+msgid "Enter search terms or a module, class or function name."
+msgstr "Wprowadź szukany termin lub nazwę modułu, klasy lub funkcji."
+
+#: sphinx/themes/agogo/layout.html:78 sphinx/themes/basic/sourcelink.html:14
+msgid "Show Source"
+msgstr "Pokaż źródło"
+
+#: sphinx/themes/basic/defindex.html:11
msgid "Overview"
msgstr "Przegląd"
-#: sphinx/themes/basic/defindex.html:11
+#: sphinx/themes/basic/defindex.html:20
msgid "Indices and tables:"
msgstr "Indeksy i tablice:"
-#: sphinx/themes/basic/defindex.html:14
+#: sphinx/themes/basic/defindex.html:23
msgid "Complete Table of Contents"
msgstr "Kompletny spis treści"
-#: sphinx/themes/basic/defindex.html:15
+#: sphinx/themes/basic/defindex.html:24
msgid "lists all sections and subsections"
msgstr "wymień wszystkie rozdziały i podrozdziały"
-#: sphinx/themes/basic/defindex.html:17
+#: sphinx/themes/basic/defindex.html:26
msgid "search this documentation"
msgstr "wyszukaj w dokumentacji"
-#: sphinx/themes/basic/defindex.html:20
+#: sphinx/themes/basic/defindex.html:28
+msgid "Global Module Index"
+msgstr "Indeks modułów"
+
+#: sphinx/themes/basic/defindex.html:29
msgid "quick access to all modules"
msgstr "szybki dostęp do wszystkich modułów"
-#: sphinx/themes/basic/defindex.html:22
+#: sphinx/themes/basic/defindex.html:31
msgid "all functions, classes, terms"
msgstr "wszystkie funkcje, klasy, terminy"
-#: sphinx/themes/basic/genindex-single.html:5
+#: sphinx/themes/basic/genindex-single.html:14
#, python-format
msgid "Index &ndash; %(key)s"
msgstr "Indeks &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
+#: sphinx/themes/basic/genindex-single.html:46
+#: sphinx/themes/basic/genindex-split.html:24
+#: sphinx/themes/basic/genindex-split.html:38
+#: sphinx/themes/basic/genindex.html:56
msgid "Full index on one page"
msgstr "Cały indeks na jednej stronie"
-#: sphinx/themes/basic/genindex-split.html:7
+#: sphinx/themes/basic/genindex-split.html:16
msgid "Index pages by letter"
msgstr "Strony indeksu alfabetycznie"
-#: sphinx/themes/basic/genindex-split.html:15
+#: sphinx/themes/basic/genindex-split.html:25
msgid "can be huge"
msgstr "może być ogromny"
-#: sphinx/themes/basic/layout.html:10
+#: sphinx/themes/basic/layout.html:23
msgid "Navigation"
msgstr "Nawigacja"
-#: sphinx/themes/basic/layout.html:42
-msgid "Table Of Contents"
-msgstr "Spis treści"
-
-#: sphinx/themes/basic/layout.html:48
-msgid "Previous topic"
-msgstr "Poprzedni temat"
-
-#: sphinx/themes/basic/layout.html:50
-msgid "previous chapter"
-msgstr "poprzedni rozdział"
-
-#: sphinx/themes/basic/layout.html:53
-msgid "Next topic"
-msgstr "Następny temat"
-
-#: sphinx/themes/basic/layout.html:55
-msgid "next chapter"
-msgstr "następny rozdział"
-
-#: sphinx/themes/basic/layout.html:60
-msgid "This Page"
-msgstr "Ta strona"
-
-#: sphinx/themes/basic/layout.html:63
-msgid "Show Source"
-msgstr "Pokaż źródło"
-
-#: sphinx/themes/basic/layout.html:73
-msgid "Quick search"
-msgstr "Szybkie wyszukiwanie"
-
-#: sphinx/themes/basic/layout.html:76
-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."
-
-#: sphinx/themes/basic/layout.html:119
+#: sphinx/themes/basic/layout.html:113
#, 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:122
msgid "About these documents"
msgstr "O tych dokumentach"
-#: sphinx/themes/basic/layout.html:134 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:131
msgid "Copyright"
msgstr "Copyright"
-#: sphinx/themes/basic/layout.html:183
+#: sphinx/themes/basic/layout.html:180
#, 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:182
#, python-format
msgid "&copy; Copyright %(copyright)s."
msgstr "&copy; Copyright %(copyright)s."
-#: sphinx/themes/basic/layout.html:188
+#: sphinx/themes/basic/layout.html:186
#, 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:189
#, python-format
msgid ""
"Created using <a href=\"http://sphinx.pocoo.org/\">Sphinx</a> "
@@ -471,23 +620,34 @@ msgstr ""
"Utworzone przy pomocy <a href=\"http://sphinx.pocoo.org/\">Sphinx</a>'a "
"%(sphinx_version)s."
-#: sphinx/themes/basic/modindex.html:36
-msgid "Deprecated"
-msgstr "Niezalecane"
-
#: sphinx/themes/basic/opensearch.xml:4
#, python-format
msgid "Search %(docstitle)s"
msgstr "Przeszukaj %(docstitle)s"
-#: sphinx/themes/basic/search.html:9
+#: sphinx/themes/basic/relations.html:11
+msgid "Previous topic"
+msgstr "Poprzedni temat"
+
+#: sphinx/themes/basic/relations.html:13
+msgid "previous chapter"
+msgstr "poprzedni rozdział"
+
+#: sphinx/themes/basic/relations.html:16
+msgid "Next topic"
+msgstr "Następny temat"
+
+#: sphinx/themes/basic/relations.html:18
+msgid "next chapter"
+msgstr "następny rozdział"
+
+#: sphinx/themes/basic/search.html:18
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
+#: sphinx/themes/basic/search.html:23
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,23 +656,32 @@ 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
+#: sphinx/themes/basic/search.html:30
msgid "search"
msgstr "Szukaj"
-#: sphinx/themes/basic/search.html:25
-#: sphinx/themes/basic/static/searchtools.js:453
+#: sphinx/themes/basic/search.html:34
+#: sphinx/themes/basic/static/searchtools.js:489
msgid "Search Results"
msgstr "Wyniki wyszukiwania"
-#: sphinx/themes/basic/search.html:27
+#: sphinx/themes/basic/search.html:36
msgid "Your search did not match any results."
msgstr "Nie znaleziono żadnych pasujących stron."
+#: sphinx/themes/basic/searchbox.html:12
+msgid "Quick search"
+msgstr "Szybkie wyszukiwanie"
+
+#: sphinx/themes/basic/sourcelink.html:11
+msgid "This Page"
+msgstr "Ta strona"
+
#: sphinx/themes/basic/changes/frameset.html:5
#: sphinx/themes/basic/changes/versionchanges.html:12
#, python-format
@@ -541,37 +710,32 @@ msgstr "Zmiany w C API"
msgid "Other changes"
msgstr "Inne zmiany"
-#: sphinx/themes/basic/static/doctools.js:139 sphinx/writers/html.py:473
-#: sphinx/writers/html.py:478
+#: sphinx/themes/basic/static/doctools.js:154 sphinx/writers/html.py:482
+#: sphinx/writers/html.py:487
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:160 sphinx/writers/html.py:87
msgid "Permalink to this definition"
msgstr "Stały odnośnik do tej definicji"
-#: sphinx/themes/basic/static/doctools.js:174
+#: sphinx/themes/basic/static/doctools.js:189
msgid "Hide Search Matches"
msgstr "Ukryj wyniki wyszukiwania"
-#: sphinx/themes/basic/static/searchtools.js:274
+#: sphinx/themes/basic/static/searchtools.js:285
msgid "Searching"
msgstr "Wyszukiwanie"
-#: sphinx/themes/basic/static/searchtools.js:279
+#: sphinx/themes/basic/static/searchtools.js:290
msgid "Preparing search..."
msgstr "Przygotowanie wyszukiwania..."
-#: sphinx/themes/basic/static/searchtools.js:338
-#, fuzzy
-msgid "module, in "
-msgstr "moduł"
-
-#: sphinx/themes/basic/static/searchtools.js:347
+#: sphinx/themes/basic/static/searchtools.js:364
msgid ", in "
-msgstr ""
+msgstr ", w "
-#: sphinx/themes/basic/static/searchtools.js:455
+#: sphinx/themes/basic/static/searchtools.js:491
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,34 +743,53 @@ 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:493
#, 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/themes/default/static/sidebar.js:66
+msgid "Expand sidebar"
+msgstr ""
+
+#: sphinx/themes/default/static/sidebar.js:79
+#: sphinx/themes/default/static/sidebar.js:106
+msgid "Collapse sidebar"
+msgstr ""
+
+#: sphinx/themes/haiku/layout.html:26
+msgid "Contents"
+msgstr ""
+
+#: sphinx/writers/latex.py:171
msgid "Release"
msgstr "Wydanie"
-#: sphinx/writers/latex.py:571
+#: sphinx/writers/latex.py:572 sphinx/writers/manpage.py:178
msgid "Footnotes"
-msgstr ""
+msgstr "Przypisy"
-#: sphinx/writers/latex.py:639
+#: sphinx/writers/latex.py:641
msgid "continued from previous page"
-msgstr ""
+msgstr "kontynuacja poprzedniej strony"
-#: sphinx/writers/latex.py:644
-#, fuzzy
+#: sphinx/writers/latex.py:646
msgid "Continued on next page"
-msgstr "Cały indeks na jednej stronie"
-
-#: sphinx/writers/text.py:166
-#, python-format
-msgid "Platform: %s"
-msgstr "Platforma: %s"
+msgstr "Kontynuacja na następnej stronie"
-#: sphinx/writers/text.py:428
+#: sphinx/writers/text.py:422
msgid "[image]"
msgstr "[obrazek]"
+#~ msgid "Parameter"
+#~ msgstr "Parametr"
+
+#~ msgid "here"
+#~ msgstr "tutaj"
+
+#~ msgid "module, in "
+#~ msgstr "moduł, w "
+
+#~ msgid "Platform: %s"
+#~ msgstr "Platforma: %s"
+
diff --git a/sphinx/locale/pt_BR/LC_MESSAGES/sphinx.js b/sphinx/locale/pt_BR/LC_MESSAGES/sphinx.js
index 228dd96ea..dbfaab85f 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": {"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
+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 ", "Expand sidebar": "", "Permalink to this headline": "Link permanente para este t\u00edtulo", "Searching": "Pesquisando", "Collapse sidebar": "", "Permalink to this definition": "Link permanente para esta defini\u00e7\u00e3o", "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 5b8901f5d..b644a1145 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 1d63841f0..44e2053a1 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: 2010-05-24 23:54+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,228 +17,377 @@ 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:106 sphinx/writers/latex.py:184
+#: sphinx/writers/manpage.py:67
#, python-format
msgid "%B %d, %Y"
msgstr "%d/%m/%Y"
-#: 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
-msgid "Index"
-msgstr "Índice"
-
-#: sphinx/environment.py:325 sphinx/writers/latex.py:187
-msgid "Module Index"
-msgstr "Índice do Módulo"
-
-#: sphinx/environment.py:326 sphinx/themes/basic/defindex.html:16
-msgid "Search Page"
-msgstr "Página de Pesquisa"
-
-#: sphinx/roles.py:55 sphinx/directives/desc.py:747
-#, python-format
-msgid "environment variable; %s"
-msgstr "váriavel de ambiente; %s"
-
-#: sphinx/roles.py:62
+#: sphinx/roles.py:174
#, python-format
msgid "Python Enhancement Proposals!PEP %s"
msgstr "Python Enhancement Proposals!PEP %s"
-#: sphinx/builders/changes.py:71
+#: sphinx/builders/changes.py:72
msgid "Builtins"
msgstr "Internos"
-#: sphinx/builders/changes.py:73
+#: sphinx/builders/changes.py:74
msgid "Module level"
msgstr "Módulo"
-#: sphinx/builders/html.py:205
+#: sphinx/builders/html.py:266
#, 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:285 sphinx/themes/basic/defindex.html:30
msgid "General Index"
msgstr "Índice Geral"
-#: sphinx/builders/html.py:224
+#: sphinx/builders/html.py:285
msgid "index"
msgstr "índice"
-#: 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
-msgid "Global Module Index"
-msgstr "Índice Global de Módulos"
-
-#: sphinx/builders/html.py:227
-msgid "modules"
-msgstr "módulos"
-
-#: sphinx/builders/html.py:281
+#: sphinx/builders/html.py:345
msgid "next"
msgstr "próximo"
-#: sphinx/builders/html.py:290
+#: sphinx/builders/html.py:354
msgid "previous"
msgstr "anterior"
-#: sphinx/builders/latex.py:162
+#: sphinx/builders/latex.py:151
msgid " (in "
msgstr " (em "
-#: sphinx/directives/desc.py:97
-msgid "Raises"
-msgstr "Levanta"
+#: sphinx/directives/other.py:127
+msgid "Section author: "
+msgstr "Autor da seção: "
-#: sphinx/directives/desc.py:101
-msgid "Variable"
-msgstr "Variável"
+#: sphinx/directives/other.py:129
+msgid "Module author: "
+msgstr "Autor do módulo: "
+
+#: sphinx/directives/other.py:131
+#, fuzzy
+msgid "Code author: "
+msgstr "Autor do módulo: "
-#: sphinx/directives/desc.py:104
+#: sphinx/directives/other.py:133
+msgid "Author: "
+msgstr "Autor: "
+
+#: sphinx/directives/other.py:238
+msgid "See also"
+msgstr "Veja também"
+
+#: sphinx/domains/__init__.py:253
+#, python-format
+msgid "%s %s"
+msgstr ""
+
+#: sphinx/domains/c.py:51 sphinx/domains/python.py:49
+msgid "Parameters"
+msgstr "Parâmetros"
+
+#: sphinx/domains/c.py:54 sphinx/domains/javascript.py:137
+#: sphinx/domains/python.py:59
msgid "Returns"
msgstr "Retorna"
-#: sphinx/directives/desc.py:113
+#: sphinx/domains/c.py:56 sphinx/domains/python.py:61
msgid "Return type"
msgstr "Tipo de retorno"
-#: sphinx/directives/desc.py:186
+#: sphinx/domains/c.py:133
+#, python-format
+msgid "%s (C function)"
+msgstr "%s (função C)"
+
+#: sphinx/domains/c.py:135
+#, python-format
+msgid "%s (C member)"
+msgstr "%s (membro C)"
+
+#: sphinx/domains/c.py:137
+#, python-format
+msgid "%s (C macro)"
+msgstr "%s (macro C)"
+
+#: sphinx/domains/c.py:139
+#, python-format
+msgid "%s (C type)"
+msgstr "%s (tipo C)"
+
+#: sphinx/domains/c.py:141
+#, python-format
+msgid "%s (C variable)"
+msgstr "%s (variável C)"
+
+#: sphinx/domains/c.py:171 sphinx/domains/cpp.py:1031
+#: sphinx/domains/javascript.py:166 sphinx/domains/python.py:497
+msgid "function"
+msgstr "função"
+
+#: sphinx/domains/c.py:172 sphinx/domains/cpp.py:1032
+msgid "member"
+msgstr "membro"
+
+#: sphinx/domains/c.py:173
+msgid "macro"
+msgstr "macro"
+
+#: sphinx/domains/c.py:174 sphinx/domains/cpp.py:1033
+msgid "type"
+msgstr "tipo"
+
+#: sphinx/domains/c.py:175
#, fuzzy
-msgid "Parameter"
-msgstr "Parâmetros"
+msgid "variable"
+msgstr "Variável"
-#: sphinx/directives/desc.py:190
-msgid "Parameters"
-msgstr "Parâmetros"
+#: sphinx/domains/cpp.py:876
+#, python-format
+msgid "%s (C++ class)"
+msgstr "%s (classe C++)"
+
+#: sphinx/domains/cpp.py:891
+#, python-format
+msgid "%s (C++ type)"
+msgstr "%s (tipo C++)"
+
+#: sphinx/domains/cpp.py:910
+#, python-format
+msgid "%s (C++ member)"
+msgstr "%s (membro C++)"
-#: sphinx/directives/desc.py:418
+#: sphinx/domains/cpp.py:962
+#, python-format
+msgid "%s (C++ function)"
+msgstr "%s (função C++)"
+
+#: sphinx/domains/cpp.py:1030 sphinx/domains/python.py:499
+msgid "class"
+msgstr "classe"
+
+#: sphinx/domains/javascript.py:117 sphinx/domains/python.py:221
#, python-format
msgid "%s() (built-in function)"
msgstr "%s() (função interna)"
-#: sphinx/directives/desc.py:419 sphinx/directives/desc.py:476
-#: sphinx/directives/desc.py:488
+#: sphinx/domains/javascript.py:118 sphinx/domains/python.py:285
+#, python-format
+msgid "%s() (%s method)"
+msgstr "%s() (método %s)"
+
+#: sphinx/domains/javascript.py:120
+#, python-format
+msgid "%s (global variable or constant)"
+msgstr ""
+
+#: sphinx/domains/javascript.py:122 sphinx/domains/python.py:323
+#, python-format
+msgid "%s (%s attribute)"
+msgstr "%s (atributo %s)"
+
+#: sphinx/domains/javascript.py:131
+#, fuzzy
+msgid "Arguments"
+msgstr "Parâmetros"
+
+#: sphinx/domains/javascript.py:134
+msgid "Throws"
+msgstr ""
+
+#: sphinx/domains/javascript.py:167 sphinx/domains/python.py:498
+msgid "data"
+msgstr ""
+
+#: sphinx/domains/javascript.py:168 sphinx/domains/python.py:504
+msgid "attribute"
+msgstr "atributo"
+
+#: sphinx/domains/python.py:53
+#, fuzzy
+msgid "Variables"
+msgstr "Variável"
+
+#: sphinx/domains/python.py:56
+msgid "Raises"
+msgstr "Levanta"
+
+#: sphinx/domains/python.py:222 sphinx/domains/python.py:279
+#: sphinx/domains/python.py:291 sphinx/domains/python.py:304
#, python-format
msgid "%s() (in module %s)"
msgstr "%s() (no módulo %s)"
-#: sphinx/directives/desc.py:422
+#: sphinx/domains/python.py:225
#, python-format
msgid "%s (built-in variable)"
msgstr "%s (variável interna)"
-#: sphinx/directives/desc.py:423 sphinx/directives/desc.py:514
+#: sphinx/domains/python.py:226 sphinx/domains/python.py:317
#, python-format
msgid "%s (in module %s)"
msgstr "%s (no módulo %s)"
-#: sphinx/directives/desc.py:439
+#: sphinx/domains/python.py:242
#, python-format
msgid "%s (built-in class)"
msgstr "%s (classe interna)"
-#: sphinx/directives/desc.py:440
+#: sphinx/domains/python.py:243
#, python-format
msgid "%s (class in %s)"
msgstr "%s (classe em %s)"
-#: sphinx/directives/desc.py:480
+#: sphinx/domains/python.py:283
#, python-format
msgid "%s() (%s.%s method)"
msgstr "%s() (método %s.%s)"
-#: sphinx/directives/desc.py:482
-#, python-format
-msgid "%s() (%s method)"
-msgstr "%s() (método %s)"
-
-#: sphinx/directives/desc.py:492
+#: sphinx/domains/python.py:295
#, python-format
msgid "%s() (%s.%s static method)"
msgstr "%s() (método estático %s.%s)"
-#: sphinx/directives/desc.py:495
+#: sphinx/domains/python.py:298
#, python-format
msgid "%s() (%s static method)"
msgstr "%s() (método estático %s)"
-#: sphinx/directives/desc.py:518
+#: sphinx/domains/python.py:308
+#, fuzzy, python-format
+msgid "%s() (%s.%s class method)"
+msgstr "%s() (método %s.%s)"
+
+#: sphinx/domains/python.py:311
+#, fuzzy, python-format
+msgid "%s() (%s class method)"
+msgstr "%s() (método %s)"
+
+#: sphinx/domains/python.py:321
#, python-format
msgid "%s (%s.%s attribute)"
msgstr "%s (atributo %s.%s)"
-#: sphinx/directives/desc.py:520
-#, python-format
-msgid "%s (%s attribute)"
-msgstr "%s (atributo %s)"
+#: sphinx/domains/python.py:366
+msgid "Platforms: "
+msgstr "Plataformas: "
-#: sphinx/directives/desc.py:609
+#: sphinx/domains/python.py:372
#, python-format
-msgid "%s (C function)"
-msgstr "%s (função C)"
+msgid "%s (module)"
+msgstr "%s (módulo)"
-#: sphinx/directives/desc.py:611
-#, python-format
-msgid "%s (C member)"
-msgstr "%s (membro C)"
+#: sphinx/domains/python.py:429
+#, fuzzy
+msgid "Python Module Index"
+msgstr "Índice do Módulo"
-#: sphinx/directives/desc.py:613
-#, python-format
-msgid "%s (C macro)"
-msgstr "%s (macro C)"
+#: sphinx/domains/python.py:430
+msgid "modules"
+msgstr "módulos"
+
+#: sphinx/domains/python.py:475
+msgid "Deprecated"
+msgstr "Obsoleto"
+
+#: sphinx/domains/python.py:500 sphinx/locale/__init__.py:162
+msgid "exception"
+msgstr "exceção"
+
+#: sphinx/domains/python.py:501
+msgid "method"
+msgstr ""
-#: sphinx/directives/desc.py:615
+#: sphinx/domains/python.py:502
+#, fuzzy, python-format
+msgid "class method"
+msgstr "%s() (método %s)"
+
+#: sphinx/domains/python.py:503
+msgid "static method"
+msgstr "método estático"
+
+#: sphinx/domains/python.py:505 sphinx/locale/__init__.py:158
+msgid "module"
+msgstr "módulo"
+
+#: sphinx/domains/rst.py:53
#, python-format
-msgid "%s (C type)"
-msgstr "%s (tipo C)"
+msgid "%s (directive)"
+msgstr ""
-#: sphinx/directives/desc.py:617
+#: sphinx/domains/rst.py:55
+#, fuzzy, python-format
+msgid "%s (role)"
+msgstr "%s (módulo)"
+
+#: sphinx/domains/rst.py:103
+msgid "directive"
+msgstr ""
+
+#: sphinx/domains/rst.py:104
+#, fuzzy
+msgid "role"
+msgstr "módulo"
+
+#: sphinx/domains/std.py:68 sphinx/domains/std.py:84
#, python-format
-msgid "%s (C variable)"
-msgstr "%s (variável C)"
+msgid "environment variable; %s"
+msgstr "váriavel de ambiente; %s"
-#: sphinx/directives/desc.py:665
+#: sphinx/domains/std.py:160
#, python-format
msgid "%scommand line option; %s"
msgstr "%sopção de linha de comando; %s"
-#: sphinx/directives/other.py:138
-msgid "Platforms: "
-msgstr "Plataformas: "
+#: sphinx/domains/std.py:328
+msgid "glossary term"
+msgstr ""
-#: sphinx/directives/other.py:144
-#, python-format
-msgid "%s (module)"
-msgstr "%s (módulo)"
+#: sphinx/domains/std.py:329
+msgid "grammar token"
+msgstr ""
-#: sphinx/directives/other.py:193
-msgid "Section author: "
-msgstr "Autor da seção: "
+#: sphinx/domains/std.py:330
+msgid "reference label"
+msgstr ""
-#: sphinx/directives/other.py:195
-msgid "Module author: "
-msgstr "Autor do módulo: "
+#: sphinx/domains/std.py:331
+msgid "environment variable"
+msgstr "váriavel de ambiente"
-#: sphinx/directives/other.py:197
-msgid "Author: "
-msgstr "Autor: "
+#: sphinx/domains/std.py:332
+msgid "program option"
+msgstr ""
-#: sphinx/directives/other.py:317
-msgid "See also"
-msgstr "Veja também"
+#: sphinx/domains/std.py:360 sphinx/themes/basic/genindex-single.html:11
+#: sphinx/themes/basic/genindex-split.html:11
+#: sphinx/themes/basic/genindex-split.html:14
+#: sphinx/themes/basic/genindex.html:11 sphinx/themes/basic/genindex.html:14
+#: sphinx/themes/basic/genindex.html:50 sphinx/themes/basic/layout.html:125
+#: sphinx/writers/latex.py:173
+msgid "Index"
+msgstr "Índice"
+
+#: sphinx/domains/std.py:361
+msgid "Module Index"
+msgstr "Índice do Módulo"
+
+#: sphinx/domains/std.py:362 sphinx/themes/basic/defindex.html:25
+msgid "Search Page"
+msgstr "Página de Pesquisa"
-#: sphinx/ext/autodoc.py:883
+#: sphinx/ext/autodoc.py:917
#, python-format
msgid " Bases: %s"
msgstr ""
-#: sphinx/ext/autodoc.py:916
+#: sphinx/ext/autodoc.py:950
#, python-format
msgid "alias of :class:`%s`"
msgstr ""
@@ -247,225 +396,224 @@ msgstr ""
msgid "Todo"
msgstr "Por fazer"
-#: sphinx/ext/todo.py:99
+#: sphinx/ext/todo.py:109
#, python-format
-msgid "(The original entry is located in %s, line %d and can be found "
-msgstr "(A entrada original está localizada em %s, linha %d e pode ser encontrada "
+msgid "(The <<original entry>> is located in %s, line %d.)"
+msgstr "(A <<entrada original>> está localizada em %s, linha %d.)"
-#: sphinx/ext/todo.py:105
-msgid "here"
-msgstr "aqui"
+#: sphinx/ext/todo.py:117
+msgid "original entry"
+msgstr "entrada original"
-#: sphinx/locale/__init__.py:15
+#: sphinx/ext/viewcode.py:66
+msgid "[source]"
+msgstr ""
+
+#: sphinx/ext/viewcode.py:109
+msgid "[docs]"
+msgstr ""
+
+#: sphinx/ext/viewcode.py:123
+#, fuzzy
+msgid "Module code"
+msgstr "módulo"
+
+#: sphinx/ext/viewcode.py:129
+#, python-format
+msgid "<h1>Source code for %s</h1>"
+msgstr ""
+
+#: sphinx/ext/viewcode.py:156
+msgid "Overview: module code"
+msgstr ""
+
+#: sphinx/ext/viewcode.py:157
+msgid "<h1>All modules for which code is available</h1>"
+msgstr ""
+
+#: sphinx/locale/__init__.py:139
msgid "Attention"
msgstr "Atenção"
-#: sphinx/locale/__init__.py:16
+#: sphinx/locale/__init__.py:140
msgid "Caution"
msgstr "Cuidado"
-#: sphinx/locale/__init__.py:17
+#: sphinx/locale/__init__.py:141
msgid "Danger"
msgstr "Perigo"
-#: sphinx/locale/__init__.py:18
+#: sphinx/locale/__init__.py:142
msgid "Error"
msgstr "Erro"
-#: sphinx/locale/__init__.py:19
+#: sphinx/locale/__init__.py:143
msgid "Hint"
msgstr "Dica"
-#: sphinx/locale/__init__.py:20
+#: sphinx/locale/__init__.py:144
msgid "Important"
msgstr "Importante"
-#: sphinx/locale/__init__.py:21
+#: sphinx/locale/__init__.py:145
msgid "Note"
msgstr "Nota"
-#: sphinx/locale/__init__.py:22
+#: sphinx/locale/__init__.py:146
msgid "See Also"
msgstr "Veja Também"
-#: sphinx/locale/__init__.py:23
+#: sphinx/locale/__init__.py:147
msgid "Tip"
msgstr "Dica"
-#: sphinx/locale/__init__.py:24
+#: sphinx/locale/__init__.py:148
msgid "Warning"
msgstr "Aviso"
-#: sphinx/locale/__init__.py:28
+#: sphinx/locale/__init__.py:152
#, python-format
msgid "New in version %s"
msgstr "Novo na versão %s"
-#: sphinx/locale/__init__.py:29
+#: sphinx/locale/__init__.py:153
#, python-format
msgid "Changed in version %s"
msgstr "Alterado na versão %s"
-#: sphinx/locale/__init__.py:30
+#: sphinx/locale/__init__.py:154
#, python-format
msgid "Deprecated since version %s"
msgstr "Obsoleto desde a versão %s"
-#: sphinx/locale/__init__.py:34
-msgid "module"
-msgstr "módulo"
-
-#: sphinx/locale/__init__.py:35
+#: sphinx/locale/__init__.py:159
msgid "keyword"
msgstr "palavra-chave"
-#: sphinx/locale/__init__.py:36
+#: sphinx/locale/__init__.py:160
msgid "operator"
msgstr "operador"
-#: sphinx/locale/__init__.py:37
+#: sphinx/locale/__init__.py:161
msgid "object"
msgstr "objeto"
-#: sphinx/locale/__init__.py:38
-msgid "exception"
-msgstr "exceção"
-
-#: sphinx/locale/__init__.py:39
+#: sphinx/locale/__init__.py:163
msgid "statement"
msgstr "comando"
-#: sphinx/locale/__init__.py:40
+#: sphinx/locale/__init__.py:164
msgid "built-in function"
msgstr "função interna"
-#: sphinx/themes/basic/defindex.html:2
+#: sphinx/themes/agogo/layout.html:45 sphinx/themes/basic/globaltoc.html:10
+#: sphinx/themes/basic/localtoc.html:11
+msgid "Table Of Contents"
+msgstr "Tabela de Conteúdo"
+
+#: sphinx/themes/agogo/layout.html:49 sphinx/themes/basic/layout.html:128
+#: sphinx/themes/basic/search.html:11 sphinx/themes/basic/search.html:14
+msgid "Search"
+msgstr "Pesquisar"
+
+#: sphinx/themes/agogo/layout.html:52 sphinx/themes/basic/searchbox.html:15
+msgid "Go"
+msgstr "Ir"
+
+#: sphinx/themes/agogo/layout.html:57 sphinx/themes/basic/searchbox.html:20
+#, fuzzy
+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/agogo/layout.html:78 sphinx/themes/basic/sourcelink.html:14
+msgid "Show Source"
+msgstr "Exibir Fonte"
+
+#: sphinx/themes/basic/defindex.html:11
msgid "Overview"
msgstr "Visão geral"
-#: sphinx/themes/basic/defindex.html:11
+#: sphinx/themes/basic/defindex.html:20
msgid "Indices and tables:"
msgstr "Índices e tabelas:"
-#: sphinx/themes/basic/defindex.html:14
+#: sphinx/themes/basic/defindex.html:23
msgid "Complete Table of Contents"
msgstr "Tabela de Conteúdo Completa"
-#: sphinx/themes/basic/defindex.html:15
+#: sphinx/themes/basic/defindex.html:24
msgid "lists all sections and subsections"
msgstr "Lista todas seções e subseções"
-#: sphinx/themes/basic/defindex.html:17
+#: sphinx/themes/basic/defindex.html:26
msgid "search this documentation"
msgstr "Pesquisar esta documentação"
-#: sphinx/themes/basic/defindex.html:20
+#: sphinx/themes/basic/defindex.html:28
+msgid "Global Module Index"
+msgstr "Índice Global de Módulos"
+
+#: sphinx/themes/basic/defindex.html:29
msgid "quick access to all modules"
msgstr "acesso rápido para todos os módulos"
-#: sphinx/themes/basic/defindex.html:22
+#: sphinx/themes/basic/defindex.html:31
msgid "all functions, classes, terms"
msgstr "todas funções, classes, termos"
-#: sphinx/themes/basic/genindex-single.html:5
+#: sphinx/themes/basic/genindex-single.html:14
#, python-format
msgid "Index &ndash; %(key)s"
msgstr "Índice &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
+#: sphinx/themes/basic/genindex-single.html:46
+#: sphinx/themes/basic/genindex-split.html:24
+#: sphinx/themes/basic/genindex-split.html:38
+#: sphinx/themes/basic/genindex.html:56
msgid "Full index on one page"
msgstr "Índice completo em uma página"
-#: sphinx/themes/basic/genindex-split.html:7
+#: sphinx/themes/basic/genindex-split.html:16
msgid "Index pages by letter"
msgstr "Paginas de índice por letra"
-#: sphinx/themes/basic/genindex-split.html:15
+#: sphinx/themes/basic/genindex-split.html:25
msgid "can be huge"
msgstr "pode ser enorme"
-#: sphinx/themes/basic/layout.html:10
+#: sphinx/themes/basic/layout.html:23
msgid "Navigation"
msgstr "Navegação"
-#: sphinx/themes/basic/layout.html:42
-msgid "Table Of Contents"
-msgstr "Tabela de Conteúdo"
-
-#: sphinx/themes/basic/layout.html:48
-msgid "Previous topic"
-msgstr "Tópico anterior"
-
-#: sphinx/themes/basic/layout.html:50
-msgid "previous chapter"
-msgstr "capítulo anterior"
-
-#: sphinx/themes/basic/layout.html:53
-msgid "Next topic"
-msgstr "Próximo tópico"
-
-#: sphinx/themes/basic/layout.html:55
-msgid "next chapter"
-msgstr "próximo capítulo"
-
-#: sphinx/themes/basic/layout.html:60
-msgid "This Page"
-msgstr "Esta Página"
-
-#: sphinx/themes/basic/layout.html:63
-msgid "Show Source"
-msgstr "Exibir Fonte"
-
-#: sphinx/themes/basic/layout.html:73
-msgid "Quick search"
-msgstr "Pesquisa rápida"
-
-#: sphinx/themes/basic/layout.html:76
-msgid "Go"
-msgstr "Ir"
-
-#: sphinx/themes/basic/layout.html:81
-#, fuzzy
-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:113
#, python-format
msgid "Search within %(docstitle)s"
msgstr "Pesquisar dentro de %(docstitle)s"
-#: sphinx/themes/basic/layout.html:128
+#: sphinx/themes/basic/layout.html:122
msgid "About these documents"
msgstr "Sobre estes documentos"
-#: sphinx/themes/basic/layout.html:134 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:131
msgid "Copyright"
msgstr "Copyright"
-#: sphinx/themes/basic/layout.html:183
+#: sphinx/themes/basic/layout.html:180
#, 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:182
#, python-format
msgid "&copy; Copyright %(copyright)s."
msgstr "&copy; Copyright %(copyright)s."
-#: sphinx/themes/basic/layout.html:188
+#: sphinx/themes/basic/layout.html:186
#, 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:189
#, python-format
msgid ""
"Created using <a href=\"http://sphinx.pocoo.org/\">Sphinx</a> "
@@ -474,22 +622,34 @@ msgstr ""
"Criado com <a href=\"http://sphinx.pocoo.org/\">Sphinx</a> "
"%(sphinx_version)s."
-#: sphinx/themes/basic/modindex.html:36
-msgid "Deprecated"
-msgstr "Obsoleto"
-
#: sphinx/themes/basic/opensearch.xml:4
#, python-format
msgid "Search %(docstitle)s"
msgstr "Pesquisar em %(docstitle)s"
-#: sphinx/themes/basic/search.html:9
+#: sphinx/themes/basic/relations.html:11
+msgid "Previous topic"
+msgstr "Tópico anterior"
+
+#: sphinx/themes/basic/relations.html:13
+msgid "previous chapter"
+msgstr "capítulo anterior"
+
+#: sphinx/themes/basic/relations.html:16
+msgid "Next topic"
+msgstr "Próximo tópico"
+
+#: sphinx/themes/basic/relations.html:18
+msgid "next chapter"
+msgstr "próximo capítulo"
+
+#: sphinx/themes/basic/search.html:18
msgid ""
"Please activate JavaScript to enable the search\n"
" functionality."
msgstr ""
-#: sphinx/themes/basic/search.html:14
+#: sphinx/themes/basic/search.html:23
#, fuzzy
msgid ""
"From here you can search these documents. Enter your search\n"
@@ -504,19 +664,27 @@ msgstr ""
" Páginas contendo menos palavras não irão aparecer na lista de "
"resultado."
-#: sphinx/themes/basic/search.html:21
+#: sphinx/themes/basic/search.html:30
msgid "search"
msgstr "pesquisar"
-#: sphinx/themes/basic/search.html:25
-#: sphinx/themes/basic/static/searchtools.js:453
+#: sphinx/themes/basic/search.html:34
+#: sphinx/themes/basic/static/searchtools.js:489
msgid "Search Results"
msgstr "Resultados da Pesquisa"
-#: sphinx/themes/basic/search.html:27
+#: sphinx/themes/basic/search.html:36
msgid "Your search did not match any results."
msgstr "Sua pesquisa não encontrou nenhum resultado."
+#: sphinx/themes/basic/searchbox.html:12
+msgid "Quick search"
+msgstr "Pesquisa rápida"
+
+#: sphinx/themes/basic/sourcelink.html:11
+msgid "This Page"
+msgstr "Esta Página"
+
#: sphinx/themes/basic/changes/frameset.html:5
#: sphinx/themes/basic/changes/versionchanges.html:12
#, python-format
@@ -545,36 +713,32 @@ msgstr "Alterações na API C"
msgid "Other changes"
msgstr "Outras alterações"
-#: sphinx/themes/basic/static/doctools.js:139 sphinx/writers/html.py:473
-#: sphinx/writers/html.py:478
+#: sphinx/themes/basic/static/doctools.js:154 sphinx/writers/html.py:482
+#: sphinx/writers/html.py:487
msgid "Permalink to this headline"
msgstr "Link permanente para este título"
-#: sphinx/themes/basic/static/doctools.js:145 sphinx/writers/html.py:80
+#: sphinx/themes/basic/static/doctools.js:160 sphinx/writers/html.py:87
msgid "Permalink to this definition"
msgstr "Link permanente para esta definição"
-#: sphinx/themes/basic/static/doctools.js:174
+#: sphinx/themes/basic/static/doctools.js:189
msgid "Hide Search Matches"
msgstr "Esconder Resultados da Pesquisa"
-#: sphinx/themes/basic/static/searchtools.js:274
+#: sphinx/themes/basic/static/searchtools.js:285
msgid "Searching"
msgstr "Pesquisando"
-#: sphinx/themes/basic/static/searchtools.js:279
+#: sphinx/themes/basic/static/searchtools.js:290
msgid "Preparing search..."
msgstr "Preparando pesquisa..."
-#: sphinx/themes/basic/static/searchtools.js:338
-msgid "module, in "
-msgstr "módulo, em "
-
-#: sphinx/themes/basic/static/searchtools.js:347
+#: sphinx/themes/basic/static/searchtools.js:364
msgid ", in "
msgstr ", em "
-#: sphinx/themes/basic/static/searchtools.js:455
+#: sphinx/themes/basic/static/searchtools.js:491
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,36 +747,43 @@ 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:493
#, 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/themes/default/static/sidebar.js:66
+msgid "Expand sidebar"
+msgstr ""
+
+#: sphinx/themes/default/static/sidebar.js:79
+#: sphinx/themes/default/static/sidebar.js:106
+msgid "Collapse sidebar"
+msgstr ""
+
+#: sphinx/themes/haiku/layout.html:26
+msgid "Contents"
+msgstr ""
+
+#: sphinx/writers/latex.py:171
msgid "Release"
msgstr "Versão"
-#: sphinx/writers/latex.py:571
+#: sphinx/writers/latex.py:572 sphinx/writers/manpage.py:178
msgid "Footnotes"
msgstr ""
-#: sphinx/writers/latex.py:639
+#: sphinx/writers/latex.py:641
msgid "continued from previous page"
msgstr ""
-#: sphinx/writers/latex.py:644
+#: sphinx/writers/latex.py:646
#, fuzzy
msgid "Continued on next page"
msgstr "Índice completo em uma página"
-#: sphinx/writers/text.py:166
-#, python-format
-msgid "Platform: %s"
-msgstr "Plataforma: %s"
-
-#: sphinx/writers/text.py:428
+#: sphinx/writers/text.py:422
msgid "[image]"
msgstr "[imagem]"
-
diff --git a/sphinx/locale/ru/LC_MESSAGES/sphinx.js b/sphinx/locale/ru/LC_MESSAGES/sphinx.js
index 8d72986b6..e597cfad9 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": {"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
+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 ", "Expand sidebar": "", "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", "Collapse sidebar": "", "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"}}); \ 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 9beac94ce..ecdc68604 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 cf466c7ec..e2b1e3a13 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: 2010-05-24 23:54+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,227 +17,377 @@ 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:106 sphinx/writers/latex.py:184
+#: sphinx/writers/manpage.py:67
#, python-format
msgid "%B %d, %Y"
msgstr "%d %B %Y"
-#: 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
-msgid "Index"
-msgstr "Алфавитный указатель"
-
-#: sphinx/environment.py:325 sphinx/writers/latex.py:187
-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
+#: sphinx/roles.py:174
#, python-format
msgid "Python Enhancement Proposals!PEP %s"
msgstr "Python Enhancement Proposals!PEP %s"
-#: sphinx/builders/changes.py:71
+#: sphinx/builders/changes.py:72
msgid "Builtins"
msgstr "Встроенные функции"
-#: sphinx/builders/changes.py:73
+#: sphinx/builders/changes.py:74
msgid "Module level"
msgstr "Модуль"
-#: sphinx/builders/html.py:205
+#: sphinx/builders/html.py:266
#, 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:285 sphinx/themes/basic/defindex.html:30
msgid "General Index"
msgstr "Словарь-указатель"
-#: sphinx/builders/html.py:224
+#: sphinx/builders/html.py:285
msgid "index"
msgstr "словарь"
-#: 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
-msgid "Global Module Index"
-msgstr "Алфавитный указатель модулей"
-
-#: sphinx/builders/html.py:227
-msgid "modules"
-msgstr "модули"
-
-#: sphinx/builders/html.py:281
+#: sphinx/builders/html.py:345
msgid "next"
msgstr "следующий"
-#: sphinx/builders/html.py:290
+#: sphinx/builders/html.py:354
msgid "previous"
msgstr "предыдущий"
-#: sphinx/builders/latex.py:162
+#: sphinx/builders/latex.py:151
msgid " (in "
msgstr " (в "
-#: sphinx/directives/desc.py:97
-msgid "Raises"
-msgstr "Исключение"
+#: sphinx/directives/other.py:127
+msgid "Section author: "
+msgstr "Автор секции: "
-#: sphinx/directives/desc.py:101
-msgid "Variable"
-msgstr "Переменная"
+#: sphinx/directives/other.py:129
+msgid "Module author: "
+msgstr "Автор модуля: "
+
+#: sphinx/directives/other.py:131
+#, fuzzy
+msgid "Code author: "
+msgstr "Автор модуля: "
+
+#: sphinx/directives/other.py:133
+msgid "Author: "
+msgstr "Автор: "
+
+#: sphinx/directives/other.py:238
+msgid "See also"
+msgstr "См.также"
+
+#: sphinx/domains/__init__.py:253
+#, python-format
+msgid "%s %s"
+msgstr ""
-#: sphinx/directives/desc.py:104
+#: sphinx/domains/c.py:51 sphinx/domains/python.py:49
+msgid "Parameters"
+msgstr "Параметры"
+
+#: sphinx/domains/c.py:54 sphinx/domains/javascript.py:137
+#: sphinx/domains/python.py:59
msgid "Returns"
msgstr "Результат"
-#: sphinx/directives/desc.py:113
+#: sphinx/domains/c.py:56 sphinx/domains/python.py:61
msgid "Return type"
msgstr "Тип результата"
-#: sphinx/directives/desc.py:186
-msgid "Parameter"
-msgstr "Параметр"
+#: sphinx/domains/c.py:133
+#, python-format
+msgid "%s (C function)"
+msgstr "%s (функция C)"
-#: sphinx/directives/desc.py:190
-msgid "Parameters"
-msgstr "Параметры"
+#: sphinx/domains/c.py:135
+#, python-format
+msgid "%s (C member)"
+msgstr "%s (поле C)"
-#: sphinx/directives/desc.py:418
+#: sphinx/domains/c.py:137
+#, python-format
+msgid "%s (C macro)"
+msgstr "%s (макроподстановка C)"
+
+#: sphinx/domains/c.py:139
+#, python-format
+msgid "%s (C type)"
+msgstr "%s (тип C)"
+
+#: sphinx/domains/c.py:141
+#, python-format
+msgid "%s (C variable)"
+msgstr "%s (переменная C)"
+
+#: sphinx/domains/c.py:171 sphinx/domains/cpp.py:1031
+#: sphinx/domains/javascript.py:166 sphinx/domains/python.py:497
+msgid "function"
+msgstr "функция"
+
+#: sphinx/domains/c.py:172 sphinx/domains/cpp.py:1032
+msgid "member"
+msgstr "поле"
+
+#: sphinx/domains/c.py:173
+msgid "macro"
+msgstr ""
+
+#: sphinx/domains/c.py:174 sphinx/domains/cpp.py:1033
+msgid "type"
+msgstr "тип"
+
+#: sphinx/domains/c.py:175
+#, fuzzy
+msgid "variable"
+msgstr "Переменная"
+
+#: sphinx/domains/cpp.py:876
+#, python-format
+msgid "%s (C++ class)"
+msgstr "%s (класс C++)"
+
+#: sphinx/domains/cpp.py:891
+#, python-format
+msgid "%s (C++ type)"
+msgstr "%s (тип C++)"
+
+#: sphinx/domains/cpp.py:910
+#, python-format
+msgid "%s (C++ member)"
+msgstr "%s (поле C++)"
+
+#: sphinx/domains/cpp.py:962
+#, python-format
+msgid "%s (C++ function)"
+msgstr "%s (функция C++)"
+
+#: sphinx/domains/cpp.py:1030 sphinx/domains/python.py:499
+msgid "class"
+msgstr "класс"
+
+#: sphinx/domains/javascript.py:117 sphinx/domains/python.py:221
#, python-format
msgid "%s() (built-in function)"
msgstr "%s() (встроенная функция)"
-#: sphinx/directives/desc.py:419 sphinx/directives/desc.py:476
-#: sphinx/directives/desc.py:488
+#: sphinx/domains/javascript.py:118 sphinx/domains/python.py:285
+#, python-format
+msgid "%s() (%s method)"
+msgstr "%s() (метод %s)"
+
+#: sphinx/domains/javascript.py:120
+#, python-format
+msgid "%s (global variable or constant)"
+msgstr ""
+
+#: sphinx/domains/javascript.py:122 sphinx/domains/python.py:323
+#, python-format
+msgid "%s (%s attribute)"
+msgstr "%s (атрибут %s)"
+
+#: sphinx/domains/javascript.py:131
+#, fuzzy
+msgid "Arguments"
+msgstr "Параметры"
+
+#: sphinx/domains/javascript.py:134
+msgid "Throws"
+msgstr ""
+
+#: sphinx/domains/javascript.py:167 sphinx/domains/python.py:498
+msgid "data"
+msgstr ""
+
+#: sphinx/domains/javascript.py:168 sphinx/domains/python.py:504
+msgid "attribute"
+msgstr "атрибут"
+
+#: sphinx/domains/python.py:53
+#, fuzzy
+msgid "Variables"
+msgstr "Переменная"
+
+#: sphinx/domains/python.py:56
+msgid "Raises"
+msgstr "Исключение"
+
+#: sphinx/domains/python.py:222 sphinx/domains/python.py:279
+#: sphinx/domains/python.py:291 sphinx/domains/python.py:304
#, python-format
msgid "%s() (in module %s)"
msgstr "%s() (в модуле %s)"
-#: sphinx/directives/desc.py:422
+#: sphinx/domains/python.py:225
#, python-format
msgid "%s (built-in variable)"
msgstr "%s (встроенная переменная)"
-#: sphinx/directives/desc.py:423 sphinx/directives/desc.py:514
+#: sphinx/domains/python.py:226 sphinx/domains/python.py:317
#, python-format
msgid "%s (in module %s)"
msgstr "%s (в модуле %s)"
-#: sphinx/directives/desc.py:439
+#: sphinx/domains/python.py:242
#, python-format
msgid "%s (built-in class)"
msgstr "%s (встроенный класс)"
-#: sphinx/directives/desc.py:440
+#: sphinx/domains/python.py:243
#, python-format
msgid "%s (class in %s)"
msgstr "%s (класс в %s)"
-#: sphinx/directives/desc.py:480
+#: sphinx/domains/python.py:283
#, 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
+#: sphinx/domains/python.py:295
#, python-format
msgid "%s() (%s.%s static method)"
msgstr "%s() (статический метод %s.%s)"
-#: sphinx/directives/desc.py:495
+#: sphinx/domains/python.py:298
#, python-format
msgid "%s() (%s static method)"
msgstr "%s() (статический метод %s)"
-#: sphinx/directives/desc.py:518
+#: sphinx/domains/python.py:308
+#, fuzzy, python-format
+msgid "%s() (%s.%s class method)"
+msgstr "%s() (метод %s.%s)"
+
+#: sphinx/domains/python.py:311
+#, fuzzy, python-format
+msgid "%s() (%s class method)"
+msgstr "%s() (метод %s)"
+
+#: sphinx/domains/python.py:321
#, 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/domains/python.py:366
+msgid "Platforms: "
+msgstr "Платформы: "
-#: sphinx/directives/desc.py:609
+#: sphinx/domains/python.py:372
#, python-format
-msgid "%s (C function)"
-msgstr "%s (функция C)"
+msgid "%s (module)"
+msgstr "%s (модуль)"
-#: sphinx/directives/desc.py:611
-#, python-format
-msgid "%s (C member)"
-msgstr "%s (поле C)"
+#: sphinx/domains/python.py:429
+#, fuzzy
+msgid "Python Module Index"
+msgstr "Состав модуля"
-#: sphinx/directives/desc.py:613
-#, python-format
-msgid "%s (C macro)"
-msgstr "%s (макроподстановка C)"
+#: sphinx/domains/python.py:430
+msgid "modules"
+msgstr "модули"
+
+#: sphinx/domains/python.py:475
+msgid "Deprecated"
+msgstr "Не рекомендуется"
+
+#: sphinx/domains/python.py:500 sphinx/locale/__init__.py:162
+msgid "exception"
+msgstr "исключение"
+
+#: sphinx/domains/python.py:501
+msgid "method"
+msgstr ""
-#: sphinx/directives/desc.py:615
+#: sphinx/domains/python.py:502
+#, fuzzy, python-format
+msgid "class method"
+msgstr "%s() (метод %s)"
+
+#: sphinx/domains/python.py:503
+msgid "static method"
+msgstr "статический метод"
+
+#: sphinx/domains/python.py:505 sphinx/locale/__init__.py:158
+msgid "module"
+msgstr "модуль"
+
+#: sphinx/domains/rst.py:53
#, python-format
-msgid "%s (C type)"
-msgstr "%s (тип C)"
+msgid "%s (directive)"
+msgstr ""
-#: sphinx/directives/desc.py:617
+#: sphinx/domains/rst.py:55
+#, fuzzy, python-format
+msgid "%s (role)"
+msgstr "%s (модуль)"
+
+#: sphinx/domains/rst.py:103
+msgid "directive"
+msgstr ""
+
+#: sphinx/domains/rst.py:104
+#, fuzzy
+msgid "role"
+msgstr "модуль"
+
+#: sphinx/domains/std.py:68 sphinx/domains/std.py:84
#, python-format
-msgid "%s (C variable)"
-msgstr "%s (переменная C)"
+msgid "environment variable; %s"
+msgstr "переменная окружения; %s"
-#: sphinx/directives/desc.py:665
+#: sphinx/domains/std.py:160
#, python-format
msgid "%scommand line option; %s"
msgstr "Опция командной строки %s; %s"
-#: sphinx/directives/other.py:138
-msgid "Platforms: "
-msgstr "Платформы: "
+#: sphinx/domains/std.py:328
+msgid "glossary term"
+msgstr ""
-#: sphinx/directives/other.py:144
-#, python-format
-msgid "%s (module)"
-msgstr "%s (модуль)"
+#: sphinx/domains/std.py:329
+msgid "grammar token"
+msgstr ""
-#: sphinx/directives/other.py:193
-msgid "Section author: "
-msgstr "Автор секции: "
+#: sphinx/domains/std.py:330
+msgid "reference label"
+msgstr ""
-#: sphinx/directives/other.py:195
-msgid "Module author: "
-msgstr "Автор модуля: "
+#: sphinx/domains/std.py:331
+msgid "environment variable"
+msgstr "переменная окружения"
-#: sphinx/directives/other.py:197
-msgid "Author: "
-msgstr "Автор: "
+#: sphinx/domains/std.py:332
+msgid "program option"
+msgstr ""
-#: sphinx/directives/other.py:317
-msgid "See also"
-msgstr "См.также"
+#: sphinx/domains/std.py:360 sphinx/themes/basic/genindex-single.html:11
+#: sphinx/themes/basic/genindex-split.html:11
+#: sphinx/themes/basic/genindex-split.html:14
+#: sphinx/themes/basic/genindex.html:11 sphinx/themes/basic/genindex.html:14
+#: sphinx/themes/basic/genindex.html:50 sphinx/themes/basic/layout.html:125
+#: sphinx/writers/latex.py:173
+msgid "Index"
+msgstr "Алфавитный указатель"
+
+#: sphinx/domains/std.py:361
+msgid "Module Index"
+msgstr "Состав модуля"
+
+#: sphinx/domains/std.py:362 sphinx/themes/basic/defindex.html:25
+msgid "Search Page"
+msgstr "Поиск"
-#: sphinx/ext/autodoc.py:883
+#: sphinx/ext/autodoc.py:917
#, python-format
msgid " Bases: %s"
msgstr " Базовые классы: %s"
-#: sphinx/ext/autodoc.py:916
+#: sphinx/ext/autodoc.py:950
#, python-format
msgid "alias of :class:`%s`"
msgstr "псевдоним класса :class:`%s`"
@@ -246,224 +396,223 @@ msgstr "псевдоним класса :class:`%s`"
msgid "Todo"
msgstr "План"
-#: sphinx/ext/todo.py:99
-#, python-format
-msgid "(The original entry is located in %s, line %d and can be found "
+#: sphinx/ext/todo.py:109
+#, fuzzy, python-format
+msgid "(The <<original entry>> is located in %s, line %d.)"
msgstr "(Исходный элемент находится в %s, в строке %d, и может быть найден "
-#: sphinx/ext/todo.py:105
-msgid "here"
-msgstr "здесь"
+#: sphinx/ext/todo.py:117
+msgid "original entry"
+msgstr ""
+
+#: sphinx/ext/viewcode.py:66
+msgid "[source]"
+msgstr ""
+
+#: sphinx/ext/viewcode.py:109
+msgid "[docs]"
+msgstr ""
+
+#: sphinx/ext/viewcode.py:123
+#, fuzzy
+msgid "Module code"
+msgstr "модуль"
+
+#: sphinx/ext/viewcode.py:129
+#, python-format
+msgid "<h1>Source code for %s</h1>"
+msgstr ""
+
+#: sphinx/ext/viewcode.py:156
+msgid "Overview: module code"
+msgstr ""
-#: sphinx/locale/__init__.py:15
+#: sphinx/ext/viewcode.py:157
+msgid "<h1>All modules for which code is available</h1>"
+msgstr ""
+
+#: sphinx/locale/__init__.py:139
msgid "Attention"
msgstr "Внимание"
-#: sphinx/locale/__init__.py:16
+#: sphinx/locale/__init__.py:140
msgid "Caution"
msgstr "Осторожно"
-#: sphinx/locale/__init__.py:17
+#: sphinx/locale/__init__.py:141
msgid "Danger"
msgstr "Опасно"
-#: sphinx/locale/__init__.py:18
+#: sphinx/locale/__init__.py:142
msgid "Error"
msgstr "Ошибка"
-#: sphinx/locale/__init__.py:19
+#: sphinx/locale/__init__.py:143
msgid "Hint"
msgstr "Подсказка"
-#: sphinx/locale/__init__.py:20
+#: sphinx/locale/__init__.py:144
msgid "Important"
msgstr "Важно"
-#: sphinx/locale/__init__.py:21
+#: sphinx/locale/__init__.py:145
msgid "Note"
msgstr "Примечание"
-#: sphinx/locale/__init__.py:22
+#: sphinx/locale/__init__.py:146
msgid "See Also"
msgstr "См.также"
-#: sphinx/locale/__init__.py:23
+#: sphinx/locale/__init__.py:147
msgid "Tip"
msgstr "Совет"
-#: sphinx/locale/__init__.py:24
+#: sphinx/locale/__init__.py:148
msgid "Warning"
msgstr "Предупреждение"
-#: sphinx/locale/__init__.py:28
+#: sphinx/locale/__init__.py:152
#, python-format
msgid "New in version %s"
msgstr "Добавлено в версии %s"
-#: sphinx/locale/__init__.py:29
+#: sphinx/locale/__init__.py:153
#, python-format
msgid "Changed in version %s"
msgstr "Изменено в версии %s"
-#: sphinx/locale/__init__.py:30
+#: sphinx/locale/__init__.py:154
#, python-format
msgid "Deprecated since version %s"
msgstr "Не рекомендуется, начиная с версии %s"
-#: sphinx/locale/__init__.py:34
-msgid "module"
-msgstr "модуль"
-
-#: sphinx/locale/__init__.py:35
+#: sphinx/locale/__init__.py:159
msgid "keyword"
msgstr "ключевое слово"
-#: sphinx/locale/__init__.py:36
+#: sphinx/locale/__init__.py:160
msgid "operator"
msgstr "оператор"
-#: sphinx/locale/__init__.py:37
+#: sphinx/locale/__init__.py:161
msgid "object"
msgstr "объект"
-#: sphinx/locale/__init__.py:38
-msgid "exception"
-msgstr "исключение"
-
-#: sphinx/locale/__init__.py:39
+#: sphinx/locale/__init__.py:163
msgid "statement"
msgstr "команда"
-#: sphinx/locale/__init__.py:40
+#: sphinx/locale/__init__.py:164
msgid "built-in function"
msgstr "базовая функция"
-#: sphinx/themes/basic/defindex.html:2
+#: sphinx/themes/agogo/layout.html:45 sphinx/themes/basic/globaltoc.html:10
+#: sphinx/themes/basic/localtoc.html:11
+msgid "Table Of Contents"
+msgstr "Содержание"
+
+#: sphinx/themes/agogo/layout.html:49 sphinx/themes/basic/layout.html:128
+#: sphinx/themes/basic/search.html:11 sphinx/themes/basic/search.html:14
+msgid "Search"
+msgstr "Поиск"
+
+#: sphinx/themes/agogo/layout.html:52 sphinx/themes/basic/searchbox.html:15
+msgid "Go"
+msgstr "Искать"
+
+#: sphinx/themes/agogo/layout.html:57 sphinx/themes/basic/searchbox.html:20
+msgid "Enter search terms or a module, class or function name."
+msgstr "Введите слова для поиска или имя модуля, класса или функции."
+
+#: sphinx/themes/agogo/layout.html:78 sphinx/themes/basic/sourcelink.html:14
+msgid "Show Source"
+msgstr "Показать исходный текст"
+
+#: sphinx/themes/basic/defindex.html:11
msgid "Overview"
msgstr "Обзор"
-#: sphinx/themes/basic/defindex.html:11
+#: sphinx/themes/basic/defindex.html:20
msgid "Indices and tables:"
msgstr "Таблицы и указатели:"
-#: sphinx/themes/basic/defindex.html:14
+#: sphinx/themes/basic/defindex.html:23
msgid "Complete Table of Contents"
msgstr "Подробное оглавление"
-#: sphinx/themes/basic/defindex.html:15
+#: sphinx/themes/basic/defindex.html:24
msgid "lists all sections and subsections"
msgstr "список всех разделов и подразделов"
-#: sphinx/themes/basic/defindex.html:17
+#: sphinx/themes/basic/defindex.html:26
msgid "search this documentation"
msgstr "поиск во всем документе"
-#: sphinx/themes/basic/defindex.html:20
+#: sphinx/themes/basic/defindex.html:28
+msgid "Global Module Index"
+msgstr "Алфавитный указатель модулей"
+
+#: sphinx/themes/basic/defindex.html:29
msgid "quick access to all modules"
msgstr "сводный список всех модулей"
-#: sphinx/themes/basic/defindex.html:22
+#: sphinx/themes/basic/defindex.html:31
msgid "all functions, classes, terms"
msgstr "все функции, классы, переменные и константы"
-#: sphinx/themes/basic/genindex-single.html:5
+#: sphinx/themes/basic/genindex-single.html:14
#, 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
+#: sphinx/themes/basic/genindex-single.html:46
+#: sphinx/themes/basic/genindex-split.html:24
+#: sphinx/themes/basic/genindex-split.html:38
+#: sphinx/themes/basic/genindex.html:56
msgid "Full index on one page"
msgstr "Полный алфавитный указатель на одной странице"
-#: sphinx/themes/basic/genindex-split.html:7
+#: sphinx/themes/basic/genindex-split.html:16
msgid "Index pages by letter"
msgstr "Указатели по буквам алфавита"
-#: sphinx/themes/basic/genindex-split.html:15
+#: sphinx/themes/basic/genindex-split.html:25
msgid "can be huge"
msgstr "может быть очень большим"
-#: sphinx/themes/basic/layout.html:10
+#: sphinx/themes/basic/layout.html:23
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:119
+#: sphinx/themes/basic/layout.html:113
#, python-format
msgid "Search within %(docstitle)s"
msgstr "Поиск в документе «%(docstitle)s»"
-#: sphinx/themes/basic/layout.html:128
+#: sphinx/themes/basic/layout.html:122
msgid "About these documents"
msgstr "Об этих документах…"
-#: sphinx/themes/basic/layout.html:134 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:131
msgid "Copyright"
msgstr "Copyright"
-#: sphinx/themes/basic/layout.html:183
+#: sphinx/themes/basic/layout.html:180
#, 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:182
#, python-format
msgid "&copy; Copyright %(copyright)s."
msgstr "&copy; Copyright %(copyright)s."
-#: sphinx/themes/basic/layout.html:188
+#: sphinx/themes/basic/layout.html:186
#, python-format
msgid "Last updated on %(last_updated)s."
msgstr "Дата последнего обновления: %(last_updated)s."
-#: sphinx/themes/basic/layout.html:191
+#: sphinx/themes/basic/layout.html:189
#, python-format
msgid ""
"Created using <a href=\"http://sphinx.pocoo.org/\">Sphinx</a> "
@@ -472,22 +621,34 @@ 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
+#: sphinx/themes/basic/relations.html:11
+msgid "Previous topic"
+msgstr "Предыдущий раздел"
+
+#: sphinx/themes/basic/relations.html:13
+msgid "previous chapter"
+msgstr "предыдущая глава"
+
+#: sphinx/themes/basic/relations.html:16
+msgid "Next topic"
+msgstr "Следующий раздел"
+
+#: sphinx/themes/basic/relations.html:18
+msgid "next chapter"
+msgstr "следующая глава"
+
+#: sphinx/themes/basic/search.html:18
msgid ""
"Please activate JavaScript to enable the search\n"
" functionality."
msgstr "Для выполнения поиска необходима поддержка JavaScript в браузере."
-#: sphinx/themes/basic/search.html:14
+#: sphinx/themes/basic/search.html:23
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"
@@ -500,19 +661,27 @@ msgstr ""
"упомянуты все указанные слова. Страницы, в которых встречается только "
"часть этих слов, отобраны не будут."
-#: sphinx/themes/basic/search.html:21
+#: sphinx/themes/basic/search.html:30
msgid "search"
msgstr "искать"
-#: sphinx/themes/basic/search.html:25
-#: sphinx/themes/basic/static/searchtools.js:453
+#: sphinx/themes/basic/search.html:34
+#: sphinx/themes/basic/static/searchtools.js:489
msgid "Search Results"
msgstr "Результаты поиска"
-#: sphinx/themes/basic/search.html:27
+#: sphinx/themes/basic/search.html:36
msgid "Your search did not match any results."
msgstr "Результатов по вашему запросу не найдено."
+#: sphinx/themes/basic/searchbox.html:12
+msgid "Quick search"
+msgstr "Быстрый поиск"
+
+#: sphinx/themes/basic/sourcelink.html:11
+msgid "This Page"
+msgstr "На этой странице"
+
#: sphinx/themes/basic/changes/frameset.html:5
#: sphinx/themes/basic/changes/versionchanges.html:12
#, python-format
@@ -541,36 +710,32 @@ msgstr "Изменения в C API"
msgid "Other changes"
msgstr "Другие изменения"
-#: sphinx/themes/basic/static/doctools.js:139 sphinx/writers/html.py:473
-#: sphinx/writers/html.py:478
+#: sphinx/themes/basic/static/doctools.js:154 sphinx/writers/html.py:482
+#: sphinx/writers/html.py:487
msgid "Permalink to this headline"
msgstr "Ссылка на этот заголовок"
-#: sphinx/themes/basic/static/doctools.js:145 sphinx/writers/html.py:80
+#: sphinx/themes/basic/static/doctools.js:160 sphinx/writers/html.py:87
msgid "Permalink to this definition"
msgstr "Ссылка на это определение"
-#: sphinx/themes/basic/static/doctools.js:174
+#: sphinx/themes/basic/static/doctools.js:189
msgid "Hide Search Matches"
msgstr "Снять выделение"
-#: sphinx/themes/basic/static/searchtools.js:274
+#: sphinx/themes/basic/static/searchtools.js:285
msgid "Searching"
msgstr "Поиск"
-#: sphinx/themes/basic/static/searchtools.js:279
+#: sphinx/themes/basic/static/searchtools.js:290
msgid "Preparing search..."
msgstr "Подготовка к поиску..."
-#: sphinx/themes/basic/static/searchtools.js:338
-msgid "module, in "
-msgstr ", модуль в "
-
-#: sphinx/themes/basic/static/searchtools.js:347
+#: sphinx/themes/basic/static/searchtools.js:364
msgid ", in "
msgstr ", в "
-#: sphinx/themes/basic/static/searchtools.js:455
+#: sphinx/themes/basic/static/searchtools.js:491
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,34 +743,41 @@ msgstr ""
"Нет документов, соответствующих вашему запросу. Проверьте, правильно ли "
"выбраны категории и нет ли опечаток в запросе."
-#: sphinx/themes/basic/static/searchtools.js:457
+#: sphinx/themes/basic/static/searchtools.js:493
#, python-format
msgid "Search finished, found %s page(s) matching the search query."
msgstr "Поиск окончен, найдено страниц: %s."
-#: sphinx/writers/latex.py:185
+#: sphinx/themes/default/static/sidebar.js:66
+msgid "Expand sidebar"
+msgstr ""
+
+#: sphinx/themes/default/static/sidebar.js:79
+#: sphinx/themes/default/static/sidebar.js:106
+msgid "Collapse sidebar"
+msgstr ""
+
+#: sphinx/themes/haiku/layout.html:26
+msgid "Contents"
+msgstr ""
+
+#: sphinx/writers/latex.py:171
msgid "Release"
msgstr "Выпуск"
-#: sphinx/writers/latex.py:571
+#: sphinx/writers/latex.py:572 sphinx/writers/manpage.py:178
msgid "Footnotes"
msgstr ""
-#: sphinx/writers/latex.py:639
+#: sphinx/writers/latex.py:641
msgid "continued from previous page"
msgstr ""
-#: sphinx/writers/latex.py:644
+#: sphinx/writers/latex.py:646
#, fuzzy
msgid "Continued on next page"
msgstr "Полный алфавитный указатель на одной странице"
-#: sphinx/writers/text.py:166
-#, python-format
-msgid "Platform: %s"
-msgstr "Платформа: %s"
-
-#: sphinx/writers/text.py:428
+#: sphinx/writers/text.py:422
msgid "[image]"
msgstr "[рисунок]"
-
diff --git a/sphinx/locale/sl/LC_MESSAGES/sphinx.js b/sphinx/locale/sl/LC_MESSAGES/sphinx.js
index 46b1b7b7c..2a2f960a6 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": {"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
+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 ", "Expand sidebar": "", "Permalink to this headline": "Povezava na naslov", "Searching": "I\u0161\u010dem", "Collapse sidebar": "", "Permalink to this definition": "Povezava na to definicijo", "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 eb48b659a..21e64ffd5 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 866610c9c..6028c35c8 100644
--- a/sphinx/locale/sl/LC_MESSAGES/sphinx.po
+++ b/sphinx/locale/sl/LC_MESSAGES/sphinx.po
@@ -1,9 +1,10 @@
+
msgid ""
msgstr ""
-"Project-Id-Version: Sphinx\n"
+"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: 2010-04-20 09:19+0100\n"
+"PO-Revision-Date: 2010-05-24 23:54+0200\n"
"Last-Translator: Luka Marinko <luka.marinko@simt.si>\n"
"Language-Team: Rok Garbas <rok.garbas@gmail.com>\n"
"Plural-Forms: nplurals=1; plural=0\n"
@@ -12,513 +13,672 @@ 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:106 sphinx/writers/latex.py:184
+#: sphinx/writers/manpage.py:67
#, python-format
msgid "%B %d, %Y"
msgstr "%d %B, %Y"
-#: 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
-msgid "Index"
-msgstr "Abecedni seznam"
-
-#: sphinx/environment.py:325
-#: sphinx/writers/latex.py:187
-msgid "Module Index"
-msgstr "Seznam modulov"
-
-#: sphinx/environment.py:326
-#: sphinx/themes/basic/defindex.html:16
-msgid "Search Page"
-msgstr "Iskalna stran"
-
-#: sphinx/roles.py:55
-#: sphinx/directives/desc.py:747
-#, python-format
-msgid "environment variable; %s"
-msgstr "globalna spremenljivka; %s"
-
-#: sphinx/roles.py:62
+#: sphinx/roles.py:174
#, python-format
msgid "Python Enhancement Proposals!PEP %s"
msgstr "Python Enhancement Proposals!PEP %s"
-#: sphinx/builders/changes.py:71
+#: sphinx/builders/changes.py:72
msgid "Builtins"
msgstr "Vgrajeni deli"
-#: sphinx/builders/changes.py:73
+#: sphinx/builders/changes.py:74
msgid "Module level"
msgstr "Nivo modula"
-#: sphinx/builders/html.py:205
+#: sphinx/builders/html.py:266
#, 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:285 sphinx/themes/basic/defindex.html:30
msgid "General Index"
msgstr "Splošni abecedni seznam"
-#: sphinx/builders/html.py:224
+#: sphinx/builders/html.py:285
msgid "index"
msgstr "abecedni seznam"
-#: 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
-msgid "Global Module Index"
-msgstr "Splošen Seznam Modulov"
-
-#: sphinx/builders/html.py:227
-msgid "modules"
-msgstr "Moduli"
-
-#: sphinx/builders/html.py:281
+#: sphinx/builders/html.py:345
msgid "next"
msgstr "naprej"
-#: sphinx/builders/html.py:290
+#: sphinx/builders/html.py:354
msgid "previous"
msgstr "nazaj"
-#: sphinx/builders/latex.py:162
+#: sphinx/builders/latex.py:151
msgid " (in "
-msgstr "(v "
+msgstr " (v "
-#: sphinx/directives/desc.py:97
-msgid "Raises"
-msgstr "Javi"
+#: sphinx/directives/other.py:127
+msgid "Section author: "
+msgstr "Avtor sekcije: "
-#: sphinx/directives/desc.py:101
-msgid "Variable"
-msgstr "Spremenljivka"
+#: sphinx/directives/other.py:129
+msgid "Module author: "
+msgstr "Avtor modula: "
+
+#: sphinx/directives/other.py:131
+#, fuzzy
+msgid "Code author: "
+msgstr "Avtor modula: "
+
+#: sphinx/directives/other.py:133
+msgid "Author: "
+msgstr "Avtor: "
+
+#: sphinx/directives/other.py:238
+msgid "See also"
+msgstr "Poglej Tudi"
+
+#: sphinx/domains/__init__.py:253
+#, python-format
+msgid "%s %s"
+msgstr ""
+
+#: sphinx/domains/c.py:51 sphinx/domains/python.py:49
+msgid "Parameters"
+msgstr "Parametri"
-#: sphinx/directives/desc.py:104
+#: sphinx/domains/c.py:54 sphinx/domains/javascript.py:137
+#: sphinx/domains/python.py:59
msgid "Returns"
msgstr "Vrne"
-#: sphinx/directives/desc.py:113
+#: sphinx/domains/c.py:56 sphinx/domains/python.py:61
msgid "Return type"
msgstr "Vrne tip"
-#: sphinx/directives/desc.py:186
-msgid "Parameter"
-msgstr "Parameter"
+#: sphinx/domains/c.py:133
+#, python-format
+msgid "%s (C function)"
+msgstr "%s (C funkcija)"
-#: sphinx/directives/desc.py:190
-msgid "Parameters"
-msgstr "Parametri"
+#: sphinx/domains/c.py:135
+#, python-format
+msgid "%s (C member)"
+msgstr "%s (C član)"
+
+#: sphinx/domains/c.py:137
+#, python-format
+msgid "%s (C macro)"
+msgstr "%s (C makro)"
+
+#: sphinx/domains/c.py:139
+#, python-format
+msgid "%s (C type)"
+msgstr "%s (C tip)"
+
+#: sphinx/domains/c.py:141
+#, python-format
+msgid "%s (C variable)"
+msgstr "%s (C spremenljivka)"
+
+#: sphinx/domains/c.py:171 sphinx/domains/cpp.py:1031
+#: sphinx/domains/javascript.py:166 sphinx/domains/python.py:497
+msgid "function"
+msgstr "funkcija"
+
+#: sphinx/domains/c.py:172 sphinx/domains/cpp.py:1032
+msgid "member"
+msgstr "član"
+
+#: sphinx/domains/c.py:173
+msgid "macro"
+msgstr ""
+
+#: sphinx/domains/c.py:174 sphinx/domains/cpp.py:1033
+msgid "type"
+msgstr "tip"
+
+#: sphinx/domains/c.py:175
+#, fuzzy
+msgid "variable"
+msgstr "Spremenljivka"
+
+#: sphinx/domains/cpp.py:876
+#, python-format
+msgid "%s (C++ class)"
+msgstr "%s (C++ razred)"
+
+#: sphinx/domains/cpp.py:891
+#, python-format
+msgid "%s (C++ type)"
+msgstr "%s (C++ tip)"
+
+#: sphinx/domains/cpp.py:910
+#, python-format
+msgid "%s (C++ member)"
+msgstr "%s (C++ član)"
+
+#: sphinx/domains/cpp.py:962
+#, python-format
+msgid "%s (C++ function)"
+msgstr "%s (C++ funkcija)"
+
+#: sphinx/domains/cpp.py:1030 sphinx/domains/python.py:499
+msgid "class"
+msgstr "razred"
-#: sphinx/directives/desc.py:418
+#: sphinx/domains/javascript.py:117 sphinx/domains/python.py:221
#, python-format
msgid "%s() (built-in function)"
msgstr "%s() (vgrajene funkcije)"
-#: sphinx/directives/desc.py:419
-#: sphinx/directives/desc.py:476
-#: sphinx/directives/desc.py:488
+#: sphinx/domains/javascript.py:118 sphinx/domains/python.py:285
+#, python-format
+msgid "%s() (%s method)"
+msgstr "%s() (%s metoda)"
+
+#: sphinx/domains/javascript.py:120
+#, python-format
+msgid "%s (global variable or constant)"
+msgstr ""
+
+#: sphinx/domains/javascript.py:122 sphinx/domains/python.py:323
+#, python-format
+msgid "%s (%s attribute)"
+msgstr "%s (%s atribut)"
+
+#: sphinx/domains/javascript.py:131
+#, fuzzy
+msgid "Arguments"
+msgstr "Parametri"
+
+#: sphinx/domains/javascript.py:134
+msgid "Throws"
+msgstr ""
+
+#: sphinx/domains/javascript.py:167 sphinx/domains/python.py:498
+msgid "data"
+msgstr ""
+
+#: sphinx/domains/javascript.py:168 sphinx/domains/python.py:504
+msgid "attribute"
+msgstr "atribut"
+
+#: sphinx/domains/python.py:53
+#, fuzzy
+msgid "Variables"
+msgstr "Spremenljivka"
+
+#: sphinx/domains/python.py:56
+msgid "Raises"
+msgstr "Sproži izjemo"
+
+#: sphinx/domains/python.py:222 sphinx/domains/python.py:279
+#: sphinx/domains/python.py:291 sphinx/domains/python.py:304
#, python-format
msgid "%s() (in module %s)"
msgstr "%s() (v modulu %s)"
-#: sphinx/directives/desc.py:422
+#: sphinx/domains/python.py:225
#, python-format
msgid "%s (built-in variable)"
msgstr "%s (vgrajene spremenljivke)"
-#: sphinx/directives/desc.py:423
-#: sphinx/directives/desc.py:514
+#: sphinx/domains/python.py:226 sphinx/domains/python.py:317
#, python-format
msgid "%s (in module %s)"
msgstr "%s (v modulu %s)"
-#: sphinx/directives/desc.py:439
+#: sphinx/domains/python.py:242
#, python-format
msgid "%s (built-in class)"
msgstr "%s (vgrajen razred)"
-#: sphinx/directives/desc.py:440
+#: sphinx/domains/python.py:243
#, python-format
msgid "%s (class in %s)"
msgstr "%s (razred v %s)"
-#: sphinx/directives/desc.py:480
+#: sphinx/domains/python.py:283
#, python-format
msgid "%s() (%s.%s method)"
msgstr "%s() (%s.%s metoda)"
-#: sphinx/directives/desc.py:482
-#, python-format
-msgid "%s() (%s method)"
-msgstr "%s() (%s metoda)"
-
-#: sphinx/directives/desc.py:492
+#: sphinx/domains/python.py:295
#, python-format
msgid "%s() (%s.%s static method)"
msgstr "%s() (%s.%s statična metoda)"
-#: sphinx/directives/desc.py:495
+#: sphinx/domains/python.py:298
#, python-format
msgid "%s() (%s static method)"
msgstr "%s() (%s statična metoda)"
-#: sphinx/directives/desc.py:518
+#: sphinx/domains/python.py:308
+#, fuzzy, python-format
+msgid "%s() (%s.%s class method)"
+msgstr "%s() (%s.%s metoda)"
+
+#: sphinx/domains/python.py:311
+#, fuzzy, python-format
+msgid "%s() (%s class method)"
+msgstr "%s() (%s metoda)"
+
+#: sphinx/domains/python.py:321
#, python-format
msgid "%s (%s.%s attribute)"
msgstr "%s (%s.%s atribut)"
-#: sphinx/directives/desc.py:520
-#, python-format
-msgid "%s (%s attribute)"
-msgstr "%s (%s atribut)"
+#: sphinx/domains/python.py:366
+msgid "Platforms: "
+msgstr "Platforme:"
-#: sphinx/directives/desc.py:609
+#: sphinx/domains/python.py:372
#, python-format
-msgid "%s (C function)"
-msgstr "%s (C funkcija)"
+msgid "%s (module)"
+msgstr "%s (modul)"
-#: sphinx/directives/desc.py:611
-#, python-format
-msgid "%s (C member)"
-msgstr "%s (C član)"
+#: sphinx/domains/python.py:429
+#, fuzzy
+msgid "Python Module Index"
+msgstr "Seznam modulov"
-#: sphinx/directives/desc.py:613
-#, python-format
-msgid "%s (C macro)"
-msgstr "%s (C makro)"
+#: sphinx/domains/python.py:430
+msgid "modules"
+msgstr "Moduli"
+
+#: sphinx/domains/python.py:475
+msgid "Deprecated"
+msgstr "Zastarelo"
+
+#: sphinx/domains/python.py:500 sphinx/locale/__init__.py:162
+msgid "exception"
+msgstr "izjema"
+
+#: sphinx/domains/python.py:501
+msgid "method"
+msgstr ""
+
+#: sphinx/domains/python.py:502
+#, fuzzy, python-format
+msgid "class method"
+msgstr "%s() (%s metoda)"
+
+#: sphinx/domains/python.py:503
+msgid "static method"
+msgstr "statična metoda"
-#: sphinx/directives/desc.py:615
+#: sphinx/domains/python.py:505 sphinx/locale/__init__.py:158
+msgid "module"
+msgstr "modul"
+
+#: sphinx/domains/rst.py:53
#, python-format
-msgid "%s (C type)"
-msgstr "%s (C tip)"
+msgid "%s (directive)"
+msgstr ""
+
+#: sphinx/domains/rst.py:55
+#, fuzzy, python-format
+msgid "%s (role)"
+msgstr "%s (modul)"
-#: sphinx/directives/desc.py:617
+#: sphinx/domains/rst.py:103
+msgid "directive"
+msgstr ""
+
+#: sphinx/domains/rst.py:104
+#, fuzzy
+msgid "role"
+msgstr "modul"
+
+#: sphinx/domains/std.py:68 sphinx/domains/std.py:84
#, python-format
-msgid "%s (C variable)"
-msgstr "%s (C spremenljivka)"
+msgid "environment variable; %s"
+msgstr "okoljska spremenljivka; %s"
-#: sphinx/directives/desc.py:665
+#: sphinx/domains/std.py:160
#, python-format
msgid "%scommand line option; %s"
-msgstr "%sopcija komandne linije; %s"
+msgstr "%scommand line parameter; %s"
-#: sphinx/directives/other.py:138
-msgid "Platforms: "
-msgstr "Platforma:"
+#: sphinx/domains/std.py:328
+msgid "glossary term"
+msgstr ""
-#: sphinx/directives/other.py:144
-#, python-format
-msgid "%s (module)"
-msgstr "%s (modul)"
+#: sphinx/domains/std.py:329
+msgid "grammar token"
+msgstr ""
-#: sphinx/directives/other.py:193
-msgid "Section author: "
-msgstr "Avtor sekcije:"
+#: sphinx/domains/std.py:330
+msgid "reference label"
+msgstr ""
-#: sphinx/directives/other.py:195
-msgid "Module author: "
-msgstr "Avtor modula:"
+#: sphinx/domains/std.py:331
+msgid "environment variable"
+msgstr "okoljska spremenljivka"
-#: sphinx/directives/other.py:197
-msgid "Author: "
-msgstr "Avtor:"
+#: sphinx/domains/std.py:332
+msgid "program option"
+msgstr ""
-#: sphinx/directives/other.py:317
-msgid "See also"
-msgstr "Poglej tudi"
+#: sphinx/domains/std.py:360 sphinx/themes/basic/genindex-single.html:11
+#: sphinx/themes/basic/genindex-split.html:11
+#: sphinx/themes/basic/genindex-split.html:14
+#: sphinx/themes/basic/genindex.html:11 sphinx/themes/basic/genindex.html:14
+#: sphinx/themes/basic/genindex.html:50 sphinx/themes/basic/layout.html:125
+#: sphinx/writers/latex.py:173
+msgid "Index"
+msgstr "Abecedni seznam"
-#: sphinx/ext/autodoc.py:883
+#: sphinx/domains/std.py:361
+msgid "Module Index"
+msgstr "Seznam modulov"
+
+#: sphinx/domains/std.py:362 sphinx/themes/basic/defindex.html:25
+msgid "Search Page"
+msgstr "Iskalnik"
+
+#: sphinx/ext/autodoc.py:917
#, python-format
msgid " Bases: %s"
-msgstr "Baza: %s"
+msgstr " Baza: %s"
-#: sphinx/ext/autodoc.py:916
+#: sphinx/ext/autodoc.py:950
#, python-format
msgid "alias of :class:`%s`"
-msgstr "alias od :class:`%s`"
+msgstr "vzdevek za :class:`%s`"
#: sphinx/ext/todo.py:41
msgid "Todo"
-msgstr "Naredi"
+msgstr "Todo"
+
+#: sphinx/ext/todo.py:109
+#, fuzzy, python-format
+msgid "(The <<original entry>> is located in %s, line %d.)"
+msgstr "(Originalen vnos se nahaja v %s, v vrstici %d, in ga je moč poiskati "
+
+#: sphinx/ext/todo.py:117
+msgid "original entry"
+msgstr ""
+
+#: sphinx/ext/viewcode.py:66
+msgid "[source]"
+msgstr ""
+
+#: sphinx/ext/viewcode.py:109
+msgid "[docs]"
+msgstr ""
-#: sphinx/ext/todo.py:99
+#: sphinx/ext/viewcode.py:123
+#, fuzzy
+msgid "Module code"
+msgstr "modul"
+
+#: sphinx/ext/viewcode.py:129
#, 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 "
+msgid "<h1>Source code for %s</h1>"
+msgstr ""
-#: sphinx/ext/todo.py:105
-msgid "here"
-msgstr "tukaj"
+#: sphinx/ext/viewcode.py:156
+msgid "Overview: module code"
+msgstr ""
-#: sphinx/locale/__init__.py:15
+#: sphinx/ext/viewcode.py:157
+msgid "<h1>All modules for which code is available</h1>"
+msgstr ""
+
+#: sphinx/locale/__init__.py:139
msgid "Attention"
msgstr "Pozor"
-#: sphinx/locale/__init__.py:16
+#: sphinx/locale/__init__.py:140
msgid "Caution"
msgstr "Previdno"
-#: sphinx/locale/__init__.py:17
+#: sphinx/locale/__init__.py:141
msgid "Danger"
-msgstr "Navarno"
+msgstr "Nevarno"
-#: sphinx/locale/__init__.py:18
+#: sphinx/locale/__init__.py:142
msgid "Error"
msgstr "Napaka"
-#: sphinx/locale/__init__.py:19
+#: sphinx/locale/__init__.py:143
msgid "Hint"
msgstr "Nasvet"
-#: sphinx/locale/__init__.py:20
+#: sphinx/locale/__init__.py:144
msgid "Important"
msgstr "Pomembno"
-#: sphinx/locale/__init__.py:21
+#: sphinx/locale/__init__.py:145
msgid "Note"
msgstr "Opomba"
-#: sphinx/locale/__init__.py:22
+#: sphinx/locale/__init__.py:146
msgid "See Also"
msgstr "Poglej Tudi"
-#: sphinx/locale/__init__.py:23
+#: sphinx/locale/__init__.py:147
msgid "Tip"
msgstr "Nasvet"
-#: sphinx/locale/__init__.py:24
+#: sphinx/locale/__init__.py:148
msgid "Warning"
msgstr "Opozorilo"
-#: sphinx/locale/__init__.py:28
+#: sphinx/locale/__init__.py:152
#, python-format
msgid "New in version %s"
msgstr "Novo v verziji %s"
-#: sphinx/locale/__init__.py:29
+#: sphinx/locale/__init__.py:153
#, python-format
msgid "Changed in version %s"
-msgstr "Spemenjeno v verziji %s"
+msgstr "Spremenjeno v verziji %s"
-#: sphinx/locale/__init__.py:30
+#: sphinx/locale/__init__.py:154
#, python-format
msgid "Deprecated since version %s"
msgstr "Zastarelo od verzije %s"
-#: sphinx/locale/__init__.py:34
-msgid "module"
-msgstr "modul"
-
-#: sphinx/locale/__init__.py:35
+#: sphinx/locale/__init__.py:159
msgid "keyword"
-msgstr "kllučna beseda"
+msgstr "ključna beseda"
-#: sphinx/locale/__init__.py:36
+#: sphinx/locale/__init__.py:160
msgid "operator"
msgstr "operator"
-#: sphinx/locale/__init__.py:37
+#: sphinx/locale/__init__.py:161
msgid "object"
msgstr "objekt"
-#: sphinx/locale/__init__.py:38
-msgid "exception"
-msgstr "izjema"
-
-#: sphinx/locale/__init__.py:39
+#: sphinx/locale/__init__.py:163
msgid "statement"
msgstr "izjava"
-#: sphinx/locale/__init__.py:40
+#: sphinx/locale/__init__.py:164
msgid "built-in function"
msgstr "vgrajene funkcije"
-#: sphinx/themes/basic/defindex.html:2
+#: sphinx/themes/agogo/layout.html:45 sphinx/themes/basic/globaltoc.html:10
+#: sphinx/themes/basic/localtoc.html:11
+msgid "Table Of Contents"
+msgstr "Seznam Vsebine"
+
+#: sphinx/themes/agogo/layout.html:49 sphinx/themes/basic/layout.html:128
+#: sphinx/themes/basic/search.html:11 sphinx/themes/basic/search.html:14
+msgid "Search"
+msgstr "Išči"
+
+#: sphinx/themes/agogo/layout.html:52 sphinx/themes/basic/searchbox.html:15
+msgid "Go"
+msgstr "Potrdi"
+
+#: sphinx/themes/agogo/layout.html:57 sphinx/themes/basic/searchbox.html:20
+msgid "Enter search terms or a module, class or function name."
+msgstr "Vnesi ime modula, razreda ali funkcije."
+
+#: sphinx/themes/agogo/layout.html:78 sphinx/themes/basic/sourcelink.html:14
+msgid "Show Source"
+msgstr "Prikaži izvorno kodo"
+
+#: sphinx/themes/basic/defindex.html:11
msgid "Overview"
msgstr "Pregled"
-#: sphinx/themes/basic/defindex.html:11
+#: sphinx/themes/basic/defindex.html:20
msgid "Indices and tables:"
-msgstr "Kazalo in tabele:"
+msgstr "Kazalo in seznami:"
-#: sphinx/themes/basic/defindex.html:14
+#: sphinx/themes/basic/defindex.html:23
msgid "Complete Table of Contents"
msgstr "Popoln Seznam Vsebine"
-#: sphinx/themes/basic/defindex.html:15
+#: sphinx/themes/basic/defindex.html:24
msgid "lists all sections and subsections"
msgstr "prikazi vse sekcije in podsekcije"
-#: sphinx/themes/basic/defindex.html:17
+#: sphinx/themes/basic/defindex.html:26
msgid "search this documentation"
-msgstr "isči po dokumentaciji"
+msgstr "išči po dokumentaciji"
-#: sphinx/themes/basic/defindex.html:20
+#: sphinx/themes/basic/defindex.html:28
+msgid "Global Module Index"
+msgstr "Splošen seznam modulov"
+
+#: sphinx/themes/basic/defindex.html:29
msgid "quick access to all modules"
msgstr "hiter dostop do vseh modulov"
-#: sphinx/themes/basic/defindex.html:22
+#: sphinx/themes/basic/defindex.html:31
msgid "all functions, classes, terms"
-msgstr "vse funkcije, rezredi, termini"
+msgstr "vse funkcije, razredi, izrazi"
-#: sphinx/themes/basic/genindex-single.html:5
+#: sphinx/themes/basic/genindex-single.html:14
#, python-format
msgid "Index &ndash; %(key)s"
msgstr "Seznam &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
+#: sphinx/themes/basic/genindex-single.html:46
+#: sphinx/themes/basic/genindex-split.html:24
+#: sphinx/themes/basic/genindex-split.html:38
+#: sphinx/themes/basic/genindex.html:56
msgid "Full index on one page"
msgstr "Poln indeks na eni strani"
-#: sphinx/themes/basic/genindex-split.html:7
+#: sphinx/themes/basic/genindex-split.html:16
msgid "Index pages by letter"
msgstr "Indeksiraj strani po črki"
-#: sphinx/themes/basic/genindex-split.html:15
+#: sphinx/themes/basic/genindex-split.html:25
msgid "can be huge"
msgstr "lahko je veliko"
-#: sphinx/themes/basic/layout.html:10
+#: sphinx/themes/basic/layout.html:23
msgid "Navigation"
msgstr "Navigacija"
-#: sphinx/themes/basic/layout.html:42
-msgid "Table Of Contents"
-msgstr "Seznam Vsebine"
-
-#: sphinx/themes/basic/layout.html:48
-msgid "Previous topic"
-msgstr "Prejšnja tema"
-
-#: sphinx/themes/basic/layout.html:50
-msgid "previous chapter"
-msgstr "prejšnje poglavje"
-
-#: sphinx/themes/basic/layout.html:53
-msgid "Next topic"
-msgstr "Naslednja tema"
-
-#: sphinx/themes/basic/layout.html:55
-msgid "next chapter"
-msgstr "naslednje poglavje"
-
-#: sphinx/themes/basic/layout.html:60
-msgid "This Page"
-msgstr "Ta stran"
-
-#: sphinx/themes/basic/layout.html:63
-msgid "Show Source"
-msgstr "Prikaži izvorno kodo"
-
-#: sphinx/themes/basic/layout.html:73
-msgid "Quick search"
-msgstr "Hitro iskanje"
-
-#: sphinx/themes/basic/layout.html:76
-msgid "Go"
-msgstr "Potrdi"
-
-#: sphinx/themes/basic/layout.html:81
-msgid "Enter search terms or a module, class or function name."
-msgstr "Vnesi ime modula, razreda ali funkcije."
-
-#: sphinx/themes/basic/layout.html:119
+#: sphinx/themes/basic/layout.html:113
#, python-format
msgid "Search within %(docstitle)s"
msgstr "Išči med %(docstitle)s"
-#: sphinx/themes/basic/layout.html:128
+#: sphinx/themes/basic/layout.html:122
msgid "About these documents"
-msgstr "O teh dokumentih"
-
-#: sphinx/themes/basic/layout.html:134
-#: sphinx/themes/basic/search.html:2
-#: sphinx/themes/basic/search.html:5
-msgid "Search"
-msgstr "Išči"
+msgstr "O dokumentih"
-#: sphinx/themes/basic/layout.html:137
+#: sphinx/themes/basic/layout.html:131
msgid "Copyright"
msgstr "Vse pravice pridržane"
-#: sphinx/themes/basic/layout.html:183
+#: sphinx/themes/basic/layout.html:180
#, 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:182
#, 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:186
#, 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:189
#, python-format
-msgid "Created using <a href=\"http://sphinx.pocoo.org/\">Sphinx</a> %(sphinx_version)s."
-msgstr "Narejeno s <a href=\"http://sphinx.pocoo.org/\">Sphinx</a> %(sphinx_version)s."
-
-#: sphinx/themes/basic/modindex.html:36
-msgid "Deprecated"
-msgstr "Zastarelo"
+msgid ""
+"Created using <a href=\"http://sphinx.pocoo.org/\">Sphinx</a> "
+"%(sphinx_version)s."
+msgstr ""
+"Narejeno s <a href=\"http://sphinx.pocoo.org/\">Sphinx</a> "
+"%(sphinx_version)s."
#: sphinx/themes/basic/opensearch.xml:4
#, python-format
msgid "Search %(docstitle)s"
msgstr "Išči %(docstitle)s"
-#: sphinx/themes/basic/search.html:9
+#: sphinx/themes/basic/relations.html:11
+msgid "Previous topic"
+msgstr "Prejšnja tema"
+
+#: sphinx/themes/basic/relations.html:13
+msgid "previous chapter"
+msgstr "prejšnje poglavje"
+
+#: sphinx/themes/basic/relations.html:16
+msgid "Next topic"
+msgstr "Naslednja tema"
+
+#: sphinx/themes/basic/relations.html:18
+msgid "next chapter"
+msgstr "naslednje poglavje"
+
+#: sphinx/themes/basic/search.html:18
msgid ""
"Please activate JavaScript to enable the search\n"
" functionality."
msgstr ""
"Za pravilno delovanje Iskanja morete vklopiti\n"
-" JavaScrip."
+" JavaScript."
-#: sphinx/themes/basic/search.html:14
+#: sphinx/themes/basic/search.html:23
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."
-#: sphinx/themes/basic/search.html:21
+#: sphinx/themes/basic/search.html:30
msgid "search"
msgstr "išči"
-#: sphinx/themes/basic/search.html:25
-#: sphinx/themes/basic/static/searchtools.js:453
+#: sphinx/themes/basic/search.html:34
+#: sphinx/themes/basic/static/searchtools.js:489
msgid "Search Results"
msgstr "Rezultati Iskanja"
-#: sphinx/themes/basic/search.html:27
+#: sphinx/themes/basic/search.html:36
msgid "Your search did not match any results."
msgstr "Vaše iskanje ni imelo nobenega zadetka."
+#: sphinx/themes/basic/searchbox.html:12
+msgid "Quick search"
+msgstr "Hitro iskanje"
+
+#: sphinx/themes/basic/sourcelink.html:11
+msgid "This Page"
+msgstr "Trenutna stran"
+
#: sphinx/themes/basic/changes/frameset.html:5
#: sphinx/themes/basic/changes/versionchanges.html:12
#, python-format
@@ -547,68 +707,73 @@ msgstr "C API spremembe"
msgid "Other changes"
msgstr "Ostale spremembe"
-#: sphinx/themes/basic/static/doctools.js:139
-#: sphinx/writers/html.py:473
-#: sphinx/writers/html.py:478
+#: sphinx/themes/basic/static/doctools.js:154 sphinx/writers/html.py:482
+#: sphinx/writers/html.py:487
msgid "Permalink to this headline"
msgstr "Povezava na naslov"
-#: sphinx/themes/basic/static/doctools.js:145
-#: sphinx/writers/html.py:80
+#: sphinx/themes/basic/static/doctools.js:160 sphinx/writers/html.py:87
msgid "Permalink to this definition"
msgstr "Povezava na to definicijo"
-#: sphinx/themes/basic/static/doctools.js:174
+#: sphinx/themes/basic/static/doctools.js:189
msgid "Hide Search Matches"
-msgstr "Skrij Resultate Iskanja"
+msgstr "Skrij resultate iskanja"
-#: sphinx/themes/basic/static/searchtools.js:274
+#: sphinx/themes/basic/static/searchtools.js:285
msgid "Searching"
msgstr "Iščem"
-#: sphinx/themes/basic/static/searchtools.js:279
+#: sphinx/themes/basic/static/searchtools.js:290
msgid "Preparing search..."
msgstr "Pripravljam iskanje..."
-#: sphinx/themes/basic/static/searchtools.js:338
-msgid "module, in "
-msgstr "modul, v "
-
-#: sphinx/themes/basic/static/searchtools.js:347
+#: sphinx/themes/basic/static/searchtools.js:364
msgid ", in "
msgstr ", v "
-#: 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 "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:491
+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 ""
+"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:493
#, 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/themes/default/static/sidebar.js:66
+msgid "Expand sidebar"
+msgstr ""
+
+#: sphinx/themes/default/static/sidebar.js:79
+#: sphinx/themes/default/static/sidebar.js:106
+msgid "Collapse sidebar"
+msgstr ""
+
+#: sphinx/themes/haiku/layout.html:26
+msgid "Contents"
+msgstr ""
+
+#: sphinx/writers/latex.py:171
msgid "Release"
msgstr "Izdaja"
-#: sphinx/writers/latex.py:571
+#: sphinx/writers/latex.py:572 sphinx/writers/manpage.py:178
msgid "Footnotes"
msgstr "Opombe"
-#: sphinx/writers/latex.py:639
+#: sphinx/writers/latex.py:641
msgid "continued from previous page"
msgstr "nadaljevanje iz prejšnje strani"
-#: sphinx/writers/latex.py:644
+#: sphinx/writers/latex.py:646
msgid "Continued on next page"
msgstr "Nadaljevanje na naslednji strani"
-#: sphinx/writers/text.py:166
-#, python-format
-msgid "Platform: %s"
-msgstr "Platforma: %s"
-
-#: sphinx/writers/text.py:428
+#: sphinx/writers/text.py:422
msgid "[image]"
msgstr "[slika]"
-
diff --git a/sphinx/locale/sphinx.pot b/sphinx/locale/sphinx.pot
index eff6e9835..955663aa7 100644
--- a/sphinx/locale/sphinx.pot
+++ b/sphinx/locale/sphinx.pot
@@ -1,14 +1,14 @@
# Translations template for Sphinx.
-# Copyright (C) 2009 ORGANIZATION
+# Copyright (C) 2010 ORGANIZATION
# This file is distributed under the same license as the Sphinx project.
-# FIRST AUTHOR <EMAIL@ADDRESS>, 2009.
+# FIRST AUTHOR <EMAIL@ADDRESS>, 2010.
#
#, fuzzy
msgid ""
msgstr ""
-"Project-Id-Version: Sphinx 0.6.2+/6b02a19ccf31\n"
+"Project-Id-Version: Sphinx 1.0pre/8b971dbc7d36\n"
"Report-Msgid-Bugs-To: EMAIL@ADDRESS\n"
-"POT-Creation-Date: 2009-08-06 22:48+0200\n"
+"POT-Creation-Date: 2010-05-24 23:53+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,227 +17,370 @@ 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:106 sphinx/writers/latex.py:184
+#: sphinx/writers/manpage.py:67
#, python-format
msgid "%B %d, %Y"
msgstr ""
-#: 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
-msgid "Index"
+#: sphinx/roles.py:174
+#, python-format
+msgid "Python Enhancement Proposals!PEP %s"
msgstr ""
-#: sphinx/environment.py:325 sphinx/writers/latex.py:187
-msgid "Module Index"
+#: sphinx/builders/changes.py:72
+msgid "Builtins"
msgstr ""
-#: sphinx/environment.py:326 sphinx/themes/basic/defindex.html:16
-msgid "Search Page"
+#: sphinx/builders/changes.py:74
+msgid "Module level"
msgstr ""
-#: sphinx/roles.py:55 sphinx/directives/desc.py:747
+#: sphinx/builders/html.py:266
#, python-format
-msgid "environment variable; %s"
+msgid "%b %d, %Y"
msgstr ""
-#: sphinx/roles.py:62
+#: sphinx/builders/html.py:285 sphinx/themes/basic/defindex.html:30
+msgid "General Index"
+msgstr ""
+
+#: sphinx/builders/html.py:285
+msgid "index"
+msgstr ""
+
+#: sphinx/builders/html.py:345
+msgid "next"
+msgstr ""
+
+#: sphinx/builders/html.py:354
+msgid "previous"
+msgstr ""
+
+#: sphinx/builders/latex.py:151
+msgid " (in "
+msgstr ""
+
+#: sphinx/directives/other.py:127
+msgid "Section author: "
+msgstr ""
+
+#: sphinx/directives/other.py:129
+msgid "Module author: "
+msgstr ""
+
+#: sphinx/directives/other.py:131
+msgid "Code author: "
+msgstr ""
+
+#: sphinx/directives/other.py:133
+msgid "Author: "
+msgstr ""
+
+#: sphinx/directives/other.py:238
+msgid "See also"
+msgstr ""
+
+#: sphinx/domains/__init__.py:253
#, python-format
-msgid "Python Enhancement Proposals!PEP %s"
+msgid "%s %s"
msgstr ""
-#: sphinx/builders/changes.py:71
-msgid "Builtins"
+#: sphinx/domains/c.py:51 sphinx/domains/python.py:49
+msgid "Parameters"
msgstr ""
-#: sphinx/builders/changes.py:73
-msgid "Module level"
+#: sphinx/domains/c.py:54 sphinx/domains/javascript.py:137
+#: sphinx/domains/python.py:59
+msgid "Returns"
+msgstr ""
+
+#: sphinx/domains/c.py:56 sphinx/domains/python.py:61
+msgid "Return type"
msgstr ""
-#: sphinx/builders/html.py:205
+#: sphinx/domains/c.py:133
#, python-format
-msgid "%b %d, %Y"
+msgid "%s (C function)"
msgstr ""
-#: sphinx/builders/html.py:224 sphinx/themes/basic/defindex.html:21
-msgid "General Index"
+#: sphinx/domains/c.py:135
+#, python-format
+msgid "%s (C member)"
msgstr ""
-#: sphinx/builders/html.py:224
-msgid "index"
+#: sphinx/domains/c.py:137
+#, python-format
+msgid "%s (C macro)"
msgstr ""
-#: 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
-msgid "Global Module Index"
+#: sphinx/domains/c.py:139
+#, python-format
+msgid "%s (C type)"
msgstr ""
-#: sphinx/builders/html.py:227
-msgid "modules"
+#: sphinx/domains/c.py:141
+#, python-format
+msgid "%s (C variable)"
msgstr ""
-#: sphinx/builders/html.py:281
-msgid "next"
+#: sphinx/domains/c.py:171 sphinx/domains/cpp.py:1031
+#: sphinx/domains/javascript.py:166 sphinx/domains/python.py:497
+msgid "function"
msgstr ""
-#: sphinx/builders/html.py:290
-msgid "previous"
+#: sphinx/domains/c.py:172 sphinx/domains/cpp.py:1032
+msgid "member"
msgstr ""
-#: sphinx/builders/latex.py:162
-msgid " (in "
+#: sphinx/domains/c.py:173
+msgid "macro"
msgstr ""
-#: sphinx/directives/desc.py:97
-msgid "Raises"
+#: sphinx/domains/c.py:174 sphinx/domains/cpp.py:1033
+msgid "type"
msgstr ""
-#: sphinx/directives/desc.py:101
-msgid "Variable"
+#: sphinx/domains/c.py:175
+msgid "variable"
msgstr ""
-#: sphinx/directives/desc.py:104
-msgid "Returns"
+#: sphinx/domains/cpp.py:876
+#, python-format
+msgid "%s (C++ class)"
msgstr ""
-#: sphinx/directives/desc.py:113
-msgid "Return type"
+#: sphinx/domains/cpp.py:891
+#, python-format
+msgid "%s (C++ type)"
msgstr ""
-#: sphinx/directives/desc.py:186
-msgid "Parameter"
+#: sphinx/domains/cpp.py:910
+#, python-format
+msgid "%s (C++ member)"
msgstr ""
-#: sphinx/directives/desc.py:190
-msgid "Parameters"
+#: sphinx/domains/cpp.py:962
+#, python-format
+msgid "%s (C++ function)"
+msgstr ""
+
+#: sphinx/domains/cpp.py:1030 sphinx/domains/python.py:499
+msgid "class"
msgstr ""
-#: sphinx/directives/desc.py:418
+#: sphinx/domains/javascript.py:117 sphinx/domains/python.py:221
#, python-format
msgid "%s() (built-in function)"
msgstr ""
-#: sphinx/directives/desc.py:419 sphinx/directives/desc.py:476
-#: sphinx/directives/desc.py:488
+#: sphinx/domains/javascript.py:118 sphinx/domains/python.py:285
+#, python-format
+msgid "%s() (%s method)"
+msgstr ""
+
+#: sphinx/domains/javascript.py:120
+#, python-format
+msgid "%s (global variable or constant)"
+msgstr ""
+
+#: sphinx/domains/javascript.py:122 sphinx/domains/python.py:323
+#, python-format
+msgid "%s (%s attribute)"
+msgstr ""
+
+#: sphinx/domains/javascript.py:131
+msgid "Arguments"
+msgstr ""
+
+#: sphinx/domains/javascript.py:134
+msgid "Throws"
+msgstr ""
+
+#: sphinx/domains/javascript.py:167 sphinx/domains/python.py:498
+msgid "data"
+msgstr ""
+
+#: sphinx/domains/javascript.py:168 sphinx/domains/python.py:504
+msgid "attribute"
+msgstr ""
+
+#: sphinx/domains/python.py:53
+msgid "Variables"
+msgstr ""
+
+#: sphinx/domains/python.py:56
+msgid "Raises"
+msgstr ""
+
+#: sphinx/domains/python.py:222 sphinx/domains/python.py:279
+#: sphinx/domains/python.py:291 sphinx/domains/python.py:304
#, python-format
msgid "%s() (in module %s)"
msgstr ""
-#: sphinx/directives/desc.py:422
+#: sphinx/domains/python.py:225
#, python-format
msgid "%s (built-in variable)"
msgstr ""
-#: sphinx/directives/desc.py:423 sphinx/directives/desc.py:514
+#: sphinx/domains/python.py:226 sphinx/domains/python.py:317
#, python-format
msgid "%s (in module %s)"
msgstr ""
-#: sphinx/directives/desc.py:439
+#: sphinx/domains/python.py:242
#, python-format
msgid "%s (built-in class)"
msgstr ""
-#: sphinx/directives/desc.py:440
+#: sphinx/domains/python.py:243
#, python-format
msgid "%s (class in %s)"
msgstr ""
-#: sphinx/directives/desc.py:480
+#: sphinx/domains/python.py:283
#, python-format
msgid "%s() (%s.%s method)"
msgstr ""
-#: sphinx/directives/desc.py:482
-#, python-format
-msgid "%s() (%s method)"
-msgstr ""
-
-#: sphinx/directives/desc.py:492
+#: sphinx/domains/python.py:295
#, python-format
msgid "%s() (%s.%s static method)"
msgstr ""
-#: sphinx/directives/desc.py:495
+#: sphinx/domains/python.py:298
#, python-format
msgid "%s() (%s static method)"
msgstr ""
-#: sphinx/directives/desc.py:518
+#: sphinx/domains/python.py:308
#, python-format
-msgid "%s (%s.%s attribute)"
+msgid "%s() (%s.%s class method)"
msgstr ""
-#: sphinx/directives/desc.py:520
+#: sphinx/domains/python.py:311
#, python-format
-msgid "%s (%s attribute)"
+msgid "%s() (%s class method)"
msgstr ""
-#: sphinx/directives/desc.py:609
+#: sphinx/domains/python.py:321
#, python-format
-msgid "%s (C function)"
+msgid "%s (%s.%s attribute)"
+msgstr ""
+
+#: sphinx/domains/python.py:366
+msgid "Platforms: "
msgstr ""
-#: sphinx/directives/desc.py:611
+#: sphinx/domains/python.py:372
#, python-format
-msgid "%s (C member)"
+msgid "%s (module)"
+msgstr ""
+
+#: sphinx/domains/python.py:429
+msgid "Python Module Index"
+msgstr ""
+
+#: sphinx/domains/python.py:430
+msgid "modules"
+msgstr ""
+
+#: sphinx/domains/python.py:475
+msgid "Deprecated"
+msgstr ""
+
+#: sphinx/domains/python.py:500 sphinx/locale/__init__.py:162
+msgid "exception"
+msgstr ""
+
+#: sphinx/domains/python.py:501
+msgid "method"
+msgstr ""
+
+#: sphinx/domains/python.py:502
+msgid "class method"
+msgstr ""
+
+#: sphinx/domains/python.py:503
+msgid "static method"
+msgstr ""
+
+#: sphinx/domains/python.py:505 sphinx/locale/__init__.py:158
+msgid "module"
msgstr ""
-#: sphinx/directives/desc.py:613
+#: sphinx/domains/rst.py:53
#, python-format
-msgid "%s (C macro)"
+msgid "%s (directive)"
msgstr ""
-#: sphinx/directives/desc.py:615
+#: sphinx/domains/rst.py:55
#, python-format
-msgid "%s (C type)"
+msgid "%s (role)"
msgstr ""
-#: sphinx/directives/desc.py:617
+#: sphinx/domains/rst.py:103
+msgid "directive"
+msgstr ""
+
+#: sphinx/domains/rst.py:104
+msgid "role"
+msgstr ""
+
+#: sphinx/domains/std.py:68 sphinx/domains/std.py:84
#, python-format
-msgid "%s (C variable)"
+msgid "environment variable; %s"
msgstr ""
-#: sphinx/directives/desc.py:665
+#: sphinx/domains/std.py:160
#, python-format
msgid "%scommand line option; %s"
msgstr ""
-#: sphinx/directives/other.py:138
-msgid "Platforms: "
+#: sphinx/domains/std.py:328
+msgid "glossary term"
msgstr ""
-#: sphinx/directives/other.py:144
-#, python-format
-msgid "%s (module)"
+#: sphinx/domains/std.py:329
+msgid "grammar token"
msgstr ""
-#: sphinx/directives/other.py:193
-msgid "Section author: "
+#: sphinx/domains/std.py:330
+msgid "reference label"
msgstr ""
-#: sphinx/directives/other.py:195
-msgid "Module author: "
+#: sphinx/domains/std.py:331
+msgid "environment variable"
msgstr ""
-#: sphinx/directives/other.py:197
-msgid "Author: "
+#: sphinx/domains/std.py:332
+msgid "program option"
msgstr ""
-#: sphinx/directives/other.py:317
-msgid "See also"
+#: sphinx/domains/std.py:360 sphinx/themes/basic/genindex-single.html:11
+#: sphinx/themes/basic/genindex-split.html:11
+#: sphinx/themes/basic/genindex-split.html:14
+#: sphinx/themes/basic/genindex.html:11 sphinx/themes/basic/genindex.html:14
+#: sphinx/themes/basic/genindex.html:50 sphinx/themes/basic/layout.html:125
+#: sphinx/writers/latex.py:173
+msgid "Index"
msgstr ""
-#: sphinx/ext/autodoc.py:883
+#: sphinx/domains/std.py:361
+msgid "Module Index"
+msgstr ""
+
+#: sphinx/domains/std.py:362 sphinx/themes/basic/defindex.html:25
+msgid "Search Page"
+msgstr ""
+
+#: sphinx/ext/autodoc.py:917
#, python-format
msgid " Bases: %s"
msgstr ""
-#: sphinx/ext/autodoc.py:916
+#: sphinx/ext/autodoc.py:950
#, python-format
msgid "alias of :class:`%s`"
msgstr ""
@@ -246,246 +389,256 @@ msgstr ""
msgid "Todo"
msgstr ""
-#: sphinx/ext/todo.py:99
+#: sphinx/ext/todo.py:109
#, python-format
-msgid "(The original entry is located in %s, line %d and can be found "
+msgid "(The <<original entry>> is located in %s, line %d.)"
+msgstr ""
+
+#: sphinx/ext/todo.py:117
+msgid "original entry"
msgstr ""
-#: sphinx/ext/todo.py:105
-msgid "here"
+#: sphinx/ext/viewcode.py:66
+msgid "[source]"
msgstr ""
-#: sphinx/locale/__init__.py:15
+#: sphinx/ext/viewcode.py:109
+msgid "[docs]"
+msgstr ""
+
+#: sphinx/ext/viewcode.py:123
+msgid "Module code"
+msgstr ""
+
+#: sphinx/ext/viewcode.py:129
+#, python-format
+msgid "<h1>Source code for %s</h1>"
+msgstr ""
+
+#: sphinx/ext/viewcode.py:156
+msgid "Overview: module code"
+msgstr ""
+
+#: sphinx/ext/viewcode.py:157
+msgid "<h1>All modules for which code is available</h1>"
+msgstr ""
+
+#: sphinx/locale/__init__.py:139
msgid "Attention"
msgstr ""
-#: sphinx/locale/__init__.py:16
+#: sphinx/locale/__init__.py:140
msgid "Caution"
msgstr ""
-#: sphinx/locale/__init__.py:17
+#: sphinx/locale/__init__.py:141
msgid "Danger"
msgstr ""
-#: sphinx/locale/__init__.py:18
+#: sphinx/locale/__init__.py:142
msgid "Error"
msgstr ""
-#: sphinx/locale/__init__.py:19
+#: sphinx/locale/__init__.py:143
msgid "Hint"
msgstr ""
-#: sphinx/locale/__init__.py:20
+#: sphinx/locale/__init__.py:144
msgid "Important"
msgstr ""
-#: sphinx/locale/__init__.py:21
+#: sphinx/locale/__init__.py:145
msgid "Note"
msgstr ""
-#: sphinx/locale/__init__.py:22
+#: sphinx/locale/__init__.py:146
msgid "See Also"
msgstr ""
-#: sphinx/locale/__init__.py:23
+#: sphinx/locale/__init__.py:147
msgid "Tip"
msgstr ""
-#: sphinx/locale/__init__.py:24
+#: sphinx/locale/__init__.py:148
msgid "Warning"
msgstr ""
-#: sphinx/locale/__init__.py:28
+#: sphinx/locale/__init__.py:152
#, python-format
msgid "New in version %s"
msgstr ""
-#: sphinx/locale/__init__.py:29
+#: sphinx/locale/__init__.py:153
#, python-format
msgid "Changed in version %s"
msgstr ""
-#: sphinx/locale/__init__.py:30
+#: sphinx/locale/__init__.py:154
#, python-format
msgid "Deprecated since version %s"
msgstr ""
-#: sphinx/locale/__init__.py:34
-msgid "module"
-msgstr ""
-
-#: sphinx/locale/__init__.py:35
+#: sphinx/locale/__init__.py:159
msgid "keyword"
msgstr ""
-#: sphinx/locale/__init__.py:36
+#: sphinx/locale/__init__.py:160
msgid "operator"
msgstr ""
-#: sphinx/locale/__init__.py:37
+#: sphinx/locale/__init__.py:161
msgid "object"
msgstr ""
-#: sphinx/locale/__init__.py:38
-msgid "exception"
-msgstr ""
-
-#: sphinx/locale/__init__.py:39
+#: sphinx/locale/__init__.py:163
msgid "statement"
msgstr ""
-#: sphinx/locale/__init__.py:40
+#: sphinx/locale/__init__.py:164
msgid "built-in function"
msgstr ""
-#: sphinx/themes/basic/defindex.html:2
-msgid "Overview"
+#: sphinx/themes/agogo/layout.html:45 sphinx/themes/basic/globaltoc.html:10
+#: sphinx/themes/basic/localtoc.html:11
+msgid "Table Of Contents"
+msgstr ""
+
+#: sphinx/themes/agogo/layout.html:49 sphinx/themes/basic/layout.html:128
+#: sphinx/themes/basic/search.html:11 sphinx/themes/basic/search.html:14
+msgid "Search"
+msgstr ""
+
+#: sphinx/themes/agogo/layout.html:52 sphinx/themes/basic/searchbox.html:15
+msgid "Go"
+msgstr ""
+
+#: sphinx/themes/agogo/layout.html:57 sphinx/themes/basic/searchbox.html:20
+msgid "Enter search terms or a module, class or function name."
+msgstr ""
+
+#: sphinx/themes/agogo/layout.html:78 sphinx/themes/basic/sourcelink.html:14
+msgid "Show Source"
msgstr ""
#: sphinx/themes/basic/defindex.html:11
+msgid "Overview"
+msgstr ""
+
+#: sphinx/themes/basic/defindex.html:20
msgid "Indices and tables:"
msgstr ""
-#: sphinx/themes/basic/defindex.html:14
+#: sphinx/themes/basic/defindex.html:23
msgid "Complete Table of Contents"
msgstr ""
-#: sphinx/themes/basic/defindex.html:15
+#: sphinx/themes/basic/defindex.html:24
msgid "lists all sections and subsections"
msgstr ""
-#: sphinx/themes/basic/defindex.html:17
+#: sphinx/themes/basic/defindex.html:26
msgid "search this documentation"
msgstr ""
-#: sphinx/themes/basic/defindex.html:20
+#: sphinx/themes/basic/defindex.html:28
+msgid "Global Module Index"
+msgstr ""
+
+#: sphinx/themes/basic/defindex.html:29
msgid "quick access to all modules"
msgstr ""
-#: sphinx/themes/basic/defindex.html:22
+#: sphinx/themes/basic/defindex.html:31
msgid "all functions, classes, terms"
msgstr ""
-#: sphinx/themes/basic/genindex-single.html:5
+#: sphinx/themes/basic/genindex-single.html:14
#, python-format
msgid "Index &ndash; %(key)s"
msgstr ""
-#: 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
+#: sphinx/themes/basic/genindex-single.html:46
+#: sphinx/themes/basic/genindex-split.html:24
+#: sphinx/themes/basic/genindex-split.html:38
+#: sphinx/themes/basic/genindex.html:56
msgid "Full index on one page"
msgstr ""
-#: sphinx/themes/basic/genindex-split.html:7
+#: sphinx/themes/basic/genindex-split.html:16
msgid "Index pages by letter"
msgstr ""
-#: sphinx/themes/basic/genindex-split.html:15
+#: sphinx/themes/basic/genindex-split.html:25
msgid "can be huge"
msgstr ""
-#: sphinx/themes/basic/layout.html:10
+#: sphinx/themes/basic/layout.html:23
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:119
+#: sphinx/themes/basic/layout.html:113
#, python-format
msgid "Search within %(docstitle)s"
msgstr ""
-#: sphinx/themes/basic/layout.html:128
+#: sphinx/themes/basic/layout.html:122
msgid "About these documents"
msgstr ""
-#: sphinx/themes/basic/layout.html:134 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:131
msgid "Copyright"
msgstr ""
-#: sphinx/themes/basic/layout.html:183
+#: sphinx/themes/basic/layout.html:180
#, python-format
msgid "&copy; <a href=\"%(path)s\">Copyright</a> %(copyright)s."
msgstr ""
-#: sphinx/themes/basic/layout.html:185
+#: sphinx/themes/basic/layout.html:182
#, python-format
msgid "&copy; Copyright %(copyright)s."
msgstr ""
-#: sphinx/themes/basic/layout.html:188
+#: sphinx/themes/basic/layout.html:186
#, python-format
msgid "Last updated on %(last_updated)s."
msgstr ""
-#: sphinx/themes/basic/layout.html:191
+#: sphinx/themes/basic/layout.html:189
#, python-format
msgid ""
"Created using <a href=\"http://sphinx.pocoo.org/\">Sphinx</a> "
"%(sphinx_version)s."
msgstr ""
-#: sphinx/themes/basic/modindex.html:36
-msgid "Deprecated"
-msgstr ""
-
#: sphinx/themes/basic/opensearch.xml:4
#, python-format
msgid "Search %(docstitle)s"
msgstr ""
-#: sphinx/themes/basic/search.html:9
+#: sphinx/themes/basic/relations.html:11
+msgid "Previous topic"
+msgstr ""
+
+#: sphinx/themes/basic/relations.html:13
+msgid "previous chapter"
+msgstr ""
+
+#: sphinx/themes/basic/relations.html:16
+msgid "Next topic"
+msgstr ""
+
+#: sphinx/themes/basic/relations.html:18
+msgid "next chapter"
+msgstr ""
+
+#: sphinx/themes/basic/search.html:18
msgid ""
"Please activate JavaScript to enable the search\n"
" functionality."
msgstr ""
-#: sphinx/themes/basic/search.html:14
+#: sphinx/themes/basic/search.html:23
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"
@@ -493,19 +646,27 @@ msgid ""
" containing fewer words won't appear in the result list."
msgstr ""
-#: sphinx/themes/basic/search.html:21
+#: sphinx/themes/basic/search.html:30
msgid "search"
msgstr ""
-#: sphinx/themes/basic/search.html:25
-#: sphinx/themes/basic/static/searchtools.js:453
+#: sphinx/themes/basic/search.html:34
+#: sphinx/themes/basic/static/searchtools.js:489
msgid "Search Results"
msgstr ""
-#: sphinx/themes/basic/search.html:27
+#: sphinx/themes/basic/search.html:36
msgid "Your search did not match any results."
msgstr ""
+#: sphinx/themes/basic/searchbox.html:12
+msgid "Quick search"
+msgstr ""
+
+#: sphinx/themes/basic/sourcelink.html:11
+msgid "This Page"
+msgstr ""
+
#: sphinx/themes/basic/changes/frameset.html:5
#: sphinx/themes/basic/changes/versionchanges.html:12
#, python-format
@@ -534,68 +695,72 @@ msgstr ""
msgid "Other changes"
msgstr ""
-#: sphinx/themes/basic/static/doctools.js:139 sphinx/writers/html.py:473
-#: sphinx/writers/html.py:478
+#: sphinx/themes/basic/static/doctools.js:154 sphinx/writers/html.py:482
+#: sphinx/writers/html.py:487
msgid "Permalink to this headline"
msgstr ""
-#: sphinx/themes/basic/static/doctools.js:145 sphinx/writers/html.py:80
+#: sphinx/themes/basic/static/doctools.js:160 sphinx/writers/html.py:87
msgid "Permalink to this definition"
msgstr ""
-#: sphinx/themes/basic/static/doctools.js:174
+#: sphinx/themes/basic/static/doctools.js:189
msgid "Hide Search Matches"
msgstr ""
-#: sphinx/themes/basic/static/searchtools.js:274
+#: sphinx/themes/basic/static/searchtools.js:285
msgid "Searching"
msgstr ""
-#: sphinx/themes/basic/static/searchtools.js:279
+#: sphinx/themes/basic/static/searchtools.js:290
msgid "Preparing search..."
msgstr ""
-#: sphinx/themes/basic/static/searchtools.js:338
-msgid "module, in "
-msgstr ""
-
-#: sphinx/themes/basic/static/searchtools.js:347
+#: sphinx/themes/basic/static/searchtools.js:364
msgid ", in "
msgstr ""
-#: sphinx/themes/basic/static/searchtools.js:455
+#: sphinx/themes/basic/static/searchtools.js:491
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:493
#, python-format
msgid "Search finished, found %s page(s) matching the search query."
msgstr ""
-#: sphinx/writers/latex.py:185
+#: sphinx/themes/default/static/sidebar.js:66
+msgid "Expand sidebar"
+msgstr ""
+
+#: sphinx/themes/default/static/sidebar.js:79
+#: sphinx/themes/default/static/sidebar.js:106
+msgid "Collapse sidebar"
+msgstr ""
+
+#: sphinx/themes/haiku/layout.html:26
+msgid "Contents"
+msgstr ""
+
+#: sphinx/writers/latex.py:171
msgid "Release"
msgstr ""
-#: sphinx/writers/latex.py:571
+#: sphinx/writers/latex.py:572 sphinx/writers/manpage.py:178
msgid "Footnotes"
msgstr ""
-#: sphinx/writers/latex.py:639
+#: sphinx/writers/latex.py:641
msgid "continued from previous page"
msgstr ""
-#: sphinx/writers/latex.py:644
+#: sphinx/writers/latex.py:646
msgid "Continued on next page"
msgstr ""
-#: sphinx/writers/text.py:166
-#, python-format
-msgid "Platform: %s"
-msgstr ""
-
-#: sphinx/writers/text.py:428
+#: sphinx/writers/text.py:422
msgid "[image]"
msgstr ""
diff --git a/sphinx/locale/tr/LC_MESSAGES/sphinx.js b/sphinx/locale/tr/LC_MESSAGES/sphinx.js
new file mode 100644
index 000000000..77e2ab226
--- /dev/null
+++ b/sphinx/locale/tr/LC_MESSAGES/sphinx.js
@@ -0,0 +1 @@
+Documentation.addTranslations({"locale": "tr", "plural_expr": "0", "messages": {"Search Results": "Arama Sonu\u00e7lar\u0131", "Preparing search...": "Aramaya haz\u0131rlan\u0131yor...", "Your search did not match any documents. Please make sure that all words are spelled correctly and that you've selected enough categories.": "Arama sonucunda hi\u00e7bir belge bulunamad\u0131. B\u00fct\u00fcn kelimeleri do\u011fru yazd\u0131\u011f\u0131n\u0131zda ve yeterli kategori se\u00e7imi yapt\u0131\u011f\u0131n\u0131zdan emin olun.", "Search finished, found %s page(s) matching the search query.": "Arama sonu\u00e7land\u0131, aramayla e\u015fle\u015fen %s sayfa bulundu.", ", in ": ", \u015funun i\u00e7inde:", "Expand sidebar": "", "Permalink to this headline": "Bu ba\u015fl\u0131\u011f\u0131n kal\u0131c\u0131 ba\u011flant\u0131s\u0131", "Searching": "Ar\u0131yor", "Collapse sidebar": "", "Permalink to this definition": "Bu tan\u0131m\u0131n kal\u0131c\u0131 ba\u011flant\u0131s\u0131", "Hide Search Matches": "Arama Sonu\u00e7lar\u0131n\u0131 Gizle"}}); \ No newline at end of file
diff --git a/sphinx/locale/tr/LC_MESSAGES/sphinx.mo b/sphinx/locale/tr/LC_MESSAGES/sphinx.mo
new file mode 100644
index 000000000..65df784f4
--- /dev/null
+++ b/sphinx/locale/tr/LC_MESSAGES/sphinx.mo
Binary files differ
diff --git a/sphinx/locale/tr/LC_MESSAGES/sphinx.po b/sphinx/locale/tr/LC_MESSAGES/sphinx.po
new file mode 100644
index 000000000..27d406d76
--- /dev/null
+++ b/sphinx/locale/tr/LC_MESSAGES/sphinx.po
@@ -0,0 +1,785 @@
+# Turkish translations for Sphinx.
+# Copyright (C) 2009 ORGANIZATION
+# This file is distributed under the same license as the Sphinx project.
+# FIRST AUTHOR <EMAIL@ADDRESS>, 2009.
+#
+msgid ""
+msgstr ""
+"Project-Id-Version: Sphinx 0.6.2+/6b02a19ccf31\n"
+"Report-Msgid-Bugs-To: EMAIL@ADDRESS\n"
+"POT-Creation-Date: 2009-08-06 22:48+0200\n"
+"PO-Revision-Date: 2010-05-24 23:54+0200\n"
+"Last-Translator: Firat Ozgul <kistihza@yahoo.com>\n"
+"Language-Team: Turkish <kistihza@yahoo.com>\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:106 sphinx/writers/latex.py:184
+#: sphinx/writers/manpage.py:67
+#, python-format
+msgid "%B %d, %Y"
+msgstr "%d %B %Y"
+
+#: sphinx/roles.py:174
+#, python-format
+msgid "Python Enhancement Proposals!PEP %s"
+msgstr "Python'u İyileştirme Önerileri!PEP %s"
+
+#: sphinx/builders/changes.py:72
+msgid "Builtins"
+msgstr "Gömülü"
+
+#: sphinx/builders/changes.py:74
+msgid "Module level"
+msgstr "Modül düzeyi"
+
+#: sphinx/builders/html.py:266
+#, python-format
+msgid "%b %d, %Y"
+msgstr "%d %b %Y"
+
+#: sphinx/builders/html.py:285 sphinx/themes/basic/defindex.html:30
+msgid "General Index"
+msgstr "Genel Dizin"
+
+#: sphinx/builders/html.py:285
+msgid "index"
+msgstr "dizin"
+
+#: sphinx/builders/html.py:345
+msgid "next"
+msgstr "sonraki"
+
+#: sphinx/builders/html.py:354
+msgid "previous"
+msgstr "önceki"
+
+#: sphinx/builders/latex.py:151
+msgid " (in "
+msgstr " (şunun içinde: "
+
+#: sphinx/directives/other.py:127
+msgid "Section author: "
+msgstr "Bölüm yazarı: "
+
+#: sphinx/directives/other.py:129
+msgid "Module author: "
+msgstr "Modül yazarı: "
+
+#: sphinx/directives/other.py:131
+#, fuzzy
+msgid "Code author: "
+msgstr "Modül yazarı: "
+
+#: sphinx/directives/other.py:133
+msgid "Author: "
+msgstr "Yazarı: "
+
+#: sphinx/directives/other.py:238
+msgid "See also"
+msgstr "Ayrıca bkz."
+
+#: sphinx/domains/__init__.py:253
+#, python-format
+msgid "%s %s"
+msgstr ""
+
+#: sphinx/domains/c.py:51 sphinx/domains/python.py:49
+msgid "Parameters"
+msgstr "Parametreler"
+
+#: sphinx/domains/c.py:54 sphinx/domains/javascript.py:137
+#: sphinx/domains/python.py:59
+msgid "Returns"
+msgstr "Şunu döndürür:"
+
+#: sphinx/domains/c.py:56 sphinx/domains/python.py:61
+msgid "Return type"
+msgstr "Dönüş tipi"
+
+#: sphinx/domains/c.py:133
+#, python-format
+msgid "%s (C function)"
+msgstr "%s (C fonksiyonu)"
+
+#: sphinx/domains/c.py:135
+#, python-format
+msgid "%s (C member)"
+msgstr "%s (C öğesi)"
+
+#: sphinx/domains/c.py:137
+#, python-format
+msgid "%s (C macro)"
+msgstr "%s (C makrosu)"
+
+#: sphinx/domains/c.py:139
+#, python-format
+msgid "%s (C type)"
+msgstr "%s (C tipi)"
+
+#: sphinx/domains/c.py:141
+#, python-format
+msgid "%s (C variable)"
+msgstr "%s (C değişkeni)"
+
+#: sphinx/domains/c.py:171 sphinx/domains/cpp.py:1031
+#: sphinx/domains/javascript.py:166 sphinx/domains/python.py:497
+msgid "function"
+msgstr "fonksiyonu"
+
+#: sphinx/domains/c.py:172 sphinx/domains/cpp.py:1032
+msgid "member"
+msgstr "öğesi"
+
+#: sphinx/domains/c.py:173
+msgid "macro"
+msgstr ""
+
+#: sphinx/domains/c.py:174 sphinx/domains/cpp.py:1033
+msgid "type"
+msgstr "tipi"
+
+#: sphinx/domains/c.py:175
+#, fuzzy
+msgid "variable"
+msgstr "Değişken"
+
+#: sphinx/domains/cpp.py:876
+#, python-format
+msgid "%s (C++ class)"
+msgstr "%s (C++ sınıf)"
+
+#: sphinx/domains/cpp.py:891
+#, python-format
+msgid "%s (C++ type)"
+msgstr "%s (C++ tipi)"
+
+#: sphinx/domains/cpp.py:910
+#, python-format
+msgid "%s (C++ member)"
+msgstr "%s (C++ öğesi)"
+
+#: sphinx/domains/cpp.py:962
+#, python-format
+msgid "%s (C++ function)"
+msgstr "%s (C++ fonksiyonu)"
+
+#: sphinx/domains/cpp.py:1030 sphinx/domains/python.py:499
+msgid "class"
+msgstr "sınıf"
+
+#: sphinx/domains/javascript.py:117 sphinx/domains/python.py:221
+#, python-format
+msgid "%s() (built-in function)"
+msgstr "%s() (gömülü fonksiyon)"
+
+#: sphinx/domains/javascript.py:118 sphinx/domains/python.py:285
+#, python-format
+msgid "%s() (%s method)"
+msgstr "%s() (%s metodu)"
+
+#: sphinx/domains/javascript.py:120
+#, python-format
+msgid "%s (global variable or constant)"
+msgstr ""
+
+#: sphinx/domains/javascript.py:122 sphinx/domains/python.py:323
+#, python-format
+msgid "%s (%s attribute)"
+msgstr "%s (%s niteliği)"
+
+#: sphinx/domains/javascript.py:131
+#, fuzzy
+msgid "Arguments"
+msgstr "Parametreler"
+
+#: sphinx/domains/javascript.py:134
+msgid "Throws"
+msgstr ""
+
+#: sphinx/domains/javascript.py:167 sphinx/domains/python.py:498
+msgid "data"
+msgstr ""
+
+#: sphinx/domains/javascript.py:168 sphinx/domains/python.py:504
+msgid "attribute"
+msgstr "niteliği"
+
+#: sphinx/domains/python.py:53
+#, fuzzy
+msgid "Variables"
+msgstr "Değişken"
+
+#: sphinx/domains/python.py:56
+msgid "Raises"
+msgstr "Şunu üretir:"
+
+#: sphinx/domains/python.py:222 sphinx/domains/python.py:279
+#: sphinx/domains/python.py:291 sphinx/domains/python.py:304
+#, python-format
+msgid "%s() (in module %s)"
+msgstr "%s() (%s modülü içinde)"
+
+#: sphinx/domains/python.py:225
+#, python-format
+msgid "%s (built-in variable)"
+msgstr "%s (gömülü değişken)"
+
+#: sphinx/domains/python.py:226 sphinx/domains/python.py:317
+#, python-format
+msgid "%s (in module %s)"
+msgstr "%s (%s modülü içinde)"
+
+#: sphinx/domains/python.py:242
+#, python-format
+msgid "%s (built-in class)"
+msgstr "%s (gömülü sınıf)"
+
+#: sphinx/domains/python.py:243
+#, python-format
+msgid "%s (class in %s)"
+msgstr "%s (sınıf %s içinde)"
+
+#: sphinx/domains/python.py:283
+#, python-format
+msgid "%s() (%s.%s method)"
+msgstr "%s() (%s.%s metodu)"
+
+#: sphinx/domains/python.py:295
+#, python-format
+msgid "%s() (%s.%s static method)"
+msgstr "%s() (%s.%s statik metodu)"
+
+#: sphinx/domains/python.py:298
+#, python-format
+msgid "%s() (%s static method)"
+msgstr "%s() (%s statik metodu)"
+
+#: sphinx/domains/python.py:308
+#, fuzzy, python-format
+msgid "%s() (%s.%s class method)"
+msgstr "%s() (%s.%s metodu)"
+
+#: sphinx/domains/python.py:311
+#, fuzzy, python-format
+msgid "%s() (%s class method)"
+msgstr "%s() (%s metodu)"
+
+#: sphinx/domains/python.py:321
+#, python-format
+msgid "%s (%s.%s attribute)"
+msgstr "%s (%s.%s niteliği)"
+
+#: sphinx/domains/python.py:366
+msgid "Platforms: "
+msgstr "Platformlar:"
+
+#: sphinx/domains/python.py:372
+#, python-format
+msgid "%s (module)"
+msgstr "%s (modül)"
+
+#: sphinx/domains/python.py:429
+#, fuzzy
+msgid "Python Module Index"
+msgstr "Modül Dizini"
+
+#: sphinx/domains/python.py:430
+msgid "modules"
+msgstr "modüller"
+
+#: sphinx/domains/python.py:475
+msgid "Deprecated"
+msgstr "Önerilmiyor"
+
+#: sphinx/domains/python.py:500 sphinx/locale/__init__.py:162
+msgid "exception"
+msgstr "istisna"
+
+#: sphinx/domains/python.py:501
+msgid "method"
+msgstr ""
+
+#: sphinx/domains/python.py:502
+#, fuzzy, python-format
+msgid "class method"
+msgstr "%s() (%s metodu)"
+
+#: sphinx/domains/python.py:503
+msgid "static method"
+msgstr "statik metodu"
+
+#: sphinx/domains/python.py:505 sphinx/locale/__init__.py:158
+msgid "module"
+msgstr "modül"
+
+#: sphinx/domains/rst.py:53
+#, python-format
+msgid "%s (directive)"
+msgstr ""
+
+#: sphinx/domains/rst.py:55
+#, fuzzy, python-format
+msgid "%s (role)"
+msgstr "%s (modül)"
+
+#: sphinx/domains/rst.py:103
+msgid "directive"
+msgstr ""
+
+#: sphinx/domains/rst.py:104
+#, fuzzy
+msgid "role"
+msgstr "modül"
+
+#: sphinx/domains/std.py:68 sphinx/domains/std.py:84
+#, python-format
+msgid "environment variable; %s"
+msgstr "çevre değişkeni; %s"
+
+#: sphinx/domains/std.py:160
+#, python-format
+msgid "%scommand line option; %s"
+msgstr "%skomut satırı seçeneği; %s"
+
+#: sphinx/domains/std.py:328
+msgid "glossary term"
+msgstr ""
+
+#: sphinx/domains/std.py:329
+msgid "grammar token"
+msgstr ""
+
+#: sphinx/domains/std.py:330
+msgid "reference label"
+msgstr ""
+
+#: sphinx/domains/std.py:331
+msgid "environment variable"
+msgstr "çevre değişkeni"
+
+#: sphinx/domains/std.py:332
+msgid "program option"
+msgstr ""
+
+#: sphinx/domains/std.py:360 sphinx/themes/basic/genindex-single.html:11
+#: sphinx/themes/basic/genindex-split.html:11
+#: sphinx/themes/basic/genindex-split.html:14
+#: sphinx/themes/basic/genindex.html:11 sphinx/themes/basic/genindex.html:14
+#: sphinx/themes/basic/genindex.html:50 sphinx/themes/basic/layout.html:125
+#: sphinx/writers/latex.py:173
+msgid "Index"
+msgstr "Dizin"
+
+#: sphinx/domains/std.py:361
+msgid "Module Index"
+msgstr "Modül Dizini"
+
+#: sphinx/domains/std.py:362 sphinx/themes/basic/defindex.html:25
+msgid "Search Page"
+msgstr "Arama Sayfası"
+
+#: sphinx/ext/autodoc.py:917
+#, python-format
+msgid " Bases: %s"
+msgstr " Taban: %s"
+
+#: sphinx/ext/autodoc.py:950
+#, python-format
+msgid "alias of :class:`%s`"
+msgstr "şunun takma adı: :class:`%s`"
+
+#: sphinx/ext/todo.py:41
+msgid "Todo"
+msgstr "Yapılacaklar"
+
+#: sphinx/ext/todo.py:109
+#, fuzzy, python-format
+msgid "(The <<original entry>> is located in %s, line %d.)"
+msgstr "(%s içinde ve %d satırındaki özgün girdi şurada bulunuyor "
+
+#: sphinx/ext/todo.py:117
+msgid "original entry"
+msgstr ""
+
+#: sphinx/ext/viewcode.py:66
+msgid "[source]"
+msgstr ""
+
+#: sphinx/ext/viewcode.py:109
+msgid "[docs]"
+msgstr ""
+
+#: sphinx/ext/viewcode.py:123
+#, fuzzy
+msgid "Module code"
+msgstr "modül"
+
+#: sphinx/ext/viewcode.py:129
+#, python-format
+msgid "<h1>Source code for %s</h1>"
+msgstr ""
+
+#: sphinx/ext/viewcode.py:156
+msgid "Overview: module code"
+msgstr ""
+
+#: sphinx/ext/viewcode.py:157
+msgid "<h1>All modules for which code is available</h1>"
+msgstr ""
+
+#: sphinx/locale/__init__.py:139
+msgid "Attention"
+msgstr "Dikkat"
+
+#: sphinx/locale/__init__.py:140
+msgid "Caution"
+msgstr "Uyarı"
+
+#: sphinx/locale/__init__.py:141
+msgid "Danger"
+msgstr "Tehlike"
+
+#: sphinx/locale/__init__.py:142
+msgid "Error"
+msgstr "Hata"
+
+#: sphinx/locale/__init__.py:143
+msgid "Hint"
+msgstr "İpucu"
+
+#: sphinx/locale/__init__.py:144
+msgid "Important"
+msgstr "Önemli"
+
+#: sphinx/locale/__init__.py:145
+msgid "Note"
+msgstr "Not"
+
+#: sphinx/locale/__init__.py:146
+msgid "See Also"
+msgstr "Ayrıca bkz."
+
+#: sphinx/locale/__init__.py:147
+msgid "Tip"
+msgstr "Tüyo"
+
+#: sphinx/locale/__init__.py:148
+msgid "Warning"
+msgstr "Uyarı"
+
+#: sphinx/locale/__init__.py:152
+#, python-format
+msgid "New in version %s"
+msgstr "%s sürümüyle geldi"
+
+#: sphinx/locale/__init__.py:153
+#, python-format
+msgid "Changed in version %s"
+msgstr "%s sürümünde değişti"
+
+#: sphinx/locale/__init__.py:154
+#, python-format
+msgid "Deprecated since version %s"
+msgstr "%s sürümünden beri önerilmiyor"
+
+#: sphinx/locale/__init__.py:159
+msgid "keyword"
+msgstr "anahtar kelime"
+
+#: sphinx/locale/__init__.py:160
+msgid "operator"
+msgstr "işleç"
+
+#: sphinx/locale/__init__.py:161
+msgid "object"
+msgstr "nesne"
+
+#: sphinx/locale/__init__.py:163
+msgid "statement"
+msgstr "deyim"
+
+#: sphinx/locale/__init__.py:164
+msgid "built-in function"
+msgstr "gömülü fonksiyon"
+
+#: sphinx/themes/agogo/layout.html:45 sphinx/themes/basic/globaltoc.html:10
+#: sphinx/themes/basic/localtoc.html:11
+msgid "Table Of Contents"
+msgstr "İçindekiler Tablosu"
+
+#: sphinx/themes/agogo/layout.html:49 sphinx/themes/basic/layout.html:128
+#: sphinx/themes/basic/search.html:11 sphinx/themes/basic/search.html:14
+msgid "Search"
+msgstr "Ara"
+
+#: sphinx/themes/agogo/layout.html:52 sphinx/themes/basic/searchbox.html:15
+msgid "Go"
+msgstr "Git"
+
+#: sphinx/themes/agogo/layout.html:57 sphinx/themes/basic/searchbox.html:20
+msgid "Enter search terms or a module, class or function name."
+msgstr "Aranacak terimleri veya modül, sınıf ya da fonksiyon adını giriniz."
+
+#: sphinx/themes/agogo/layout.html:78 sphinx/themes/basic/sourcelink.html:14
+msgid "Show Source"
+msgstr "Kaynağı Göster"
+
+#: sphinx/themes/basic/defindex.html:11
+msgid "Overview"
+msgstr "Genel Bakış"
+
+#: sphinx/themes/basic/defindex.html:20
+msgid "Indices and tables:"
+msgstr "Dizinler ve tablolar"
+
+#: sphinx/themes/basic/defindex.html:23
+msgid "Complete Table of Contents"
+msgstr "Ayrıntılı İçindekiler Tablosu"
+
+#: sphinx/themes/basic/defindex.html:24
+msgid "lists all sections and subsections"
+msgstr "bütün bölümler ve alt bölümler listelenir"
+
+#: sphinx/themes/basic/defindex.html:26
+msgid "search this documentation"
+msgstr "Bu belgelerde ara"
+
+#: sphinx/themes/basic/defindex.html:28
+msgid "Global Module Index"
+msgstr "Global Modül Dizini"
+
+#: sphinx/themes/basic/defindex.html:29
+msgid "quick access to all modules"
+msgstr "bütün modüllere hızlı erişim"
+
+#: sphinx/themes/basic/defindex.html:31
+msgid "all functions, classes, terms"
+msgstr "bütün fonksiyonlar, sınıflar, terimler"
+
+#: sphinx/themes/basic/genindex-single.html:14
+#, python-format
+msgid "Index &ndash; %(key)s"
+msgstr "Dizin &ndash; %(key)s"
+
+#: sphinx/themes/basic/genindex-single.html:46
+#: sphinx/themes/basic/genindex-split.html:24
+#: sphinx/themes/basic/genindex-split.html:38
+#: sphinx/themes/basic/genindex.html:56
+msgid "Full index on one page"
+msgstr "Bütün dizin tek sayfada"
+
+#: sphinx/themes/basic/genindex-split.html:16
+msgid "Index pages by letter"
+msgstr "Harfe göre dizin sayfaları"
+
+#: sphinx/themes/basic/genindex-split.html:25
+msgid "can be huge"
+msgstr "çok büyük olabilir"
+
+#: sphinx/themes/basic/layout.html:23
+msgid "Navigation"
+msgstr "Gezinti"
+
+#: sphinx/themes/basic/layout.html:113
+#, python-format
+msgid "Search within %(docstitle)s"
+msgstr "%(docstitle)s içinde ara"
+
+#: sphinx/themes/basic/layout.html:122
+msgid "About these documents"
+msgstr "Bu belgeler hakkında"
+
+#: sphinx/themes/basic/layout.html:131
+msgid "Copyright"
+msgstr "Copyright"
+
+#: sphinx/themes/basic/layout.html:180
+#, 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:182
+#, python-format
+msgid "&copy; Copyright %(copyright)s."
+msgstr "&copy; Copyright %(copyright)s."
+
+#: sphinx/themes/basic/layout.html:186
+#, python-format
+msgid "Last updated on %(last_updated)s."
+msgstr "Son güncelleme: %(last_updated)s."
+
+#: sphinx/themes/basic/layout.html:189
+#, 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 ile "
+"oluşturulmuştur."
+
+#: sphinx/themes/basic/opensearch.xml:4
+#, python-format
+msgid "Search %(docstitle)s"
+msgstr "Ara: %(docstitle)s"
+
+#: sphinx/themes/basic/relations.html:11
+msgid "Previous topic"
+msgstr "Önceki konu"
+
+#: sphinx/themes/basic/relations.html:13
+msgid "previous chapter"
+msgstr "önceki bölüm"
+
+#: sphinx/themes/basic/relations.html:16
+msgid "Next topic"
+msgstr "Sonraki konu"
+
+#: sphinx/themes/basic/relations.html:18
+msgid "next chapter"
+msgstr "sonraki bölüm"
+
+#: sphinx/themes/basic/search.html:18
+msgid ""
+"Please activate JavaScript to enable the search\n"
+" functionality."
+msgstr ""
+"Arama işlevini kullanabilmek için lütfen JavaScript'i\n"
+" etkinleştirin."
+
+#: sphinx/themes/basic/search.html:23
+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 ""
+"Burada belgeler içinde arama yapabilirsiniz. Aradığınız kelimeyi \n"
+"aşağıdaki kutuya yazıp \"ara\" düğmesine basınız. Arama işlevi \n"
+"otomatik olarak bütün kelimeleri arayacaktır. Eksik kelime içeren \n"
+"sayfalar sonuç listesinde görünmez."
+
+#: sphinx/themes/basic/search.html:30
+msgid "search"
+msgstr "ara"
+
+#: sphinx/themes/basic/search.html:34
+#: sphinx/themes/basic/static/searchtools.js:489
+msgid "Search Results"
+msgstr "Arama Sonuçları"
+
+#: sphinx/themes/basic/search.html:36
+msgid "Your search did not match any results."
+msgstr "Arama sonucunda herhangi bir belge bulunamadı."
+
+#: sphinx/themes/basic/searchbox.html:12
+msgid "Quick search"
+msgstr "Hızlı Arama"
+
+#: sphinx/themes/basic/sourcelink.html:11
+msgid "This Page"
+msgstr "Bu Sayfa"
+
+#: 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 "Sürüm %(version)s &mdash; %(docstitle)s içindeki Değişiklikler"
+
+#: sphinx/themes/basic/changes/rstsource.html:5
+#, python-format
+msgid "%(filename)s &mdash; %(docstitle)s"
+msgstr "%(filename)s &mdash; %(docstitle)s"
+
+#: sphinx/themes/basic/changes/versionchanges.html:17
+#, python-format
+msgid "Automatically generated list of changes in version %(version)s"
+msgstr ""
+"%(version)s numaralı sürümdeki değişikliklerin otomatik olarak üretilmiş "
+"listesi"
+
+#: sphinx/themes/basic/changes/versionchanges.html:18
+msgid "Library changes"
+msgstr "Kütüphane değişiklikleri"
+
+#: sphinx/themes/basic/changes/versionchanges.html:23
+msgid "C API changes"
+msgstr "C API'sindeki değişiklikler"
+
+#: sphinx/themes/basic/changes/versionchanges.html:25
+msgid "Other changes"
+msgstr "Diğer değişiklikler"
+
+#: sphinx/themes/basic/static/doctools.js:154 sphinx/writers/html.py:482
+#: sphinx/writers/html.py:487
+msgid "Permalink to this headline"
+msgstr "Bu başlığın kalıcı bağlantısı"
+
+#: sphinx/themes/basic/static/doctools.js:160 sphinx/writers/html.py:87
+msgid "Permalink to this definition"
+msgstr "Bu tanımın kalıcı bağlantısı"
+
+#: sphinx/themes/basic/static/doctools.js:189
+msgid "Hide Search Matches"
+msgstr "Arama Sonuçlarını Gizle"
+
+#: sphinx/themes/basic/static/searchtools.js:285
+msgid "Searching"
+msgstr "Arıyor"
+
+#: sphinx/themes/basic/static/searchtools.js:290
+msgid "Preparing search..."
+msgstr "Aramaya hazırlanıyor..."
+
+#: sphinx/themes/basic/static/searchtools.js:364
+msgid ", in "
+msgstr ", şunun içinde:"
+
+#: sphinx/themes/basic/static/searchtools.js:491
+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 ""
+"Arama sonucunda hiçbir belge bulunamadı. Bütün kelimeleri doğru "
+"yazdığınızda ve yeterli kategori seçimi yaptığınızdan emin olun."
+
+#: sphinx/themes/basic/static/searchtools.js:493
+#, python-format
+msgid "Search finished, found %s page(s) matching the search query."
+msgstr "Arama sonuçlandı, aramayla eşleşen %s sayfa bulundu."
+
+#: sphinx/themes/default/static/sidebar.js:66
+msgid "Expand sidebar"
+msgstr ""
+
+#: sphinx/themes/default/static/sidebar.js:79
+#: sphinx/themes/default/static/sidebar.js:106
+msgid "Collapse sidebar"
+msgstr ""
+
+#: sphinx/themes/haiku/layout.html:26
+msgid "Contents"
+msgstr ""
+
+#: sphinx/writers/latex.py:171
+msgid "Release"
+msgstr "Sürüm"
+
+#: sphinx/writers/latex.py:572 sphinx/writers/manpage.py:178
+msgid "Footnotes"
+msgstr "Dipnotları"
+
+#: sphinx/writers/latex.py:641
+msgid "continued from previous page"
+msgstr "önceki sayfadan devam"
+
+#: sphinx/writers/latex.py:646
+msgid "Continued on next page"
+msgstr "Devamı sonraki sayfada"
+
+#: sphinx/writers/text.py:422
+msgid "[image]"
+msgstr "[resim]"
diff --git a/sphinx/locale/uk_UA/LC_MESSAGES/sphinx.js b/sphinx/locale/uk_UA/LC_MESSAGES/sphinx.js
index 061ecb589..7af42ca8d 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": {"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
+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 ", "Expand sidebar": "", "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", "Collapse sidebar": "", "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"}}); \ 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 310536f16..cfa0b8e0e 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 75c933a25..a85eaebe4 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: 2010-05-24 23:54+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,227 +18,378 @@ 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:106 sphinx/writers/latex.py:184
+#: sphinx/writers/manpage.py:67
#, python-format
msgid "%B %d, %Y"
msgstr ""
-#: 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
-msgid "Index"
-msgstr "Індекс"
-
-#: sphinx/environment.py:325 sphinx/writers/latex.py:187
-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
+#: sphinx/roles.py:174
#, python-format
msgid "Python Enhancement Proposals!PEP %s"
msgstr "Python Enhancement Proposals!PEP %s"
-#: sphinx/builders/changes.py:71
+#: sphinx/builders/changes.py:72
msgid "Builtins"
msgstr "Вбудовані елементи"
-#: sphinx/builders/changes.py:73
+#: sphinx/builders/changes.py:74
msgid "Module level"
msgstr "Рівень модуля"
-#: sphinx/builders/html.py:205
+#: sphinx/builders/html.py:266
#, 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:285 sphinx/themes/basic/defindex.html:30
msgid "General Index"
msgstr "Загальний індекс"
-#: sphinx/builders/html.py:224
+#: sphinx/builders/html.py:285
msgid "index"
msgstr "індекс"
-#: 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
-msgid "Global Module Index"
-msgstr "Загальний індекс модулів"
-
-#: sphinx/builders/html.py:227
-msgid "modules"
-msgstr "модулі"
-
-#: sphinx/builders/html.py:281
+#: sphinx/builders/html.py:345
msgid "next"
msgstr "наступний"
-#: sphinx/builders/html.py:290
+#: sphinx/builders/html.py:354
msgid "previous"
msgstr "попередній"
-#: sphinx/builders/latex.py:162
+#: sphinx/builders/latex.py:151
msgid " (in "
msgstr " (в "
-#: sphinx/directives/desc.py:97
-msgid "Raises"
-msgstr "Викликає"
+#: sphinx/directives/other.py:127
+msgid "Section author: "
+msgstr "Автор секції: "
-#: sphinx/directives/desc.py:101
-msgid "Variable"
-msgstr "Змінна"
+#: sphinx/directives/other.py:129
+msgid "Module author: "
+msgstr "Автор модуля: "
+
+#: sphinx/directives/other.py:131
+#, fuzzy
+msgid "Code author: "
+msgstr "Автор модуля: "
+
+#: sphinx/directives/other.py:133
+msgid "Author: "
+msgstr "Автор: "
+
+#: sphinx/directives/other.py:238
+msgid "See also"
+msgstr "Дивись також"
+
+#: sphinx/domains/__init__.py:253
+#, python-format
+msgid "%s %s"
+msgstr ""
-#: sphinx/directives/desc.py:104
+#: sphinx/domains/c.py:51 sphinx/domains/python.py:49
+msgid "Parameters"
+msgstr "Параметри"
+
+#: sphinx/domains/c.py:54 sphinx/domains/javascript.py:137
+#: sphinx/domains/python.py:59
msgid "Returns"
msgstr "Повертає"
-#: sphinx/directives/desc.py:113
+#: sphinx/domains/c.py:56 sphinx/domains/python.py:61
msgid "Return type"
msgstr "Тип повернення"
-#: sphinx/directives/desc.py:186
-msgid "Parameter"
-msgstr "Параметр"
+#: sphinx/domains/c.py:133
+#, python-format
+msgid "%s (C function)"
+msgstr "%s (С функція)"
-#: sphinx/directives/desc.py:190
-msgid "Parameters"
-msgstr "Параметри"
+#: sphinx/domains/c.py:135
+#, python-format
+msgid "%s (C member)"
+msgstr "%s (C член)"
+
+#: sphinx/domains/c.py:137
+#, python-format
+msgid "%s (C macro)"
+msgstr "%s (C макрос)"
+
+#: sphinx/domains/c.py:139
+#, python-format
+msgid "%s (C type)"
+msgstr "%s (C тип)"
+
+#: sphinx/domains/c.py:141
+#, python-format
+msgid "%s (C variable)"
+msgstr "%s (C змінна)"
+
+#: sphinx/domains/c.py:171 sphinx/domains/cpp.py:1031
+#: sphinx/domains/javascript.py:166 sphinx/domains/python.py:497
+msgid "function"
+msgstr "функція"
+
+#: sphinx/domains/c.py:172 sphinx/domains/cpp.py:1032
+msgid "member"
+msgstr "член"
+
+#: sphinx/domains/c.py:173
+msgid "macro"
+msgstr "макрос"
+
+#: sphinx/domains/c.py:174 sphinx/domains/cpp.py:1033
+msgid "type"
+msgstr "тип"
+
+#: sphinx/domains/c.py:175
+#, fuzzy
+msgid "variable"
+msgstr "Змінна"
+
+#: sphinx/domains/cpp.py:876
+#, python-format
+msgid "%s (C++ class)"
+msgstr "%s (C++ клас)"
+
+#: sphinx/domains/cpp.py:891
+#, python-format
+msgid "%s (C++ type)"
+msgstr "%s (C++ тип)"
+
+#: sphinx/domains/cpp.py:910
+#, python-format
+msgid "%s (C++ member)"
+msgstr "%s (C++ член)"
-#: sphinx/directives/desc.py:418
+#: sphinx/domains/cpp.py:962
+#, python-format
+msgid "%s (C++ function)"
+msgstr "%s (C++ функція)"
+
+#: sphinx/domains/cpp.py:1030 sphinx/domains/python.py:499
+msgid "class"
+msgstr "клас"
+
+#: sphinx/domains/javascript.py:117 sphinx/domains/python.py:221
#, python-format
msgid "%s() (built-in function)"
msgstr "%s() (вбудована функція)"
-#: sphinx/directives/desc.py:419 sphinx/directives/desc.py:476
-#: sphinx/directives/desc.py:488
+#: sphinx/domains/javascript.py:118 sphinx/domains/python.py:285
+#, python-format
+msgid "%s() (%s method)"
+msgstr "%s() (%s метод)"
+
+#: sphinx/domains/javascript.py:120
+#, python-format
+msgid "%s (global variable or constant)"
+msgstr ""
+
+#: sphinx/domains/javascript.py:122 sphinx/domains/python.py:323
+#, python-format
+msgid "%s (%s attribute)"
+msgstr "%s (%s атрибут)"
+
+#: sphinx/domains/javascript.py:131
+#, fuzzy
+msgid "Arguments"
+msgstr "Параметри"
+
+#: sphinx/domains/javascript.py:134
+msgid "Throws"
+msgstr ""
+
+#: sphinx/domains/javascript.py:167 sphinx/domains/python.py:498
+msgid "data"
+msgstr ""
+
+#: sphinx/domains/javascript.py:168 sphinx/domains/python.py:504
+#, python-format
+msgid "attribute"
+msgstr "атрибут"
+
+#: sphinx/domains/python.py:53
+#, fuzzy
+msgid "Variables"
+msgstr "Змінна"
+
+#: sphinx/domains/python.py:56
+msgid "Raises"
+msgstr "Викликає"
+
+#: sphinx/domains/python.py:222 sphinx/domains/python.py:279
+#: sphinx/domains/python.py:291 sphinx/domains/python.py:304
#, python-format
msgid "%s() (in module %s)"
msgstr "%s() (в модулі %s)"
-#: sphinx/directives/desc.py:422
+#: sphinx/domains/python.py:225
#, python-format
msgid "%s (built-in variable)"
msgstr "%s (вбудована змінна)"
-#: sphinx/directives/desc.py:423 sphinx/directives/desc.py:514
+#: sphinx/domains/python.py:226 sphinx/domains/python.py:317
#, python-format
msgid "%s (in module %s)"
msgstr "%s (в модулі %s)"
-#: sphinx/directives/desc.py:439
+#: sphinx/domains/python.py:242
#, python-format
msgid "%s (built-in class)"
msgstr "%s (вбудований клас)"
-#: sphinx/directives/desc.py:440
+#: sphinx/domains/python.py:243
#, python-format
msgid "%s (class in %s)"
msgstr "%s (клас в %s)"
-#: sphinx/directives/desc.py:480
+#: sphinx/domains/python.py:283
#, 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
+#: sphinx/domains/python.py:295
#, python-format
msgid "%s() (%s.%s static method)"
msgstr "%s() (%s.%s статичний метод)"
-#: sphinx/directives/desc.py:495
+#: sphinx/domains/python.py:298
#, python-format
msgid "%s() (%s static method)"
msgstr "%s() (%s статичний метод)"
-#: sphinx/directives/desc.py:518
+#: sphinx/domains/python.py:308
+#, fuzzy, python-format
+msgid "%s() (%s.%s class method)"
+msgstr "%s() (%s.%s метод)"
+
+#: sphinx/domains/python.py:311
+#, fuzzy, python-format
+msgid "%s() (%s class method)"
+msgstr "%s() (%s метод)"
+
+#: sphinx/domains/python.py:321
#, 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/domains/python.py:366
+msgid "Platforms: "
+msgstr "Платформи: "
-#: sphinx/directives/desc.py:609
+#: sphinx/domains/python.py:372
#, python-format
-msgid "%s (C function)"
-msgstr "%s (С функція)"
+msgid "%s (module)"
+msgstr "%s (модуль)"
-#: sphinx/directives/desc.py:611
-#, python-format
-msgid "%s (C member)"
-msgstr "%s (C член)"
+#: sphinx/domains/python.py:429
+#, fuzzy
+msgid "Python Module Index"
+msgstr "Індекс модулів"
-#: sphinx/directives/desc.py:613
-#, python-format
-msgid "%s (C macro)"
-msgstr "%s (C макрос)"
+#: sphinx/domains/python.py:430
+msgid "modules"
+msgstr "модулі"
+
+#: sphinx/domains/python.py:475
+msgid "Deprecated"
+msgstr "Застарілий"
+
+#: sphinx/domains/python.py:500 sphinx/locale/__init__.py:162
+msgid "exception"
+msgstr "виняткова ситуація"
+
+#: sphinx/domains/python.py:501
+msgid "method"
+msgstr ""
-#: sphinx/directives/desc.py:615
+#: sphinx/domains/python.py:502
+#, fuzzy, python-format
+msgid "class method"
+msgstr "%s() (%s метод)"
+
+#: sphinx/domains/python.py:503
+msgid "static method"
+msgstr "статичний метод"
+
+#: sphinx/domains/python.py:505 sphinx/locale/__init__.py:158
+msgid "module"
+msgstr "модуль"
+
+#: sphinx/domains/rst.py:53
#, python-format
-msgid "%s (C type)"
-msgstr "%s (C тип)"
+msgid "%s (directive)"
+msgstr ""
-#: sphinx/directives/desc.py:617
+#: sphinx/domains/rst.py:55
+#, fuzzy, python-format
+msgid "%s (role)"
+msgstr "%s (модуль)"
+
+#: sphinx/domains/rst.py:103
+msgid "directive"
+msgstr ""
+
+#: sphinx/domains/rst.py:104
+#, fuzzy
+msgid "role"
+msgstr "модуль"
+
+#: sphinx/domains/std.py:68 sphinx/domains/std.py:84
#, python-format
-msgid "%s (C variable)"
-msgstr "%s (C змінна)"
+msgid "environment variable; %s"
+msgstr "змінна оточення; %s"
-#: sphinx/directives/desc.py:665
+#: sphinx/domains/std.py:160
#, python-format
msgid "%scommand line option; %s"
msgstr "%sопція командного рядка; %s"
-#: sphinx/directives/other.py:138
-msgid "Platforms: "
-msgstr "Платформи: "
+#: sphinx/domains/std.py:328
+msgid "glossary term"
+msgstr ""
-#: sphinx/directives/other.py:144
-#, python-format
-msgid "%s (module)"
-msgstr "%s (модуль)"
+#: sphinx/domains/std.py:329
+msgid "grammar token"
+msgstr ""
-#: sphinx/directives/other.py:193
-msgid "Section author: "
-msgstr "Автор секції: "
+#: sphinx/domains/std.py:330
+msgid "reference label"
+msgstr ""
-#: sphinx/directives/other.py:195
-msgid "Module author: "
-msgstr "Автор модуля: "
+#: sphinx/domains/std.py:331
+msgid "environment variable"
+msgstr "змінна оточення"
-#: sphinx/directives/other.py:197
-msgid "Author: "
-msgstr "Автор: "
+#: sphinx/domains/std.py:332
+msgid "program option"
+msgstr ""
-#: sphinx/directives/other.py:317
-msgid "See also"
-msgstr "Дивись також"
+#: sphinx/domains/std.py:360 sphinx/themes/basic/genindex-single.html:11
+#: sphinx/themes/basic/genindex-split.html:11
+#: sphinx/themes/basic/genindex-split.html:14
+#: sphinx/themes/basic/genindex.html:11 sphinx/themes/basic/genindex.html:14
+#: sphinx/themes/basic/genindex.html:50 sphinx/themes/basic/layout.html:125
+#: sphinx/writers/latex.py:173
+msgid "Index"
+msgstr "Індекс"
+
+#: sphinx/domains/std.py:361
+msgid "Module Index"
+msgstr "Індекс модулів"
+
+#: sphinx/domains/std.py:362 sphinx/themes/basic/defindex.html:25
+msgid "Search Page"
+msgstr "Сторінка пошуку"
-#: sphinx/ext/autodoc.py:883
+#: sphinx/ext/autodoc.py:917
#, python-format
msgid " Bases: %s"
msgstr " Базовий: %s"
-#: sphinx/ext/autodoc.py:916
+#: sphinx/ext/autodoc.py:950
#, python-format
msgid "alias of :class:`%s`"
msgstr "синонім :class:`%s`"
@@ -247,224 +398,223 @@ msgstr "синонім :class:`%s`"
msgid "Todo"
msgstr "Доробити"
-#: sphinx/ext/todo.py:99
-#, python-format
-msgid "(The original entry is located in %s, line %d and can be found "
+#: sphinx/ext/todo.py:109
+#, fuzzy, python-format
+msgid "(The <<original entry>> is located in %s, line %d.)"
msgstr "(Початкове входження знаходиться в %s, рядок %d і може бути знайдений "
-#: sphinx/ext/todo.py:105
-msgid "here"
-msgstr "тут"
+#: sphinx/ext/todo.py:117
+msgid "original entry"
+msgstr ""
+
+#: sphinx/ext/viewcode.py:66
+msgid "[source]"
+msgstr ""
+
+#: sphinx/ext/viewcode.py:109
+msgid "[docs]"
+msgstr ""
+
+#: sphinx/ext/viewcode.py:123
+#, fuzzy
+msgid "Module code"
+msgstr "модуль"
+
+#: sphinx/ext/viewcode.py:129
+#, python-format
+msgid "<h1>Source code for %s</h1>"
+msgstr ""
+
+#: sphinx/ext/viewcode.py:156
+msgid "Overview: module code"
+msgstr ""
-#: sphinx/locale/__init__.py:15
+#: sphinx/ext/viewcode.py:157
+msgid "<h1>All modules for which code is available</h1>"
+msgstr ""
+
+#: sphinx/locale/__init__.py:139
msgid "Attention"
msgstr "Увага"
-#: sphinx/locale/__init__.py:16
+#: sphinx/locale/__init__.py:140
msgid "Caution"
msgstr "Застереження"
-#: sphinx/locale/__init__.py:17
+#: sphinx/locale/__init__.py:141
msgid "Danger"
msgstr "Небезпека"
-#: sphinx/locale/__init__.py:18
+#: sphinx/locale/__init__.py:142
msgid "Error"
msgstr "Помилка"
-#: sphinx/locale/__init__.py:19
+#: sphinx/locale/__init__.py:143
msgid "Hint"
msgstr "Підказка"
-#: sphinx/locale/__init__.py:20
+#: sphinx/locale/__init__.py:144
msgid "Important"
msgstr "Важливо"
-#: sphinx/locale/__init__.py:21
+#: sphinx/locale/__init__.py:145
msgid "Note"
msgstr "Примітка"
-#: sphinx/locale/__init__.py:22
+#: sphinx/locale/__init__.py:146
msgid "See Also"
msgstr "Дивись також"
-#: sphinx/locale/__init__.py:23
+#: sphinx/locale/__init__.py:147
msgid "Tip"
msgstr "Порада"
-#: sphinx/locale/__init__.py:24
+#: sphinx/locale/__init__.py:148
msgid "Warning"
msgstr "Попередження"
-#: sphinx/locale/__init__.py:28
+#: sphinx/locale/__init__.py:152
#, python-format
msgid "New in version %s"
msgstr "Нове в версії %s"
-#: sphinx/locale/__init__.py:29
+#: sphinx/locale/__init__.py:153
#, python-format
msgid "Changed in version %s"
msgstr "Змінено в версії %s"
-#: sphinx/locale/__init__.py:30
+#: sphinx/locale/__init__.py:154
#, python-format
msgid "Deprecated since version %s"
msgstr "Застаріло починаючи з версії %s"
-#: sphinx/locale/__init__.py:34
-msgid "module"
-msgstr "модуль"
-
-#: sphinx/locale/__init__.py:35
+#: sphinx/locale/__init__.py:159
msgid "keyword"
msgstr "ключове слово"
-#: sphinx/locale/__init__.py:36
+#: sphinx/locale/__init__.py:160
msgid "operator"
msgstr "оператор"
-#: sphinx/locale/__init__.py:37
+#: sphinx/locale/__init__.py:161
msgid "object"
msgstr "об'єкт"
-#: sphinx/locale/__init__.py:38
-msgid "exception"
-msgstr "виняткова ситуація"
-
-#: sphinx/locale/__init__.py:39
+#: sphinx/locale/__init__.py:163
msgid "statement"
msgstr "вираз"
-#: sphinx/locale/__init__.py:40
+#: sphinx/locale/__init__.py:164
msgid "built-in function"
msgstr "вбудована функція"
-#: sphinx/themes/basic/defindex.html:2
+#: sphinx/themes/agogo/layout.html:45 sphinx/themes/basic/globaltoc.html:10
+#: sphinx/themes/basic/localtoc.html:11
+msgid "Table Of Contents"
+msgstr "Зміст"
+
+#: sphinx/themes/agogo/layout.html:49 sphinx/themes/basic/layout.html:128
+#: sphinx/themes/basic/search.html:11 sphinx/themes/basic/search.html:14
+msgid "Search"
+msgstr "Пошук"
+
+#: sphinx/themes/agogo/layout.html:52 sphinx/themes/basic/searchbox.html:15
+msgid "Go"
+msgstr "Вперед"
+
+#: sphinx/themes/agogo/layout.html:57 sphinx/themes/basic/searchbox.html:20
+msgid "Enter search terms or a module, class or function name."
+msgstr "Введіть пошуковий термін, модуль, клас чи назву функції."
+
+#: sphinx/themes/agogo/layout.html:78 sphinx/themes/basic/sourcelink.html:14
+msgid "Show Source"
+msgstr "Відобразити вихідний текст"
+
+#: sphinx/themes/basic/defindex.html:11
msgid "Overview"
msgstr "Огляд"
-#: sphinx/themes/basic/defindex.html:11
+#: sphinx/themes/basic/defindex.html:20
msgid "Indices and tables:"
msgstr "Індекси та таблиці:"
-#: sphinx/themes/basic/defindex.html:14
+#: sphinx/themes/basic/defindex.html:23
msgid "Complete Table of Contents"
msgstr "Повний Зміст"
-#: sphinx/themes/basic/defindex.html:15
+#: sphinx/themes/basic/defindex.html:24
msgid "lists all sections and subsections"
msgstr "перелічити всі секції та підсекції"
-#: sphinx/themes/basic/defindex.html:17
+#: sphinx/themes/basic/defindex.html:26
msgid "search this documentation"
msgstr "шукати цю документацію"
-#: sphinx/themes/basic/defindex.html:20
+#: sphinx/themes/basic/defindex.html:28
+msgid "Global Module Index"
+msgstr "Загальний індекс модулів"
+
+#: sphinx/themes/basic/defindex.html:29
msgid "quick access to all modules"
msgstr "швидкий доступ до всіх модулів"
-#: sphinx/themes/basic/defindex.html:22
+#: sphinx/themes/basic/defindex.html:31
msgid "all functions, classes, terms"
msgstr "всі функції, класи, терміни"
-#: sphinx/themes/basic/genindex-single.html:5
+#: sphinx/themes/basic/genindex-single.html:14
#, python-format
msgid "Index &ndash; %(key)s"
msgstr "Індекс &ndash; %(key)"
-#: 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
+#: sphinx/themes/basic/genindex-single.html:46
+#: sphinx/themes/basic/genindex-split.html:24
+#: sphinx/themes/basic/genindex-split.html:38
+#: sphinx/themes/basic/genindex.html:56
msgid "Full index on one page"
msgstr "Повний індекс на одній сторінці"
-#: sphinx/themes/basic/genindex-split.html:7
+#: sphinx/themes/basic/genindex-split.html:16
msgid "Index pages by letter"
msgstr "Індексні сторінки по символам"
-#: sphinx/themes/basic/genindex-split.html:15
+#: sphinx/themes/basic/genindex-split.html:25
msgid "can be huge"
msgstr "може бути величезним"
-#: sphinx/themes/basic/layout.html:10
+#: sphinx/themes/basic/layout.html:23
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:119
+#: sphinx/themes/basic/layout.html:113
#, python-format
msgid "Search within %(docstitle)s"
msgstr "Шукати в %(docstitle)s"
-#: sphinx/themes/basic/layout.html:128
+#: sphinx/themes/basic/layout.html:122
msgid "About these documents"
msgstr "Про ці документи"
-#: sphinx/themes/basic/layout.html:134 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:131
msgid "Copyright"
msgstr "Авторські права"
-#: sphinx/themes/basic/layout.html:183
+#: sphinx/themes/basic/layout.html:180
#, 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:182
#, python-format
msgid "&copy; Copyright %(copyright)s."
msgstr "&copy; Copyright %(copyright)s."
-#: sphinx/themes/basic/layout.html:188
+#: sphinx/themes/basic/layout.html:186
#, python-format
msgid "Last updated on %(last_updated)s."
msgstr "Востаннє оновлено %(last_updated)s."
-#: sphinx/themes/basic/layout.html:191
+#: sphinx/themes/basic/layout.html:189
#, python-format
msgid ""
"Created using <a href=\"http://sphinx.pocoo.org/\">Sphinx</a> "
@@ -473,16 +623,28 @@ 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
+#: sphinx/themes/basic/relations.html:11
+msgid "Previous topic"
+msgstr "Попередній розділ"
+
+#: sphinx/themes/basic/relations.html:13
+msgid "previous chapter"
+msgstr "Попередній розділ"
+
+#: sphinx/themes/basic/relations.html:16
+msgid "Next topic"
+msgstr "Наступна тема"
+
+#: sphinx/themes/basic/relations.html:18
+msgid "next chapter"
+msgstr "наступний розділ"
+
+#: sphinx/themes/basic/search.html:18
msgid ""
"Please activate JavaScript to enable the search\n"
" functionality."
@@ -491,7 +653,7 @@ msgstr ""
"\"\n"
"\" пошук."
-#: sphinx/themes/basic/search.html:14
+#: sphinx/themes/basic/search.html:23
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"
@@ -503,19 +665,27 @@ msgstr ""
" пошуку автоматично шукатиме за всіма словами. Сторінки\n"
" що містять менше слів не з'являться в результуючому списку."
-#: sphinx/themes/basic/search.html:21
+#: sphinx/themes/basic/search.html:30
msgid "search"
msgstr "пошук"
-#: sphinx/themes/basic/search.html:25
-#: sphinx/themes/basic/static/searchtools.js:453
+#: sphinx/themes/basic/search.html:34
+#: sphinx/themes/basic/static/searchtools.js:489
msgid "Search Results"
msgstr "Результати пошуку"
-#: sphinx/themes/basic/search.html:27
+#: sphinx/themes/basic/search.html:36
msgid "Your search did not match any results."
msgstr "Ваш пошук не виявив жодних співпадінь."
+#: sphinx/themes/basic/searchbox.html:12
+msgid "Quick search"
+msgstr "Швидкий пошук"
+
+#: sphinx/themes/basic/sourcelink.html:11
+msgid "This Page"
+msgstr "Ця сторінка"
+
#: sphinx/themes/basic/changes/frameset.html:5
#: sphinx/themes/basic/changes/versionchanges.html:12
#, python-format
@@ -544,36 +714,32 @@ msgstr "зміни C API"
msgid "Other changes"
msgstr "Інші зміни"
-#: sphinx/themes/basic/static/doctools.js:139 sphinx/writers/html.py:473
-#: sphinx/writers/html.py:478
+#: sphinx/themes/basic/static/doctools.js:154 sphinx/writers/html.py:482
+#: sphinx/writers/html.py:487
msgid "Permalink to this headline"
msgstr "Постійне посилання на цей заголовок"
-#: sphinx/themes/basic/static/doctools.js:145 sphinx/writers/html.py:80
+#: sphinx/themes/basic/static/doctools.js:160 sphinx/writers/html.py:87
msgid "Permalink to this definition"
msgstr "Постійне посилання на це визначення"
-#: sphinx/themes/basic/static/doctools.js:174
+#: sphinx/themes/basic/static/doctools.js:189
msgid "Hide Search Matches"
msgstr "Приховати співпадіння пошуку"
-#: sphinx/themes/basic/static/searchtools.js:274
+#: sphinx/themes/basic/static/searchtools.js:285
msgid "Searching"
msgstr "Шукаю"
-#: sphinx/themes/basic/static/searchtools.js:279
+#: sphinx/themes/basic/static/searchtools.js:290
msgid "Preparing search..."
msgstr "Підготовка до пошуку..."
-#: sphinx/themes/basic/static/searchtools.js:338
-msgid "module, in "
-msgstr "модуль, в "
-
-#: sphinx/themes/basic/static/searchtools.js:347
+#: sphinx/themes/basic/static/searchtools.js:364
msgid ", in "
msgstr ", в "
-#: sphinx/themes/basic/static/searchtools.js:455
+#: sphinx/themes/basic/static/searchtools.js:491
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,34 +747,41 @@ msgstr ""
"Ваш пошук не виявив жодного співпадіння. Будь-ласка переконайтеся що всі "
"слова набрані правильно і ви обрали достатньо категорій."
-#: sphinx/themes/basic/static/searchtools.js:457
+#: sphinx/themes/basic/static/searchtools.js:493
#, python-format
msgid "Search finished, found %s page(s) matching the search query."
msgstr "Пошук закінчено, знайдено %s сторінок які співпали з пошуковим запитом."
-#: sphinx/writers/latex.py:185
+#: sphinx/themes/default/static/sidebar.js:66
+msgid "Expand sidebar"
+msgstr ""
+
+#: sphinx/themes/default/static/sidebar.js:79
+#: sphinx/themes/default/static/sidebar.js:106
+msgid "Collapse sidebar"
+msgstr ""
+
+#: sphinx/themes/haiku/layout.html:26
+msgid "Contents"
+msgstr ""
+
+#: sphinx/writers/latex.py:171
msgid "Release"
msgstr "Реліз"
-#: sphinx/writers/latex.py:571
+#: sphinx/writers/latex.py:572 sphinx/writers/manpage.py:178
msgid "Footnotes"
msgstr ""
-#: sphinx/writers/latex.py:639
+#: sphinx/writers/latex.py:641
msgid "continued from previous page"
msgstr ""
-#: sphinx/writers/latex.py:644
+#: sphinx/writers/latex.py:646
#, fuzzy
msgid "Continued on next page"
msgstr "Повний індекс на одній сторінці"
-#: sphinx/writers/text.py:166
-#, python-format
-msgid "Platform: %s"
-msgstr "Платформа: %s"
-
-#: sphinx/writers/text.py:428
+#: sphinx/writers/text.py:422
msgid "[image]"
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 000000000..bf0de29db
--- /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", "Expand sidebar": "", "Permalink to this headline": "\u6c38\u4e45\u94fe\u63a5\u81f3\u6807\u9898", "Searching": "\u641c\u7d22\u4e2d", "Collapse sidebar": "", "Permalink to this definition": "\u6c38\u4e45\u94fe\u63a5\u81f3\u76ee\u6807", "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 000000000..b62c4c5b9
--- /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 000000000..c17620439
--- /dev/null
+++ b/sphinx/locale/zh_CN/LC_MESSAGES/sphinx.po
@@ -0,0 +1,775 @@
+# 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: 2010-05-24 23:54+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:106 sphinx/writers/latex.py:184
+#: sphinx/writers/manpage.py:67
+#, python-format
+msgid "%B %d, %Y"
+msgstr "%Y 年 %m 月 %d 日"
+
+#: sphinx/roles.py:174
+#, python-format
+msgid "Python Enhancement Proposals!PEP %s"
+msgstr "Python 建议文件!PEP %s"
+
+#: sphinx/builders/changes.py:72
+msgid "Builtins"
+msgstr "内置"
+
+#: sphinx/builders/changes.py:74
+msgid "Module level"
+msgstr "模块级别"
+
+#: sphinx/builders/html.py:266
+#, python-format
+msgid "%b %d, %Y"
+msgstr "%Y 年 %m 月 %d 日"
+
+#: sphinx/builders/html.py:285 sphinx/themes/basic/defindex.html:30
+msgid "General Index"
+msgstr "总目录"
+
+#: sphinx/builders/html.py:285
+msgid "index"
+msgstr "索引"
+
+#: sphinx/builders/html.py:345
+msgid "next"
+msgstr "下一页"
+
+#: sphinx/builders/html.py:354
+msgid "previous"
+msgstr "上一页"
+
+#: sphinx/builders/latex.py:151
+msgid " (in "
+msgstr ""
+
+#: sphinx/directives/other.py:127
+msgid "Section author: "
+msgstr "Section 作者:"
+
+#: sphinx/directives/other.py:129
+msgid "Module author: "
+msgstr "模块作者:"
+
+#: sphinx/directives/other.py:131
+#, fuzzy
+msgid "Code author: "
+msgstr "模块作者:"
+
+#: sphinx/directives/other.py:133
+msgid "Author: "
+msgstr "作者:"
+
+#: sphinx/directives/other.py:238
+msgid "See also"
+msgstr "也可以参考"
+
+#: sphinx/domains/__init__.py:253
+#, python-format
+msgid "%s %s"
+msgstr ""
+
+#: sphinx/domains/c.py:51 sphinx/domains/python.py:49
+msgid "Parameters"
+msgstr "参数"
+
+#: sphinx/domains/c.py:54 sphinx/domains/javascript.py:137
+#: sphinx/domains/python.py:59
+msgid "Returns"
+msgstr "返回"
+
+#: sphinx/domains/c.py:56 sphinx/domains/python.py:61
+msgid "Return type"
+msgstr "返回类型"
+
+#: sphinx/domains/c.py:133
+#, python-format
+msgid "%s (C function)"
+msgstr "%s (C 函数)"
+
+#: sphinx/domains/c.py:135
+#, python-format
+msgid "%s (C member)"
+msgstr "%s (C 成员)"
+
+#: sphinx/domains/c.py:137
+#, python-format
+msgid "%s (C macro)"
+msgstr "%s (C 宏)"
+
+#: sphinx/domains/c.py:139
+#, python-format
+msgid "%s (C type)"
+msgstr "%s (C 类型)"
+
+#: sphinx/domains/c.py:141
+#, python-format
+msgid "%s (C variable)"
+msgstr "%s (C 变量)"
+
+#: sphinx/domains/c.py:171 sphinx/domains/cpp.py:1031
+#: sphinx/domains/javascript.py:166 sphinx/domains/python.py:497
+msgid "function"
+msgstr "函数"
+
+#: sphinx/domains/c.py:172 sphinx/domains/cpp.py:1032
+msgid "member"
+msgstr "成员"
+
+#: sphinx/domains/c.py:173
+msgid "macro"
+msgstr ""
+
+#: sphinx/domains/c.py:174 sphinx/domains/cpp.py:1033
+msgid "type"
+msgstr ""
+
+#: sphinx/domains/c.py:175
+#, fuzzy
+msgid "variable"
+msgstr "变量"
+
+#: sphinx/domains/cpp.py:876
+#, fuzzy, python-format
+msgid "%s (C++ class)"
+msgstr "%s (內置类)"
+
+#: sphinx/domains/cpp.py:891
+#, python-format
+msgid "%s (C++ type)"
+msgstr "%s (C++ 类型)"
+
+#: sphinx/domains/cpp.py:910
+#, python-format
+msgid "%s (C++ member)"
+msgstr "%s (C++ 成员)"
+
+#: sphinx/domains/cpp.py:962
+#, python-format
+msgid "%s (C++ function)"
+msgstr "%s (C++ 函数)"
+
+#: sphinx/domains/cpp.py:1030 sphinx/domains/python.py:499
+msgid "class"
+msgstr ""
+
+#: sphinx/domains/javascript.py:117 sphinx/domains/python.py:221
+#, python-format
+msgid "%s() (built-in function)"
+msgstr "%s() (內置函数)"
+
+#: sphinx/domains/javascript.py:118 sphinx/domains/python.py:285
+#, python-format
+msgid "%s() (%s method)"
+msgstr "%s() (%s 方法)"
+
+#: sphinx/domains/javascript.py:120
+#, python-format
+msgid "%s (global variable or constant)"
+msgstr ""
+
+#: sphinx/domains/javascript.py:122 sphinx/domains/python.py:323
+#, python-format
+msgid "%s (%s attribute)"
+msgstr "%s (%s 属性)"
+
+#: sphinx/domains/javascript.py:131
+#, fuzzy
+msgid "Arguments"
+msgstr "参数"
+
+#: sphinx/domains/javascript.py:134
+msgid "Throws"
+msgstr ""
+
+#: sphinx/domains/javascript.py:167 sphinx/domains/python.py:498
+msgid "data"
+msgstr ""
+
+#: sphinx/domains/javascript.py:168 sphinx/domains/python.py:504
+msgid "attribute"
+msgstr "属性"
+
+#: sphinx/domains/python.py:53
+#, fuzzy
+msgid "Variables"
+msgstr "变量"
+
+#: sphinx/domains/python.py:56
+msgid "Raises"
+msgstr "引发"
+
+#: sphinx/domains/python.py:222 sphinx/domains/python.py:279
+#: sphinx/domains/python.py:291 sphinx/domains/python.py:304
+#, python-format
+msgid "%s() (in module %s)"
+msgstr "%s() (在 %s 模块中)"
+
+#: sphinx/domains/python.py:225
+#, python-format
+msgid "%s (built-in variable)"
+msgstr "%s (內置变量)"
+
+#: sphinx/domains/python.py:226 sphinx/domains/python.py:317
+#, python-format
+msgid "%s (in module %s)"
+msgstr "%s() (在 %s 模块中)"
+
+#: sphinx/domains/python.py:242
+#, python-format
+msgid "%s (built-in class)"
+msgstr "%s (內置类)"
+
+#: sphinx/domains/python.py:243
+#, python-format
+msgid "%s (class in %s)"
+msgstr ""
+
+#: sphinx/domains/python.py:283
+#, python-format
+msgid "%s() (%s.%s method)"
+msgstr "%s() (%s.%s 方法)"
+
+#: sphinx/domains/python.py:295
+#, python-format
+msgid "%s() (%s.%s static method)"
+msgstr "%s() (%s.%s 静态方法)"
+
+#: sphinx/domains/python.py:298
+#, python-format
+msgid "%s() (%s static method)"
+msgstr "%s() (%s 静态方法)"
+
+#: sphinx/domains/python.py:308
+#, fuzzy, python-format
+msgid "%s() (%s.%s class method)"
+msgstr "%s() (%s.%s 方法)"
+
+#: sphinx/domains/python.py:311
+#, fuzzy, python-format
+msgid "%s() (%s class method)"
+msgstr "%s() (%s 方法)"
+
+#: sphinx/domains/python.py:321
+#, python-format
+msgid "%s (%s.%s attribute)"
+msgstr "%s (%s.%s 属性)"
+
+#: sphinx/domains/python.py:366
+msgid "Platforms: "
+msgstr "平台"
+
+#: sphinx/domains/python.py:372
+#, python-format
+msgid "%s (module)"
+msgstr "%s (模块)"
+
+#: sphinx/domains/python.py:429
+#, fuzzy
+msgid "Python Module Index"
+msgstr "模块索引"
+
+#: sphinx/domains/python.py:430
+msgid "modules"
+msgstr "模块"
+
+#: sphinx/domains/python.py:475
+msgid "Deprecated"
+msgstr "已移除"
+
+#: sphinx/domains/python.py:500 sphinx/locale/__init__.py:162
+msgid "exception"
+msgstr "例外"
+
+#: sphinx/domains/python.py:501
+msgid "method"
+msgstr ""
+
+#: sphinx/domains/python.py:502
+#, fuzzy, python-format
+msgid "class method"
+msgstr "%s() (%s 方法)"
+
+#: sphinx/domains/python.py:503
+msgid "static method"
+msgstr "静态方法"
+
+#: sphinx/domains/python.py:505 sphinx/locale/__init__.py:158
+msgid "module"
+msgstr "模块"
+
+#: sphinx/domains/rst.py:53
+#, python-format
+msgid "%s (directive)"
+msgstr ""
+
+#: sphinx/domains/rst.py:55
+#, fuzzy, python-format
+msgid "%s (role)"
+msgstr "%s (模块)"
+
+#: sphinx/domains/rst.py:103
+msgid "directive"
+msgstr ""
+
+#: sphinx/domains/rst.py:104
+#, fuzzy
+msgid "role"
+msgstr "模块"
+
+#: sphinx/domains/std.py:68 sphinx/domains/std.py:84
+#, python-format
+msgid "environment variable; %s"
+msgstr "环境变量; %s"
+
+#: sphinx/domains/std.py:160
+#, python-format
+msgid "%scommand line option; %s"
+msgstr "%s命令行选项; %s"
+
+#: sphinx/domains/std.py:328
+msgid "glossary term"
+msgstr ""
+
+#: sphinx/domains/std.py:329
+msgid "grammar token"
+msgstr ""
+
+#: sphinx/domains/std.py:330
+msgid "reference label"
+msgstr ""
+
+#: sphinx/domains/std.py:331
+msgid "environment variable"
+msgstr "环境变量"
+
+#: sphinx/domains/std.py:332
+msgid "program option"
+msgstr ""
+
+#: sphinx/domains/std.py:360 sphinx/themes/basic/genindex-single.html:11
+#: sphinx/themes/basic/genindex-split.html:11
+#: sphinx/themes/basic/genindex-split.html:14
+#: sphinx/themes/basic/genindex.html:11 sphinx/themes/basic/genindex.html:14
+#: sphinx/themes/basic/genindex.html:50 sphinx/themes/basic/layout.html:125
+#: sphinx/writers/latex.py:173
+msgid "Index"
+msgstr "索引"
+
+#: sphinx/domains/std.py:361
+msgid "Module Index"
+msgstr "模块索引"
+
+#: sphinx/domains/std.py:362 sphinx/themes/basic/defindex.html:25
+msgid "Search Page"
+msgstr "搜索页面"
+
+#: sphinx/ext/autodoc.py:917
+#, python-format
+msgid " Bases: %s"
+msgstr ""
+
+#: sphinx/ext/autodoc.py:950
+#, python-format
+msgid "alias of :class:`%s`"
+msgstr ""
+
+#: sphinx/ext/todo.py:41
+msgid "Todo"
+msgstr "待处理"
+
+#: sphinx/ext/todo.py:109
+#, fuzzy, python-format
+msgid "(The <<original entry>> is located in %s, line %d.)"
+msgstr "(最初的入口位于%s 的第%d行"
+
+#: sphinx/ext/todo.py:117
+msgid "original entry"
+msgstr ""
+
+#: sphinx/ext/viewcode.py:66
+msgid "[source]"
+msgstr ""
+
+#: sphinx/ext/viewcode.py:109
+msgid "[docs]"
+msgstr ""
+
+#: sphinx/ext/viewcode.py:123
+#, fuzzy
+msgid "Module code"
+msgstr "模块"
+
+#: sphinx/ext/viewcode.py:129
+#, python-format
+msgid "<h1>Source code for %s</h1>"
+msgstr ""
+
+#: sphinx/ext/viewcode.py:156
+msgid "Overview: module code"
+msgstr ""
+
+#: sphinx/ext/viewcode.py:157
+msgid "<h1>All modules for which code is available</h1>"
+msgstr ""
+
+#: sphinx/locale/__init__.py:139
+msgid "Attention"
+msgstr "注意"
+
+#: sphinx/locale/__init__.py:140
+msgid "Caution"
+msgstr "警告"
+
+#: sphinx/locale/__init__.py:141
+msgid "Danger"
+msgstr "危险"
+
+#: sphinx/locale/__init__.py:142
+msgid "Error"
+msgstr "错误"
+
+#: sphinx/locale/__init__.py:143
+msgid "Hint"
+msgstr "提示"
+
+#: sphinx/locale/__init__.py:144
+msgid "Important"
+msgstr "重要"
+
+#: sphinx/locale/__init__.py:145
+msgid "Note"
+msgstr "注解"
+
+#: sphinx/locale/__init__.py:146
+msgid "See Also"
+msgstr "也可以参考"
+
+#: sphinx/locale/__init__.py:147
+msgid "Tip"
+msgstr "小技巧"
+
+#: sphinx/locale/__init__.py:148
+msgid "Warning"
+msgstr "警告"
+
+#: sphinx/locale/__init__.py:152
+#, python-format
+msgid "New in version %s"
+msgstr "%s 新版功能"
+
+#: sphinx/locale/__init__.py:153
+#, python-format
+msgid "Changed in version %s"
+msgstr "在 %s 版更改"
+
+#: sphinx/locale/__init__.py:154
+#, python-format
+msgid "Deprecated since version %s"
+msgstr "%s 版后已移除"
+
+#: sphinx/locale/__init__.py:159
+msgid "keyword"
+msgstr "关键字"
+
+#: sphinx/locale/__init__.py:160
+msgid "operator"
+msgstr "操作数"
+
+#: sphinx/locale/__init__.py:161
+msgid "object"
+msgstr "对象"
+
+#: sphinx/locale/__init__.py:163
+msgid "statement"
+msgstr "语句"
+
+#: sphinx/locale/__init__.py:164
+msgid "built-in function"
+msgstr "內置函数"
+
+#: sphinx/themes/agogo/layout.html:45 sphinx/themes/basic/globaltoc.html:10
+#: sphinx/themes/basic/localtoc.html:11
+msgid "Table Of Contents"
+msgstr "內容目录"
+
+#: sphinx/themes/agogo/layout.html:49 sphinx/themes/basic/layout.html:128
+#: sphinx/themes/basic/search.html:11 sphinx/themes/basic/search.html:14
+msgid "Search"
+msgstr "搜索"
+
+#: sphinx/themes/agogo/layout.html:52 sphinx/themes/basic/searchbox.html:15
+msgid "Go"
+msgstr "搜索"
+
+#: sphinx/themes/agogo/layout.html:57 sphinx/themes/basic/searchbox.html:20
+msgid "Enter search terms or a module, class or function name."
+msgstr "输入相关的模块,术语,类或者函数名称进行搜索"
+
+#: sphinx/themes/agogo/layout.html:78 sphinx/themes/basic/sourcelink.html:14
+msgid "Show Source"
+msgstr "显示源代码"
+
+#: sphinx/themes/basic/defindex.html:11
+msgid "Overview"
+msgstr "概述"
+
+#: sphinx/themes/basic/defindex.html:20
+msgid "Indices and tables:"
+msgstr "索引和表格"
+
+#: sphinx/themes/basic/defindex.html:23
+msgid "Complete Table of Contents"
+msgstr "完整的内容表"
+
+#: sphinx/themes/basic/defindex.html:24
+msgid "lists all sections and subsections"
+msgstr "列出所有的章节和部分"
+
+#: sphinx/themes/basic/defindex.html:26
+msgid "search this documentation"
+msgstr "搜索文档"
+
+#: sphinx/themes/basic/defindex.html:28
+msgid "Global Module Index"
+msgstr "全局模块索引"
+
+#: sphinx/themes/basic/defindex.html:29
+msgid "quick access to all modules"
+msgstr "快速查看所有的模块"
+
+#: sphinx/themes/basic/defindex.html:31
+msgid "all functions, classes, terms"
+msgstr "所的函数,类,术语"
+
+#: sphinx/themes/basic/genindex-single.html:14
+#, python-format
+msgid "Index &ndash; %(key)s"
+msgstr "索引 &ndash; %(key)s"
+
+#: sphinx/themes/basic/genindex-single.html:46
+#: sphinx/themes/basic/genindex-split.html:24
+#: sphinx/themes/basic/genindex-split.html:38
+#: sphinx/themes/basic/genindex.html:56
+msgid "Full index on one page"
+msgstr "一页的全部索引"
+
+#: sphinx/themes/basic/genindex-split.html:16
+msgid "Index pages by letter"
+msgstr "按照字母的索引页"
+
+#: sphinx/themes/basic/genindex-split.html:25
+msgid "can be huge"
+msgstr "可能会很多"
+
+#: sphinx/themes/basic/layout.html:23
+msgid "Navigation"
+msgstr "导航"
+
+#: sphinx/themes/basic/layout.html:113
+#, python-format
+msgid "Search within %(docstitle)s"
+msgstr "在 %(docstitle)s 中搜索"
+
+#: sphinx/themes/basic/layout.html:122
+msgid "About these documents"
+msgstr "关于这些文档"
+
+#: sphinx/themes/basic/layout.html:131
+msgid "Copyright"
+msgstr "版权所有"
+
+#: sphinx/themes/basic/layout.html:180
+#, 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:182
+#, python-format
+msgid "&copy; Copyright %(copyright)s."
+msgstr "&copy; 版权所有 %(copyright)s."
+
+#: sphinx/themes/basic/layout.html:186
+#, python-format
+msgid "Last updated on %(last_updated)s."
+msgstr "最后更新日期是 %(last_updated)s."
+
+#: sphinx/themes/basic/layout.html:189
+#, 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/opensearch.xml:4
+#, python-format
+msgid "Search %(docstitle)s"
+msgstr "搜索 %(docstitle)s"
+
+#: sphinx/themes/basic/relations.html:11
+msgid "Previous topic"
+msgstr "上一个主题"
+
+#: sphinx/themes/basic/relations.html:13
+msgid "previous chapter"
+msgstr "上一章"
+
+#: sphinx/themes/basic/relations.html:16
+msgid "Next topic"
+msgstr "下一个主题"
+
+#: sphinx/themes/basic/relations.html:18
+msgid "next chapter"
+msgstr "下一章"
+
+#: sphinx/themes/basic/search.html:18
+msgid ""
+"Please activate JavaScript to enable the search\n"
+" functionality."
+msgstr ""
+
+#: sphinx/themes/basic/search.html:23
+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:30
+msgid "search"
+msgstr "搜索"
+
+#: sphinx/themes/basic/search.html:34
+#: sphinx/themes/basic/static/searchtools.js:489
+msgid "Search Results"
+msgstr "搜索结果"
+
+#: sphinx/themes/basic/search.html:36
+msgid "Your search did not match any results."
+msgstr "你的搜索没有找到任何的结果."
+
+#: sphinx/themes/basic/searchbox.html:12
+msgid "Quick search"
+msgstr "快速搜索"
+
+#: sphinx/themes/basic/sourcelink.html:11
+msgid "This Page"
+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:154 sphinx/writers/html.py:482
+#: sphinx/writers/html.py:487
+msgid "Permalink to this headline"
+msgstr "永久链接至标题"
+
+#: sphinx/themes/basic/static/doctools.js:160 sphinx/writers/html.py:87
+msgid "Permalink to this definition"
+msgstr "永久链接至目标"
+
+#: sphinx/themes/basic/static/doctools.js:189
+msgid "Hide Search Matches"
+msgstr "隐藏搜索结果"
+
+#: sphinx/themes/basic/static/searchtools.js:285
+msgid "Searching"
+msgstr "搜索中"
+
+#: sphinx/themes/basic/static/searchtools.js:290
+msgid "Preparing search..."
+msgstr "准备搜索..."
+
+#: sphinx/themes/basic/static/searchtools.js:364
+msgid ", in "
+msgstr ", 位于"
+
+#: sphinx/themes/basic/static/searchtools.js:491
+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:493
+#, python-format
+msgid "Search finished, found %s page(s) matching the search query."
+msgstr "搜索完成, 找到了 %s 页匹配所搜索的关键字"
+
+#: sphinx/themes/default/static/sidebar.js:66
+msgid "Expand sidebar"
+msgstr ""
+
+#: sphinx/themes/default/static/sidebar.js:79
+#: sphinx/themes/default/static/sidebar.js:106
+msgid "Collapse sidebar"
+msgstr ""
+
+#: sphinx/themes/haiku/layout.html:26
+msgid "Contents"
+msgstr ""
+
+#: sphinx/writers/latex.py:171
+msgid "Release"
+msgstr "发布"
+
+#: sphinx/writers/latex.py:572 sphinx/writers/manpage.py:178
+msgid "Footnotes"
+msgstr ""
+
+#: sphinx/writers/latex.py:641
+msgid "continued from previous page"
+msgstr ""
+
+#: sphinx/writers/latex.py:646
+#, fuzzy
+msgid "Continued on next page"
+msgstr "一页的全部索引"
+
+#: sphinx/writers/text.py:422
+msgid "[image]"
+msgstr "[图片]"
diff --git a/sphinx/locale/zh_TW/LC_MESSAGES/sphinx.js b/sphinx/locale/zh_TW/LC_MESSAGES/sphinx.js
index 3e4631d4f..ac64cd0bf 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": {"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
+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 ": "", "Expand sidebar": "", "Permalink to this headline": "", "Searching": "\u641c\u5c0b\u4e2d", "Collapse sidebar": "", "Permalink to this definition": "", "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 c0a2e9508..008ecec05 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 6b86de790..33dff8cae 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: 2010-05-24 23:54+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,228 +17,380 @@ 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:106 sphinx/writers/latex.py:184
+#: sphinx/writers/manpage.py:67
#, 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:131
-#: sphinx/writers/latex.py:188
-msgid "Index"
-msgstr "索引"
-
-#: sphinx/environment.py:325 sphinx/writers/latex.py:187
-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
+#: sphinx/roles.py:174
#, python-format
msgid "Python Enhancement Proposals!PEP %s"
msgstr "Python 建議文件!PEP %s"
-#: sphinx/builders/changes.py:71
+#: sphinx/builders/changes.py:72
msgid "Builtins"
msgstr ""
-#: sphinx/builders/changes.py:73
+#: sphinx/builders/changes.py:74
msgid "Module level"
msgstr ""
-#: sphinx/builders/html.py:205
+#: sphinx/builders/html.py:266
#, 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:285 sphinx/themes/basic/defindex.html:30
msgid "General Index"
msgstr "總索引"
-#: sphinx/builders/html.py:224
+#: sphinx/builders/html.py:285
msgid "index"
msgstr "索引"
-#: 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
-msgid "Global Module Index"
-msgstr ""
-
-#: sphinx/builders/html.py:227
-msgid "modules"
-msgstr "模組"
-
-#: sphinx/builders/html.py:281
+#: sphinx/builders/html.py:345
msgid "next"
msgstr "下一頁"
-#: sphinx/builders/html.py:290
+#: sphinx/builders/html.py:354
msgid "previous"
msgstr "上一頁"
-#: sphinx/builders/latex.py:162
+#: sphinx/builders/latex.py:151
msgid " (in "
msgstr ""
-#: sphinx/directives/desc.py:97
-msgid "Raises"
+#: sphinx/directives/other.py:127
+msgid "Section author: "
+msgstr "Section 作者:"
+
+#: sphinx/directives/other.py:129
+msgid "Module author: "
+msgstr "模組作者:"
+
+#: sphinx/directives/other.py:131
+#, fuzzy
+msgid "Code author: "
+msgstr "模組作者:"
+
+#: sphinx/directives/other.py:133
+msgid "Author: "
+msgstr "作者:"
+
+#: sphinx/directives/other.py:238
+msgid "See also"
msgstr ""
-#: sphinx/directives/desc.py:101
-msgid "Variable"
-msgstr "變數"
+#: sphinx/domains/__init__.py:253
+#, python-format
+msgid "%s %s"
+msgstr ""
+
+#: sphinx/domains/c.py:51 sphinx/domains/python.py:49
+msgid "Parameters"
+msgstr "參數"
-#: sphinx/directives/desc.py:104
+#: sphinx/domains/c.py:54 sphinx/domains/javascript.py:137
+#: sphinx/domains/python.py:59
msgid "Returns"
msgstr "返回"
-#: sphinx/directives/desc.py:113
+#: sphinx/domains/c.py:56 sphinx/domains/python.py:61
msgid "Return type"
msgstr "返回類別"
-#: sphinx/directives/desc.py:186
+#: sphinx/domains/c.py:133
+#, python-format
+msgid "%s (C function)"
+msgstr "%s (C 函式)"
+
+#: sphinx/domains/c.py:135
+#, python-format
+msgid "%s (C member)"
+msgstr "%s (C 成員)"
+
+#: sphinx/domains/c.py:137
+#, python-format
+msgid "%s (C macro)"
+msgstr "%s (C 巨集)"
+
+#: sphinx/domains/c.py:139
+#, python-format
+msgid "%s (C type)"
+msgstr "%s (C 類別)"
+
+#: sphinx/domains/c.py:141
+#, python-format
+msgid "%s (C variable)"
+msgstr "%s (C 變數)"
+
+#: sphinx/domains/c.py:171 sphinx/domains/cpp.py:1031
+#: sphinx/domains/javascript.py:166 sphinx/domains/python.py:497
+#, python-format
+msgid "function"
+msgstr "函式"
+
+#: sphinx/domains/c.py:172 sphinx/domains/cpp.py:1032
+msgid "member"
+msgstr "成員"
+
+#: sphinx/domains/c.py:173
+msgid "macro"
+msgstr "巨集"
+
+#: sphinx/domains/c.py:174 sphinx/domains/cpp.py:1033
+msgid "type"
+msgstr "類別"
+
+#: sphinx/domains/c.py:175
#, fuzzy
-msgid "Parameter"
-msgstr "參數"
+msgid "variable"
+msgstr "變數"
-#: sphinx/directives/desc.py:190
-msgid "Parameters"
-msgstr "參數"
+#: sphinx/domains/cpp.py:876
+#, fuzzy, python-format
+msgid "%s (C++ class)"
+msgstr "%s (內建類別)"
-#: sphinx/directives/desc.py:418
+#: sphinx/domains/cpp.py:891
+#, python-format
+msgid "%s (C++ type)"
+msgstr "%s (C++ 類別)"
+
+#: sphinx/domains/cpp.py:910
+#, python-format
+msgid "%s (C++ member)"
+msgstr "%s (C++ 成員)"
+
+#: sphinx/domains/cpp.py:962
+#, python-format
+msgid "%s (C++ function)"
+msgstr "%s (C++ 函式)"
+
+#: sphinx/domains/cpp.py:1030 sphinx/domains/python.py:499
+msgid "class"
+msgstr ""
+
+#: sphinx/domains/javascript.py:117 sphinx/domains/python.py:221
#, python-format
msgid "%s() (built-in function)"
msgstr "%s() (內建函式)"
-#: sphinx/directives/desc.py:419 sphinx/directives/desc.py:476
-#: sphinx/directives/desc.py:488
+#: sphinx/domains/javascript.py:118 sphinx/domains/python.py:285
+#, python-format
+msgid "%s() (%s method)"
+msgstr "%s() (%s 方法)"
+
+#: sphinx/domains/javascript.py:120
+#, python-format
+msgid "%s (global variable or constant)"
+msgstr ""
+
+#: sphinx/domains/javascript.py:122 sphinx/domains/python.py:323
+#, python-format
+msgid "%s (%s attribute)"
+msgstr "%s (%s 屬性)"
+
+#: sphinx/domains/javascript.py:131
+#, fuzzy
+msgid "Arguments"
+msgstr "參數"
+
+#: sphinx/domains/javascript.py:134
+msgid "Throws"
+msgstr ""
+
+#: sphinx/domains/javascript.py:167 sphinx/domains/python.py:498
+msgid "data"
+msgstr ""
+
+#: sphinx/domains/javascript.py:168 sphinx/domains/python.py:504
+#, python-format
+msgid "attribute"
+msgstr "屬性"
+
+#: sphinx/domains/python.py:53
+#, fuzzy
+msgid "Variables"
+msgstr "變數"
+
+#: sphinx/domains/python.py:56
+msgid "Raises"
+msgstr ""
+
+#: sphinx/domains/python.py:222 sphinx/domains/python.py:279
+#: sphinx/domains/python.py:291 sphinx/domains/python.py:304
#, python-format
msgid "%s() (in module %s)"
msgstr "%s() (在 %s 模組中)"
-#: sphinx/directives/desc.py:422
+#: sphinx/domains/python.py:225
#, python-format
msgid "%s (built-in variable)"
msgstr "%s (內建變數)"
-#: sphinx/directives/desc.py:423 sphinx/directives/desc.py:514
+#: sphinx/domains/python.py:226 sphinx/domains/python.py:317
#, python-format
msgid "%s (in module %s)"
msgstr "%s() (在 %s 模組中)"
-#: sphinx/directives/desc.py:439
+#: sphinx/domains/python.py:242
#, python-format
msgid "%s (built-in class)"
msgstr "%s (內建類別)"
-#: sphinx/directives/desc.py:440
+#: sphinx/domains/python.py:243
#, python-format
msgid "%s (class in %s)"
msgstr ""
-#: sphinx/directives/desc.py:480
+#: sphinx/domains/python.py:283
#, 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
+#: sphinx/domains/python.py:295
#, python-format
msgid "%s() (%s.%s static method)"
msgstr "%s() (%s.%s 靜態方法)"
-#: sphinx/directives/desc.py:495
+#: sphinx/domains/python.py:298
#, python-format
msgid "%s() (%s static method)"
msgstr "%s() (%s 靜態方法)"
-#: sphinx/directives/desc.py:518
+#: sphinx/domains/python.py:308
+#, fuzzy, python-format
+msgid "%s() (%s.%s class method)"
+msgstr "%s() (%s.%s 方法)"
+
+#: sphinx/domains/python.py:311
+#, fuzzy, python-format
+msgid "%s() (%s class method)"
+msgstr "%s() (%s 方法)"
+
+#: sphinx/domains/python.py:321
#, 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/domains/python.py:366
+msgid "Platforms: "
+msgstr "平台"
-#: sphinx/directives/desc.py:609
+#: sphinx/domains/python.py:372
#, python-format
-msgid "%s (C function)"
-msgstr "%s (C 函式)"
+msgid "%s (module)"
+msgstr "%s (模組)"
-#: sphinx/directives/desc.py:611
-#, python-format
-msgid "%s (C member)"
-msgstr "%s (C 成員)"
+#: sphinx/domains/python.py:429
+#, fuzzy
+msgid "Python Module Index"
+msgstr "模組索引"
+
+#: sphinx/domains/python.py:430
+msgid "modules"
+msgstr "模組"
+
+#: sphinx/domains/python.py:475
+msgid "Deprecated"
+msgstr "已移除"
+
+#: sphinx/domains/python.py:500 sphinx/locale/__init__.py:162
+msgid "exception"
+msgstr "例外"
+
+#: sphinx/domains/python.py:501
+msgid "method"
+msgstr ""
+
+#: sphinx/domains/python.py:502
+#, fuzzy, python-format
+msgid "class method"
+msgstr "%s() (%s 方法)"
-#: sphinx/directives/desc.py:613
+#: sphinx/domains/python.py:503
#, python-format
-msgid "%s (C macro)"
-msgstr "%s (C 巨集)"
+msgid "static method"
+msgstr "靜態方法"
+
+#: sphinx/domains/python.py:505 sphinx/locale/__init__.py:158
+msgid "module"
+msgstr "模組"
-#: sphinx/directives/desc.py:615
+#: sphinx/domains/rst.py:53
#, python-format
-msgid "%s (C type)"
-msgstr "%s (C 類別)"
+msgid "%s (directive)"
+msgstr ""
-#: sphinx/directives/desc.py:617
+#: sphinx/domains/rst.py:55
+#, fuzzy, python-format
+msgid "%s (role)"
+msgstr "%s (模組)"
+
+#: sphinx/domains/rst.py:103
+msgid "directive"
+msgstr ""
+
+#: sphinx/domains/rst.py:104
+#, fuzzy
+msgid "role"
+msgstr "模組"
+
+#: sphinx/domains/std.py:68 sphinx/domains/std.py:84
#, python-format
-msgid "%s (C variable)"
-msgstr "%s (C 變數)"
+msgid "environment variable; %s"
+msgstr "環境變數; %s"
-#: sphinx/directives/desc.py:665
+#: sphinx/domains/std.py:160
#, python-format
msgid "%scommand line option; %s"
msgstr "%s命令列選項; %s"
-#: sphinx/directives/other.py:138
-msgid "Platforms: "
-msgstr "平台"
-
-#: sphinx/directives/other.py:144
-#, python-format
-msgid "%s (module)"
-msgstr "%s (模組)"
+#: sphinx/domains/std.py:328
+msgid "glossary term"
+msgstr ""
-#: sphinx/directives/other.py:193
-msgid "Section author: "
-msgstr "Section 作者:"
+#: sphinx/domains/std.py:329
+msgid "grammar token"
+msgstr ""
-#: sphinx/directives/other.py:195
-msgid "Module author: "
-msgstr "模組作者:"
+#: sphinx/domains/std.py:330
+msgid "reference label"
+msgstr ""
-#: sphinx/directives/other.py:197
-msgid "Author: "
-msgstr "作者:"
+#: sphinx/domains/std.py:331
+msgid "environment variable"
+msgstr "環境變數"
-#: sphinx/directives/other.py:317
-msgid "See also"
+#: sphinx/domains/std.py:332
+msgid "program option"
msgstr ""
-#: sphinx/ext/autodoc.py:883
+#: sphinx/domains/std.py:360 sphinx/themes/basic/genindex-single.html:11
+#: sphinx/themes/basic/genindex-split.html:11
+#: sphinx/themes/basic/genindex-split.html:14
+#: sphinx/themes/basic/genindex.html:11 sphinx/themes/basic/genindex.html:14
+#: sphinx/themes/basic/genindex.html:50 sphinx/themes/basic/layout.html:125
+#: sphinx/writers/latex.py:173
+msgid "Index"
+msgstr "索引"
+
+#: sphinx/domains/std.py:361
+msgid "Module Index"
+msgstr "模組索引"
+
+#: sphinx/domains/std.py:362 sphinx/themes/basic/defindex.html:25
+msgid "Search Page"
+msgstr "搜尋頁面"
+
+#: sphinx/ext/autodoc.py:917
#, python-format
msgid " Bases: %s"
msgstr ""
-#: sphinx/ext/autodoc.py:916
+#: sphinx/ext/autodoc.py:950
#, python-format
msgid "alias of :class:`%s`"
msgstr ""
@@ -247,247 +399,258 @@ msgstr ""
msgid "Todo"
msgstr "待辦"
-#: sphinx/ext/todo.py:99
+#: sphinx/ext/todo.py:109
#, python-format
-msgid "(The original entry is located in %s, line %d and can be found "
+msgid "(The <<original entry>> is located in %s, line %d.)"
msgstr ""
-#: sphinx/ext/todo.py:105
-msgid "here"
+#: sphinx/ext/todo.py:117
+msgid "original entry"
msgstr ""
-#: sphinx/locale/__init__.py:15
+#: sphinx/ext/viewcode.py:66
+msgid "[source]"
+msgstr ""
+
+#: sphinx/ext/viewcode.py:109
+msgid "[docs]"
+msgstr ""
+
+#: sphinx/ext/viewcode.py:123
+#, fuzzy
+msgid "Module code"
+msgstr "模組"
+
+#: sphinx/ext/viewcode.py:129
+#, python-format
+msgid "<h1>Source code for %s</h1>"
+msgstr ""
+
+#: sphinx/ext/viewcode.py:156
+msgid "Overview: module code"
+msgstr ""
+
+#: sphinx/ext/viewcode.py:157
+msgid "<h1>All modules for which code is available</h1>"
+msgstr ""
+
+#: sphinx/locale/__init__.py:139
msgid "Attention"
msgstr "注意"
-#: sphinx/locale/__init__.py:16
+#: sphinx/locale/__init__.py:140
msgid "Caution"
msgstr "警示"
-#: sphinx/locale/__init__.py:17
+#: sphinx/locale/__init__.py:141
msgid "Danger"
msgstr "危險"
-#: sphinx/locale/__init__.py:18
+#: sphinx/locale/__init__.py:142
msgid "Error"
msgstr "錯誤"
-#: sphinx/locale/__init__.py:19
+#: sphinx/locale/__init__.py:143
msgid "Hint"
msgstr "提示"
-#: sphinx/locale/__init__.py:20
+#: sphinx/locale/__init__.py:144
msgid "Important"
msgstr "重要"
-#: sphinx/locale/__init__.py:21
+#: sphinx/locale/__init__.py:145
msgid "Note"
msgstr "註解"
-#: sphinx/locale/__init__.py:22
+#: sphinx/locale/__init__.py:146
msgid "See Also"
msgstr ""
-#: sphinx/locale/__init__.py:23
+#: sphinx/locale/__init__.py:147
msgid "Tip"
msgstr "小技巧"
-#: sphinx/locale/__init__.py:24
+#: sphinx/locale/__init__.py:148
msgid "Warning"
msgstr "警告"
-#: sphinx/locale/__init__.py:28
+#: sphinx/locale/__init__.py:152
#, python-format
msgid "New in version %s"
msgstr "%s 版新功能"
-#: sphinx/locale/__init__.py:29
+#: sphinx/locale/__init__.py:153
#, python-format
msgid "Changed in version %s"
msgstr "在 %s 版改變"
-#: sphinx/locale/__init__.py:30
+#: sphinx/locale/__init__.py:154
#, python-format
msgid "Deprecated since version %s"
msgstr "%s 版後已移除"
-#: sphinx/locale/__init__.py:34
-msgid "module"
-msgstr "模組"
-
-#: sphinx/locale/__init__.py:35
+#: sphinx/locale/__init__.py:159
msgid "keyword"
msgstr "關鍵字"
-#: sphinx/locale/__init__.py:36
+#: sphinx/locale/__init__.py:160
msgid "operator"
msgstr "運算子"
-#: sphinx/locale/__init__.py:37
+#: sphinx/locale/__init__.py:161
msgid "object"
msgstr "物件"
-#: sphinx/locale/__init__.py:38
-msgid "exception"
-msgstr "例外"
-
-#: sphinx/locale/__init__.py:39
+#: sphinx/locale/__init__.py:163
msgid "statement"
msgstr ""
-#: sphinx/locale/__init__.py:40
+#: sphinx/locale/__init__.py:164
msgid "built-in function"
msgstr "內建函式"
-#: sphinx/themes/basic/defindex.html:2
-msgid "Overview"
+#: sphinx/themes/agogo/layout.html:45 sphinx/themes/basic/globaltoc.html:10
+#: sphinx/themes/basic/localtoc.html:11
+msgid "Table Of Contents"
+msgstr "內容目錄"
+
+#: sphinx/themes/agogo/layout.html:49 sphinx/themes/basic/layout.html:128
+#: sphinx/themes/basic/search.html:11 sphinx/themes/basic/search.html:14
+msgid "Search"
+msgstr "搜尋"
+
+#: sphinx/themes/agogo/layout.html:52 sphinx/themes/basic/searchbox.html:15
+msgid "Go"
msgstr ""
+#: sphinx/themes/agogo/layout.html:57 sphinx/themes/basic/searchbox.html:20
+#, fuzzy
+msgid "Enter search terms or a module, class or function name."
+msgstr "輸入一個模組、類別、或是函式名稱."
+
+#: sphinx/themes/agogo/layout.html:78 sphinx/themes/basic/sourcelink.html:14
+msgid "Show Source"
+msgstr "顯示原始碼"
+
#: sphinx/themes/basic/defindex.html:11
+msgid "Overview"
+msgstr ""
+
+#: sphinx/themes/basic/defindex.html:20
msgid "Indices and tables:"
msgstr ""
-#: sphinx/themes/basic/defindex.html:14
+#: sphinx/themes/basic/defindex.html:23
msgid "Complete Table of Contents"
msgstr ""
-#: sphinx/themes/basic/defindex.html:15
+#: sphinx/themes/basic/defindex.html:24
msgid "lists all sections and subsections"
msgstr ""
-#: sphinx/themes/basic/defindex.html:17
+#: sphinx/themes/basic/defindex.html:26
msgid "search this documentation"
msgstr ""
-#: sphinx/themes/basic/defindex.html:20
+#: sphinx/themes/basic/defindex.html:28
+msgid "Global Module Index"
+msgstr ""
+
+#: sphinx/themes/basic/defindex.html:29
msgid "quick access to all modules"
msgstr ""
-#: sphinx/themes/basic/defindex.html:22
+#: sphinx/themes/basic/defindex.html:31
msgid "all functions, classes, terms"
msgstr ""
-#: sphinx/themes/basic/genindex-single.html:5
+#: sphinx/themes/basic/genindex-single.html:14
#, python-format
msgid "Index &ndash; %(key)s"
msgstr ""
-#: 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
+#: sphinx/themes/basic/genindex-single.html:46
+#: sphinx/themes/basic/genindex-split.html:24
+#: sphinx/themes/basic/genindex-split.html:38
+#: sphinx/themes/basic/genindex.html:56
msgid "Full index on one page"
msgstr ""
-#: sphinx/themes/basic/genindex-split.html:7
+#: sphinx/themes/basic/genindex-split.html:16
msgid "Index pages by letter"
msgstr ""
-#: sphinx/themes/basic/genindex-split.html:15
+#: sphinx/themes/basic/genindex-split.html:25
msgid "can be huge"
msgstr ""
-#: sphinx/themes/basic/layout.html:10
+#: sphinx/themes/basic/layout.html:23
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
-#, fuzzy
-msgid "Enter search terms or a module, class or function name."
-msgstr "輸入一個模組、類別、或是函式名稱."
-
-#: sphinx/themes/basic/layout.html:119
+#: sphinx/themes/basic/layout.html:113
#, python-format
msgid "Search within %(docstitle)s"
msgstr "在 %(docstitle)s 中搜尋"
-#: sphinx/themes/basic/layout.html:128
+#: sphinx/themes/basic/layout.html:122
msgid "About these documents"
msgstr ""
-#: sphinx/themes/basic/layout.html:134 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:131
msgid "Copyright"
msgstr "版權所有"
-#: sphinx/themes/basic/layout.html:183
+#: sphinx/themes/basic/layout.html:180
#, python-format
msgid "&copy; <a href=\"%(path)s\">Copyright</a> %(copyright)s."
msgstr ""
-#: sphinx/themes/basic/layout.html:185
+#: sphinx/themes/basic/layout.html:182
#, python-format
msgid "&copy; Copyright %(copyright)s."
msgstr ""
-#: sphinx/themes/basic/layout.html:188
+#: sphinx/themes/basic/layout.html:186
#, python-format
msgid "Last updated on %(last_updated)s."
msgstr "最後更新日期是 %(last_updated)s."
-#: sphinx/themes/basic/layout.html:191
+#: sphinx/themes/basic/layout.html:189
#, python-format
msgid ""
"Created using <a href=\"http://sphinx.pocoo.org/\">Sphinx</a> "
"%(sphinx_version)s."
msgstr ""
-#: 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
+#: sphinx/themes/basic/relations.html:11
+msgid "Previous topic"
+msgstr "上一個主題"
+
+#: sphinx/themes/basic/relations.html:13
+msgid "previous chapter"
+msgstr "上一章"
+
+#: sphinx/themes/basic/relations.html:16
+msgid "Next topic"
+msgstr "下一個主題"
+
+#: sphinx/themes/basic/relations.html:18
+msgid "next chapter"
+msgstr "下一章"
+
+#: sphinx/themes/basic/search.html:18
msgid ""
"Please activate JavaScript to enable the search\n"
" functionality."
msgstr ""
-#: sphinx/themes/basic/search.html:14
+#: sphinx/themes/basic/search.html:23
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"
@@ -495,19 +658,27 @@ msgid ""
" containing fewer words won't appear in the result list."
msgstr ""
-#: sphinx/themes/basic/search.html:21
+#: sphinx/themes/basic/search.html:30
msgid "search"
msgstr "搜尋"
-#: sphinx/themes/basic/search.html:25
-#: sphinx/themes/basic/static/searchtools.js:453
+#: sphinx/themes/basic/search.html:34
+#: sphinx/themes/basic/static/searchtools.js:489
msgid "Search Results"
msgstr "搜尋結果"
-#: sphinx/themes/basic/search.html:27
+#: sphinx/themes/basic/search.html:36
msgid "Your search did not match any results."
msgstr ""
+#: sphinx/themes/basic/searchbox.html:12
+msgid "Quick search"
+msgstr "快速搜尋"
+
+#: sphinx/themes/basic/sourcelink.html:11
+msgid "This Page"
+msgstr "本頁"
+
#: sphinx/themes/basic/changes/frameset.html:5
#: sphinx/themes/basic/changes/versionchanges.html:12
#, python-format
@@ -536,68 +707,71 @@ msgstr "C API 改變"
msgid "Other changes"
msgstr "其他改變:"
-#: sphinx/themes/basic/static/doctools.js:139 sphinx/writers/html.py:473
-#: sphinx/writers/html.py:478
+#: sphinx/themes/basic/static/doctools.js:154 sphinx/writers/html.py:482
+#: sphinx/writers/html.py:487
msgid "Permalink to this headline"
msgstr ""
-#: sphinx/themes/basic/static/doctools.js:145 sphinx/writers/html.py:80
+#: sphinx/themes/basic/static/doctools.js:160 sphinx/writers/html.py:87
msgid "Permalink to this definition"
msgstr ""
-#: sphinx/themes/basic/static/doctools.js:174
+#: sphinx/themes/basic/static/doctools.js:189
msgid "Hide Search Matches"
msgstr ""
-#: sphinx/themes/basic/static/searchtools.js:274
+#: sphinx/themes/basic/static/searchtools.js:285
msgid "Searching"
msgstr "搜尋中"
-#: sphinx/themes/basic/static/searchtools.js:279
+#: sphinx/themes/basic/static/searchtools.js:290
msgid "Preparing search..."
msgstr "準備搜尋..."
-#: sphinx/themes/basic/static/searchtools.js:338
-msgid "module, in "
-msgstr ""
-
-#: sphinx/themes/basic/static/searchtools.js:347
+#: sphinx/themes/basic/static/searchtools.js:364
msgid ", in "
msgstr ""
-#: sphinx/themes/basic/static/searchtools.js:455
+#: sphinx/themes/basic/static/searchtools.js:491
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:493
#, python-format
msgid "Search finished, found %s page(s) matching the search query."
msgstr ""
-#: sphinx/writers/latex.py:185
+#: sphinx/themes/default/static/sidebar.js:66
+msgid "Expand sidebar"
+msgstr ""
+
+#: sphinx/themes/default/static/sidebar.js:79
+#: sphinx/themes/default/static/sidebar.js:106
+msgid "Collapse sidebar"
+msgstr ""
+
+#: sphinx/themes/haiku/layout.html:26
+msgid "Contents"
+msgstr ""
+
+#: sphinx/writers/latex.py:171
msgid "Release"
msgstr "釋出"
-#: sphinx/writers/latex.py:571
+#: sphinx/writers/latex.py:572 sphinx/writers/manpage.py:178
msgid "Footnotes"
msgstr ""
-#: sphinx/writers/latex.py:639
+#: sphinx/writers/latex.py:641
msgid "continued from previous page"
msgstr ""
-#: sphinx/writers/latex.py:644
+#: sphinx/writers/latex.py:646
msgid "Continued on next page"
msgstr ""
-#: sphinx/writers/text.py:166
-#, python-format
-msgid "Platform: %s"
-msgstr "平台:%s"
-
-#: sphinx/writers/text.py:428
+#: sphinx/writers/text.py:422
msgid "[image]"
msgstr "[圖片]"
-
diff --git a/sphinx/pycode/__init__.py b/sphinx/pycode/__init__.py
index b7473bf22..63303a85d 100644
--- a/sphinx/pycode/__init__.py
+++ b/sphinx/pycode/__init__.py
@@ -14,8 +14,10 @@ import sys
from os import path
from cStringIO import StringIO
+from sphinx.errors import PycodeError
from sphinx.pycode import nodes
from sphinx.pycode.pgen2 import driver, token, tokenize, parse, literals
+from sphinx.util import get_module_source
from sphinx.util.docstrings import prepare_docstring, prepare_commentdoc
@@ -45,22 +47,42 @@ _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 = {}
+ self.tagnumber = 0
+ self.tagorder = {}
+
+ def add_tag(self, name):
+ name = '.'.join(self.namespace + [name])
+ self.tagorder[name] = self.tagnumber
+ self.tagnumber += 1
def visit_classdef(self, node):
+ """Visit a class."""
+ self.add_tag(node[1].value)
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
+ self.add_tag(node[1].value)
+ 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:
@@ -78,8 +100,7 @@ class AttrDocVisitor(nodes.NodeVisitor):
prefix = pnode.get_prefix()
prefix = prefix.decode(self.encoding)
docstring = prepare_commentdoc(prefix)
- if docstring:
- self.add_docstring(node, docstring)
+ self.add_docstring(node, docstring)
def visit_simple_stmt(self, node):
"""Visit a docstring statement which may have an assignment before."""
@@ -97,28 +118,34 @@ 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
- namespace = '.'.join(self.namespace)
- if namespace.startswith(self.scope):
- self.collected[namespace, target.value] = docstring
-
-
-class PycodeError(Exception):
- def __str__(self):
- res = self.args[0]
- if len(self.args) > 1:
- res += ' (exception was: %r)' % self.args[1]
- return res
+ else:
+ name = target.value
+ self.add_tag(name)
+ if docstring:
+ namespace = '.'.join(self.namespace)
+ if namespace.startswith(self.scope):
+ self.collected[namespace, name] = docstring
class ModuleAnalyzer(object):
@@ -150,33 +177,11 @@ class ModuleAnalyzer(object):
return entry
try:
- if modname not in sys.modules:
- try:
- __import__(modname)
- except ImportError, err:
- raise PycodeError('error importing %r' % modname, err)
- mod = sys.modules[modname]
- if hasattr(mod, '__loader__'):
- try:
- source = mod.__loader__.get_source(modname)
- except Exception, err:
- raise PycodeError('error getting source for %r' % modname,
- err)
+ type, source = get_module_source(modname)
+ if type == 'string':
obj = cls.for_string(source, modname)
- cls.cache['module', modname] = obj
- return obj
- filename = getattr(mod, '__file__', None)
- if filename is None:
- raise PycodeError('no source found for module %r' % modname)
- filename = path.normpath(path.abspath(filename))
- lfilename = filename.lower()
- if lfilename.endswith('.pyo') or lfilename.endswith('.pyc'):
- filename = filename[:-1]
- elif not lfilename.endswith('.py'):
- raise PycodeError('source is not a .py file: %r' % filename)
- if not path.isfile(filename):
- raise PycodeError('source file is not present: %r' % filename)
- obj = cls.for_file(filename, modname)
+ else:
+ obj = cls.for_file(source, modname)
except PycodeError, err:
cls.cache['module', modname] = err
raise
@@ -191,12 +196,18 @@ class ModuleAnalyzer(object):
# file-like object yielding source lines
self.source = source
+ # cache the source code as well
+ pos = self.source.tell()
+ self.code = self.source.read()
+ self.source.seek(pos)
+
# will be filled by tokenize()
self.tokens = None
# will be filled by parse()
self.parsetree = None
# will be filled by find_attr_docs()
self.attr_docs = None
+ self.tagorder = None
# will be filled by find_tags()
self.tags = None
@@ -234,6 +245,7 @@ class ModuleAnalyzer(object):
attr_visitor = AttrDocVisitor(number2name, scope, self.encoding)
attr_visitor.visit(self.parsetree)
self.attr_docs = attr_visitor.collected
+ self.tagorder = attr_visitor.tagorder
# now that we found everything we could in the tree, throw it away
# (it takes quite a bit of memory for large modules)
self.parsetree = None
@@ -298,8 +310,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/driver.py b/sphinx/pycode/pgen2/driver.py
index edc882fa2..39e347b79 100644
--- a/sphinx/pycode/pgen2/driver.py
+++ b/sphinx/pycode/pgen2/driver.py
@@ -35,7 +35,7 @@ class Driver(object):
def parse_tokens(self, tokens, debug=False):
"""Parse a series of tokens and return the syntax tree."""
- # XXX Move the prefix computation into a wrapper around tokenize.
+ # X X X Move the prefix computation into a wrapper around tokenize.
p = parse.Parser(self.grammar, self.convert)
p.setup()
lineno = 1
diff --git a/sphinx/pycode/pgen2/grammar.py b/sphinx/pycode/pgen2/grammar.py
index 381d80e82..5a433578b 100644
--- a/sphinx/pycode/pgen2/grammar.py
+++ b/sphinx/pycode/pgen2/grammar.py
@@ -16,7 +16,7 @@ fallback token code OP, but the parser needs the actual token code.
import pickle
# Local imports
-from sphinx.pycode.pgen2 import token, tokenize
+from sphinx.pycode.pgen2 import token
class Grammar(object):
diff --git a/sphinx/pycode/pgen2/parse.c b/sphinx/pycode/pgen2/parse.c
index fd0e9ff94..e09f50589 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 537d73936..9c97a4539 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/pycode/pgen2/pgen.py b/sphinx/pycode/pgen2/pgen.py
index d6895eaef..0a04447d0 100644
--- a/sphinx/pycode/pgen2/pgen.py
+++ b/sphinx/pycode/pgen2/pgen.py
@@ -54,12 +54,12 @@ class ParserGenerator(object):
first = {}
for label in rawfirst:
ilabel = self.make_label(c, label)
- ##assert ilabel not in first # XXX failed on <> ... !=
+ ##assert ilabel not in first # X X X failed on <> ... !=
first[ilabel] = 1
return first
def make_label(self, c, label):
- # XXX Maybe this should be a method on a subclass of converter?
+ # X X X Maybe this should be a method on a subclass of converter?
ilabel = len(c.labels)
if label[0].isalpha():
# Either a symbol name or a named token
@@ -157,9 +157,9 @@ class ParserGenerator(object):
#self.dump_nfa(name, a, z)
dfa = self.make_dfa(a, z)
#self.dump_dfa(name, dfa)
- oldlen = len(dfa)
+ #oldlen = len(dfa)
self.simplify_dfa(dfa)
- newlen = len(dfa)
+ #newlen = len(dfa)
dfas[name] = dfa
#print name, oldlen, newlen
if startsymbol is None:
diff --git a/sphinx/quickstart.py b/sphinx/quickstart.py
index af1132d56..2e215bfe7 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
@@ -163,7 +164,7 @@ html_static_path = ['%(dot)sstatic']
#html_additional_pages = {}
# If false, no module index is generated.
-#html_use_modindex = True
+#html_domain_indices = True
# If false, no index is generated.
#html_use_index = True
@@ -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.
@@ -209,6 +216,12 @@ latex_documents = [
# not chapters.
#latex_use_parts = False
+# If true, show page references after internal links.
+#latex_show_pagerefs = False
+
+# If true, show URL addresses after external links.
+#latex_show_urls = False
+
# Additional stuff for the LaTeX preamble.
#latex_preamble = ''
@@ -216,7 +229,56 @@ latex_documents = [
#latex_appendices = []
# If false, no module index is generated.
-#latex_use_modindex = True
+#latex_domain_indices = True
+
+
+# -- Options for manual page output --------------------------------------------
+
+# One entry per manual page. List of tuples
+# (source start file, name, description, authors, manual section).
+man_pages = [
+ ('%(master_str)s', '%(project_manpage)s', u'%(project_doc)s',
+ [u'%(author_str)s'], 1)
+]
+'''
+
+EPUB_CONFIG = '''
+
+# -- Options for Epub output ---------------------------------------------------
+
+# Bibliographic Dublin Core info.
+epub_title = u'%(project_str)s'
+epub_author = u'%(author_str)s'
+epub_publisher = u'%(author_str)s'
+epub_copyright = u'%(copyright_str)s'
+
+# 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 +326,27 @@ 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 devhelp \
+epub latex latexpdf text man 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 " text to make text files"
+\t@echo " man to make manual pages"
+\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 +362,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,12 +392,43 @@ qthelp:
\t@echo "To view the help file:"
\t@echo "# assistant -collectionFile $(BUILDDIR)/qthelp/%(project_fn)s.qhc"
+devhelp:
+\t$(SPHINXBUILD) -b devhelp $(ALLSPHINXOPTS) $(BUILDDIR)/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 $(BUILDDIR)/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
\t@echo "Build finished; the LaTeX files are in $(BUILDDIR)/latex."
-\t@echo "Run \\`make all-pdf' or \\`make all-ps' in that directory to" \\
-\t "run these through (pdf)latex."
+\t@echo "Run \\`make' in that directory to run these through (pdf)latex" \\
+\t "(use \\`make latexpdf' here to do that automatically)."
+
+latexpdf: latex
+\t$(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex
+\t@echo "Running LaTeX files through pdflatex..."
+\tmake -C $(BUILDDIR)/latex all-pdf
+\t@echo "pdflatex finished; the PDF files are in $(BUILDDIR)/latex."
+
+text:
+\t$(SPHINXBUILD) -b text $(ALLSPHINXOPTS) $(BUILDDIR)/text
+\t@echo
+\t@echo "Build finished. The text files are in $(BUILDDIR)/text."
+
+man:
+\t$(SPHINXBUILD) -b man $(ALLSPHINXOPTS) $(BUILDDIR)/man
+\t@echo
+\t@echo "Build finished. The manual pages are in $(BUILDDIR)/man."
changes:
\t$(SPHINXBUILD) -b changes $(ALLSPHINXOPTS) $(BUILDDIR)/changes
@@ -348,7 +452,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 +466,21 @@ 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. text to make text files
+\techo. man to make manual pages
+\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 +504,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 +544,20 @@ if "%%1" == "qthelp" (
\tgoto end
)
+if "%%1" == "devhelp" (
+\t%%SPHINXBUILD%% -b devhelp %%ALLSPHINXOPTS%% %%BUILDDIR%%/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.
@@ -433,6 +565,20 @@ if "%%1" == "latex" (
\tgoto end
)
+if "%%1" == "text" (
+\t%%SPHINXBUILD%% -b text %%ALLSPHINXOPTS%% %%BUILDDIR%%/text
+\techo.
+\techo.Build finished. The text files are in %%BUILDDIR%%/text.
+\tgoto end
+)
+
+if "%%1" == "man" (
+\t%%SPHINXBUILD%% -b man %%ALLSPHINXOPTS%% %%BUILDDIR%%/man
+\techo.
+\techo.Build finished. The manual pages are in %%BUILDDIR%%/man.
+\tgoto end
+)
+
if "%%1" == "changes" (
\t%%SPHINXBUILD%% -b changes %%ALLSPHINXOPTS%% %%BUILDDIR%%/changes
\techo.
@@ -537,7 +683,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).'''
@@ -606,6 +752,11 @@ document is a custom template, you can also set this to another filename.'''
'existing file and press Enter', d['master'])
print '''
+Sphinx can also add configuration for epub output:'''
+ do_prompt(d, 'epub', 'Do you want to use the epub builder (y/N)',
+ 'n', boolean)
+
+ print '''
Please indicate if you want to use one of the following Sphinx extensions:'''
do_prompt(d, 'ext_autodoc', 'autodoc: automatically insert docstrings '
'from modules (y/N)', 'n', boolean)
@@ -626,6 +777,8 @@ Please indicate if you want to use one of the following Sphinx extensions:'''
pngmath has been deselected.'''
do_prompt(d, 'ext_ifconfig', 'ifconfig: conditional inclusion of '
'content based on config values (y/N)', 'n', boolean)
+ do_prompt(d, 'ext_viewcode', 'viewcode: include links to the source code '
+ 'of documented Python objects (y/N)', 'n', boolean)
print '''
A Makefile and a Windows command file can be generated for you so that you
only have to run e.g. `make html' instead of invoking sphinx-build
@@ -635,12 +788,13 @@ directly.'''
'y', boolean)
d['project_fn'] = make_filename(d['project'])
+ d['project_manpage'] = d['project_fn'].lower()
d['now'] = time.asctime()
d['underline'] = len(d['project']) * '='
d['extensions'] = ', '.join(
repr('sphinx.ext.' + name)
for name in ('autodoc', 'doctest', 'intersphinx', 'todo', 'coverage',
- 'pngmath', 'jsmath', 'ifconfig')
+ 'pngmath', 'jsmath', 'ifconfig', 'viewcode')
if d['ext_' + name])
d['copyright'] = time.strftime('%Y') + ', ' + d['author']
d['author_texescaped'] = unicode(d['author']).\
@@ -651,7 +805,7 @@ directly.'''
# escape backslashes and single quotes in strings that are put into
# a Python string literal
- for key in ('project', 'copyright', 'author_texescaped',
+ for key in ('project', 'copyright', 'author', 'author_texescaped',
'project_doc_texescaped', 'version', 'release', 'master'):
d[key + '_str'] = d[key].replace('\\', '\\\\').replace("'", "\\'")
@@ -663,15 +817,17 @@ 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'))
conf_text = QUICKSTART_CONF % d
+ if d['epub']:
+ conf_text += EPUB_CONFIG % d
if d['ext_intersphinx']:
conf_text += INTERSPHINX_CONFIG
diff --git a/sphinx/roles.py b/sphinx/roles.py
index 599de3c75..0164d7576 100644
--- a/sphinx/roles.py
+++ b/sphinx/roles.py
@@ -10,54 +10,166 @@
"""
import re
+import warnings
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.locale import _
+from sphinx.util import ws_re
+from sphinx.util.nodes import split_explicit_title
generic_docroles = {
'command' : nodes.strong,
'dfn' : nodes.emphasis,
- 'guilabel' : nodes.strong,
'kbd' : nodes.literal,
'mailheader' : addnodes.literal_emphasis,
'makevar' : nodes.strong,
'manpage' : addnodes.literal_emphasis,
'mimetype' : addnodes.literal_emphasis,
'newsgroup' : addnodes.literal_emphasis,
- 'program' : nodes.strong,
+ 'program' : nodes.strong, # XXX should be an x-ref
'regexp' : nodes.literal,
}
for rolename, nodeclass in generic_docroles.iteritems():
- role = roles.GenericRole(rolename, nodeclass)
+ generic = roles.GenericRole(rolename, nodeclass)
+ role = roles.CustomRole(rolename, generic, {'classes': [rolename]})
roles.register_local_role(rolename, role)
+# -- generic cross-reference role ----------------------------------------------
+
+class XRefRole(object):
+ """
+ A generic cross-referencing role. To create a callable that can be used as
+ a role function, create an instance of this class.
+
+ The general features of this role are:
+
+ * Automatic creation of a reference and a content node.
+ * Optional separation of title and target with `title <target>`.
+ * The implementation is a class rather than a function to make
+ customization easier.
+
+ Customization can be done in two ways:
+
+ * Supplying constructor parameters:
+ * `fix_parens` to normalize parentheses (strip from target, and add to
+ title if configured)
+ * `lowercase` to lowercase the target
+ * `nodeclass` and `innernodeclass` select the node classes for
+ the reference and the content node
+
+ * Subclassing and overwriting `process_link()` and/or `result_nodes()`.
+ """
+
+ nodeclass = addnodes.pending_xref
+ innernodeclass = nodes.literal
+
+ def __init__(self, fix_parens=False, lowercase=False,
+ nodeclass=None, innernodeclass=None):
+ self.fix_parens = fix_parens
+ self.lowercase = lowercase
+ if nodeclass is not None:
+ self.nodeclass = nodeclass
+ if innernodeclass is not None:
+ self.innernodeclass = innernodeclass
+
+ def _fix_parens(self, env, has_explicit_title, title, target):
+ if not has_explicit_title:
+ if title.endswith('()'):
+ # remove parentheses
+ title = title[:-2]
+ if env.config.add_function_parentheses:
+ # add them back to all occurrences if configured
+ title += '()'
+ # remove parentheses from the target too
+ if target.endswith('()'):
+ target = target[:-2]
+ return title, target
+
+ def __call__(self, typ, rawtext, text, lineno, inliner,
+ options={}, content=[]):
+ env = inliner.document.settings.env
+ if not typ:
+ typ = env.config.default_role
+ else:
+ typ = typ.lower()
+ if ':' not in typ:
+ domain, role = '', typ
+ classes = ['xref', role]
+ else:
+ domain, role = typ.split(':', 1)
+ classes = ['xref', domain, '%s-%s' % (domain, role)]
+ # if the first character is a bang, don't cross-reference at all
+ if text[0:1] == '!':
+ text = utils.unescape(text)
+ if self.fix_parens:
+ text, tgt = self._fix_parens(env, False, text[1:], "")
+ innernode = self.innernodeclass(rawtext, text, classes=classes)
+ return self.result_nodes(inliner.document, env, innernode,
+ is_ref=False)
+ # split title and target in role content
+ has_explicit_title, title, target = split_explicit_title(text)
+ title = utils.unescape(title)
+ target = utils.unescape(target)
+ # fix-up title and target
+ if self.lowercase:
+ target = target.lower()
+ if self.fix_parens:
+ title, target = self._fix_parens(
+ env, has_explicit_title, title, target)
+ # create the reference node
+ refnode = self.nodeclass(rawtext, reftype=role, refdomain=domain,
+ refexplicit=has_explicit_title)
+ # we may need the line number for warnings
+ refnode.line = lineno
+ title, target = self.process_link(
+ env, refnode, has_explicit_title, title, target)
+ # now that the target and title are finally determined, set them
+ refnode['reftarget'] = target
+ refnode += self.innernodeclass(rawtext, title, classes=classes)
+ # we also need the source document
+ refnode['refdoc'] = env.docname
+ # result_nodes allow further modification of return values
+ return self.result_nodes(inliner.document, env, refnode, is_ref=True)
+
+ # methods that can be overwritten
+
+ def process_link(self, env, refnode, has_explicit_title, title, target):
+ """
+ Called after parsing title and target text, and creating the reference
+ node (given in *refnode*). This method can alter the reference node and
+ must return a new (or the same) ``(title, target)`` tuple.
+ """
+ return title, ws_re.sub(' ', target)
+
+ def result_nodes(self, document, env, node, is_ref):
+ """
+ Called before returning the finished nodes. *node* is the reference
+ node if one was created (*is_ref* is then true), else the content node.
+ This method can add other nodes and must return a ``(nodes, messages)``
+ tuple (the usual return value of a role function).
+ """
+ return [node], []
+
def indexmarkup_role(typ, rawtext, etext, lineno, inliner,
options={}, content=[]):
+ """Role for PEP/RFC references that generate an index entry."""
env = inliner.document.settings.env
if not typ:
typ = env.config.default_role
else:
typ = typ.lower()
text = utils.unescape(etext)
- targetid = 'index-%s' % env.index_num
- env.index_num += 1
+ targetid = 'index-%s' % env.new_serialno('index')
indexnode = addnodes.index()
targetnode = nodes.target('', '', ids=[targetid])
inliner.document.note_explicit_target(targetnode)
- if typ == 'envvar':
- indexnode['entries'] = [('single', text, targetid, text),
- ('single', _('environment variable; %s') % text,
- targetid, text)]
- xref_nodes = xfileref_role(typ, rawtext, etext, lineno, inliner,
- options, content)[0]
- return [indexnode, targetnode] + xref_nodes, []
- elif typ == 'pep':
+ if typ == 'pep':
indexnode['entries'] = [
('single', _('Python Enhancement Proposals!PEP %s') % text,
targetid, 'PEP %s' % text)]
@@ -70,7 +182,7 @@ def indexmarkup_role(typ, rawtext, etext, lineno, inliner,
return [prb], [msg]
ref = inliner.document.settings.pep_base_url + 'pep-%04d' % pepnum
sn = nodes.strong('PEP '+text, 'PEP '+text)
- rn = nodes.reference('', '', refuri=ref)
+ rn = nodes.reference('', '', internal=False, refuri=ref, classes=[typ])
rn += sn
return [indexnode, targetnode, rn], []
elif typ == 'rfc':
@@ -85,136 +197,36 @@ def indexmarkup_role(typ, rawtext, etext, lineno, inliner,
return [prb], [msg]
ref = inliner.document.settings.rfc_base_url + inliner.rfc_url % rfcnum
sn = nodes.strong('RFC '+text, 'RFC '+text)
- rn = nodes.reference('', '', refuri=ref)
+ rn = nodes.reference('', '', internal=False, refuri=ref, classes=[typ])
rn += sn
return [indexnode, targetnode, rn], []
-roles.register_local_role('envvar', indexmarkup_role)
-roles.register_local_role('pep', indexmarkup_role)
-roles.register_local_role('rfc', indexmarkup_role)
-
-
-# default is `literal`
-innernodetypes = {
- 'ref': nodes.emphasis,
- 'term': nodes.emphasis,
- 'token': nodes.strong,
- 'envvar': nodes.strong,
- 'download': nodes.strong,
- 'option': addnodes.literal_emphasis,
-}
-
-def _fix_parens(typ, text, env):
- if typ in ('func', 'meth', 'cfunc'):
- if text.endswith('()'):
- # remove parentheses
- text = text[:-2]
- if env.config.add_function_parentheses:
- # add them back to all occurrences if configured
- text += '()'
- return text
-
-def xfileref_role(typ, rawtext, text, lineno, inliner, options={}, content=[]):
- env = inliner.document.settings.env
- if not typ:
- typ = env.config.default_role
- else:
- typ = typ.lower()
- text = utils.unescape(text)
- # if the first character is a bang, don't cross-reference at all
- if text[0:1] == '!':
- text = _fix_parens(typ, text[1:], env)
- return [innernodetypes.get(typ, nodes.literal)(
- rawtext, text, classes=['xref'])], []
- # we want a cross-reference, create the reference node
- nodeclass = (typ == 'download') and addnodes.download_reference or \
- addnodes.pending_xref
- pnode = nodeclass(rawtext, reftype=typ, refcaption=False,
- 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
- 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:
- 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)
- # if the first character is a tilde, don't display the module/class
- # parts of the contents
- if title[0:1] == '~':
- title = title[1:]
- dot = title.rfind('.')
- if dot != -1:
- title = title[dot+1:]
- # remove parentheses from the target too
- if target.endswith('()'):
- target = target[:-2]
- # if the first character is a dot, search more specific namespaces first
- # else search builtins first
- if target[0:1] == '.':
- target = target[1:]
- pnode['refspecific'] = True
- # some other special cases for the target
- elif typ == 'option':
- program = env.currprogram
- if titleistarget:
- if ' ' in title and not (title.startswith('/') or
- title.startswith('-')):
- program, target = re.split(' (?=-|--|/)', title, 1)
- program = ws_re.sub('-', program)
- target = target.strip()
- elif ' ' in target:
- program, target = re.split(' (?=-|--|/)', target, 1)
- program = ws_re.sub('-', program)
- pnode['refprogram'] = program
- elif typ == 'term':
- # normalize whitespace in definition terms (if the term reference is
- # broken over a line, a newline will be in target)
- target = ws_re.sub(' ', target).lower()
- elif typ == 'ref':
- # reST label names are always lowercased
- target = ws_re.sub('', target).lower()
- elif typ == 'cfunc':
- # fix-up parens for C functions too
- if titleistarget:
- title = _fix_parens(typ, title, env)
- # remove parentheses from the target too
- if target.endswith('()'):
- target = target[:-2]
- else:
- # remove all whitespace to avoid referencing problems
- target = ws_re.sub('', target)
- pnode['refdoc'] = env.docname
- pnode['reftarget'] = target
- pnode += innernodetypes.get(typ, nodes.literal)(rawtext, title,
- classes=['xref'])
- return [pnode], []
+_amp_re = re.compile(r'(?<!&)&(?![&\s])')
def menusel_role(typ, rawtext, text, lineno, inliner, options={}, content=[]):
- return [nodes.emphasis(
- rawtext,
- utils.unescape(text).replace('-->', u'\N{TRIANGULAR BULLET}'))], []
+ if typ == 'menuselection':
+ text = utils.unescape(text).replace('-->', u'\N{TRIANGULAR BULLET}')
+ spans = _amp_re.split(text)
+
+ node = nodes.emphasis(rawtext=rawtext)
+ for i, span in enumerate(spans):
+ span = span.replace('&&', '&')
+ if i == 0:
+ if len(span) > 0:
+ textnode = nodes.Text(span)
+ node += textnode
+ continue
+ accel_node = nodes.inline()
+ letter_node = nodes.Text(span[0])
+ accel_node += letter_node
+ accel_node['classes'].append('accelerator')
+ node += accel_node
+ textnode = nodes.Text(span[1:])
+ node += textnode
+ node['classes'].append(typ)
+ return [node], []
_litvar_re = re.compile('{([^}]+)}')
@@ -222,7 +234,7 @@ def emph_literal_role(typ, rawtext, text, lineno, inliner,
options={}, content=[]):
text = utils.unescape(text)
pos = 0
- retnode = nodes.literal(role=typ.lower())
+ retnode = nodes.literal(role=typ.lower(), classes=[typ])
for m in _litvar_re.finditer(text):
if m.start() > pos:
txt = text[pos:m.start()]
@@ -247,30 +259,14 @@ def abbr_role(typ, rawtext, text, lineno, inliner, options={}, content=[]):
specific_docroles = {
- 'data': xfileref_role,
- 'exc': xfileref_role,
- 'func': xfileref_role,
- 'class': xfileref_role,
- 'const': xfileref_role,
- 'attr': xfileref_role,
- 'meth': xfileref_role,
- 'obj': xfileref_role,
- 'cfunc' : xfileref_role,
- 'cmember': xfileref_role,
- 'cdata': xfileref_role,
- 'ctype': xfileref_role,
- 'cmacro': xfileref_role,
-
- 'mod': xfileref_role,
-
- 'keyword': xfileref_role,
- 'ref': xfileref_role,
- 'token': xfileref_role,
- 'term': xfileref_role,
- 'option': xfileref_role,
- 'doc': xfileref_role,
- 'download': xfileref_role,
+ # links to download references
+ 'download': XRefRole(nodeclass=addnodes.download_reference),
+ # links to documents
+ 'doc': XRefRole(),
+ 'pep': indexmarkup_role,
+ 'rfc': indexmarkup_role,
+ 'guilabel': menusel_role,
'menuselection': menusel_role,
'file': emph_literal_role,
'samp': emph_literal_role,
@@ -279,3 +275,10 @@ specific_docroles = {
for rolename, func in specific_docroles.iteritems():
roles.register_local_role(rolename, func)
+
+
+# backwards compatibility alias
+def xfileref_role(*args, **kwds):
+ warnings.warn('xfileref_role is deprecated, use XRefRole',
+ DeprecationWarning, stacklevel=2)
+ return XRefRole()(*args, **kwds)
diff --git a/sphinx/search.py b/sphinx/search.py
index c0d3ab3c6..0d07fd72f 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):
@@ -105,8 +119,10 @@ class IndexBuilder(object):
self._titles = {}
# stemmed word -> set(filenames)
self._mapping = {}
- # desctypes -> index
- self._desctypes = {}
+ # objtype -> index
+ self._objtypes = {}
+ # objtype index -> objname (localized)
+ self._objnames = {}
def load(self, stream, format):
"""Reconstruct from frozen data."""
@@ -124,7 +140,7 @@ class IndexBuilder(object):
self._mapping[k] = set([index2fn[v]])
else:
self._mapping[k] = set(index2fn[i] for i in v)
- # no need to load keywords/desctypes
+ # no need to load keywords/objtypes
def dump(self, stream, format):
"""Dump the frozen index to a stream."""
@@ -132,27 +148,33 @@ class IndexBuilder(object):
format = self.formats[format]
format.dump(self.freeze(), stream)
- def get_modules(self, fn2index):
- rv = {}
- for name, (doc, _, _, _) in self.env.modules.iteritems():
- if doc in fn2index:
- rv[name] = fn2index[doc]
- return rv
-
- def get_descrefs(self, fn2index):
+ def get_objects(self, fn2index):
rv = {}
- dt = self._desctypes
- for fullname, (doc, desctype) in self.env.descrefs.iteritems():
- if doc not in fn2index:
- continue
- prefix, name = rpartition(fullname, '.')
- pdict = rv.setdefault(prefix, {})
- try:
- i = dt[desctype]
- except KeyError:
- i = len(dt)
- dt[desctype] = i
- pdict[name] = (fn2index[doc], i)
+ otypes = self._objtypes
+ onames = self._objnames
+ for domainname, domain in self.env.domains.iteritems():
+ for fullname, dispname, type, docname, anchor, prio in \
+ domain.get_objects():
+ # XXX use dispname?
+ if docname not in fn2index:
+ continue
+ if prio < 0:
+ continue
+ # XXX splitting at dot is kind of Python specific
+ prefix, name = rpartition(fullname, '.')
+ pdict = rv.setdefault(prefix, {})
+ try:
+ i = otypes[domainname, type]
+ except KeyError:
+ i = len(otypes)
+ otypes[domainname, type] = i
+ otype = domain.object_types.get(type)
+ if otype:
+ # use str() to fire translation proxies
+ onames[i] = str(domain.get_type_name(otype))
+ else:
+ onames[i] = type
+ pdict[name] = (fn2index[docname], i, prio)
return rv
def get_terms(self, fn2index):
@@ -171,14 +193,13 @@ class IndexBuilder(object):
filenames = self._titles.keys()
titles = self._titles.values()
fn2index = dict((f, i) for (i, f) in enumerate(filenames))
- return dict(
- filenames=filenames,
- titles=titles,
- terms=self.get_terms(fn2index),
- descrefs=self.get_descrefs(fn2index),
- modules=self.get_modules(fn2index),
- desctypes=dict((v, k) for (k, v) in self._desctypes.items()),
- )
+ terms = self.get_terms(fn2index)
+ objects = self.get_objects(fn2index) # populates _objtypes
+ objtypes = dict((v, k[0] + ':' + k[1])
+ for (k, v) in self._objtypes.iteritems())
+ objnames = self._objnames
+ return dict(filenames=filenames, titles=titles, terms=terms,
+ objects=objects, objtypes=objtypes, objnames=objnames)
def prune(self, filenames):
"""Remove data for all filenames not in the list."""
@@ -197,11 +218,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 d569b031c..e2d83bc6c 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 = [
@@ -30,16 +64,27 @@ class BuildDoc(Command):
('all-files', 'a', 'build all files'),
('source-dir=', 's', 'Source directory'),
('build-dir=', None, 'Build directory'),
+ ('config-dir=', 'c', 'Location of the configuration directory'),
('builder=', 'b', 'The builder to use. Defaults to "html"'),
- ]
- boolean_options = ['fresh-env', 'all-files']
+ ('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|'),
+ ('link-index', 'i', 'Link index.html to the master doc'),
+ ]
+ boolean_options = ['fresh-env', 'all-files', 'link-index']
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 = ''
+ self.config_dir = None
+ self.link_index = False
def _guess_source_dir(self):
for guess in ('doc', 'docs'):
@@ -48,13 +93,18 @@ class BuildDoc(Command):
for root, dirnames, filenames in os.walk(guess):
if 'conf.py' in filenames:
return root
+ return None
def finalize_options(self):
if self.source_dir is None:
self.source_dir = self._guess_source_dir()
self.announce('Using source directory %s' % self.source_dir)
self.ensure_dirname('source_dir')
+ if self.source_dir is None:
+ self.source_dir = os.curdir
self.source_dir = os.path.abspath(self.source_dir)
+ if self.config_dir is None:
+ self.config_dir = self.source_dir
if self.build_dir is None:
build = self.get_finalized_command('build')
@@ -74,9 +124,16 @@ class BuildDoc(Command):
status_stream = StringIO()
else:
status_stream = sys.stdout
- app = Sphinx(self.source_dir, self.source_dir,
+ 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.config_dir,
self.builder_target_dir, self.doctree_dir,
- self.builder, {}, status_stream,
+ self.builder, confoverrides, status_stream,
freshenv=self.fresh_env)
try:
@@ -92,3 +149,8 @@ class BuildDoc(Command):
'backslashreplace')
else:
raise
+
+ if self.link_index:
+ src = app.config.master_doc + app.builder.out_suffix
+ dst = app.builder.get_outfilename('index')
+ os.symlink(src, dst)
diff --git a/sphinx/texinputs/Makefile b/sphinx/texinputs/Makefile
index 5c0d50189..d5a73f5bb 100644
--- a/sphinx/texinputs/Makefile
+++ b/sphinx/texinputs/Makefile
@@ -37,7 +37,6 @@ bz2: tar
latex $(LATEXOPTS) '$<'
latex $(LATEXOPTS) '$<'
-makeindex -s python.ist '$(basename $<).idx'
- -makeindex -s python.ist '$(basename mod$<).idx'
latex $(LATEXOPTS) '$<'
latex $(LATEXOPTS) '$<'
@@ -46,7 +45,6 @@ bz2: tar
pdflatex $(LATEXOPTS) '$<'
pdflatex $(LATEXOPTS) '$<'
-makeindex -s python.ist '$(basename $<).idx'
- -makeindex -s python.ist '$(basename mod$<).idx'
pdflatex $(LATEXOPTS) '$<'
pdflatex $(LATEXOPTS) '$<'
diff --git a/sphinx/texinputs/sphinx.sty b/sphinx/texinputs/sphinx.sty
index 6b98d289c..be8a6c15d 100644
--- a/sphinx/texinputs/sphinx.sty
+++ b/sphinx/texinputs/sphinx.sty
@@ -6,7 +6,7 @@
%
\NeedsTeXFormat{LaTeX2e}[1995/12/01]
-\ProvidesPackage{sphinx}[2008/05/01 LaTeX package (Sphinx markup)]
+\ProvidesPackage{sphinx}[2010/01/15 LaTeX package (Sphinx markup)]
\RequirePackage{textcomp}
\RequirePackage{fancyhdr}
@@ -130,8 +130,6 @@
\newcommand{\samp}[1]{`\code{#1}'}
\newcommand{\email}[1]{\textsf{#1}}
-\newcommand{\py@modulebadkey}{{--just-some-junk--}}
-
% Redefine the Verbatim environment to allow border and background colors.
% The original environment is still used for verbatims within tables.
\let\OriginalVerbatim=\Verbatim
@@ -142,12 +140,11 @@
\newlength\leftsidespace
\def\mycolorbox#1{%
\setlength\leftsidespace{\@totalleftmargin}%
- \setlength\distancetoright{\textwidth}%
+ \setlength\distancetoright{\linewidth}%
\advance\distancetoright -\@totalleftmargin %
\noindent\hspace*{\@totalleftmargin}%
\fcolorbox{VerbatimBorderColor}{VerbatimColor}{%
\begin{minipage}{\distancetoright}%
- \smallskip%
\noindent\hspace*{-\leftsidespace}%
#1
\end{minipage}%
@@ -156,6 +153,9 @@
\def\FrameCommand{\mycolorbox}
\renewcommand{\Verbatim}[1][1]{%
+ % list starts new par, but we don't want it to be set apart vertically
+ \bgroup\parskip=0pt%
+ \smallskip%
% The list environement is needed to control perfectly the vertical
% space.
\list{}{%
@@ -173,6 +173,8 @@
\endOriginalVerbatim%
\endMakeFramed%
\endlist%
+ % close group to restore \parskip
+ \egroup%
}
@@ -193,89 +195,12 @@
\index{#4!#1 #2 #3}
}
-% support for the module index
-\newif\ifpy@UseModuleIndex
-\py@UseModuleIndexfalse
-
-\newcommand{\makemodindex}{
- \newwrite\modindexfile
- \openout\modindexfile=mod\jobname.idx
- \py@UseModuleIndextrue
-}
-
-\newcommand{\printmodindex}{
- \@input@{mod\jobname.ind}
-}
-
-% Add the defining entry for a module
-\newcommand{\py@modindex}[2]{%
- \renewcommand{\py@thismodule}{#1}
- \ifpy@UseModuleIndex%
- \@ifundefined{py@modplat@\py@thismodulekey}{
- \write\modindexfile{\protect\indexentry{#1@{\texttt{#1}}|hyperpage}{\thepage}}%
- }{\write\modindexfile{\protect\indexentry{#1@{\texttt{#1 }%
- \emph{(\platformof{\py@thismodulekey})}}|hyperpage}{\thepage}}%
- }
- \fi%
-}
-
-% "Current" keys
-\newcommand{\py@thisclass}{}
-\newcommand{\py@thismodule}{}
-\newcommand{\py@thismodulekey}{}
-\newcommand{\py@thismoduletype}{}
-\newcommand{\py@emptymodule}{}
-
-% \declaremodule[key]{type}{name}
-\newcommand{\declaremodule}[3][\py@modulebadkey]{
- \renewcommand{\py@thismoduletype}{#2}
- \ifx\py@modulebadkey#1
- \renewcommand{\py@thismodulekey}{#3}
- \else
- \renewcommand{\py@thismodulekey}{#1}
- \fi
- \py@modindex{#3}{}
- %\label{module-\py@thismodulekey}
-}
-
-% Record module platforms for the Module Index
-\newif\ifpy@ModPlatformFileIsOpen \py@ModPlatformFileIsOpenfalse
-\long\def\py@writeModPlatformFile#1{%
- \protected@write\py@ModPlatformFile%
- {\let\label\@gobble \let\index\@gobble \let\glossary\@gobble}%
- {\string#1}%
-}
-\newcommand{\py@ModPlatformFilename}{\jobname.pla}
-\newcommand{\platform}[1]{
- \ifpy@ModPlatformFileIsOpen\else
- \newwrite\py@ModPlatformFile
- \openout\py@ModPlatformFile=\py@ModPlatformFilename
- \py@ModPlatformFileIsOpentrue
- \fi
- \py@writeModPlatformFile{\py@defplatform{\py@thismodulekey}{#1}}
-}
-\newcommand{\py@defplatform}[2]{\expandafter\def\csname py@modplat@#1\endcsname{#2}}
-\newcommand{\platformof}[1]{\csname py@modplat@#1\endcsname}
-
-\InputIfFileExists{\jobname.pla}{}{}
-
% \moduleauthor{name}{email}
\newcommand{\moduleauthor}[2]{}
% \sectionauthor{name}{email}
\newcommand{\sectionauthor}[2]{}
-% Ignore module synopsis.
-\newcommand{\modulesynopsis}[1]{}
-
-% Reset "current" objects.
-\newcommand{\resetcurrentobjects}{
- \renewcommand{\py@thisclass}{}
- \renewcommand{\py@thismodule}{}
- \renewcommand{\py@thismodulekey}{}
- \renewcommand{\py@thismoduletype}{}
-}
-
% Augment the sectioning commands used to get our own font family in place,
% and reset some internal data items:
\titleformat{\section}{\Large\py@HeaderFamily}%
@@ -287,14 +212,7 @@
\titleformat{\paragraph}{\large\py@HeaderFamily}%
{\py@TitleColor}{0em}{\py@TitleColor}{\py@NormalColor}
-
-% Now for a lot of semantically-loaded environments that do a ton of magical
-% things to get the right formatting and index entries for the stuff in
-% Python modules and C API.
-
-
-% {fulllineitems} is used in one place in libregex.tex, but is really for
-% internal use in this file.
+% {fulllineitems} is the main environment for object descriptions.
%
\newcommand{\py@itemnewline}[1]{%
\@tempdima\linewidth%
@@ -308,222 +226,19 @@
\let\makelabel=\py@itemnewline}
}{\end{list}}
-% \optional is mostly for use in the arguments parameters to the various
-% {*desc} environments defined below, but may be used elsewhere. Known to
-% be used in the debugger chapter.
-%
-% Typical usage:
-%
-% \begin{funcdesc}{myfunc}{reqparm\optional{, optparm}}
-% ^^^ ^^^
-% No space here No space here
-%
-% When a function has multiple optional parameters, \optional should be
-% nested, not chained. This is right:
-%
-% \begin{funcdesc}{myfunc}{\optional{parm1\optional{, parm2}}}
-%
-\let\py@badkey=\@undefined
-
+% \optional is used for ``[, arg]``, i.e. desc_optional nodes.
\newcommand{\optional}[1]{%
{\textnormal{\Large[}}{#1}\hspace{0.5mm}{\textnormal{\Large]}}}
-% This can be used when a function or method accepts an varying number
-% of arguments, such as by using the *args syntax in the parameter list.
-\newcommand{\py@moreargs}{...}
-
-% This can be used when you don't want to document the parameters to a
-% function or method, but simply state that it's an alias for
-% something else.
-\newcommand{\py@unspecified}{...}
-
-\newcommand{\py@varvars}[1]{{%
- {\let\unspecified=\py@unspecified%
- \let\moreargs=\py@moreargs%
- \emph{#1}}}}
-
\newlength{\py@argswidth}
-\newcommand{\py@sigparams}[1]{%
- \parbox[t]{\py@argswidth}{\py@varvars{#1}\code{)}}}
-\newcommand{\py@sigline}[2]{%
+\newcommand{\py@sigparams}[2]{%
+ \parbox[t]{\py@argswidth}{#1\code{)}#2}}
+\newcommand{\pysigline}[1]{\item[#1]\nopagebreak}
+\newcommand{\pysiglinewithargsret}[3]{%
\settowidth{\py@argswidth}{#1\code{(}}%
\addtolength{\py@argswidth}{-2\py@argswidth}%
- \addtolength{\py@argswidth}{\textwidth}%
- \item[#1\code{(}\py@sigparams{#2}]}
-
-% C functions ------------------------------------------------------------
-% \begin{cfuncdesc}[refcount]{type}{name}{arglist}
-% Note that the [refcount] slot should only be filled in by
-% tools/anno-api.py; it pulls the value from the refcounts database.
-\newcommand{\cfuncline}[3]{
- \py@sigline{\code{#1 \bfcode{#2}}}{#3}%
-}
-\newenvironment{cfuncdesc}[3]{
- \begin{fulllineitems}
- \cfuncline{#1}{#2}{#3}
-}{\end{fulllineitems}}
-
-% C variables ------------------------------------------------------------
-% \begin{cvardesc}{type}{name}
-\newenvironment{cvardesc}[2]{
- \begin{fulllineitems}
- \item[\code{#1 \bfcode{#2}}]
-}{\end{fulllineitems}}
-
-% C data types -----------------------------------------------------------
-% \begin{ctypedesc}[index name]{typedef name}
-\newenvironment{ctypedesc}[2][\py@badkey]{
- \begin{fulllineitems}
- \item[\bfcode{#2}]
-}{\end{fulllineitems}}
-
-% C type fields ----------------------------------------------------------
-% \begin{cmemberdesc}{container type}{ctype}{membername}
-\newcommand{\cmemberline}[3]{
- \item[\code{#2 \bfcode{#3}}]
-}
-\newenvironment{cmemberdesc}[3]{
- \begin{fulllineitems}
- \cmemberline{#1}{#2}{#3}
-}{\end{fulllineitems}}
-
-% Funky macros -----------------------------------------------------------
-% \begin{csimplemacrodesc}{name}
-% -- "simple" because it has no args; NOT for constant definitions!
-\newenvironment{csimplemacrodesc}[1]{
- \begin{fulllineitems}
- \item[\bfcode{#1}]
-}{\end{fulllineitems}}
-
-% simple functions (not methods) -----------------------------------------
-% \begin{funcdesc}{name}{args}
-\newcommand{\funcline}[2]{%
- \py@sigline{\bfcode{#1}}{#2}}
-\newenvironment{funcdesc}[2]{
- \begin{fulllineitems}
- \funcline{#1}{#2}
-}{\end{fulllineitems}}
-
-% classes ----------------------------------------------------------------
-% \begin{classdesc}{name}{constructor args}
-\newcommand{\classline}[2]{
- \py@sigline{\strong{class }\bfcode{#1}}{#2}}
-\newenvironment{classdesc}[2]{
- % Using \renewcommand doesn't work for this, for unknown reasons:
- \global\def\py@thisclass{#1}
- \begin{fulllineitems}
- \classline{#1}{#2}
-}{\end{fulllineitems}}
-
-% \begin{excclassdesc}{name}{constructor args}
-% but indexes as an exception
-\newenvironment{excclassdesc}[2]{
- % Using \renewcommand doesn't work for this, for unknown reasons:
- \global\def\py@thisclass{#1}
- \begin{fulllineitems}
- \py@sigline{\strong{exception }\bfcode{#1}}{#2}%
-}{\end{fulllineitems}}
-
-% There is no corresponding {excclassdesc*} environment. To describe
-% a class exception without parameters, use the {excdesc} environment.
-
-
-\let\py@classbadkey=\@undefined
-
-% object method ----------------------------------------------------------
-% \begin{methoddesc}[classname]{methodname}{args}
-\newcommand{\methodline}[3][\@undefined]{
- \py@sigline{\bfcode{#2}}{#3}}
-\newenvironment{methoddesc}[3][\@undefined]{
- \begin{fulllineitems}
- \ifx\@undefined#1\relax
- \methodline{#2}{#3}
- \else
- \def\py@thisclass{#1}
- \methodline{#2}{#3}
- \fi
-}{\end{fulllineitems}}
-
-% static method ----------------------------------------------------------
-% \begin{staticmethoddesc}[classname]{methodname}{args}
-\newcommand{\staticmethodline}[3][\@undefined]{
- \py@sigline{static \bfcode{#2}}{#3}}
-\newenvironment{staticmethoddesc}[3][\@undefined]{
- \begin{fulllineitems}
- \ifx\@undefined#1\relax
- \staticmethodline{#2}{#3}
- \else
- \def\py@thisclass{#1}
- \staticmethodline{#2}{#3}
- \fi
-}{\end{fulllineitems}}
-
-% class method ----------------------------------------------------------
-% \begin{classmethoddesc}[classname]{methodname}{args}
-\newcommand{\classmethodline}[3][\@undefined]{
- \py@sigline{class \bfcode{#2}}{#3}}
-\newenvironment{classmethoddesc}[3][\@undefined]{
- \begin{fulllineitems}
- \ifx\@undefined#1\relax
- \classmethodline{#2}{#3}
- \else
- \def\py@thisclass{#1}
- \classmethodline{#2}{#3}
- \fi
-}{\end{fulllineitems}}
-
-% object data attribute --------------------------------------------------
-% \begin{memberdesc}[classname]{membername}
-\newcommand{\memberline}[2][\py@classbadkey]{%
- \ifx\@undefined#1\relax
- \item[\bfcode{#2}]
- \else
- \item[\bfcode{#2}]
- \fi
-}
-\newenvironment{memberdesc}[2][\py@classbadkey]{
- \begin{fulllineitems}
- \ifx\@undefined#1\relax
- \memberline{#2}
- \else
- \def\py@thisclass{#1}
- \memberline{#2}
- \fi
-}{\end{fulllineitems}}
-
-% For exceptions: --------------------------------------------------------
-% \begin{excdesc}{name}
-% -- for constructor information, use excclassdesc instead
-\newenvironment{excdesc}[1]{
- \begin{fulllineitems}
- \item[\strong{exception }\bfcode{#1}]
-}{\end{fulllineitems}}
-
-% Module data or constants: ----------------------------------------------
-% \begin{datadesc}{name}
-\newcommand{\dataline}[1]{%
- \item[\bfcode{#1}]\nopagebreak}
-\newenvironment{datadesc}[1]{
- \begin{fulllineitems}
- \dataline{#1}
-}{\end{fulllineitems}}
-
-% bytecode instruction ---------------------------------------------------
-% \begin{opcodedesc}{name}{var}
-% -- {var} may be {}
-\newenvironment{opcodedesc}[2]{
- \begin{fulllineitems}
- \item[\bfcode{#1}\quad\emph{#2}]
-}{\end{fulllineitems}}
-
-% generic description ----------------------------------------------------
-\newcommand{\descline}[1]{%
- \item[\bfcode{#1}]\nopagebreak%
-}
-\newenvironment{describe}[1]{
- \begin{fulllineitems}
- \descline{#1}
-}{\end{fulllineitems}}
+ \addtolength{\py@argswidth}{\linewidth}%
+ \item[#1\code{(}\py@sigparams{#2}{#3}]}
% This version is being checked in for the historical record; it shows
% how I've managed to get some aspects of this to work. It will not
@@ -533,9 +248,10 @@
% the example completely.
%
\newcommand{\grammartoken}[1]{\texttt{#1}}
-\newenvironment{productionlist}[1][\py@badkey]{
+\newenvironment{productionlist}[1][\@undefined]{
\def\optional##1{{\Large[}##1{\Large]}}
- \def\production##1##2{\code{##1}&::=&\code{##2}\\}
+ \def\production##1##2{\hypertarget{grammar-token-##1}{}%
+ \code{##1}&::=&\code{##2}\\}
\def\productioncont##1{& &\code{##1}\\}
\def\token##1{##1}
\let\grammartoken=\token
@@ -728,8 +444,8 @@
% Include hyperref last.
\RequirePackage[colorlinks,breaklinks,
linkcolor=InnerLinkColor,filecolor=OuterLinkColor,
- menucolor=OuterLinkColor,pagecolor=OuterLinkColor,
- urlcolor=OuterLinkColor,citecolor=InnerLinkColor]{hyperref}
+ menucolor=OuterLinkColor,urlcolor=OuterLinkColor,
+ citecolor=InnerLinkColor]{hyperref}
% From docutils.writers.latex2e
\providecommand{\DUspan}[2]{%
diff --git a/sphinx/texinputs/howto.cls b/sphinx/texinputs/sphinxhowto.cls
index 6844533a7..1ebdd4346 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 2fb77c620..575177980 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 000000000..f1429770b
--- /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>{{ _('Table Of 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 000000000..d2233dfb2
--- /dev/null
+++ b/sphinx/themes/agogo/static/agogo.css_t
@@ -0,0 +1,422 @@
+/*
+ * 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;
+}
+
+dt:target, .highlighted {
+ background-color: #fbe54e;
+}
+
+/* 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: 1.5em;
+ 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;
+}
+
+div.document blockquote {
+ margin: 1em;
+}
+
+div.document ol {
+ margin: 1.5em;
+}
+
+
+/* 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;
+}
+
+/* -- viewcode extension ---------------------------------------------------- */
+
+.viewcode-link {
+ float: right;
+}
+
+.viewcode-back {
+ float: right;
+ font-family:: {{ theme_bodyfont }};
+}
+
+div.viewcode-block:target {
+ margin: -1px -3px;
+ padding: 0 3px;
+ background-color: #f4debf;
+ border-top: 1px solid #ac9;
+ border-bottom: 1px solid #ac9;
+}
diff --git a/sphinx/themes/agogo/static/bgfooter.png b/sphinx/themes/agogo/static/bgfooter.png
new file mode 100644
index 000000000..9ce5bdd90
--- /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 000000000..a0d4709ba
--- /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 000000000..3fc88580f
--- /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 40f4f4c90..f337faece 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/domainindex.html b/sphinx/themes/basic/domainindex.html
new file mode 100644
index 000000000..0aca7e696
--- /dev/null
+++ b/sphinx/themes/basic/domainindex.html
@@ -0,0 +1,57 @@
+{#
+ basic/domainindex.html
+ ~~~~~~~~~~~~~~~~~~~~~~
+
+ Template for domain indices (module index, ...).
+
+ :copyright: Copyright 2007-2010 by the Sphinx team, see AUTHORS.
+ :license: BSD, see LICENSE for details.
+#}
+{% extends "layout.html" %}
+{% set title = indextitle %}
+{% block extrahead %}
+{{ super() }}
+{% if not embedded and collapse_index %}
+ <script type="text/javascript">
+ DOCUMENTATION_OPTIONS.COLLAPSE_INDEX = true;
+ </script>
+{% endif %}
+{% endblock %}
+{% block body %}
+
+ {%- set curr_group = 0 %}
+
+ <h1>{{ indextitle }}</h1>
+
+ <div class="modindex-jumpbox">
+ {%- for (letter, entries) in content %}
+ <a href="#cap-{{ letter }}"><strong>{{ letter }}</strong></a>
+ {%- if not loop.last %} | {% endif %}
+ {%- endfor %}
+ </div>
+
+ <table class="indextable modindextable" cellspacing="0" cellpadding="2">
+ {%- for letter, entries in content %}
+ <tr class="pcap"><td></td><td>&nbsp;</td><td></td></tr>
+ <tr class="cap"><td></td><td><a name="cap-{{ letter }}">
+ <strong>{{ letter }}</strong></a></td><td></td></tr>
+ {%- for (name, grouptype, page, anchor, extra, qualifier, description)
+ in entries %}
+ {%- if grouptype == 1 %}{% set curr_group = curr_group + 1 %}{% endif %}
+ <tr{% if grouptype == 2 %} class="cg-{{ curr_group }}"{% endif %}>
+ <td>{% if grouptype == 1 -%}
+ <img src="{{ pathto('_static/minus.png', 1) }}" id="toggle-{{ curr_group }}"
+ class="toggler" style="display: none" alt="-" />
+ {%- endif %}</td>
+ <td>{% if grouptype == 2 %}&nbsp;&nbsp;&nbsp;{% endif %}
+ {% if page %}<a href="{{ pathto(page) }}#{{ anchor }}">{% endif -%}
+ <tt class="xref">{{ name|e }}</tt>
+ {%- if page %}</a>{% endif %}
+ {%- if extra %} <em>({{ extra|e }})</em>{% endif -%}
+ </td><td>{% if qualifier %}<strong>{{ qualifier|e }}:</strong>{% endif %}
+ <em>{{ description|e }}</em></td></tr>
+ {%- endfor %}
+ {%- endfor %}
+ </table>
+
+{% endblock %}
diff --git a/sphinx/themes/basic/genindex-single.html b/sphinx/themes/basic/genindex-single.html
index 9aaaeb0ca..1e98ba9c9 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 ab099e5bd..d068a96a6 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 a19aa80f4..4d46380f1 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 000000000..7422888c5
--- /dev/null
+++ b/sphinx/themes/basic/globaltoc.html
@@ -0,0 +1,11 @@
+{#
+ 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.
+#}
+<h3><a href="{{ pathto(master_doc) }}">{{ _('Table Of Contents') }}</a></h3>
+{{ toctree() }}
diff --git a/sphinx/themes/basic/layout.html b/sphinx/themes/basic/layout.html
index 3380dbe13..ee51804f7 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 == []) %}
{%- set url_root = pathto('', 1) %}
{%- if url_root == '#' %}{% set url_root = '' %}{% endif %}
@@ -29,7 +40,7 @@
{%- endmacro %}
{%- macro sidebar() %}
- {%- if not embedded %}{% if not theme_nosidebar|tobool %}
+ {%- if render_sidebar %}
<div class="sphinxsidebar">
<div class="sphinxsidebarwrapper">
{%- block sidebarlogo %}
@@ -39,76 +50,57 @@
</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(cssfile, 1) }}" type="text/css" />
+ {%- endfor %}
{%- if not embedded %}
<script type="text/javascript">
var DOCUMENTATION_OPTIONS = {
URL_ROOT: '{{ url_root }}',
VERSION: '{{ release|e }}',
- COLLAPSE_MODINDEX: false,
+ COLLAPSE_INDEX: false,
FILE_SUFFIX: '{{ file_suffix }}',
HAS_SOURCE: {{ has_source|lower }}
};
@@ -156,35 +148,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 000000000..896eda9ce
--- /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
deleted file mode 100644
index 0392edc80..000000000
--- a/sphinx/themes/basic/modindex.html
+++ /dev/null
@@ -1,42 +0,0 @@
-{% extends "layout.html" %}
-{% set title = _('Global Module Index') %}
-{% block extrahead %}
-{{ super() }}
-{% if not embedded and collapse_modindex %}
- <script type="text/javascript">
- DOCUMENTATION_OPTIONS.COLLAPSE_MODINDEX = true;
- </script>
-{% endif %}
-{% endblock %}
-{% block body %}
-
- <h1 id="global-module-index">{{ _('Global Module Index') }}</h1>
-
- {%- for letter in letters %}
- <a href="#cap-{{ letter }}"><strong>{{ letter }}</strong></a> {% if not loop.last %}| {% endif %}
- {%- endfor %}
- <hr/>
-
- <table width="100%" class="indextable" 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>
- <tr class="cap"><td></td><td><a name="cap-{{ fname }}"><strong>{{ fname }}</strong></a></td><td></td></tr>
- {%- else -%}
- <tr{% if indent %} class="cg-{{ cgroup }}"{% endif %}>
- <td>{% if collapse -%}
- <img src="{{ pathto('_static/minus.png', 1) }}" id="toggle-{{ cgroup }}"
- class="toggler" style="display: none" alt="-" />
- {%- endif %}</td>
- <td>{% if indent %}&nbsp;&nbsp;&nbsp;{% endif %}
- {% if fname %}<a href="{{ fname }}">{% endif -%}
- <tt class="xref">{{ stripped|e }}{{ modname|e }}</tt>
- {%- if fname %}</a>{% endif %}
- {%- if pform and pform[0] %} <em>({{ pform|join(', ') }})</em>{% endif -%}
- </td><td>{% if dep %}<strong>{{ _('Deprecated')}}:</strong>{% endif %}
- <em>{{ synops|e }}</em></td></tr>
- {%- endif -%}
- {% endfor %}
- </table>
-
-{% endblock %}
diff --git a/sphinx/themes/basic/page.html b/sphinx/themes/basic/page.html
index 17a930165..c7188fa52 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 000000000..b693daf88
--- /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 96c406527..eac326055 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 000000000..56d6617c9
--- /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 000000000..8fa7563b4
--- /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 a04d6545b..c317cc0a3 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;
@@ -292,7 +316,7 @@ dd {
margin-left: 30px;
}
-dt:target, .highlight {
+dt:target, .highlighted {
background-color: #fbe54e;
}
@@ -344,6 +368,14 @@ dl.glossary dt {
margin-left: 1.5em;
}
+.guilabel, .menuselection {
+ font-family: sans-serif;
+}
+
+.accelerator {
+ text-decoration: underline;
+}
+
/* -- code displays --------------------------------------------------------- */
pre {
@@ -384,6 +416,20 @@ h1 tt, h2 tt, h3 tt, h4 tt, h5 tt, h6 tt {
background-color: transparent;
}
+.viewcode-link {
+ float: right;
+}
+
+.viewcode-back {
+ float: right;
+ font-family: sans-serif;
+}
+
+div.viewcode-block:target {
+ margin: -1px -10px;
+ padding: 0 10px;
+}
+
/* -- math display ---------------------------------------------------------- */
img.math {
diff --git a/sphinx/themes/basic/static/doctools.js b/sphinx/themes/basic/static/doctools.js
index 9447678cd..eeea95ea5 100644
--- a/sphinx/themes/basic/static/doctools.js
+++ b/sphinx/themes/basic/static/doctools.js
@@ -1,16 +1,31 @@
-/// 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
* an installed firebug like debugger
- */
if (!window.console || !console.firebug) {
- var names = ["log", "debug", "info", "warn", "error", "assert", "dir", "dirxml",
- "group", "groupEnd", "time", "timeEnd", "count", "trace", "profile", "profileEnd"];
+ var names = ["log", "debug", "info", "warn", "error", "assert", "dir",
+ "dirxml", "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() {};
}
+ */
/**
* small helper function to urldecode strings
@@ -44,7 +59,7 @@ jQuery.getQueryParameters = function(s) {
result[key] = [value];
}
return result;
-}
+};
/**
* small function to check if an array contains
@@ -56,7 +71,7 @@ jQuery.contains = function(arr, item) {
return true;
}
return false;
-}
+};
/**
* highlight a given string on a jquery object by wrapping it in
@@ -67,7 +82,7 @@ jQuery.fn.highlightText = function(text, className) {
if (node.nodeType == 3) {
var val = node.nodeValue;
var pos = val.toLowerCase().indexOf(text);
- if (pos >= 0 && !jQuery.className.has(node.parentNode, className)) {
+ if (pos >= 0 && !jQuery(node.parentNode).hasClass(className)) {
var span = document.createElement("span");
span.className = className;
span.appendChild(document.createTextNode(val.substr(pos, text.length)));
@@ -79,14 +94,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.
@@ -96,7 +111,7 @@ var Documentation = {
init : function() {
this.fixFirefoxAnchorBug();
this.highlightSearchWords();
- this.initModIndex();
+ this.initIndexTable();
},
/**
@@ -107,7 +122,7 @@ var Documentation = {
LOCALE : 'unknown',
// gettext and ngettext don't access this so that the functions
- // can savely bound to a different name (_ = Documentation.gettext)
+ // can safely bound to a different name (_ = Documentation.gettext)
gettext : function(string) {
var translated = Documentation.TRANSLATIONS[string];
if (typeof translated == 'undefined')
@@ -167,7 +182,7 @@ var Documentation = {
var body = $('div.body');
window.setTimeout(function() {
$.each(terms, function() {
- body.highlightText(this.toLowerCase(), 'highlight');
+ body.highlightText(this.toLowerCase(), 'highlighted');
});
}, 10);
$('<li class="highlight-link"><a href="javascript:Documentation.' +
@@ -177,19 +192,19 @@ var Documentation = {
},
/**
- * init the modindex toggle buttons
+ * init the domain index toggle buttons
*/
- initModIndex : function() {
+ initIndexTable : function() {
var togglers = $('img.toggler').click(function() {
var src = $(this).attr('src');
var idnum = $(this).attr('id').substr(7);
- console.log($('tr.cg-' + idnum).toggle());
+ $('tr.cg-' + idnum).toggle();
if (src.substr(-9) == 'minus.png')
$(this).attr('src', src.substr(0, src.length-9) + 'plus.png');
else
$(this).attr('src', src.substr(0, src.length-8) + 'minus.png');
}).css('display', '');
- if (DOCUMENTATION_OPTIONS.COLLAPSE_MODINDEX) {
+ if (DOCUMENTATION_OPTIONS.COLLAPSE_INDEX) {
togglers.click();
}
},
@@ -199,7 +214,7 @@ var Documentation = {
*/
hideSearchWords : function() {
$('.sidebar .this-page-menu li.highlight-link').fadeOut(300);
- $('span.highlight').removeClass('highlight');
+ $('span.highlighted').removeClass('highlighted');
},
/**
diff --git a/sphinx/themes/basic/static/jquery.js b/sphinx/themes/basic/static/jquery.js
index 82b98e1d7..5c70e4c5f 100644
--- a/sphinx/themes/basic/static/jquery.js
+++ b/sphinx/themes/basic/static/jquery.js
@@ -1,32 +1,151 @@
-/*
- * jQuery 1.2.6 - New Wave Javascript
+/*!
+ * jQuery JavaScript Library v1.4
+ * http://jquery.com/
*
- * Copyright (c) 2008 John Resig (jquery.com)
- * Dual licensed under the MIT (MIT-LICENSE.txt)
- * and GPL (GPL-LICENSE.txt) licenses.
+ * Copyright 2010, John Resig
+ * Dual licensed under the MIT or GPL Version 2 licenses.
+ * http://docs.jquery.com/License
*
- * $Date: 2008-05-24 14:22:17 -0400 (Sat, 24 May 2008) $
- * $Rev: 5685 $
+ * Includes Sizzle.js
+ * http://sizzlejs.com/
+ * Copyright 2010, The Dojo Foundation
+ * Released under the MIT, BSD, and GPL Licenses.
+ *
+ * Date: Wed Jan 13 15:23:05 2010 -0500
*/
-(function(){var _jQuery=window.jQuery,_$=window.$;var jQuery=window.jQuery=window.$=function(selector,context){return new jQuery.fn.init(selector,context);};var quickExpr=/^[^<]*(<(.|\s)+>)[^>]*$|^#(\w+)$/,isSimple=/^.[^:#\[\.]*$/,undefined;jQuery.fn=jQuery.prototype={init:function(selector,context){selector=selector||document;if(selector.nodeType){this[0]=selector;this.length=1;return this;}if(typeof selector=="string"){var match=quickExpr.exec(selector);if(match&&(match[1]||!context)){if(match[1])selector=jQuery.clean([match[1]],context);else{var elem=document.getElementById(match[3]);if(elem){if(elem.id!=match[3])return jQuery().find(selector);return jQuery(elem);}selector=[];}}else
-return jQuery(context).find(selector);}else if(jQuery.isFunction(selector))return jQuery(document)[jQuery.fn.ready?"ready":"load"](selector);return this.setArray(jQuery.makeArray(selector));},jquery:"1.2.6",size:function(){return this.length;},length:0,get:function(num){return num==undefined?jQuery.makeArray(this):this[num];},pushStack:function(elems){var ret=jQuery(elems);ret.prevObject=this;return ret;},setArray:function(elems){this.length=0;Array.prototype.push.apply(this,elems);return this;},each:function(callback,args){return jQuery.each(this,callback,args);},index:function(elem){var ret=-1;return jQuery.inArray(elem&&elem.jquery?elem[0]:elem,this);},attr:function(name,value,type){var options=name;if(name.constructor==String)if(value===undefined)return this[0]&&jQuery[type||"attr"](this[0],name);else{options={};options[name]=value;}return this.each(function(i){for(name in options)jQuery.attr(type?this.style:this,name,jQuery.prop(this,options[name],type,i,name));});},css:function(key,value){if((key=='width'||key=='height')&&parseFloat(value)<0)value=undefined;return this.attr(key,value,"curCSS");},text:function(text){if(typeof text!="object"&&text!=null)return this.empty().append((this[0]&&this[0].ownerDocument||document).createTextNode(text));var ret="";jQuery.each(text||this,function(){jQuery.each(this.childNodes,function(){if(this.nodeType!=8)ret+=this.nodeType!=1?this.nodeValue:jQuery.fn.text([this]);});});return ret;},wrapAll:function(html){if(this[0])jQuery(html,this[0].ownerDocument).clone().insertBefore(this[0]).map(function(){var elem=this;while(elem.firstChild)elem=elem.firstChild;return elem;}).append(this);return this;},wrapInner:function(html){return this.each(function(){jQuery(this).contents().wrapAll(html);});},wrap:function(html){return this.each(function(){jQuery(this).wrapAll(html);});},append:function(){return this.domManip(arguments,true,false,function(elem){if(this.nodeType==1)this.appendChild(elem);});},prepend:function(){return this.domManip(arguments,true,true,function(elem){if(this.nodeType==1)this.insertBefore(elem,this.firstChild);});},before:function(){return this.domManip(arguments,false,false,function(elem){this.parentNode.insertBefore(elem,this);});},after:function(){return this.domManip(arguments,false,true,function(elem){this.parentNode.insertBefore(elem,this.nextSibling);});},end:function(){return this.prevObject||jQuery([]);},find:function(selector){var elems=jQuery.map(this,function(elem){return jQuery.find(selector,elem);});return this.pushStack(/[^+>] [^+>]/.test(selector)||selector.indexOf("..")>-1?jQuery.unique(elems):elems);},clone:function(events){var ret=this.map(function(){if(jQuery.browser.msie&&!jQuery.isXMLDoc(this)){var clone=this.cloneNode(true),container=document.createElement("div");container.appendChild(clone);return jQuery.clean([container.innerHTML])[0];}else
-return this.cloneNode(true);});var clone=ret.find("*").andSelf().each(function(){if(this[expando]!=undefined)this[expando]=null;});if(events===true)this.find("*").andSelf().each(function(i){if(this.nodeType==3)return;var events=jQuery.data(this,"events");for(var type in events)for(var handler in events[type])jQuery.event.add(clone[i],type,events[type][handler],events[type][handler].data);});return ret;},filter:function(selector){return this.pushStack(jQuery.isFunction(selector)&&jQuery.grep(this,function(elem,i){return selector.call(elem,i);})||jQuery.multiFilter(selector,this));},not:function(selector){if(selector.constructor==String)if(isSimple.test(selector))return this.pushStack(jQuery.multiFilter(selector,this,true));else
-selector=jQuery.multiFilter(selector,this);var isArrayLike=selector.length&&selector[selector.length-1]!==undefined&&!selector.nodeType;return this.filter(function(){return isArrayLike?jQuery.inArray(this,selector)<0:this!=selector;});},add:function(selector){return this.pushStack(jQuery.unique(jQuery.merge(this.get(),typeof selector=='string'?jQuery(selector):jQuery.makeArray(selector))));},is:function(selector){return!!selector&&jQuery.multiFilter(selector,this).length>0;},hasClass:function(selector){return this.is("."+selector);},val:function(value){if(value==undefined){if(this.length){var elem=this[0];if(jQuery.nodeName(elem,"select")){var index=elem.selectedIndex,values=[],options=elem.options,one=elem.type=="select-one";if(index<0)return null;for(var i=one?index:0,max=one?index+1:options.length;i<max;i++){var option=options[i];if(option.selected){value=jQuery.browser.msie&&!option.attributes.value.specified?option.text:option.value;if(one)return value;values.push(value);}}return values;}else
-return(this[0].value||"").replace(/\r/g,"");}return undefined;}if(value.constructor==Number)value+='';return this.each(function(){if(this.nodeType!=1)return;if(value.constructor==Array&&/radio|checkbox/.test(this.type))this.checked=(jQuery.inArray(this.value,value)>=0||jQuery.inArray(this.name,value)>=0);else if(jQuery.nodeName(this,"select")){var values=jQuery.makeArray(value);jQuery("option",this).each(function(){this.selected=(jQuery.inArray(this.value,values)>=0||jQuery.inArray(this.text,values)>=0);});if(!values.length)this.selectedIndex=-1;}else
-this.value=value;});},html:function(value){return value==undefined?(this[0]?this[0].innerHTML:null):this.empty().append(value);},replaceWith:function(value){return this.after(value).remove();},eq:function(i){return this.slice(i,i+1);},slice:function(){return this.pushStack(Array.prototype.slice.apply(this,arguments));},map:function(callback){return this.pushStack(jQuery.map(this,function(elem,i){return callback.call(elem,i,elem);}));},andSelf:function(){return this.add(this.prevObject);},data:function(key,value){var parts=key.split(".");parts[1]=parts[1]?"."+parts[1]:"";if(value===undefined){var data=this.triggerHandler("getData"+parts[1]+"!",[parts[0]]);if(data===undefined&&this.length)data=jQuery.data(this[0],key);return data===undefined&&parts[1]?this.data(parts[0]):data;}else
-return this.trigger("setData"+parts[1]+"!",[parts[0],value]).each(function(){jQuery.data(this,key,value);});},removeData:function(key){return this.each(function(){jQuery.removeData(this,key);});},domManip:function(args,table,reverse,callback){var clone=this.length>1,elems;return this.each(function(){if(!elems){elems=jQuery.clean(args,this.ownerDocument);if(reverse)elems.reverse();}var obj=this;if(table&&jQuery.nodeName(this,"table")&&jQuery.nodeName(elems[0],"tr"))obj=this.getElementsByTagName("tbody")[0]||this.appendChild(this.ownerDocument.createElement("tbody"));var scripts=jQuery([]);jQuery.each(elems,function(){var elem=clone?jQuery(this).clone(true)[0]:this;if(jQuery.nodeName(elem,"script"))scripts=scripts.add(elem);else{if(elem.nodeType==1)scripts=scripts.add(jQuery("script",elem).remove());callback.call(obj,elem);}});scripts.each(evalScript);});}};jQuery.fn.init.prototype=jQuery.fn;function evalScript(i,elem){if(elem.src)jQuery.ajax({url:elem.src,async:false,dataType:"script"});else
-jQuery.globalEval(elem.text||elem.textContent||elem.innerHTML||"");if(elem.parentNode)elem.parentNode.removeChild(elem);}function now(){return+new Date;}jQuery.extend=jQuery.fn.extend=function(){var target=arguments[0]||{},i=1,length=arguments.length,deep=false,options;if(target.constructor==Boolean){deep=target;target=arguments[1]||{};i=2;}if(typeof target!="object"&&typeof target!="function")target={};if(length==i){target=this;--i;}for(;i<length;i++)if((options=arguments[i])!=null)for(var name in options){var src=target[name],copy=options[name];if(target===copy)continue;if(deep&&copy&&typeof copy=="object"&&!copy.nodeType)target[name]=jQuery.extend(deep,src||(copy.length!=null?[]:{}),copy);else if(copy!==undefined)target[name]=copy;}return target;};var expando="jQuery"+now(),uuid=0,windowData={},exclude=/z-?index|font-?weight|opacity|zoom|line-?height/i,defaultView=document.defaultView||{};jQuery.extend({noConflict:function(deep){window.$=_$;if(deep)window.jQuery=_jQuery;return jQuery;},isFunction:function(fn){return!!fn&&typeof fn!="string"&&!fn.nodeName&&fn.constructor!=Array&&/^[\s[]?function/.test(fn+"");},isXMLDoc:function(elem){return elem.documentElement&&!elem.body||elem.tagName&&elem.ownerDocument&&!elem.ownerDocument.body;},globalEval:function(data){data=jQuery.trim(data);if(data){var head=document.getElementsByTagName("head")[0]||document.documentElement,script=document.createElement("script");script.type="text/javascript";if(jQuery.browser.msie)script.text=data;else
-script.appendChild(document.createTextNode(data));head.insertBefore(script,head.firstChild);head.removeChild(script);}},nodeName:function(elem,name){return elem.nodeName&&elem.nodeName.toUpperCase()==name.toUpperCase();},cache:{},data:function(elem,name,data){elem=elem==window?windowData:elem;var id=elem[expando];if(!id)id=elem[expando]=++uuid;if(name&&!jQuery.cache[id])jQuery.cache[id]={};if(data!==undefined)jQuery.cache[id][name]=data;return name?jQuery.cache[id][name]:id;},removeData:function(elem,name){elem=elem==window?windowData:elem;var id=elem[expando];if(name){if(jQuery.cache[id]){delete jQuery.cache[id][name];name="";for(name in jQuery.cache[id])break;if(!name)jQuery.removeData(elem);}}else{try{delete elem[expando];}catch(e){if(elem.removeAttribute)elem.removeAttribute(expando);}delete jQuery.cache[id];}},each:function(object,callback,args){var name,i=0,length=object.length;if(args){if(length==undefined){for(name in object)if(callback.apply(object[name],args)===false)break;}else
-for(;i<length;)if(callback.apply(object[i++],args)===false)break;}else{if(length==undefined){for(name in object)if(callback.call(object[name],name,object[name])===false)break;}else
-for(var value=object[0];i<length&&callback.call(value,i,value)!==false;value=object[++i]){}}return object;},prop:function(elem,value,type,i,name){if(jQuery.isFunction(value))value=value.call(elem,i);return value&&value.constructor==Number&&type=="curCSS"&&!exclude.test(name)?value+"px":value;},className:{add:function(elem,classNames){jQuery.each((classNames||"").split(/\s+/),function(i,className){if(elem.nodeType==1&&!jQuery.className.has(elem.className,className))elem.className+=(elem.className?" ":"")+className;});},remove:function(elem,classNames){if(elem.nodeType==1)elem.className=classNames!=undefined?jQuery.grep(elem.className.split(/\s+/),function(className){return!jQuery.className.has(classNames,className);}).join(" "):"";},has:function(elem,className){return jQuery.inArray(className,(elem.className||elem).toString().split(/\s+/))>-1;}},swap:function(elem,options,callback){var old={};for(var name in options){old[name]=elem.style[name];elem.style[name]=options[name];}callback.call(elem);for(var name in options)elem.style[name]=old[name];},css:function(elem,name,force){if(name=="width"||name=="height"){var val,props={position:"absolute",visibility:"hidden",display:"block"},which=name=="width"?["Left","Right"]:["Top","Bottom"];function getWH(){val=name=="width"?elem.offsetWidth:elem.offsetHeight;var padding=0,border=0;jQuery.each(which,function(){padding+=parseFloat(jQuery.curCSS(elem,"padding"+this,true))||0;border+=parseFloat(jQuery.curCSS(elem,"border"+this+"Width",true))||0;});val-=Math.round(padding+border);}if(jQuery(elem).is(":visible"))getWH();else
-jQuery.swap(elem,props,getWH);return Math.max(0,val);}return jQuery.curCSS(elem,name,force);},curCSS:function(elem,name,force){var ret,style=elem.style;function color(elem){if(!jQuery.browser.safari)return false;var ret=defaultView.getComputedStyle(elem,null);return!ret||ret.getPropertyValue("color")=="";}if(name=="opacity"&&jQuery.browser.msie){ret=jQuery.attr(style,"opacity");return ret==""?"1":ret;}if(jQuery.browser.opera&&name=="display"){var save=style.outline;style.outline="0 solid black";style.outline=save;}if(name.match(/float/i))name=styleFloat;if(!force&&style&&style[name])ret=style[name];else if(defaultView.getComputedStyle){if(name.match(/float/i))name="float";name=name.replace(/([A-Z])/g,"-$1").toLowerCase();var computedStyle=defaultView.getComputedStyle(elem,null);if(computedStyle&&!color(elem))ret=computedStyle.getPropertyValue(name);else{var swap=[],stack=[],a=elem,i=0;for(;a&&color(a);a=a.parentNode)stack.unshift(a);for(;i<stack.length;i++)if(color(stack[i])){swap[i]=stack[i].style.display;stack[i].style.display="block";}ret=name=="display"&&swap[stack.length-1]!=null?"none":(computedStyle&&computedStyle.getPropertyValue(name))||"";for(i=0;i<swap.length;i++)if(swap[i]!=null)stack[i].style.display=swap[i];}if(name=="opacity"&&ret=="")ret="1";}else if(elem.currentStyle){var camelCase=name.replace(/\-(\w)/g,function(all,letter){return letter.toUpperCase();});ret=elem.currentStyle[name]||elem.currentStyle[camelCase];if(!/^\d+(px)?$/i.test(ret)&&/^\d/.test(ret)){var left=style.left,rsLeft=elem.runtimeStyle.left;elem.runtimeStyle.left=elem.currentStyle.left;style.left=ret||0;ret=style.pixelLeft+"px";style.left=left;elem.runtimeStyle.left=rsLeft;}}return ret;},clean:function(elems,context){var ret=[];context=context||document;if(typeof context.createElement=='undefined')context=context.ownerDocument||context[0]&&context[0].ownerDocument||document;jQuery.each(elems,function(i,elem){if(!elem)return;if(elem.constructor==Number)elem+='';if(typeof elem=="string"){elem=elem.replace(/(<(\w+)[^>]*?)\/>/g,function(all,front,tag){return tag.match(/^(abbr|br|col|img|input|link|meta|param|hr|area|embed)$/i)?all:front+"></"+tag+">";});var tags=jQuery.trim(elem).toLowerCase(),div=context.createElement("div");var wrap=!tags.indexOf("<opt")&&[1,"<select multiple='multiple'>","</select>"]||!tags.indexOf("<leg")&&[1,"<fieldset>","</fieldset>"]||tags.match(/^<(thead|tbody|tfoot|colg|cap)/)&&[1,"<table>","</table>"]||!tags.indexOf("<tr")&&[2,"<table><tbody>","</tbody></table>"]||(!tags.indexOf("<td")||!tags.indexOf("<th"))&&[3,"<table><tbody><tr>","</tr></tbody></table>"]||!tags.indexOf("<col")&&[2,"<table><tbody></tbody><colgroup>","</colgroup></table>"]||jQuery.browser.msie&&[1,"div<div>","</div>"]||[0,"",""];div.innerHTML=wrap[1]+elem+wrap[2];while(wrap[0]--)div=div.lastChild;if(jQuery.browser.msie){var tbody=!tags.indexOf("<table")&&tags.indexOf("<tbody")<0?div.firstChild&&div.firstChild.childNodes:wrap[1]=="<table>"&&tags.indexOf("<tbody")<0?div.childNodes:[];for(var j=tbody.length-1;j>=0;--j)if(jQuery.nodeName(tbody[j],"tbody")&&!tbody[j].childNodes.length)tbody[j].parentNode.removeChild(tbody[j]);if(/^\s/.test(elem))div.insertBefore(context.createTextNode(elem.match(/^\s*/)[0]),div.firstChild);}elem=jQuery.makeArray(div.childNodes);}if(elem.length===0&&(!jQuery.nodeName(elem,"form")&&!jQuery.nodeName(elem,"select")))return;if(elem[0]==undefined||jQuery.nodeName(elem,"form")||elem.options)ret.push(elem);else
-ret=jQuery.merge(ret,elem);});return ret;},attr:function(elem,name,value){if(!elem||elem.nodeType==3||elem.nodeType==8)return undefined;var notxml=!jQuery.isXMLDoc(elem),set=value!==undefined,msie=jQuery.browser.msie;name=notxml&&jQuery.props[name]||name;if(elem.tagName){var special=/href|src|style/.test(name);if(name=="selected"&&jQuery.browser.safari)elem.parentNode.selectedIndex;if(name in elem&&notxml&&!special){if(set){if(name=="type"&&jQuery.nodeName(elem,"input")&&elem.parentNode)throw"type property can't be changed";elem[name]=value;}if(jQuery.nodeName(elem,"form")&&elem.getAttributeNode(name))return elem.getAttributeNode(name).nodeValue;return elem[name];}if(msie&&notxml&&name=="style")return jQuery.attr(elem.style,"cssText",value);if(set)elem.setAttribute(name,""+value);var attr=msie&&notxml&&special?elem.getAttribute(name,2):elem.getAttribute(name);return attr===null?undefined:attr;}if(msie&&name=="opacity"){if(set){elem.zoom=1;elem.filter=(elem.filter||"").replace(/alpha\([^)]*\)/,"")+(parseInt(value)+''=="NaN"?"":"alpha(opacity="+value*100+")");}return elem.filter&&elem.filter.indexOf("opacity=")>=0?(parseFloat(elem.filter.match(/opacity=([^)]*)/)[1])/100)+'':"";}name=name.replace(/-([a-z])/ig,function(all,letter){return letter.toUpperCase();});if(set)elem[name]=value;return elem[name];},trim:function(text){return(text||"").replace(/^\s+|\s+$/g,"");},makeArray:function(array){var ret=[];if(array!=null){var i=array.length;if(i==null||array.split||array.setInterval||array.call)ret[0]=array;else
-while(i)ret[--i]=array[i];}return ret;},inArray:function(elem,array){for(var i=0,length=array.length;i<length;i++)if(array[i]===elem)return i;return-1;},merge:function(first,second){var i=0,elem,pos=first.length;if(jQuery.browser.msie){while(elem=second[i++])if(elem.nodeType!=8)first[pos++]=elem;}else
-while(elem=second[i++])first[pos++]=elem;return first;},unique:function(array){var ret=[],done={};try{for(var i=0,length=array.length;i<length;i++){var id=jQuery.data(array[i]);if(!done[id]){done[id]=true;ret.push(array[i]);}}}catch(e){ret=array;}return ret;},grep:function(elems,callback,inv){var ret=[];for(var i=0,length=elems.length;i<length;i++)if(!inv!=!callback(elems[i],i))ret.push(elems[i]);return ret;},map:function(elems,callback){var ret=[];for(var i=0,length=elems.length;i<length;i++){var value=callback(elems[i],i);if(value!=null)ret[ret.length]=value;}return ret.concat.apply([],ret);}});var userAgent=navigator.userAgent.toLowerCase();jQuery.browser={version:(userAgent.match(/.+(?:rv|it|ra|ie)[\/: ]([\d.]+)/)||[])[1],safari:/webkit/.test(userAgent),opera:/opera/.test(userAgent),msie:/msie/.test(userAgent)&&!/opera/.test(userAgent),mozilla:/mozilla/.test(userAgent)&&!/(compatible|webkit)/.test(userAgent)};var styleFloat=jQuery.browser.msie?"styleFloat":"cssFloat";jQuery.extend({boxModel:!jQuery.browser.msie||document.compatMode=="CSS1Compat",props:{"for":"htmlFor","class":"className","float":styleFloat,cssFloat:styleFloat,styleFloat:styleFloat,readonly:"readOnly",maxlength:"maxLength",cellspacing:"cellSpacing"}});jQuery.each({parent:function(elem){return elem.parentNode;},parents:function(elem){return jQuery.dir(elem,"parentNode");},next:function(elem){return jQuery.nth(elem,2,"nextSibling");},prev:function(elem){return jQuery.nth(elem,2,"previousSibling");},nextAll:function(elem){return jQuery.dir(elem,"nextSibling");},prevAll:function(elem){return jQuery.dir(elem,"previousSibling");},siblings:function(elem){return jQuery.sibling(elem.parentNode.firstChild,elem);},children:function(elem){return jQuery.sibling(elem.firstChild);},contents:function(elem){return jQuery.nodeName(elem,"iframe")?elem.contentDocument||elem.contentWindow.document:jQuery.makeArray(elem.childNodes);}},function(name,fn){jQuery.fn[name]=function(selector){var ret=jQuery.map(this,fn);if(selector&&typeof selector=="string")ret=jQuery.multiFilter(selector,ret);return this.pushStack(jQuery.unique(ret));};});jQuery.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(name,original){jQuery.fn[name]=function(){var args=arguments;return this.each(function(){for(var i=0,length=args.length;i<length;i++)jQuery(args[i])[original](this);});};});jQuery.each({removeAttr:function(name){jQuery.attr(this,name,"");if(this.nodeType==1)this.removeAttribute(name);},addClass:function(classNames){jQuery.className.add(this,classNames);},removeClass:function(classNames){jQuery.className.remove(this,classNames);},toggleClass:function(classNames){jQuery.className[jQuery.className.has(this,classNames)?"remove":"add"](this,classNames);},remove:function(selector){if(!selector||jQuery.filter(selector,[this]).r.length){jQuery("*",this).add(this).each(function(){jQuery.event.remove(this);jQuery.removeData(this);});if(this.parentNode)this.parentNode.removeChild(this);}},empty:function(){jQuery(">*",this).remove();while(this.firstChild)this.removeChild(this.firstChild);}},function(name,fn){jQuery.fn[name]=function(){return this.each(fn,arguments);};});jQuery.each(["Height","Width"],function(i,name){var type=name.toLowerCase();jQuery.fn[type]=function(size){return this[0]==window?jQuery.browser.opera&&document.body["client"+name]||jQuery.browser.safari&&window["inner"+name]||document.compatMode=="CSS1Compat"&&document.documentElement["client"+name]||document.body["client"+name]:this[0]==document?Math.max(Math.max(document.body["scroll"+name],document.documentElement["scroll"+name]),Math.max(document.body["offset"+name],document.documentElement["offset"+name])):size==undefined?(this.length?jQuery.css(this[0],type):null):this.css(type,size.constructor==String?size:size+"px");};});function num(elem,prop){return elem[0]&&parseInt(jQuery.curCSS(elem[0],prop,true),10)||0;}var chars=jQuery.browser.safari&&parseInt(jQuery.browser.version)<417?"(?:[\\w*_-]|\\\\.)":"(?:[\\w\u0128-\uFFFF*_-]|\\\\.)",quickChild=new RegExp("^>\\s*("+chars+"+)"),quickID=new RegExp("^("+chars+"+)(#)("+chars+"+)"),quickClass=new RegExp("^([#.]?)("+chars+"*)");jQuery.extend({expr:{"":function(a,i,m){return m[2]=="*"||jQuery.nodeName(a,m[2]);},"#":function(a,i,m){return a.getAttribute("id")==m[2];},":":{lt:function(a,i,m){return i<m[3]-0;},gt:function(a,i,m){return i>m[3]-0;},nth:function(a,i,m){return m[3]-0==i;},eq:function(a,i,m){return m[3]-0==i;},first:function(a,i){return i==0;},last:function(a,i,m,r){return i==r.length-1;},even:function(a,i){return i%2==0;},odd:function(a,i){return i%2;},"first-child":function(a){return a.parentNode.getElementsByTagName("*")[0]==a;},"last-child":function(a){return jQuery.nth(a.parentNode.lastChild,1,"previousSibling")==a;},"only-child":function(a){return!jQuery.nth(a.parentNode.lastChild,2,"previousSibling");},parent:function(a){return a.firstChild;},empty:function(a){return!a.firstChild;},contains:function(a,i,m){return(a.textContent||a.innerText||jQuery(a).text()||"").indexOf(m[3])>=0;},visible:function(a){return"hidden"!=a.type&&jQuery.css(a,"display")!="none"&&jQuery.css(a,"visibility")!="hidden";},hidden:function(a){return"hidden"==a.type||jQuery.css(a,"display")=="none"||jQuery.css(a,"visibility")=="hidden";},enabled:function(a){return!a.disabled;},disabled:function(a){return a.disabled;},checked:function(a){return a.checked;},selected:function(a){return a.selected||jQuery.attr(a,"selected");},text:function(a){return"text"==a.type;},radio:function(a){return"radio"==a.type;},checkbox:function(a){return"checkbox"==a.type;},file:function(a){return"file"==a.type;},password:function(a){return"password"==a.type;},submit:function(a){return"submit"==a.type;},image:function(a){return"image"==a.type;},reset:function(a){return"reset"==a.type;},button:function(a){return"button"==a.type||jQuery.nodeName(a,"button");},input:function(a){return/input|select|textarea|button/i.test(a.nodeName);},has:function(a,i,m){return jQuery.find(m[3],a).length;},header:function(a){return/h\d/i.test(a.nodeName);},animated:function(a){return jQuery.grep(jQuery.timers,function(fn){return a==fn.elem;}).length;}}},parse:[/^(\[) *@?([\w-]+) *([!*$^~=]*) *('?"?)(.*?)\4 *\]/,/^(:)([\w-]+)\("?'?(.*?(\(.*?\))?[^(]*?)"?'?\)/,new RegExp("^([:.#]*)("+chars+"+)")],multiFilter:function(expr,elems,not){var old,cur=[];while(expr&&expr!=old){old=expr;var f=jQuery.filter(expr,elems,not);expr=f.t.replace(/^\s*,\s*/,"");cur=not?elems=f.r:jQuery.merge(cur,f.r);}return cur;},find:function(t,context){if(typeof t!="string")return[t];if(context&&context.nodeType!=1&&context.nodeType!=9)return[];context=context||document;var ret=[context],done=[],last,nodeName;while(t&&last!=t){var r=[];last=t;t=jQuery.trim(t);var foundToken=false,re=quickChild,m=re.exec(t);if(m){nodeName=m[1].toUpperCase();for(var i=0;ret[i];i++)for(var c=ret[i].firstChild;c;c=c.nextSibling)if(c.nodeType==1&&(nodeName=="*"||c.nodeName.toUpperCase()==nodeName))r.push(c);ret=r;t=t.replace(re,"");if(t.indexOf(" ")==0)continue;foundToken=true;}else{re=/^([>+~])\s*(\w*)/i;if((m=re.exec(t))!=null){r=[];var merge={};nodeName=m[2].toUpperCase();m=m[1];for(var j=0,rl=ret.length;j<rl;j++){var n=m=="~"||m=="+"?ret[j].nextSibling:ret[j].firstChild;for(;n;n=n.nextSibling)if(n.nodeType==1){var id=jQuery.data(n);if(m=="~"&&merge[id])break;if(!nodeName||n.nodeName.toUpperCase()==nodeName){if(m=="~")merge[id]=true;r.push(n);}if(m=="+")break;}}ret=r;t=jQuery.trim(t.replace(re,""));foundToken=true;}}if(t&&!foundToken){if(!t.indexOf(",")){if(context==ret[0])ret.shift();done=jQuery.merge(done,ret);r=ret=[context];t=" "+t.substr(1,t.length);}else{var re2=quickID;var m=re2.exec(t);if(m){m=[0,m[2],m[3],m[1]];}else{re2=quickClass;m=re2.exec(t);}m[2]=m[2].replace(/\\/g,"");var elem=ret[ret.length-1];if(m[1]=="#"&&elem&&elem.getElementById&&!jQuery.isXMLDoc(elem)){var oid=elem.getElementById(m[2]);if((jQuery.browser.msie||jQuery.browser.opera)&&oid&&typeof oid.id=="string"&&oid.id!=m[2])oid=jQuery('[@id="'+m[2]+'"]',elem)[0];ret=r=oid&&(!m[3]||jQuery.nodeName(oid,m[3]))?[oid]:[];}else{for(var i=0;ret[i];i++){var tag=m[1]=="#"&&m[3]?m[3]:m[1]!=""||m[0]==""?"*":m[2];if(tag=="*"&&ret[i].nodeName.toLowerCase()=="object")tag="param";r=jQuery.merge(r,ret[i].getElementsByTagName(tag));}if(m[1]==".")r=jQuery.classFilter(r,m[2]);if(m[1]=="#"){var tmp=[];for(var i=0;r[i];i++)if(r[i].getAttribute("id")==m[2]){tmp=[r[i]];break;}r=tmp;}ret=r;}t=t.replace(re2,"");}}if(t){var val=jQuery.filter(t,r);ret=r=val.r;t=jQuery.trim(val.t);}}if(t)ret=[];if(ret&&context==ret[0])ret.shift();done=jQuery.merge(done,ret);return done;},classFilter:function(r,m,not){m=" "+m+" ";var tmp=[];for(var i=0;r[i];i++){var pass=(" "+r[i].className+" ").indexOf(m)>=0;if(!not&&pass||not&&!pass)tmp.push(r[i]);}return tmp;},filter:function(t,r,not){var last;while(t&&t!=last){last=t;var p=jQuery.parse,m;for(var i=0;p[i];i++){m=p[i].exec(t);if(m){t=t.substring(m[0].length);m[2]=m[2].replace(/\\/g,"");break;}}if(!m)break;if(m[1]==":"&&m[2]=="not")r=isSimple.test(m[3])?jQuery.filter(m[3],r,true).r:jQuery(r).not(m[3]);else if(m[1]==".")r=jQuery.classFilter(r,m[2],not);else if(m[1]=="["){var tmp=[],type=m[3];for(var i=0,rl=r.length;i<rl;i++){var a=r[i],z=a[jQuery.props[m[2]]||m[2]];if(z==null||/href|src|selected/.test(m[2]))z=jQuery.attr(a,m[2])||'';if((type==""&&!!z||type=="="&&z==m[5]||type=="!="&&z!=m[5]||type=="^="&&z&&!z.indexOf(m[5])||type=="$="&&z.substr(z.length-m[5].length)==m[5]||(type=="*="||type=="~=")&&z.indexOf(m[5])>=0)^not)tmp.push(a);}r=tmp;}else if(m[1]==":"&&m[2]=="nth-child"){var merge={},tmp=[],test=/(-?)(\d*)n((?:\+|-)?\d*)/.exec(m[3]=="even"&&"2n"||m[3]=="odd"&&"2n+1"||!/\D/.test(m[3])&&"0n+"+m[3]||m[3]),first=(test[1]+(test[2]||1))-0,last=test[3]-0;for(var i=0,rl=r.length;i<rl;i++){var node=r[i],parentNode=node.parentNode,id=jQuery.data(parentNode);if(!merge[id]){var c=1;for(var n=parentNode.firstChild;n;n=n.nextSibling)if(n.nodeType==1)n.nodeIndex=c++;merge[id]=true;}var add=false;if(first==0){if(node.nodeIndex==last)add=true;}else if((node.nodeIndex-last)%first==0&&(node.nodeIndex-last)/first>=0)add=true;if(add^not)tmp.push(node);}r=tmp;}else{var fn=jQuery.expr[m[1]];if(typeof fn=="object")fn=fn[m[2]];if(typeof fn=="string")fn=eval("false||function(a,i){return "+fn+";}");r=jQuery.grep(r,function(elem,i){return fn(elem,i,m,r);},not);}}return{r:r,t:t};},dir:function(elem,dir){var matched=[],cur=elem[dir];while(cur&&cur!=document){if(cur.nodeType==1)matched.push(cur);cur=cur[dir];}return matched;},nth:function(cur,result,dir,elem){result=result||1;var num=0;for(;cur;cur=cur[dir])if(cur.nodeType==1&&++num==result)break;return cur;},sibling:function(n,elem){var r=[];for(;n;n=n.nextSibling){if(n.nodeType==1&&n!=elem)r.push(n);}return r;}});jQuery.event={add:function(elem,types,handler,data){if(elem.nodeType==3||elem.nodeType==8)return;if(jQuery.browser.msie&&elem.setInterval)elem=window;if(!handler.guid)handler.guid=this.guid++;if(data!=undefined){var fn=handler;handler=this.proxy(fn,function(){return fn.apply(this,arguments);});handler.data=data;}var events=jQuery.data(elem,"events")||jQuery.data(elem,"events",{}),handle=jQuery.data(elem,"handle")||jQuery.data(elem,"handle",function(){if(typeof jQuery!="undefined"&&!jQuery.event.triggered)return jQuery.event.handle.apply(arguments.callee.elem,arguments);});handle.elem=elem;jQuery.each(types.split(/\s+/),function(index,type){var parts=type.split(".");type=parts[0];handler.type=parts[1];var handlers=events[type];if(!handlers){handlers=events[type]={};if(!jQuery.event.special[type]||jQuery.event.special[type].setup.call(elem)===false){if(elem.addEventListener)elem.addEventListener(type,handle,false);else if(elem.attachEvent)elem.attachEvent("on"+type,handle);}}handlers[handler.guid]=handler;jQuery.event.global[type]=true;});elem=null;},guid:1,global:{},remove:function(elem,types,handler){if(elem.nodeType==3||elem.nodeType==8)return;var events=jQuery.data(elem,"events"),ret,index;if(events){if(types==undefined||(typeof types=="string"&&types.charAt(0)=="."))for(var type in events)this.remove(elem,type+(types||""));else{if(types.type){handler=types.handler;types=types.type;}jQuery.each(types.split(/\s+/),function(index,type){var parts=type.split(".");type=parts[0];if(events[type]){if(handler)delete events[type][handler.guid];else
-for(handler in events[type])if(!parts[1]||events[type][handler].type==parts[1])delete events[type][handler];for(ret in events[type])break;if(!ret){if(!jQuery.event.special[type]||jQuery.event.special[type].teardown.call(elem)===false){if(elem.removeEventListener)elem.removeEventListener(type,jQuery.data(elem,"handle"),false);else if(elem.detachEvent)elem.detachEvent("on"+type,jQuery.data(elem,"handle"));}ret=null;delete events[type];}}});}for(ret in events)break;if(!ret){var handle=jQuery.data(elem,"handle");if(handle)handle.elem=null;jQuery.removeData(elem,"events");jQuery.removeData(elem,"handle");}}},trigger:function(type,data,elem,donative,extra){data=jQuery.makeArray(data);if(type.indexOf("!")>=0){type=type.slice(0,-1);var exclusive=true;}if(!elem){if(this.global[type])jQuery("*").add([window,document]).trigger(type,data);}else{if(elem.nodeType==3||elem.nodeType==8)return undefined;var val,ret,fn=jQuery.isFunction(elem[type]||null),event=!data[0]||!data[0].preventDefault;if(event){data.unshift({type:type,target:elem,preventDefault:function(){},stopPropagation:function(){},timeStamp:now()});data[0][expando]=true;}data[0].type=type;if(exclusive)data[0].exclusive=true;var handle=jQuery.data(elem,"handle");if(handle)val=handle.apply(elem,data);if((!fn||(jQuery.nodeName(elem,'a')&&type=="click"))&&elem["on"+type]&&elem["on"+type].apply(elem,data)===false)val=false;if(event)data.shift();if(extra&&jQuery.isFunction(extra)){ret=extra.apply(elem,val==null?data:data.concat(val));if(ret!==undefined)val=ret;}if(fn&&donative!==false&&val!==false&&!(jQuery.nodeName(elem,'a')&&type=="click")){this.triggered=true;try{elem[type]();}catch(e){}}this.triggered=false;}return val;},handle:function(event){var val,ret,namespace,all,handlers;event=arguments[0]=jQuery.event.fix(event||window.event);namespace=event.type.split(".");event.type=namespace[0];namespace=namespace[1];all=!namespace&&!event.exclusive;handlers=(jQuery.data(this,"events")||{})[event.type];for(var j in handlers){var handler=handlers[j];if(all||handler.type==namespace){event.handler=handler;event.data=handler.data;ret=handler.apply(this,arguments);if(val!==false)val=ret;if(ret===false){event.preventDefault();event.stopPropagation();}}}return val;},fix:function(event){if(event[expando]==true)return event;var originalEvent=event;event={originalEvent:originalEvent};var props="altKey attrChange attrName bubbles button cancelable charCode clientX clientY ctrlKey currentTarget data detail eventPhase fromElement handler keyCode metaKey newValue originalTarget pageX pageY prevValue relatedNode relatedTarget screenX screenY shiftKey srcElement target timeStamp toElement type view wheelDelta which".split(" ");for(var i=props.length;i;i--)event[props[i]]=originalEvent[props[i]];event[expando]=true;event.preventDefault=function(){if(originalEvent.preventDefault)originalEvent.preventDefault();originalEvent.returnValue=false;};event.stopPropagation=function(){if(originalEvent.stopPropagation)originalEvent.stopPropagation();originalEvent.cancelBubble=true;};event.timeStamp=event.timeStamp||now();if(!event.target)event.target=event.srcElement||document;if(event.target.nodeType==3)event.target=event.target.parentNode;if(!event.relatedTarget&&event.fromElement)event.relatedTarget=event.fromElement==event.target?event.toElement:event.fromElement;if(event.pageX==null&&event.clientX!=null){var doc=document.documentElement,body=document.body;event.pageX=event.clientX+(doc&&doc.scrollLeft||body&&body.scrollLeft||0)-(doc.clientLeft||0);event.pageY=event.clientY+(doc&&doc.scrollTop||body&&body.scrollTop||0)-(doc.clientTop||0);}if(!event.which&&((event.charCode||event.charCode===0)?event.charCode:event.keyCode))event.which=event.charCode||event.keyCode;if(!event.metaKey&&event.ctrlKey)event.metaKey=event.ctrlKey;if(!event.which&&event.button)event.which=(event.button&1?1:(event.button&2?3:(event.button&4?2:0)));return event;},proxy:function(fn,proxy){proxy.guid=fn.guid=fn.guid||proxy.guid||this.guid++;return proxy;},special:{ready:{setup:function(){bindReady();return;},teardown:function(){return;}},mouseenter:{setup:function(){if(jQuery.browser.msie)return false;jQuery(this).bind("mouseover",jQuery.event.special.mouseenter.handler);return true;},teardown:function(){if(jQuery.browser.msie)return false;jQuery(this).unbind("mouseover",jQuery.event.special.mouseenter.handler);return true;},handler:function(event){if(withinElement(event,this))return true;event.type="mouseenter";return jQuery.event.handle.apply(this,arguments);}},mouseleave:{setup:function(){if(jQuery.browser.msie)return false;jQuery(this).bind("mouseout",jQuery.event.special.mouseleave.handler);return true;},teardown:function(){if(jQuery.browser.msie)return false;jQuery(this).unbind("mouseout",jQuery.event.special.mouseleave.handler);return true;},handler:function(event){if(withinElement(event,this))return true;event.type="mouseleave";return jQuery.event.handle.apply(this,arguments);}}}};jQuery.fn.extend({bind:function(type,data,fn){return type=="unload"?this.one(type,data,fn):this.each(function(){jQuery.event.add(this,type,fn||data,fn&&data);});},one:function(type,data,fn){var one=jQuery.event.proxy(fn||data,function(event){jQuery(this).unbind(event,one);return(fn||data).apply(this,arguments);});return this.each(function(){jQuery.event.add(this,type,one,fn&&data);});},unbind:function(type,fn){return this.each(function(){jQuery.event.remove(this,type,fn);});},trigger:function(type,data,fn){return this.each(function(){jQuery.event.trigger(type,data,this,true,fn);});},triggerHandler:function(type,data,fn){return this[0]&&jQuery.event.trigger(type,data,this[0],false,fn);},toggle:function(fn){var args=arguments,i=1;while(i<args.length)jQuery.event.proxy(fn,args[i++]);return this.click(jQuery.event.proxy(fn,function(event){this.lastToggle=(this.lastToggle||0)%i;event.preventDefault();return args[this.lastToggle++].apply(this,arguments)||false;}));},hover:function(fnOver,fnOut){return this.bind('mouseenter',fnOver).bind('mouseleave',fnOut);},ready:function(fn){bindReady();if(jQuery.isReady)fn.call(document,jQuery);else
-jQuery.readyList.push(function(){return fn.call(this,jQuery);});return this;}});jQuery.extend({isReady:false,readyList:[],ready:function(){if(!jQuery.isReady){jQuery.isReady=true;if(jQuery.readyList){jQuery.each(jQuery.readyList,function(){this.call(document);});jQuery.readyList=null;}jQuery(document).triggerHandler("ready");}}});var readyBound=false;function bindReady(){if(readyBound)return;readyBound=true;if(document.addEventListener&&!jQuery.browser.opera)document.addEventListener("DOMContentLoaded",jQuery.ready,false);if(jQuery.browser.msie&&window==top)(function(){if(jQuery.isReady)return;try{document.documentElement.doScroll("left");}catch(error){setTimeout(arguments.callee,0);return;}jQuery.ready();})();if(jQuery.browser.opera)document.addEventListener("DOMContentLoaded",function(){if(jQuery.isReady)return;for(var i=0;i<document.styleSheets.length;i++)if(document.styleSheets[i].disabled){setTimeout(arguments.callee,0);return;}jQuery.ready();},false);if(jQuery.browser.safari){var numStyles;(function(){if(jQuery.isReady)return;if(document.readyState!="loaded"&&document.readyState!="complete"){setTimeout(arguments.callee,0);return;}if(numStyles===undefined)numStyles=jQuery("style, link[rel=stylesheet]").length;if(document.styleSheets.length!=numStyles){setTimeout(arguments.callee,0);return;}jQuery.ready();})();}jQuery.event.add(window,"load",jQuery.ready);}jQuery.each(("blur,focus,load,resize,scroll,unload,click,dblclick,"+"mousedown,mouseup,mousemove,mouseover,mouseout,change,select,"+"submit,keydown,keypress,keyup,error").split(","),function(i,name){jQuery.fn[name]=function(fn){return fn?this.bind(name,fn):this.trigger(name);};});var withinElement=function(event,elem){var parent=event.relatedTarget;while(parent&&parent!=elem)try{parent=parent.parentNode;}catch(error){parent=elem;}return parent==elem;};jQuery(window).bind("unload",function(){jQuery("*").add(document).unbind();});jQuery.fn.extend({_load:jQuery.fn.load,load:function(url,params,callback){if(typeof url!='string')return this._load(url);var off=url.indexOf(" ");if(off>=0){var selector=url.slice(off,url.length);url=url.slice(0,off);}callback=callback||function(){};var type="GET";if(params)if(jQuery.isFunction(params)){callback=params;params=null;}else{params=jQuery.param(params);type="POST";}var self=this;jQuery.ajax({url:url,type:type,dataType:"html",data:params,complete:function(res,status){if(status=="success"||status=="notmodified")self.html(selector?jQuery("<div/>").append(res.responseText.replace(/<script(.|\s)*?\/script>/g,"")).find(selector):res.responseText);self.each(callback,[res.responseText,status,res]);}});return this;},serialize:function(){return jQuery.param(this.serializeArray());},serializeArray:function(){return this.map(function(){return jQuery.nodeName(this,"form")?jQuery.makeArray(this.elements):this;}).filter(function(){return this.name&&!this.disabled&&(this.checked||/select|textarea/i.test(this.nodeName)||/text|hidden|password/i.test(this.type));}).map(function(i,elem){var val=jQuery(this).val();return val==null?null:val.constructor==Array?jQuery.map(val,function(val,i){return{name:elem.name,value:val};}):{name:elem.name,value:val};}).get();}});jQuery.each("ajaxStart,ajaxStop,ajaxComplete,ajaxError,ajaxSuccess,ajaxSend".split(","),function(i,o){jQuery.fn[o]=function(f){return this.bind(o,f);};});var jsc=now();jQuery.extend({get:function(url,data,callback,type){if(jQuery.isFunction(data)){callback=data;data=null;}return jQuery.ajax({type:"GET",url:url,data:data,success:callback,dataType:type});},getScript:function(url,callback){return jQuery.get(url,null,callback,"script");},getJSON:function(url,data,callback){return jQuery.get(url,data,callback,"json");},post:function(url,data,callback,type){if(jQuery.isFunction(data)){callback=data;data={};}return jQuery.ajax({type:"POST",url:url,data:data,success:callback,dataType:type});},ajaxSetup:function(settings){jQuery.extend(jQuery.ajaxSettings,settings);},ajaxSettings:{url:location.href,global:true,type:"GET",timeout:0,contentType:"application/x-www-form-urlencoded",processData:true,async:true,data:null,username:null,password:null,accepts:{xml:"application/xml, text/xml",html:"text/html",script:"text/javascript, application/javascript",json:"application/json, text/javascript",text:"text/plain",_default:"*/*"}},lastModified:{},ajax:function(s){s=jQuery.extend(true,s,jQuery.extend(true,{},jQuery.ajaxSettings,s));var jsonp,jsre=/=\?(&|$)/g,status,data,type=s.type.toUpperCase();if(s.data&&s.processData&&typeof s.data!="string")s.data=jQuery.param(s.data);if(s.dataType=="jsonp"){if(type=="GET"){if(!s.url.match(jsre))s.url+=(s.url.match(/\?/)?"&":"?")+(s.jsonp||"callback")+"=?";}else if(!s.data||!s.data.match(jsre))s.data=(s.data?s.data+"&":"")+(s.jsonp||"callback")+"=?";s.dataType="json";}if(s.dataType=="json"&&(s.data&&s.data.match(jsre)||s.url.match(jsre))){jsonp="jsonp"+jsc++;if(s.data)s.data=(s.data+"").replace(jsre,"="+jsonp+"$1");s.url=s.url.replace(jsre,"="+jsonp+"$1");s.dataType="script";window[jsonp]=function(tmp){data=tmp;success();complete();window[jsonp]=undefined;try{delete window[jsonp];}catch(e){}if(head)head.removeChild(script);};}if(s.dataType=="script"&&s.cache==null)s.cache=false;if(s.cache===false&&type=="GET"){var ts=now();var ret=s.url.replace(/(\?|&)_=.*?(&|$)/,"$1_="+ts+"$2");s.url=ret+((ret==s.url)?(s.url.match(/\?/)?"&":"?")+"_="+ts:"");}if(s.data&&type=="GET"){s.url+=(s.url.match(/\?/)?"&":"?")+s.data;s.data=null;}if(s.global&&!jQuery.active++)jQuery.event.trigger("ajaxStart");var remote=/^(?:\w+:)?\/\/([^\/?#]+)/;if(s.dataType=="script"&&type=="GET"&&remote.test(s.url)&&remote.exec(s.url)[1]!=location.host){var head=document.getElementsByTagName("head")[0];var script=document.createElement("script");script.src=s.url;if(s.scriptCharset)script.charset=s.scriptCharset;if(!jsonp){var done=false;script.onload=script.onreadystatechange=function(){if(!done&&(!this.readyState||this.readyState=="loaded"||this.readyState=="complete")){done=true;success();complete();head.removeChild(script);}};}head.appendChild(script);return undefined;}var requestDone=false;var xhr=window.ActiveXObject?new ActiveXObject("Microsoft.XMLHTTP"):new XMLHttpRequest();if(s.username)xhr.open(type,s.url,s.async,s.username,s.password);else
-xhr.open(type,s.url,s.async);try{if(s.data)xhr.setRequestHeader("Content-Type",s.contentType);if(s.ifModified)xhr.setRequestHeader("If-Modified-Since",jQuery.lastModified[s.url]||"Thu, 01 Jan 1970 00:00:00 GMT");xhr.setRequestHeader("X-Requested-With","XMLHttpRequest");xhr.setRequestHeader("Accept",s.dataType&&s.accepts[s.dataType]?s.accepts[s.dataType]+", */*":s.accepts._default);}catch(e){}if(s.beforeSend&&s.beforeSend(xhr,s)===false){s.global&&jQuery.active--;xhr.abort();return false;}if(s.global)jQuery.event.trigger("ajaxSend",[xhr,s]);var onreadystatechange=function(isTimeout){if(!requestDone&&xhr&&(xhr.readyState==4||isTimeout=="timeout")){requestDone=true;if(ival){clearInterval(ival);ival=null;}status=isTimeout=="timeout"&&"timeout"||!jQuery.httpSuccess(xhr)&&"error"||s.ifModified&&jQuery.httpNotModified(xhr,s.url)&&"notmodified"||"success";if(status=="success"){try{data=jQuery.httpData(xhr,s.dataType,s.dataFilter);}catch(e){status="parsererror";}}if(status=="success"){var modRes;try{modRes=xhr.getResponseHeader("Last-Modified");}catch(e){}if(s.ifModified&&modRes)jQuery.lastModified[s.url]=modRes;if(!jsonp)success();}else
-jQuery.handleError(s,xhr,status);complete();if(s.async)xhr=null;}};if(s.async){var ival=setInterval(onreadystatechange,13);if(s.timeout>0)setTimeout(function(){if(xhr){xhr.abort();if(!requestDone)onreadystatechange("timeout");}},s.timeout);}try{xhr.send(s.data);}catch(e){jQuery.handleError(s,xhr,null,e);}if(!s.async)onreadystatechange();function success(){if(s.success)s.success(data,status);if(s.global)jQuery.event.trigger("ajaxSuccess",[xhr,s]);}function complete(){if(s.complete)s.complete(xhr,status);if(s.global)jQuery.event.trigger("ajaxComplete",[xhr,s]);if(s.global&&!--jQuery.active)jQuery.event.trigger("ajaxStop");}return xhr;},handleError:function(s,xhr,status,e){if(s.error)s.error(xhr,status,e);if(s.global)jQuery.event.trigger("ajaxError",[xhr,s,e]);},active:0,httpSuccess:function(xhr){try{return!xhr.status&&location.protocol=="file:"||(xhr.status>=200&&xhr.status<300)||xhr.status==304||xhr.status==1223||jQuery.browser.safari&&xhr.status==undefined;}catch(e){}return false;},httpNotModified:function(xhr,url){try{var xhrRes=xhr.getResponseHeader("Last-Modified");return xhr.status==304||xhrRes==jQuery.lastModified[url]||jQuery.browser.safari&&xhr.status==undefined;}catch(e){}return false;},httpData:function(xhr,type,filter){var ct=xhr.getResponseHeader("content-type"),xml=type=="xml"||!type&&ct&&ct.indexOf("xml")>=0,data=xml?xhr.responseXML:xhr.responseText;if(xml&&data.documentElement.tagName=="parsererror")throw"parsererror";if(filter)data=filter(data,type);if(type=="script")jQuery.globalEval(data);if(type=="json")data=eval("("+data+")");return data;},param:function(a){var s=[];if(a.constructor==Array||a.jquery)jQuery.each(a,function(){s.push(encodeURIComponent(this.name)+"="+encodeURIComponent(this.value));});else
-for(var j in a)if(a[j]&&a[j].constructor==Array)jQuery.each(a[j],function(){s.push(encodeURIComponent(j)+"="+encodeURIComponent(this));});else
-s.push(encodeURIComponent(j)+"="+encodeURIComponent(jQuery.isFunction(a[j])?a[j]():a[j]));return s.join("&").replace(/%20/g,"+");}});jQuery.fn.extend({show:function(speed,callback){return speed?this.animate({height:"show",width:"show",opacity:"show"},speed,callback):this.filter(":hidden").each(function(){this.style.display=this.oldblock||"";if(jQuery.css(this,"display")=="none"){var elem=jQuery("<"+this.tagName+" />").appendTo("body");this.style.display=elem.css("display");if(this.style.display=="none")this.style.display="block";elem.remove();}}).end();},hide:function(speed,callback){return speed?this.animate({height:"hide",width:"hide",opacity:"hide"},speed,callback):this.filter(":visible").each(function(){this.oldblock=this.oldblock||jQuery.css(this,"display");this.style.display="none";}).end();},_toggle:jQuery.fn.toggle,toggle:function(fn,fn2){return jQuery.isFunction(fn)&&jQuery.isFunction(fn2)?this._toggle.apply(this,arguments):fn?this.animate({height:"toggle",width:"toggle",opacity:"toggle"},fn,fn2):this.each(function(){jQuery(this)[jQuery(this).is(":hidden")?"show":"hide"]();});},slideDown:function(speed,callback){return this.animate({height:"show"},speed,callback);},slideUp:function(speed,callback){return this.animate({height:"hide"},speed,callback);},slideToggle:function(speed,callback){return this.animate({height:"toggle"},speed,callback);},fadeIn:function(speed,callback){return this.animate({opacity:"show"},speed,callback);},fadeOut:function(speed,callback){return this.animate({opacity:"hide"},speed,callback);},fadeTo:function(speed,to,callback){return this.animate({opacity:to},speed,callback);},animate:function(prop,speed,easing,callback){var optall=jQuery.speed(speed,easing,callback);return this[optall.queue===false?"each":"queue"](function(){if(this.nodeType!=1)return false;var opt=jQuery.extend({},optall),p,hidden=jQuery(this).is(":hidden"),self=this;for(p in prop){if(prop[p]=="hide"&&hidden||prop[p]=="show"&&!hidden)return opt.complete.call(this);if(p=="height"||p=="width"){opt.display=jQuery.css(this,"display");opt.overflow=this.style.overflow;}}if(opt.overflow!=null)this.style.overflow="hidden";opt.curAnim=jQuery.extend({},prop);jQuery.each(prop,function(name,val){var e=new jQuery.fx(self,opt,name);if(/toggle|show|hide/.test(val))e[val=="toggle"?hidden?"show":"hide":val](prop);else{var parts=val.toString().match(/^([+-]=)?([\d+-.]+)(.*)$/),start=e.cur(true)||0;if(parts){var end=parseFloat(parts[2]),unit=parts[3]||"px";if(unit!="px"){self.style[name]=(end||1)+unit;start=((end||1)/e.cur(true))*start;self.style[name]=start+unit;}if(parts[1])end=((parts[1]=="-="?-1:1)*end)+start;e.custom(start,end,unit);}else
-e.custom(start,val,"");}});return true;});},queue:function(type,fn){if(jQuery.isFunction(type)||(type&&type.constructor==Array)){fn=type;type="fx";}if(!type||(typeof type=="string"&&!fn))return queue(this[0],type);return this.each(function(){if(fn.constructor==Array)queue(this,type,fn);else{queue(this,type).push(fn);if(queue(this,type).length==1)fn.call(this);}});},stop:function(clearQueue,gotoEnd){var timers=jQuery.timers;if(clearQueue)this.queue([]);this.each(function(){for(var i=timers.length-1;i>=0;i--)if(timers[i].elem==this){if(gotoEnd)timers[i](true);timers.splice(i,1);}});if(!gotoEnd)this.dequeue();return this;}});var queue=function(elem,type,array){if(elem){type=type||"fx";var q=jQuery.data(elem,type+"queue");if(!q||array)q=jQuery.data(elem,type+"queue",jQuery.makeArray(array));}return q;};jQuery.fn.dequeue=function(type){type=type||"fx";return this.each(function(){var q=queue(this,type);q.shift();if(q.length)q[0].call(this);});};jQuery.extend({speed:function(speed,easing,fn){var opt=speed&&speed.constructor==Object?speed:{complete:fn||!fn&&easing||jQuery.isFunction(speed)&&speed,duration:speed,easing:fn&&easing||easing&&easing.constructor!=Function&&easing};opt.duration=(opt.duration&&opt.duration.constructor==Number?opt.duration:jQuery.fx.speeds[opt.duration])||jQuery.fx.speeds.def;opt.old=opt.complete;opt.complete=function(){if(opt.queue!==false)jQuery(this).dequeue();if(jQuery.isFunction(opt.old))opt.old.call(this);};return opt;},easing:{linear:function(p,n,firstNum,diff){return firstNum+diff*p;},swing:function(p,n,firstNum,diff){return((-Math.cos(p*Math.PI)/2)+0.5)*diff+firstNum;}},timers:[],timerId:null,fx:function(elem,options,prop){this.options=options;this.elem=elem;this.prop=prop;if(!options.orig)options.orig={};}});jQuery.fx.prototype={update:function(){if(this.options.step)this.options.step.call(this.elem,this.now,this);(jQuery.fx.step[this.prop]||jQuery.fx.step._default)(this);if(this.prop=="height"||this.prop=="width")this.elem.style.display="block";},cur:function(force){if(this.elem[this.prop]!=null&&this.elem.style[this.prop]==null)return this.elem[this.prop];var r=parseFloat(jQuery.css(this.elem,this.prop,force));return r&&r>-10000?r:parseFloat(jQuery.curCSS(this.elem,this.prop))||0;},custom:function(from,to,unit){this.startTime=now();this.start=from;this.end=to;this.unit=unit||this.unit||"px";this.now=this.start;this.pos=this.state=0;this.update();var self=this;function t(gotoEnd){return self.step(gotoEnd);}t.elem=this.elem;jQuery.timers.push(t);if(jQuery.timerId==null){jQuery.timerId=setInterval(function(){var timers=jQuery.timers;for(var i=0;i<timers.length;i++)if(!timers[i]())timers.splice(i--,1);if(!timers.length){clearInterval(jQuery.timerId);jQuery.timerId=null;}},13);}},show:function(){this.options.orig[this.prop]=jQuery.attr(this.elem.style,this.prop);this.options.show=true;this.custom(0,this.cur());if(this.prop=="width"||this.prop=="height")this.elem.style[this.prop]="1px";jQuery(this.elem).show();},hide:function(){this.options.orig[this.prop]=jQuery.attr(this.elem.style,this.prop);this.options.hide=true;this.custom(this.cur(),0);},step:function(gotoEnd){var t=now();if(gotoEnd||t>this.options.duration+this.startTime){this.now=this.end;this.pos=this.state=1;this.update();this.options.curAnim[this.prop]=true;var done=true;for(var i in this.options.curAnim)if(this.options.curAnim[i]!==true)done=false;if(done){if(this.options.display!=null){this.elem.style.overflow=this.options.overflow;this.elem.style.display=this.options.display;if(jQuery.css(this.elem,"display")=="none")this.elem.style.display="block";}if(this.options.hide)this.elem.style.display="none";if(this.options.hide||this.options.show)for(var p in this.options.curAnim)jQuery.attr(this.elem.style,p,this.options.orig[p]);}if(done)this.options.complete.call(this.elem);return false;}else{var n=t-this.startTime;this.state=n/this.options.duration;this.pos=jQuery.easing[this.options.easing||(jQuery.easing.swing?"swing":"linear")](this.state,n,0,1,this.options.duration);this.now=this.start+((this.end-this.start)*this.pos);this.update();}return true;}};jQuery.extend(jQuery.fx,{speeds:{slow:600,fast:200,def:400},step:{scrollLeft:function(fx){fx.elem.scrollLeft=fx.now;},scrollTop:function(fx){fx.elem.scrollTop=fx.now;},opacity:function(fx){jQuery.attr(fx.elem.style,"opacity",fx.now);},_default:function(fx){fx.elem.style[fx.prop]=fx.now+fx.unit;}}});jQuery.fn.offset=function(){var left=0,top=0,elem=this[0],results;if(elem)with(jQuery.browser){var parent=elem.parentNode,offsetChild=elem,offsetParent=elem.offsetParent,doc=elem.ownerDocument,safari2=safari&&parseInt(version)<522&&!/adobeair/i.test(userAgent),css=jQuery.curCSS,fixed=css(elem,"position")=="fixed";if(elem.getBoundingClientRect){var box=elem.getBoundingClientRect();add(box.left+Math.max(doc.documentElement.scrollLeft,doc.body.scrollLeft),box.top+Math.max(doc.documentElement.scrollTop,doc.body.scrollTop));add(-doc.documentElement.clientLeft,-doc.documentElement.clientTop);}else{add(elem.offsetLeft,elem.offsetTop);while(offsetParent){add(offsetParent.offsetLeft,offsetParent.offsetTop);if(mozilla&&!/^t(able|d|h)$/i.test(offsetParent.tagName)||safari&&!safari2)border(offsetParent);if(!fixed&&css(offsetParent,"position")=="fixed")fixed=true;offsetChild=/^body$/i.test(offsetParent.tagName)?offsetChild:offsetParent;offsetParent=offsetParent.offsetParent;}while(parent&&parent.tagName&&!/^body|html$/i.test(parent.tagName)){if(!/^inline|table.*$/i.test(css(parent,"display")))add(-parent.scrollLeft,-parent.scrollTop);if(mozilla&&css(parent,"overflow")!="visible")border(parent);parent=parent.parentNode;}if((safari2&&(fixed||css(offsetChild,"position")=="absolute"))||(mozilla&&css(offsetChild,"position")!="absolute"))add(-doc.body.offsetLeft,-doc.body.offsetTop);if(fixed)add(Math.max(doc.documentElement.scrollLeft,doc.body.scrollLeft),Math.max(doc.documentElement.scrollTop,doc.body.scrollTop));}results={top:top,left:left};}function border(elem){add(jQuery.curCSS(elem,"borderLeftWidth",true),jQuery.curCSS(elem,"borderTopWidth",true));}function add(l,t){left+=parseInt(l,10)||0;top+=parseInt(t,10)||0;}return results;};jQuery.fn.extend({position:function(){var left=0,top=0,results;if(this[0]){var offsetParent=this.offsetParent(),offset=this.offset(),parentOffset=/^body|html$/i.test(offsetParent[0].tagName)?{top:0,left:0}:offsetParent.offset();offset.top-=num(this,'marginTop');offset.left-=num(this,'marginLeft');parentOffset.top+=num(offsetParent,'borderTopWidth');parentOffset.left+=num(offsetParent,'borderLeftWidth');results={top:offset.top-parentOffset.top,left:offset.left-parentOffset.left};}return results;},offsetParent:function(){var offsetParent=this[0].offsetParent;while(offsetParent&&(!/^body|html$/i.test(offsetParent.tagName)&&jQuery.css(offsetParent,'position')=='static'))offsetParent=offsetParent.offsetParent;return jQuery(offsetParent);}});jQuery.each(['Left','Top'],function(i,name){var method='scroll'+name;jQuery.fn[method]=function(val){if(!this[0])return;return val!=undefined?this.each(function(){this==window||this==document?window.scrollTo(!i?val:jQuery(window).scrollLeft(),i?val:jQuery(window).scrollTop()):this[method]=val;}):this[0]==window||this[0]==document?self[i?'pageYOffset':'pageXOffset']||jQuery.boxModel&&document.documentElement[method]||document.body[method]:this[0][method];};});jQuery.each(["Height","Width"],function(i,name){var tl=i?"Left":"Top",br=i?"Right":"Bottom";jQuery.fn["inner"+name]=function(){return this[name.toLowerCase()]()+num(this,"padding"+tl)+num(this,"padding"+br);};jQuery.fn["outer"+name]=function(margin){return this["inner"+name]()+num(this,"border"+tl+"Width")+num(this,"border"+br+"Width")+(margin?num(this,"margin"+tl)+num(this,"margin"+br):0);};});})(); \ No newline at end of file
+(function(A,w){function oa(){if(!c.isReady){try{s.documentElement.doScroll("left")}catch(a){setTimeout(oa,1);return}c.ready()}}function La(a,b){b.src?c.ajax({url:b.src,async:false,dataType:"script"}):c.globalEval(b.text||b.textContent||b.innerHTML||"");b.parentNode&&b.parentNode.removeChild(b)}function $(a,b,d,f,e,i){var j=a.length;if(typeof b==="object"){for(var o in b)$(a,o,b[o],f,e,d);return a}if(d!==w){f=!i&&f&&c.isFunction(d);for(o=0;o<j;o++)e(a[o],b,f?d.call(a[o],o,e(a[o],b)):d,i);return a}return j?
+e(a[0],b):null}function K(){return(new Date).getTime()}function aa(){return false}function ba(){return true}function pa(a,b,d){d[0].type=a;return c.event.handle.apply(b,d)}function qa(a){var b=true,d=[],f=[],e=arguments,i,j,o,p,n,t=c.extend({},c.data(this,"events").live);for(p in t){j=t[p];if(j.live===a.type||j.altLive&&c.inArray(a.type,j.altLive)>-1){i=j.data;i.beforeFilter&&i.beforeFilter[a.type]&&!i.beforeFilter[a.type](a)||f.push(j.selector)}else delete t[p]}i=c(a.target).closest(f,a.currentTarget);
+n=0;for(l=i.length;n<l;n++)for(p in t){j=t[p];o=i[n].elem;f=null;if(i[n].selector===j.selector){if(j.live==="mouseenter"||j.live==="mouseleave")f=c(a.relatedTarget).closest(j.selector)[0];if(!f||f!==o)d.push({elem:o,fn:j})}}n=0;for(l=d.length;n<l;n++){i=d[n];a.currentTarget=i.elem;a.data=i.fn.data;if(i.fn.apply(i.elem,e)===false){b=false;break}}return b}function ra(a,b){return["live",a,b.replace(/\./g,"`").replace(/ /g,"&")].join(".")}function sa(a){return!a||!a.parentNode||a.parentNode.nodeType===
+11}function ta(a,b){var d=0;b.each(function(){if(this.nodeName===(a[d]&&a[d].nodeName)){var f=c.data(a[d++]),e=c.data(this,f);if(f=f&&f.events){delete e.handle;e.events={};for(var i in f)for(var j in f[i])c.event.add(this,i,f[i][j],f[i][j].data)}}})}function ua(a,b,d){var f,e,i;if(a.length===1&&typeof a[0]==="string"&&a[0].length<512&&a[0].indexOf("<option")<0){e=true;if(i=c.fragments[a[0]])if(i!==1)f=i}if(!f){b=b&&b[0]?b[0].ownerDocument||b[0]:s;f=b.createDocumentFragment();c.clean(a,b,f,d)}if(e)c.fragments[a[0]]=
+i?f:1;return{fragment:f,cacheable:e}}function T(a){for(var b=0,d,f;(d=a[b])!=null;b++)if(!c.noData[d.nodeName.toLowerCase()]&&(f=d[H]))delete c.cache[f]}function L(a,b){var d={};c.each(va.concat.apply([],va.slice(0,b)),function(){d[this]=a});return d}function wa(a){return"scrollTo"in a&&a.document?a:a.nodeType===9?a.defaultView||a.parentWindow:false}var c=function(a,b){return new c.fn.init(a,b)},Ma=A.jQuery,Na=A.$,s=A.document,U,Oa=/^[^<]*(<[\w\W]+>)[^>]*$|^#([\w-]+)$/,Pa=/^.[^:#\[\.,]*$/,Qa=/\S/,
+Ra=/^(\s|\u00A0)+|(\s|\u00A0)+$/g,Sa=/^<(\w+)\s*\/?>(?:<\/\1>)?$/,P=navigator.userAgent,xa=false,Q=[],M,ca=Object.prototype.toString,da=Object.prototype.hasOwnProperty,ea=Array.prototype.push,R=Array.prototype.slice,V=Array.prototype.indexOf;c.fn=c.prototype={init:function(a,b){var d,f;if(!a)return this;if(a.nodeType){this.context=this[0]=a;this.length=1;return this}if(typeof a==="string")if((d=Oa.exec(a))&&(d[1]||!b))if(d[1]){f=b?b.ownerDocument||b:s;if(a=Sa.exec(a))if(c.isPlainObject(b)){a=[s.createElement(a[1])];
+c.fn.attr.call(a,b,true)}else a=[f.createElement(a[1])];else{a=ua([d[1]],[f]);a=(a.cacheable?a.fragment.cloneNode(true):a.fragment).childNodes}}else{if(b=s.getElementById(d[2])){if(b.id!==d[2])return U.find(a);this.length=1;this[0]=b}this.context=s;this.selector=a;return this}else if(!b&&/^\w+$/.test(a)){this.selector=a;this.context=s;a=s.getElementsByTagName(a)}else return!b||b.jquery?(b||U).find(a):c(b).find(a);else if(c.isFunction(a))return U.ready(a);if(a.selector!==w){this.selector=a.selector;
+this.context=a.context}return c.isArray(a)?this.setArray(a):c.makeArray(a,this)},selector:"",jquery:"1.4",length:0,size:function(){return this.length},toArray:function(){return R.call(this,0)},get:function(a){return a==null?this.toArray():a<0?this.slice(a)[0]:this[a]},pushStack:function(a,b,d){a=c(a||null);a.prevObject=this;a.context=this.context;if(b==="find")a.selector=this.selector+(this.selector?" ":"")+d;else if(b)a.selector=this.selector+"."+b+"("+d+")";return a},setArray:function(a){this.length=
+0;ea.apply(this,a);return this},each:function(a,b){return c.each(this,a,b)},ready:function(a){c.bindReady();if(c.isReady)a.call(s,c);else Q&&Q.push(a);return this},eq:function(a){return a===-1?this.slice(a):this.slice(a,+a+1)},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},slice:function(){return this.pushStack(R.apply(this,arguments),"slice",R.call(arguments).join(","))},map:function(a){return this.pushStack(c.map(this,function(b,d){return a.call(b,d,b)}))},end:function(){return this.prevObject||
+c(null)},push:ea,sort:[].sort,splice:[].splice};c.fn.init.prototype=c.fn;c.extend=c.fn.extend=function(){var a=arguments[0]||{},b=1,d=arguments.length,f=false,e,i,j,o;if(typeof a==="boolean"){f=a;a=arguments[1]||{};b=2}if(typeof a!=="object"&&!c.isFunction(a))a={};if(d===b){a=this;--b}for(;b<d;b++)if((e=arguments[b])!=null)for(i in e){j=a[i];o=e[i];if(a!==o)if(f&&o&&(c.isPlainObject(o)||c.isArray(o))){j=j&&(c.isPlainObject(j)||c.isArray(j))?j:c.isArray(o)?[]:{};a[i]=c.extend(f,j,o)}else if(o!==w)a[i]=
+o}return a};c.extend({noConflict:function(a){A.$=Na;if(a)A.jQuery=Ma;return c},isReady:false,ready:function(){if(!c.isReady){if(!s.body)return setTimeout(c.ready,13);c.isReady=true;if(Q){for(var a,b=0;a=Q[b++];)a.call(s,c);Q=null}c.fn.triggerHandler&&c(s).triggerHandler("ready")}},bindReady:function(){if(!xa){xa=true;if(s.readyState==="complete")return c.ready();if(s.addEventListener){s.addEventListener("DOMContentLoaded",M,false);A.addEventListener("load",c.ready,false)}else if(s.attachEvent){s.attachEvent("onreadystatechange",
+M);A.attachEvent("onload",c.ready);var a=false;try{a=A.frameElement==null}catch(b){}s.documentElement.doScroll&&a&&oa()}}},isFunction:function(a){return ca.call(a)==="[object Function]"},isArray:function(a){return ca.call(a)==="[object Array]"},isPlainObject:function(a){if(!a||ca.call(a)!=="[object Object]"||a.nodeType||a.setInterval)return false;if(a.constructor&&!da.call(a,"constructor")&&!da.call(a.constructor.prototype,"isPrototypeOf"))return false;var b;for(b in a);return b===w||da.call(a,b)},
+isEmptyObject:function(a){for(var b in a)return false;return true},noop:function(){},globalEval:function(a){if(a&&Qa.test(a)){var b=s.getElementsByTagName("head")[0]||s.documentElement,d=s.createElement("script");d.type="text/javascript";if(c.support.scriptEval)d.appendChild(s.createTextNode(a));else d.text=a;b.insertBefore(d,b.firstChild);b.removeChild(d)}},nodeName:function(a,b){return a.nodeName&&a.nodeName.toUpperCase()===b.toUpperCase()},each:function(a,b,d){var f,e=0,i=a.length,j=i===w||c.isFunction(a);
+if(d)if(j)for(f in a){if(b.apply(a[f],d)===false)break}else for(;e<i;){if(b.apply(a[e++],d)===false)break}else if(j)for(f in a){if(b.call(a[f],f,a[f])===false)break}else for(d=a[0];e<i&&b.call(d,e,d)!==false;d=a[++e]);return a},trim:function(a){return(a||"").replace(Ra,"")},makeArray:function(a,b){b=b||[];if(a!=null)a.length==null||typeof a==="string"||c.isFunction(a)||typeof a!=="function"&&a.setInterval?ea.call(b,a):c.merge(b,a);return b},inArray:function(a,b){if(b.indexOf)return b.indexOf(a);for(var d=
+0,f=b.length;d<f;d++)if(b[d]===a)return d;return-1},merge:function(a,b){var d=a.length,f=0;if(typeof b.length==="number")for(var e=b.length;f<e;f++)a[d++]=b[f];else for(;b[f]!==w;)a[d++]=b[f++];a.length=d;return a},grep:function(a,b,d){for(var f=[],e=0,i=a.length;e<i;e++)!d!==!b(a[e],e)&&f.push(a[e]);return f},map:function(a,b,d){for(var f=[],e,i=0,j=a.length;i<j;i++){e=b(a[i],i,d);if(e!=null)f[f.length]=e}return f.concat.apply([],f)},guid:1,proxy:function(a,b,d){if(arguments.length===2)if(typeof b===
+"string"){d=a;a=d[b];b=w}else if(b&&!c.isFunction(b)){d=b;b=w}if(!b&&a)b=function(){return a.apply(d||this,arguments)};if(a)b.guid=a.guid=a.guid||b.guid||c.guid++;return b},uaMatch:function(a){var b={browser:""};a=a.toLowerCase();if(/webkit/.test(a))b={browser:"webkit",version:/webkit[\/ ]([\w.]+)/};else if(/opera/.test(a))b={browser:"opera",version:/version/.test(a)?/version[\/ ]([\w.]+)/:/opera[\/ ]([\w.]+)/};else if(/msie/.test(a))b={browser:"msie",version:/msie ([\w.]+)/};else if(/mozilla/.test(a)&&
+!/compatible/.test(a))b={browser:"mozilla",version:/rv:([\w.]+)/};b.version=(b.version&&b.version.exec(a)||[0,"0"])[1];return b},browser:{}});P=c.uaMatch(P);if(P.browser){c.browser[P.browser]=true;c.browser.version=P.version}if(c.browser.webkit)c.browser.safari=true;if(V)c.inArray=function(a,b){return V.call(b,a)};U=c(s);if(s.addEventListener)M=function(){s.removeEventListener("DOMContentLoaded",M,false);c.ready()};else if(s.attachEvent)M=function(){if(s.readyState==="complete"){s.detachEvent("onreadystatechange",
+M);c.ready()}};if(V)c.inArray=function(a,b){return V.call(b,a)};(function(){c.support={};var a=s.documentElement,b=s.createElement("script"),d=s.createElement("div"),f="script"+K();d.style.display="none";d.innerHTML=" <link/><table></table><a href='/a' style='color:red;float:left;opacity:.55;'>a</a><input type='checkbox'/>";var e=d.getElementsByTagName("*"),i=d.getElementsByTagName("a")[0];if(!(!e||!e.length||!i)){c.support={leadingWhitespace:d.firstChild.nodeType===3,tbody:!d.getElementsByTagName("tbody").length,
+htmlSerialize:!!d.getElementsByTagName("link").length,style:/red/.test(i.getAttribute("style")),hrefNormalized:i.getAttribute("href")==="/a",opacity:/^0.55$/.test(i.style.opacity),cssFloat:!!i.style.cssFloat,checkOn:d.getElementsByTagName("input")[0].value==="on",optSelected:s.createElement("select").appendChild(s.createElement("option")).selected,scriptEval:false,noCloneEvent:true,boxModel:null};b.type="text/javascript";try{b.appendChild(s.createTextNode("window."+f+"=1;"))}catch(j){}a.insertBefore(b,
+a.firstChild);if(A[f]){c.support.scriptEval=true;delete A[f]}a.removeChild(b);if(d.attachEvent&&d.fireEvent){d.attachEvent("onclick",function o(){c.support.noCloneEvent=false;d.detachEvent("onclick",o)});d.cloneNode(true).fireEvent("onclick")}c(function(){var o=s.createElement("div");o.style.width=o.style.paddingLeft="1px";s.body.appendChild(o);c.boxModel=c.support.boxModel=o.offsetWidth===2;s.body.removeChild(o).style.display="none"});a=function(o){var p=s.createElement("div");o="on"+o;var n=o in
+p;if(!n){p.setAttribute(o,"return;");n=typeof p[o]==="function"}return n};c.support.submitBubbles=a("submit");c.support.changeBubbles=a("change");a=b=d=e=i=null}})();c.props={"for":"htmlFor","class":"className",readonly:"readOnly",maxlength:"maxLength",cellspacing:"cellSpacing",rowspan:"rowSpan",colspan:"colSpan",tabindex:"tabIndex",usemap:"useMap",frameborder:"frameBorder"};var H="jQuery"+K(),Ta=0,ya={},Ua={};c.extend({cache:{},expando:H,noData:{embed:true,object:true,applet:true},data:function(a,
+b,d){if(!(a.nodeName&&c.noData[a.nodeName.toLowerCase()])){a=a==A?ya:a;var f=a[H],e=c.cache;if(!b&&!f)return null;f||(f=++Ta);if(typeof b==="object"){a[H]=f;e=e[f]=c.extend(true,{},b)}else e=e[f]?e[f]:typeof d==="undefined"?Ua:(e[f]={});if(d!==w){a[H]=f;e[b]=d}return typeof b==="string"?e[b]:e}},removeData:function(a,b){if(!(a.nodeName&&c.noData[a.nodeName.toLowerCase()])){a=a==A?ya:a;var d=a[H],f=c.cache,e=f[d];if(b){if(e){delete e[b];c.isEmptyObject(e)&&c.removeData(a)}}else{try{delete a[H]}catch(i){a.removeAttribute&&
+a.removeAttribute(H)}delete f[d]}}}});c.fn.extend({data:function(a,b){if(typeof a==="undefined"&&this.length)return c.data(this[0]);else if(typeof a==="object")return this.each(function(){c.data(this,a)});var d=a.split(".");d[1]=d[1]?"."+d[1]:"";if(b===w){var f=this.triggerHandler("getData"+d[1]+"!",[d[0]]);if(f===w&&this.length)f=c.data(this[0],a);return f===w&&d[1]?this.data(d[0]):f}else return this.trigger("setData"+d[1]+"!",[d[0],b]).each(function(){c.data(this,a,b)})},removeData:function(a){return this.each(function(){c.removeData(this,
+a)})}});c.extend({queue:function(a,b,d){if(a){b=(b||"fx")+"queue";var f=c.data(a,b);if(!d)return f||[];if(!f||c.isArray(d))f=c.data(a,b,c.makeArray(d));else f.push(d);return f}},dequeue:function(a,b){b=b||"fx";var d=c.queue(a,b),f=d.shift();if(f==="inprogress")f=d.shift();if(f){b==="fx"&&d.unshift("inprogress");f.call(a,function(){c.dequeue(a,b)})}}});c.fn.extend({queue:function(a,b){if(typeof a!=="string"){b=a;a="fx"}if(b===w)return c.queue(this[0],a);return this.each(function(){var d=c.queue(this,
+a,b);a==="fx"&&d[0]!=="inprogress"&&c.dequeue(this,a)})},dequeue:function(a){return this.each(function(){c.dequeue(this,a)})},delay:function(a,b){a=c.fx?c.fx.speeds[a]||a:a;b=b||"fx";return this.queue(b,function(){var d=this;setTimeout(function(){c.dequeue(d,b)},a)})},clearQueue:function(a){return this.queue(a||"fx",[])}});var za=/[\n\t]/g,fa=/\s+/,Va=/\r/g,Wa=/href|src|style/,Xa=/(button|input)/i,Ya=/(button|input|object|select|textarea)/i,Za=/^(a|area)$/i,Aa=/radio|checkbox/;c.fn.extend({attr:function(a,
+b){return $(this,a,b,true,c.attr)},removeAttr:function(a){return this.each(function(){c.attr(this,a,"");this.nodeType===1&&this.removeAttribute(a)})},addClass:function(a){if(c.isFunction(a))return this.each(function(p){var n=c(this);n.addClass(a.call(this,p,n.attr("class")))});if(a&&typeof a==="string")for(var b=(a||"").split(fa),d=0,f=this.length;d<f;d++){var e=this[d];if(e.nodeType===1)if(e.className)for(var i=" "+e.className+" ",j=0,o=b.length;j<o;j++){if(i.indexOf(" "+b[j]+" ")<0)e.className+=
+" "+b[j]}else e.className=a}return this},removeClass:function(a){if(c.isFunction(a))return this.each(function(p){var n=c(this);n.removeClass(a.call(this,p,n.attr("class")))});if(a&&typeof a==="string"||a===w)for(var b=(a||"").split(fa),d=0,f=this.length;d<f;d++){var e=this[d];if(e.nodeType===1&&e.className)if(a){for(var i=(" "+e.className+" ").replace(za," "),j=0,o=b.length;j<o;j++)i=i.replace(" "+b[j]+" "," ");e.className=i.substring(1,i.length-1)}else e.className=""}return this},toggleClass:function(a,
+b){var d=typeof a,f=typeof b==="boolean";if(c.isFunction(a))return this.each(function(e){var i=c(this);i.toggleClass(a.call(this,e,i.attr("class"),b),b)});return this.each(function(){if(d==="string")for(var e,i=0,j=c(this),o=b,p=a.split(fa);e=p[i++];){o=f?o:!j.hasClass(e);j[o?"addClass":"removeClass"](e)}else if(d==="undefined"||d==="boolean"){this.className&&c.data(this,"__className__",this.className);this.className=this.className||a===false?"":c.data(this,"__className__")||""}})},hasClass:function(a){a=
+" "+a+" ";for(var b=0,d=this.length;b<d;b++)if((" "+this[b].className+" ").replace(za," ").indexOf(a)>-1)return true;return false},val:function(a){if(a===w){var b=this[0];if(b){if(c.nodeName(b,"option"))return(b.attributes.value||{}).specified?b.value:b.text;if(c.nodeName(b,"select")){var d=b.selectedIndex,f=[],e=b.options;b=b.type==="select-one";if(d<0)return null;var i=b?d:0;for(d=b?d+1:e.length;i<d;i++){var j=e[i];if(j.selected){a=c(j).val();if(b)return a;f.push(a)}}return f}if(Aa.test(b.type)&&
+!c.support.checkOn)return b.getAttribute("value")===null?"on":b.value;return(b.value||"").replace(Va,"")}return w}var o=c.isFunction(a);return this.each(function(p){var n=c(this),t=a;if(this.nodeType===1){if(o)t=a.call(this,p,n.val());if(typeof t==="number")t+="";if(c.isArray(t)&&Aa.test(this.type))this.checked=c.inArray(n.val(),t)>=0;else if(c.nodeName(this,"select")){var z=c.makeArray(t);c("option",this).each(function(){this.selected=c.inArray(c(this).val(),z)>=0});if(!z.length)this.selectedIndex=
+-1}else this.value=t}})}});c.extend({attrFn:{val:true,css:true,html:true,text:true,data:true,width:true,height:true,offset:true},attr:function(a,b,d,f){if(!a||a.nodeType===3||a.nodeType===8)return w;if(f&&b in c.attrFn)return c(a)[b](d);f=a.nodeType!==1||!c.isXMLDoc(a);var e=d!==w;b=f&&c.props[b]||b;if(a.nodeType===1){var i=Wa.test(b);if(b in a&&f&&!i){if(e){if(b==="type"&&Xa.test(a.nodeName)&&a.parentNode)throw"type property can't be changed";a[b]=d}if(c.nodeName(a,"form")&&a.getAttributeNode(b))return a.getAttributeNode(b).nodeValue;
+if(b==="tabIndex")return(b=a.getAttributeNode("tabIndex"))&&b.specified?b.value:Ya.test(a.nodeName)||Za.test(a.nodeName)&&a.href?0:w;return a[b]}if(!c.support.style&&f&&b==="style"){if(e)a.style.cssText=""+d;return a.style.cssText}e&&a.setAttribute(b,""+d);a=!c.support.hrefNormalized&&f&&i?a.getAttribute(b,2):a.getAttribute(b);return a===null?w:a}return c.style(a,b,d)}});var $a=function(a){return a.replace(/[^\w\s\.\|`]/g,function(b){return"\\"+b})};c.event={add:function(a,b,d,f){if(!(a.nodeType===
+3||a.nodeType===8)){if(a.setInterval&&a!==A&&!a.frameElement)a=A;if(!d.guid)d.guid=c.guid++;if(f!==w){d=c.proxy(d);d.data=f}var e=c.data(a,"events")||c.data(a,"events",{}),i=c.data(a,"handle"),j;if(!i){j=function(){return typeof c!=="undefined"&&!c.event.triggered?c.event.handle.apply(j.elem,arguments):w};i=c.data(a,"handle",j)}if(i){i.elem=a;b=b.split(/\s+/);for(var o,p=0;o=b[p++];){var n=o.split(".");o=n.shift();d.type=n.slice(0).sort().join(".");var t=e[o],z=this.special[o]||{};if(!t){t=e[o]={};
+if(!z.setup||z.setup.call(a,f,n,d)===false)if(a.addEventListener)a.addEventListener(o,i,false);else a.attachEvent&&a.attachEvent("on"+o,i)}if(z.add)if((n=z.add.call(a,d,f,n,t))&&c.isFunction(n)){n.guid=n.guid||d.guid;d=n}t[d.guid]=d;this.global[o]=true}a=null}}},global:{},remove:function(a,b,d){if(!(a.nodeType===3||a.nodeType===8)){var f=c.data(a,"events"),e,i,j;if(f){if(b===w||typeof b==="string"&&b.charAt(0)===".")for(i in f)this.remove(a,i+(b||""));else{if(b.type){d=b.handler;b=b.type}b=b.split(/\s+/);
+for(var o=0;i=b[o++];){var p=i.split(".");i=p.shift();var n=!p.length,t=c.map(p.slice(0).sort(),$a);t=new RegExp("(^|\\.)"+t.join("\\.(?:.*\\.)?")+"(\\.|$)");var z=this.special[i]||{};if(f[i]){if(d){j=f[i][d.guid];delete f[i][d.guid]}else for(var B in f[i])if(n||t.test(f[i][B].type))delete f[i][B];z.remove&&z.remove.call(a,p,j);for(e in f[i])break;if(!e){if(!z.teardown||z.teardown.call(a,p)===false)if(a.removeEventListener)a.removeEventListener(i,c.data(a,"handle"),false);else a.detachEvent&&a.detachEvent("on"+
+i,c.data(a,"handle"));e=null;delete f[i]}}}}for(e in f)break;if(!e){if(B=c.data(a,"handle"))B.elem=null;c.removeData(a,"events");c.removeData(a,"handle")}}}},trigger:function(a,b,d,f){var e=a.type||a;if(!f){a=typeof a==="object"?a[H]?a:c.extend(c.Event(e),a):c.Event(e);if(e.indexOf("!")>=0){a.type=e=e.slice(0,-1);a.exclusive=true}if(!d){a.stopPropagation();this.global[e]&&c.each(c.cache,function(){this.events&&this.events[e]&&c.event.trigger(a,b,this.handle.elem)})}if(!d||d.nodeType===3||d.nodeType===
+8)return w;a.result=w;a.target=d;b=c.makeArray(b);b.unshift(a)}a.currentTarget=d;var i=c.data(d,"handle");i&&i.apply(d,b);var j,o;try{if(!(d&&d.nodeName&&c.noData[d.nodeName.toLowerCase()])){j=d[e];o=d["on"+e]}}catch(p){}i=c.nodeName(d,"a")&&e==="click";if(!f&&j&&!a.isDefaultPrevented()&&!i){this.triggered=true;try{d[e]()}catch(n){}}else if(o&&d["on"+e].apply(d,b)===false)a.result=false;this.triggered=false;if(!a.isPropagationStopped())(d=d.parentNode||d.ownerDocument)&&c.event.trigger(a,b,d,true)},
+handle:function(a){var b,d;a=arguments[0]=c.event.fix(a||A.event);a.currentTarget=this;d=a.type.split(".");a.type=d.shift();b=!d.length&&!a.exclusive;var f=new RegExp("(^|\\.)"+d.slice(0).sort().join("\\.(?:.*\\.)?")+"(\\.|$)");d=(c.data(this,"events")||{})[a.type];for(var e in d){var i=d[e];if(b||f.test(i.type)){a.handler=i;a.data=i.data;i=i.apply(this,arguments);if(i!==w){a.result=i;if(i===false){a.preventDefault();a.stopPropagation()}}if(a.isImmediatePropagationStopped())break}}return a.result},
+props:"altKey attrChange attrName bubbles button cancelable charCode clientX clientY ctrlKey currentTarget data detail eventPhase fromElement handler keyCode layerX layerY metaKey newValue offsetX offsetY originalTarget pageX pageY prevValue relatedNode relatedTarget screenX screenY shiftKey srcElement target toElement view wheelDelta which".split(" "),fix:function(a){if(a[H])return a;var b=a;a=c.Event(b);for(var d=this.props.length,f;d;){f=this.props[--d];a[f]=b[f]}if(!a.target)a.target=a.srcElement||
+s;if(a.target.nodeType===3)a.target=a.target.parentNode;if(!a.relatedTarget&&a.fromElement)a.relatedTarget=a.fromElement===a.target?a.toElement:a.fromElement;if(a.pageX==null&&a.clientX!=null){b=s.documentElement;d=s.body;a.pageX=a.clientX+(b&&b.scrollLeft||d&&d.scrollLeft||0)-(b&&b.clientLeft||d&&d.clientLeft||0);a.pageY=a.clientY+(b&&b.scrollTop||d&&d.scrollTop||0)-(b&&b.clientTop||d&&d.clientTop||0)}if(!a.which&&(a.charCode||a.charCode===0?a.charCode:a.keyCode))a.which=a.charCode||a.keyCode;if(!a.metaKey&&
+a.ctrlKey)a.metaKey=a.ctrlKey;if(!a.which&&a.button!==w)a.which=a.button&1?1:a.button&2?3:a.button&4?2:0;return a},guid:1E8,proxy:c.proxy,special:{ready:{setup:c.bindReady,teardown:c.noop},live:{add:function(a,b){c.extend(a,b||{});a.guid+=b.selector+b.live;c.event.add(this,b.live,qa,b)},remove:function(a){if(a.length){var b=0,d=new RegExp("(^|\\.)"+a[0]+"(\\.|$)");c.each(c.data(this,"events").live||{},function(){d.test(this.type)&&b++});b<1&&c.event.remove(this,a[0],qa)}},special:{}},beforeunload:{setup:function(a,
+b,d){if(this.setInterval)this.onbeforeunload=d;return false},teardown:function(a,b){if(this.onbeforeunload===b)this.onbeforeunload=null}}}};c.Event=function(a){if(!this.preventDefault)return new c.Event(a);if(a&&a.type){this.originalEvent=a;this.type=a.type}else this.type=a;this.timeStamp=K();this[H]=true};c.Event.prototype={preventDefault:function(){this.isDefaultPrevented=ba;var a=this.originalEvent;if(a){a.preventDefault&&a.preventDefault();a.returnValue=false}},stopPropagation:function(){this.isPropagationStopped=
+ba;var a=this.originalEvent;if(a){a.stopPropagation&&a.stopPropagation();a.cancelBubble=true}},stopImmediatePropagation:function(){this.isImmediatePropagationStopped=ba;this.stopPropagation()},isDefaultPrevented:aa,isPropagationStopped:aa,isImmediatePropagationStopped:aa};var Ba=function(a){for(var b=a.relatedTarget;b&&b!==this;)try{b=b.parentNode}catch(d){break}if(b!==this){a.type=a.data;c.event.handle.apply(this,arguments)}},Ca=function(a){a.type=a.data;c.event.handle.apply(this,arguments)};c.each({mouseenter:"mouseover",
+mouseleave:"mouseout"},function(a,b){c.event.special[a]={setup:function(d){c.event.add(this,b,d&&d.selector?Ca:Ba,a)},teardown:function(d){c.event.remove(this,b,d&&d.selector?Ca:Ba)}}});if(!c.support.submitBubbles)c.event.special.submit={setup:function(a,b,d){if(this.nodeName.toLowerCase()!=="form"){c.event.add(this,"click.specialSubmit."+d.guid,function(f){var e=f.target,i=e.type;if((i==="submit"||i==="image")&&c(e).closest("form").length)return pa("submit",this,arguments)});c.event.add(this,"keypress.specialSubmit."+
+d.guid,function(f){var e=f.target,i=e.type;if((i==="text"||i==="password")&&c(e).closest("form").length&&f.keyCode===13)return pa("submit",this,arguments)})}else return false},remove:function(a,b){c.event.remove(this,"click.specialSubmit"+(b?"."+b.guid:""));c.event.remove(this,"keypress.specialSubmit"+(b?"."+b.guid:""))}};if(!c.support.changeBubbles){var ga=/textarea|input|select/i;function Da(a){var b=a.type,d=a.value;if(b==="radio"||b==="checkbox")d=a.checked;else if(b==="select-multiple")d=a.selectedIndex>
+-1?c.map(a.options,function(f){return f.selected}).join("-"):"";else if(a.nodeName.toLowerCase()==="select")d=a.selectedIndex;return d}function ha(a,b){var d=a.target,f,e;if(!(!ga.test(d.nodeName)||d.readOnly)){f=c.data(d,"_change_data");e=Da(d);if(e!==f){if(a.type!=="focusout"||d.type!=="radio")c.data(d,"_change_data",e);if(d.type!=="select"&&(f!=null||e)){a.type="change";return c.event.trigger(a,b,this)}}}}c.event.special.change={filters:{focusout:ha,click:function(a){var b=a.target,d=b.type;if(d===
+"radio"||d==="checkbox"||b.nodeName.toLowerCase()==="select")return ha.call(this,a)},keydown:function(a){var b=a.target,d=b.type;if(a.keyCode===13&&b.nodeName.toLowerCase()!=="textarea"||a.keyCode===32&&(d==="checkbox"||d==="radio")||d==="select-multiple")return ha.call(this,a)},beforeactivate:function(a){a=a.target;a.nodeName.toLowerCase()==="input"&&a.type==="radio"&&c.data(a,"_change_data",Da(a))}},setup:function(a,b,d){for(var f in W)c.event.add(this,f+".specialChange."+d.guid,W[f]);return ga.test(this.nodeName)},
+remove:function(a,b){for(var d in W)c.event.remove(this,d+".specialChange"+(b?"."+b.guid:""),W[d]);return ga.test(this.nodeName)}};var W=c.event.special.change.filters}s.addEventListener&&c.each({focus:"focusin",blur:"focusout"},function(a,b){function d(f){f=c.event.fix(f);f.type=b;return c.event.handle.call(this,f)}c.event.special[b]={setup:function(){this.addEventListener(a,d,true)},teardown:function(){this.removeEventListener(a,d,true)}}});c.each(["bind","one"],function(a,b){c.fn[b]=function(d,
+f,e){if(typeof d==="object"){for(var i in d)this[b](i,f,d[i],e);return this}if(c.isFunction(f)){thisObject=e;e=f;f=w}var j=b==="one"?c.proxy(e,function(o){c(this).unbind(o,j);return e.apply(this,arguments)}):e;return d==="unload"&&b!=="one"?this.one(d,f,e,thisObject):this.each(function(){c.event.add(this,d,j,f)})}});c.fn.extend({unbind:function(a,b){if(typeof a==="object"&&!a.preventDefault){for(var d in a)this.unbind(d,a[d]);return this}return this.each(function(){c.event.remove(this,a,b)})},trigger:function(a,
+b){return this.each(function(){c.event.trigger(a,b,this)})},triggerHandler:function(a,b){if(this[0]){a=c.Event(a);a.preventDefault();a.stopPropagation();c.event.trigger(a,b,this[0]);return a.result}},toggle:function(a){for(var b=arguments,d=1;d<b.length;)c.proxy(a,b[d++]);return this.click(c.proxy(a,function(f){var e=(c.data(this,"lastToggle"+a.guid)||0)%d;c.data(this,"lastToggle"+a.guid,e+1);f.preventDefault();return b[e].apply(this,arguments)||false}))},hover:function(a,b){return this.mouseenter(a).mouseleave(b||
+a)},live:function(a,b,d){if(c.isFunction(b)){d=b;b=w}c(this.context).bind(ra(a,this.selector),{data:b,selector:this.selector,live:a},d);return this},die:function(a,b){c(this.context).unbind(ra(a,this.selector),b?{guid:b.guid+this.selector+a}:null);return this}});c.each("blur focus focusin focusout load resize scroll unload click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup error".split(" "),function(a,b){c.fn[b]=function(d){return d?
+this.bind(b,d):this.trigger(b)};if(c.attrFn)c.attrFn[b]=true});A.attachEvent&&!A.addEventListener&&A.attachEvent("onunload",function(){for(var a in c.cache)if(c.cache[a].handle)try{c.event.remove(c.cache[a].handle.elem)}catch(b){}});(function(){function a(g){for(var h="",k,m=0;g[m];m++){k=g[m];if(k.nodeType===3||k.nodeType===4)h+=k.nodeValue;else if(k.nodeType!==8)h+=a(k.childNodes)}return h}function b(g,h,k,m,r,q){r=0;for(var v=m.length;r<v;r++){var u=m[r];if(u){u=u[g];for(var y=false;u;){if(u.sizcache===
+k){y=m[u.sizset];break}if(u.nodeType===1&&!q){u.sizcache=k;u.sizset=r}if(u.nodeName.toLowerCase()===h){y=u;break}u=u[g]}m[r]=y}}}function d(g,h,k,m,r,q){r=0;for(var v=m.length;r<v;r++){var u=m[r];if(u){u=u[g];for(var y=false;u;){if(u.sizcache===k){y=m[u.sizset];break}if(u.nodeType===1){if(!q){u.sizcache=k;u.sizset=r}if(typeof h!=="string"){if(u===h){y=true;break}}else if(p.filter(h,[u]).length>0){y=u;break}}u=u[g]}m[r]=y}}}var f=/((?:\((?:\([^()]+\)|[^()]+)+\)|\[(?:\[[^[\]]*\]|['"][^'"]*['"]|[^[\]'"]+)+\]|\\.|[^ >+~,(\[\\]+)+|[>+~])(\s*,\s*)?((?:.|\r|\n)*)/g,
+e=0,i=Object.prototype.toString,j=false,o=true;[0,0].sort(function(){o=false;return 0});var p=function(g,h,k,m){k=k||[];var r=h=h||s;if(h.nodeType!==1&&h.nodeType!==9)return[];if(!g||typeof g!=="string")return k;for(var q=[],v,u,y,S,I=true,N=x(h),J=g;(f.exec(""),v=f.exec(J))!==null;){J=v[3];q.push(v[1]);if(v[2]){S=v[3];break}}if(q.length>1&&t.exec(g))if(q.length===2&&n.relative[q[0]])u=ia(q[0]+q[1],h);else for(u=n.relative[q[0]]?[h]:p(q.shift(),h);q.length;){g=q.shift();if(n.relative[g])g+=q.shift();
+u=ia(g,u)}else{if(!m&&q.length>1&&h.nodeType===9&&!N&&n.match.ID.test(q[0])&&!n.match.ID.test(q[q.length-1])){v=p.find(q.shift(),h,N);h=v.expr?p.filter(v.expr,v.set)[0]:v.set[0]}if(h){v=m?{expr:q.pop(),set:B(m)}:p.find(q.pop(),q.length===1&&(q[0]==="~"||q[0]==="+")&&h.parentNode?h.parentNode:h,N);u=v.expr?p.filter(v.expr,v.set):v.set;if(q.length>0)y=B(u);else I=false;for(;q.length;){var E=q.pop();v=E;if(n.relative[E])v=q.pop();else E="";if(v==null)v=h;n.relative[E](y,v,N)}}else y=[]}y||(y=u);if(!y)throw"Syntax error, unrecognized expression: "+
+(E||g);if(i.call(y)==="[object Array]")if(I)if(h&&h.nodeType===1)for(g=0;y[g]!=null;g++){if(y[g]&&(y[g]===true||y[g].nodeType===1&&F(h,y[g])))k.push(u[g])}else for(g=0;y[g]!=null;g++)y[g]&&y[g].nodeType===1&&k.push(u[g]);else k.push.apply(k,y);else B(y,k);if(S){p(S,r,k,m);p.uniqueSort(k)}return k};p.uniqueSort=function(g){if(D){j=o;g.sort(D);if(j)for(var h=1;h<g.length;h++)g[h]===g[h-1]&&g.splice(h--,1)}return g};p.matches=function(g,h){return p(g,null,null,h)};p.find=function(g,h,k){var m,r;if(!g)return[];
+for(var q=0,v=n.order.length;q<v;q++){var u=n.order[q];if(r=n.leftMatch[u].exec(g)){var y=r[1];r.splice(1,1);if(y.substr(y.length-1)!=="\\"){r[1]=(r[1]||"").replace(/\\/g,"");m=n.find[u](r,h,k);if(m!=null){g=g.replace(n.match[u],"");break}}}}m||(m=h.getElementsByTagName("*"));return{set:m,expr:g}};p.filter=function(g,h,k,m){for(var r=g,q=[],v=h,u,y,S=h&&h[0]&&x(h[0]);g&&h.length;){for(var I in n.filter)if((u=n.leftMatch[I].exec(g))!=null&&u[2]){var N=n.filter[I],J,E;E=u[1];y=false;u.splice(1,1);if(E.substr(E.length-
+1)!=="\\"){if(v===q)q=[];if(n.preFilter[I])if(u=n.preFilter[I](u,v,k,q,m,S)){if(u===true)continue}else y=J=true;if(u)for(var X=0;(E=v[X])!=null;X++)if(E){J=N(E,u,X,v);var Ea=m^!!J;if(k&&J!=null)if(Ea)y=true;else v[X]=false;else if(Ea){q.push(E);y=true}}if(J!==w){k||(v=q);g=g.replace(n.match[I],"");if(!y)return[];break}}}if(g===r)if(y==null)throw"Syntax error, unrecognized expression: "+g;else break;r=g}return v};var n=p.selectors={order:["ID","NAME","TAG"],match:{ID:/#((?:[\w\u00c0-\uFFFF-]|\\.)+)/,
+CLASS:/\.((?:[\w\u00c0-\uFFFF-]|\\.)+)/,NAME:/\[name=['"]*((?:[\w\u00c0-\uFFFF-]|\\.)+)['"]*\]/,ATTR:/\[\s*((?:[\w\u00c0-\uFFFF-]|\\.)+)\s*(?:(\S?=)\s*(['"]*)(.*?)\3|)\s*\]/,TAG:/^((?:[\w\u00c0-\uFFFF\*-]|\\.)+)/,CHILD:/:(only|nth|last|first)-child(?:\((even|odd|[\dn+-]*)\))?/,POS:/:(nth|eq|gt|lt|first|last|even|odd)(?:\((\d*)\))?(?=[^-]|$)/,PSEUDO:/:((?:[\w\u00c0-\uFFFF-]|\\.)+)(?:\((['"]?)((?:\([^\)]+\)|[^\(\)]*)+)\2\))?/},leftMatch:{},attrMap:{"class":"className","for":"htmlFor"},attrHandle:{href:function(g){return g.getAttribute("href")}},
+relative:{"+":function(g,h){var k=typeof h==="string",m=k&&!/\W/.test(h);k=k&&!m;if(m)h=h.toLowerCase();m=0;for(var r=g.length,q;m<r;m++)if(q=g[m]){for(;(q=q.previousSibling)&&q.nodeType!==1;);g[m]=k||q&&q.nodeName.toLowerCase()===h?q||false:q===h}k&&p.filter(h,g,true)},">":function(g,h){var k=typeof h==="string";if(k&&!/\W/.test(h)){h=h.toLowerCase();for(var m=0,r=g.length;m<r;m++){var q=g[m];if(q){k=q.parentNode;g[m]=k.nodeName.toLowerCase()===h?k:false}}}else{m=0;for(r=g.length;m<r;m++)if(q=g[m])g[m]=
+k?q.parentNode:q.parentNode===h;k&&p.filter(h,g,true)}},"":function(g,h,k){var m=e++,r=d;if(typeof h==="string"&&!/\W/.test(h)){var q=h=h.toLowerCase();r=b}r("parentNode",h,m,g,q,k)},"~":function(g,h,k){var m=e++,r=d;if(typeof h==="string"&&!/\W/.test(h)){var q=h=h.toLowerCase();r=b}r("previousSibling",h,m,g,q,k)}},find:{ID:function(g,h,k){if(typeof h.getElementById!=="undefined"&&!k)return(g=h.getElementById(g[1]))?[g]:[]},NAME:function(g,h){if(typeof h.getElementsByName!=="undefined"){var k=[];
+h=h.getElementsByName(g[1]);for(var m=0,r=h.length;m<r;m++)h[m].getAttribute("name")===g[1]&&k.push(h[m]);return k.length===0?null:k}},TAG:function(g,h){return h.getElementsByTagName(g[1])}},preFilter:{CLASS:function(g,h,k,m,r,q){g=" "+g[1].replace(/\\/g,"")+" ";if(q)return g;q=0;for(var v;(v=h[q])!=null;q++)if(v)if(r^(v.className&&(" "+v.className+" ").replace(/[\t\n]/g," ").indexOf(g)>=0))k||m.push(v);else if(k)h[q]=false;return false},ID:function(g){return g[1].replace(/\\/g,"")},TAG:function(g){return g[1].toLowerCase()},
+CHILD:function(g){if(g[1]==="nth"){var h=/(-?)(\d*)n((?:\+|-)?\d*)/.exec(g[2]==="even"&&"2n"||g[2]==="odd"&&"2n+1"||!/\D/.test(g[2])&&"0n+"+g[2]||g[2]);g[2]=h[1]+(h[2]||1)-0;g[3]=h[3]-0}g[0]=e++;return g},ATTR:function(g,h,k,m,r,q){h=g[1].replace(/\\/g,"");if(!q&&n.attrMap[h])g[1]=n.attrMap[h];if(g[2]==="~=")g[4]=" "+g[4]+" ";return g},PSEUDO:function(g,h,k,m,r){if(g[1]==="not")if((f.exec(g[3])||"").length>1||/^\w/.test(g[3]))g[3]=p(g[3],null,null,h);else{g=p.filter(g[3],h,k,true^r);k||m.push.apply(m,
+g);return false}else if(n.match.POS.test(g[0])||n.match.CHILD.test(g[0]))return true;return g},POS:function(g){g.unshift(true);return g}},filters:{enabled:function(g){return g.disabled===false&&g.type!=="hidden"},disabled:function(g){return g.disabled===true},checked:function(g){return g.checked===true},selected:function(g){return g.selected===true},parent:function(g){return!!g.firstChild},empty:function(g){return!g.firstChild},has:function(g,h,k){return!!p(k[3],g).length},header:function(g){return/h\d/i.test(g.nodeName)},
+text:function(g){return"text"===g.type},radio:function(g){return"radio"===g.type},checkbox:function(g){return"checkbox"===g.type},file:function(g){return"file"===g.type},password:function(g){return"password"===g.type},submit:function(g){return"submit"===g.type},image:function(g){return"image"===g.type},reset:function(g){return"reset"===g.type},button:function(g){return"button"===g.type||g.nodeName.toLowerCase()==="button"},input:function(g){return/input|select|textarea|button/i.test(g.nodeName)}},
+setFilters:{first:function(g,h){return h===0},last:function(g,h,k,m){return h===m.length-1},even:function(g,h){return h%2===0},odd:function(g,h){return h%2===1},lt:function(g,h,k){return h<k[3]-0},gt:function(g,h,k){return h>k[3]-0},nth:function(g,h,k){return k[3]-0===h},eq:function(g,h,k){return k[3]-0===h}},filter:{PSEUDO:function(g,h,k,m){var r=h[1],q=n.filters[r];if(q)return q(g,k,h,m);else if(r==="contains")return(g.textContent||g.innerText||a([g])||"").indexOf(h[3])>=0;else if(r==="not"){h=
+h[3];k=0;for(m=h.length;k<m;k++)if(h[k]===g)return false;return true}else throw"Syntax error, unrecognized expression: "+r;},CHILD:function(g,h){var k=h[1],m=g;switch(k){case "only":case "first":for(;m=m.previousSibling;)if(m.nodeType===1)return false;if(k==="first")return true;m=g;case "last":for(;m=m.nextSibling;)if(m.nodeType===1)return false;return true;case "nth":k=h[2];var r=h[3];if(k===1&&r===0)return true;h=h[0];var q=g.parentNode;if(q&&(q.sizcache!==h||!g.nodeIndex)){var v=0;for(m=q.firstChild;m;m=
+m.nextSibling)if(m.nodeType===1)m.nodeIndex=++v;q.sizcache=h}g=g.nodeIndex-r;return k===0?g===0:g%k===0&&g/k>=0}},ID:function(g,h){return g.nodeType===1&&g.getAttribute("id")===h},TAG:function(g,h){return h==="*"&&g.nodeType===1||g.nodeName.toLowerCase()===h},CLASS:function(g,h){return(" "+(g.className||g.getAttribute("class"))+" ").indexOf(h)>-1},ATTR:function(g,h){var k=h[1];g=n.attrHandle[k]?n.attrHandle[k](g):g[k]!=null?g[k]:g.getAttribute(k);k=g+"";var m=h[2];h=h[4];return g==null?m==="!=":m===
+"="?k===h:m==="*="?k.indexOf(h)>=0:m==="~="?(" "+k+" ").indexOf(h)>=0:!h?k&&g!==false:m==="!="?k!==h:m==="^="?k.indexOf(h)===0:m==="$="?k.substr(k.length-h.length)===h:m==="|="?k===h||k.substr(0,h.length+1)===h+"-":false},POS:function(g,h,k,m){var r=n.setFilters[h[2]];if(r)return r(g,k,h,m)}}},t=n.match.POS;for(var z in n.match){n.match[z]=new RegExp(n.match[z].source+/(?![^\[]*\])(?![^\(]*\))/.source);n.leftMatch[z]=new RegExp(/(^(?:.|\r|\n)*?)/.source+n.match[z].source.replace(/\\(\d+)/g,function(g,
+h){return"\\"+(h-0+1)}))}var B=function(g,h){g=Array.prototype.slice.call(g,0);if(h){h.push.apply(h,g);return h}return g};try{Array.prototype.slice.call(s.documentElement.childNodes,0)}catch(C){B=function(g,h){h=h||[];if(i.call(g)==="[object Array]")Array.prototype.push.apply(h,g);else if(typeof g.length==="number")for(var k=0,m=g.length;k<m;k++)h.push(g[k]);else for(k=0;g[k];k++)h.push(g[k]);return h}}var D;if(s.documentElement.compareDocumentPosition)D=function(g,h){if(!g.compareDocumentPosition||
+!h.compareDocumentPosition){if(g==h)j=true;return g.compareDocumentPosition?-1:1}g=g.compareDocumentPosition(h)&4?-1:g===h?0:1;if(g===0)j=true;return g};else if("sourceIndex"in s.documentElement)D=function(g,h){if(!g.sourceIndex||!h.sourceIndex){if(g==h)j=true;return g.sourceIndex?-1:1}g=g.sourceIndex-h.sourceIndex;if(g===0)j=true;return g};else if(s.createRange)D=function(g,h){if(!g.ownerDocument||!h.ownerDocument){if(g==h)j=true;return g.ownerDocument?-1:1}var k=g.ownerDocument.createRange(),m=
+h.ownerDocument.createRange();k.setStart(g,0);k.setEnd(g,0);m.setStart(h,0);m.setEnd(h,0);g=k.compareBoundaryPoints(Range.START_TO_END,m);if(g===0)j=true;return g};(function(){var g=s.createElement("div"),h="script"+(new Date).getTime();g.innerHTML="<a name='"+h+"'/>";var k=s.documentElement;k.insertBefore(g,k.firstChild);if(s.getElementById(h)){n.find.ID=function(m,r,q){if(typeof r.getElementById!=="undefined"&&!q)return(r=r.getElementById(m[1]))?r.id===m[1]||typeof r.getAttributeNode!=="undefined"&&
+r.getAttributeNode("id").nodeValue===m[1]?[r]:w:[]};n.filter.ID=function(m,r){var q=typeof m.getAttributeNode!=="undefined"&&m.getAttributeNode("id");return m.nodeType===1&&q&&q.nodeValue===r}}k.removeChild(g);k=g=null})();(function(){var g=s.createElement("div");g.appendChild(s.createComment(""));if(g.getElementsByTagName("*").length>0)n.find.TAG=function(h,k){k=k.getElementsByTagName(h[1]);if(h[1]==="*"){h=[];for(var m=0;k[m];m++)k[m].nodeType===1&&h.push(k[m]);k=h}return k};g.innerHTML="<a href='#'></a>";
+if(g.firstChild&&typeof g.firstChild.getAttribute!=="undefined"&&g.firstChild.getAttribute("href")!=="#")n.attrHandle.href=function(h){return h.getAttribute("href",2)};g=null})();s.querySelectorAll&&function(){var g=p,h=s.createElement("div");h.innerHTML="<p class='TEST'></p>";if(!(h.querySelectorAll&&h.querySelectorAll(".TEST").length===0)){p=function(m,r,q,v){r=r||s;if(!v&&r.nodeType===9&&!x(r))try{return B(r.querySelectorAll(m),q)}catch(u){}return g(m,r,q,v)};for(var k in g)p[k]=g[k];h=null}}();
+(function(){var g=s.createElement("div");g.innerHTML="<div class='test e'></div><div class='test'></div>";if(!(!g.getElementsByClassName||g.getElementsByClassName("e").length===0)){g.lastChild.className="e";if(g.getElementsByClassName("e").length!==1){n.order.splice(1,0,"CLASS");n.find.CLASS=function(h,k,m){if(typeof k.getElementsByClassName!=="undefined"&&!m)return k.getElementsByClassName(h[1])};g=null}}})();var F=s.compareDocumentPosition?function(g,h){return g.compareDocumentPosition(h)&16}:function(g,
+h){return g!==h&&(g.contains?g.contains(h):true)},x=function(g){return(g=(g?g.ownerDocument||g:0).documentElement)?g.nodeName!=="HTML":false},ia=function(g,h){var k=[],m="",r;for(h=h.nodeType?[h]:h;r=n.match.PSEUDO.exec(g);){m+=r[0];g=g.replace(n.match.PSEUDO,"")}g=n.relative[g]?g+"*":g;r=0;for(var q=h.length;r<q;r++)p(g,h[r],k);return p.filter(m,k)};c.find=p;c.expr=p.selectors;c.expr[":"]=c.expr.filters;c.unique=p.uniqueSort;c.getText=a;c.isXMLDoc=x;c.contains=F})();var ab=/Until$/,bb=/^(?:parents|prevUntil|prevAll)/,
+cb=/,/;R=Array.prototype.slice;var Fa=function(a,b,d){if(c.isFunction(b))return c.grep(a,function(e,i){return!!b.call(e,i,e)===d});else if(b.nodeType)return c.grep(a,function(e){return e===b===d});else if(typeof b==="string"){var f=c.grep(a,function(e){return e.nodeType===1});if(Pa.test(b))return c.filter(b,f,!d);else b=c.filter(b,a)}return c.grep(a,function(e){return c.inArray(e,b)>=0===d})};c.fn.extend({find:function(a){for(var b=this.pushStack("","find",a),d=0,f=0,e=this.length;f<e;f++){d=b.length;
+c.find(a,this[f],b);if(f>0)for(var i=d;i<b.length;i++)for(var j=0;j<d;j++)if(b[j]===b[i]){b.splice(i--,1);break}}return b},has:function(a){var b=c(a);return this.filter(function(){for(var d=0,f=b.length;d<f;d++)if(c.contains(this,b[d]))return true})},not:function(a){return this.pushStack(Fa(this,a,false),"not",a)},filter:function(a){return this.pushStack(Fa(this,a,true),"filter",a)},is:function(a){return!!a&&c.filter(a,this).length>0},closest:function(a,b){if(c.isArray(a)){var d=[],f=this[0],e,i=
+{},j;if(f&&a.length){e=0;for(var o=a.length;e<o;e++){j=a[e];i[j]||(i[j]=c.expr.match.POS.test(j)?c(j,b||this.context):j)}for(;f&&f.ownerDocument&&f!==b;){for(j in i){e=i[j];if(e.jquery?e.index(f)>-1:c(f).is(e)){d.push({selector:j,elem:f});delete i[j]}}f=f.parentNode}}return d}var p=c.expr.match.POS.test(a)?c(a,b||this.context):null;return this.map(function(n,t){for(;t&&t.ownerDocument&&t!==b;){if(p?p.index(t)>-1:c(t).is(a))return t;t=t.parentNode}return null})},index:function(a){if(!a||typeof a===
+"string")return c.inArray(this[0],a?c(a):this.parent().children());return c.inArray(a.jquery?a[0]:a,this)},add:function(a,b){a=typeof a==="string"?c(a,b||this.context):c.makeArray(a);b=c.merge(this.get(),a);return this.pushStack(sa(a[0])||sa(b[0])?b:c.unique(b))},andSelf:function(){return this.add(this.prevObject)}});c.each({parent:function(a){return(a=a.parentNode)&&a.nodeType!==11?a:null},parents:function(a){return c.dir(a,"parentNode")},parentsUntil:function(a,b,d){return c.dir(a,"parentNode",
+d)},next:function(a){return c.nth(a,2,"nextSibling")},prev:function(a){return c.nth(a,2,"previousSibling")},nextAll:function(a){return c.dir(a,"nextSibling")},prevAll:function(a){return c.dir(a,"previousSibling")},nextUntil:function(a,b,d){return c.dir(a,"nextSibling",d)},prevUntil:function(a,b,d){return c.dir(a,"previousSibling",d)},siblings:function(a){return c.sibling(a.parentNode.firstChild,a)},children:function(a){return c.sibling(a.firstChild)},contents:function(a){return c.nodeName(a,"iframe")?
+a.contentDocument||a.contentWindow.document:c.makeArray(a.childNodes)}},function(a,b){c.fn[a]=function(d,f){var e=c.map(this,b,d);ab.test(a)||(f=d);if(f&&typeof f==="string")e=c.filter(f,e);e=this.length>1?c.unique(e):e;if((this.length>1||cb.test(f))&&bb.test(a))e=e.reverse();return this.pushStack(e,a,R.call(arguments).join(","))}});c.extend({filter:function(a,b,d){if(d)a=":not("+a+")";return c.find.matches(a,b)},dir:function(a,b,d){var f=[];for(a=a[b];a&&a.nodeType!==9&&(d===w||!c(a).is(d));){a.nodeType===
+1&&f.push(a);a=a[b]}return f},nth:function(a,b,d){b=b||1;for(var f=0;a;a=a[d])if(a.nodeType===1&&++f===b)break;return a},sibling:function(a,b){for(var d=[];a;a=a.nextSibling)a.nodeType===1&&a!==b&&d.push(a);return d}});var Ga=/ jQuery\d+="(?:\d+|null)"/g,Y=/^\s+/,db=/(<([\w:]+)[^>]*?)\/>/g,eb=/^(?:area|br|col|embed|hr|img|input|link|meta|param)$/i,Ha=/<([\w:]+)/,fb=/<tbody/i,gb=/<|&\w+;/,hb=function(a,b,d){return eb.test(d)?a:b+"></"+d+">"},G={option:[1,"<select multiple='multiple'>","</select>"],
+legend:[1,"<fieldset>","</fieldset>"],thead:[1,"<table>","</table>"],tr:[2,"<table><tbody>","</tbody></table>"],td:[3,"<table><tbody><tr>","</tr></tbody></table>"],col:[2,"<table><tbody></tbody><colgroup>","</colgroup></table>"],area:[1,"<map>","</map>"],_default:[0,"",""]};G.optgroup=G.option;G.tbody=G.tfoot=G.colgroup=G.caption=G.thead;G.th=G.td;if(!c.support.htmlSerialize)G._default=[1,"div<div>","</div>"];c.fn.extend({text:function(a){if(c.isFunction(a))return this.each(function(b){var d=c(this);
+return d.text(a.call(this,b,d.text()))});if(typeof a!=="object"&&a!==w)return this.empty().append((this[0]&&this[0].ownerDocument||s).createTextNode(a));return c.getText(this)},wrapAll:function(a){if(c.isFunction(a))return this.each(function(d){c(this).wrapAll(a.call(this,d))});if(this[0]){var b=c(a,this[0].ownerDocument).eq(0).clone(true);this[0].parentNode&&b.insertBefore(this[0]);b.map(function(){for(var d=this;d.firstChild&&d.firstChild.nodeType===1;)d=d.firstChild;return d}).append(this)}return this},
+wrapInner:function(a){return this.each(function(){var b=c(this),d=b.contents();d.length?d.wrapAll(a):b.append(a)})},wrap:function(a){return this.each(function(){c(this).wrapAll(a)})},unwrap:function(){return this.parent().each(function(){c.nodeName(this,"body")||c(this).replaceWith(this.childNodes)}).end()},append:function(){return this.domManip(arguments,true,function(a){this.nodeType===1&&this.appendChild(a)})},prepend:function(){return this.domManip(arguments,true,function(a){this.nodeType===1&&
+this.insertBefore(a,this.firstChild)})},before:function(){if(this[0]&&this[0].parentNode)return this.domManip(arguments,false,function(b){this.parentNode.insertBefore(b,this)});else if(arguments.length){var a=c(arguments[0]);a.push.apply(a,this.toArray());return this.pushStack(a,"before",arguments)}},after:function(){if(this[0]&&this[0].parentNode)return this.domManip(arguments,false,function(b){this.parentNode.insertBefore(b,this.nextSibling)});else if(arguments.length){var a=this.pushStack(this,
+"after",arguments);a.push.apply(a,c(arguments[0]).toArray());return a}},clone:function(a){var b=this.map(function(){if(!c.support.noCloneEvent&&!c.isXMLDoc(this)){var d=this.outerHTML,f=this.ownerDocument;if(!d){d=f.createElement("div");d.appendChild(this.cloneNode(true));d=d.innerHTML}return c.clean([d.replace(Ga,"").replace(Y,"")],f)[0]}else return this.cloneNode(true)});if(a===true){ta(this,b);ta(this.find("*"),b.find("*"))}return b},html:function(a){if(a===w)return this[0]&&this[0].nodeType===
+1?this[0].innerHTML.replace(Ga,""):null;else if(typeof a==="string"&&!/<script/i.test(a)&&(c.support.leadingWhitespace||!Y.test(a))&&!G[(Ha.exec(a)||["",""])[1].toLowerCase()])try{for(var b=0,d=this.length;b<d;b++)if(this[b].nodeType===1){T(this[b].getElementsByTagName("*"));this[b].innerHTML=a}}catch(f){this.empty().append(a)}else c.isFunction(a)?this.each(function(e){var i=c(this),j=i.html();i.empty().append(function(){return a.call(this,e,j)})}):this.empty().append(a);return this},replaceWith:function(a){if(this[0]&&
+this[0].parentNode){c.isFunction(a)||(a=c(a).detach());return this.each(function(){var b=this.nextSibling,d=this.parentNode;c(this).remove();b?c(b).before(a):c(d).append(a)})}else return this.pushStack(c(c.isFunction(a)?a():a),"replaceWith",a)},detach:function(a){return this.remove(a,true)},domManip:function(a,b,d){function f(t){return c.nodeName(t,"table")?t.getElementsByTagName("tbody")[0]||t.appendChild(t.ownerDocument.createElement("tbody")):t}var e,i,j=a[0],o=[];if(c.isFunction(j))return this.each(function(t){var z=
+c(this);a[0]=j.call(this,t,b?z.html():w);return z.domManip(a,b,d)});if(this[0]){e=a[0]&&a[0].parentNode&&a[0].parentNode.nodeType===11?{fragment:a[0].parentNode}:ua(a,this,o);if(i=e.fragment.firstChild){b=b&&c.nodeName(i,"tr");for(var p=0,n=this.length;p<n;p++)d.call(b?f(this[p],i):this[p],e.cacheable||this.length>1||p>0?e.fragment.cloneNode(true):e.fragment)}o&&c.each(o,La)}return this}});c.fragments={};c.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},
+function(a,b){c.fn[a]=function(d){var f=[];d=c(d);for(var e=0,i=d.length;e<i;e++){var j=(e>0?this.clone(true):this).get();c.fn[b].apply(c(d[e]),j);f=f.concat(j)}return this.pushStack(f,a,d.selector)}});c.each({remove:function(a,b){if(!a||c.filter(a,[this]).length){if(!b&&this.nodeType===1){T(this.getElementsByTagName("*"));T([this])}this.parentNode&&this.parentNode.removeChild(this)}},empty:function(){for(this.nodeType===1&&T(this.getElementsByTagName("*"));this.firstChild;)this.removeChild(this.firstChild)}},
+function(a,b){c.fn[a]=function(){return this.each(b,arguments)}});c.extend({clean:function(a,b,d,f){b=b||s;if(typeof b.createElement==="undefined")b=b.ownerDocument||b[0]&&b[0].ownerDocument||s;var e=[];c.each(a,function(i,j){if(typeof j==="number")j+="";if(j){if(typeof j==="string"&&!gb.test(j))j=b.createTextNode(j);else if(typeof j==="string"){j=j.replace(db,hb);var o=(Ha.exec(j)||["",""])[1].toLowerCase(),p=G[o]||G._default,n=p[0];i=b.createElement("div");for(i.innerHTML=p[1]+j+p[2];n--;)i=i.lastChild;
+if(!c.support.tbody){n=fb.test(j);o=o==="table"&&!n?i.firstChild&&i.firstChild.childNodes:p[1]==="<table>"&&!n?i.childNodes:[];for(p=o.length-1;p>=0;--p)c.nodeName(o[p],"tbody")&&!o[p].childNodes.length&&o[p].parentNode.removeChild(o[p])}!c.support.leadingWhitespace&&Y.test(j)&&i.insertBefore(b.createTextNode(Y.exec(j)[0]),i.firstChild);j=c.makeArray(i.childNodes)}if(j.nodeType)e.push(j);else e=c.merge(e,j)}});if(d)for(a=0;e[a];a++)if(f&&c.nodeName(e[a],"script")&&(!e[a].type||e[a].type.toLowerCase()===
+"text/javascript"))f.push(e[a].parentNode?e[a].parentNode.removeChild(e[a]):e[a]);else{e[a].nodeType===1&&e.splice.apply(e,[a+1,0].concat(c.makeArray(e[a].getElementsByTagName("script"))));d.appendChild(e[a])}return e}});var ib=/z-?index|font-?weight|opacity|zoom|line-?height/i,Ia=/alpha\([^)]*\)/,Ja=/opacity=([^)]*)/,ja=/float/i,ka=/-([a-z])/ig,jb=/([A-Z])/g,kb=/^-?\d+(?:px)?$/i,lb=/^-?\d/,mb={position:"absolute",visibility:"hidden",display:"block"},nb=["Left","Right"],ob=["Top","Bottom"],pb=s.defaultView&&
+s.defaultView.getComputedStyle,Ka=c.support.cssFloat?"cssFloat":"styleFloat",la=function(a,b){return b.toUpperCase()};c.fn.css=function(a,b){return $(this,a,b,true,function(d,f,e){if(e===w)return c.curCSS(d,f);if(typeof e==="number"&&!ib.test(f))e+="px";c.style(d,f,e)})};c.extend({style:function(a,b,d){if(!a||a.nodeType===3||a.nodeType===8)return w;if((b==="width"||b==="height")&&parseFloat(d)<0)d=w;var f=a.style||a,e=d!==w;if(!c.support.opacity&&b==="opacity"){if(e){f.zoom=1;b=parseInt(d,10)+""===
+"NaN"?"":"alpha(opacity="+d*100+")";a=f.filter||c.curCSS(a,"filter")||"";f.filter=Ia.test(a)?a.replace(Ia,b):b}return f.filter&&f.filter.indexOf("opacity=")>=0?parseFloat(Ja.exec(f.filter)[1])/100+"":""}if(ja.test(b))b=Ka;b=b.replace(ka,la);if(e)f[b]=d;return f[b]},css:function(a,b,d,f){if(b==="width"||b==="height"){var e,i=b==="width"?nb:ob;function j(){e=b==="width"?a.offsetWidth:a.offsetHeight;f!=="border"&&c.each(i,function(){f||(e-=parseFloat(c.curCSS(a,"padding"+this,true))||0);if(f==="margin")e+=
+parseFloat(c.curCSS(a,"margin"+this,true))||0;else e-=parseFloat(c.curCSS(a,"border"+this+"Width",true))||0})}a.offsetWidth!==0?j():c.swap(a,mb,j);return Math.max(0,Math.round(e))}return c.curCSS(a,b,d)},curCSS:function(a,b,d){var f,e=a.style;if(!c.support.opacity&&b==="opacity"&&a.currentStyle){f=Ja.test(a.currentStyle.filter||"")?parseFloat(RegExp.$1)/100+"":"";return f===""?"1":f}if(ja.test(b))b=Ka;if(!d&&e&&e[b])f=e[b];else if(pb){if(ja.test(b))b="float";b=b.replace(jb,"-$1").toLowerCase();e=
+a.ownerDocument.defaultView;if(!e)return null;if(a=e.getComputedStyle(a,null))f=a.getPropertyValue(b);if(b==="opacity"&&f==="")f="1"}else if(a.currentStyle){d=b.replace(ka,la);f=a.currentStyle[b]||a.currentStyle[d];if(!kb.test(f)&&lb.test(f)){b=e.left;var i=a.runtimeStyle.left;a.runtimeStyle.left=a.currentStyle.left;e.left=d==="fontSize"?"1em":f||0;f=e.pixelLeft+"px";e.left=b;a.runtimeStyle.left=i}}return f},swap:function(a,b,d){var f={};for(var e in b){f[e]=a.style[e];a.style[e]=b[e]}d.call(a);for(e in b)a.style[e]=
+f[e]}});if(c.expr&&c.expr.filters){c.expr.filters.hidden=function(a){var b=a.offsetWidth,d=a.offsetHeight,f=a.nodeName.toLowerCase()==="tr";return b===0&&d===0&&!f?true:b>0&&d>0&&!f?false:c.curCSS(a,"display")==="none"};c.expr.filters.visible=function(a){return!c.expr.filters.hidden(a)}}var qb=K(),rb=/<script(.|\s)*?\/script>/gi,sb=/select|textarea/i,tb=/color|date|datetime|email|hidden|month|number|password|range|search|tel|text|time|url|week/i,O=/=\?(&|$)/,ma=/\?/,ub=/(\?|&)_=.*?(&|$)/,vb=/^(\w+:)?\/\/([^\/?#]+)/,
+wb=/%20/g;c.fn.extend({_load:c.fn.load,load:function(a,b,d){if(typeof a!=="string")return this._load(a);else if(!this.length)return this;var f=a.indexOf(" ");if(f>=0){var e=a.slice(f,a.length);a=a.slice(0,f)}f="GET";if(b)if(c.isFunction(b)){d=b;b=null}else if(typeof b==="object"){b=c.param(b,c.ajaxSettings.traditional);f="POST"}c.ajax({url:a,type:f,dataType:"html",data:b,context:this,complete:function(i,j){if(j==="success"||j==="notmodified")this.html(e?c("<div />").append(i.responseText.replace(rb,
+"")).find(e):i.responseText);d&&this.each(d,[i.responseText,j,i])}});return this},serialize:function(){return c.param(this.serializeArray())},serializeArray:function(){return this.map(function(){return this.elements?c.makeArray(this.elements):this}).filter(function(){return this.name&&!this.disabled&&(this.checked||sb.test(this.nodeName)||tb.test(this.type))}).map(function(a,b){a=c(this).val();return a==null?null:c.isArray(a)?c.map(a,function(d){return{name:b.name,value:d}}):{name:b.name,value:a}}).get()}});
+c.each("ajaxStart ajaxStop ajaxComplete ajaxError ajaxSuccess ajaxSend".split(" "),function(a,b){c.fn[b]=function(d){return this.bind(b,d)}});c.extend({get:function(a,b,d,f){if(c.isFunction(b)){f=f||d;d=b;b=null}return c.ajax({type:"GET",url:a,data:b,success:d,dataType:f})},getScript:function(a,b){return c.get(a,null,b,"script")},getJSON:function(a,b,d){return c.get(a,b,d,"json")},post:function(a,b,d,f){if(c.isFunction(b)){f=f||d;d=b;b={}}return c.ajax({type:"POST",url:a,data:b,success:d,dataType:f})},
+ajaxSetup:function(a){c.extend(c.ajaxSettings,a)},ajaxSettings:{url:location.href,global:true,type:"GET",contentType:"application/x-www-form-urlencoded",processData:true,async:true,xhr:A.XMLHttpRequest&&(A.location.protocol!=="file:"||!A.ActiveXObject)?function(){return new A.XMLHttpRequest}:function(){try{return new A.ActiveXObject("Microsoft.XMLHTTP")}catch(a){}},accepts:{xml:"application/xml, text/xml",html:"text/html",script:"text/javascript, application/javascript",json:"application/json, text/javascript",
+text:"text/plain",_default:"*/*"}},lastModified:{},etag:{},ajax:function(a){function b(){e.success&&e.success.call(p,o,j,x);e.global&&f("ajaxSuccess",[x,e])}function d(){e.complete&&e.complete.call(p,x,j);e.global&&f("ajaxComplete",[x,e]);e.global&&!--c.active&&c.event.trigger("ajaxStop")}function f(r,q){(e.context?c(e.context):c.event).trigger(r,q)}var e=c.extend(true,{},c.ajaxSettings,a),i,j,o,p=e.context||e,n=e.type.toUpperCase();if(e.data&&e.processData&&typeof e.data!=="string")e.data=c.param(e.data,
+e.traditional);if(e.dataType==="jsonp"){if(n==="GET")O.test(e.url)||(e.url+=(ma.test(e.url)?"&":"?")+(e.jsonp||"callback")+"=?");else if(!e.data||!O.test(e.data))e.data=(e.data?e.data+"&":"")+(e.jsonp||"callback")+"=?";e.dataType="json"}if(e.dataType==="json"&&(e.data&&O.test(e.data)||O.test(e.url))){i=e.jsonpCallback||"jsonp"+qb++;if(e.data)e.data=(e.data+"").replace(O,"="+i+"$1");e.url=e.url.replace(O,"="+i+"$1");e.dataType="script";A[i]=A[i]||function(r){o=r;b();d();A[i]=w;try{delete A[i]}catch(q){}B&&
+B.removeChild(C)}}if(e.dataType==="script"&&e.cache===null)e.cache=false;if(e.cache===false&&n==="GET"){var t=K(),z=e.url.replace(ub,"$1_="+t+"$2");e.url=z+(z===e.url?(ma.test(e.url)?"&":"?")+"_="+t:"")}if(e.data&&n==="GET")e.url+=(ma.test(e.url)?"&":"?")+e.data;e.global&&!c.active++&&c.event.trigger("ajaxStart");t=(t=vb.exec(e.url))&&(t[1]&&t[1]!==location.protocol||t[2]!==location.host);if(e.dataType==="script"&&n==="GET"&&t){var B=s.getElementsByTagName("head")[0]||s.documentElement,C=s.createElement("script");
+C.src=e.url;if(e.scriptCharset)C.charset=e.scriptCharset;if(!i){var D=false;C.onload=C.onreadystatechange=function(){if(!D&&(!this.readyState||this.readyState==="loaded"||this.readyState==="complete")){D=true;b();d();C.onload=C.onreadystatechange=null;B&&C.parentNode&&B.removeChild(C)}}}B.insertBefore(C,B.firstChild);return w}var F=false,x=e.xhr();if(x){e.username?x.open(n,e.url,e.async,e.username,e.password):x.open(n,e.url,e.async);try{if(e.data||a&&a.contentType)x.setRequestHeader("Content-Type",
+e.contentType);if(e.ifModified){c.lastModified[e.url]&&x.setRequestHeader("If-Modified-Since",c.lastModified[e.url]);c.etag[e.url]&&x.setRequestHeader("If-None-Match",c.etag[e.url])}t||x.setRequestHeader("X-Requested-With","XMLHttpRequest");x.setRequestHeader("Accept",e.dataType&&e.accepts[e.dataType]?e.accepts[e.dataType]+", */*":e.accepts._default)}catch(ia){}if(e.beforeSend&&e.beforeSend.call(p,x,e)===false){e.global&&!--c.active&&c.event.trigger("ajaxStop");x.abort();return false}e.global&&f("ajaxSend",
+[x,e]);var g=x.onreadystatechange=function(r){if(!x||x.readyState===0){F||d();F=true;if(x)x.onreadystatechange=c.noop}else if(!F&&x&&(x.readyState===4||r==="timeout")){F=true;x.onreadystatechange=c.noop;j=r==="timeout"?"timeout":!c.httpSuccess(x)?"error":e.ifModified&&c.httpNotModified(x,e.url)?"notmodified":"success";if(j==="success")try{o=c.httpData(x,e.dataType,e)}catch(q){j="parsererror"}if(j==="success"||j==="notmodified")i||b();else c.handleError(e,x,j);d();r==="timeout"&&x.abort();if(e.async)x=
+null}};try{var h=x.abort;x.abort=function(){if(x){h.call(x);if(x)x.readyState=0}g()}}catch(k){}e.async&&e.timeout>0&&setTimeout(function(){x&&!F&&g("timeout")},e.timeout);try{x.send(n==="POST"||n==="PUT"||n==="DELETE"?e.data:null)}catch(m){c.handleError(e,x,null,m);d()}e.async||g();return x}},handleError:function(a,b,d,f){if(a.error)a.error.call(a.context||A,b,d,f);if(a.global)(a.context?c(a.context):c.event).trigger("ajaxError",[b,a,f])},active:0,httpSuccess:function(a){try{return!a.status&&location.protocol===
+"file:"||a.status>=200&&a.status<300||a.status===304||a.status===1223||a.status===0}catch(b){}return false},httpNotModified:function(a,b){var d=a.getResponseHeader("Last-Modified"),f=a.getResponseHeader("Etag");if(d)c.lastModified[b]=d;if(f)c.etag[b]=f;return a.status===304||a.status===0},httpData:function(a,b,d){var f=a.getResponseHeader("content-type")||"",e=b==="xml"||!b&&f.indexOf("xml")>=0;a=e?a.responseXML:a.responseText;if(e&&a.documentElement.nodeName==="parsererror")throw"parsererror";if(d&&
+d.dataFilter)a=d.dataFilter(a,b);if(typeof a==="string")if(b==="json"||!b&&f.indexOf("json")>=0)if(/^[\],:{}\s]*$/.test(a.replace(/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,"@").replace(/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,"]").replace(/(?:^|:|,)(?:\s*\[)+/g,"")))a=A.JSON&&A.JSON.parse?A.JSON.parse(a):(new Function("return "+a))();else throw"Invalid JSON: "+a;else if(b==="script"||!b&&f.indexOf("javascript")>=0)c.globalEval(a);return a},param:function(a,b){function d(e,i){i=
+c.isFunction(i)?i():i;f[f.length]=encodeURIComponent(e)+"="+encodeURIComponent(i)}var f=[];if(b===w)b=c.ajaxSettings.traditional;c.isArray(a)||a.jquery?c.each(a,function(){d(this.name,this.value)}):c.each(a,function e(i,j){if(c.isArray(j))c.each(j,function(o,p){b?d(i,p):e(i+"["+(typeof p==="object"||c.isArray(p)?o:"")+"]",p)});else!b&&j!=null&&typeof j==="object"?c.each(j,function(o,p){e(i+"["+o+"]",p)}):d(i,j)});return f.join("&").replace(wb,"+")}});var na={},xb=/toggle|show|hide/,yb=/^([+-]=)?([\d+-.]+)(.*)$/,
+Z,va=[["height","marginTop","marginBottom","paddingTop","paddingBottom"],["width","marginLeft","marginRight","paddingLeft","paddingRight"],["opacity"]];c.fn.extend({show:function(a,b){if(a!=null)return this.animate(L("show",3),a,b);else{a=0;for(b=this.length;a<b;a++){var d=c.data(this[a],"olddisplay");this[a].style.display=d||"";if(c.css(this[a],"display")==="none"){d=this[a].nodeName;var f;if(na[d])f=na[d];else{var e=c("<"+d+" />").appendTo("body");f=e.css("display");if(f==="none")f="block";e.remove();
+na[d]=f}c.data(this[a],"olddisplay",f)}}a=0;for(b=this.length;a<b;a++)this[a].style.display=c.data(this[a],"olddisplay")||"";return this}},hide:function(a,b){if(a!=null)return this.animate(L("hide",3),a,b);else{a=0;for(b=this.length;a<b;a++){var d=c.data(this[a],"olddisplay");!d&&d!=="none"&&c.data(this[a],"olddisplay",c.css(this[a],"display"))}a=0;for(b=this.length;a<b;a++)this[a].style.display="none";return this}},_toggle:c.fn.toggle,toggle:function(a,b){var d=typeof a==="boolean";if(c.isFunction(a)&&
+c.isFunction(b))this._toggle.apply(this,arguments);else a==null||d?this.each(function(){var f=d?a:c(this).is(":hidden");c(this)[f?"show":"hide"]()}):this.animate(L("toggle",3),a,b);return this},fadeTo:function(a,b,d){return this.filter(":hidden").css("opacity",0).show().end().animate({opacity:b},a,d)},animate:function(a,b,d,f){var e=c.speed(b,d,f);if(c.isEmptyObject(a))return this.each(e.complete);return this[e.queue===false?"each":"queue"](function(){var i=c.extend({},e),j,o=this.nodeType===1&&c(this).is(":hidden"),
+p=this;for(j in a){var n=j.replace(ka,la);if(j!==n){a[n]=a[j];delete a[j];j=n}if(a[j]==="hide"&&o||a[j]==="show"&&!o)return i.complete.call(this);if((j==="height"||j==="width")&&this.style){i.display=c.css(this,"display");i.overflow=this.style.overflow}if(c.isArray(a[j])){(i.specialEasing=i.specialEasing||{})[j]=a[j][1];a[j]=a[j][0]}}if(i.overflow!=null)this.style.overflow="hidden";i.curAnim=c.extend({},a);c.each(a,function(t,z){var B=new c.fx(p,i,t);if(xb.test(z))B[z==="toggle"?o?"show":"hide":z](a);
+else{var C=yb.exec(z),D=B.cur(true)||0;if(C){z=parseFloat(C[2]);var F=C[3]||"px";if(F!=="px"){p.style[t]=(z||1)+F;D=(z||1)/B.cur(true)*D;p.style[t]=D+F}if(C[1])z=(C[1]==="-="?-1:1)*z+D;B.custom(D,z,F)}else B.custom(D,z,"")}});return true})},stop:function(a,b){var d=c.timers;a&&this.queue([]);this.each(function(){for(var f=d.length-1;f>=0;f--)if(d[f].elem===this){b&&d[f](true);d.splice(f,1)}});b||this.dequeue();return this}});c.each({slideDown:L("show",1),slideUp:L("hide",1),slideToggle:L("toggle",
+1),fadeIn:{opacity:"show"},fadeOut:{opacity:"hide"}},function(a,b){c.fn[a]=function(d,f){return this.animate(b,d,f)}});c.extend({speed:function(a,b,d){var f=a&&typeof a==="object"?a:{complete:d||!d&&b||c.isFunction(a)&&a,duration:a,easing:d&&b||b&&!c.isFunction(b)&&b};f.duration=c.fx.off?0:typeof f.duration==="number"?f.duration:c.fx.speeds[f.duration]||c.fx.speeds._default;f.old=f.complete;f.complete=function(){f.queue!==false&&c(this).dequeue();c.isFunction(f.old)&&f.old.call(this)};return f},easing:{linear:function(a,
+b,d,f){return d+f*a},swing:function(a,b,d,f){return(-Math.cos(a*Math.PI)/2+0.5)*f+d}},timers:[],fx:function(a,b,d){this.options=b;this.elem=a;this.prop=d;if(!b.orig)b.orig={}}});c.fx.prototype={update:function(){this.options.step&&this.options.step.call(this.elem,this.now,this);(c.fx.step[this.prop]||c.fx.step._default)(this);if((this.prop==="height"||this.prop==="width")&&this.elem.style)this.elem.style.display="block"},cur:function(a){if(this.elem[this.prop]!=null&&(!this.elem.style||this.elem.style[this.prop]==
+null))return this.elem[this.prop];return(a=parseFloat(c.css(this.elem,this.prop,a)))&&a>-10000?a:parseFloat(c.curCSS(this.elem,this.prop))||0},custom:function(a,b,d){function f(i){return e.step(i)}this.startTime=K();this.start=a;this.end=b;this.unit=d||this.unit||"px";this.now=this.start;this.pos=this.state=0;var e=this;f.elem=this.elem;if(f()&&c.timers.push(f)&&!Z)Z=setInterval(c.fx.tick,13)},show:function(){this.options.orig[this.prop]=c.style(this.elem,this.prop);this.options.show=true;this.custom(this.prop===
+"width"||this.prop==="height"?1:0,this.cur());c(this.elem).show()},hide:function(){this.options.orig[this.prop]=c.style(this.elem,this.prop);this.options.hide=true;this.custom(this.cur(),0)},step:function(a){var b=K(),d=true;if(a||b>=this.options.duration+this.startTime){this.now=this.end;this.pos=this.state=1;this.update();this.options.curAnim[this.prop]=true;for(var f in this.options.curAnim)if(this.options.curAnim[f]!==true)d=false;if(d){if(this.options.display!=null){this.elem.style.overflow=
+this.options.overflow;a=c.data(this.elem,"olddisplay");this.elem.style.display=a?a:this.options.display;if(c.css(this.elem,"display")==="none")this.elem.style.display="block"}this.options.hide&&c(this.elem).hide();if(this.options.hide||this.options.show)for(var e in this.options.curAnim)c.style(this.elem,e,this.options.orig[e]);this.options.complete.call(this.elem)}return false}else{e=b-this.startTime;this.state=e/this.options.duration;a=this.options.easing||(c.easing.swing?"swing":"linear");this.pos=
+c.easing[this.options.specialEasing&&this.options.specialEasing[this.prop]||a](this.state,e,0,1,this.options.duration);this.now=this.start+(this.end-this.start)*this.pos;this.update()}return true}};c.extend(c.fx,{tick:function(){for(var a=c.timers,b=0;b<a.length;b++)a[b]()||a.splice(b--,1);a.length||c.fx.stop()},stop:function(){clearInterval(Z);Z=null},speeds:{slow:600,fast:200,_default:400},step:{opacity:function(a){c.style(a.elem,"opacity",a.now)},_default:function(a){if(a.elem.style&&a.elem.style[a.prop]!=
+null)a.elem.style[a.prop]=(a.prop==="width"||a.prop==="height"?Math.max(0,a.now):a.now)+a.unit;else a.elem[a.prop]=a.now}}});if(c.expr&&c.expr.filters)c.expr.filters.animated=function(a){return c.grep(c.timers,function(b){return a===b.elem}).length};c.fn.offset="getBoundingClientRect"in s.documentElement?function(a){var b=this[0];if(!b||!b.ownerDocument)return null;if(a)return this.each(function(e){c.offset.setOffset(this,a,e)});if(b===b.ownerDocument.body)return c.offset.bodyOffset(b);var d=b.getBoundingClientRect(),
+f=b.ownerDocument;b=f.body;f=f.documentElement;return{top:d.top+(self.pageYOffset||c.support.boxModel&&f.scrollTop||b.scrollTop)-(f.clientTop||b.clientTop||0),left:d.left+(self.pageXOffset||c.support.boxModel&&f.scrollLeft||b.scrollLeft)-(f.clientLeft||b.clientLeft||0)}}:function(a){var b=this[0];if(!b||!b.ownerDocument)return null;if(a)return this.each(function(t){c.offset.setOffset(this,a,t)});if(b===b.ownerDocument.body)return c.offset.bodyOffset(b);c.offset.initialize();var d=b.offsetParent,f=
+b,e=b.ownerDocument,i,j=e.documentElement,o=e.body;f=(e=e.defaultView)?e.getComputedStyle(b,null):b.currentStyle;for(var p=b.offsetTop,n=b.offsetLeft;(b=b.parentNode)&&b!==o&&b!==j;){if(c.offset.supportsFixedPosition&&f.position==="fixed")break;i=e?e.getComputedStyle(b,null):b.currentStyle;p-=b.scrollTop;n-=b.scrollLeft;if(b===d){p+=b.offsetTop;n+=b.offsetLeft;if(c.offset.doesNotAddBorder&&!(c.offset.doesAddBorderForTableAndCells&&/^t(able|d|h)$/i.test(b.nodeName))){p+=parseFloat(i.borderTopWidth)||
+0;n+=parseFloat(i.borderLeftWidth)||0}f=d;d=b.offsetParent}if(c.offset.subtractsBorderForOverflowNotVisible&&i.overflow!=="visible"){p+=parseFloat(i.borderTopWidth)||0;n+=parseFloat(i.borderLeftWidth)||0}f=i}if(f.position==="relative"||f.position==="static"){p+=o.offsetTop;n+=o.offsetLeft}if(c.offset.supportsFixedPosition&&f.position==="fixed"){p+=Math.max(j.scrollTop,o.scrollTop);n+=Math.max(j.scrollLeft,o.scrollLeft)}return{top:p,left:n}};c.offset={initialize:function(){var a=s.body,b=s.createElement("div"),
+d,f,e,i=parseFloat(c.curCSS(a,"marginTop",true))||0;c.extend(b.style,{position:"absolute",top:0,left:0,margin:0,border:0,width:"1px",height:"1px",visibility:"hidden"});b.innerHTML="<div style='position:absolute;top:0;left:0;margin:0;border:5px solid #000;padding:0;width:1px;height:1px;'><div></div></div><table style='position:absolute;top:0;left:0;margin:0;border:5px solid #000;padding:0;width:1px;height:1px;' cellpadding='0' cellspacing='0'><tr><td></td></tr></table>";a.insertBefore(b,a.firstChild);
+d=b.firstChild;f=d.firstChild;e=d.nextSibling.firstChild.firstChild;this.doesNotAddBorder=f.offsetTop!==5;this.doesAddBorderForTableAndCells=e.offsetTop===5;f.style.position="fixed";f.style.top="20px";this.supportsFixedPosition=f.offsetTop===20||f.offsetTop===15;f.style.position=f.style.top="";d.style.overflow="hidden";d.style.position="relative";this.subtractsBorderForOverflowNotVisible=f.offsetTop===-5;this.doesNotIncludeMarginInBodyOffset=a.offsetTop!==i;a.removeChild(b);c.offset.initialize=c.noop},
+bodyOffset:function(a){var b=a.offsetTop,d=a.offsetLeft;c.offset.initialize();if(c.offset.doesNotIncludeMarginInBodyOffset){b+=parseFloat(c.curCSS(a,"marginTop",true))||0;d+=parseFloat(c.curCSS(a,"marginLeft",true))||0}return{top:b,left:d}},setOffset:function(a,b,d){if(/static/.test(c.curCSS(a,"position")))a.style.position="relative";var f=c(a),e=f.offset(),i=parseInt(c.curCSS(a,"top",true),10)||0,j=parseInt(c.curCSS(a,"left",true),10)||0;if(c.isFunction(b))b=b.call(a,d,e);d={top:b.top-e.top+i,left:b.left-
+e.left+j};"using"in b?b.using.call(a,d):f.css(d)}};c.fn.extend({position:function(){if(!this[0])return null;var a=this[0],b=this.offsetParent(),d=this.offset(),f=/^body|html$/i.test(b[0].nodeName)?{top:0,left:0}:b.offset();d.top-=parseFloat(c.curCSS(a,"marginTop",true))||0;d.left-=parseFloat(c.curCSS(a,"marginLeft",true))||0;f.top+=parseFloat(c.curCSS(b[0],"borderTopWidth",true))||0;f.left+=parseFloat(c.curCSS(b[0],"borderLeftWidth",true))||0;return{top:d.top-f.top,left:d.left-f.left}},offsetParent:function(){return this.map(function(){for(var a=
+this.offsetParent||s.body;a&&!/^body|html$/i.test(a.nodeName)&&c.css(a,"position")==="static";)a=a.offsetParent;return a})}});c.each(["Left","Top"],function(a,b){var d="scroll"+b;c.fn[d]=function(f){var e=this[0],i;if(!e)return null;if(f!==w)return this.each(function(){if(i=wa(this))i.scrollTo(!a?f:c(i).scrollLeft(),a?f:c(i).scrollTop());else this[d]=f});else return(i=wa(e))?"pageXOffset"in i?i[a?"pageYOffset":"pageXOffset"]:c.support.boxModel&&i.document.documentElement[d]||i.document.body[d]:e[d]}});
+c.each(["Height","Width"],function(a,b){var d=b.toLowerCase();c.fn["inner"+b]=function(){return this[0]?c.css(this[0],d,false,"padding"):null};c.fn["outer"+b]=function(f){return this[0]?c.css(this[0],d,false,f?"margin":"border"):null};c.fn[d]=function(f){var e=this[0];if(!e)return f==null?null:this;return"scrollTo"in e&&e.document?e.document.compatMode==="CSS1Compat"&&e.document.documentElement["client"+b]||e.document.body["client"+b]:e.nodeType===9?Math.max(e.documentElement["client"+b],e.body["scroll"+
+b],e.documentElement["scroll"+b],e.body["offset"+b],e.documentElement["offset"+b]):f===w?c.css(e,d):this.css(d,typeof f==="string"?f:f+"px")}});A.jQuery=A.$=c})(window);
diff --git a/sphinx/themes/basic/static/searchtools.js b/sphinx/themes/basic/static/searchtools.js
index f679a7544..b96ff3d2e 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
@@ -20,7 +31,7 @@ jQuery.makeSearchSummary = function(text, keywords, hlwords) {
((start + 240 - text.length) ? '...' : '');
var rv = $('<div class="context"></div>').text(excerpt);
$.each(hlwords, function() {
- rv = rv.highlightText(this, 'highlight');
+ rv = rv.highlightText(this, 'highlighted');
});
return rv;
}
@@ -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,9 +312,11 @@ var Search = {
var tmp = query.split(/\s+/);
var object = (tmp.length == 1) ? tmp[0].toLowerCase() : null;
for (var i = 0; i < tmp.length; i++) {
- // ignore leading/trailing whitespace
- if (tmp[i] == "")
+ if ($u.indexOf(stopwords, tmp[i]) != -1 || tmp[i].match(/^\d+$/) ||
+ tmp[i] == "") {
+ // skip this "word"
continue;
+ }
// stem the word
var word = stemmer.stemWord(tmp[i]).toLowerCase();
// select the correct list
@@ -316,39 +334,42 @@ var Search = {
};
var highlightstring = '?highlight=' + $.urlencode(hlterms.join(" "));
- console.debug('SEARCH: searching for:');
- console.info('required: ', searchterms);
- console.info('excluded: ', excluded);
+ // console.debug('SEARCH: searching for:');
+ // console.info('required: ', searchterms);
+ // console.info('excluded: ', excluded);
// prepare search
var filenames = this._index.filenames;
var titles = this._index.titles;
var terms = this._index.terms;
- var descrefs = this._index.descrefs;
- var modules = this._index.modules;
- var desctypes = this._index.desctypes;
+ var objects = this._index.objects;
+ var objtypes = this._index.objtypes;
+ var objnames = this._index.objnames;
var fileMap = {};
var files = null;
+ // different result priorities
+ var importantResults = [];
var objectResults = [];
var regularResults = [];
+ var unimportantResults = [];
$('#search-progress').empty();
// lookup as object
if (object != null) {
- for (var module in modules) {
- if (module.indexOf(object) > -1) {
- fn = modules[module];
- descr = _('module, in ') + titles[fn];
- objectResults.push([filenames[fn], module, '#module-'+module, descr]);
- }
- }
- for (var prefix in descrefs) {
- for (var name in descrefs[prefix]) {
+ for (var prefix in objects) {
+ for (var name in objects[prefix]) {
var fullname = (prefix ? prefix + '.' : '') + name;
if (fullname.toLowerCase().indexOf(object) > -1) {
- match = descrefs[prefix][name];
- descr = desctypes[match[1]] + _(', in ') + titles[match[0]];
- objectResults.push([filenames[match[0]], fullname, '#'+fullname, descr]);
+ match = objects[prefix][name];
+ descr = objnames[match[1]] + _(', in ') + titles[match[0]];
+ // XXX the generated anchors are not generally correct
+ // XXX there may be custom prefixes
+ result = [filenames[match[0]], fullname, '#'+fullname, descr];
+ switch (match[2]) {
+ case 1: objectResults.push(result); break;
+ case 0: importantResults.push(result); break;
+ case 2: unimportantResults.push(result); break;
+ }
}
}
}
@@ -359,6 +380,14 @@ var Search = {
return (a[1] > b[1]) ? -1 : ((a[1] < b[1]) ? 1 : 0);
});
+ importantResults.sort(function(a, b) {
+ return (a[1] > b[1]) ? -1 : ((a[1] < b[1]) ? 1 : 0);
+ });
+
+ unimportantResults.sort(function(a, b) {
+ return (a[1] > b[1]) ? -1 : ((a[1] < b[1]) ? 1 : 0);
+ });
+
// perform the search on the required terms
for (var i = 0; i < searchterms.length; i++) {
@@ -414,8 +443,9 @@ var Search = {
return (left > right) ? -1 : ((left < right) ? 1 : 0);
});
- // combine both
- var results = regularResults.concat(objectResults);
+ // combine all results
+ var results = unimportantResults.concat(regularResults)
+ .concat(objectResults).concat(importantResults);
// print the results
var resultCount = results.length;
@@ -437,11 +467,13 @@ var Search = {
} else if (DOCUMENTATION_OPTIONS.HAS_SOURCE) {
$.get(DOCUMENTATION_OPTIONS.URL_ROOT + '_sources/' +
item[0] + '.txt', function(data) {
- listItem.append($.makeSearchSummary(data, searchterms, hlterms));
- Search.output.append(listItem);
- listItem.slideDown(5, function() {
- displayNextItem();
- });
+ if (data != '') {
+ listItem.append($.makeSearchSummary(data, searchterms, hlterms));
+ Search.output.append(listItem);
+ listItem.slideDown(5, function() {
+ displayNextItem();
+ });
+ }
});
} else {
// no source available, just display title
diff --git a/sphinx/themes/basic/static/underscore.js b/sphinx/themes/basic/static/underscore.js
new file mode 100644
index 000000000..9146e0860
--- /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/layout.html b/sphinx/themes/default/layout.html
new file mode 100644
index 000000000..43ee2cdf4
--- /dev/null
+++ b/sphinx/themes/default/layout.html
@@ -0,0 +1,14 @@
+{#
+ default/layout.html
+ ~~~~~~~~~~~~~~~~~~~
+
+ Sphinx layout template for the default theme.
+
+ :copyright: Copyright 2007-2010 by the Sphinx team, see AUTHORS.
+ :license: BSD, see LICENSE for details.
+#}
+{% extends "basic/layout.html" %}
+
+{% if theme_collapsiblesidebar|tobool %}
+{% set script_files = script_files + ['_static/sidebar.js'] %}
+{% endif %}
diff --git a/sphinx/themes/default/static/default.css_t b/sphinx/themes/default/static/default.css_t
index 5f4a4c6fa..f200a0fea 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");
@@ -141,21 +147,36 @@ div.sphinxsidebar input {
font-size: 1em;
}
-/* -- body styles ----------------------------------------------------------- */
+
+/* -- hyperlink styles ------------------------------------------------------ */
a {
color: {{ theme_linkcolor }};
text-decoration: none;
}
+a:visited {
+ color: {{ theme_visitedlinkcolor }};
+ text-decoration: none;
+}
+
a:hover {
text-decoration: underline;
}
-div.body p, div.body dd, div.body li {
- text-align: justify;
- line-height: 130%;
+{% if theme_externalrefs|tobool %}
+a.external {
+ text-decoration: none;
+ border-bottom: 1px dashed {{ theme_linkcolor }};
+}
+
+a.external:hover {
+ text-decoration: none;
+ border-bottom: none;
}
+{% endif %}
+
+/* -- body styles ----------------------------------------------------------- */
div.body h1,
div.body h2,
@@ -255,6 +276,10 @@ tt {
font-size: 0.95em;
}
+th {
+ background-color: #ede;
+}
+
.warning tt {
background: #efc2c2;
}
@@ -262,3 +287,13 @@ tt {
.note tt {
background: #d6d6d6;
}
+
+.viewcode-back {
+ font-family: {{ theme_bodyfont }};
+}
+
+div.viewcode-block:target {
+ background-color: #f4debf;
+ border-top: 1px solid #ac9;
+ border-bottom: 1px solid #ac9;
+}
diff --git a/sphinx/themes/default/static/sidebar.js b/sphinx/themes/default/static/sidebar.js
new file mode 100644
index 000000000..be206ede9
--- /dev/null
+++ b/sphinx/themes/default/static/sidebar.js
@@ -0,0 +1,147 @@
+/*
+ * sidebar.js
+ * ~~~~~~~~~~
+ *
+ * This script makes the Sphinx sidebar collapsible.
+ *
+ * .sphinxsidebar contains .sphinxsidebarwrapper. This script adds
+ * in .sphixsidebar, after .sphinxsidebarwrapper, the #sidebarbutton
+ * used to collapse and expand the sidebar.
+ *
+ * When the sidebar is collapsed the .sphinxsidebarwrapper is hidden
+ * and the width of the sidebar and the margin-left of the document
+ * are decreased. When the sidebar is expanded the opposite happens.
+ * This script saves a per-browser/per-session cookie used to
+ * remember the position of the sidebar among the pages.
+ * Once the browser is closed the cookie is deleted and the position
+ * reset to the default (expanded).
+ *
+ * :copyright: Copyright 2007-2010 by the Sphinx team, see AUTHORS.
+ * :license: BSD, see LICENSE for details.
+ *
+ */
+
+$(function() {
+ // global elements used by the functions.
+ // the 'sidebarbutton' element is defined as global after its
+ // creation, in the add_sidebar_button function
+ var bodywrapper = $('.bodywrapper');
+ var sidebar = $('.sphinxsidebar');
+ var sidebarwrapper = $('.sphinxsidebarwrapper');
+
+ // original margin-left of the bodywrapper and width of the sidebar
+ // with the sidebar expanded
+ var bw_margin_expanded = bodywrapper.css('margin-left');
+ var ssb_width_expanded = sidebar.width();
+
+ // margin-left of the bodywrapper and width of the sidebar
+ // with the sidebar collapsed
+ var bw_margin_collapsed = '.8em';
+ var ssb_width_collapsed = '.8em';
+
+ // colors used by the current theme
+ var dark_color = $('.related').css('background-color');
+ var light_color = $('.document').css('background-color');
+
+ function sidebar_is_collapsed() {
+ return sidebarwrapper.is(':not(:visible)');
+ }
+
+ function toggle_sidebar() {
+ if (sidebar_is_collapsed())
+ expand_sidebar();
+ else
+ collapse_sidebar();
+ }
+
+ function collapse_sidebar() {
+ sidebarwrapper.hide();
+ sidebar.css('width', ssb_width_collapsed);
+ bodywrapper.css('margin-left', bw_margin_collapsed);
+ sidebarbutton.css({
+ 'margin-left': '0',
+ 'height': bodywrapper.height()
+ });
+ sidebarbutton.find('span').text('»');
+ sidebarbutton.attr('title', _('Expand sidebar'));
+ document.cookie = 'sidebar=collapsed';
+ }
+
+ function expand_sidebar() {
+ bodywrapper.css('margin-left', bw_margin_expanded);
+ sidebar.css('width', ssb_width_expanded);
+ sidebarwrapper.show();
+ sidebarbutton.css({
+ 'margin-left': ssb_width_expanded-12,
+ 'height': bodywrapper.height()
+ });
+ sidebarbutton.find('span').text('«');
+ sidebarbutton.attr('title', _('Collapse sidebar'));
+ document.cookie = 'sidebar=expanded';
+ }
+
+ function add_sidebar_button() {
+ sidebarwrapper.css({
+ 'float': 'left',
+ 'margin-right': '0',
+ 'width': ssb_width_expanded - 28
+ });
+ // create the button
+ sidebar.append(
+ '<div id="sidebarbutton"><span>&laquo;</span></div>'
+ );
+ var sidebarbutton = $('#sidebarbutton');
+ // find the height of the viewport to center the '<<' in the page
+ var viewport_height;
+ if (window.innerHeight)
+ viewport_height = window.innerHeight;
+ else
+ viewport_height = $(window).height();
+ sidebarbutton.find('span').css({
+ 'display': 'block',
+ 'margin-top': (viewport_height - sidebar.position().top - 20) / 2
+ });
+
+ sidebarbutton.click(toggle_sidebar);
+ sidebarbutton.attr('title', _('Collapse sidebar'));
+ sidebarbutton.css({
+ 'color': '#FFFFFF',
+ 'border-left': '1px solid ' + dark_color,
+ 'font-size': '1.2em',
+ 'cursor': 'pointer',
+ 'height': bodywrapper.height(),
+ 'padding-top': '1px',
+ 'margin-left': ssb_width_expanded - 12
+ });
+
+ sidebarbutton.hover(
+ function () {
+ $(this).css('background-color', dark_color);
+ },
+ function () {
+ $(this).css('background-color', light_color);
+ }
+ );
+ }
+
+ function set_position_from_cookie() {
+ if (!document.cookie)
+ return;
+ var items = document.cookie.split(';');
+ for(var k=0; k<items.length; k++) {
+ var key_val = items[k].split('=');
+ var key = key_val[0];
+ if (key == 'sidebar') {
+ var value = key_val[1];
+ if ((value == 'collapsed') && (!sidebar_is_collapsed()))
+ collapse_sidebar();
+ else if ((value == 'expanded') && (sidebar_is_collapsed()))
+ expand_sidebar();
+ }
+ }
+ }
+
+ add_sidebar_button();
+ var sidebarbutton = $('#sidebarbutton');
+ set_position_from_cookie();
+}); \ No newline at end of file
diff --git a/sphinx/themes/default/theme.conf b/sphinx/themes/default/theme.conf
index 812330f8a..ad5586b5e 100644
--- a/sphinx/themes/default/theme.conf
+++ b/sphinx/themes/default/theme.conf
@@ -6,6 +6,8 @@ pygments_style = sphinx
[options]
rightsidebar = false
stickysidebar = false
+collapsiblesidebar = false
+externalrefs = false
footerbgcolor = #11303d
footertextcolor = #ffffff
@@ -21,6 +23,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 000000000..8a348beda
--- /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 000000000..de21c4626
--- /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, .highlighted {
+ 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 000000000..d5806ec50
--- /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 000000000..91c768521
--- /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 000000000..05b4fe898
--- /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 000000000..f13611cde
--- /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 000000000..c6f3bc477
--- /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 000000000..ad5d02f34
--- /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 000000000..93007dfb9
--- /dev/null
+++ b/sphinx/themes/haiku/static/haiku.css_t
@@ -0,0 +1,371 @@
+/*
+ * 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;
+ }
+}
+
+.viewcode-back {
+ font-family: "DejaVu Sans", Arial, Helvetica, sans-serif;
+}
+
+div.viewcode-block:target {
+ background-color: #f4debf;
+ border-top: 1px solid #ac9;
+ border-bottom: 1px solid #ac9;
+ margin: -1px -12px;
+ padding: 0 12px;
+}
diff --git a/sphinx/themes/haiku/theme.conf b/sphinx/themes/haiku/theme.conf
new file mode 100644
index 000000000..3537da1d3
--- /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 000000000..d0aa912b2
--- /dev/null
+++ b/sphinx/themes/nature/static/nature.css_t
@@ -0,0 +1,245 @@
+/*
+ * 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;
+}
+
+.viewcode-back {
+ font-family: Arial, sans-serif;
+}
+
+div.viewcode-block:target {
+ background-color: #f4debf;
+ border-top: 1px solid #ac9;
+ border-bottom: 1px solid #ac9;
+}
diff --git a/sphinx/themes/nature/theme.conf b/sphinx/themes/nature/theme.conf
new file mode 100644
index 000000000..1cc400446
--- /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 000000000..0907a4ea3
--- /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 000000000..9c139b880
--- /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 000000000..e8c9ff62a
--- /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 000000000..0c5b3657c
--- /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 000000000..d1961cf09
--- /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 000000000..97166f131
--- /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 000000000..1e248d4d7
--- /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 000000000..fb633d879
--- /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 000000000..589f91abd
--- /dev/null
+++ b/sphinx/themes/scrolls/static/scrolls.css_t
@@ -0,0 +1,431 @@
+/*
+ * 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;
+}
+
+.viewcode-link {
+ float: right;
+}
+
+.viewcode-back {
+ float: right;
+ font-family: 'Georgia', serif;
+}
+
+div.viewcode-block:target {
+ background-color: #f4debf;
+ border-top: 1px solid #ac9;
+ border-bottom: 1px solid #ac9;
+ margin: -1px -5px;
+ padding: 0 5px;
+}
diff --git a/sphinx/themes/scrolls/static/theme_extras.js b/sphinx/themes/scrolls/static/theme_extras.js
new file mode 100644
index 000000000..1c0421878
--- /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 000000000..eb1b6be95
--- /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 000000000..563f6cde0
--- /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 000000000..4e7800f90
--- /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 48d2118e8..2d653f9fc 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 75b2ae0f9..c7e6e335a 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");
@@ -321,3 +326,14 @@ div.versioninfo {
line-height: 1.3em;
font-size: 0.9em;
}
+
+.viewcode-back {
+ font-family: 'Lucida Grande', 'Lucida Sans Unicode', 'Geneva',
+ 'Verdana', sans-serif;
+}
+
+div.viewcode-block:target {
+ background-color: #f4debf;
+ border-top: 1px solid #ac9;
+ border-bottom: 1px solid #ac9;
+}
diff --git a/sphinx/themes/traditional/static/traditional.css b/sphinx/themes/traditional/static/traditional.css
index 8c224c073..c9980fa57 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;
}
@@ -698,3 +717,20 @@ form.comment textarea {
display: none;
}
}
+
+.viewcode-link {
+ float: right;
+}
+
+.viewcode-back {
+ float: right;
+ font-family: serif;
+}
+
+div.viewcode-block:target {
+ background-color: #f4debf;
+ border-top: 1px solid #ac9;
+ border-bottom: 1px solid #ac9;
+ margin: -1px -10px;
+ padding: 0 10px;
+}
diff --git a/sphinx/theming.py b/sphinx/theming.py
index 27a1c26ae..0d0f28634 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 5745907f4..8d1298cd3 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,72 @@ import traceback
from os import path
import docutils
+from docutils.utils import relative_path
+
+import jinja2
+
import sphinx
+from sphinx.errors import PycodeError
-# 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.
+def get_matching_files(dirname, exclude_matchers=()):
"""
- 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
-
+ Get all file names in a directory, recursively.
-def get_matching_docs(dirname, suffix, exclude_docs=(), exclude_dirs=(),
- exclude_trees=(), exclude_dirnames=()):
+ Exclude files and dirs matching some matcher in *exclude_matchers*.
"""
- Get all file names (without suffix) matching a suffix in a
- directory, recursively.
-
- Exclude docs in *exclude_docs*, exclude dirs in *exclude_dirs*,
- prune dirs in *exclude_trees*, prune dirnames in *exclude_dirnames*.
- """
- 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]
+ dirlen = len(dirname) + 1 # exclude final os.path.sep
+ for root, dirs, files in walk(dirname, followlinks=True):
+ relativeroot = root[dirlen:]
-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)
-
+ 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])]
-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
+ dirs[:] = sorted(dirs[i] for (i, _) in qdirs)
+ for i, filename in sorted(qfiles):
+ yield filename
-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.
+def get_matching_docs(dirname, suffix, exclude_matchers=()):
"""
- 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 + '$'
-
-
-_pat_cache = {}
-
-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)
-
-
-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):
- """
- File-like object writing to two streams.
+ Exclude files and dirs matching a pattern in *exclude_patterns*.
"""
- 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 +125,105 @@ 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
+
+
+def get_module_source(modname):
+ """Try to find the source code for a module.
+
+ Can return ('file', 'filename') in which case the source is in the given
+ file, or ('string', 'source') which which case the source is the string.
+ """
+ if modname not in sys.modules:
+ try:
+ __import__(modname)
+ except Exception, err:
+ raise PycodeError('error importing %r' % modname, err)
+ mod = sys.modules[modname]
+ if hasattr(mod, '__loader__'):
+ try:
+ source = mod.__loader__.get_source(modname)
+ except Exception, err:
+ raise PycodeError('error getting source for %r' % modname, err)
+ return 'string', source
+ filename = getattr(mod, '__file__', None)
+ if filename is None:
+ raise PycodeError('no source found for module %r' % modname)
+ filename = path.normpath(path.abspath(filename))
+ lfilename = filename.lower()
+ if lfilename.endswith('.pyo') or lfilename.endswith('.pyc'):
+ filename = filename[:-1]
+ elif not lfilename.endswith('.py'):
+ raise PycodeError('source is not a .py file: %r' % filename)
+ if not path.isfile(filename):
+ raise PycodeError('source file is not present: %r' % filename)
+ return 'file', filename
+
+
+# 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 +242,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 +262,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/compat.py b/sphinx/util/compat.py
index 885a458e3..3fbfe4b26 100644
--- a/sphinx/util/compat.py
+++ b/sphinx/util/compat.py
@@ -11,7 +11,7 @@
from docutils import nodes
-# function missing in 0.5 SVN
+# function missing in docutils 0.5
def make_admonition(node_class, name, arguments, options, content, lineno,
content_offset, block_text, state, state_machine):
#if not content:
@@ -35,64 +35,13 @@ def make_admonition(node_class, name, arguments, options, content, lineno,
return [admonition_node]
-# support the class-style Directive interface even when using docutils 0.4
+# backwards-compatibility aliases for helpers in older Sphinx versions that
+# supported the docutils 0.4 directive function interface
-try:
- from docutils.parsers.rst import Directive
+from docutils.parsers.rst import Directive
-except ImportError:
- class Directive(object):
- """
- Fake Directive class to allow Sphinx directives to be written in
- class style.
- """
- required_arguments = 0
- optional_arguments = 0
- final_argument_whitespace = False
- option_spec = None
- has_content = False
-
- def __init__(self, name, arguments, options, content, lineno,
- content_offset, block_text, state, state_machine):
- self.name = name
- self.arguments = arguments
- self.options = options
- self.content = content
- self.lineno = lineno
- self.content_offset = content_offset
- self.block_text = block_text
- self.state = state
- self.state_machine = state_machine
-
- def run(self):
- raise NotImplementedError('Must override run() is subclass.')
-
- def directive_dwim(obj):
- """
- Return something usable with register_directive(), regardless if
- class or function. For that, we need to convert classes to a
- function for docutils 0.4.
- """
- if isinstance(obj, type) and issubclass(obj, Directive):
- def _class_directive(name, arguments, options, content,
- lineno, content_offset, block_text,
- state, state_machine):
- return obj(name, arguments, options, content,
- lineno, content_offset, block_text,
- state, state_machine).run()
- _class_directive.options = obj.option_spec
- _class_directive.content = obj.has_content
- _class_directive.arguments = (obj.required_arguments,
- obj.optional_arguments,
- obj.final_argument_whitespace)
- return _class_directive
- return obj
-
-else:
- def directive_dwim(obj):
- """
- Return something usable with register_directive(), regardless if
- class or function. Nothing to do here, because docutils 0.5 takes
- care of converting functions itself.
- """
- return obj
+def directive_dwim(obj):
+ import warnings
+ warnings.warn('directive_dwim is deprecated and no longer needed',
+ DeprecationWarning, stacklevel=2)
+ return obj
diff --git a/sphinx/util/docfields.py b/sphinx/util/docfields.py
new file mode 100644
index 000000000..da93c6fea
--- /dev/null
+++ b/sphinx/util/docfields.py
@@ -0,0 +1,267 @@
+# -*- coding: utf-8 -*-
+"""
+ sphinx.util.docfields
+ ~~~~~~~~~~~~~~~~~~~~~
+
+ "Doc fields" are reST field lists in object descriptions that will
+ be domain-specifically transformed to a more appealing presentation.
+
+ :copyright: Copyright 2007-2010 by the Sphinx team, see AUTHORS.
+ :license: BSD, see LICENSE for details.
+"""
+
+from docutils import nodes
+
+from sphinx import addnodes
+
+
+def _is_single_paragraph(node):
+ """True if the node only contains one paragraph (and system messages)."""
+ if len(node) == 0:
+ return False
+ elif len(node) > 1:
+ for subnode in node[1:]:
+ if not isinstance(subnode, nodes.system_message):
+ return False
+ if isinstance(node[0], nodes.paragraph):
+ return True
+ return False
+
+
+class Field(object):
+ """
+ A doc field that is never grouped. It can have an argument or not, the
+ argument can be linked using a specified *rolename*. Field should be used
+ for doc fields that usually don't occur more than once.
+
+ Example::
+
+ :returns: description of the return value
+ :rtype: description of the return type
+ """
+ is_grouped = False
+ is_typed = False
+
+ def __init__(self, name, names=(), label=None, has_arg=True, rolename=None):
+ self.name = name
+ self.names = names
+ self.label = label
+ self.has_arg = has_arg
+ self.rolename = rolename
+
+ def make_xref(self, rolename, domain, target, innernode=nodes.emphasis):
+ if not rolename:
+ return innernode(target, target)
+ refnode = addnodes.pending_xref('', refdomain=domain, refexplicit=False,
+ reftype=rolename, reftarget=target)
+ refnode += innernode(target, target)
+ return refnode
+
+ def make_entry(self, fieldarg, content):
+ return (fieldarg, content)
+
+ def make_field(self, types, domain, item):
+ fieldarg, content = item
+ fieldname = nodes.field_name('', self.label)
+ if fieldarg:
+ fieldname += nodes.Text(' ')
+ fieldname += self.make_xref(self.rolename, domain,
+ fieldarg, nodes.Text)
+ fieldbody = nodes.field_body('', nodes.paragraph('', *content))
+ return nodes.field('', fieldname, fieldbody)
+
+
+class GroupedField(Field):
+ """
+ A doc field that is grouped; i.e., all fields of that type will be
+ transformed into one field with its body being a bulleted list. It always
+ has an argument. The argument can be linked using the given *rolename*.
+ GroupedField should be used for doc fields that can occur more than once.
+ If *can_collapse* is true, this field will revert to a Field if only used
+ once.
+
+ Example::
+
+ :raises ErrorClass: description when it is raised
+ """
+ is_grouped = True
+ list_type = nodes.bullet_list
+
+ def __init__(self, name, names=(), label=None, rolename=None,
+ can_collapse=False):
+ Field.__init__(self, name, names, label, True, rolename)
+ self.can_collapse = can_collapse
+
+ def make_field(self, types, domain, items):
+ fieldname = nodes.field_name('', self.label)
+ listnode = self.list_type()
+ if len(items) == 1 and self.can_collapse:
+ return Field.make_field(self, types, domain, items[0])
+ for fieldarg, content in items:
+ par = nodes.paragraph()
+ par += self.make_xref(self.rolename, domain, fieldarg, nodes.strong)
+ par += nodes.Text(' -- ')
+ par += content
+ listnode += nodes.list_item('', par)
+ fieldbody = nodes.field_body('', listnode)
+ return nodes.field('', fieldname, fieldbody)
+
+
+class TypedField(GroupedField):
+ """
+ A doc field that is grouped and has type information for the arguments. It
+ always has an argument. The argument can be linked using the given
+ *rolename*, the type using the given *typerolename*.
+
+ Two uses are possible: either parameter and type description are given
+ separately, using a field from *names* and one from *typenames*,
+ respectively, or both are given using a field from *names*, see the example.
+
+ Example::
+
+ :param foo: description of parameter foo
+ :type foo: SomeClass
+
+ -- or --
+
+ :param SomeClass foo: description of parameter foo
+ """
+ is_typed = True
+
+ def __init__(self, name, names=(), typenames=(), label=None,
+ rolename=None, typerolename=None):
+ GroupedField.__init__(self, name, names, label, rolename, False)
+ self.typenames = typenames
+ self.typerolename = typerolename
+
+ def make_field(self, types, domain, items):
+ fieldname = nodes.field_name('', self.label)
+ listnode = self.list_type()
+ for fieldarg, content in items:
+ par = nodes.paragraph()
+ par += self.make_xref(self.rolename, domain, fieldarg, nodes.strong)
+ if fieldarg in types:
+ typename = u''.join(n.astext() for n in types[fieldarg])
+ par += nodes.Text(' (')
+ par += self.make_xref(self.typerolename, domain, typename)
+ par += nodes.Text(')')
+ par += nodes.Text(' -- ')
+ par += content
+ listnode += nodes.list_item('', par)
+ fieldbody = nodes.field_body('', listnode)
+ return nodes.field('', fieldname, fieldbody)
+
+
+class DocFieldTransformer(object):
+ """
+ Transforms field lists in "doc field" syntax into better-looking
+ equivalents, using the field type definitions given on a domain.
+ """
+
+ def __init__(self, directive):
+ self.domain = directive.domain
+ if not hasattr(directive, '_doc_field_type_map'):
+ directive.__class__._doc_field_type_map = \
+ self.preprocess_fieldtypes(directive.__class__.doc_field_types)
+ self.typemap = directive._doc_field_type_map
+
+ def preprocess_fieldtypes(self, types):
+ typemap = {}
+ for fieldtype in types:
+ for name in fieldtype.names:
+ typemap[name] = fieldtype, False
+ if fieldtype.is_typed:
+ for name in fieldtype.typenames:
+ typemap[name] = fieldtype, True
+ return typemap
+
+ def transform_all(self, node):
+ """Transform all field list children of a node."""
+ # don't traverse, only handle field lists that are immediate children
+ for child in node:
+ if isinstance(child, nodes.field_list):
+ self.transform(child)
+
+ def transform(self, node):
+ """Transform a single field list *node*."""
+ typemap = self.typemap
+
+ entries = []
+ groupindices = {}
+ types = {}
+
+ # step 1: traverse all fields and collect field types and content
+ for field in node:
+ fieldname, fieldbody = field
+ try:
+ # split into field type and argument
+ fieldtype, fieldarg = fieldname.astext().split(None, 1)
+ except ValueError:
+ # maybe an argument-less field type?
+ fieldtype, fieldarg = fieldname.astext(), ''
+ typedesc, is_typefield = typemap.get(fieldtype, (None, None))
+
+ # sort out unknown fields
+ if typedesc is None or typedesc.has_arg != bool(fieldarg):
+ # either the field name is unknown, or the argument doesn't
+ # match the spec; capitalize field name and be done with it
+ new_fieldname = fieldtype.capitalize() + ' ' + fieldarg
+ fieldname[0] = nodes.Text(new_fieldname)
+ entries.append(field)
+ continue
+
+ typename = typedesc.name
+
+ # collect the content, trying not to keep unnecessary paragraphs
+ if _is_single_paragraph(fieldbody):
+ content = fieldbody.children[0].children
+ else:
+ content = fieldbody.children
+
+ # if the field specifies a type, put it in the types collection
+ if is_typefield:
+ # filter out only inline nodes; others will result in invalid
+ # markup being written out
+ content = filter(lambda n: isinstance(n, nodes.Inline), content)
+ if content:
+ types.setdefault(typename, {})[fieldarg] = content
+ continue
+
+ # also support syntax like ``:param type name:``
+ if typedesc.is_typed:
+ try:
+ argtype, argname = fieldarg.split(None, 1)
+ except ValueError:
+ pass
+ else:
+ types.setdefault(typename, {})[argname] = \
+ [nodes.Text(argtype)]
+ fieldarg = argname
+
+ # grouped entries need to be collected in one entry, while others
+ # get one entry per field
+ if typedesc.is_grouped:
+ if typename in groupindices:
+ group = entries[groupindices[typename]]
+ else:
+ groupindices[typename] = len(entries)
+ group = [typedesc, []]
+ entries.append(group)
+ group[1].append(typedesc.make_entry(fieldarg, content))
+ else:
+ entries.append([typedesc,
+ typedesc.make_entry(fieldarg, content)])
+
+ # step 2: all entries are collected, construct the new field list
+ new_list = nodes.field_list()
+ for entry in entries:
+ if isinstance(entry, nodes.field):
+ # pass-through old field
+ new_list += entry
+ else:
+ fieldtype, content = entry
+ fieldtypes = types.get(fieldtype.name, {})
+ new_list += fieldtype.make_field(fieldtypes, self.domain,
+ content)
+
+ node.replace_self(new_list)
diff --git a/sphinx/util/matching.py b/sphinx/util/matching.py
new file mode 100644
index 000000000..c459aca2d
--- /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 000000000..82427f134
--- /dev/null
+++ b/sphinx/util/nodes.py
@@ -0,0 +1,138 @@
+# -*- 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 docutils import nodes
+
+from sphinx import addnodes
+
+
+# \x00 means the "<" was backslash-escaped
+explicit_title_re = re.compile(r'^(.+?)\s*(?<!\x00)<(.*?)>$', 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(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
+
+
+def make_refnode(builder, fromdocname, todocname, targetid, child, title=None):
+ """Shortcut to create a reference node."""
+ node = nodes.reference('', '', internal=True)
+ if fromdocname == todocname:
+ node['refid'] = targetid
+ else:
+ node['refuri'] = (builder.get_relative_uri(fromdocname, todocname)
+ + '#' + targetid)
+ if title:
+ node['reftitle'] = title
+ node.append(child)
+ return node
+
+# 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)
+
+nodes.Node._old_traverse = nodes.Node.traverse
+nodes.Node._all_traverse = _all_traverse
+nodes.Node._fast_traverse = _fast_traverse
+nodes.Node.traverse = _new_traverse
+
+# monkey-patch Node.__contains__ to get consistent "in" operator behavior
+# across docutils versions
+
+def _new_contains(self, key):
+ # support both membership test for children and attributes
+ # (has_key is translated to "in" by 2to3)
+ if isinstance(key, basestring):
+ return key in self.attributes
+ return key in self.children
+
+nodes.Node.__contains__ = _new_contains
diff --git a/sphinx/util/osutil.py b/sphinx/util/osutil.py
new file mode 100644
index 000000000..beab38cbd
--- /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 021943072..240406088 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/util/texescape.py b/sphinx/util/texescape.py
index 737908295..4cabd9b20 100644
--- a/sphinx/util/texescape.py
+++ b/sphinx/util/texescape.py
@@ -99,6 +99,7 @@ tex_replacements = [
]
tex_escape_map = {}
+tex_replace_map = {}
tex_hl_escape_map_old = {} # replacement map for Pygments <= 1.1
tex_hl_escape_map_new = {} # replacement map for Pygments >= 1.2
_old_cmd_chars = {ord(u'\\'): u'@', ord(u'{'): u'[', ord(u'}'): u']'}
@@ -106,6 +107,7 @@ _old_cmd_chars = {ord(u'\\'): u'@', ord(u'{'): u'[', ord(u'}'): u']'}
def init():
for a, b in tex_replacements:
tex_escape_map[ord(a)] = b
+ tex_replace_map[ord(a)] = u'_'
for a, b in tex_replacements:
if a in u'[]{}\\': continue
diff --git a/sphinx/writers/html.py b/sphinx/writers/html.py
index ea79fb9d7..3fe1326a9 100644
--- a/sphinx/writers/html.py
+++ b/sphinx/writers/html.py
@@ -16,7 +16,7 @@ import os
from docutils import nodes
from docutils.writers.html4css1 import Writer, HTMLTranslator as BaseTranslator
-from sphinx.locale import admonitionlabels, versionlabels
+from sphinx.locale import admonitionlabels, versionlabels, _
from sphinx.util.smartypants import sphinx_smarty_pants
try:
@@ -59,9 +59,16 @@ class HTMLTranslator(BaseTranslator):
self.highlightlinenothreshold = sys.maxint
self.protect_literal_text = 0
self.add_permalinks = builder.config.html_add_permalinks
+ self.secnumber_suffix = builder.config.html_secnumber_suffix
+
+ 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']))
+ self.body.append(self.starttag(node, 'dl', CLASS=node['objtype']))
def depart_desc(self, node):
self.body.append('</dl>\n\n')
@@ -69,7 +76,7 @@ class HTMLTranslator(BaseTranslator):
# the id is set automatically
self.body.append(self.starttag(node, 'dt'))
# anchor for per-desc interactive data
- if node.parent['desctype'] != 'describe' \
+ if node.parent['objtype'] != 'describe' \
and node['ids'] and node['first']:
self.body.append('<!--[%s]-->' % node['ids'][0])
def depart_desc_signature(self, node):
@@ -138,7 +145,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 += ': '
@@ -150,16 +157,31 @@ class HTMLTranslator(BaseTranslator):
# overwritten
def visit_reference(self, node):
- BaseTranslator.visit_reference(self, node)
- if node.hasattr('reftitle'):
- # ugly hack to add a title attribute
- starttag = self.body[-1]
- if not starttag.startswith('<a '):
- return
- self.body[-1] = '<a title="%s"' % self.attval(node['reftitle']) + \
- starttag[2:]
+ atts = {'class': 'reference'}
+ if node.get('internal'):
+ atts['class'] += ' internal'
+ else:
+ atts['class'] += ' external'
+ if 'refuri' in node:
+ atts['href'] = node['refuri']
+ if self.settings.cloak_email_addresses and \
+ atts['href'].startswith('mailto:'):
+ atts['href'] = self.cloak_mailto(atts['href'])
+ self.in_mailto = 1
+ else:
+ assert 'refid' in node, \
+ 'References must have "refuri" or "refid" attribute.'
+ atts['href'] = '#' + node['refid']
+ if not isinstance(node.parent, nodes.TextElement):
+ assert len(node) == 1 and isinstance(node[0], nodes.image)
+ atts['class'] += ' image-reference'
+ if 'reftitle' in node:
+ atts['title'] = node['reftitle']
+ self.body.append(self.starttag(node, 'a', '', **atts))
+
if node.hasattr('secnumber'):
- self.body.append('%s. ' % '.'.join(map(str, node['secnumber'])))
+ self.body.append(('%s' + self.secnumber_suffix) %
+ '.'.join(map(str, node['secnumber'])))
# overwritten -- we don't want source comments to show up in the HTML
def visit_comment(self, node):
@@ -180,30 +202,21 @@ class HTMLTranslator(BaseTranslator):
def add_secnumber(self, node):
if node.hasattr('secnumber'):
- self.body.append('.'.join(map(str, node['secnumber'])) + '. ')
+ self.body.append('.'.join(map(str, node['secnumber'])) +
+ self.secnumber_suffix)
elif isinstance(node.parent, nodes.section):
anchorname = '#' + node.parent['ids'][0]
if anchorname not in self.builder.secnumbers:
anchorname = '' # try first heading which has no anchor
if anchorname in self.builder.secnumbers:
numbers = self.builder.secnumbers[anchorname]
- self.body.append('.'.join(map(str, numbers)) + '. ')
-
- # overwritten for docutils 0.4
- if hasattr(BaseTranslator, 'start_tag_with_title'):
- def visit_section(self, node):
- # the 0.5 version, to get the id attribute in the <div> tag
- self.section_level += 1
- self.body.append(self.starttag(node, 'div', CLASS='section'))
-
- def visit_title(self, node):
- # don't move the id attribute inside the <h> tag
- BaseTranslator.visit_title(self, node, move_ids=0)
- self.add_secnumber(node)
- else:
- def visit_title(self, node):
- BaseTranslator.visit_title(self, node)
- self.add_secnumber(node)
+ self.body.append('.'.join(map(str, numbers)) +
+ self.secnumber_suffix)
+
+ # overwritten
+ def visit_title(self, node):
+ BaseTranslator.visit_title(self, node)
+ self.add_secnumber(node)
# overwritten
def visit_literal_block(self, node):
@@ -284,8 +297,9 @@ class HTMLTranslator(BaseTranslator):
def visit_download_reference(self, node):
if node.hasattr('filename'):
- self.body.append('<a href="%s">' % posixpath.join(
- self.builder.dlpath, node['filename']))
+ self.body.append(
+ '<a class="reference download internal" href="%s">' %
+ posixpath.join(self.builder.dlpath, node['filename']))
self.context.append('</a>')
else:
self.context.append('')
@@ -357,11 +371,6 @@ class HTMLTranslator(BaseTranslator):
def depart_acks(self, node):
pass
- def visit_module(self, node):
- pass
- def depart_module(self, node):
- pass
-
def visit_hlist(self, node):
self.body.append('<table class="hlist"><tr>')
def depart_hlist(self, node):
diff --git a/sphinx/writers/latex.py b/sphinx/writers/latex.py
index 438820570..0e8de719d 100644
--- a/sphinx/writers/latex.py
+++ b/sphinx/writers/latex.py
@@ -22,14 +22,16 @@ from docutils.writers.latex2e import Babel
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.texescape import tex_escape_map
+from sphinx.locale import admonitionlabels, versionlabels, _
+from sphinx.util.osutil import ustrftime
+from sphinx.util.texescape import tex_escape_map, tex_replace_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
@@ -45,7 +47,6 @@ HEADER = r'''%% Generated by Sphinx.
\newcommand{\sphinxlogo}{%(logo)s}
\renewcommand{\releasename}{%(releasename)s}
%(makeindex)s
-%(makemodindex)s
'''
BEGIN_DOC = r'''
@@ -56,9 +57,6 @@ BEGIN_DOC = r'''
'''
FOOTER = r'''
-%(footer)s
-\renewcommand{\indexname}{%(modindexname)s}
-%(printmodindex)s
\renewcommand{\indexname}{%(indexname)s}
%(printindex)s
\end{document}
@@ -119,14 +117,6 @@ class Table(object):
self.longtable = False
-class Desc(object):
- def __init__(self, node):
- self.env = LaTeXTranslator.desc_map.get(node['desctype'], 'describe')
- self.type = self.cls = self.name = self.params = \
- self.annotation = self.returns = ''
- self.count = 0
-
-
class LaTeXTranslator(nodes.NodeVisitor):
sectionnames = ["part", "chapter", "section", "subsection",
"subsubsection", "paragraph", "subparagraph"]
@@ -134,11 +124,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}',
@@ -152,12 +142,10 @@ class LaTeXTranslator(nodes.NodeVisitor):
'logo': '',
'releasename': 'Release',
'makeindex': '\\makeindex',
- 'makemodindex': '\\makemodindex',
'shorthandoff': '',
'maketitle': '\\maketitle',
'tableofcontents': '\\tableofcontents',
'footer': '',
- 'printmodindex': '\\printmodindex',
'printindex': '\\printindex',
}
@@ -173,7 +161,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
@@ -182,9 +170,13 @@ class LaTeXTranslator(nodes.NodeVisitor):
'author': document.settings.author,
'releasename': _('Release'),
'preamble': builder.config.latex_preamble,
- '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:
@@ -205,14 +197,11 @@ class LaTeXTranslator(nodes.NodeVisitor):
self.elements['fncychap'] = '\\usepackage[Sonny]{fncychap}'
else:
self.elements['classoptions'] += ',english'
- if not builder.config.latex_use_modindex:
- self.elements['makemodindex'] = ''
- self.elements['printmodindex'] = ''
# 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,18 +213,17 @@ class LaTeXTranslator(nodes.NodeVisitor):
# by .. highlight:: directive in the master file
self.hlsettingstack = 2 * [[builder.config.highlight_language,
sys.maxint]]
- self.written_ids = set()
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
+ self.next_section_ids = set()
# flags
self.verbatim = None
self.in_title = 0
@@ -245,13 +233,74 @@ class LaTeXTranslator(nodes.NodeVisitor):
self.literal_whitespace = 0
self.no_contractions = 0
self.compact_list = 0
+ self.first_param = 0
def astext(self):
- return (HEADER % self.elements + self.highlighter.get_stylesheet() +
- u''.join(self.body) + FOOTER % self.elements)
+ return (HEADER % self.elements +
+ self.highlighter.get_stylesheet() +
+ u''.join(self.body) +
+ '\n' + self.elements['footer'] + '\n' +
+ self.generate_indices() +
+ FOOTER % self.elements)
+
+ def hypertarget(self, id, withdoc=True, anchor=True):
+ if withdoc:
+ id = self.curfilestack[-1] + ':' + id
+ return (anchor and '\\phantomsection' or '') + \
+ '\\label{%s}' % self.idescape(id)
+
+ def hyperlink(self, id):
+ return '\\hyperref[%s]{' % (self.idescape(id))
+
+ def hyperpageref(self, id):
+ return '\\autopageref*{%s}' % (self.idescape(id))
def idescape(self, id):
- return str(unicode(id).translate(tex_escape_map))
+ return str(unicode(id).translate(tex_replace_map))
+
+ def generate_indices(self):
+ def generate(content, collapsed):
+ ret.append('\\begin{theindex}\n')
+ ret.append('\\def\\bigletter#1{{\\Large\\sffamily#1}'
+ '\\nopagebreak\\vspace{1mm}}\n')
+ for i, (letter, entries) in enumerate(content):
+ if i > 0:
+ ret.append('\\indexspace\n')
+ ret.append('\\bigletter{%s}\n' % letter)
+ for entry in entries:
+ if not entry[3]:
+ continue
+ ret.append('\\item {\\texttt{%s}}' % self.encode(entry[0]))
+ if entry[4]:
+ # add "extra" info
+ ret.append(' \\emph{(%s)}' % self.encode(entry[4]))
+ ret.append(', \\pageref{%s:%s}\n' %
+ (entry[2], self.idescape(entry[3])))
+ ret.append('\\end{theindex}\n')
+
+ ret = []
+ # latex_domain_indices can be False/True or a list of index names
+ indices_config = self.builder.config.latex_domain_indices
+ if indices_config:
+ for domain in self.builder.env.domains.itervalues():
+ for indexcls in domain.indices:
+ indexname = '%s-%s' % (domain.name, indexcls.name)
+ if isinstance(indices_config, list):
+ if indexname not in indices_config:
+ continue
+ # deprecated config value
+ if indexname == 'py-modindex' and \
+ not self.builder.config.latex_use_modindex:
+ continue
+ content, collapsed = indexcls(domain).generate(
+ self.builder.docnames)
+ if not content:
+ continue
+ ret.append('\\renewcommand{\\indexname}{%s}\n' %
+ indexcls.localname)
+ generate(content, collapsed)
+
+ return ''.join(ret)
def visit_document(self, node):
self.footnotestack.append(self.collect_footnotes(node))
@@ -265,8 +314,7 @@ class LaTeXTranslator(nodes.NodeVisitor):
self.body.append('\n\\appendix\n')
self.first_document = -1
if node.has_key('docname'):
- self.body.append('\\hypertarget{--doc-%s}{}' %
- self.idescape(node['docname']))
+ self.body.append(self.hypertarget(':doc'))
# "- 1" because the level is increased before the title is visited
self.sectionlevel = self.top_sectionlevel - 1
def depart_document(self, node):
@@ -277,23 +325,18 @@ class LaTeXTranslator(nodes.NodeVisitor):
widest_label = bi[0]
self.body.append('\n\\begin{thebibliography}{%s}\n' % widest_label)
for bi in self.bibitems:
- # cite_key: underscores must not be escaped
- cite_key = bi[0].replace(r"\_", "_")
- self.body.append('\\bibitem[%s]{%s}{\hypertarget{%s}{} %s}\n' %
- (bi[0], cite_key,
- self.idescape(cite_key.lower()), bi[1]))
+ target = self.hypertarget(bi[2] + ':' + bi[0].lower(),
+ withdoc=False)
+ self.body.append('\\bibitem[%s]{%s}{%s %s}\n' %
+ (bi[0], self.idescape(bi[0]), target, bi[1]))
self.body.append('\\end{thebibliography}\n')
self.bibitems = []
def visit_start_of_file(self, node):
- # This marks the begin of a new file; therefore the current module and
- # class must be reset
- self.body.append('\n\\resetcurrentobjects\n')
- # and also, new footnotes
+ # collect new footnotes
self.footnotestack.append(self.collect_footnotes(node))
# also add a document target
- self.body.append('\\hypertarget{--doc-%s}{}' %
- self.idescape(node['docname']))
+ self.next_section_ids.add(':doc')
self.curfilestack.append(node['docname'])
# use default highlight settings for new file
self.hlsettingstack.append(self.hlsettingstack[0])
@@ -327,15 +370,8 @@ class LaTeXTranslator(nodes.NodeVisitor):
if not self.this_is_the_title:
self.sectionlevel += 1
self.body.append('\n\n')
- if self.next_section_target:
- self.body.append(r'\hypertarget{%s}{}' %
- self.idescape(self.next_section_target))
- self.next_section_target = None
- #if node.get('ids'):
- # for id in node['ids']:
- # if id not in self.written_ids:
- # self.body.append(r'\hypertarget{%s}{}' % id)
- # self.written_ids.add(id)
+ if node.get('ids'):
+ self.next_section_ids.update(node['ids'])
def depart_section(self, node):
self.sectionlevel = max(self.sectionlevel - 1,
self.top_sectionlevel - 1)
@@ -347,7 +383,7 @@ class LaTeXTranslator(nodes.NodeVisitor):
def visit_topic(self, node):
self.body.append('\\setbox0\\vbox{\n'
- '\\begin{minipage}{0.95\\textwidth}\n')
+ '\\begin{minipage}{0.95\\linewidth}\n')
def depart_topic(self, node):
self.body.append('\\end{minipage}}\n'
'\\begin{center}\\setlength{\\fboxsep}{5pt}'
@@ -406,6 +442,12 @@ class LaTeXTranslator(nodes.NodeVisitor):
# just use "subparagraph", it's not numbered anyway
self.body.append(r'\%s{' % self.sectionnames[-1])
self.context.append('}\n')
+
+ if self.next_section_ids:
+ for id in self.next_section_ids:
+ self.context[-1] += self.hypertarget(id, anchor=False)
+ self.next_section_ids.clear()
+
elif isinstance(parent, (nodes.topic, nodes.sidebar)):
self.body.append(r'\textbf{')
self.context.append('}\n\n\medskip\n\n')
@@ -437,138 +479,76 @@ class LaTeXTranslator(nodes.NodeVisitor):
def depart_subtitle(self, node):
self.body.append(self.context.pop())
- desc_map = {
- 'function' : 'funcdesc',
- 'class': 'classdesc',
- 'method': 'methoddesc',
- 'classmethod': 'classmethoddesc',
- 'staticmethod': 'staticmethoddesc',
- 'exception': 'excdesc',
- 'data': 'datadesc',
- 'attribute': 'memberdesc',
- 'opcode': 'opcodedesc',
-
- 'cfunction': 'cfuncdesc',
- 'cmember': 'cmemberdesc',
- 'cmacro': 'csimplemacrodesc',
- 'ctype': 'ctypedesc',
- 'cvar': 'cvardesc',
-
- 'describe': 'describe',
- # and all others are 'describe' too
- }
-
def visit_desc(self, node):
- self.descstack.append(Desc(node))
+ self.body.append('\n\n\\begin{fulllineitems}\n')
def depart_desc(self, node):
- d = self.descstack.pop()
- self.body.append("\\end{%s}\n" % d.env)
+ self.body.append('\n\\end{fulllineitems}\n\n')
def visit_desc_signature(self, node):
- d = self.descstack[-1]
- # reset these for every signature
- d.type = d.cls = d.name = d.params = ''
- def depart_desc_signature(self, node):
- d = self.descstack[-1]
- d.cls = d.cls.rstrip('.')
- if node.parent['desctype'] != 'describe' and node['ids']:
- hyper = '\\hypertarget{%s}{}' % self.idescape(node['ids'][0])
+ if node.parent['objtype'] != 'describe' and node['ids']:
+ hyper = self.hypertarget(node['ids'][0])
else:
hyper = ''
- if d.count == 0:
- t1 = "\n\n%s\\begin{%s}" % (hyper, d.env)
+ self.body.append(hyper)
+ for child in node:
+ if isinstance(child, addnodes.desc_parameterlist):
+ self.body.append(r'\pysiglinewithargsret{')
+ break
else:
- t1 = "\n%s\\%sline" % (hyper, d.env[:-4])
- d.count += 1
- if d.env in ('funcdesc', 'classdesc', 'excclassdesc'):
- t2 = "{%s}{%s}" % (d.name, d.params)
- elif d.env in ('datadesc', 'excdesc', 'csimplemacrodesc'):
- t2 = "{%s}" % (d.name)
- elif d.env in ('methoddesc', 'classmethoddesc', 'staticmethoddesc'):
- if d.cls:
- t2 = "[%s]{%s}{%s}" % (d.cls, d.name, d.params)
- else:
- t2 = "{%s}{%s}" % (d.name, d.params)
- elif d.env == 'memberdesc':
- if d.cls:
- t2 = "[%s]{%s}" % (d.cls, d.name)
- else:
- t2 = "{%s}" % d.name
- elif d.env == 'cfuncdesc':
- if d.cls:
- # C++ class names
- d.name = '%s::%s' % (d.cls, d.name)
- t2 = "{%s}{%s}{%s}" % (d.type, d.name, d.params)
- elif d.env == 'cmemberdesc':
- try:
- type, container = d.type.rsplit(' ', 1)
- container = container.rstrip('.')
- except ValueError:
- container = ''
- type = d.type
- t2 = "{%s}{%s}{%s}" % (container, type, d.name)
- elif d.env == 'cvardesc':
- t2 = "{%s}{%s}" % (d.type, d.name)
- elif d.env == 'ctypedesc':
- t2 = "{%s}" % (d.name)
- elif d.env == 'opcodedesc':
- t2 = "{%s}{%s}" % (d.name, d.params)
- elif d.env == 'describe':
- t2 = "{%s}" % d.name
- self.body.append(t1 + t2)
+ self.body.append(r'\pysigline{')
+ def depart_desc_signature(self, node):
+ self.body.append('}{}')
+
+ def visit_desc_addname(self, node):
+ self.body.append(r'\code{')
+ self.literal_whitespace += 1
+ def depart_desc_addname(self, node):
+ self.body.append('}')
+ self.literal_whitespace -= 1
def visit_desc_type(self, node):
- d = self.descstack[-1]
- if d.env == 'describe':
- d.name += self.encode(node.astext())
- else:
- self.descstack[-1].type = self.encode(node.astext().strip())
- raise nodes.SkipNode
+ pass
+ def depart_desc_type(self, node):
+ pass
def visit_desc_returns(self, node):
- d = self.descstack[-1]
- if d.env == 'describe':
- d.name += ' $\\rightarrow$ ' + self.encode(node.astext())
- else:
- self.descstack[-1].returns = self.encode(node.astext().strip())
- raise nodes.SkipNode
+ self.body.append(r'}{ $\rightarrow$ ')
+ def depart_desc_returns(self, node):
+ pass
def visit_desc_name(self, node):
- d = self.descstack[-1]
- if d.env == 'describe':
- d.name += self.encode(node.astext())
- else:
- self.descstack[-1].name = self.encode(node.astext().strip())
- raise nodes.SkipNode
-
- def visit_desc_addname(self, node):
- d = self.descstack[-1]
- if d.env == 'describe':
- d.name += self.encode(node.astext())
- else:
- self.descstack[-1].cls = self.encode(node.astext().strip())
- raise nodes.SkipNode
+ self.body.append(r'\bfcode{')
+ self.literal_whitespace += 1
+ def depart_desc_name(self, node):
+ self.body.append('}')
+ self.literal_whitespace -= 1
def visit_desc_parameterlist(self, node):
- d = self.descstack[-1]
- if d.env == 'describe':
- d.name += self.encode(node.astext())
- else:
- self.descstack[-1].params = self.encode(node.astext().strip())
- raise nodes.SkipNode
+ self.body.append('}{')
+ self.first_param = 1
+ def depart_desc_parameterlist(self, node):
+ pass
- def visit_desc_annotation(self, node):
- d = self.descstack[-1]
- if d.env == 'describe':
- d.name += self.encode(node.astext())
+ def visit_desc_parameter(self, node):
+ if not self.first_param:
+ self.body.append(', ')
else:
- self.descstack[-1].annotation = self.encode(node.astext().strip())
- raise nodes.SkipNode
+ self.first_param = 0
+ if not node.hasattr('noemph'):
+ self.body.append(r'\emph{')
+ def depart_desc_parameter(self, node):
+ if not node.hasattr('noemph'):
+ self.body.append('}')
+
+ def visit_desc_optional(self, node):
+ self.body.append(r'\optional{')
+ def depart_desc_optional(self, node):
+ self.body.append('}')
- def visit_refcount(self, node):
- self.body.append("\\emph{")
- def depart_refcount(self, node):
- self.body.append("}\\\\")
+ def visit_desc_annotation(self, node):
+ self.body.append(r'\strong{')
+ def depart_desc_annotation(self, node):
+ self.body.append('}')
def visit_desc_content(self, node):
if node.children and not isinstance(node.children[0], nodes.paragraph):
@@ -577,6 +557,11 @@ class LaTeXTranslator(nodes.NodeVisitor):
def depart_desc_content(self, node):
pass
+ def visit_refcount(self, node):
+ self.body.append("\\emph{")
+ def depart_refcount(self, node):
+ self.body.append("}\\\\")
+
def visit_seealso(self, node):
self.body.append("\n\n\\strong{%s:}\n\n" % admonitionlabels['seealso'])
def depart_seealso(self, node):
@@ -602,6 +587,7 @@ class LaTeXTranslator(nodes.NodeVisitor):
def visit_label(self, node):
if isinstance(node.parent, nodes.citation):
self.bibitems[-1][0] = node.astext()
+ self.bibitems[-1][2] = self.curfilestack[-1]
raise nodes.SkipNode
def visit_tabular_col_spec(self, node):
@@ -631,13 +617,13 @@ class LaTeXTranslator(nodes.NodeVisitor):
elif self.table.has_verbatim:
self.body.append('\n\\begin{tabular}')
else:
- self.body.append('\n\\begin{tabulary}{\\textwidth}')
+ self.body.append('\n\\begin{tabulary}{\\linewidth}')
if self.table.colspec:
self.body.append(self.table.colspec)
else:
if self.table.has_verbatim:
colwidth = 0.95 / self.table.colcount
- colspec = ('p{%.3f\\textwidth}|' % colwidth) * \
+ colspec = ('p{%.3f\\linewidth}|' % colwidth) * \
self.table.colcount
self.body.append('{|' + colspec + '}\n')
elif self.table.longtable:
@@ -765,7 +751,7 @@ class LaTeXTranslator(nodes.NodeVisitor):
def visit_term(self, node):
ctx = '}] \\leavevmode'
if node.has_key('ids') and node['ids']:
- ctx += '\\hypertarget{%s}{}' % self.idescape(node['ids'][0])
+ ctx += self.hypertarget(node['ids'][0])
self.body.append('\\item[{')
self.context.append(ctx)
def depart_term(self, node):
@@ -822,19 +808,6 @@ class LaTeXTranslator(nodes.NodeVisitor):
def depart_hlistcol(self, node):
pass
- def visit_module(self, node):
- modname = node['modname']
- self.body.append('\n\\hypertarget{module-%s}{}' %
- self.idescape(modname.replace(' ','')))
- self.body.append('\n\\declaremodule[%s]{}{%s}' % (
- modname.replace('_', ''), self.encode(modname)))
- self.body.append('\n\\modulesynopsis{%s}' %
- self.encode(node['synopsis']))
- if node.has_key('platform'):
- self.body.append('\\platform{%s}' % self.encode(node['platform']))
- def depart_module(self, node):
- pass
-
def latex_image_length(self, width_str):
match = re.match('(\d*\.?\d*)\s*(\S*)', width_str)
if not match:
@@ -888,7 +861,7 @@ class LaTeXTranslator(nodes.NodeVisitor):
pre.append(align_prepost[is_inline, attrs['align']][0])
post.append(align_prepost[is_inline, attrs['align']][1])
except KeyError:
- pass # XXX complain here?
+ pass
if not is_inline:
pre.append('\n')
post.append('\n')
@@ -990,19 +963,30 @@ class LaTeXTranslator(nodes.NodeVisitor):
# indexing uses standard LaTeX index markup, so the targets
# will be generated differently
if not id.startswith('index-'):
- self.body.append(r'\hypertarget{%s}{}' % self.idescape(id))
+ self.body.append(self.hypertarget(id))
- if node.has_key('refid') and node['refid'] not in self.written_ids:
- parindex = node.parent.index(node)
+ # postpone the labels until after the sectioning command
+ parindex = node.parent.index(node)
+ try:
try:
next = node.parent[parindex+1]
- if isinstance(next, nodes.section):
- self.next_section_target = node['refid']
- return
except IndexError:
- pass
+ # last node in parent, look at next after parent
+ # (for section of equal level)
+ next = node.parent.parent[node.parent.parent.index(node.parent)]
+ if isinstance(next, nodes.section):
+ if node.get('refid'):
+ self.next_section_ids.add(node['refid'])
+ self.next_section_ids.update(node['ids'])
+ return
+ except IndexError:
+ pass
+ if 'refuri' in node:
+ return
+ if node.get('refid'):
add_target(node['refid'])
- self.written_ids.add(node['refid'])
+ for id in node['ids']:
+ add_target(id)
def depart_target(self, node):
pass
@@ -1046,20 +1030,42 @@ class LaTeXTranslator(nodes.NodeVisitor):
if self.in_title or not uri:
self.context.append('')
elif uri.startswith('mailto:') or uri.startswith('http:') or \
- uri.startswith('https:') or uri.startswith('ftp:'):
+ uri.startswith('https:') or uri.startswith('ftp:'):
self.body.append('\\href{%s}{' % self.encode_uri(uri))
- self.context.append('}')
+ # if configured, put the URL after the link
+ if self.builder.config.latex_show_urls and \
+ node.astext() != uri:
+ if uri.startswith('mailto:'):
+ uri = uri[7:]
+ self.context.append('} (%s)' % self.encode_uri(uri))
+ else:
+ self.context.append('}')
elif uri.startswith('#'):
- # references to labels
- self.body.append('\\hyperlink{%s}{' % self.idescape(uri[1:]))
- self.context.append('}')
+ # references to labels in the same document
+ id = self.curfilestack[-1] + ':' + uri[1:]
+ self.body.append(self.hyperlink(id))
+ if self.builder.config.latex_show_pagerefs:
+ self.context.append('} (%s)' % self.hyperpageref(id))
+ else:
+ self.context.append('}')
elif uri.startswith('%'):
# references to documents or labels inside documents
hashindex = uri.find('#')
- targetname = (hashindex == -1) and '--doc-' + uri[1:] \
- or uri[hashindex+1:]
- self.body.append('\\hyperlink{%s}{' % self.idescape(targetname))
- self.context.append('}')
+ if hashindex == -1:
+ # reference to the document
+ id = uri[1:] + '::doc'
+ else:
+ # reference to a label
+ id = uri[1:].replace('#', ':')
+ self.body.append(self.hyperlink(id))
+ if len(node) and 'std-term' in node[0].get('classes', []):
+ # don't add a pageref for glossary terms
+ self.context.append('}')
+ else:
+ if self.builder.config.latex_show_pagerefs:
+ self.context.append('} (%s)' % self.hyperpageref(id))
+ else:
+ self.context.append('}')
elif uri.startswith('@token'):
if self.in_production_list:
self.body.append('\\token{')
@@ -1121,7 +1127,7 @@ class LaTeXTranslator(nodes.NodeVisitor):
def visit_citation(self, node):
# TODO maybe use cite bibitems
- self.bibitems.append(['', ''])
+ self.bibitems.append(['', '', '']) # [citeid, citetext, docname]
self.context.append(len(self.body))
def depart_citation(self, node):
size = self.context.pop()
@@ -1130,8 +1136,9 @@ class LaTeXTranslator(nodes.NodeVisitor):
self.bibitems[-1][1] = text
def visit_citation_reference(self, node):
- citeid = node.astext()
- self.body.append('\\cite{%s}' % citeid)
+ # This is currently never encountered, since citation_reference nodes
+ # are already replaced by pending_xref nodes in the environment.
+ self.body.append('\\cite{%s}' % self.idescape(node.astext()))
raise nodes.SkipNode
def visit_literal(self, node):
@@ -1198,9 +1205,9 @@ class LaTeXTranslator(nodes.NodeVisitor):
* serif typeface
"""
self.body.append('{\\raggedright{}')
- self.literal_whitespace = 1
+ self.literal_whitespace += 1
def depart_line_block(self, node):
- self.literal_whitespace = 0
+ self.literal_whitespace -= 1
# remove the last \\
del self.body[-1]
self.body.append('}\n')
@@ -1281,7 +1288,7 @@ class LaTeXTranslator(nodes.NodeVisitor):
raise nodes.SkipNode
def visit_description(self, node):
- self.body.append( ' ' )
+ self.body.append(' ')
def depart_description(self, node):
pass
diff --git a/sphinx/writers/manpage.py b/sphinx/writers/manpage.py
new file mode 100644
index 000000000..5f93c7ebb
--- /dev/null
+++ b/sphinx/writers/manpage.py
@@ -0,0 +1,328 @@
+# -*- coding: utf-8 -*-
+"""
+ sphinx.writers.manpage
+ ~~~~~~~~~~~~~~~~~~~~~~
+
+ Manual page writer, extended for Sphinx custom nodes.
+
+ :copyright: Copyright 2007-2010 by the Sphinx team, see AUTHORS.
+ :license: BSD, see LICENSE for details.
+"""
+
+from docutils import nodes
+try:
+ from docutils.writers.manpage import MACRO_DEF, Writer, \
+ Translator as BaseTranslator
+ has_manpage_writer = True
+except ImportError:
+ # define the classes in any case, sphinx.application needs it
+ Writer = BaseTranslator = object
+ has_manpage_writer = False
+
+from sphinx import addnodes
+from sphinx.locale import admonitionlabels, versionlabels, _
+from sphinx.util.osutil import ustrftime
+
+
+class ManualPageWriter(Writer):
+ def __init__(self, builder):
+ Writer.__init__(self)
+ self.builder = builder
+
+ def translate(self):
+ visitor = ManualPageTranslator(self.builder, self.document)
+ self.visitor = visitor
+ self.document.walkabout(visitor)
+ self.output = visitor.astext()
+
+
+class ManualPageTranslator(BaseTranslator):
+ """
+ Custom translator.
+ """
+
+ def __init__(self, builder, *args, **kwds):
+ BaseTranslator.__init__(self, *args, **kwds)
+ self.builder = builder
+
+ self.in_productionlist = 0
+
+ # first title is the manpage title
+ self.section_level = -1
+
+ # docinfo set by man_pages config value
+ self._docinfo['title'] = self.document.settings.title
+ self._docinfo['subtitle'] = self.document.settings.subtitle
+ if self.document.settings.authors:
+ # don't set it if no author given
+ self._docinfo['author'] = self.document.settings.authors
+ self._docinfo['manual_section'] = self.document.settings.section
+
+ # docinfo set by other config values
+ self._docinfo['title_upper'] = self._docinfo['title'].upper()
+ if builder.config.today:
+ self._docinfo['date'] = builder.config.today
+ else:
+ self._docinfo['date'] = ustrftime(builder.config.today_fmt
+ or _('%B %d, %Y'))
+ self._docinfo['copyright'] = builder.config.copyright
+ self._docinfo['version'] = builder.config.version
+ self._docinfo['manual_group'] = builder.config.project
+
+ # since self.append_header() is never called, need to do this here
+ self.body.append(MACRO_DEF)
+
+ # overwritten -- added quotes around all .TH arguments
+ def header(self):
+ tmpl = (".TH \"%(title_upper)s\" \"%(manual_section)s\""
+ " \"%(date)s\" \"%(version)s\" \"%(manual_group)s\"\n"
+ ".SH NAME\n"
+ "%(title)s \- %(subtitle)s\n")
+ return tmpl % self._docinfo
+
+ def visit_start_of_file(self, node):
+ pass
+ def depart_start_of_file(self, node):
+ pass
+
+ def visit_desc(self, node):
+ self.visit_definition_list(node)
+ def depart_desc(self, node):
+ self.depart_definition_list(node)
+
+ def visit_desc_signature(self, node):
+ self.visit_definition_list_item(node)
+ self.visit_term(node)
+ def depart_desc_signature(self, node):
+ self.depart_term(node)
+
+ def visit_desc_addname(self, node):
+ pass
+ def depart_desc_addname(self, node):
+ pass
+
+ def visit_desc_type(self, node):
+ pass
+ def depart_desc_type(self, node):
+ pass
+
+ def visit_desc_returns(self, node):
+ self.body.append(' -> ')
+ def depart_desc_returns(self, node):
+ pass
+
+ def visit_desc_name(self, node):
+ pass
+ def depart_desc_name(self, node):
+ pass
+
+ def visit_desc_parameterlist(self, node):
+ self.body.append('(')
+ self.first_param = 1
+ def depart_desc_parameterlist(self, node):
+ self.body.append(')')
+
+ def visit_desc_parameter(self, node):
+ if not self.first_param:
+ self.body.append(', ')
+ else:
+ self.first_param = 0
+ def depart_desc_parameter(self, node):
+ pass
+
+ def visit_desc_optional(self, node):
+ self.body.append('[')
+ def depart_desc_optional(self, node):
+ self.body.append(']')
+
+ def visit_desc_annotation(self, node):
+ pass
+ def depart_desc_annotation(self, node):
+ pass
+
+ def visit_desc_content(self, node):
+ self.visit_definition(node)
+ def depart_desc_content(self, node):
+ self.depart_definition(node)
+
+ def visit_refcount(self, node):
+ self.body.append(self.defs['emphasis'][0])
+ def depart_refcount(self, node):
+ self.body.append(self.defs['emphasis'][1])
+
+ def visit_versionmodified(self, node):
+ self.visit_paragraph(node)
+ text = versionlabels[node['type']] % node['version']
+ if len(node):
+ text += ': '
+ else:
+ text += '.'
+ self.body.append(text)
+ def depart_versionmodified(self, node):
+ self.depart_paragraph(node)
+
+ # overwritten -- we don't want source comments to show up
+ def visit_comment(self, node):
+ raise nodes.SkipNode
+
+ # overwritten -- added ensure_eol()
+ def visit_footnote(self, node):
+ self.ensure_eol()
+ BaseTranslator.visit_footnote(self, node)
+
+ # overwritten -- handle footnotes rubric
+ def visit_rubric(self, node):
+ self.ensure_eol()
+ if len(node.children) == 1:
+ rubtitle = node.children[0].astext()
+ if rubtitle in ('Footnotes', _('Footnotes')):
+ self.body.append('.SH ' + self.deunicode(rubtitle).upper() +
+ '\n')
+ raise nodes.SkipNode
+ else:
+ self.body.append('.sp\n')
+ def depart_rubric(self, node):
+ pass
+
+ def visit_seealso(self, node):
+ self.visit_admonition(node)
+ def depart_seealso(self, node):
+ self.depart_admonition(node)
+
+ # overwritten -- use our own label translations
+ def visit_admonition(self, node, name=None):
+ if name:
+ self.body.append('.IP %s\n' %
+ admonitionlabels.get(name, name))
+
+ def visit_productionlist(self, node):
+ self.ensure_eol()
+ names = []
+ self.in_productionlist += 1
+ self.body.append('.sp\n.nf\n')
+ for production in node:
+ names.append(production['tokenname'])
+ maxlen = max(len(name) for name in names)
+ for production in node:
+ if production['tokenname']:
+ lastname = production['tokenname'].ljust(maxlen)
+ self.body.append(self.defs['strong'][0])
+ self.body.append(self.deunicode(lastname))
+ self.body.append(self.defs['strong'][1])
+ self.body.append(' ::= ')
+ else:
+ self.body.append('%s ' % (' '*len(lastname)))
+ production.walkabout(self)
+ self.body.append('\n')
+ self.body.append('\n.fi\n')
+ self.in_productionlist -= 1
+ raise nodes.SkipNode
+
+ def visit_production(self, node):
+ pass
+ def depart_production(self, node):
+ pass
+
+ # overwritten -- don't emit a warning for images
+ def visit_image(self, node):
+ if 'alt' in node.attributes:
+ self.body.append('[image: %s]\n' % node['alt'])
+ self.body.append('[image]\n')
+ raise nodes.SkipNode
+
+ # overwritten -- don't visit inner marked up nodes
+ def visit_reference(self, node):
+ self.body.append(self.defs['reference'][0])
+ self.body.append(node.astext())
+ self.body.append(self.defs['reference'][1])
+ raise nodes.SkipNode
+
+ def visit_centered(self, node):
+ self.ensure_eol()
+ self.body.append('.sp\n.ce\n')
+ def depart_centered(self, node):
+ self.body.append('\n.ce 0\n')
+
+ def visit_compact_paragraph(self, node):
+ pass
+ def depart_compact_paragraph(self, node):
+ pass
+
+ def visit_highlightlang(self, node):
+ pass
+ def depart_highlightlang(self, node):
+ pass
+
+ def visit_download_reference(self, node):
+ pass
+ def depart_download_reference(self, node):
+ pass
+
+ def visit_toctree(self, node):
+ raise nodes.SkipNode
+
+ def visit_index(self, node):
+ raise nodes.SkipNode
+
+ def visit_tabular_col_spec(self, node):
+ raise nodes.SkipNode
+
+ def visit_glossary(self, node):
+ pass
+ def depart_glossary(self, node):
+ pass
+
+ def visit_acks(self, node):
+ self.ensure_eol()
+ self.body.append(', '.join(n.astext()
+ for n in node.children[0].children) + '.')
+ self.body.append('\n')
+ raise nodes.SkipNode
+
+ def visit_hlist(self, node):
+ self.visit_bullet_list(node)
+ def depart_hlist(self, node):
+ self.depart_bullet_list(node)
+
+ def visit_hlistcol(self, node):
+ pass
+ def depart_hlistcol(self, node):
+ pass
+
+ def visit_literal_emphasis(self, node):
+ return self.visit_emphasis(node)
+ def depart_literal_emphasis(self, node):
+ return self.depart_emphasis(node)
+
+ def visit_abbreviation(self, node):
+ pass
+ def depart_abbreviation(self, node):
+ pass
+
+ # overwritten: handle section titles better than in 0.6 release
+ def visit_title(self, node):
+ if isinstance(node.parent, addnodes.seealso):
+ self.body.append('.IP "')
+ return
+ elif isinstance(node.parent, nodes.section):
+ if self.section_level == 0:
+ # skip the document title
+ raise nodes.SkipNode
+ elif self.section_level == 1:
+ self.body.append('.SH %s\n' %
+ self.deunicode(node.astext().upper()))
+ raise nodes.SkipNode
+ return BaseTranslator.visit_title(self, node)
+ def depart_title(self, node):
+ if isinstance(node.parent, addnodes.seealso):
+ self.body.append('"\n')
+ return
+ return BaseTranslator.depart_title(self, node)
+
+ def visit_raw(self, node):
+ if 'manpage' in node.get('format', '').split():
+ self.body.append(node.astext())
+ raise nodes.SkipNode
+
+ def unknown_visit(self, node):
+ raise NotImplementedError('Unknown node: ' + node.__class__.__name__)
diff --git a/sphinx/writers/text.py b/sphinx/writers/text.py
index d897a1a0d..98528d5ba 100644
--- a/sphinx/writers/text.py
+++ b/sphinx/writers/text.py
@@ -15,7 +15,7 @@ import textwrap
from docutils import nodes, writers
from sphinx import addnodes
-from sphinx.locale import admonitionlabels, versionlabels
+from sphinx.locale import admonitionlabels, versionlabels, _
class TextWriter(writers.Writer):
@@ -47,7 +47,7 @@ STDINDENT = 3
class TextTranslator(nodes.NodeVisitor):
- sectionchars = '*=-~"+'
+ sectionchars = '*=-~"+`'
def __init__(self, document, builder):
nodes.NodeVisitor.__init__(self, document)
@@ -161,13 +161,6 @@ class TextTranslator(nodes.NodeVisitor):
def depart_attribution(self, node):
pass
- def visit_module(self, node):
- if node.has_key('platform'):
- self.new_state(0)
- self.add_text(_('Platform: %s') % node['platform'])
- self.end_state()
- raise nodes.SkipNode
-
def visit_desc(self, node):
pass
def depart_desc(self, node):
@@ -175,8 +168,8 @@ class TextTranslator(nodes.NodeVisitor):
def visit_desc_signature(self, node):
self.new_state(0)
- if node.parent['desctype'] in ('class', 'exception'):
- self.add_text('%s ' % node.parent['desctype'])
+ if node.parent['objtype'] in ('class', 'exception'):
+ self.add_text('%s ' % node.parent['objtype'])
def depart_desc_signature(self, node):
# XXX: wrap signatures in a way that makes sense
self.end_state(wrap=False, end=None)
diff --git a/tests/coverage.py b/tests/coverage.py
index 148e573c6..117fd4f29 100755
--- a/tests/coverage.py
+++ b/tests/coverage.py
@@ -106,20 +106,20 @@ class StatementFindingAstVisitor(compiler.visitor.ASTVisitor):
self.excluded = excluded
self.suite_spots = suite_spots
self.excluding_suite = 0
-
+
def doRecursive(self, node):
for n in node.getChildNodes():
self.dispatch(n)
visitStmt = visitModule = doRecursive
-
+
def doCode(self, node):
if hasattr(node, 'decorators') and node.decorators:
self.dispatch(node.decorators)
self.recordAndDispatch(node.code)
else:
self.doSuite(node, node.code)
-
+
visitFunction = visitClass = doCode
def getFirstLine(self, node):
@@ -139,14 +139,14 @@ class StatementFindingAstVisitor(compiler.visitor.ASTVisitor):
for n in node.getChildNodes():
lineno = max(lineno, self.getLastLine(n))
return lineno
-
+
def doStatement(self, node):
self.recordLine(self.getFirstLine(node))
visitAssert = visitAssign = visitAssTuple = visitPrint = \
visitPrintnl = visitRaise = visitSubscript = visitDecorators = \
doStatement
-
+
def visitPass(self, node):
# Pass statements have weird interactions with docstrings. If this
# pass statement is part of one of those pairs, claim that the statement
@@ -155,10 +155,10 @@ class StatementFindingAstVisitor(compiler.visitor.ASTVisitor):
if l:
lines = self.suite_spots.get(l, [l,l])
self.statements[lines[1]] = 1
-
+
def visitDiscard(self, node):
# Discard nodes are statements that execute an expression, but then
- # discard the results. This includes function calls, so we can't
+ # discard the results. This includes function calls, so we can't
# ignore them all. But if the expression is a constant, the statement
# won't be "executed", so don't count it now.
if node.expr.__class__.__name__ != 'Const':
@@ -172,7 +172,7 @@ class StatementFindingAstVisitor(compiler.visitor.ASTVisitor):
return self.recordLine(self.getFirstLine(node))
else:
return 0
-
+
def recordLine(self, lineno):
# Returns a bool, whether the line is included or excluded.
if lineno:
@@ -196,9 +196,9 @@ class StatementFindingAstVisitor(compiler.visitor.ASTVisitor):
self.statements[lineno] = 1
return 1
return 0
-
+
default = recordNodeLine
-
+
def recordAndDispatch(self, node):
self.recordNodeLine(node)
self.dispatch(node)
@@ -209,7 +209,7 @@ class StatementFindingAstVisitor(compiler.visitor.ASTVisitor):
self.excluding_suite = 1
self.recordAndDispatch(body)
self.excluding_suite = exsuite
-
+
def doPlainWordSuite(self, prevsuite, suite):
# Finding the exclude lines for else's is tricky, because they aren't
# present in the compiler parse tree. Look at the previous suite,
@@ -223,11 +223,11 @@ class StatementFindingAstVisitor(compiler.visitor.ASTVisitor):
break
else:
self.doSuite(None, suite)
-
+
def doElse(self, prevsuite, node):
if node.else_:
self.doPlainWordSuite(prevsuite, node.else_)
-
+
def visitFor(self, node):
self.doSuite(node, node.body)
self.doElse(node.body, node)
@@ -257,14 +257,14 @@ class StatementFindingAstVisitor(compiler.visitor.ASTVisitor):
else:
self.doSuite(a, h)
self.doElse(node.handlers[-1][2], node)
-
+
def visitTryFinally(self, node):
self.doSuite(node, node.body)
self.doPlainWordSuite(node.body, node.final)
-
+
def visitWith(self, node):
self.doSuite(node, node.body)
-
+
def visitGlobal(self, node):
# "global" statements don't execute like others (they don't call the
# trace function), so don't record their line numbers.
@@ -285,7 +285,7 @@ class coverage:
# A dictionary with an entry for (Python source file name, line number
# in that file) if that line has been executed.
c = {}
-
+
# A map from canonical Python source file name to a dictionary in
# which there's an entry for each line number that has been
# executed.
@@ -313,19 +313,19 @@ class coverage:
self.relative_dir = self.abs_file(os.curdir)+os.sep
self.exclude('# *pragma[: ]*[nN][oO] *[cC][oO][vV][eE][rR]')
- # t(f, x, y). This method is passed to sys.settrace as a trace function.
- # See [van Rossum 2001-07-20b, 9.2] for an explanation of sys.settrace and
+ # t(f, x, y). This method is passed to sys.settrace as a trace function.
+ # See [van Rossum 2001-07-20b, 9.2] for an explanation of sys.settrace and
# the arguments and return value of the trace function.
# See [van Rossum 2001-07-20a, 3.2] for a description of frame and code
# objects.
-
+
def t(self, f, w, unused): #pragma: no cover
if w == 'line':
self.c[(f.f_code.co_filename, f.f_lineno)] = 1
#-for c in self.cstack:
#- c[(f.f_code.co_filename, f.f_lineno)] = 1
return self.t
-
+
def help(self, error=None): #pragma: no cover
if error:
print error
@@ -377,14 +377,14 @@ class coverage:
args_needed = (settings.get('execute')
or settings.get('annotate')
or settings.get('report'))
- action = (settings.get('erase')
+ action = (settings.get('erase')
or settings.get('collect')
or args_needed)
if not action:
help_fn("You must specify at least one of -e, -x, -c, -r, or -a.")
if not args_needed and args:
help_fn("Unexpected arguments: %s" % " ".join(args))
-
+
self.parallel_mode = settings.get('parallel-mode')
self.get_ready()
@@ -402,7 +402,7 @@ class coverage:
self.collect()
if not args:
args = self.cexecuted.keys()
-
+
ignore_errors = settings.get('ignore-errors')
show_missing = settings.get('show-missing')
directory = settings.get('directory=')
@@ -412,7 +412,7 @@ class coverage:
omit = [self.abs_file(p) for p in omit.split(',')]
else:
omit = []
-
+
if settings.get('report'):
self.report(args, show_missing, ignore_errors, omit_prefixes=omit)
if settings.get('annotate'):
@@ -422,7 +422,7 @@ class coverage:
self.usecache = usecache
if cache_file and not self.cache:
self.cache_default = cache_file
-
+
def get_ready(self, parallel_mode=False):
if self.usecache and not self.cache:
self.cache = os.environ.get(self.cache_env, self.cache_default)
@@ -430,7 +430,7 @@ class coverage:
self.cache += "." + gethostname() + "." + str(os.getpid())
self.restore()
self.analysis_cache = {}
-
+
def start(self, parallel_mode=False):
self.get_ready()
if self.nesting == 0: #pragma: no cover
@@ -438,7 +438,7 @@ class coverage:
if hasattr(threading, 'settrace'):
threading.settrace(self.t)
self.nesting += 1
-
+
def stop(self):
self.nesting -= 1
if self.nesting == 0: #pragma: no cover
@@ -462,7 +462,7 @@ class coverage:
def begin_recursive(self):
self.cstack.append(self.c)
self.xstack.append(self.exclude_re)
-
+
def end_recursive(self):
self.c = self.cstack.pop()
self.exclude_re = self.xstack.pop()
@@ -568,7 +568,7 @@ class coverage:
self.canonical_filename_cache[filename] = cf
return self.canonical_filename_cache[filename]
- # canonicalize_filenames(). Copy results from "c" to "cexecuted",
+ # canonicalize_filenames(). Copy results from "c" to "cexecuted",
# canonicalizing filenames on the way. Clear the "c" map.
def canonicalize_filenames(self):
@@ -598,7 +598,7 @@ class coverage:
# in the source code, (3) a list of lines of excluded statements,
# and (4), a map of line numbers to multi-line line number ranges, for
# statements that cross lines.
-
+
def analyze_morf(self, morf):
if self.analysis_cache.has_key(morf):
return self.analysis_cache[morf]
@@ -636,26 +636,26 @@ class coverage:
if len(tree) == 3 and type(tree[2]) == type(1):
return tree[2]
tree = tree[1]
-
+
def last_line_of_tree(self, tree):
while True:
if len(tree) == 3 and type(tree[2]) == type(1):
return tree[2]
tree = tree[-1]
-
+
def find_docstring_pass_pair(self, tree, spots):
for i in range(1, len(tree)):
if self.is_string_constant(tree[i]) and self.is_pass_stmt(tree[i+1]):
first_line = self.first_line_of_tree(tree[i])
last_line = self.last_line_of_tree(tree[i+1])
self.record_multiline(spots, first_line, last_line)
-
+
def is_string_constant(self, tree):
try:
return tree[0] == symbol.stmt and tree[1][1][1][0] == symbol.expr_stmt
except:
return False
-
+
def is_pass_stmt(self, tree):
try:
return tree[0] == symbol.stmt and tree[1][1][1][0] == symbol.pass_stmt
@@ -665,7 +665,7 @@ class coverage:
def record_multiline(self, spots, i, j):
for l in range(i, j+1):
spots[l] = (i, j)
-
+
def get_suite_spots(self, tree, spots):
""" Analyze a parse tree to find suite introducers which span a number
of lines.
@@ -707,7 +707,7 @@ class coverage:
# treat them differently, especially in the common case of a
# function with a doc string and a single pass statement.
self.find_docstring_pass_pair(tree[i], spots)
-
+
elif tree[i][0] == symbol.simple_stmt:
first_line = self.first_line_of_tree(tree[i])
last_line = self.last_line_of_tree(tree[i])
@@ -732,7 +732,7 @@ class coverage:
tree = parser.suite(text+'\n\n').totuple(1)
self.get_suite_spots(tree, suite_spots)
#print "Suite spots:", suite_spots
-
+
# Use the compiler module to parse the text and find the executable
# statements. We add newlines to be impervious to final partial lines.
statements = {}
@@ -842,7 +842,7 @@ class coverage:
else:
globbed.append(morf)
morfs = globbed
-
+
morfs = self.filter_by_prefix(morfs, omit_prefixes)
morfs.sort(self.morf_name_compare)
@@ -909,7 +909,7 @@ class coverage:
except:
if not ignore_errors:
raise
-
+
def annotate_file(self, filename, statements, excluded, missing, directory=None):
source = open(filename, 'r')
if directory:
@@ -937,7 +937,7 @@ class coverage:
if self.blank_re.match(line):
dest.write(' ')
elif self.else_re.match(line):
- # Special logic for lines containing only 'else:'.
+ # Special logic for lines containing only 'else:'.
# See [GDR 2001-12-04b, 3.2].
if i >= len(statements) and j >= len(missing):
dest.write('! ')
@@ -961,40 +961,40 @@ class coverage:
the_coverage = coverage()
# Module functions call methods in the singleton object.
-def use_cache(*args, **kw):
+def use_cache(*args, **kw):
return the_coverage.use_cache(*args, **kw)
-def start(*args, **kw):
+def start(*args, **kw):
return the_coverage.start(*args, **kw)
-def stop(*args, **kw):
+def stop(*args, **kw):
return the_coverage.stop(*args, **kw)
-def erase(*args, **kw):
+def erase(*args, **kw):
return the_coverage.erase(*args, **kw)
-def begin_recursive(*args, **kw):
+def begin_recursive(*args, **kw):
return the_coverage.begin_recursive(*args, **kw)
-def end_recursive(*args, **kw):
+def end_recursive(*args, **kw):
return the_coverage.end_recursive(*args, **kw)
-def exclude(*args, **kw):
+def exclude(*args, **kw):
return the_coverage.exclude(*args, **kw)
-def analysis(*args, **kw):
+def analysis(*args, **kw):
return the_coverage.analysis(*args, **kw)
-def analysis2(*args, **kw):
+def analysis2(*args, **kw):
return the_coverage.analysis2(*args, **kw)
-def report(*args, **kw):
+def report(*args, **kw):
return the_coverage.report(*args, **kw)
-def annotate(*args, **kw):
+def annotate(*args, **kw):
return the_coverage.annotate(*args, **kw)
-def annotate_file(*args, **kw):
+def annotate_file(*args, **kw):
return the_coverage.annotate_file(*args, **kw)
# Save coverage data when Python exits. (The atexit module wasn't
@@ -1008,7 +1008,7 @@ except ImportError:
def main():
the_coverage.command_line(sys.argv[1:])
-
+
# Command-line interface.
if __name__ == '__main__':
main()
@@ -1072,7 +1072,7 @@ if __name__ == '__main__':
# Thanks, Allen.
#
# 2005-12-02 NMB Call threading.settrace so that all threads are measured.
-# Thanks Martin Fuzzey. Add a file argument to report so that reports can be
+# Thanks Martin Fuzzey. Add a file argument to report so that reports can be
# captured to a different destination.
#
# 2005-12-03 NMB coverage.py can now measure itself.
diff --git a/tests/root/_static/README b/tests/root/_static/README
index d517219be..9e1ec3569 100644
--- a/tests/root/_static/README
+++ b/tests/root/_static/README
@@ -1 +1 @@
-This placeholder file is there because Mercurial ignores empty directories.
+This whole directory is there to test html_static_path.
diff --git a/tests/root/_static/excluded.css b/tests/root/_static/excluded.css
new file mode 100644
index 000000000..03c941a44
--- /dev/null
+++ b/tests/root/_static/excluded.css
@@ -0,0 +1 @@
+/* This file should be excluded from being copied over */
diff --git a/tests/root/_static/subdir/foo.css b/tests/root/_static/subdir/foo.css
new file mode 100644
index 000000000..9427981d6
--- /dev/null
+++ b/tests/root/_static/subdir/foo.css
@@ -0,0 +1 @@
+/* Stub file */
diff --git a/tests/root/_templates/contentssb.html b/tests/root/_templates/contentssb.html
new file mode 100644
index 000000000..9951d3c35
--- /dev/null
+++ b/tests/root/_templates/contentssb.html
@@ -0,0 +1,2 @@
+{# sidebar only for contents document #}
+<h4>Contents sidebar</h4> \ No newline at end of file
diff --git a/tests/root/_templates/customsb.html b/tests/root/_templates/customsb.html
new file mode 100644
index 000000000..cc88b8cfb
--- /dev/null
+++ b/tests/root/_templates/customsb.html
@@ -0,0 +1,2 @@
+{# custom sidebar template #}
+<h4>Custom sidebar</h4>
diff --git a/tests/root/_templates/layout.html b/tests/root/_templates/layout.html
index 7f290fc1e..82125df8e 100644
--- a/tests/root/_templates/layout.html
+++ b/tests/root/_templates/layout.html
@@ -1,4 +1,5 @@
{% extends "!layout.html" %}
+
{% block extrahead %}
{# html_context variable from conf.py #}
<meta name="hc" content="{{ hckey }}" />
@@ -6,3 +7,9 @@
<meta name="hc_co" content="{{ hckey_co }}" />
{{ super() }}
{% endblock %}
+
+{% block sidebartoc %}
+{# display global TOC in addition to local TOC #}
+{{ super() }}
+{{ toctree(collapse=False, maxdepth=-1) }}
+{% endblock %} \ No newline at end of file
diff --git a/tests/root/conf.py b/tests/root/conf.py
index 19c803c98..0a08076db 100644
--- a/tests/root/conf.py
+++ b/tests/root/conf.py
@@ -4,9 +4,10 @@ import sys, os
sys.path.append(os.path.abspath('.'))
-extensions = ['ext', 'sphinx.ext.autodoc', 'sphinx.ext.jsmath',
- 'sphinx.ext.coverage', 'sphinx.ext.todo',
- 'sphinx.ext.autosummary', 'sphinx.ext.doctest']
+extensions = ['sphinx.ext.autodoc', 'sphinx.ext.jsmath', 'sphinx.ext.todo',
+ 'sphinx.ext.coverage', 'sphinx.ext.autosummary',
+ 'sphinx.ext.doctest', 'sphinx.ext.extlinks',
+ 'sphinx.ext.oldcmarkup', 'ext']
jsmath_path = 'dummy.js'
@@ -16,24 +17,26 @@ master_doc = 'contents'
source_suffix = '.txt'
project = 'Sphinx <Tests>'
-copyright = '2008, Georg Brandl & Team'
+copyright = '2010, Georg Brandl & Team'
# If this is changed, remember to update the versionchanges!
version = '0.6'
release = '0.6alpha1'
today_fmt = '%B %d, %Y'
#unused_docs = []
-exclude_trees = ['_build']
+exclude_patterns = ['_build', '**/excluded.*']
keep_warnings = True
pygments_style = 'sphinx'
+show_authors = True
rst_epilog = '.. |subst| replace:: global substitution'
html_theme = 'testtheme'
html_theme_path = ['.']
html_theme_options = {'testopt': 'testoverride'}
-
+html_sidebars = {'**': 'customsb.html',
+ 'contents': ['contentssb.html', 'localtoc.html'] }
html_style = 'default.css'
-html_static_path = ['_static']
+html_static_path = ['_static', 'templated.css_t']
html_last_updated_fmt = '%b %d, %Y'
html_context = {'hckey': 'hcval', 'hckey_co': 'wrong_hcval_co'}
@@ -49,14 +52,22 @@ latex_additional_files = ['svgimg.svg']
value_from_conf_py = 84
coverage_c_path = ['special/*.h']
-coverage_c_regexes = {'cfunction': r'^PyAPI_FUNC\(.*\)\s+([^_][\w_]+)'}
+coverage_c_regexes = {'function': r'^PyAPI_FUNC\(.*\)\s+([^_][\w_]+)'}
autosummary_generate = ['autosummary']
+extlinks = {'issue': ('http://bugs.python.org/issue%s', 'issue '),
+ 'pyurl': ('http://python.org/%s', None)}
+
# modify tags from conf.py
tags.add('confpytag')
+
+# -- extension API
+
+from docutils import nodes
from sphinx import addnodes
+from sphinx.util.compat import Directive
def userdesc_parse(env, sig, signode):
x, y = sig.split(':')
@@ -65,7 +76,18 @@ def userdesc_parse(env, sig, signode):
signode[-1] += addnodes.desc_parameter(y, y)
return x
+def functional_directive(name, arguments, options, content, lineno,
+ content_offset, block_text, state, state_machine):
+ return [nodes.strong(text='from function: %s' % options['opt'])]
+
+class ClassDirective(Directive):
+ option_spec = {'opt': lambda x: x}
+ def run(self):
+ return [nodes.strong(text='from class: %s' % self.options['opt'])]
+
def setup(app):
app.add_config_value('value_from_conf_py', 42, False)
- app.add_description_unit('userdesc', 'userdescrole', '%s (userdesc)',
- userdesc_parse)
+ app.add_directive('funcdir', functional_directive, opt=lambda x: x)
+ app.add_directive('clsdir', ClassDirective)
+ app.add_object_type('userdesc', 'userdescrole', '%s (userdesc)',
+ userdesc_parse, objname='user desc')
diff --git a/tests/root/contents.txt b/tests/root/contents.txt
index 503cb5e1e..e052e04b2 100644
--- a/tests/root/contents.txt
+++ b/tests/root/contents.txt
@@ -11,16 +11,19 @@ Contents:
:maxdepth: 2
:numbered:
+ extapi
images
subdir/images
subdir/includes
includes
markup
- desc
+ objects
bom
math
autodoc
autosummary
+ metadata
+ extensions
doctest
extensions
diff --git a/tests/root/desc.txt b/tests/root/desc.txt
deleted file mode 100644
index d6915dc27..000000000
--- a/tests/root/desc.txt
+++ /dev/null
@@ -1,71 +0,0 @@
-Testing description units
-=========================
-
-.. function:: func_without_module(a, b, *c[, d])
-
- Does something.
-
-.. function:: func_without_body()
-
-.. function:: func_noindex
- :noindex:
-
-
-.. module:: mod
- :synopsis: Module synopsis.
- :platform: UNIX
-
-.. function:: func_in_module
-
-.. class:: Cls
-
- .. method:: meth1
-
- .. staticmethod:: meths
-
- .. attribute:: attr
-
-.. explicit class given
-.. method:: Cls.meth2
-
-.. explicit module given
-.. exception:: Error(arg1, arg2)
- :module: errmod
-
-.. data:: var
-
-
-.. currentmodule:: None
-
-.. function:: func_without_module2() -> annotation
-
-
-C items
-=======
-
-.. cfunction:: Sphinx_DoSomething()
-
-.. cmember:: SphinxStruct.member
-
-.. cmacro:: SPHINX_USE_PYTHON
-
-.. ctype:: SphinxType
-
-.. cvar:: sphinx_global
-
-
-Testing references
-==================
-
-Referencing :class:`mod.Cls` or :Class:`mod.Cls` should be the same.
-
-
-User markup
-===========
-
-.. userdesc:: myobj:parameter
-
- Description of userdesc.
-
-
-Referencing :userdescrole:`myobj`.
diff --git a/tests/root/extapi.txt b/tests/root/extapi.txt
new file mode 100644
index 000000000..4728e3de1
--- /dev/null
+++ b/tests/root/extapi.txt
@@ -0,0 +1,10 @@
+Extension API tests
+===================
+
+Testing directives:
+
+.. funcdir::
+ :opt: Foo
+
+.. clsdir::
+ :opt: Bar
diff --git a/tests/root/extensions.txt b/tests/root/extensions.txt
index 70c8959fa..96b1f8ef3 100644
--- a/tests/root/extensions.txt
+++ b/tests/root/extensions.txt
@@ -1,6 +1,13 @@
Test for diverse extensions
===========================
+extlinks
+--------
+
+Test diverse links: :issue:`1000` and :pyurl:`dev/`, also with
+:issue:`explicit caption <1042>`.
+
+
todo
----
@@ -19,4 +26,3 @@ list of all todos
^^^^^^^^^^^^^^^^^
.. todolist::
-
diff --git a/tests/root/includes.txt b/tests/root/includes.txt
index 4fe13ed64..85cf19701 100644
--- a/tests/root/includes.txt
+++ b/tests/root/includes.txt
@@ -44,12 +44,27 @@ Literalinclude options
:start-after: coding: utf-8
:end-before: class Foo
+.. cssclass:: inc-preappend
+.. literalinclude:: literal.inc
+ :prepend: START CODE
+ :append: END CODE
+
.. literalinclude:: literal.inc
:start-after: utf-8
.. literalinclude:: literal.inc
:end-before: class Foo
+.. cssclass:: inc-tab3
+.. literalinclude:: tabs.inc
+ :tab-width: 3
+ :language: text
+
+.. cssclass:: inc-tab8
+.. literalinclude:: tabs.inc
+ :tab-width: 8
+ :language: python
+
Test if dedenting before parsing works.
.. highlight:: python
diff --git a/tests/root/markup.txt b/tests/root/markup.txt
index cdb8c5fcd..7b68ba268 100644
--- a/tests/root/markup.txt
+++ b/tests/root/markup.txt
@@ -5,7 +5,11 @@
Testing various markup
======================
+Meta markup
+-----------
+
.. sectionauthor:: Georg Brandl
+.. moduleauthor:: Georg Brandl
.. contents:: TOC
@@ -13,7 +17,11 @@ Testing various markup
:author: Me
:keywords: docs, sphinx
-A |subst|.
+
+Generic reST
+------------
+
+A |subst| (the definition is in rst_epilog).
.. _label:
@@ -21,22 +29,14 @@ A |subst|.
some code
-Admonitions
------------
-
-.. note:: Note
- Note text.
-
-.. warning:: Warning
-
- Warning text.
+Option list:
-.. tip::
- Tip text.
+-h help
+--help also help
Body directives
----------------
+^^^^^^^^^^^^^^^
.. topic:: Title
@@ -69,7 +69,74 @@ Body directives
b
-
+
+.. _admonition-section:
+
+Admonitions
+^^^^^^^^^^^
+
+.. admonition:: My Admonition
+
+ Admonition text.
+
+.. note::
+ Note text.
+
+.. warning::
+
+ Warning text.
+
+.. _some-label:
+
+.. tip::
+ Tip text.
+
+
+Inline markup
+-------------
+
+*Generic inline markup*
+
+* :command:`command`
+* :dfn:`dfn`
+* :guilabel:`guilabel with &accelerator`
+* :kbd:`kbd`
+* :mailheader:`mailheader`
+* :makevar:`makevar`
+* :manpage:`manpage`
+* :mimetype:`mimetype`
+* :newsgroup:`newsgroup`
+* :program:`program`
+* :regexp:`regexp`
+* :menuselection:`File --> Close`
+* :menuselection:`&File --> &Print`
+* :file:`a/{varpart}/b`
+* :samp:`print {i}`
+
+*Linking inline markup*
+
+* :pep:`8`
+* :rfc:`1`
+* :envvar:`HOME`
+* :keyword:`with`
+* :token:`try statement <try_stmt>`
+* :ref:`admonition-section`
+* :ref:`here <some-label>`
+* :doc:`subdir/includes`
+* ``:download:`` is tested in includes.txt
+* :option:`Python -c option <python -c>`
+
+Test :abbr:`abbr (abbreviation)` and another :abbr:`abbr (abbreviation)`.
+
+
+.. _with:
+
+With
+----
+
+(Empty section.)
+
+
Tables
------
@@ -96,6 +163,17 @@ Version markup
Boring stuff.
+Code blocks
+-----------
+
+.. code-block:: ruby
+ :linenos:
+
+ def ruby?
+ false
+ end
+
+
Misc stuff
----------
@@ -124,11 +202,6 @@ This is a side note.
This tests :CLASS:`role names in uppercase`.
-Option list:
-
--h help
---help also help
-
.. centered:: LICENSE AGREEMENT
.. acks::
@@ -146,7 +219,7 @@ Option list:
Particle with half-integer spin.
.. productionlist::
- try_stmt: try1_stmt | try2_stmt
+ try_stmt: `try1_stmt` | `try2_stmt`
try1_stmt: "try" ":" `suite`
: ("except" [`expression` ["," `target`]] ":" `suite`)+
: ["else" ":" `suite`]
@@ -154,7 +227,6 @@ Option list:
try2_stmt: "try" ":" `suite`
: "finally" ":" `suite`
-Test :abbr:`abbr (abbreviation)` and another :abbr:`abbr (abbreviation)`.
Index markup
------------
@@ -180,11 +252,6 @@ Invalid index markup...
Testing öäü...
-Object markup
--------------
-
-:cfunc:`CFunction`.
-
Only directive
--------------
@@ -208,3 +275,4 @@ Only directive
.. rubric:: Footnotes
.. [#] Like footnotes.
+
diff --git a/tests/root/metadata.txt b/tests/root/metadata.txt
new file mode 100644
index 000000000..9b3044ba8
--- /dev/null
+++ b/tests/root/metadata.txt
@@ -0,0 +1,53 @@
+:Author: David Goodger
+:Address: 123 Example Street
+ Example, EX Canada
+ A1B 2C3
+:Contact: goodger@python.org
+:Authors: Me; Myself; I
+:organization: humankind
+:date: $Date: 2006-05-21 22:44:42 +0200 (Son, 21 Mai 2006) $
+:status: This is a "work in progress"
+:revision: $Revision: 4564 $
+:version: 1
+:copyright: This document has been placed in the public domain. You
+ may do with it as you wish. You may copy, modify,
+ redistribute, reattribute, sell, buy, rent, lease,
+ destroy, or improve it, quote it at length, excerpt,
+ incorporate, collate, fold, staple, or mutilate it, or do
+ anything else to it that your or anyone else's heart
+ desires.
+:field name: This is a generic bibliographic field.
+:field name 2:
+ Generic bibliographic fields may contain multiple body elements.
+
+ Like this.
+
+:Dedication:
+
+ For Docutils users & co-developers.
+
+:abstract:
+
+ This document is a demonstration of the reStructuredText markup
+ language, containing examples of all basic reStructuredText
+ constructs and many advanced constructs.
+
+.. meta::
+ :keywords: reStructuredText, demonstration, demo, parser
+ :description lang=en: A demonstration of the reStructuredText
+ markup language, containing examples of all basic
+ constructs and many advanced constructs.
+
+================================
+ reStructuredText Demonstration
+================================
+
+.. Above is the document title, and below is the subtitle.
+ They are transformed from section titles after parsing.
+
+--------------------------------
+ Examples of Syntax Constructs
+--------------------------------
+
+.. bibliographic fields (which also require a transform):
+
diff --git a/tests/root/objects.txt b/tests/root/objects.txt
new file mode 100644
index 000000000..ca3d0eb76
--- /dev/null
+++ b/tests/root/objects.txt
@@ -0,0 +1,145 @@
+Testing object descriptions
+===========================
+
+.. function:: func_without_module(a, b, *c[, d])
+
+ Does something.
+
+.. function:: func_without_body()
+
+.. function:: func_noindex
+ :noindex:
+
+.. function:: func_with_module
+ :module: foolib
+
+.. module:: mod
+ :synopsis: Module synopsis.
+ :platform: UNIX
+
+.. function:: func_in_module
+
+.. class:: Cls
+
+ .. method:: meth1
+
+ .. staticmethod:: meths
+
+ .. attribute:: attr
+
+.. explicit class given
+.. method:: Cls.meth2
+
+.. explicit module given
+.. exception:: Error(arg1, arg2)
+ :module: errmod
+
+.. data:: var
+
+
+.. currentmodule:: None
+
+.. function:: func_without_module2() -> annotation
+
+.. class:: TimeInt
+
+.. class:: Time(hour, minute, isdst)
+
+ :param hour: The year.
+ :type hour: TimeInt
+ :param TimeInt minute: The minute.
+ :param isdst: whether it's DST
+ :type isdst: * some complex
+ * expression
+ :returns: a new :class:`Time` instance
+ :rtype: :class:`Time`
+ :raises ValueError: if the values are out of range
+ :ivar int hour: like *hour*
+ :ivar minute: like *minute*
+ :vartype minute: int
+
+
+C items
+=======
+
+.. c:function:: Sphinx_DoSomething()
+
+.. c:member:: SphinxStruct.member
+
+.. c:macro:: SPHINX_USE_PYTHON
+
+.. c:type:: SphinxType
+
+.. c:var:: sphinx_global
+
+
+Old C items (from oldcmarkup ext)
+---------------------------------
+
+.. cfunction:: Sphinx_Func()
+
+Refer to :cfunc:`Sphinx_Func`.
+
+
+Javascript items
+================
+
+.. js:function:: foo()
+
+.. js:data:: bar
+
+.. documenting the method of any object
+.. js:function:: bar.baz(href, callback[, errback])
+
+ :param string href: The location of the resource.
+ :param callback: Get's called with the data returned by the resource.
+ :throws InvalidHref: If the `href` is invalid.
+ :returns: `undefined`
+
+.. js:attribute:: bar.spam
+
+References
+==========
+
+Referencing :class:`mod.Cls` or :Class:`mod.Cls` should be the same.
+
+With target: :c:func:`Sphinx_DoSomething()` (parentheses are handled),
+:c:member:`SphinxStruct.member`, :c:macro:`SPHINX_USE_PYTHON`,
+:c:type:`SphinxType *` (pointer is handled), :c:data:`sphinx_global`.
+
+Without target: :c:func:`CFunction`. :c:func:`!malloc`.
+
+:js:func:`foo()`
+:js:func:`foo`
+
+:js:data:`bar`
+:js:func:`bar.baz()`
+:js:func:`bar.baz`
+:js:func:`~bar.baz()`
+
+:js:attr:`bar.baz`
+
+
+Others
+======
+
+.. envvar:: HOME
+
+.. program:: python
+
+.. cmdoption:: -c command
+
+.. program:: perl
+
+.. cmdoption:: -c
+
+
+User markup
+===========
+
+.. userdesc:: myobj:parameter
+
+ Description of userdesc.
+
+
+Referencing :userdescrole:`myobj`.
diff --git a/tests/root/subdir/excluded.txt b/tests/root/subdir/excluded.txt
new file mode 100644
index 000000000..5df3139b4
--- /dev/null
+++ b/tests/root/subdir/excluded.txt
@@ -0,0 +1,2 @@
+Excluded file -- should *not* be read as source
+-----------------------------------------------
diff --git a/tests/root/tabs.inc b/tests/root/tabs.inc
new file mode 100644
index 000000000..20b51820d
--- /dev/null
+++ b/tests/root/tabs.inc
@@ -0,0 +1,5 @@
+Tabs include file test
+----------------------
+
+The next line has a tab:
+-| |-
diff --git a/tests/root/templated.css_t b/tests/root/templated.css_t
new file mode 100644
index 000000000..72ddb807c
--- /dev/null
+++ b/tests/root/templated.css_t
@@ -0,0 +1,2 @@
+/* Stub file, templated */
+{{ sphinx_version }}
diff --git a/tests/test_autodoc.py b/tests/test_autodoc.py
index e0845b67a..62768b202 100644
--- a/tests/test_autodoc.py
+++ b/tests/test_autodoc.py
@@ -14,7 +14,7 @@ from util import *
from docutils.statemachine import ViewList
-from sphinx.ext.autodoc import AutoDirective, Documenter, add_documenter, \
+from sphinx.ext.autodoc import AutoDirective, add_documenter, \
ModuleLevelDocumenter, FunctionDocumenter, cut_lines, between, ALL
@@ -97,28 +97,28 @@ def test_parse_name():
verify('function', 'util.raises', ('util', ['raises'], None, None))
verify('function', 'util.raises(exc) -> None',
('util', ['raises'], 'exc', 'None'))
- directive.env.autodoc_current_module = 'util'
+ directive.env.temp_data['autodoc:module'] = 'util'
verify('function', 'raises', ('util', ['raises'], None, None))
- directive.env.autodoc_current_module = None
- directive.env.currmodule = 'util'
+ del directive.env.temp_data['autodoc:module']
+ directive.env.temp_data['py:module'] = 'util'
verify('function', 'raises', ('util', ['raises'], None, None))
verify('class', 'TestApp', ('util', ['TestApp'], None, None))
# for members
- directive.env.currmodule = 'foo'
+ directive.env.temp_data['py:module'] = 'foo'
verify('method', 'util.TestApp.cleanup',
('util', ['TestApp', 'cleanup'], None, None))
- directive.env.currmodule = 'util'
- directive.env.currclass = 'Foo'
- directive.env.autodoc_current_class = 'TestApp'
+ directive.env.temp_data['py:module'] = 'util'
+ directive.env.temp_data['py:class'] = 'Foo'
+ directive.env.temp_data['autodoc:class'] = 'TestApp'
verify('method', 'cleanup', ('util', ['TestApp', 'cleanup'], None, None))
verify('method', 'TestApp.cleanup',
('util', ['TestApp', 'cleanup'], None, None))
# and clean up
- directive.env.currmodule = None
- directive.env.currclass = None
- directive.env.autodoc_current_class = None
+ del directive.env.temp_data['py:module']
+ del directive.env.temp_data['py:class']
+ del directive.env.temp_data['autodoc:class']
def test_format_signature():
@@ -307,7 +307,7 @@ def test_new_documenter():
del directive.result[:]
options.members = ['integer']
- assert_result_contains('.. data:: integer', 'module', 'test_autodoc')
+ assert_result_contains('.. py:data:: integer', 'module', 'test_autodoc')
def test_generate():
@@ -341,6 +341,26 @@ def test_generate():
assert item in directive.result
del directive.result[:]
+ def assert_order(items, objtype, name, member_order, **kw):
+ inst = AutoDirective._registry[objtype](directive, name)
+ inst.options.member_order = member_order
+ inst.generate(**kw)
+ assert len(_warnings) == 0, _warnings
+ items = list(reversed(items))
+ lineiter = iter(directive.result)
+ #for line in directive.result:
+ # if line.strip():
+ # print repr(line)
+ while items:
+ item = items.pop()
+ for line in lineiter:
+ if line == item:
+ break
+ else: # ran out of items!
+ assert False, 'item %r not found in result or not in the ' \
+ ' correct order' % item
+ del directive.result[:]
+
options.members = []
# no module found?
@@ -354,7 +374,7 @@ def test_generate():
'function', 'util.foobar', more_content=None)
# test auto and given content mixing
- directive.env.currmodule = 'test_autodoc'
+ directive.env.temp_data['py:module'] = 'test_autodoc'
assert_result_contains(' Function.', 'method', 'Class.meth')
add_content = ViewList()
add_content.append('Content.', '', 0)
@@ -383,7 +403,10 @@ def test_generate():
('attribute', 'test_autodoc.Class.descr'),
('attribute', 'test_autodoc.Class.attr'),
('attribute', 'test_autodoc.Class.docattr'),
- ('attribute', 'test_autodoc.Class.udocattr')])
+ ('attribute', 'test_autodoc.Class.udocattr'),
+ ('attribute', 'test_autodoc.Class.inst_attr_comment'),
+ ('attribute', 'test_autodoc.Class.inst_attr_string')
+ ])
options.members = ALL
assert_processes(should, 'class', 'Class')
options.undoc_members = True
@@ -395,7 +418,8 @@ def test_generate():
options.members = []
# test module flags
- assert_result_contains('.. module:: test_autodoc', 'module', 'test_autodoc')
+ assert_result_contains('.. py:module:: test_autodoc',
+ 'module', 'test_autodoc')
options.synopsis = 'Synopsis'
assert_result_contains(' :synopsis: Synopsis', 'module', 'test_autodoc')
options.deprecated = True
@@ -404,9 +428,9 @@ def test_generate():
assert_result_contains(' :platform: Platform', 'module', 'test_autodoc')
# test if __all__ is respected for modules
options.members = ALL
- assert_result_contains('.. class:: Class', 'module', 'test_autodoc')
+ assert_result_contains('.. py:class:: Class(arg)', 'module', 'test_autodoc')
try:
- assert_result_contains('.. exception:: CustomEx',
+ assert_result_contains('.. py:exception:: CustomEx',
'module', 'test_autodoc')
except AssertionError:
pass
@@ -420,7 +444,7 @@ def test_generate():
assert_result_contains(' :noindex:', 'class', 'Base')
# okay, now let's get serious about mixing Python and C signature stuff
- assert_result_contains('.. class:: CustomDict', 'class', 'CustomDict',
+ assert_result_contains('.. py:class:: CustomDict', 'class', 'CustomDict',
all_members=True)
# test inner class handling
@@ -434,10 +458,26 @@ def test_generate():
'attribute', 'test_autodoc.Class.descr')
# test generation for C modules (which have no source file)
- directive.env.currmodule = 'time'
+ directive.env.temp_data['py:module'] = 'time'
assert_processes([('function', 'time.asctime')], 'function', 'asctime')
assert_processes([('function', 'time.asctime')], 'function', 'asctime')
+ # test autodoc_member_order == 'source'
+ directive.env.temp_data['py:module'] = 'test_autodoc'
+ assert_order(['.. py:class:: Class(arg)',
+ ' .. py:attribute:: Class.descr',
+ ' .. py:method:: Class.meth()',
+ ' .. py:method:: Class.undocmeth()',
+ ' .. py:attribute:: Class.attr',
+ ' .. py:attribute:: Class.prop',
+ ' .. py:attribute:: Class.docattr',
+ ' .. py:attribute:: Class.udocattr',
+ ' .. py:attribute:: Class.inst_attr_comment',
+ ' .. py:attribute:: Class.inst_attr_string',
+ ' .. py:method:: Class.inheritedmeth()',
+ ],
+ 'class', 'Class', member_order='bysource', all_members=True)
+
# --- generate fodder ------------
@@ -500,6 +540,13 @@ class Class(Base):
udocattr = 'quux'
u"""should be documented as well - süß"""
+ def __init__(self, arg):
+ #: a documented instance attribute
+ self.inst_attr_comment = None
+ self.inst_attr_string = None
+ """a documented instance attribute"""
+
+
class CustomDict(dict):
"""Docstring."""
diff --git a/tests/test_autosummary.py b/tests/test_autosummary.py
new file mode 100644
index 000000000..7e3093676
--- /dev/null
+++ b/tests/test_autosummary.py
@@ -0,0 +1,34 @@
+# -*- coding: utf-8 -*-
+"""
+ test_autosummary
+ ~~~~~~~~~~~~~~~~
+
+ Test the autosummary extension.
+
+ :copyright: Copyright 2007-2010 by the Sphinx team, see AUTHORS.
+ :license: BSD, see LICENSE for details.
+"""
+
+import string
+
+from util import *
+
+from sphinx.ext.autosummary import mangle_signature
+
+
+def test_mangle_signature():
+ TEST = """
+ () :: ()
+ (a, b, c, d, e) :: (a, b, c, d, e)
+ (a, b, c=1, d=2, e=3) :: (a, b[, c, d, e])
+ (a, b, aaa=1, bbb=1, ccc=1, eee=1, fff=1, ggg=1, hhh=1, iii=1, jjj=1)\
+ :: (a, b[, aaa, bbb, ccc, ...])
+ (a, b, c=(), d=<foo>) :: (a, b[, c, d])
+ (a, b, c='foobar()', d=123) :: (a, b[, c, d])
+ """
+
+ TEST = [map(string.strip, x.split("::")) for x in TEST.split("\n")
+ if '::' in x]
+ for inp, outp in TEST:
+ res = mangle_signature(inp).strip().replace(u"\u00a0", " ")
+ assert res == outp, (u"'%s' -> '%s' != '%s'" % (inp, res, outp))
diff --git a/tests/test_build.py b/tests/test_build.py
index b04215122..f18ff1754 100644
--- a/tests/test_build.py
+++ b/tests/test_build.py
@@ -3,260 +3,18 @@
test_build
~~~~~~~~~~
- Test the entire build process with the test root.
+ Test all builders that have no special checks.
:copyright: Copyright 2007-2010 by the Sphinx team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
-import os
-import re
-import sys
-import difflib
-import htmlentitydefs
-from StringIO import StringIO
-from subprocess import Popen, PIPE
-
from util import *
-from etree13 import ElementTree as ET
-
-try:
- import pygments
-except ImportError:
- pygments = None
-
-from sphinx.builders.html import StandaloneHTMLBuilder
-from sphinx.builders.latex import LaTeXBuilder
-from sphinx.writers.latex import LaTeXTranslator
def teardown_module():
(test_root / '_build').rmtree(True)
-
-html_warnfile = StringIO()
-latex_warnfile = StringIO()
-
-ENV_WARNINGS = """\
-%(root)s/images.txt:9: WARNING: image file not readable: foo.png
-%(root)s/images.txt:23: WARNING: nonlocal image URI found: \
-http://www.python.org/logo.png
-%(root)s/includes.txt:: (WARNING/2) Encoding 'utf-8-sig' used for reading \
-included file u'wrongenc.inc' seems to be wrong, try giving an :encoding: option
-%(root)s/includes.txt:4: WARNING: download file not readable: nonexisting.png
-"""
-
-HTML_WARNINGS = ENV_WARNINGS + """\
-%(root)s/images.txt:20: WARNING: no matching candidate for image URI u'foo.*'
-%(root)s/markup.txt:: WARNING: invalid index entry u''
-%(root)s/markup.txt:: WARNING: invalid pair index entry u''
-%(root)s/markup.txt:: WARNING: invalid pair index entry u'keyword; '
-"""
-
-LATEX_WARNINGS = ENV_WARNINGS + """\
-None:None: WARNING: no matching candidate for image URI u'foo.*'
-WARNING: invalid pair index entry u''
-"""
-
-HTML_XPATH = {
- 'images.html': {
- ".//img[@src='_images/img.png']": '',
- ".//img[@src='_images/img1.png']": '',
- ".//img[@src='_images/simg.png']": '',
- ".//object[@data='_images/svgimg.svg']": '',
- ".//embed[@src='_images/svgimg.svg']": '',
- },
- 'subdir/images.html': {
- ".//img[@src='../_images/img1.png']": '',
- ".//img[@src='../_images/rimg.png']": '',
- },
- 'subdir/includes.html': {
- ".//a[@href='../_downloads/img.png']": '',
- },
- 'includes.html': {
- ".//pre": u'Max Strauß',
- ".//a[@href='_downloads/img.png']": '',
- ".//a[@href='_downloads/img1.png']": '',
- ".//pre": u'"quotes"',
- ".//pre": u"'included'",
- },
- 'autodoc.html': {
- ".//dt[@id='test_autodoc.Class']": '',
- ".//dt[@id='test_autodoc.function']/em": r'\*\*kwds',
- ".//dd": r'Return spam\.',
- },
- 'markup.html': {
- ".//meta[@name='author'][@content='Me']": '',
- ".//meta[@name='keywords'][@content='docs, sphinx']": '',
- ".//a[@href='contents.html#ref1']": '',
- ".//div[@id='label']": '',
- ".//span[@class='option']": '--help',
- ".//p": 'A global substitution.',
- ".//p": 'In HTML.',
- ".//p": 'In both.',
- ".//p": 'Always present',
- ".//title": 'set by title directive',
- ".//span[@class='pre']": 'CFunction()',
- },
- 'desc.html': {
- ".//dt[@id='mod.Cls.meth1']": '',
- ".//dt[@id='errmod.Error']": '',
- ".//a[@href='#mod.Cls']": '',
- ".//dl[@class='userdesc']": '',
- ".//dt[@id='userdescrole-myobj']": '',
- ".//a[@href='#userdescrole-myobj']": '',
- },
- 'contents.html': {
- ".//meta[@name='hc'][@content='hcval']": '',
- ".//meta[@name='hc_co'][@content='hcval_co']": '',
- ".//meta[@name='testopt'][@content='testoverride']": '',
- #".//td[@class='label']": r'\[Ref1\]', # docutils 0.5 only
- ".//td[@class='label']": '',
- ".//li[@class='toctree-l1']/a": 'Testing various markup',
- ".//li[@class='toctree-l2']/a": 'Admonitions',
- ".//title": 'Sphinx <Tests>',
- ".//div[@class='footer']": 'Georg Brandl & Team',
- ".//a[@href='http://python.org/']": '',
- },
- 'bom.html': {
- ".//title": " File with UTF-8 BOM",
- },
- '_static/statictmpl.html': {
- ".//project": 'Sphinx <Tests>',
- },
-}
-
-if pygments:
- HTML_XPATH['includes.html'].update({
- ".//pre/span[@class='s']": u'üöä',
- ".//div[@class='inc-pyobj1 highlight-text']/div/pre":
- r'^class Foo:\n pass\n\s*$',
- ".//div[@class='inc-pyobj2 highlight-text']/div/pre":
- r'^ def baz\(\):\n pass\n\s*$',
- ".//div[@class='inc-lines highlight-text']/div/pre":
- r'^class Foo:\n pass\nclass Bar:\n$',
- ".//div[@class='inc-startend highlight-text']/div/pre":
- ur'^foo = u"Including Unicode characters: üöä"\n$',
- ".//div[@class='inc-pyobj-dedent highlight-python']/div/pre/span":
- r'def',
- })
- HTML_XPATH['subdir/includes.html'].update({
- ".//pre/span": 'line 1',
- ".//pre/span": 'line 2',
- })
-
-class NslessParser(ET.XMLParser):
- """XMLParser that throws away namespaces in tag names."""
-
- def _fixname(self, key):
- try:
- return self._names[key]
- except KeyError:
- name = key
- br = name.find('}')
- if br > 0:
- name = name[br+1:]
- self._names[key] = name = self._fixtext(name)
- return name
-
-
-def check_xpath(etree, fname, path, check):
- nodes = list(etree.findall(path))
- assert nodes != [], ('did not find any node matching xpath '
- '%r in file %s' % (path, fname))
- if hasattr(check, '__call__'):
- check(nodes)
- elif not check:
- # only check for node presence
- pass
- else:
- rex = re.compile(check)
- for node in nodes:
- if node.text and rex.search(node.text):
- break
- else:
- assert False, ('%r not found in any node matching '
- 'path %s in %s: %r' % (check, path, fname,
- [node.text for node in nodes]))
-
-@gen_with_app(buildername='html', warning=html_warnfile, cleanenv=True,
- confoverrides={'html_context.hckey_co': 'hcval_co'},
- tags=['testtag'])
-def test_html(app):
- app.builder.build_all()
- html_warnings = html_warnfile.getvalue().replace(os.sep, '/')
- html_warnings_exp = HTML_WARNINGS % {'root': app.srcdir}
- assert html_warnings == html_warnings_exp, 'Warnings don\'t match:\n' + \
- '\n'.join(difflib.ndiff(html_warnings_exp.splitlines(),
- html_warnings.splitlines()))
-
- for fname, paths in HTML_XPATH.iteritems():
- parser = NslessParser()
- parser.entity.update(htmlentitydefs.entitydefs)
- etree = ET.parse(os.path.join(app.outdir, fname), parser)
- for path, check in paths.iteritems():
- yield check_xpath, etree, fname, path, check
-
-
-@with_app(buildername='latex', warning=latex_warnfile, cleanenv=True)
-def test_latex(app):
- LaTeXTranslator.ignore_missing_images = True
- app.builder.build_all()
- latex_warnings = latex_warnfile.getvalue().replace(os.sep, '/')
- latex_warnings_exp = LATEX_WARNINGS % {'root': app.srcdir}
- assert latex_warnings == latex_warnings_exp, 'Warnings don\'t match:\n' + \
- '\n'.join(difflib.ndiff(latex_warnings_exp.splitlines(),
- latex_warnings.splitlines()))
- # file from latex_additional_files
- assert (app.outdir / 'svgimg.svg').isfile()
-
- # only run latex if all needed packages are there
- def kpsetest(filename):
- try:
- p = Popen(['kpsewhich', filename], stdout=PIPE)
- except OSError, err:
- # no kpsewhich... either no tex distribution is installed or it is
- # a "strange" one -- don't bother running latex
- return None
- else:
- p.communicate()
- if p.returncode != 0:
- # not found
- return False
- # found
- return True
-
- if kpsetest('article.sty') is None:
- print >>sys.stderr, \
- 'info: not running latex, it doesn\'t seem to be installed'
- return
- for filename in ['fancyhdr.sty', 'fancybox.sty', 'titlesec.sty',
- 'amsmath.sty', 'framed.sty', 'color.sty', 'fancyvrb.sty',
- 'threeparttable.sty']:
- if not kpsetest(filename):
- print >>sys.stderr, \
- 'info: not running latex, the %s package doesn\'t ' \
- 'seem to be installed' % filename
- return
-
- # now, try to run latex over it
- cwd = os.getcwd()
- os.chdir(app.outdir)
- try:
- try:
- p = Popen(['pdflatex', '--interaction=nonstopmode',
- 'SphinxTests.tex'], stdout=PIPE, stderr=PIPE)
- except OSError, err:
- pass # most likely pdflatex was not found
- else:
- stdout, stderr = p.communicate()
- if p.returncode != 0:
- print stdout
- del app.cleanup_trees[:]
- assert False, 'latex exited with error'
- finally:
- os.chdir(cwd)
-
# just let the remaining ones run for now
@with_app(buildername='pickle')
@@ -279,6 +37,23 @@ def test_htmlhelp(app):
def test_qthelp(app):
app.builder.build_all()
-@with_app(buildername='changes', cleanenv=True)
+@with_app(buildername='epub')
+def test_epub(app):
+ app.builder.build_all()
+
+@with_app(buildername='changes')
def test_changes(app):
app.builder.build_all()
+
+try:
+ from docutils.writers.manpage import Writer
+except ImportError:
+ pass
+else:
+ @with_app(buildername='man')
+ def test_man(app):
+ app.builder.build_all()
+
+@with_app(buildername='singlehtml', cleanenv=True)
+def test_singlehtml(app):
+ app.builder.build_all()
diff --git a/tests/test_build_html.py b/tests/test_build_html.py
new file mode 100644
index 000000000..8b3d5b565
--- /dev/null
+++ b/tests/test_build_html.py
@@ -0,0 +1,291 @@
+# -*- coding: utf-8 -*-
+"""
+ test_build_html
+ ~~~~~~~~~~~~~~~
+
+ Test the HTML builder and check output against XPath.
+
+ :copyright: Copyright 2007-2010 by the Sphinx team, see AUTHORS.
+ :license: BSD, see LICENSE for details.
+"""
+
+import os
+import re
+import difflib
+import htmlentitydefs
+from StringIO import StringIO
+
+try:
+ import pygments
+except ImportError:
+ pygments = None
+
+from sphinx import __version__
+from util import *
+from etree13 import ElementTree as ET
+
+
+def teardown_module():
+ (test_root / '_build').rmtree(True)
+
+
+html_warnfile = StringIO()
+
+ENV_WARNINGS = """\
+%(root)s/images.txt:9: WARNING: image file not readable: foo.png
+%(root)s/images.txt:23: WARNING: nonlocal image URI found: \
+http://www.python.org/logo.png
+%(root)s/includes.txt:: (WARNING/2) Encoding 'utf-8-sig' used for reading \
+included file u'wrongenc.inc' seems to be wrong, try giving an :encoding: option
+%(root)s/includes.txt:4: WARNING: download file not readable: nonexisting.png
+"""
+
+HTML_WARNINGS = ENV_WARNINGS + """\
+%(root)s/images.txt:20: WARNING: no matching candidate for image URI u'foo.*'
+%(root)s/markup.txt:: WARNING: invalid index entry u''
+%(root)s/markup.txt:: WARNING: invalid pair index entry u''
+%(root)s/markup.txt:: WARNING: invalid pair index entry u'keyword; '
+"""
+
+HTML_XPATH = {
+ 'images.html': {
+ ".//img[@src='_images/img.png']": '',
+ ".//img[@src='_images/img1.png']": '',
+ ".//img[@src='_images/simg.png']": '',
+ ".//object[@data='_images/svgimg.svg']": '',
+ ".//embed[@src='_images/svgimg.svg']": '',
+ },
+ 'subdir/images.html': {
+ ".//img[@src='../_images/img1.png']": '',
+ ".//img[@src='../_images/rimg.png']": '',
+ },
+ 'subdir/includes.html': {
+ ".//a[@href='../_downloads/img.png']": '',
+ },
+ 'includes.html': {
+ ".//pre": u'Max Strauß',
+ ".//a[@href='_downloads/img.png']": '',
+ ".//a[@href='_downloads/img1.png']": '',
+ ".//pre": u'"quotes"',
+ ".//pre": u"'included'",
+ },
+ 'autodoc.html': {
+ ".//dt[@id='test_autodoc.Class']": '',
+ ".//dt[@id='test_autodoc.function']/em": r'\*\*kwds',
+ ".//dd": r'Return spam\.',
+ },
+ 'extapi.html': {
+ ".//strong": 'from function: Foo',
+ ".//strong": 'from class: Bar',
+ },
+ 'markup.html': {
+ ".//title": 'set by title directive',
+ ".//p/em": 'Section author: Georg Brandl',
+ ".//p/em": 'Module author: Georg Brandl',
+ # created by the meta directive
+ ".//meta[@name='author'][@content='Me']": '',
+ ".//meta[@name='keywords'][@content='docs, sphinx']": '',
+ # a label created by ``.. _label:``
+ ".//div[@id='label']": '',
+ # code with standard code blocks
+ ".//pre": '^some code$',
+ # an option list
+ ".//span[@class='option']": '--help',
+ # admonitions
+ ".//p[@class='first admonition-title']": 'My Admonition',
+ ".//p[@class='last']": 'Note text.',
+ ".//p[@class='last']": 'Warning text.',
+ # inline markup
+ ".//li/strong": '^command$',
+ ".//li/strong": '^program$',
+ ".//li/em": '^dfn$',
+ ".//li/tt/span[@class='pre']": '^kbd$',
+ ".//li/em": u'File \N{TRIANGULAR BULLET} Close',
+ ".//li/tt/span[@class='pre']": '^a/$',
+ ".//li/tt/em/span[@class='pre']": '^varpart$',
+ ".//li/tt/em/span[@class='pre']": '^i$',
+ ".//a[@href='http://www.python.org/dev/peps/pep-0008']"
+ "[@class='pep reference external']/strong": 'PEP 8',
+ ".//a[@href='http://tools.ietf.org/html/rfc1.html']"
+ "[@class='rfc reference external']/strong": 'RFC 1',
+ ".//a[@href='objects.html#envvar-HOME']"
+ "[@class='reference internal']/tt/span[@class='pre']": 'HOME',
+ ".//a[@href='#with']"
+ "[@class='reference internal']/tt/span[@class='pre']": '^with$',
+ ".//a[@href='#grammar-token-try_stmt']"
+ "[@class='reference internal']/tt/span": '^statement$',
+ ".//a[@href='subdir/includes.html']"
+ "[@class='reference internal']/em": 'Including in subdir',
+ ".//a[@href='objects.html#cmdoption-python-c']"
+ "[@class='reference internal']/em": 'Python -c option',
+ # abbreviations
+ ".//abbr[@title='abbreviation']": '^abbr$',
+ # version stuff
+ ".//span[@class='versionmodified']": 'New in version 0.6',
+ # footnote reference
+ ".//a[@class='footnote-reference']": r'\[1\]',
+ # created by reference lookup
+ ".//a[@href='contents.html#ref1']": '',
+ # ``seealso`` directive
+ ".//div/p[@class='first admonition-title']": 'See also',
+ # a ``hlist`` directive
+ ".//table[@class='hlist']/tr/td/ul/li": '^This$',
+ # a ``centered`` directive
+ ".//p[@class='centered']/strong": 'LICENSE',
+ # a glossary
+ ".//dl/dt[@id='term-boson']": 'boson',
+ # a production list
+ ".//pre/strong": 'try_stmt',
+ ".//pre/a[@href='#grammar-token-try1_stmt']/tt/span": 'try1_stmt',
+ # tests for ``only`` directive
+ ".//p": 'A global substitution.',
+ ".//p": 'In HTML.',
+ ".//p": 'In both.',
+ ".//p": 'Always present',
+ },
+ 'objects.html': {
+ ".//dt[@id='mod.Cls.meth1']": '',
+ ".//dt[@id='errmod.Error']": '',
+ ".//a[@href='#mod.Cls'][@class='reference internal']": '',
+ ".//dl[@class='userdesc']": '',
+ ".//dt[@id='userdesc-myobj']": '',
+ ".//a[@href='#userdesc-myobj']": '',
+ # C references
+ ".//span[@class='pre']": 'CFunction()',
+ ".//a[@href='#Sphinx_DoSomething']": '',
+ ".//a[@href='#SphinxStruct.member']": '',
+ ".//a[@href='#SPHINX_USE_PYTHON']": '',
+ ".//a[@href='#SphinxType']": '',
+ ".//a[@href='#sphinx_global']": '',
+ # reference from old C markup extension
+ ".//a[@href='#Sphinx_Func']": '',
+ # test global TOC created by toctree()
+ ".//ul[@class='current']/li[@class='toctree-l1 current']/a[@href='']":
+ 'Testing object descriptions',
+ ".//li[@class='toctree-l1']/a[@href='markup.html']":
+ 'Testing various markup',
+ # custom sidebar
+ ".//h4": 'Custom sidebar',
+ },
+ 'contents.html': {
+ ".//meta[@name='hc'][@content='hcval']": '',
+ ".//meta[@name='hc_co'][@content='hcval_co']": '',
+ ".//meta[@name='testopt'][@content='testoverride']": '',
+ ".//td[@class='label']": r'\[Ref1\]',
+ ".//td[@class='label']": '',
+ ".//li[@class='toctree-l1']/a": 'Testing various markup',
+ ".//li[@class='toctree-l2']/a": 'Inline markup',
+ ".//title": 'Sphinx <Tests>',
+ ".//div[@class='footer']": 'Georg Brandl & Team',
+ ".//a[@href='http://python.org/']"
+ "[@class='reference external']": '',
+ ".//li/a[@href='genindex.html']/em": 'Index',
+ ".//li/a[@href='py-modindex.html']/em": 'Module Index',
+ ".//li/a[@href='search.html']/em": 'Search Page',
+ # custom sidebar only for contents
+ ".//h4": 'Contents sidebar',
+ },
+ 'bom.html': {
+ ".//title": " File with UTF-8 BOM",
+ },
+ 'extensions.html': {
+ ".//a[@href='http://python.org/dev/']": "http://python.org/dev/",
+ ".//a[@href='http://bugs.python.org/issue1000']": "issue 1000",
+ ".//a[@href='http://bugs.python.org/issue1042']": "explicit caption",
+ },
+ '_static/statictmpl.html': {
+ ".//project": 'Sphinx <Tests>',
+ },
+}
+
+if pygments:
+ HTML_XPATH['includes.html'].update({
+ ".//pre/span[@class='s']": u'üöä',
+ ".//div[@class='inc-pyobj1 highlight-text']//pre":
+ r'^class Foo:\n pass\n\s*$',
+ ".//div[@class='inc-pyobj2 highlight-text']//pre":
+ r'^ def baz\(\):\n pass\n\s*$',
+ ".//div[@class='inc-lines highlight-text']//pre":
+ r'^class Foo:\n pass\nclass Bar:\n$',
+ ".//div[@class='inc-startend highlight-text']//pre":
+ ur'^foo = u"Including Unicode characters: üöä"\n$',
+ ".//div[@class='inc-preappend highlight-text']//pre":
+ r'(?m)^START CODE$',
+ ".//div[@class='inc-pyobj-dedent highlight-python']//span":
+ r'def',
+ ".//div[@class='inc-tab3 highlight-text']//pre":
+ r'-| |-',
+ ".//div[@class='inc-tab8 highlight-python']//pre":
+ r'-| |-',
+ })
+ HTML_XPATH['subdir/includes.html'].update({
+ ".//pre/span": 'line 1',
+ ".//pre/span": 'line 2',
+ })
+
+class NslessParser(ET.XMLParser):
+ """XMLParser that throws away namespaces in tag names."""
+
+ def _fixname(self, key):
+ try:
+ return self._names[key]
+ except KeyError:
+ name = key
+ br = name.find('}')
+ if br > 0:
+ name = name[br+1:]
+ self._names[key] = name = self._fixtext(name)
+ return name
+
+
+def check_xpath(etree, fname, path, check):
+ nodes = list(etree.findall(path))
+ assert nodes != [], ('did not find any node matching xpath '
+ '%r in file %s' % (path, fname))
+ if hasattr(check, '__call__'):
+ check(nodes)
+ elif not check:
+ # only check for node presence
+ pass
+ else:
+ rex = re.compile(check)
+ for node in nodes:
+ if node.text and rex.search(node.text):
+ break
+ else:
+ assert False, ('%r not found in any node matching '
+ 'path %s in %s: %r' % (check, path, fname,
+ [node.text for node in nodes]))
+
+def check_static_entries(outdir):
+ staticdir = outdir / '_static'
+ assert staticdir.isdir()
+ # a file from a directory entry in html_static_path
+ assert (staticdir / 'README').isfile()
+ # a directory from a directory entry in html_static_path
+ assert (staticdir / 'subdir' / 'foo.css').isfile()
+ # a file from a file entry in html_static_path
+ assert (staticdir / 'templated.css').isfile()
+ assert (staticdir / 'templated.css').text().splitlines()[1] == __version__
+ # a file from _static, but matches exclude_patterns
+ assert not (staticdir / 'excluded.css').exists()
+
+@gen_with_app(buildername='html', warning=html_warnfile, cleanenv=True,
+ confoverrides={'html_context.hckey_co': 'hcval_co'},
+ tags=['testtag'])
+def test_html(app):
+ app.builder.build_all()
+ html_warnings = html_warnfile.getvalue().replace(os.sep, '/')
+ html_warnings_exp = HTML_WARNINGS % {'root': app.srcdir}
+ assert html_warnings == html_warnings_exp, 'Warnings don\'t match:\n' + \
+ '\n'.join(difflib.ndiff(html_warnings_exp.splitlines(),
+ html_warnings.splitlines()))
+
+ for fname, paths in HTML_XPATH.iteritems():
+ parser = NslessParser()
+ parser.entity.update(htmlentitydefs.entitydefs)
+ etree = ET.parse(os.path.join(app.outdir, fname), parser)
+ for path, check in paths.iteritems():
+ yield check_xpath, etree, fname, path, check
+
+ check_static_entries(app.builder.outdir)
diff --git a/tests/test_build_latex.py b/tests/test_build_latex.py
new file mode 100644
index 000000000..4f40cc117
--- /dev/null
+++ b/tests/test_build_latex.py
@@ -0,0 +1,94 @@
+# -*- coding: utf-8 -*-
+"""
+ test_build_latex
+ ~~~~~~~~~~~~~~~~
+
+ Test the build process with LaTeX builder with the test root.
+
+ :copyright: Copyright 2007-2010 by the Sphinx team, see AUTHORS.
+ :license: BSD, see LICENSE for details.
+"""
+
+import os
+import sys
+import difflib
+from StringIO import StringIO
+from subprocess import Popen, PIPE
+
+from sphinx.writers.latex import LaTeXTranslator
+
+from util import *
+from test_build_html import ENV_WARNINGS
+
+
+def teardown_module():
+ (test_root / '_build').rmtree(True)
+
+
+latex_warnfile = StringIO()
+
+LATEX_WARNINGS = ENV_WARNINGS + """\
+None:None: WARNING: no matching candidate for image URI u'foo.*'
+WARNING: invalid pair index entry u''
+"""
+
+
+@with_app(buildername='latex', warning=latex_warnfile, cleanenv=True)
+def test_latex(app):
+ LaTeXTranslator.ignore_missing_images = True
+ app.builder.build_all()
+ latex_warnings = latex_warnfile.getvalue().replace(os.sep, '/')
+ latex_warnings_exp = LATEX_WARNINGS % {'root': app.srcdir}
+ assert latex_warnings == latex_warnings_exp, 'Warnings don\'t match:\n' + \
+ '\n'.join(difflib.ndiff(latex_warnings_exp.splitlines(),
+ latex_warnings.splitlines()))
+ # file from latex_additional_files
+ assert (app.outdir / 'svgimg.svg').isfile()
+
+ # only run latex if all needed packages are there
+ def kpsetest(filename):
+ try:
+ p = Popen(['kpsewhich', filename], stdout=PIPE)
+ except OSError:
+ # no kpsewhich... either no tex distribution is installed or it is
+ # a "strange" one -- don't bother running latex
+ return None
+ else:
+ p.communicate()
+ if p.returncode != 0:
+ # not found
+ return False
+ # found
+ return True
+
+ if kpsetest('article.sty') is None:
+ print >>sys.stderr, \
+ 'info: not running latex, it doesn\'t seem to be installed'
+ return
+ for filename in ['fancyhdr.sty', 'fancybox.sty', 'titlesec.sty',
+ 'amsmath.sty', 'framed.sty', 'color.sty', 'fancyvrb.sty',
+ 'threeparttable.sty']:
+ if not kpsetest(filename):
+ print >>sys.stderr, \
+ 'info: not running latex, the %s package doesn\'t ' \
+ 'seem to be installed' % filename
+ return
+
+ # now, try to run latex over it
+ cwd = os.getcwd()
+ os.chdir(app.outdir)
+ try:
+ try:
+ p = Popen(['pdflatex', '--interaction=nonstopmode',
+ 'SphinxTests.tex'], stdout=PIPE, stderr=PIPE)
+ except OSError:
+ pass # most likely pdflatex was not found
+ else:
+ stdout, stderr = p.communicate()
+ if p.returncode != 0:
+ print stdout
+ print stderr
+ del app.cleanup_trees[:]
+ assert False, 'latex exited with return code %s' % p.returncode
+ finally:
+ os.chdir(cwd)
diff --git a/tests/test_config.py b/tests/test_config.py
index 346e66c9a..cb4e11056 100644
--- a/tests/test_config.py
+++ b/tests/test_config.py
@@ -12,8 +12,9 @@
from util import *
+import sphinx
from sphinx.config import Config
-from sphinx.errors import ExtensionError, ConfigError
+from sphinx.errors import ExtensionError, ConfigError, VersionRequirementError
@with_app(confoverrides={'master_doc': 'master', 'nonexisting_value': 'True',
@@ -31,9 +32,9 @@ def test_core_config(app):
assert cfg.latex_elements['docclass'] == 'scrartcl'
# simple default values
- assert 'exclude_dirs' not in cfg.__dict__
- assert cfg.exclude_dirs == []
- assert cfg.show_authors == False
+ assert 'locale_dirs' not in cfg.__dict__
+ assert cfg.locale_dirs == []
+ assert cfg.trim_footnote_reference_space == False
# complex default values
assert 'html_title' not in cfg.__dict__
@@ -94,3 +95,8 @@ def test_errors_warnings(dir):
warned[0] = True
cfg.check_unicode(warn)
assert warned[0]
+
+
+def test_needs_sphinx():
+ raises(VersionRequirementError, TestApp,
+ confoverrides={'needs_sphinx': '9.9'})
diff --git a/tests/test_coverage.py b/tests/test_coverage.py
index 282db6776..1262ebf5b 100644
--- a/tests/test_coverage.py
+++ b/tests/test_coverage.py
@@ -36,7 +36,7 @@ def test_build(app):
undoc_py, undoc_c = pickle.loads((app.outdir / 'undoc.pickle').text())
assert len(undoc_c) == 1
# the key is the full path to the header file, which isn't testable
- assert undoc_c.values()[0] == [('cfunction', 'Py_SphinxTest')]
+ assert undoc_c.values()[0] == [('function', 'Py_SphinxTest')]
assert 'test_autodoc' in undoc_py
assert 'funcs' in undoc_py['test_autodoc']
diff --git a/tests/test_cpp_domain.py b/tests/test_cpp_domain.py
new file mode 100644
index 000000000..1e7226021
--- /dev/null
+++ b/tests/test_cpp_domain.py
@@ -0,0 +1,55 @@
+# -*- coding: utf-8 -*-
+"""
+ test_cpp_domain
+ ~~~~~~~~~~~~~~~
+
+ Tests the C++ Domain
+
+ :copyright: Copyright 2007-2010 by the Sphinx team, see AUTHORS.
+ :license: BSD, see LICENSE for details.
+"""
+
+from util import *
+
+from sphinx.domains.cpp import DefinitionParser
+
+
+def parse(name, string):
+ return getattr(DefinitionParser(string), 'parse_' + name)()
+
+
+def test_type_definitions():
+ rv = parse('member_object', ' const std::string & name = 42')
+ assert unicode(rv) == 'const std::string& name = 42'
+
+ rv = parse('member_object', ' const std::string & name leftover')
+ assert unicode(rv) == 'const std::string& name'
+
+ rv = parse('member_object', 'const std::vector< unsigned int, long> &name')
+ assert unicode(rv) == 'const std::vector<unsigned int, long>& name'
+
+ x = 'std::vector<std::pair<std::string, int>>& module::test(register ' \
+ 'foo, bar, std::string baz="foobar, blah, bleh") const = 0'
+ assert unicode(parse('function', x)) == x
+
+ x = 'module::myclass::operator std::vector<std::string>()'
+ assert unicode(parse('function', x)) == x
+ x = 'explicit module::myclass::foo::foo()'
+ assert unicode(parse('function', x)) == x
+
+ x = 'std::vector<std::pair<std::string, long long>> module::blah'
+ assert unicode(parse('type_object', x)) == x
+
+ assert unicode(parse('type_object', 'long long int foo')) == 'long long foo'
+
+
+def test_operators():
+ x = parse('function', 'void operator new [ ] ()')
+ assert unicode(x) == 'void operator new[]()'
+
+ x = parse('function', 'void operator delete ()')
+ assert unicode(x) == 'void operator delete()'
+
+ for op in '*-+=/%!':
+ x = parse('function', 'void operator %s ()' % op)
+ assert unicode(x) == 'void operator%s()' % op
diff --git a/tests/test_env.py b/tests/test_env.py
index da129d9ac..4ecbaac49 100644
--- a/tests/test_env.py
+++ b/tests/test_env.py
@@ -11,7 +11,6 @@
from util import *
-from sphinx.environment import BuildEnvironment
from sphinx.builders.html import StandaloneHTMLBuilder
from sphinx.builders.latex import LaTeXBuilder
@@ -20,8 +19,8 @@ warnings = []
def setup_module():
global app, env
- app = TestApp(srcdir='(temp)')
- env = BuildEnvironment(app.srcdir, app.doctreedir, app.config)
+ app = TestApp(srcdir='(temp)', freshenv=True)
+ env = app.env
env.set_warnfunc(lambda *args: warnings.append(args))
def teardown_module():
@@ -43,6 +42,8 @@ def test_first_update():
for docname in it: # the generator does all the work
docnames.add(docname)
assert docnames == env.found_docs == set(env.all_docs)
+ # test if exclude_patterns works ok
+ assert 'subdir/excluded' not in env.found_docs
def test_images():
assert warning_emitted('images.txt', 'image file not readable: foo.png')
@@ -51,7 +52,7 @@ def test_images():
tree = env.get_doctree('images')
app._warning.reset()
- htmlbuilder = StandaloneHTMLBuilder(app, env)
+ htmlbuilder = StandaloneHTMLBuilder(app)
htmlbuilder.post_process_images(tree)
assert "no matching candidate for image URI u'foo.*'" in \
app._warning.content[-1]
@@ -61,7 +62,7 @@ def test_images():
set(['img.png', 'img1.png', 'simg.png', 'svgimg.svg'])
app._warning.reset()
- latexbuilder = LaTeXBuilder(app, env)
+ latexbuilder = LaTeXBuilder(app)
latexbuilder.post_process_images(tree)
assert "no matching candidate for image URI u'foo.*'" in \
app._warning.content[-1]
@@ -92,10 +93,10 @@ def test_second_update():
assert 'autodoc' not in env.found_docs
def test_object_inventory():
- refs = env.descrefs
+ refs = env.domaindata['py']['objects']
assert 'func_without_module' in refs
- assert refs['func_without_module'] == ('desc', 'function')
+ assert refs['func_without_module'] == ('objects', 'function')
assert 'func_without_module2' in refs
assert 'mod.func_in_module' in refs
assert 'mod.Cls' in refs
@@ -109,5 +110,8 @@ def test_object_inventory():
assert 'func_in_module' not in refs
assert 'func_noindex' not in refs
- assert 'mod' in env.modules
- assert env.modules['mod'] == ('desc', 'Module synopsis.', 'UNIX', False)
+ assert env.domaindata['py']['modules']['mod'] == \
+ ('objects', 'Module synopsis.', 'UNIX', False)
+
+ assert env.domains['py'].data is env.domaindata['py']
+ assert env.domains['c'].data is env.domaindata['c']
diff --git a/tests/test_highlighting.py b/tests/test_highlighting.py
index 78f4e86f9..7496690be 100644
--- a/tests/test_highlighting.py
+++ b/tests/test_highlighting.py
@@ -37,7 +37,8 @@ class MyLexer(RegexLexer):
class MyFormatter(HtmlFormatter):
def format(self, tokensource, outfile):
- outfile.write('test')
+ for tok in tokensource:
+ outfile.write(tok[1])
class ComplainOnUnhighlighted(PygmentsBridge):
@@ -69,7 +70,16 @@ def test_set_formatter():
PygmentsBridge.html_formatter = MyFormatter
try:
bridge = PygmentsBridge('html')
- ret = bridge.highlight_block('foo', 'python')
- assert ret == 'test'
+ ret = bridge.highlight_block('foo\n', 'python')
+ assert ret == 'foo\n'
+ finally:
+ PygmentsBridge.html_formatter = HtmlFormatter
+
+def test_trim_doctest_flags():
+ PygmentsBridge.html_formatter = MyFormatter
+ try:
+ bridge = PygmentsBridge('html', trim_doctest_flags=True)
+ ret = bridge.highlight_block('>>> 1+2 # doctest: SKIP\n3\n', 'pycon')
+ assert ret == '>>> 1+2 \n3\n'
finally:
PygmentsBridge.html_formatter = HtmlFormatter
diff --git a/tests/test_intersphinx.py b/tests/test_intersphinx.py
new file mode 100644
index 000000000..622243e60
--- /dev/null
+++ b/tests/test_intersphinx.py
@@ -0,0 +1,112 @@
+# -*- coding: utf-8 -*-
+"""
+ test_intersphinx
+ ~~~~~~~~~~~~~~~~
+
+ Test the intersphinx extension.
+
+ :copyright: Copyright 2007-2010 by the Sphinx team, see AUTHORS.
+ :license: BSD, see LICENSE for details.
+"""
+
+import zlib
+import posixpath
+from cStringIO import StringIO
+
+from docutils import nodes
+
+from sphinx import addnodes
+from sphinx.ext.intersphinx import read_inventory_v1, read_inventory_v2, \
+ load_mappings, missing_reference
+
+from util import *
+
+
+inventory_v1 = '''\
+# Sphinx inventory version 1
+# Project: foo
+# Version: 1.0
+module mod foo.html
+module.cls class foo.html
+'''
+
+inventory_v2 = '''\
+# Sphinx inventory version 2
+# Project: foo
+# Version: 2.0
+# The remainder of this file is compressed with zlib.
+''' + zlib.compress('''\
+module1 py:module 0 foo.html#module-module1 Long Module desc
+module2 py:module 0 foo.html#module-$ -
+module1.func py:function 1 sub/foo.html#$ -
+CFunc c:function 2 cfunc.html#CFunc -
+''')
+
+
+def test_read_inventory_v1():
+ f = StringIO(inventory_v1)
+ f.readline()
+ invdata = read_inventory_v1(f, '/util', posixpath.join)
+ assert invdata['py:module']['module'] == \
+ ('foo', '1.0', '/util/foo.html#module-module', '-')
+ assert invdata['py:class']['module.cls'] == \
+ ('foo', '1.0', '/util/foo.html#module.cls', '-')
+
+
+def test_read_inventory_v2():
+ f = StringIO(inventory_v2)
+ f.readline()
+ invdata1 = read_inventory_v2(f, '/util', posixpath.join)
+
+ # try again with a small buffer size to test the chunking algorithm
+ f = StringIO(inventory_v2)
+ f.readline()
+ invdata2 = read_inventory_v2(f, '/util', posixpath.join, bufsize=5)
+
+ assert invdata1 == invdata2
+
+ assert len(invdata1['py:module']) == 2
+ assert invdata1['py:module']['module1'] == \
+ ('foo', '2.0', '/util/foo.html#module-module1', 'Long Module desc')
+ assert invdata1['py:module']['module2'] == \
+ ('foo', '2.0', '/util/foo.html#module-module2', '-')
+ assert invdata1['py:function']['module1.func'][2] == \
+ '/util/sub/foo.html#module1.func'
+ assert invdata1['c:function']['CFunc'][2] == '/util/cfunc.html#CFunc'
+
+
+@with_app(confoverrides={'extensions': 'sphinx.ext.intersphinx'})
+@with_tempdir
+def test_missing_reference(tempdir, app):
+ inv_file = tempdir / 'inventory'
+ write_file(inv_file, inventory_v2)
+ app.config.intersphinx_mapping = {'http://docs.python.org/': inv_file}
+ app.config.intersphinx_cache_limit = 0
+
+ # load the inventory and check if it's done correctly
+ load_mappings(app)
+ inv = app.env.intersphinx_inventory
+
+ assert inv['py:module']['module2'] == \
+ ('foo', '2.0', 'http://docs.python.org/foo.html#module-module2', '-')
+
+ # create fake nodes and check referencing
+ contnode = nodes.emphasis('foo')
+ refnode = addnodes.pending_xref('')
+ refnode['reftarget'] = 'module1.func'
+ refnode['reftype'] = 'func'
+ refnode['refdomain'] = 'py'
+
+ rn = missing_reference(app, app.env, refnode, contnode)
+ assert isinstance(rn, nodes.reference)
+ assert rn['refuri'] == 'http://docs.python.org/sub/foo.html#module1.func'
+ assert rn['reftitle'] == '(in foo v2.0)'
+ assert rn[0] is contnode
+
+ # create unresolvable nodes and check None return value
+ refnode['reftype'] = 'foo'
+ assert missing_reference(app, app.env, refnode, contnode) is None
+
+ refnode['reftype'] = 'function'
+ refnode['reftarget'] = 'foo.func'
+ assert missing_reference(app, app.env, refnode, contnode) is None
diff --git a/tests/test_markup.py b/tests/test_markup.py
index 0133a9d82..31817df62 100644
--- a/tests/test_markup.py
+++ b/tests/test_markup.py
@@ -28,6 +28,8 @@ def setup_module():
components=(rst.Parser, HTMLWriter, LaTeXWriter))
settings = optparser.get_default_values()
settings.env = app.builder.env
+ settings.env.patch_lookup_functions()
+ settings.env.temp_data['docname'] = 'dummy'
parser = rst.Parser()
def teardown_module():
@@ -59,7 +61,7 @@ def verify_re(rst, html_expected, latex_expected):
html_translator = ForgivingHTMLTranslator(app.builder, document)
document.walkabout(html_translator)
html_translated = ''.join(html_translator.fragment).strip()
- assert re.match(html_expected, html_translated), 'from' + rst
+ assert re.match(html_expected, html_translated), 'from ' + rst
if latex_expected:
latex_translator = ForgivingLaTeXTranslator(document, app.builder)
@@ -78,26 +80,32 @@ def verify(rst, html_expected, latex_expected):
def test_inline():
# correct interpretation of code with whitespace
- _html = ('<p><tt class="docutils literal"><span class="pre">'
+ _html = ('<p><tt class="(samp )?docutils literal"><span class="pre">'
'code</span>&nbsp;&nbsp; <span class="pre">sample</span></tt></p>')
- yield verify, '``code sample``', _html, '\\code{code sample}'
- yield verify, ':samp:`code sample`', _html, '\\samp{code sample}'
+ yield verify_re, '``code sample``', _html, r'\\code{code sample}'
+ yield verify_re, ':samp:`code sample`', _html, r'\\samp{code sample}'
# interpolation of braces in samp and file roles (HTML only)
yield (verify, ':samp:`a{b}c`',
- '<p><tt class="docutils literal"><span class="pre">a</span>'
+ '<p><tt class="samp docutils literal"><span class="pre">a</span>'
'<em><span class="pre">b</span></em>'
'<span class="pre">c</span></tt></p>',
'\\samp{abc}')
# interpolation of arrows in menuselection
yield (verify, ':menuselection:`a --> b`',
- u'<p><em>a \N{TRIANGULAR BULLET} b</em></p>',
+ u'<p><em class="menuselection">a \N{TRIANGULAR BULLET} b</em></p>',
'\\emph{a \\(\\rightarrow\\) b}')
+ # interpolation of ampersands in guilabel/menuselection
+ yield (verify, ':guilabel:`&Foo -&&- &Bar`',
+ u'<p><em class="guilabel"><span class="accelerator">F</span>oo '
+ '-&amp;- <span class="accelerator">B</span>ar</em></p>',
+ r'\emph{\DUspan{accelerator}{F}oo -\&- \DUspan{accelerator}{B}ar}')
+
# non-interpolation of dashes in option role
yield (verify_re, ':option:`--with-option`',
- '<p><em( class="xref")?>--with-option</em></p>$',
+ '<p><em( class="xref std std-option")?>--with-option</em></p>$',
r'\\emph{\\texttt{-{-}with-option}}$')
# verify smarty-pants quotes
@@ -108,15 +116,20 @@ def test_inline():
'&quot;John&quot;</span></tt></p>',
'\\code{"John"}')
+ # verify classes for inline roles
+ yield (verify, ':manpage:`mp(1)`',
+ '<p><em class="manpage">mp(1)</em></p>',
+ '\\emph{\\texttt{mp(1)}}')
+
def test_latex_escaping():
# correct escaping in normal mode
yield (verify, u'Γ\\\\∞$', None,
- ur'\(\Gamma\)\textbackslash{}\(\infty\)\$')
+ ur'\(\Gamma\)\textbackslash{}\(\infty\)\$')
# in verbatim code fragments
yield (verify, u'::\n\n @Γ\\∞$[]', None,
u'\\begin{Verbatim}[commandchars=@\\[\\]]\n'
u'@PYGZat[]@(@Gamma@)\\@(@infty@)@$@PYGZlb[]@PYGZrb[]\n'
u'\\end{Verbatim}')
# in URIs
- yield (verify, u'`test <http://example.com/~me/>`_', None,
- u'\\href{http://example.com/~me/}{test}')
+ yield (verify_re, u'`test <http://example.com/~me/>`_', None,
+ ur'\\href{http://example.com/~me/}{test}.*')
diff --git a/tests/test_metadata.py b/tests/test_metadata.py
new file mode 100644
index 000000000..8fb6cb214
--- /dev/null
+++ b/tests/test_metadata.py
@@ -0,0 +1,69 @@
+# -*- coding: utf-8 -*-
+"""
+ test_metadata
+ ~~~~~~~~~~~~~
+
+ Test our handling of metadata in files with bibliographic metadata.
+
+ :copyright: Copyright 2007-2010 by the Sphinx team, see AUTHORS.
+ :license: BSD, see LICENSE for details.
+"""
+
+# adapted from an example of bibliographic metadata at
+# http://docutils.sourceforge.net/docs/user/rst/demo.txt
+
+from util import *
+
+from nose.tools import assert_equals
+
+
+app = env = None
+warnings = []
+
+def setup_module():
+ # Is there a better way of generating this doctree than manually iterating?
+ global app, env
+ app = TestApp(srcdir='(temp)')
+ env = app.env
+ msg, num, it = env.update(app.config, app.srcdir, app.doctreedir, app)
+ for docname in it:
+ pass
+
+def teardown_module():
+ app.cleanup()
+
+def test_docinfo():
+ """
+ Inspect the 'docinfo' metadata stored in the first node of the document.
+ Note this doesn't give us access to data stored in subsequence blocks
+ that might be considered document metadata, such as 'abstract' or
+ 'dedication' blocks, or the 'meta' role. Doing otherwise is probably more
+ messing with the internals of sphinx than this rare use case merits.
+ """
+ exampledocinfo = env.metadata['metadata']
+ expecteddocinfo = {
+ 'author': u'David Goodger',
+ 'authors': [u'Me', u'Myself', u'I'],
+ 'address': u'123 Example Street\nExample, EX Canada\nA1B 2C3',
+ 'field name': u'This is a generic bibliographic field.',
+ 'field name 2': (u'Generic bibliographic fields may contain multiple '
+ u'body elements.\n\nLike this.'),
+ 'status': u'This is a "work in progress"',
+ 'version': u'1',
+ 'copyright': (u'This document has been placed in the public domain. '
+ u'You\nmay do with it as you wish. You may copy, modify,'
+ u'\nredistribute, reattribute, sell, buy, rent, lease,\n'
+ u'destroy, or improve it, quote it at length, excerpt,\n'
+ u'incorporate, collate, fold, staple, or mutilate it, or '
+ u'do\nanything else to it that your or anyone else\'s '
+ u'heart\ndesires.'),
+ 'contact': u'goodger@python.org',
+ 'date': u'2006-05-21',
+ 'organization': u'humankind',
+ 'revision': u'4564',
+ }
+ # I like this way of comparing dicts - easier to see the error.
+ for key in exampledocinfo:
+ yield assert_equals, exampledocinfo.get(key), expecteddocinfo.get(key)
+ # but then we still have to check for missing keys
+ yield assert_equals, set(expecteddocinfo.keys()), set(exampledocinfo.keys())
diff --git a/tests/test_quickstart.py b/tests/test_quickstart.py
index 11782fb66..cb40d27cf 100644
--- a/tests/test_quickstart.py
+++ b/tests/test_quickstart.py
@@ -126,8 +126,10 @@ def test_quickstart_all_answers(tempdir):
'pngmath': 'N',
'jsmath': 'no',
'ifconfig': 'no',
+ 'viewcode': 'no',
'Create Makefile': 'no',
'Create Windows command file': 'no',
+ 'Do you want to use the epub builder': 'yes',
}
qs.raw_input = mock_raw_input(answers, needanswer=True)
qs.TERM_ENCODING = 'utf-8'
@@ -150,6 +152,10 @@ def test_quickstart_all_answers(tempdir):
assert ns['latex_documents'] == [
('contents', 'STASI.tex', u'STASI™ Documentation',
u'Wolfgang Schäuble \\& G\'Beckstein', 'manual')]
+ assert ns['epub_author'] == u'Wolfgang Schäuble & G\'Beckstein'
+ assert ns['man_pages'] == [
+ ('contents', 'stasi', u'STASI™ Documentation',
+ [u'Wolfgang Schäuble & G\'Beckstein'], 1)]
assert (tempdir / 'build').isdir()
assert (tempdir / 'source' / '.static').isdir()
diff --git a/tests/test_rst_domain.py b/tests/test_rst_domain.py
new file mode 100644
index 000000000..10617095d
--- /dev/null
+++ b/tests/test_rst_domain.py
@@ -0,0 +1,26 @@
+# -*- coding: utf-8 -*-
+"""
+ test_rst_domain
+ ~~~~~~~~~~~~~~~
+
+ Tests the reStructuredText domain.
+
+ :copyright: Copyright 2007-2010 by the Sphinx team, see AUTHORS.
+ :license: BSD, see LICENSE for details.
+"""
+
+from sphinx.domains.rst import parse_directive
+
+def test_parse_directive():
+
+ s = parse_directive(u' foö ')
+ assert s == (u'foö', '')
+
+ s = parse_directive(u' .. foö :: ')
+ assert s == (u'foö', ' ')
+
+ s = parse_directive(u'.. foö:: args1 args2')
+ assert s == (u'foö', ' args1 args2')
+
+ s = parse_directive('.. :: bar')
+ assert s == ('.. :: bar', '')
diff --git a/tests/test_search.py b/tests/test_search.py
index 15257aebd..0b5b158b8 100644
--- a/tests/test_search.py
+++ b/tests/test_search.py
@@ -9,12 +9,14 @@
:license: BSD, see LICENSE for details.
"""
-from docutils import frontend, utils, nodes
+from docutils import frontend, utils
from docutils.parsers import rst
from sphinx.search import IndexBuilder
+settings = parser = None
+
def setup_module():
global settings, parser
optparser = frontend.OptionParser(components=(rst.Parser,))
diff --git a/tests/test_theming.py b/tests/test_theming.py
index a6bd5ad26..0cad0f8d1 100644
--- a/tests/test_theming.py
+++ b/tests/test_theming.py
@@ -24,8 +24,8 @@ def test_theme_api(app):
# test Theme class API
assert set(Theme.themes.keys()) == \
- set(['basic', 'default', 'sphinxdoc', 'traditional',
- 'testtheme', 'ziptheme'])
+ set(['basic', 'default', 'scrolls', 'agogo', 'sphinxdoc', 'haiku',
+ 'traditional', 'testtheme', 'ziptheme', 'epub', 'nature'])
assert Theme.themes['testtheme'][1] is None
assert isinstance(Theme.themes['ziptheme'][1], zipfile.ZipFile)
diff --git a/tests/util.py b/tests/util.py
index 2b3807224..1b24af0e2 100644
--- a/tests/util.py
+++ b/tests/util.py
@@ -8,7 +8,6 @@
"""
import sys
-import os
import StringIO
import tempfile
import shutil
@@ -184,9 +183,9 @@ def gen_with_app(*args, **kwargs):
def with_tempdir(func):
- def new_func():
+ def new_func(*args, **kwds):
tempdir = path(tempfile.mkdtemp())
- func(tempdir)
+ func(tempdir, *args, **kwds)
tempdir.rmtree()
new_func.__name__ = func.__name__
return new_func
diff --git a/utils/check_sources.py b/utils/check_sources.py
index ec7695d57..0571ab1e8 100755
--- a/utils/check_sources.py
+++ b/utils/check_sources.py
@@ -154,8 +154,7 @@ def check_whitespace_and_spelling(fn, lines):
yield lno+1, '"%s" used' % word
-bad_tags = ('<u>', '<s>', '<strike>'
- '<center>', '<big>', '<small>', '<font')
+bad_tags = ('<u>', '<s>', '<strike>', '<center>', '<font')
@checker('.html')
def check_xhtml(fn, lines):
@@ -190,9 +189,6 @@ def main(argv):
num = 0
out = cStringIO.StringIO()
- # TODO: replace os.walk run with iteration over output of
- # `svn list -R`.
-
for root, dirs, files in os.walk(path):
if '.svn' in dirs:
dirs.remove('.svn')
diff --git a/utils/pylintrc b/utils/pylintrc
index 2552a12c8..cf71db595 100644
--- a/utils/pylintrc
+++ b/utils/pylintrc
@@ -273,7 +273,7 @@ ignore-docstrings=yes
# checks for:
-# * warning notes in the code like FIXME, XXX
+# * warning notes in the code
# * PEP 263: source code with non ascii character but no encoding declaration
#
[MISCELLANEOUS]