diff -Nru sphinx-1.0~hg20100604/CHANGES sphinx-1.0.7/CHANGES --- sphinx-1.0~hg20100604/CHANGES 2010-06-03 22:12:22.000000000 +0000 +++ sphinx-1.0.7/CHANGES 2011-01-15 15:25:25.000000000 +0000 @@ -1,6 +1,210 @@ -Release 1.0 (in development) +Release 1.0.7 (Jan 15, 2011) ============================ +* #347: Fix wrong generation of directives of static methods in + autosummary. + +* #599: Import PIL as ``from PIL import Image``. + +* #558: Fix longtables with captions in LaTeX output. + +* Make token references work as hyperlinks again in LaTeX output. + +* #572: Show warnings by default when reference labels cannot be + found. + +* #536: Include line number when complaining about missing reference + targets in nitpicky mode. + +* #590: Fix inline display of graphviz diagrams in LaTeX output. + +* #589: Build using app.build() in setup command. + +* Fix a bug in the inheritance diagram exception that caused base + classes to be skipped if one of them is a builtin. + +* Fix general index links for C++ domain objects. + +* #332: Make admonition boundaries in LaTeX output visible. + +* #573: Fix KeyErrors occurring on rebuild after removing a file. + +* Fix a traceback when removing files with globbed toctrees. + +* If an autodoc object cannot be imported, always re-read the + document containing the directive on next build. + +* If an autodoc object cannot be imported, show the full traceback + of the import error. + +* Fix a bug where the removal of download files and images wasn't + noticed. + +* #571: Implement ``~`` cross-reference prefix for the C domain. + +* Fix regression of LaTeX output with the fix of #556. + +* #568: Fix lookup of class attribute documentation on descriptors + so that comment documentation now works. + +* Fix traceback with ``only`` directives preceded by targets. + +* Fix tracebacks occurring for duplicate C++ domain objects. + +* Fix JavaScript domain links to objects with ``$`` in their name. + + +Release 1.0.6 (Jan 04, 2011) +============================ + +* #581: Fix traceback in Python domain for empty cross-reference + targets. + +* #283: Fix literal block display issues on Chrome browsers. + +* #383, #148: Support sorting a limited range of accented characters + in the general index and the glossary. + +* #570: Try decoding ``-D`` and ``-A`` command-line arguments with + the locale's preferred encoding. + +* #528: Observe :confval:`locale_dirs` when looking for the JS + translations file. + +* #574: Add special code for better support of Japanese documents + in the LaTeX builder. + +* Regression of #77: If there is only one parameter given with + ``:param:`` markup, the bullet list is now suppressed again. + +* #556: Fix missing paragraph breaks in LaTeX output in certain + situations. + +* #567: Emit the ``autodoc-process-docstring`` event even for objects + without a docstring so that it can add content. + +* #565: In the LaTeX builder, not only literal blocks require different + table handling, but also quite a few other list-like block elements. + +* #515: Fix tracebacks in the viewcode extension for Python objects + that do not have a valid signature. + +* Fix strange reportings of line numbers for warnings generated from + autodoc-included docstrings, due to different behavior depending + on docutils version. + +* Several fixes to the C++ domain. + + +Release 1.0.5 (Nov 12, 2010) +============================ + +* #557: Add CSS styles required by docutils 0.7 for aligned images + and figures. + +* In the Makefile generated by LaTeX output, do not delete pdf files + on clean; they might be required images. + +* #535: Fix LaTeX output generated for line blocks. + +* #544: Allow ``.pyw`` as a source file extension. + + +Release 1.0.4 (Sep 17, 2010) +============================ + +* #524: Open intersphinx inventories in binary mode on Windows, + since version 2 contains zlib-compressed data. + +* #513: Allow giving non-local URIs for JavaScript files, e.g. + in the JSMath extension. + +* #512: Fix traceback when ``intersphinx_mapping`` is empty. + + +Release 1.0.3 (Aug 23, 2010) +============================ + +* #495: Fix internal vs. external link distinction for links coming + from a docutils table-of-contents. + +* #494: Fix the ``maxdepth`` option for the ``toctree()`` template + callable when used with ``collapse=True``. + +* #507: Fix crash parsing Python argument lists containing brackets + in string literals. + +* #501: Fix regression when building LaTeX docs with figures that + don't have captions. + +* #510: Fix inheritance diagrams for classes that are not picklable. + +* #497: Introduce separate background color for the sidebar collapse + button, making it easier to see. + +* #502, #503, #496: Fix small layout bugs in several builtin themes. + + +Release 1.0.2 (Aug 14, 2010) +============================ + +* #490: Fix cross-references to objects of types added by the + :func:`~.Sphinx.add_object_type` API function. + +* Fix handling of doc field types for different directive types. + +* Allow breaking long signatures, continuing with backlash-escaped + newlines. + +* Fix unwanted styling of C domain references (because of a namespace + clash with Pygments styles). + +* Allow references to PEPs and RFCs with explicit anchors. + +* #471: Fix LaTeX references to figures. + +* #482: When doing a non-exact search, match only the given type + of object. + +* #481: Apply non-exact search for Python reference targets with + ``.name`` for modules too. + +* #484: Fix crash when duplicating a parameter in an info field list. + +* #487: Fix setting the default role to one provided by the + ``oldcmarkup`` extension. + +* #488: Fix crash when json-py is installed, which provides a + ``json`` module but is incompatible to simplejson. + +* #480: Fix handling of target naming in intersphinx. + +* #486: Fix removal of ``!`` for all cross-reference roles. + + +Release 1.0.1 (Jul 27, 2010) +============================ + +* #470: Fix generated target names for reST domain objects; they + are not in the same namespace. + +* #266: Add Bengali language. + +* #473: Fix a bug in parsing JavaScript object names. + +* #474: Fix building with SingleHTMLBuilder when there is no toctree. + +* Fix display names for objects linked to by intersphinx with + explicit targets. + +* Fix building with the JSON builder. + +* Fix hyperrefs in object descriptions for LaTeX. + + +Release 1.0 (Jul 23, 2010) +========================== + Incompatible changes -------------------- @@ -15,9 +219,10 @@ - JavaScript - reStructuredText -* The old markup for defining and linking to C directives will not work - anymore without activating the :mod:`~sphinx.ext.oldcmarkup` - extension. +* The old markup for defining and linking to C directives is now + deprecated. It will not work anymore in future versions without + activating the :mod:`~sphinx.ext.oldcmarkup` extension; in Sphinx + 1.0, it is activated by default. * Removed support for old dependency versions; requirements are now: @@ -54,6 +259,8 @@ - The :rst:role:`ref` role can now also reference tables by caption. - The :rst:dir:`include` directive now supports absolute paths, which are interpreted as relative to the source directory. + - In the Python domain, references like ``:func:`.name``` now look for + matching names with any prefix if no direct match is found. * Configuration: @@ -78,6 +285,9 @@ - Added :confval:`html_show_copyright` config value. - Added :confval:`latex_show_pagerefs` and :confval:`latex_show_urls` config values. + - The behavior of :confval:`html_file_suffix` changed slightly: the + empty string now means "no suffix" instead of "default suffix", use + ``None`` for "default suffix". * New builders: @@ -141,6 +351,7 @@ instead of PNG images, controlled by the :confval:`graphviz_output_format` config value. - Added ``alt`` option to :rst:dir:`graphviz` extension directives. + - Added ``exclude`` argument to :func:`.autodoc.between`. * Translations: @@ -148,10 +359,29 @@ - Added Turkish translation, thanks to Firat Ozgul. - Added Catalan translation, thanks to Pau Fernández. - Added simplified Chinese translation. + - Added Danish translation, thanks to Hjorth Larsen. + - Added Lithuanian translation, thanks to Dalius Dobravolskas. + +* Bugs fixed: + + - #445: Fix links to result pages when using the search function + of HTML built with the ``dirhtml`` builder. + - #444: In templates, properly re-escape values treated with the + "striptags" Jinja filter. + + +Release 0.6.7 (Jun 05, 2010) +============================ + +* #440: Remove usage of a Python >= 2.5 API in the ``literalinclude`` + directive. + +* Fix a bug that prevented some references being generated in the + LaTeX builder. +* #428: Add some missing CSS styles for standard docutils classes. -Release 0.6.7 (in development) -============================== +* #432: Fix UnicodeErrors while building LaTeX in translated locale. Release 0.6.6 (May 25, 2010) diff -Nru sphinx-1.0~hg20100604/debian/changelog sphinx-1.0.7/debian/changelog --- sphinx-1.0~hg20100604/debian/changelog 2010-06-05 20:49:35.000000000 +0000 +++ sphinx-1.0.7/debian/changelog 2011-02-14 06:52:11.000000000 +0000 @@ -1,8 +1,69 @@ -sphinx (1.0~hg20100604) lucid; urgency=low +sphinx (1.0.7-lucid1) lucid; urgency=low - * Merge beta1 package from experimental with current hg tip + * Package for Ubuntu, taken from debian experimental - -- Václav Šmilauer Thu, 03 Jun 2010 23:47:58 +0200 + -- Anton Gladky Mon, 14 Feb 2011 07:44:21 +0100 + +sphinx (1.0.7-1) experimental; urgency=low + + * New upstream release. + + Refresh patches. + + Add texlive-{latex-{recommended,extra},fonts-recommended} to + Build-Depends-Indep, so that tests for LaTeX output can be run. + * Move pycode/Grammar.txt and ext/autosummary/templates/* out of + /usr/share/pyshared/ (closes: #609486). + + -- Jakub Wilk Sat, 15 Jan 2011 19:32:06 +0100 + +sphinx (1.0.6-1) experimental; urgency=low + + * New upstream release. + + Refresh patches. + + Bump year in debian/copyright. + * Don't compress objects.inv. Thanks to Michael Fladischer for the bug + report. + * Remove *.egg-info in the clean target. + + -- Jakub Wilk Sat, 08 Jan 2011 15:54:59 +0100 + +sphinx (1.0.5-1) experimental; urgency=low + + [ Jakub Wilk ] + * New upstream release. + * Fix formatting of the manual pages. + * Update and significantly rewrite manual pages (closes: #593623). + * Point Vcs-* fields to the 1.0 branch. + * Switch to source format 3.0 (quilt). + + Drop README.source. + + Refresh patches. + + Update debian/rules. + + Drop quilt from build-depends. + * Update debian/copyright. + * Use DEP-3 format for patch headers. + * Run tests at build time. + + Add python-nose and python-simplejson to Build-Depends-Indep. + + Patch test runner to import modules correctly and prevent it from + reading files in /usr/share/sphinx. + + Update debian/rules. + + [ Stefano Rivera ] + * Improve language and clarify options in manpages. + + -- Jakub Wilk Sat, 18 Dec 2010 18:11:54 +0100 + +sphinx (1.0.1-1) experimental; urgency=low + + [ Mikhail Gusarov ] + * Fix preinst script to correctly remove python-central remnants (Closes: + #559572). + + [ Jakub Wilk ] + * Add myself to uploaders. + * New upstream release, fixing HTML generation bugs (closes: #588825, + #588829). + * Bump standards version to 3.9.1 (no changes needed). + + -- Jakub Wilk Sat, 07 Aug 2010 17:34:29 +0200 sphinx (1.0~b1-1) experimental; urgency=low diff -Nru sphinx-1.0~hg20100604/debian/control sphinx-1.0.7/debian/control --- sphinx-1.0~hg20100604/debian/control 2010-06-03 21:45:47.000000000 +0000 +++ sphinx-1.0.7/debian/control 2011-01-15 18:31:20.000000000 +0000 @@ -2,13 +2,15 @@ Section: python Priority: optional Maintainer: Mikhail Gusarov -Uploaders: Debian Python Modules Team +Uploaders: Jakub Wilk , Debian Python Modules Team Homepage: http://sphinx.pocoo.org/ -Build-Depends: debhelper (>= 7), python-all (>= 2.5.4-1~), python-setuptools (>= 0.6c5-1~), quilt (>= 0.40) -Build-Depends-Indep: python-support (>= 0.6.4), python-docutils, python-pygments (>= 0.8), python-jinja2 (>= 2.1) -Standards-Version: 3.8.4 -Vcs-Svn: svn://svn.debian.org/python-modules/packages/sphinx/trunk/ -Vcs-Browser: http://svn.debian.org/viewsvn/python-modules/packages/sphinx/trunk/ +Build-Depends: debhelper (>= 7), python-all (>= 2.5.4-1~), python-setuptools (>= 0.6c5-1~) +Build-Depends-Indep: python-support (>= 0.6.4), python-docutils, python-pygments (>= 0.8), python-jinja2 (>= 2.1), + python-nose, python-simplejson, + texlive-latex-recommended, texlive-latex-extra, texlive-fonts-recommended +Standards-Version: 3.9.1 +Vcs-Svn: svn://svn.debian.org/python-modules/packages/sphinx/branches/1.0/ +Vcs-Browser: http://svn.debian.org/viewsvn/python-modules/packages/sphinx/branches/1.0/ Package: python-sphinx Architecture: all diff -Nru sphinx-1.0~hg20100604/debian/copyright sphinx-1.0.7/debian/copyright --- sphinx-1.0~hg20100604/debian/copyright 2010-06-03 21:45:47.000000000 +0000 +++ sphinx-1.0.7/debian/copyright 2011-01-08 14:40:53.000000000 +0000 @@ -7,26 +7,22 @@ , Josip Dzolonga, Gerold Penz, Vivake Gupta -License: +License for Sphinx +================== -Copyright (c) 2007-2008 by the respective authors (see AUTHORS file). +Copyright (c) 2007-2011 by the Sphinx team (see AUTHORS file). All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. +* Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above - copyright notice, this list of conditions and the following - disclaimer in the documentation and/or other materials provided - with the distribution. - - * The names of the contributors may not be used to endorse or - promote products derived from this software without specific - prior written permission. +* Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT @@ -40,36 +36,230 @@ (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -AUTHORS file: +Licenses for incorporated software +================================== -The doctools are written and maintained by Georg Brandl . -Substantial parts of the templates and the web application were written by -Armin Ronacher . - -Other contributors are noted in the :copyright: fields within the docstrings -of the respective files. +The pgen2 package, included in this distribution under the name +sphinx.pycode.pgen2, is available in the Python 2.6 distribution under +the PSF license agreement for Python: + +| Copyright © 2001-2008 Python Software Foundation; All Rights Reserved. +| +| PYTHON SOFTWARE FOUNDATION LICENSE VERSION 2 +| -------------------------------------------- +| +| 1. This LICENSE AGREEMENT is between the Python Software Foundation +| ("PSF"), and the Individual or Organization ("Licensee") accessing +| and otherwise using Python 2.6 software in source or binary form +| and its associated documentation. +| +| 2. Subject to the terms and conditions of this License Agreement, PSF +| hereby grants Licensee a nonexclusive, royalty-free, world-wide +| license to reproduce, analyze, test, perform and/or display +| publicly, prepare derivative works, distribute, and otherwise use +| Python 2.6 alone or in any derivative version, provided, however, +| that PSF's License Agreement and PSF's notice of copyright, i.e., +| "Copyright © 2001-2008 Python Software Foundation; All Rights +| Reserved" are retained in Python 2.6 alone or in any derivative +| version prepared by Licensee. +| +| 3. In the event Licensee prepares a derivative work that is based on +| or incorporates Python 2.6 or any part thereof, and wants to make +| the derivative work available to others as provided herein, then +| Licensee hereby agrees to include in any such work a brief summary +| of the changes made to Python 2.6. +| +| 4. PSF is making Python 2.6 available to Licensee on an "AS IS" basis. +| PSF MAKES NO REPRESENTATIONS OR WARRANTIES, EXPRESS OR IMPLIED. BY +| WAY OF EXAMPLE, BUT NOT LIMITATION, PSF MAKES NO AND DISCLAIMS ANY +| REPRESENTATION OR WARRANTY OF MERCHANTABILITY OR FITNESS FOR ANY +| PARTICULAR PURPOSE OR THAT THE USE OF PYTHON 2.6 WILL NOT INFRINGE +| ANY THIRD PARTY RIGHTS. +| +| 5. PSF SHALL NOT BE LIABLE TO LICENSEE OR ANY OTHER USERS OF PYTHON +| 2.6 FOR ANY INCIDENTAL, SPECIAL, OR CONSEQUENTIAL DAMAGES OR LOSS +| AS A RESULT OF MODIFYING, DISTRIBUTING, OR OTHERWISE USING PYTHON +| 2.6, OR ANY DERIVATIVE THEREOF, EVEN IF ADVISED OF THE POSSIBILITY +| THEREOF. +| +| 6. This License Agreement will automatically terminate upon a material +| breach of its terms and conditions. +| +| 7. Nothing in this License Agreement shall be deemed to create any +| relationship of agency, partnership, or joint venture between PSF +| and Licensee. This License Agreement does not grant permission to +| use PSF trademarks or trade name in a trademark sense to endorse or +| promote products or services of Licensee, or any third party. +| +| 8. By copying, installing or otherwise using Python 2.6, Licensee +| agrees to be bound by the terms and conditions of this License +| Agreement. + +The included smartypants module, included as sphinx.util.smartypants, +is available under the following license: + +| SmartyPants license:: +| +| Copyright (c) 2003 John Gruber +| (http://daringfireball.net/) +| All rights reserved. +| +| Redistribution and use in source and binary forms, with or without +| modification, are permitted provided that the following conditions +| are met: +| +| * Redistributions of source code must retain the above copyright +| notice, this list of conditions and the following disclaimer. +| +| * Redistributions in binary form must reproduce the above +| copyright notice, this list of conditions and the following +| disclaimer in the documentation and/or other materials +| provided with the distribution. +| +| * Neither the name "SmartyPants" nor the names of its +| contributors may be used to endorse or promote products +| derived from this software without specific prior written +| permission. +| +| This software is provided by the copyright holders and +| contributors "as is" and any express or implied warranties, +| including, but not limited to, the implied warranties of +| merchantability and fitness for a particular purpose are +| disclaimed. In no event shall the copyright owner or contributors +| be liable for any direct, indirect, incidental, special, +| exemplary, or consequential damages (including, but not limited +| to, procurement of substitute goods or services; loss of use, +| data, or profits; or business interruption) however caused and on +| any theory of liability, whether in contract, strict liability, or +| tort (including negligence or otherwise) arising in any way out of +| the use of this software, even if advised of the possibility of +| such damage. +| +| +| smartypants.py license:: +| +| smartypants.py is a derivative work of SmartyPants. +| +| Redistribution and use in source and binary forms, with or without +| modification, are permitted provided that the following conditions +| are met: +| +| * Redistributions of source code must retain the above copyright +| notice, this list of conditions and the following disclaimer. +| +| * Redistributions in binary form must reproduce the above +| copyright notice, this list of conditions and the following +| disclaimer in the documentation and/or other materials +| provided with the distribution. +| +| This software is provided by the copyright holders and +| contributors "as is" and any express or implied warranties, +| including, but not limited to, the implied warranties of +| merchantability and fitness for a particular purpose are +| disclaimed. In no event shall the copyright owner or contributors +| be liable for any direct, indirect, incidental, special, +| exemplary, or consequential damages (including, but not limited +| to, procurement of substitute goods or services; loss of use, +| data, or profits; or business interruption) however caused and on +| any theory of liability, whether in contract, strict liability, or +| tort (including negligence or otherwise) arising in any way out of +| the use of this software, even if advised of the possibility of +| such damage. + +The ElementTree package, included in this distribution in +test/etree13, is available under the following license: + +| The ElementTree toolkit is +| +| Copyright (c) 1999-2007 by Fredrik Lundh +| +| By obtaining, using, and/or copying this software and/or its +| associated documentation, you agree that you have read, understood, +| and will comply with the following terms and conditions: +| +| Permission to use, copy, modify, and distribute this software and its +| associated documentation for any purpose and without fee is hereby +| granted, provided that the above copyright notice appears in all +| copies, and that both that copyright notice and this permission notice +| appear in supporting documentation, and that the name of Secret Labs +| AB or the author not be used in advertising or publicity pertaining to +| distribution of the software without specific, written prior +| permission. +| +| SECRET LABS AB AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO +| THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANT- ABILITY +| AND FITNESS. IN NO EVENT SHALL SECRET LABS AB OR THE AUTHOR BE LIABLE +| FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +| WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +| ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT +| OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + +The included JQuery JavaScript library is available under the MIT +license: + +| Copyright (c) 2008 John Resig, http://jquery.com/ +| +| Permission is hereby granted, free of charge, to any person obtaining +| a copy of this software and associated documentation files (the +| "Software"), to deal in the Software without restriction, including +| without limitation the rights to use, copy, modify, merge, publish, +| distribute, sublicense, and/or sell copies of the Software, and to +| permit persons to whom the Software is furnished to do so, subject to +| the following conditions: +| +| The above copyright notice and this permission notice shall be +| included in all copies or substantial portions of the Software. +| +| THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +| EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +| MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +| NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +| LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +| OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +| WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +AUTHORS file +============ + +Sphinx is written and maintained by Georg Brandl . + +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 +* Josip Dzolonga -- coverage builder +* Horst Gutmann -- internationalization support +* 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! -Copyright strings: - -spinx/search.py, -sphinx/web/{feed.py,antispam.py,userdb.py,wsgiutil.py,markup.py,} - -:copyright: 2007-2008 by Armin Ronacher. - -sphinx/ext/coverage.py - -:copyright: 2007 by Josip Dzolonga, Georg Brandl. - -sphinx/web/mail.py - -:copyright: 2004-2007 by Gerold Penz. - -sphinx/util/stemmer.py - -:copyright: 2001 by Vivake Gupta - -All the other files: +There are also a few modules or functions incorporated from other +authors and projects: -:copyright: 2007-2008 by Georg Brandl +* sphinx.util.jsdump uses the basestring encoding from simplejson, + written by Bob Ippolito, released under the MIT license +* sphinx.util.stemmer was written by Vivake Gupta, placed in the + Public Domain diff -Nru sphinx-1.0~hg20100604/debian/dirs sphinx-1.0.7/debian/dirs --- sphinx-1.0~hg20100604/debian/dirs 2010-06-03 21:45:47.000000000 +0000 +++ sphinx-1.0.7/debian/dirs 2011-01-10 12:44:08.000000000 +0000 @@ -1 +1,3 @@ /usr/share/sphinx/locale +/usr/share/sphinx/pycode +/usr/share/sphinx/ext/autosummary diff -Nru sphinx-1.0~hg20100604/debian/patches/move_static_files_outside_site-packages.patch sphinx-1.0.7/debian/patches/move_static_files_outside_site-packages.patch --- sphinx-1.0~hg20100604/debian/patches/move_static_files_outside_site-packages.patch 2010-06-03 21:45:47.000000000 +0000 +++ sphinx-1.0.7/debian/patches/move_static_files_outside_site-packages.patch 2011-01-15 17:47:53.000000000 +0000 @@ -1,15 +1,68 @@ -# move static files outside site-packages so that they can be shared between -# different Python versions -Index: sphinx-1.0~b1/sphinx/__init__.py -=================================================================== ---- sphinx-1.0~b1.orig/sphinx/__init__.py -+++ sphinx-1.0~b1/sphinx/__init__.py -@@ -15,7 +15,7 @@ from os import path - __version__ = '1.0b1' - __released__ = '1.0b1' # used when Sphinx builds its own docs +Description: Move static files outside site-packages so that they can be shared + between different Python versions. +Forwarded: not-needed +Last-Update: 2011-01-10 + +--- a/sphinx/__init__.py ++++ b/sphinx/__init__.py +@@ -15,7 +15,7 @@ + __version__ = '1.0.7' + __released__ = '1.0.7' # used when Sphinx builds its own docs -package_dir = path.abspath(path.dirname(__file__)) +package_dir = '/usr/share/sphinx/' if '+' in __version__ or 'pre' in __version__: # try to find out the changeset hash if checked out from hg, and append +--- a/tests/run.py ++++ b/tests/run.py +@@ -14,7 +14,10 @@ + from os import path + + # always test the sphinx package from this directory +-sys.path.insert(0, path.join(path.dirname(__file__), path.pardir)) ++sys.path.insert(0, path.abspath(path.join(path.dirname(__file__), path.pardir))) ++ ++import sphinx ++sphinx.package_dir = path.join(sys.path[0], 'sphinx') + + try: + import nose +--- a/sphinx/pycode/__init__.py ++++ b/sphinx/pycode/__init__.py +@@ -14,6 +14,7 @@ + from os import path + from cStringIO import StringIO + ++from sphinx import package_dir + from sphinx.errors import PycodeError + from sphinx.pycode import nodes + from sphinx.pycode.pgen2 import driver, token, tokenize, parse, literals +@@ -22,7 +23,7 @@ + + + # load the Python grammar +-_grammarfile = path.join(path.dirname(__file__), 'Grammar.txt') ++_grammarfile = path.join(package_dir, 'pycode', 'Grammar.txt') + pygrammar = driver.load_grammar(_grammarfile) + pydriver = driver.Driver(pygrammar, convert=nodes.convert) + +--- a/sphinx/ext/autosummary/generate.py ++++ b/sphinx/ext/autosummary/generate.py +@@ -26,6 +26,7 @@ + from jinja2 import FileSystemLoader, TemplateNotFound + from jinja2.sandbox import SandboxedEnvironment + ++from sphinx import package_dir + from sphinx.ext.autosummary import import_by_name, get_documenter + from sphinx.jinja2glue import BuiltinTemplateLoader + from sphinx.util.osutil import ensuredir +@@ -76,7 +77,7 @@ + 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')] ++ template_dirs = [os.path.join(package_dir, 'ext', 'autosummary', 'templates')] + if builder is not None: + # allow the user to override the templates + template_loader = BuiltinTemplateLoader() diff -Nru sphinx-1.0~hg20100604/debian/preinst sphinx-1.0.7/debian/preinst --- sphinx-1.0~hg20100604/debian/preinst 2010-06-03 21:45:47.000000000 +0000 +++ sphinx-1.0.7/debian/preinst 2010-06-24 13:31:08.000000000 +0000 @@ -1,11 +1,10 @@ #!/bin/sh # TODO: remove this file after releasing Squeeze set -e -if [ "$1" = upgrade ] && dpkg --compare-versions "$2" lt-nl 0.5.2-1~; +if [ "$1" = upgrade ] && dpkg --compare-versions "$2" lt-nl 1.0~b1-2~; then pycentral pkgremove python-sphinx || true - rm -rf /usr/lib/python2.4/site-packages/sphinx/ - rm -rf /usr/lib/python2.5/site-packages/sphinx/ + rm -rf /usr/lib/python2.*/*-packages/sphinx/ fi #DEBHELPER# diff -Nru sphinx-1.0~hg20100604/debian/README.source sphinx-1.0.7/debian/README.source --- sphinx-1.0~hg20100604/debian/README.source 2010-06-03 21:45:47.000000000 +0000 +++ sphinx-1.0.7/debian/README.source 1970-01-01 00:00:00.000000000 +0000 @@ -1,57 +0,0 @@ -This package uses quilt to manage all modifications to the upstream -source. Changes are stored in the source package as diffs in -debian/patches and applied during the build. - -To configure quilt to use debian/patches instead of patches, you want -either to export QUILT_PATCHES=debian/patches in your environment -or use this snippet in your ~/.quiltrc: - - for where in ./ ../ ../../ ../../../ ../../../../ ../../../../../; do - if [ -e ${where}debian/rules -a -d ${where}debian/patches ]; then - export QUILT_PATCHES=debian/patches - fi - done - -To get the fully patched source after unpacking the source package, cd to -the root level of the source package and run: - - quilt push -a - -The last patch listed in debian/patches/series will become the current -patch. - -To add a new set of changes, first run quilt push -a, and then run: - - quilt new - -where is a descriptive name for the patch, used as the filename in -debian/patches. Then, for every file that will be modified by this patch, -run: - - quilt add - -before editing those files. You must tell quilt with quilt add what files -will be part of the patch before making changes or quilt will not work -properly. After editing the files, run: - - quilt refresh - -to save the results as a patch. - -Alternately, if you already have an external patch and you just want to -add it to the build system, run quilt push -a and then: - - quilt import -P /path/to/patch - quilt push -a - -(add -p 0 to quilt import if needed). as above is the filename to -use in debian/patches. The last quilt push -a will apply the patch to -make sure it works properly. - -To remove an existing patch from the list of patches that will be applied, -run: - - quilt delete - -You may need to run quilt pop -a to unapply patches first before running -this command. diff -Nru sphinx-1.0~hg20100604/debian/rules sphinx-1.0.7/debian/rules --- sphinx-1.0~hg20100604/debian/rules 2010-06-03 21:45:47.000000000 +0000 +++ sphinx-1.0.7/debian/rules 2011-01-10 12:44:08.000000000 +0000 @@ -1,7 +1,6 @@ #!/usr/bin/make -f # -*- makefile -*- -include /usr/share/quilt/quilt.make include /usr/share/python/python.mk PACKAGE_NAME=python-sphinx @@ -13,21 +12,24 @@ build-stamp: dh_testdir mkdir -p _build/html - python sphinx-build.py doc _build/html + PYTHONPATH=. python debian/sphinx-build-local.py doc _build/html +ifeq (,$(filter nocheck,$(DEB_BUILD_OPTIONS))) + set -e -x; \ + for python in $(shell pyversions -r); do \ + $$python tests/run.py; \ + done +endif touch build-stamp -clean: clean-patched unpatch +clean: dh_testdir dh_testroot + python setup.py clean find . -name '*.py[co]' -delete - rm -rf _build build + rm -rf _build build *.egg-info dh_clean sphinx/pycode/*.pickle -clean-patched: patch - dh_testdir - python setup.py clean - -install: build patch +install: build dh_testdir dh_testroot dh_installdirs @@ -36,6 +38,8 @@ # move static files outside {site,dist}-packages mv $(SITE_PACKAGES_DIR)/sphinx/texinputs $(PACKAGE_DIR)/usr/share/sphinx/ mv $(SITE_PACKAGES_DIR)/sphinx/themes $(PACKAGE_DIR)/usr/share/sphinx/ + mv $(SITE_PACKAGES_DIR)/sphinx/pycode/Grammar.txt $(PACKAGE_DIR)/usr/share/sphinx/pycode/ + mv $(SITE_PACKAGES_DIR)/sphinx/ext/autosummary/templates $(PACKAGE_DIR)/usr/share/sphinx/ext/autosummary/ for lang in `find $(SITE_PACKAGES_DIR)/sphinx/locale\ -maxdepth 1 -mindepth 1 -type d -printf "%f "`;\ do\ @@ -66,7 +70,7 @@ dh_installexamples dh_installman dh_pysupport - dh_compress -X.py -X.js -X.rst -X.json -X.doctree -X.txt + dh_compress -X.py -X.js -X.rst -X.json -X.doctree -X.txt -Xobjects.inv dh_link /usr/share/javascript/jquery/jquery.js \ /usr/share/doc/python-sphinx/html/_static/jquery.js dh_fixperms diff -Nru sphinx-1.0~hg20100604/debian/source/format sphinx-1.0.7/debian/source/format --- sphinx-1.0~hg20100604/debian/source/format 2010-06-03 21:45:47.000000000 +0000 +++ sphinx-1.0.7/debian/source/format 2011-02-14 07:01:10.000000000 +0000 @@ -1 +1 @@ -1.0 +3.0 (quilt) diff -Nru sphinx-1.0~hg20100604/debian/sphinx-autogen.1 sphinx-1.0.7/debian/sphinx-autogen.1 --- sphinx-1.0~hg20100604/debian/sphinx-autogen.1 2010-06-03 21:45:47.000000000 +0000 +++ sphinx-1.0.7/debian/sphinx-autogen.1 2010-08-31 12:16:44.000000000 +0000 @@ -1,4 +1,4 @@ -.TH sphinx\-autogen 1 "Sat, 28 Mar 2009" "Jan Dittberner" "User Commands" +.TH sphinx\-autogen 1 "Aug 2010" "Jan Dittberner" "User Commands" .SH NAME sphinx\-autogen \- generate ReStructuredText using \fBautosummary\fR @@ -6,22 +6,25 @@ .SH SYNOPSIS .B sphinx\-autogen -[\fI\-o output_dir\fR] -[\fI\-s suffix\fR] +[\-o \fIoutput_dir\fR] +[\-s \fIsuffix\fR] .BI sourcefile ... .SH OPTIONS .TP -\fB\-o output_dir\fR +\fB\-o\fR, \fB--output-dir=\fIoutput_dir\fR, the directory the output files should be written to .TP -\fB\-s suffix\fR +\fB\-s\fR, \fB--suffix=\fIsuffix\fR the suffix of the written files (defaults to rst) +.TP +\fB\-t\fR, \fB--templates=\fIdirectory\fR +custom template directory .SH DESCRIPTION .B sphinx\-autogen -is a frontend to the \fBsphinx.ext.autosummary.generate\fR it -generates the ReStructuredText files from the \fBautosummary\fR +is a frontend to \fBsphinx.ext.autosummary.generate\fR. +It generates the ReStructuredText files from the \fBautosummary\fR directives contained in the given input files. The format of the \fBautosummary\fR directive is documented in the @@ -31,8 +34,8 @@ .I sphinx.ext.autosummary .SH SEE ALSO -.BR sphinx\-quickstart (1), -.BR sphinx\-build (1) +\fBsphinx\-quickstart\fR(1), +\fBsphinx\-build\fR(1) .mso www.tmac .URL "http://sphinx.pocoo.org/" "The Sphinx website" diff -Nru sphinx-1.0~hg20100604/debian/sphinx-build.1 sphinx-1.0.7/debian/sphinx-build.1 --- sphinx-1.0~hg20100604/debian/sphinx-build.1 2010-06-03 21:45:47.000000000 +0000 +++ sphinx-1.0.7/debian/sphinx-build.1 2010-08-31 12:16:44.000000000 +0000 @@ -1,71 +1,112 @@ -.TH sphinx-build 1 "Apr 2008" "Sphinx 0.1.61950" "User Commands" +.TH sphinx-build 1 "Aug 2010" "Sphinx 0.6.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 and places it -to the . +\fBsphinx-build\fR generates documentation from the files in \fIsourcedir\fR and places it +to the \fIoutdir\fR. -sphinx-build looks for /conf.py for the configuration settings. -.B sphinx-quickstart(1) +\fBsphinx-build\fR reads \fIsourcedir\fR/conf.py for the configuration settings. +\fBsphinx-quickstart\fR(1) may be used to generate template files, including conf.py. -sphinx-build can create documentation in different formats. Format is selected -by specifying builder in command line and defaults to HTML. Builders can -also perform other tasks related to the documentation processing. +\fBsphinx-build\fR can create documentation in different formats. +The output format is selected by specifying builder in command line and +defaults to HTML. +Builders can also perform other tasks related to the documentation +processing. List of available builders: .TP \fBhtml\fR -HTML files generation. This is default builder. +Build HTML pages. This is the default builder. .TP -\fBweb\fR -Generating files for sphinx-web (currently undergo the full rewrite, and not working). +\fBsinglehtml\fR +Build a single HTML with the whole content. .TP -\fBhtmlhelp\fR -Generates files for CHM generation. +\fBdirhtml\fR +Build HTML pages, but with a single directory per document. +.TP +\fBhtmlhelp\fR, \fBqthelp\fR, \fBdevhelp\fR, \fBepub\fR +Build HTML pages with additional information for building a documentation collection in one of these formats. .TP \fBlatex\fR -Generates LaTeX version of documentation. This builder uses PAPER environment variable (e.g. PAPER=a4 or PAPER=letter) if available. +Build LaTeX sources that can be compiled to a PDF document using \fBpdflatex\fR. +This builder uses the PAPER environment variable (e.g. PAPER=a4 or PAPER=letter) if available. +.TP +\fBman\fR +Build manual pages in groff format for UNIX systems. +.TP +\fBtext\fR +Build plain text files. .TP \fBchanges\fR -Shows changed/added/deprecated items since last documentation generation. +Show changed/added/deprecated items since last documentation generation. .TP \fBlinkcheck\fR -Checks the integrity of all external links in documentation +Check the integrity of all external links in documentation. +.TP +\fBpickle\fR, \fBjson\fR +Produce a directory with pickle/JSON files containing mostly HTML fragments and TOC information, for use of a web application (or a custom postprocessing tool) that doesn't use the standard HTML templates. .SH OPTIONS .TP -\fB-b\fR -Builder to use; defaults to html. See the full list of builders above. +\fB-b\fR \fIbuilder\fR +Select a builder. The default is \fBhtml\fR. See the full list of builders above. .TP -\fB\fR -Force to generate documentation for the file +\fIfilename\fR +Only generate documentation from the source file specified. +Additionally, this option forces regeneration. .TP \fB-a\fR -Generate all files; without this option only documentation for new and changed files is generated +Write all output files. +(The default is to only write output files for new and changed source files.) .TP \fB-E\fR -Ignore cached files, forces to re-read all files from disk. +Don't use a saved environment (the structure caching all +cross-references), but rebuild completely. +(The default is to only read and parse source files that are new or have +changed since the last run.) +.TP +\fB-t\fR \fItag\fR +Define the \fItag\fR. This is relevant for \[oq]only\[cq] directives that only include their content if this tag is set. +.TP +\fB-d\fR \fIpath\fR +Select cache directory. The default is \fIoutdir\fP/.doctrees/. .TP -\fB-d\fR -Path to cached environment; defaults to /.doctrees +\fB-c\fR \fIpath\fR +Don't look for the conf.py in the \fIsourcedir\fR, but use the given configuration directory instead. 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. .TP -\fB-D\fR = -Overrides setting from /conf.py +\fB-C\fR +Don't look for a configuration file; only take options via the \fB-D\fR option. +.TP +\fB-D\fR \fIsetting\fR=\fIvalue\fR +Override a configuration value set in the \fBconf.py\fR file. +.TP +\fB-A\fR \fIname\fR=\fIvalue\fR +Make the \fIname\fR assigned to \fIvalue\fR in the HTML templates. .TP \fB-N\fR -Do not do colored output +Do not emit colored output .TP \fB-q\fR -Quiet operation, just prints warnings and errors on stderr +Do not output anything on standard output, only write warnings and errors to standard error. +.TP +\fB-Q\fR +Do not output anything on standard output, also suppress warnings. Only errors are written to standard error. +.TP +\fB-w\fR \fIfile\fR +Write warnings (and errors) to the given file, in addition to standard error. +.TP +\fB-W\fR +Turn warnings into errors. This means that the build stops at the first warning and \fBsphinx-build\fR exits with exit status 1. .TP \fB-P\fR -Run Pdb on exception +Run the Python debugger, \fBpdb\fR, if an unhandled exception occurs while building. .SH "SEE ALSO" -.BR sphinx-quickstart(1) -.br +\fBsphinx-quickstart\fR(1) +.PP The full documentation for .B Sphinx is installed to diff -Nru sphinx-1.0~hg20100604/debian/sphinx-build-local.py sphinx-1.0.7/debian/sphinx-build-local.py --- sphinx-1.0~hg20100604/debian/sphinx-build-local.py 1970-01-01 00:00:00.000000000 +0000 +++ sphinx-1.0.7/debian/sphinx-build-local.py 2010-12-18 14:10:53.000000000 +0000 @@ -0,0 +1,13 @@ +#!/usr/bin/python + +# Like /usr/bin/sphinx-build, but don't try to use system-wide static files. + +import os +import sys +import sphinx + +if __name__ == '__main__': + sphinx.package_dir = os.path.abspath(os.path.dirname(sphinx.__file__)) + sys.exit(sphinx.main(sys.argv)) + +# vim:ts=4 sw=4 et diff -Nru sphinx-1.0~hg20100604/debian/sphinx-quickstart.1 sphinx-1.0.7/debian/sphinx-quickstart.1 --- sphinx-1.0~hg20100604/debian/sphinx-quickstart.1 2010-06-03 21:45:47.000000000 +0000 +++ sphinx-1.0.7/debian/sphinx-quickstart.1 2010-08-30 19:57:40.000000000 +0000 @@ -5,11 +5,11 @@ .B sphinx-quickstart .SH DESCRIPTION sphinx-quickstart is the interactive tool which asks some questions about your -Python project and then generates template documentation directory and sample -Makefile to be used with \fBsphinx-build(1)\fR. +Python project and then generates a template documentation directory and sample +Makefile to be used with \fBsphinx-build\fR(1). .SH "SEE ALSO" -.BR sphinx-build(1) -.br +\fBsphinx-build\fR(1) +.PP The full documentation for .B Sphinx is installed to Binary files /tmp/Rt1D5gzI2R/sphinx-1.0~hg20100604/dist/Sphinx-1.0b2_28786e8ee3f6_dev_20100604-py2.6.egg and /tmp/0_5OtyEyzZ/sphinx-1.0.7/dist/Sphinx-1.0b2_28786e8ee3f6_dev_20100604-py2.6.egg differ diff -Nru sphinx-1.0~hg20100604/doc/builders.rst sphinx-1.0.7/doc/builders.rst --- sphinx-1.0~hg20100604/doc/builders.rst 2010-05-06 16:30:00.000000000 +0000 +++ sphinx-1.0.7/doc/builders.rst 2011-01-04 09:00:04.000000000 +0000 @@ -255,11 +255,11 @@ files. They also copy the reST source files in the directory ``_sources`` under the output directory. -The :class:`PickleHTMLBuilder` is a builtin subclass that implements the pickle +The :class:`.PickleHTMLBuilder` is a builtin subclass that implements the pickle serialization interface. The files per source file have the extensions of -:attr:`~SerializingHTMLBuilder.out_suffix`, and are arranged in directories +:attr:`~.SerializingHTMLBuilder.out_suffix`, and are arranged in directories just as the source files are. They unserialize to a dictionary (or dictionary like structure) with these keys: @@ -290,7 +290,7 @@ The special files are located in the root output directory. They are: -:attr:`SerializingHTMLBuilder.globalcontext_filename` +:attr:`.SerializingHTMLBuilder.globalcontext_filename` A pickled dict with these keys: ``project``, ``copyright``, ``release``, ``version`` @@ -309,7 +309,7 @@ ``titles`` A dictionary of all documents' titles, as HTML strings. -:attr:`SerializingHTMLBuilder.searchindex_filename` +:attr:`.SerializingHTMLBuilder.searchindex_filename` An index that can be used for searching the documentation. It is a pickled list with these entries: diff -Nru sphinx-1.0~hg20100604/doc/config.rst sphinx-1.0.7/doc/config.rst --- sphinx-1.0~hg20100604/doc/config.rst 2010-06-03 22:12:22.000000000 +0000 +++ sphinx-1.0.7/doc/config.rst 2011-01-12 08:36:32.000000000 +0000 @@ -98,7 +98,7 @@ Example patterns: - ``'library/xml.rst'`` -- ignores the ``library/xml.rst`` file (replaces - entry in :confval:`unused_docs` + 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 @@ -283,8 +283,10 @@ Currently supported languages are: + * ``bn`` -- Bengali * ``ca`` -- Catalan * ``cs`` -- Czech + * ``da`` -- Danish * ``de`` -- German * ``en`` -- English * ``es`` -- Spanish @@ -292,6 +294,8 @@ * ``fr`` -- French * ``hr`` -- Croatian * ``it`` -- Italian + * ``ja`` -- Japanese + * ``lt`` -- Lithuanian * ``nl`` -- Dutch * ``pl`` -- Polish * ``pt_BR`` -- Brazilian Portuguese @@ -343,12 +347,12 @@ A boolean that decides whether module names are prepended to all :term:`object` names (for object types where a "module" of some kind is - defined), e.g. for :rst:dir:`function` directives. Default is ``True``. + defined), e.g. for :rst:dir:`py:function` directives. Default is ``True``. .. confval:: show_authors - A boolean that decides whether :rst:dir:`moduleauthor` and :rst:dir:`sectionauthor` - directives produce any output in the built files. + A boolean that decides whether :rst:dir:`codeauthor` and + :rst:dir:`sectionauthor` directives produce any output in the built files. .. confval:: modindex_common_prefix @@ -432,6 +436,14 @@ .. versionadded:: 0.4 +.. confval:: html_context + + A dictionary of values to pass into the template engine's context for all + pages. Single values can also be put in this dictionary using the + :option:`-A` command-line option of ``sphinx-build``. + + .. versionadded:: 0.5 + .. confval:: html_logo If given, this must be the name of an image file that is the logo of the @@ -550,19 +562,6 @@ This will render the template ``customdownload.html`` as the page ``download.html``. - .. note:: - - Earlier versions of Sphinx had a value called :confval:`html_index` which - was a clumsy way of controlling the content of the "index" document. If - you used this feature, migrate it by adding an ``'index'`` key to this - setting, with your custom template as the value, and in your custom - template, use :: - - {% extend "defindex.html" %} - {% block tables %} - ... old template content ... - {% endblock %} - .. confval:: html_domain_indices If true, generate domain-specific indices in addition to the general index. @@ -624,8 +623,8 @@ .. confval:: html_file_suffix - If nonempty, this is the file name suffix for generated HTML files. The - default is ``".html"``. + This is the file name suffix for generated HTML files. The default is + ``".html"``. .. versionadded:: 0.4 @@ -755,7 +754,7 @@ 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:: + If the title is empty, no entry is added to :file:`toc.ncx`. Example:: epub_pre_files = [ ('index.html', 'Welcome'), @@ -766,8 +765,9 @@ .. 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 ``[]``. + It is a list of tuples containing the file name and the title. This option + can be used to add an appendix. If the title is empty, no entry is added + to :file:`toc.ncx`. The default value is ``[]``. .. confval:: epub_exclude_files @@ -780,6 +780,12 @@ be an integer greater than zero. The default value is 3. Note: A deeply nested table of contents may be difficult to navigate. +.. confval:: epub_tocdup + + This flag determines if a toc entry is inserted again at the beginning of + it's nested toc listing. This allows easier navitation to the top of + a chapter, but can be confusing because it mixes entries of differnet + depth in one list. The default value is ``True``. .. _latex-options: @@ -806,9 +812,11 @@ * *author*: Author for the LaTeX document. The same LaTeX markup caveat as for *title* applies. Use ``\and`` to separate multiple authors, as in: ``'John \and Sarah'``. - * *documentclass*: Must be one of ``'manual'`` or ``'howto'``. Only "manual" - documents will get appendices. Also, howtos will have a simpler title - page. + * *documentclass*: Normally, one of ``'manual'`` or ``'howto'`` (provided by + Sphinx). Other document classes can be given, but they must include the + "sphinx" package in order to define Sphinx' custom LaTeX commands. + "howto" documents will not get appendices. Also, howtos will have a simpler + title page. * *toctree_only*: Must be ``True`` or ``False``. If ``True``, the *startdoc* document itself is not included in the output, only the documents referenced by it via TOC trees. With this option, you can put extra stuff diff -Nru sphinx-1.0~hg20100604/doc/conf.py sphinx-1.0.7/doc/conf.py --- sphinx-1.0~hg20100604/doc/conf.py 2010-06-03 22:12:22.000000000 +0000 +++ sphinx-1.0.7/doc/conf.py 2011-01-15 14:08:44.000000000 +0000 @@ -13,7 +13,7 @@ exclude_patterns = ['_build'] project = 'Sphinx' -copyright = '2007-2010, Georg Brandl' +copyright = '2007-2011, Georg Brandl' version = sphinx.__released__ release = version show_authors = True @@ -21,7 +21,6 @@ html_theme = 'sphinxdoc' modindex_common_prefix = ['sphinx.'] html_static_path = ['_static'] -html_index = 'index.html' html_sidebars = {'index': ['indexsidebar.html', 'searchbox.html']} html_additional_pages = {'index': 'index.html'} html_use_opensearch = 'http://sphinx.pocoo.org' @@ -34,9 +33,9 @@ epub_publisher = 'http://sphinx.pocoo.org/' epub_scheme = 'url' epub_identifier = epub_publisher -epub_pre_files = [('index', 'Welcome')] +epub_pre_files = [('index.html', 'Welcome')] epub_exclude_files = ['_static/opensearch.xml', '_static/doctools.js', - '_static/jquery.js', '_static/searchtools.js', + '_static/jquery.js', '_static/searchtools.js', '_static/underscore.js', '_static/basic.css', 'search.html'] latex_documents = [('contents', 'sphinx.tex', 'Sphinx Documentation', @@ -64,6 +63,10 @@ 'template generator', '', 1), ] +# We're not using intersphinx right now, but if we did, this would be part of +# the mapping: +intersphinx_mapping = {'python': ('http://docs.python.org/dev', None)} + # -- Extension interface ------------------------------------------------------- @@ -89,8 +92,12 @@ def setup(app): from sphinx.ext.autodoc import cut_lines + from sphinx.util.docfields import GroupedField app.connect('autodoc-process-docstring', cut_lines(4, what=['module'])) - app.add_description_unit('confval', 'confval', - objname='configuration value', - indextemplate='pair: %s; configuration value') - app.add_description_unit('event', 'event', 'pair: %s; event', parse_event) + app.add_object_type('confval', 'confval', + objname='configuration value', + indextemplate='pair: %s; configuration value') + fdesc = GroupedField('parameter', label='Parameters', + names=['param'], can_collapse=True) + app.add_object_type('event', 'event', 'pair: %s; event', parse_event, + doc_field_types=[fdesc]) diff -Nru sphinx-1.0~hg20100604/doc/domains.rst sphinx-1.0.7/doc/domains.rst --- sphinx-1.0~hg20100604/doc/domains.rst 2010-06-03 22:12:22.000000000 +0000 +++ sphinx-1.0.7/doc/domains.rst 2011-01-15 13:24:08.000000000 +0000 @@ -52,10 +52,19 @@ .. py:function:: spam(eggs) ham(eggs) - :noindex: Spam or ham the foo. +This describes the two Python functions ``spam`` and ``ham``. (Note that when +signatures become too long, you can break them if you add a backslash to lines +that are continued in the next line. Example:: + + .. py:function:: filterwarnings(action, message='', category=Warning, \ + module='', lineno=0, append=False) + :noindex: + +(This example also shows how to use the ``:noindex:`` flag.) + 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 :: @@ -138,11 +147,12 @@ .. 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`. + 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:`py: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: @@ -278,11 +288,6 @@ :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]) @@ -297,6 +302,13 @@ :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 + + +.. _python-roles: Cross-referencing Python objects ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -366,6 +378,17 @@ A similar heuristic is used to determine whether the name is an attribute of the currently documented class. +Also, if the name is prefixed with a dot, and no exact match is found, the +target is taken as a suffix and all object names with that suffix are +searched. For example, ``:py:meth:`.TarFile.close``` references the +``tarfile.TarFile.close()`` function, even if the current module is not +``tarfile``. Since this can get ambiguous, if there is more than one possible +match, you will get a warning from Sphinx. + +Note that you can combine the ``~`` and ``.`` prefixes: +``:py:meth:`~.TarFile.close``` will reference the ``tarfile.TarFile.close()`` +method, but the visible link caption will only be ``close()``. + .. _c-domain: @@ -417,6 +440,8 @@ .. c:var:: PyObject* PyClass_Type +.. _c-roles: + Cross-referencing C constructs ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -501,6 +526,9 @@ Select the current C++ namespace for the following objects. + +.. _cpp-roles: + These roles link to the given object types: .. rst:role:: cpp:class @@ -511,6 +539,15 @@ Reference a C++ object. You can give the full signature (and need to, for overloaded functions.) + .. note:: + + Sphinx' syntax to give references a custom title can interfere with + linking to template classes, if nothing follows the closing angle + bracket, i.e. if the link looks like this: ``:cpp:class:`MyClass```. + This is interpreted as a link to ``T`` with a title of ``MyClass``. + In this case, please escape the opening angle bracket with a backslash, + like this: ``:cpp:class:`MyClass\```. + .. admonition:: Note on References It is currently impossible to link to a specific version of an @@ -659,6 +696,8 @@ Describes the attribute *name* of *object*. +.. _js-roles: + These roles are provided to refer to the described objects: .. rst:role:: js:func @@ -710,6 +749,8 @@ Foo description. +.. _rst-roles: + These roles are provided to refer to the described objects: .. rst:role:: rst:dir diff -Nru sphinx-1.0~hg20100604/doc/ext/appapi.rst sphinx-1.0.7/doc/ext/appapi.rst --- sphinx-1.0~hg20100604/doc/ext/appapi.rst 2010-05-06 16:30:00.000000000 +0000 +++ sphinx-1.0.7/doc/ext/appapi.rst 2011-01-07 15:27:28.000000000 +0000 @@ -163,7 +163,8 @@ .. versionadded:: 0.6 -.. method:: Sphinx.add_object_type(directivename, rolename, indextemplate='', parse_node=None, ref_nodeclass=None, objname='') +.. method:: Sphinx.add_object_type(directivename, rolename, indextemplate='', parse_node=None, \ + ref_nodeclass=None, objname='', doc_field_types=[]) This method is a very convenient way to add a new :term:`object` type that can be cross-referenced. It will do this: @@ -210,7 +211,7 @@ standard Sphinx roles (see :ref:`xref-syntax`). This method is also available under the deprecated alias - :meth:`add_description_unit`. + ``add_description_unit``. .. method:: Sphinx.add_crossref_type(directivename, rolename, indextemplate='', ref_nodeclass=None, objname='') @@ -246,7 +247,8 @@ Add *filename* to the list of JavaScript files that the default HTML template will include. The filename must be relative to the HTML static path, see - :confval:`the docs for the config value `. + :confval:`the docs for the config value `. A full URI with + scheme, like ``http://example.org/foo.js``, is also supported. .. versionadded:: 0.5 @@ -272,6 +274,8 @@ This allows to auto-document new types of objects. See the source of the autodoc module for examples on how to subclass :class:`Documenter`. + .. XXX add real docs for Documenter and subclassing + .. versionadded:: 0.6 .. method:: Sphinx.add_autodoc_attrgetter(type, getter) diff -Nru sphinx-1.0~hg20100604/doc/ext/autodoc.rst sphinx-1.0.7/doc/ext/autodoc.rst --- sphinx-1.0~hg20100604/doc/ext/autodoc.rst 2010-05-06 16:30:00.000000000 +0000 +++ sphinx-1.0.7/doc/ext/autodoc.rst 2011-01-08 22:49:58.000000000 +0000 @@ -27,20 +27,21 @@ auto-generated-looking pure API documentation. :mod:`autodoc` provides several directives that are versions of the usual -: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 :rst:dir:`module`, :rst:dir:`class` etc. -directive. +:rst:dir:`py:module`, :rst:dir:`py: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 :rst:dir:`py:module`, +:rst:dir:`py:class` etc. directive. .. note:: - 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`. + Just as :rst:dir:`py:class` respects the current :rst:dir:`py:module`, + :rst:dir:`autoclass` will also do so. Likewise, :rst:dir:`automethod` will + respect the current :rst:dir:`py:class`. .. rst:directive:: automodule - autoclass - autoexception + autoclass + autoexception Document a module, class or exception. All three directives will by default only insert the docstring of the object itself:: @@ -83,6 +84,9 @@ will document all non-private member functions and properties (that is, those whose name doesn't start with ``_``). + For modules, ``__all__`` will be respected when looking for members; the + order of the members will also be the order in ``__all__``. + You can also give an explicit list of members; only these will then be documented:: @@ -100,8 +104,8 @@ :undoc-members: * For classes and exceptions, members inherited from base classes will be - left out, unless you give the ``inherited-members`` flag option, in - addition to ``members``:: + left out when documenting all members, unless you give the + ``inherited-members`` flag option, in addition to ``members``:: .. autoclass:: Noodle :members: @@ -127,23 +131,24 @@ .. versionadded:: 0.4 - * 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 :rst:dir:`automodule`, this will be inserted for every class that is - documented in the module). + * 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 :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 :rst:dir:`function` etc. directives: no index - entries are generated for the documented object (and all autodocumented - members). + same effect as for standard :rst:dir:`py:function` etc. directives: no + index entries are generated for the documented object (and all + autodocumented members). .. versionadded:: 0.4 * :rst:dir:`automodule` also recognizes the ``synopsis``, ``platform`` and - ``deprecated`` options that the standard :rst:dir:`module` directive supports. + ``deprecated`` options that the standard :rst:dir:`py:module` directive + supports. .. versionadded:: 0.5 @@ -213,8 +218,8 @@ ``"class"`` Only the class' docstring is inserted. This is the default. You can - still document ``__init__`` as a separate method using :rst:dir:`automethod` - or the ``members`` option to :rst: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. diff -Nru sphinx-1.0~hg20100604/doc/ext/inheritance.rst sphinx-1.0.7/doc/ext/inheritance.rst --- sphinx-1.0~hg20100604/doc/ext/inheritance.rst 2010-05-06 16:30:00.000000000 +0000 +++ sphinx-1.0.7/doc/ext/inheritance.rst 2011-01-04 09:00:04.000000000 +0000 @@ -17,7 +17,7 @@ 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 :rst:dir:`module`). + in the currently described module (see :rst:dir:`py: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 -Nru sphinx-1.0~hg20100604/doc/ext/intersphinx.rst sphinx-1.0.7/doc/ext/intersphinx.rst --- sphinx-1.0~hg20100604/doc/ext/intersphinx.rst 2010-06-03 22:12:22.000000000 +0000 +++ sphinx-1.0.7/doc/ext/intersphinx.rst 2011-01-04 09:00:04.000000000 +0000 @@ -9,7 +9,21 @@ .. versionadded:: 0.5 This extension can generate automatic links to the documentation of objects in -other projects. This works as follows: +other projects. + +Usage is simple: whenever Sphinx encounters a cross-reference that has no +matching target in the current documentation set, it looks for targets in the +documentation sets configured in :confval:`intersphinx_mapping`. A reference +like ``:py:class:`zipfile.ZipFile``` can then link to the Python documentation +for the ZipFile class, without you having to specify where it is located +exactly. + +When using the "new" format (see below), you can even force lookup in a foreign +set by prefixing the link target appropriately. A link like ``:ref:`comparison +manual ``` will then link to the label "comparisons" in the +doc set "python", if it exists. + +Behind the scenes, this works as follows: * 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. @@ -70,7 +84,7 @@ To add links to modules and objects in the Python standard library documentation, use:: - intersphinx_mapping = {'python': ('http://docs.python.org/', None)} + intersphinx_mapping = {'python': ('http://docs.python.org/3.2', 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 @@ -80,12 +94,12 @@ A second example, showing the meaning of a non-``None`` value of the second tuple item:: - intersphinx_mapping = {'python': ('http://docs.python.org/', + intersphinx_mapping = {'python': ('http://docs.python.org/3.2', '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 + ``http://docs.python.org/3.2``. It is up to you to update the inventory file as new objects are added to the Python documentation. .. confval:: intersphinx_cache_limit diff -Nru sphinx-1.0~hg20100604/doc/ext/math.rst sphinx-1.0.7/doc/ext/math.rst --- sphinx-1.0~hg20100604/doc/ext/math.rst 2010-05-06 16:30:00.000000000 +0000 +++ sphinx-1.0.7/doc/ext/math.rst 2011-01-04 09:00:04.000000000 +0000 @@ -17,15 +17,15 @@ .. note:: - :mod:`sphinx.ext.mathbase` is not meant to be added to the - :confval:`extensions` config value, instead, use either - :mod:`sphinx.ext.pngmath` or :mod:`sphinx.ext.jsmath` as described below. + :mod:`.mathbase` is not meant to be added to the :confval:`extensions` config + value, instead, use either :mod:`sphinx.ext.pngmath` or + :mod:`sphinx.ext.jsmath` as described below. The input language for mathematics is LaTeX markup. This is the de-facto standard for plain-text math notation and has the added advantage that no further translation is necessary when building LaTeX output. -:mod:`mathbase` defines these new markup elements: +:mod:`.mathbase` defines these new markup elements: .. rst:role:: math diff -Nru sphinx-1.0~hg20100604/doc/extensions.rst sphinx-1.0.7/doc/extensions.rst --- sphinx-1.0~hg20100604/doc/extensions.rst 2010-06-03 22:12:22.000000000 +0000 +++ sphinx-1.0.7/doc/extensions.rst 2011-01-04 09:00:04.000000000 +0000 @@ -59,14 +59,19 @@ Third-party extensions ---------------------- -There are several extensions that are not (yet) maintained in the Sphinx -distribution. The `Wiki at BitBucket`_ maintains a list of those. - -If you write an extension that you think others will find useful, please write -to the project mailing list (`join here `_) -and we'll find the proper way of including or hosting it for the public. +You can find several extensions contributed by users in the `Sphinx Contrib`_ +repository. It is open for anyone who wants to maintain an extension +publicly; just send a short message asking for write permissions. + +There are also several extensions hosted elsewhere. The `Wiki at BitBucket`_ +maintains a list of those. + +If you write an extension that you think others will find useful or you think +should be included as a part of Sphinx, please write to the project mailing +list (`join here `_). .. _Wiki at BitBucket: http://www.bitbucket.org/birkenfeld/sphinx/wiki/Home +.. _Sphinx Contrib: http://www.bitbucket.org/birkenfeld/sphinx-contrib Where to put your own extensions? diff -Nru sphinx-1.0~hg20100604/doc/faq.rst sphinx-1.0.7/doc/faq.rst --- sphinx-1.0~hg20100604/doc/faq.rst 2010-05-06 16:30:00.000000000 +0000 +++ sphinx-1.0.7/doc/faq.rst 2011-01-08 19:05:31.000000000 +0000 @@ -60,10 +60,12 @@ Sphinx documentation to the PyPI package documentation area at http://packages.python.org/. +MediaWiki + See http://bitbucket.org/kevindunn/sphinx-wiki, a project by Kevin Dunn. + github pages - You can use `Michael Jones' sphinx-to-github tool - `_ to prepare - Sphinx HTML output. + You'll have to opt out of processing your pages with the "Jekyll" preprocessor + as described in http://pages.github.com/#using_jekyll_for_complex_layouts. Google Analytics You can use a custom ``layout.html`` template, like this: @@ -134,6 +136,16 @@ and Bookworm_. For bookworm you can download the source from http://code.google.com/p/threepress/ and run your own local server. +* Large floating divs are not displayed properly. + If they cover more than one page, the div is only shown on the first page. + In that case you can copy the :file:`epub.css` from the + ``sphinx/themes/epub/static/`` directory to your local ``_static/`` + directory and remove the float settings. + +* Files that are inserted outside of the ``toctree`` directive must be manually + included. This sometimes applies to appendixes, e.g. the glossary or + the indices. You can add them with the :confval:`epub_post_files` option. + .. _Epubcheck: http://code.google.com/p/epubcheck/ .. _Calibre: http://calibre-ebook.com/ .. _FBreader: http://www.fbreader.org/ diff -Nru sphinx-1.0~hg20100604/doc/intro.rst sphinx-1.0.7/doc/intro.rst --- sphinx-1.0~hg20100604/doc/intro.rst 2010-06-03 22:12:22.000000000 +0000 +++ sphinx-1.0.7/doc/intro.rst 2011-01-15 14:08:44.000000000 +0000 @@ -45,13 +45,15 @@ Prerequisites ------------- -Sphinx needs at least **Python 2.4** to run. If you like to have source code -highlighting support, you must also install the Pygments_ library, which you can -do via setuptools' easy_install. Sphinx should work with docutils version 0.4 -or some (not broken) SVN trunk snapshot. +Sphinx needs at least **Python 2.4** to run, as well as the docutils_ and +Jinja2_ libraries. Sphinx should work with docutils version 0.5 or some +(not broken) SVN trunk snapshot. If you like to have source code highlighting +support, you must also install the Pygments_ library. .. _reStructuredText: http://docutils.sf.net/rst.html -.. _Pygments: http://pygments.org +.. _docutils: http://docutils.sf.net/ +.. _Jinja2: http://jinja.pocoo.org/2/ +.. _Pygments: http://pygments.org/ Usage diff -Nru sphinx-1.0~hg20100604/doc/Makefile sphinx-1.0.7/doc/Makefile --- sphinx-1.0~hg20100604/doc/Makefile 2010-06-03 22:12:22.000000000 +0000 +++ sphinx-1.0.7/doc/Makefile 2011-01-04 09:00:04.000000000 +0000 @@ -16,21 +16,21 @@ help: @echo "Please use \`make ' where is one of" - @echo " html to make standalone HTML files" - @echo " dirhtml to make HTML files called index.html in directories" + @echo " html to make standalone HTML files" + @echo " dirhtml to make HTML files called index.html in directories" @echo " singlehtml to make one big HTML file" - @echo " text to make text files" - @echo " man to make manual pages" - @echo " pickle to make pickle files" - @echo " json to make json files" - @echo " htmlhelp to make HTML files and a HTML help project" - @echo " qthelp to make Qt help files and project" - @echo " devhelp to make Devhelp files and project" - @echo " epub to make an epub file" - @echo " latex to make LaTeX files, you can set PAPER=a4 or PAPER=letter" - @echo " latexpdf to make LaTeX files and run pdflatex" - @echo " changes to make an overview over all changed/added/deprecated items" - @echo " linkcheck to check all external links for integrity" + @echo " text to make text files" + @echo " man to make manual pages" + @echo " pickle to make pickle files" + @echo " json to make json files" + @echo " htmlhelp to make HTML files and a HTML help project" + @echo " qthelp to make Qt help files and project" + @echo " devhelp to make Devhelp files and project" + @echo " epub to make an epub file" + @echo " latex to make LaTeX files, you can set PAPER=a4 or PAPER=letter" + @echo " latexpdf to make LaTeX files and run pdflatex" + @echo " changes to make an overview over all changed/added/deprecated items" + @echo " linkcheck to check all external links for integrity" clean: -rm -rf _build/* diff -Nru sphinx-1.0~hg20100604/doc/markup/index.rst sphinx-1.0.7/doc/markup/index.rst --- sphinx-1.0~hg20100604/doc/markup/index.rst 2010-05-06 16:30:00.000000000 +0000 +++ sphinx-1.0.7/doc/markup/index.rst 2011-01-04 09:00:04.000000000 +0000 @@ -3,8 +3,8 @@ Sphinx Markup Constructs ======================== -Sphinx adds a lot of new directives and interpreted text roles to standard reST -markup. This section contains the reference material for these facilities. +Sphinx adds a lot of new directives and interpreted text roles to `standard reST +markup`_. This section contains the reference material for these facilities. .. toctree:: @@ -15,3 +15,5 @@ misc More markup is added by :ref:`domains`. + +.. _standard reST markup: http://docutils.sourceforge.net/docs/ref/rst/restructuredtext.html diff -Nru sphinx-1.0~hg20100604/doc/markup/inline.rst sphinx-1.0.7/doc/markup/inline.rst --- sphinx-1.0~hg20100604/doc/markup/inline.rst 2010-06-03 22:12:22.000000000 +0000 +++ sphinx-1.0.7/doc/markup/inline.rst 2011-01-06 19:44:36.000000000 +0000 @@ -44,6 +44,18 @@ tool-tip on mouse-hover) will always be the full target name. +Cross-referencing objects +------------------------- + +These roles are described with their respective domains: + +* :ref:`Python ` +* :ref:`C ` +* :ref:`C++ ` +* :ref:`JavaScript ` +* :ref:`ReST ` + + .. _ref-role: Cross-referencing arbitrary locations @@ -141,8 +153,50 @@ suitable link generated to it. +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. + + Other semantic markup ---------------------- +~~~~~~~~~~~~~~~~~~~~~ The following roles don't do anything special except formatting the text in a different style: @@ -260,7 +314,7 @@ .. 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 :rst:dir:`file`. For + curly braces to indicate a "variable" part, as in :rst:role:`file`. For example, in ``:samp:`print 1+{variable}```, the part ``variable`` would be emphasized. @@ -274,65 +328,25 @@ 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. + this text is a hyperlink to an online copy of the specified PEP. You can + link to a specific section by saying ``:pep:`number#anchor```. .. 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, - this text is a hyperlink to an online copy of the specified RFC. + this text is a hyperlink to an online copy of the specified RFC. You can + link to a specific section by saying ``:rfc:`number#anchor```. 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 -------------- +~~~~~~~~~~~~~ The documentation system provides three substitutions that are defined by default. They are set in the build configuration file. diff -Nru sphinx-1.0~hg20100604/doc/markup/misc.rst sphinx-1.0.7/doc/markup/misc.rst --- sphinx-1.0~hg20100604/doc/markup/misc.rst 2010-05-06 16:30:00.000000000 +0000 +++ sphinx-1.0.7/doc/markup/misc.rst 2011-01-08 18:21:29.000000000 +0000 @@ -13,10 +13,12 @@ :fieldname: Field content -A field list at the very top of a file is parsed by docutils as the "docinfo", +A field list near the 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. +metadata. *In Sphinx*, a field list preceding any other markup is moved from +the docinfo to the Sphinx environment as document metadata and is not displayed +in the output; a field list appearing after the document title will be part of +the docinfo as normal and will be displayed in the output. At the moment, these metadata fields are recognized: @@ -76,7 +78,7 @@ Undefined tags are false, defined tags (via the ``-t`` command-line option or within :file:`conf.py`) are true. Boolean expressions, also using - parentheses (like ``html and (latex or draft)`` are supported. + parentheses (like ``html and (latex or draft)``) are supported. The format of the current builder (``html``, ``latex`` or ``text``) is always set as a tag. @@ -124,9 +126,16 @@ .. warning:: - Tables that contain literal blocks cannot be set with ``tabulary``. They are - 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 :rst:dir:`tabularcolumns` directive to get finer control - over such tables. + Tables that contain list-like elements such as object descriptions, + blockquotes or any kind of lists cannot be set out of the box with + ``tabulary``. They are therefore set with the standard LaTeX ``tabular`` + environment if you don't give a ``tabularcolumns`` directive. If you do, the + table will be set with ``tabulary``, but you must use the ``p{width}`` + construct for the columns that contain these elements. + + Literal blocks do not work with ``tabulary`` at all, so tables containing a + literal block are always set with ``tabular``. 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 :rst:dir:`tabularcolumns` directive to get finer control over such + tables. diff -Nru sphinx-1.0~hg20100604/doc/markup/para.rst sphinx-1.0.7/doc/markup/para.rst --- sphinx-1.0~hg20100604/doc/markup/para.rst 2010-06-03 22:12:22.000000000 +0000 +++ sphinx-1.0.7/doc/markup/para.rst 2011-01-04 09:00:04.000000000 +0000 @@ -42,15 +42,25 @@ Example:: .. versionadded:: 2.5 - The `spam` parameter. + The *spam* parameter. 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. .. rst:directive:: .. versionchanged:: version - Similar to :rst:dir:`versionadded`, but describes when and what changed in the named - feature in some way (new parameters, changed side effects, etc.). + Similar to :rst:dir:`versionadded`, but describes when and what changed in + the named feature in some way (new parameters, changed side effects, etc.). + +.. rst:directive:: .. deprecated:: vesion + + Similar to :rst:dir:`versionchanged`, but describes when the feature was + deprecated. An explanation can also be given, for example to inform the + reader what should be used instead. Example:: + + .. deprecated:: 3.1 + Use :func:`spam` instead. + -------------- diff -Nru sphinx-1.0~hg20100604/doc/markup/toctree.rst sphinx-1.0.7/doc/markup/toctree.rst --- sphinx-1.0~hg20100604/doc/markup/toctree.rst 2010-06-03 22:12:22.000000000 +0000 +++ sphinx-1.0.7/doc/markup/toctree.rst 2011-01-04 09:00:04.000000000 +0000 @@ -151,7 +151,7 @@ :ref:`object descriptions `, and from :rst:dir:`index` directives. - The module index contains one entry per :rst:dir:`module` directive. + The Python module index contains one entry per :rst:dir:`py: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 -Nru sphinx-1.0~hg20100604/doc/rest.rst sphinx-1.0.7/doc/rest.rst --- sphinx-1.0~hg20100604/doc/rest.rst 2010-06-03 22:12:22.000000000 +0000 +++ sphinx-1.0.7/doc/rest.rst 2011-01-04 09:00:04.000000000 +0000 @@ -325,14 +325,15 @@ .. function:: foo(x) foo(y, z) - :bar: no + :module: some.module.name Return a line of text input from the user. ``function`` is the directive name. It is given two arguments here, the -remainder of the first line and the second line, as well as one option ``bar`` -(as you can see, options are given in the lines immediately following the -arguments and indicated by the colons). +remainder of the first line and the second line, as well as one option +``module`` (as you can see, options are given in the lines immediately following +the arguments and indicated by the colons). Options must be indented to the +same level as the directive content. The directive content follows after a blank line and is indented relative to the directive start. Binary files /tmp/Rt1D5gzI2R/sphinx-1.0~hg20100604/doc/_static/pocoo.png and /tmp/0_5OtyEyzZ/sphinx-1.0.7/doc/_static/pocoo.png differ diff -Nru sphinx-1.0~hg20100604/doc/_templates/index.html sphinx-1.0.7/doc/_templates/index.html --- sphinx-1.0~hg20100604/doc/_templates/index.html 2010-06-03 22:12:22.000000000 +0000 +++ sphinx-1.0.7/doc/_templates/index.html 2011-01-15 13:46:21.000000000 +0000 @@ -12,7 +12,7 @@

Sphinx is a tool that makes it easy to create intelligent and beautiful documentation, written by Georg Brandl and licensed under the BSD license.

-

It was originally created for the +

It was originally created for the new Python documentation, 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 diff -Nru sphinx-1.0~hg20100604/doc/_templates/indexsidebar.html sphinx-1.0.7/doc/_templates/indexsidebar.html --- sphinx-1.0~hg20100604/doc/_templates/indexsidebar.html 2010-05-06 16:30:00.000000000 +0000 +++ sphinx-1.0.7/doc/_templates/indexsidebar.html 2011-01-04 09:00:04.000000000 +0000 @@ -1,3 +1,6 @@ +

+

Download

{% if version.endswith('(hg)') %}

This documentation is for version {{ version }}, which is @@ -23,6 +26,6 @@ -

or come to the #python-docs channel on FreeNode.

+

or come to the #pocoo channel on FreeNode.

You can also open an issue at the tracker.

diff -Nru sphinx-1.0~hg20100604/doc/templating.rst sphinx-1.0.7/doc/templating.rst --- sphinx-1.0~hg20100604/doc/templating.rst 2010-06-03 22:12:22.000000000 +0000 +++ sphinx-1.0.7/doc/templating.rst 2011-01-04 09:00:04.000000000 +0000 @@ -21,10 +21,10 @@ configuration value accordingly. * You can :ref:`write a custom builder ` that derives from - :class:`~sphinx.builders.StandaloneHTMLBuilder` and calls your template engine - of choice. + :class:`~sphinx.builders.html.StandaloneHTMLBuilder` and calls your template + engine of choice. -* You can use the :class:`~sphinx.builders.PickleHTMLBuilder` that produces +* You can use the :class:`~sphinx.builders.html.PickleHTMLBuilder` that produces pickle files with the page contents, and postprocess them using a custom tool, or use them in your Web application. @@ -261,9 +261,9 @@ .. data:: file_suffix - The value of the builder's :attr:`out_suffix` attribute, i.e. the file name - extension that the output files will get. For a standard HTML builder, this - is usually ``.html``. + The value of the builder's :attr:`~.SerializingHTMLBuilder.out_suffix` + attribute, i.e. the file name extension that the output files will get. For + a standard HTML builder, this is usually ``.html``. .. data:: has_source @@ -362,7 +362,7 @@ .. data:: meta - Document metadata, see :ref:`metadata`. + Document metadata (a dictionary), see :ref:`metadata`. .. data:: sourcename diff -Nru sphinx-1.0~hg20100604/doc/theming.rst sphinx-1.0.7/doc/theming.rst --- sphinx-1.0~hg20100604/doc/theming.rst 2010-06-03 22:12:22.000000000 +0000 +++ sphinx-1.0.7/doc/theming.rst 2011-01-04 09:00:04.000000000 +0000 @@ -119,6 +119,8 @@ - **footerbgcolor** (CSS color): Background color for the footer line. - **footertextcolor** (CSS color): Text color for the footer line. - **sidebarbgcolor** (CSS color): Background color for the sidebar. + - **sidebarbtncolor** (CSS color): Background color for the sidebar collapse + button (used when *collapsiblesidebar* is true). - **sidebartextcolor** (CSS color): Text color for the sidebar. - **sidebarlinkcolor** (CSS color): Link color for the sidebar. - **relbarbgcolor** (CSS color): Background color for the relation bar. diff -Nru sphinx-1.0~hg20100604/EXAMPLES sphinx-1.0.7/EXAMPLES --- sphinx-1.0~hg20100604/EXAMPLES 2010-06-03 22:12:22.000000000 +0000 +++ sphinx-1.0.7/EXAMPLES 2011-01-15 09:23:16.000000000 +0000 @@ -12,7 +12,7 @@ Documentation using the default theme ------------------------------------- -* APSW: http://apsw.googlecode.com/svn/publish/index.html +* APSW: http://apidoc.apsw.googlecode.com/hg/index.html * ASE: https://wiki.fysik.dtu.dk/ase/ * boostmpi: http://documen.tician.de/boostmpi/ * Calibre: http://calibre.kovidgoyal.net/user_manual/ @@ -20,13 +20,17 @@ * Cython: http://docs.cython.org/ * C\\C++ Python language binding project: http://language-binding.net/index.html * Director: http://packages.python.org/director/ +* Dirigible: http://www.projectdirigible.com/documentation/ * F2py: http://www.f2py.org/html/ * GeoDjango: http://geodjango.org/docs/ * gevent: http://www.gevent.org/ * Google Wave API: http://wave-robot-python-client.googlecode.com/svn/trunk/pydocs/index.html * GSL Shell: http://www.nongnu.org/gsl-shell/ +* Hands-on Python Tutorial: http://anh.cs.luc.edu/python/hands-on/3.1/handsonHtml/ * Hedge: http://documen.tician.de/hedge/ * Kaa: http://doc.freevo.org/api/kaa/ +* Leo: http://webpages.charter.net/edreamleo/front.html +* Lino: http://lino.saffre-rumma.ee/ * MeshPy: http://documen.tician.de/meshpy/ * mpmath: http://mpmath.googlecode.com/svn/trunk/doc/build/index.html * OpenEXR: http://excamera.com/articles/26/doc/index.html @@ -38,6 +42,7 @@ * PyCuda: http://documen.tician.de/pycuda/ * Pyevolve: http://pyevolve.sourceforge.net/ * Pylo: http://documen.tician.de/pylo/ +* PyMQI: http://packages.python.org/pymqi/ * PyPubSub: http://pubsub.sourceforge.net/ * pyrticle: http://documen.tician.de/pyrticle/ * Python: http://docs.python.org/ @@ -75,6 +80,7 @@ * simuPOP: http://simupop.sourceforge.net/manual_release/build/userGuide.html * Sprox: http://sprox.org/ * TurboGears: http://turbogears.org/2.0/docs/ +* Zentyal: http://doc.zentyal.org/ * Zope: http://docs.zope.org/zope2/index.html * zc.async: http://packages.python.org/zc.async/1.5.0/ @@ -85,9 +91,11 @@ * Fityk: http://www.unipress.waw.pl/fityk/ * MapServer: http://mapserver.org/ * Matplotlib: http://matplotlib.sourceforge.net/ +* Music21: http://mit.edu/music21/doc/html/contents.html * MyHDL: http://www.myhdl.org/doc/0.6/ * NetworkX: http://networkx.lanl.gov/ * Pweave: http://mpastell.com/pweave/ +* Pyre: http://docs.danse.us/pyre/sphinx/ * Pysparse: http://pysparse.sourceforge.net/ * PyTango: http://www.tango-controls.org/static/PyTango/latest/doc/html/index.html @@ -95,6 +103,7 @@ * Satchmo: http://www.satchmoproject.com/docs/svn/ * Sphinx: http://sphinx.pocoo.org/ * Sqlkit: http://sqlkit.argolinux.org/ +* Tau: http://www.tango-controls.org/static/tau/latest/doc/html/index.html * Total Open Station: http://tops.berlios.de/ * WebFaction: http://docs.webfaction.com/ @@ -108,6 +117,9 @@ * pip: http://pip.openplans.org/ (nature) * Programmieren mit PyGTK und Glade (German): http://www.florian-diesch.de/doc/python-und-glade/online/ (agogo) +* pypol: http://pypol.altervista.org/ (nature) +* Spring Python: http://springpython.webfactional.com/current/sphinx/index.html + (nature) * sqlparse: http://python-sqlparse.googlecode.com/svn/docs/api/index.html (agogo) * libLAS: http://liblas.org/ (nature) @@ -130,13 +142,16 @@ * Open ERP: http://doc.openerp.com/ * OpenLayers: http://docs.openlayers.org/ * PyEphem: http://rhodesmill.org/pyephem/ +* German Plone 4.0 user manual: http://www.hasecke.com/plone-benutzerhandbuch/4.0/ * Pylons: http://pylonshq.com/docs/en/0.9.7/ * PyMOTW: http://www.doughellmann.com/PyMOTW/ +* qooxdoo: http://manual.qooxdoo.org/current * 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/ +* tipfy: http://www.tipfy.org/docs/ * Werkzeug: http://werkzeug.pocoo.org/documentation/dev/ * WFront: http://discorporate.us/projects/WFront/ @@ -150,3 +165,18 @@ * lunarsite: http://lunaryorn.de/ * The Wine Cellar Book: http://www.thewinecellarbook.com/doc/en/ * VOR: http://www.vor-cycling.be/ + + +Books produced using Sphinx +--------------------------- + +* "The ``repoze.bfg`` Web Application Framework": + http://www.amazon.com/repoze-bfg-Web-Application-Framework-Version/dp/0615345379 +* A Theoretical Physics Reference book: http://theoretical-physics.net/ +* "Simple and Steady Way of Learning for Software Engineering" (in Japanese): + http://www.amazon.co.jp/dp/477414259X/ +* "Expert Python Programming" (Japanese translation): + http://www.amazon.co.jp/dp/4048686291/ +* "Pomodoro Technique Illustrated" (Japanese translation): + http://www.amazon.co.jp/dp/4048689525/ + diff -Nru sphinx-1.0~hg20100604/LICENSE sphinx-1.0.7/LICENSE --- sphinx-1.0~hg20100604/LICENSE 2010-05-06 16:30:00.000000000 +0000 +++ sphinx-1.0.7/LICENSE 2011-01-04 09:00:04.000000000 +0000 @@ -1,7 +1,7 @@ License for Sphinx ================== -Copyright (c) 2007-2010 by the Sphinx team (see AUTHORS file). +Copyright (c) 2007-2011 by the Sphinx team (see AUTHORS file). All rights reserved. Redistribution and use in source and binary forms, with or without diff -Nru sphinx-1.0~hg20100604/Makefile sphinx-1.0.7/Makefile --- sphinx-1.0~hg20100604/Makefile 2010-05-06 16:30:00.000000000 +0000 +++ sphinx-1.0.7/Makefile 2011-01-04 09:00:04.000000000 +0000 @@ -9,7 +9,8 @@ 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 env . + -i doc/_build -i ez_setup.py -i tests/path.py -i tests/coverage.py \ + -i env -i .tox . clean: clean-pyc clean-patchfiles diff -Nru sphinx-1.0~hg20100604/PKG-INFO sphinx-1.0.7/PKG-INFO --- sphinx-1.0~hg20100604/PKG-INFO 2010-05-24 23:19:26.000000000 +0000 +++ sphinx-1.0.7/PKG-INFO 2011-01-15 15:26:00.000000000 +0000 @@ -1,6 +1,6 @@ Metadata-Version: 1.0 Name: Sphinx -Version: 1.0b1 +Version: 1.0.7 Summary: Python documentation generator Home-page: http://sphinx.pocoo.org/ Author: Georg Brandl @@ -47,6 +47,7 @@ Classifier: License :: OSI Approved :: BSD License Classifier: Operating System :: OS Independent Classifier: Programming Language :: Python +Classifier: Programming Language :: Python :: 2 Classifier: Topic :: Documentation Classifier: Topic :: Text Processing Classifier: Topic :: Utilities diff -Nru sphinx-1.0~hg20100604/setup.cfg sphinx-1.0.7/setup.cfg --- sphinx-1.0~hg20100604/setup.cfg 2010-05-06 16:30:00.000000000 +0000 +++ sphinx-1.0.7/setup.cfg 2011-01-15 15:26:00.000000000 +0000 @@ -1,6 +1,7 @@ [egg_info] -tag_build = dev -tag_date = true +tag_build = +tag_date = 0 +tag_svn_revision = 0 [aliases] release = egg_info -RDb '' @@ -18,3 +19,4 @@ [compile_catalog] domain = sphinx directory = sphinx/locale/ + diff -Nru sphinx-1.0~hg20100604/setup.py sphinx-1.0.7/setup.py --- sphinx-1.0~hg20100604/setup.py 2010-06-03 22:12:22.000000000 +0000 +++ sphinx-1.0.7/setup.py 2011-01-04 09:00:04.000000000 +0000 @@ -178,6 +178,7 @@ 'License :: OSI Approved :: BSD License', 'Operating System :: OS Independent', 'Programming Language :: Python', + 'Programming Language :: Python :: 2', 'Topic :: Documentation', 'Topic :: Text Processing', 'Topic :: Utilities', diff -Nru sphinx-1.0~hg20100604/sphinx/addnodes.py sphinx-1.0.7/sphinx/addnodes.py --- sphinx-1.0~hg20100604/sphinx/addnodes.py 2010-05-06 16:30:00.000000000 +0000 +++ sphinx-1.0.7/sphinx/addnodes.py 2011-01-04 09:00:04.000000000 +0000 @@ -5,7 +5,7 @@ Additional docutils nodes. - :copyright: Copyright 2007-2010 by the Sphinx team, see AUTHORS. + :copyright: Copyright 2007-2011 by the Sphinx team, see AUTHORS. :license: BSD, see LICENSE for details. """ diff -Nru sphinx-1.0~hg20100604/sphinx/application.py sphinx-1.0.7/sphinx/application.py --- sphinx-1.0~hg20100604/sphinx/application.py 2010-05-06 16:30:00.000000000 +0000 +++ sphinx-1.0.7/sphinx/application.py 2011-01-07 15:35:09.000000000 +0000 @@ -7,7 +7,7 @@ Gracefully adapted from the TextPress system by Armin. - :copyright: Copyright 2007-2010 by the Sphinx team, see AUTHORS. + :copyright: Copyright 2007-2011 by the Sphinx team, see AUTHORS. :license: BSD, see LICENSE for details. """ @@ -18,7 +18,7 @@ from cStringIO import StringIO from docutils import nodes -from docutils.parsers.rst import Directive, convert_directive_function, \ +from docutils.parsers.rst import convert_directive_function, \ directives, roles import sphinx @@ -109,7 +109,9 @@ if self.confdir is None: self.confdir = self.srcdir - # load all extension modules + # backwards compatibility: activate old C markup + self.setup_extension('sphinx.ext.oldcmarkup') + # load all user-given extension modules for extension in self.config.extensions: self.setup_extension(extension) # the config file itself can be an extension @@ -211,6 +213,12 @@ self.builder.cleanup() def warn(self, message, location=None, prefix='WARNING: '): + if isinstance(location, tuple): + docname, lineno = location + if docname: + location = '%s:%s' % (self.env.doc2path(docname), lineno or '') + else: + location = None warntext = location and '%s: %s%s\n' % (location, prefix, message) or \ '%s%s\n' % (prefix, message) if self.warningiserror: @@ -368,16 +376,16 @@ setattr(translator, 'depart_'+node.__name__, depart) 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') - return obj - else: + if isinstance(obj, (types.FunctionType, types.MethodType)): obj.content = content obj.arguments = arguments or (0, 0, False) obj.options = options return convert_directive_function(obj) + else: + if content or arguments or options: + raise ExtensionError('when adding directive classes, no ' + 'additional arguments may be given') + return obj def add_directive(self, name, obj, content=None, arguments=None, **options): directives.register_directive( @@ -424,13 +432,15 @@ setattr(self.domains[domain], 'get_%s_index' % name, func) def add_object_type(self, directivename, rolename, indextemplate='', - parse_node=None, ref_nodeclass=None, objname=''): + parse_node=None, ref_nodeclass=None, objname='', + doc_field_types=[]): 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)}) + 'parse_node': staticmethod(parse_node), + 'doc_field_types': doc_field_types}) StandardDomain.directives[directivename] = new_directive # XXX support more options? StandardDomain.roles[rolename] = XRefRole(innernodeclass=ref_nodeclass) @@ -454,8 +464,11 @@ def add_javascript(self, filename): from sphinx.builders.html import StandaloneHTMLBuilder - StandaloneHTMLBuilder.script_files.append( - posixpath.join('_static', filename)) + if '://' in filename: + StandaloneHTMLBuilder.script_files.append(filename) + else: + StandaloneHTMLBuilder.script_files.append( + posixpath.join('_static', filename)) def add_stylesheet(self, filename): from sphinx.builders.html import StandaloneHTMLBuilder diff -Nru sphinx-1.0~hg20100604/sphinx/builders/changes.py sphinx-1.0.7/sphinx/builders/changes.py --- sphinx-1.0~hg20100604/sphinx/builders/changes.py 2010-05-06 16:30:00.000000000 +0000 +++ sphinx-1.0.7/sphinx/builders/changes.py 2011-01-04 09:00:04.000000000 +0000 @@ -5,7 +5,7 @@ Changelog builder. - :copyright: Copyright 2007-2010 by the Sphinx team, see AUTHORS. + :copyright: Copyright 2007-2011 by the Sphinx team, see AUTHORS. :license: BSD, see LICENSE for details. """ diff -Nru sphinx-1.0~hg20100604/sphinx/builders/devhelp.py sphinx-1.0.7/sphinx/builders/devhelp.py --- sphinx-1.0~hg20100604/sphinx/builders/devhelp.py 2010-05-06 16:30:00.000000000 +0000 +++ sphinx-1.0.7/sphinx/builders/devhelp.py 2011-01-04 09:00:04.000000000 +0000 @@ -7,7 +7,7 @@ .. _Devhelp: http://live.gnome.org/devhelp - :copyright: Copyright 2007-2010 by the Sphinx team, see AUTHORS. + :copyright: Copyright 2007-2011 by the Sphinx team, see AUTHORS. :license: BSD, see LICENSE for details. """ diff -Nru sphinx-1.0~hg20100604/sphinx/builders/epub.py sphinx-1.0.7/sphinx/builders/epub.py --- sphinx-1.0~hg20100604/sphinx/builders/epub.py 2010-05-06 16:30:00.000000000 +0000 +++ sphinx-1.0.7/sphinx/builders/epub.py 2011-01-15 13:35:16.000000000 +0000 @@ -6,20 +6,23 @@ Build epub files. Originally derived from qthelp.py. - :copyright: Copyright 2007-2010 by the Sphinx team, see AUTHORS. + :copyright: Copyright 2007-2011 by the Sphinx team, see AUTHORS. :license: BSD, see LICENSE for details. """ import os +import re +import time import codecs -from os import path import zipfile +from os import path from docutils import nodes -from docutils.transforms import Transform +from sphinx import addnodes from sphinx.builders.html import StandaloneHTMLBuilder from sphinx.util.osutil import EEXIST +from sphinx.util.smartypants import sphinx_smarty_pants as ssp # (Fragment) templates from which the metainfo files content.opf, toc.ncx, @@ -82,6 +85,7 @@ %(publisher)s %(copyright)s %(id)s + %(date)s @@ -119,29 +123,10 @@ '.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) +# Regular expression to match colons only in local fragment identifiers. +# If the URI contains a colon before the #, +# it is an external link that should not change. +_refuri_re = re.compile("([^#:]*#)(.*)") # The epub publisher @@ -170,7 +155,6 @@ # 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, {} @@ -187,24 +171,27 @@ name = name.replace('<', '<') name = name.replace('>', '>') name = name.replace('"', '"') - name = name.replace('\'', ''') + name = name.replace('\'', ''') 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): + if isinstance(doctree, nodes.reference) and doctree.has_key('refuri'): + refuri = doctree['refuri'] + if refuri.startswith('http://') or refuri.startswith('https://') \ + or refuri.startswith('irc:') or refuri.startswith('mailto:'): + return result 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()) - }) + for level in range(8, 0, -1): # or range(1, 8)? + if (_toctree_template % level) in classes: + result.append({ + 'level': level, + 'refuri': self.esc(refuri), + 'text': ssp(self.esc(doctree.astext())) + }) + break else: for elem in doctree.children: result = self.get_refnodes(elem, result) @@ -217,24 +204,105 @@ doctree = self.env.get_and_resolve_doctree(self.config.master_doc, self, prune_toctrees=False) self.refnodes = self.get_refnodes(doctree, []) + master_dir = os.path.dirname(self.config.master_doc) + if master_dir: + master_dir += '/' # XXX or os.sep? + for item in self.refnodes: + item['refuri'] = master_dir + item['refuri'] 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()) + 'text': ssp(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) + 'refuri': self.esc(file), + 'text': ssp(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) + 'refuri': self.esc(file), + 'text': ssp(self.esc(text)) }) + def fix_fragment(self, prefix, fragment): + """Return a href/id attribute with colons replaced by hyphens.""" + return prefix + fragment.replace(':', '-') + + def fix_ids(self, tree): + """Replace colons with hyphens in href and id attributes. + Some readers crash because they interpret the part as a + transport protocol specification. + """ + for node in tree.traverse(nodes.reference): + if 'refuri' in node: + m = _refuri_re.match(node['refuri']) + if m: + node['refuri'] = self.fix_fragment(m.group(1), m.group(2)) + if 'refid' in node: + node['refid'] = self.fix_fragment('', node['refid']) + for node in tree.traverse(addnodes.desc_signature): + ids = node.attributes['ids'] + newids = [] + for id in ids: + newids.append(self.fix_fragment('', id)) + node.attributes['ids'] = newids + + def add_visible_links(self, tree): + """Append visible link targets after external links. + """ + for node in tree.traverse(nodes.reference): + uri = node.get('refuri', '') + if (uri.startswith('http:') or uri.startswith('https:') or + uri.startswith('ftp:')) and uri not in node.astext(): + uri = _link_target_template % {'uri': uri} + if uri: + idx = node.parent.index(node) + 1 + link = nodes.inline(uri, uri) + link['classes'].append(_css_link_target_class) + node.parent.insert(idx, link) + + def write_doc(self, docname, doctree): + """Write one document file. + This method is overwritten in order to fix fragment identifiers + and to add visible external links. + """ + self.fix_ids(doctree) + self.add_visible_links(doctree) + return StandaloneHTMLBuilder.write_doc(self, docname, doctree) + + def fix_genindex(self, tree): + """Fix href attributes for genindex pages. + """ + # XXX: modifies tree inline + # Logic modeled from themes/basic/genindex.html + for key, columns in tree: + for entryname, (links, subitems) in columns: + for (i, link) in enumerate(links): + m = _refuri_re.match(link) + if m: + links[i] = self.fix_fragment(m.group(1), m.group(2)) + for subentryname, subentrylinks in subitems: + for (i, link) in enumerate(subentrylinks): + m = _refuri_re.match(link) + if m: + subentrylinks[i] = \ + self.fix_fragment(m.group(1), m.group(2)) + + def handle_page(self, pagename, addctx, templatename='page.html', + outfilename=None, event_arg=None): + """Create a rendered page. + This method is overwritten for genindex pages in order to fix + href link attributes. + """ + if pagename.startswith('genindex'): + self.fix_genindex(addctx['genindexentries']) + StandaloneHTMLBuilder.handle_page(self, pagename, addctx, templatename, + outfilename, event_arg) + # Finish by building the epub file def handle_finish(self): @@ -283,6 +351,7 @@ 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['date'] = self.esc(time.strftime('%Y-%m-%d')) metadata['files'] = files metadata['spine'] = spine return metadata @@ -330,6 +399,14 @@ spine.append(_spine_template % { 'idref': self.esc(self.make_id(item['refuri'])) }) + for info in self.domain_indices: + spine.append(_spine_template % { + 'idref': self.esc(self.make_id(info[0] + self.out_suffix)) + }) + if self.config.html_use_index: + spine.append(_spine_template % { + 'idref': self.esc(self.make_id('genindex' + self.out_suffix)) + }) spine = '\n'.join(spine) # write the project file @@ -369,6 +446,8 @@ level = 1 lastnode = None for node in nodes: + if not node['text']: + continue file = node['refuri'].split('#')[0] if file in self.ignored_files: continue @@ -380,7 +459,7 @@ navstack.append(navlist) navlist = [] level += 1 - if lastnode: + if lastnode and self.config.epub_tocdup: # Insert starting point in subtoc with same playOrder navlist.append(self.new_navpoint(lastnode, level, False)) navlist.append(self.new_navpoint(node, level)) @@ -437,5 +516,7 @@ epub.write(path.join(outdir, 'mimetype'), 'mimetype', \ zipfile.ZIP_STORED) for file in projectfiles: + if isinstance(file, unicode): + file = file.encode('utf-8') epub.write(path.join(outdir, file), file, zipfile.ZIP_DEFLATED) epub.close() diff -Nru sphinx-1.0~hg20100604/sphinx/builders/htmlhelp.py sphinx-1.0.7/sphinx/builders/htmlhelp.py --- sphinx-1.0~hg20100604/sphinx/builders/htmlhelp.py 2010-06-03 22:12:22.000000000 +0000 +++ sphinx-1.0.7/sphinx/builders/htmlhelp.py 2011-01-04 09:00:04.000000000 +0000 @@ -6,7 +6,7 @@ Build HTML help support files. Parts adapted from Python's Doc/tools/prechm.py. - :copyright: Copyright 2007-2010 by the Sphinx team, see AUTHORS. + :copyright: Copyright 2007-2011 by the Sphinx team, see AUTHORS. :license: BSD, see LICENSE for details. """ @@ -200,7 +200,7 @@ outdir += os.sep olen = len(outdir) for root, dirs, files in os.walk(outdir): - staticdir = (root == path.join(outdir, '_static')) + staticdir = root.startswith(path.join(outdir, '_static')) for fn in files: if (staticdir and not fn.endswith('.js')) or \ fn.endswith('.html'): @@ -258,7 +258,7 @@ def write_index(title, refs, subitems): def write_param(name, value): item = ' \n' % (name, value) - f.write(item.encode('ascii', 'xmlcharrefreplace')) + f.write(item.encode(self.encoding, 'xmlcharrefreplace')) title = cgi.escape(title) f.write('
  • \n') write_param('Keyword', title) diff -Nru sphinx-1.0~hg20100604/sphinx/builders/html.py sphinx-1.0.7/sphinx/builders/html.py --- sphinx-1.0~hg20100604/sphinx/builders/html.py 2010-06-03 22:12:22.000000000 +0000 +++ sphinx-1.0.7/sphinx/builders/html.py 2011-01-04 09:00:04.000000000 +0000 @@ -5,7 +5,7 @@ Several HTML builders. - :copyright: Copyright 2007-2010 by the Sphinx team, see AUTHORS. + :copyright: Copyright 2007-2011 by the Sphinx team, see AUTHORS. :license: BSD, see LICENSE for details. """ @@ -30,7 +30,7 @@ from docutils.readers.doctree import Reader as DoctreeReader from sphinx import package_dir, __version__ -from sphinx.util import copy_static_entry +from sphinx.util import jsonimpl, 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 @@ -47,14 +47,6 @@ from sphinx.writers.html import HTMLWriter, HTMLTranslator, \ SmartyPantsHTMLTranslator -try: - import json -except ImportError: - try: - import simplejson as json - except ImportError: - json = None - #: the filename for the inventory of objects INVENTORY_FILENAME = 'objects.inv' #: the filename for the "last build" file (for serializing builders) @@ -95,11 +87,13 @@ self.tags_hash = '' # section numbers for headings in the currently visited document self.secnumbers = {} + # currently written docname + self.current_docname = None self.init_templates() self.init_highlighter() self.init_translator_class() - if self.config.html_file_suffix: + if self.config.html_file_suffix is not None: self.out_suffix = self.config.html_file_suffix if self.config.html_link_suffix is not None: @@ -108,15 +102,21 @@ self.link_suffix = self.out_suffix if self.config.language is not None: - jsfile_list = [path.join(package_dir, 'locale', - self.config.language, 'LC_MESSAGES', 'sphinx.js'), - path.join(sys.prefix, 'share/sphinx/locale', - self.config.language, 'sphinx.js')] - - for jsfile in jsfile_list: - if path.isfile(jsfile): - self.script_files.append('_static/translations.js') - break + if self._get_translations_js(): + self.script_files.append('_static/translations.js') + + def _get_translations_js(self): + candidates = [path.join(package_dir, 'locale', self.config.language, + 'LC_MESSAGES', 'sphinx.js'), + path.join(sys.prefix, 'share/sphinx/locale', + self.config.language, 'sphinx.js')] + \ + [path.join(dir, self.config.language, + 'LC_MESSAGES', 'sphinx.js') + for dir in self.config.locale_dirs] + for jsfile in candidates: + if path.isfile(jsfile): + return jsfile + return None def get_theme_config(self): return self.config.html_theme, self.config.html_theme_options @@ -404,6 +404,7 @@ self.imgpath = relative_uri(self.get_target_uri(docname), '_images') self.post_process_images(doctree) self.dlpath = relative_uri(self.get_target_uri(docname), '_downloads') + self.current_docname = docname self.docwriter.write(doctree, destination) self.docwriter.assemble_parts() body = self.docwriter.parts['fragment'] @@ -531,15 +532,10 @@ f.close() # then, copy translations JavaScript file if self.config.language is not None: - jsfile_list = [path.join(package_dir, 'locale', - self.config.language, 'LC_MESSAGES', 'sphinx.js'), - path.join(sys.prefix, 'share/sphinx/locale', - self.config.language, 'sphinx.js')] - for jsfile in jsfile_list: - if path.isfile(jsfile): - copyfile(jsfile, path.join(self.outdir, '_static', - 'translations.js')) - break + jsfile = self._get_translations_js() + if jsfile: + copyfile(jsfile, path.join(self.outdir, '_static', + 'translations.js')) # then, copy over theme-supplied static files if self.theme: themeentries = [path.join(themepath, 'static') @@ -686,13 +682,19 @@ def pathto(otheruri, resource=False, baseuri=self.get_target_uri(pagename)): - if not resource: + if resource and '://' in otheruri: + # allow non-local resources given by scheme + return otheruri + elif not resource: otheruri = self.get_target_uri(otheruri) uri = relative_uri(baseuri, otheruri) or '#' return uri ctx['pathto'] = pathto ctx['hasdoc'] = lambda name: name in self.env.all_docs - ctx['encoding'] = encoding = self.config.html_output_encoding + if self.name != 'htmlhelp': + ctx['encoding'] = encoding = self.config.html_output_encoding + else: + ctx['encoding'] = encoding = self.encoding ctx['toctree'] = lambda **kw: self._get_local_toctree(pagename, **kw) self.add_sidebars(pagename, ctx) ctx.update(addctx) @@ -713,7 +715,7 @@ # outfilename's path is in general different from self.outdir ensuredir(path.dirname(outfilename)) try: - f = codecs.open(outfilename, 'w', encoding) + f = codecs.open(outfilename, 'w', encoding, 'xmlcharrefreplace') try: f.write(output) finally: @@ -800,6 +802,10 @@ return outfilename + def prepare_writing(self, docnames): + StandaloneHTMLBuilder.prepare_writing(self, docnames) + self.globalcontext['no_search_suffix'] = True + class SingleFileHTMLBuilder(StandaloneHTMLBuilder): """ @@ -851,8 +857,14 @@ 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'] + # if there is no toctree, toc is None + if toc: + self.fix_refuris(toc) + toc = self.render_partial(toc)['fragment'] + display_toc = True + else: + toc = '' + display_toc = False return dict( parents = [], prev = None, @@ -865,7 +877,7 @@ rellinks = [], sourcename = '', toc = toc, - display_toc = True, + display_toc = display_toc, ) def write(self, *ignored): @@ -1003,15 +1015,15 @@ """ A builder that dumps the generated HTML into JSON files. """ - implementation = json - indexer_format = json + implementation = jsonimpl + indexer_format = jsonimpl name = 'json' out_suffix = '.fjson' globalcontext_filename = 'globalcontext.json' searchindex_filename = 'searchindex.json' def init(self): - if json is None: + if jsonimpl.json is None: raise SphinxError( 'The module simplejson (or json in Python >= 2.6) ' 'is not available. The JSONHTMLBuilder builder will not work.') diff -Nru sphinx-1.0~hg20100604/sphinx/builders/__init__.py sphinx-1.0.7/sphinx/builders/__init__.py --- sphinx-1.0~hg20100604/sphinx/builders/__init__.py 2010-05-06 16:30:00.000000000 +0000 +++ sphinx-1.0.7/sphinx/builders/__init__.py 2011-01-07 14:02:48.000000000 +0000 @@ -5,7 +5,7 @@ Builder superclass for all builders. - :copyright: Copyright 2007-2010 by the Sphinx team, see AUTHORS. + :copyright: Copyright 2007-2011 by the Sphinx team, see AUTHORS. :license: BSD, see LICENSE for details. """ @@ -277,7 +277,8 @@ # add all toctree-containing files that may have changed for docname in list(docnames): for tocdocname in self.env.files_to_rebuild.get(docname, []): - docnames.add(tocdocname) + if tocdocname in self.env.found_docs: + docnames.add(tocdocname) docnames.add(self.config.master_doc) self.info(bold('preparing documents... '), nonl=True) diff -Nru sphinx-1.0~hg20100604/sphinx/builders/latex.py sphinx-1.0.7/sphinx/builders/latex.py --- sphinx-1.0~hg20100604/sphinx/builders/latex.py 2010-06-03 22:12:22.000000000 +0000 +++ sphinx-1.0.7/sphinx/builders/latex.py 2011-01-15 09:51:35.000000000 +0000 @@ -5,7 +5,7 @@ LaTeX builder. - :copyright: Copyright 2007-2010 by the Sphinx team, see AUTHORS. + :copyright: Copyright 2007-2011 by the Sphinx team, see AUTHORS. :license: BSD, see LICENSE for details. """ @@ -46,10 +46,6 @@ return 'all documents' # for now def get_target_uri(self, docname, typ=None): - if typ == 'token': - # token references are always inside production lists and must be - # replaced by \token{} in LaTeX - return '@token' if docname not in self.docnames: raise NoUri else: @@ -96,7 +92,7 @@ encoding='utf-8') self.info("processing " + targetname + "... ", nonl=1) doctree = self.assemble_doctree(docname, toctree_only, - appendices=((docclass == 'manual') and + appendices=((docclass != 'howto') and self.config.latex_appendices or [])) self.post_process_images(doctree) self.info("writing... ", nonl=1) diff -Nru sphinx-1.0~hg20100604/sphinx/builders/linkcheck.py sphinx-1.0.7/sphinx/builders/linkcheck.py --- sphinx-1.0~hg20100604/sphinx/builders/linkcheck.py 2010-06-03 22:12:22.000000000 +0000 +++ sphinx-1.0.7/sphinx/builders/linkcheck.py 2011-01-04 09:00:04.000000000 +0000 @@ -5,7 +5,7 @@ The CheckExternalLinksBuilder class. - :copyright: Copyright 2007-2010 by the Sphinx team, see AUTHORS. + :copyright: Copyright 2007-2011 by the Sphinx team, see AUTHORS. :license: BSD, see LICENSE for details. """ @@ -16,7 +16,7 @@ from docutils import nodes from sphinx.builders import Builder -from sphinx.util.console import purple, red, darkgreen +from sphinx.util.console import purple, red, darkgreen, darkgray # create an opener that will simulate a browser user-agent opener = build_opener() @@ -71,9 +71,12 @@ break lineno = node.line + if len(uri) == 0 or uri[0:7] == 'mailto:' or uri[0:4] == 'ftp:': + return + + if lineno: + self.info('(line %3d) ' % lineno, nonl=1) 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: @@ -98,15 +101,9 @@ self.write_entry('redirected', docname, lineno, uri + ' to ' + s) self.redirected[uri] = (r, s) - elif len(uri) == 0 or uri[0:7] == 'mailto:' or uri[0:4] == 'ftp:': - return else: - self.warn(uri + ' - ' + red('malformed!')) - self.write_entry('malformed', docname, lineno, uri) - if self.app.quiet: - self.warn('malformed link: %s' % uri, - '%s:%s' % (self.env.doc2path(docname), lineno)) - self.app.statuscode = 1 + self.info(uri + ' - ' + darkgray('local')) + self.write_entry('local', docname, lineno, uri) if self.broken: self.app.statuscode = 1 diff -Nru sphinx-1.0~hg20100604/sphinx/builders/manpage.py sphinx-1.0.7/sphinx/builders/manpage.py --- sphinx-1.0~hg20100604/sphinx/builders/manpage.py 2010-05-06 16:30:00.000000000 +0000 +++ sphinx-1.0.7/sphinx/builders/manpage.py 2011-01-04 09:00:04.000000000 +0000 @@ -5,7 +5,7 @@ Manual pages builder. - :copyright: Copyright 2007-2010 by the Sphinx team, see AUTHORS. + :copyright: Copyright 2007-2011 by the Sphinx team, see AUTHORS. :license: BSD, see LICENSE for details. """ diff -Nru sphinx-1.0~hg20100604/sphinx/builders/qthelp.py sphinx-1.0.7/sphinx/builders/qthelp.py --- sphinx-1.0~hg20100604/sphinx/builders/qthelp.py 2010-06-03 22:12:22.000000000 +0000 +++ sphinx-1.0.7/sphinx/builders/qthelp.py 2011-01-04 09:00:04.000000000 +0000 @@ -5,7 +5,7 @@ Build input files for the Qt collection generator. - :copyright: Copyright 2007-2010 by the Sphinx team, see AUTHORS. + :copyright: Copyright 2007-2011 by the Sphinx team, see AUTHORS. :license: BSD, see LICENSE for details. """ @@ -23,7 +23,7 @@ _idpattern = re.compile( - r'(?P.+) (\((?P<id>[\w\.]+)( (?P<descr>\w+))?\))$') + r'(?P<title>.+) (\((class in )?(?P<id>[\w\.]+)( (?P<descr>\w+))?\))$') # Qt Help Collection Project (.qhcp). @@ -135,7 +135,7 @@ # keywords keywords = [] - index = self.env.create_index(self) + index = self.env.create_index(self, group_entries=False) for (key, group) in index: for title, (refs, subitems) in group: keywords.extend(self.build_keywords(title, refs, subitems)) @@ -165,6 +165,7 @@ nspace = 'org.sphinx.%s.%s' % (outname, self.config.version) nspace = re.sub('[^a-zA-Z0-9.]', '', nspace) nspace = re.sub(r'\.+', '.', nspace).strip('.') + nspace = nspace.lower() # write the project file f = codecs.open(path.join(outdir, outname+'.qhp'), 'w', 'utf-8') diff -Nru sphinx-1.0~hg20100604/sphinx/builders/text.py sphinx-1.0.7/sphinx/builders/text.py --- sphinx-1.0~hg20100604/sphinx/builders/text.py 2010-05-06 16:30:00.000000000 +0000 +++ sphinx-1.0.7/sphinx/builders/text.py 2011-01-04 09:00:04.000000000 +0000 @@ -5,7 +5,7 @@ Plain-text Sphinx builder. - :copyright: Copyright 2007-2010 by the Sphinx team, see AUTHORS. + :copyright: Copyright 2007-2011 by the Sphinx team, see AUTHORS. :license: BSD, see LICENSE for details. """ diff -Nru sphinx-1.0~hg20100604/sphinx/cmdline.py sphinx-1.0.7/sphinx/cmdline.py --- sphinx-1.0~hg20100604/sphinx/cmdline.py 2010-06-03 22:12:22.000000000 +0000 +++ sphinx-1.0.7/sphinx/cmdline.py 2011-01-04 14:32:30.000000000 +0000 @@ -5,7 +5,7 @@ sphinx-build command-line handling. - :copyright: Copyright 2007-2010 by the Sphinx team, see AUTHORS. + :copyright: Copyright 2007-2011 by the Sphinx team, see AUTHORS. :license: BSD, see LICENSE for details. """ @@ -90,6 +90,13 @@ if err: return 1 + # likely encoding used for command-line arguments + try: + locale = __import__('locale') # due to submodule of the same name + likely_encoding = locale.getpreferredencoding() + except Exception: + likely_encoding = None + buildername = None force_all = freshenv = warningiserror = use_pdb = False status = sys.stdout @@ -129,7 +136,11 @@ try: val = int(val) except ValueError: - pass + if likely_encoding: + try: + val = val.decode(likely_encoding) + except UnicodeError: + pass confoverrides[key] = val elif opt == '-A': try: @@ -141,7 +152,11 @@ try: val = int(val) except ValueError: - pass + if likely_encoding: + try: + val = val.decode(likely_encoding) + except UnicodeError: + pass confoverrides['html_context.%s' % key] = val elif opt == '-n': confoverrides['nitpicky'] = True diff -Nru sphinx-1.0~hg20100604/sphinx/config.py sphinx-1.0.7/sphinx/config.py --- sphinx-1.0~hg20100604/sphinx/config.py 2010-06-03 22:12:22.000000000 +0000 +++ sphinx-1.0.7/sphinx/config.py 2011-01-06 17:23:31.000000000 +0000 @@ -5,7 +5,7 @@ Build configuration file handling. - :copyright: Copyright 2007-2010 by the Sphinx team, see AUTHORS. + :copyright: Copyright 2007-2011 by the Sphinx team, see AUTHORS. :license: BSD, see LICENSE for details. """ @@ -124,6 +124,7 @@ epub_post_files = ([], 'env'), epub_exclude_files = ([], 'env'), epub_tocdepth = (3, 'env'), + epub_tocdup = (True, 'env'), # LaTeX options latex_documents = ([], None), @@ -178,8 +179,8 @@ self.extensions = config.get('extensions', []) def check_unicode(self, warn): - # check all string values for non-ASCII characters in - # bytestrings, since that can + # check all string values for non-ASCII characters in bytestrings, + # since that can result in UnicodeErrors all over the place for name, value in self._raw_config.iteritems(): if isinstance(value, str) and nonascii_re.search(value): warn('the config value %r is set to a string with non-ASCII ' diff -Nru sphinx-1.0~hg20100604/sphinx/directives/code.py sphinx-1.0.7/sphinx/directives/code.py --- sphinx-1.0~hg20100604/sphinx/directives/code.py 2010-06-03 22:12:22.000000000 +0000 +++ sphinx-1.0.7/sphinx/directives/code.py 2011-01-07 10:15:38.000000000 +0000 @@ -3,7 +3,7 @@ sphinx.directives.code ~~~~~~~~~~~~~~~~~~~~~~ - :copyright: Copyright 2007-2010 by the Sphinx team, see AUTHORS. + :copyright: Copyright 2007-2011 by the Sphinx team, see AUTHORS. :license: BSD, see LICENSE for details. """ @@ -64,6 +64,7 @@ literal = nodes.literal_block(code, code) literal['language'] = self.arguments[0] literal['linenos'] = 'linenos' in self.options + literal.line = self.lineno return [literal] @@ -102,7 +103,7 @@ rel_fn = filename[1:] else: docdir = path.dirname(env.doc2path(env.docname, base=None)) - rel_fn = path.normpath(path.join(docdir, filename)) + rel_fn = path.join(docdir, filename) try: fn = path.join(env.srcdir, rel_fn) except UnicodeDecodeError: @@ -120,7 +121,7 @@ codec_info = codecs.lookup(encoding) try: f = codecs.StreamReaderWriter(open(fn, 'U'), - codec_info.streamreader, codec_info.streamwriter, 'strict') + codec_info[2], codec_info[3], 'strict') lines = f.readlines() f.close() except (IOError, OSError): @@ -180,6 +181,7 @@ text = text.expandtabs(self.options['tab-width']) retnode = nodes.literal_block(text, text, source=fn) retnode.line = 1 + retnode.attributes['line_number'] = self.lineno if self.options.get('language', ''): retnode['language'] = self.options['language'] if 'linenos' in self.options: diff -Nru sphinx-1.0~hg20100604/sphinx/directives/__init__.py sphinx-1.0.7/sphinx/directives/__init__.py --- sphinx-1.0~hg20100604/sphinx/directives/__init__.py 2010-05-06 16:30:00.000000000 +0000 +++ sphinx-1.0.7/sphinx/directives/__init__.py 2011-01-08 21:16:36.000000000 +0000 @@ -5,7 +5,7 @@ Handlers for additional ReST directives. - :copyright: Copyright 2007-2010 by the Sphinx team, see AUTHORS. + :copyright: Copyright 2007-2011 by the Sphinx team, see AUTHORS. :license: BSD, see LICENSE for details. """ @@ -32,7 +32,8 @@ # RE to strip backslash escapes -strip_backslash_re = re.compile(r'\\(?=[^\\])') +nl_escape_re = re.compile(r'\\\n') +strip_backslash_re = re.compile(r'\\(.)') class ObjectDescription(Directive): @@ -57,10 +58,12 @@ """ Retrieve the signatures to document from the directive arguments. By default, signatures are given as arguments, one per line. + + Backslash-escaping of newlines is supported. """ + lines = nl_escape_re.sub('', self.arguments[0]).split('\n') # remove backslashes to support (dummy) escapes; helps Vim highlighting - return [strip_backslash_re.sub('', sig.strip()) - for sig in self.arguments[0].split('\n')] + return [strip_backslash_re.sub(r'\1', line.strip()) for line in lines] def handle_signature(self, sig, signode): """ @@ -159,7 +162,6 @@ 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() diff -Nru sphinx-1.0~hg20100604/sphinx/directives/other.py sphinx-1.0.7/sphinx/directives/other.py --- sphinx-1.0~hg20100604/sphinx/directives/other.py 2010-06-03 22:12:22.000000000 +0000 +++ sphinx-1.0.7/sphinx/directives/other.py 2011-01-07 15:41:03.000000000 +0000 @@ -3,7 +3,7 @@ sphinx.directives.other ~~~~~~~~~~~~~~~~~~~~~~~ - :copyright: Copyright 2007-2010 by the Sphinx team, see AUTHORS. + :copyright: Copyright 2007-2011 by the Sphinx team, see AUTHORS. :license: BSD, see LICENSE for details. """ @@ -73,8 +73,9 @@ entries.append((title, ref)) elif docname not in env.found_docs: ret.append(self.state.document.reporter.warning( - 'toctree references unknown document %r' % docname, - line=self.lineno)) + 'toctree contains reference to nonexisting ' + 'document %r' % docname, line=self.lineno)) + env.note_reread() else: entries.append((title, docname)) includefiles.append(docname) @@ -163,6 +164,7 @@ self.state.document.note_explicit_target(targetnode) indexnode = addnodes.index() indexnode['entries'] = ne = [] + indexnode['inline'] = False for entry in arguments: entry = entry.strip() for type in pairindextypes: @@ -215,12 +217,7 @@ else: ret = [node] env = self.state.document.settings.env - 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())) + env.note_versionchange(node['type'], node['version'], node, self.lineno) return ret @@ -264,6 +261,7 @@ def run(self): node = addnodes.tabular_col_spec() node['spec'] = self.arguments[0] + node.line = self.lineno return [node] diff -Nru sphinx-1.0~hg20100604/sphinx/domains/cpp.py sphinx-1.0.7/sphinx/domains/cpp.py --- sphinx-1.0~hg20100604/sphinx/domains/cpp.py 2010-06-03 22:12:22.000000000 +0000 +++ sphinx-1.0.7/sphinx/domains/cpp.py 2011-01-08 15:05:59.000000000 +0000 @@ -5,7 +5,7 @@ The C++ language domain. - :copyright: Copyright 2007-2010 by the Sphinx team, see AUTHORS. + :copyright: Copyright 2007-2011 by the Sphinx team, see AUTHORS. :license: BSD, see LICENSE for details. """ @@ -21,10 +21,9 @@ 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') +_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) @@ -150,9 +149,9 @@ """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. + it, it returns None as owner and self as name. """ - raise NotImplementedError() + return None, self def prefix(self, prefix): """Prefixes a name node (a node returned by :meth:`get_name`).""" @@ -162,7 +161,7 @@ return unicode(self).encode('utf-8') def __repr__(self): - return '<defexpr %s>' % self + return '<%s %s>' % (self.__class__.__name__, self) class PrimaryDefExpr(DefExpr): @@ -170,9 +169,6 @@ def get_name(self): return self - def split_owner(self): - return None, self - def prefix(self, prefix): if isinstance(prefix, PathDefExpr): prefix = prefix.clone() @@ -323,9 +319,8 @@ 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'') + return (u'%s %s' % (self.type or u'', self.name or u'')).strip() + \ + (self.default is not None and u'=%s' % self.default or u'') class NamedDefExpr(DefExpr): @@ -445,9 +440,9 @@ 'mutable': None, 'const': None, 'typename': None, - 'unsigned': set(('char', 'int', 'long')), - 'signed': set(('char', 'int', 'long')), - 'short': set(('int', 'short')), + 'unsigned': set(('char', 'short', 'int', 'long')), + 'signed': set(('char', 'short', 'int', 'long')), + 'short': set(('int',)), 'long': set(('int', 'long', 'double')) } @@ -694,14 +689,13 @@ self.fail('expected comma between arguments') self.skip_ws() - argname = self._parse_type() - argtype = default = None + argtype = self._parse_type() + argname = 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('='): @@ -824,17 +818,18 @@ 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) + if theid not in self.state.document.ids: + 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'].setdefault(name, - (self.env.docname, self.objtype, theid)) + self.env.domaindata['cpp']['objects'].setdefault(name, + (self.env.docname, self.objtype, theid)) indextext = self.get_index_text(name) if indextext: - self.indexnode['entries'].append(('single', indextext, name, name)) + self.indexnode['entries'].append(('single', indextext, theid, name)) def before_content(self): lastname = self.names and self.names[-1] @@ -1071,13 +1066,15 @@ 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 + raise DefinitionError('') except DefinitionError: + refdoc = node.get('refdoc', fromdocname) + env.warn(refdoc, 'unparseable C++ definition: %r' % target, + node.line) return None parent = node['cpp:parent'] diff -Nru sphinx-1.0~hg20100604/sphinx/domains/c.py sphinx-1.0.7/sphinx/domains/c.py --- sphinx-1.0~hg20100604/sphinx/domains/c.py 2010-06-03 22:12:22.000000000 +0000 +++ sphinx-1.0.7/sphinx/domains/c.py 2011-01-06 19:58:08.000000000 +0000 @@ -5,7 +5,7 @@ The C language domain. - :copyright: Copyright 2007-2010 by the Sphinx team, see AUTHORS. + :copyright: Copyright 2007-2011 by the Sphinx team, see AUTHORS. :license: BSD, see LICENSE for details. """ @@ -99,13 +99,20 @@ m = c_funcptr_name_re.match(name) if m: name = m.group(1) + + typename = self.env.temp_data.get('c:type') + if self.name == 'c:member' and typename: + fullname = typename + '.' + name + else: + fullname = name + 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 + return fullname paramlist = addnodes.desc_parameterlist() arglist = arglist.replace('`', '').replace('\\ ', '') # remove markup @@ -121,12 +128,13 @@ self._parse_type(param, arg) else: self._parse_type(param, ctype) - param += nodes.emphasis(' '+argname, ' '+argname) + # separate by non-breaking space in the output + param += nodes.emphasis(' '+argname, u'\xa0'+argname) paramlist += param signode += paramlist if const: signode += addnodes.desc_addname(const, const) - return name + return fullname def get_index_text(self, name): if self.objtype == 'function': @@ -162,6 +170,31 @@ if indextext: self.indexnode['entries'].append(('single', indextext, name, name)) + def before_content(self): + self.typename_set = False + if self.name == 'c:type': + if self.names: + self.env.temp_data['c:type'] = self.names[0] + self.typename_set = True + + def after_content(self): + if self.typename_set: + self.env.temp_data['c:type'] = None + + +class CXRefRole(XRefRole): + def process_link(self, env, refnode, has_explicit_title, title, target): + 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[0:1] == '~': + title = title[1:] + dot = title.rfind('.') + if dot != -1: + title = title[dot+1:] + return title, target + class CDomain(Domain): """C language domain.""" @@ -183,11 +216,11 @@ 'var': CObject, } roles = { - 'func' : XRefRole(fix_parens=True), - 'member': XRefRole(), - 'macro': XRefRole(), - 'data': XRefRole(), - 'type': XRefRole(), + 'func' : CXRefRole(fix_parens=True), + 'member': CXRefRole(), + 'macro': CXRefRole(), + 'data': CXRefRole(), + 'type': CXRefRole(), } initial_data = { 'objects': {}, # fullname -> docname, objtype diff -Nru sphinx-1.0~hg20100604/sphinx/domains/__init__.py sphinx-1.0.7/sphinx/domains/__init__.py --- sphinx-1.0~hg20100604/sphinx/domains/__init__.py 2010-06-03 22:12:22.000000000 +0000 +++ sphinx-1.0.7/sphinx/domains/__init__.py 2011-01-08 15:35:22.000000000 +0000 @@ -6,7 +6,7 @@ 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. + :copyright: Copyright 2007-2011 by the Sphinx team, see AUTHORS. :license: BSD, see LICENSE for details. """ @@ -132,6 +132,8 @@ roles = {} #: a list of Index subclasses indices = [] + #: role name -> a warning message if reference is missing + dangling_warnings = {} #: data value for a fresh environment initial_data = {} diff -Nru sphinx-1.0~hg20100604/sphinx/domains/javascript.py sphinx-1.0.7/sphinx/domains/javascript.py --- sphinx-1.0~hg20100604/sphinx/domains/javascript.py 2010-06-03 22:12:22.000000000 +0000 +++ sphinx-1.0.7/sphinx/domains/javascript.py 2011-01-15 13:23:40.000000000 +0000 @@ -5,7 +5,7 @@ The JavaScript domain. - :copyright: Copyright 2007-2010 by the Sphinx team, see AUTHORS. + :copyright: Copyright 2007-2011 by the Sphinx team, see AUTHORS. :license: BSD, see LICENSE for details. """ @@ -13,8 +13,8 @@ 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.domains.python import _pseudo_parse_arglist from sphinx.util.nodes import make_refnode from sphinx.util.docfields import Field, GroupedField, TypedField @@ -56,7 +56,7 @@ else: # just a function or constructor objectname = '' - fullname = '' + fullname = name signode['object'] = objectname signode['fullname'] = fullname @@ -68,28 +68,10 @@ 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 + if not arglist: + signode += addnodes.desc_parameterlist() else: - token = token.strip() - stack[-1] += addnodes.desc_parameter(token, token) - if len(stack) != 1: - raise ValueError() + _pseudo_parse_arglist(signode, arglist) return fullname, nameprefix def add_target_and_index(self, name_obj, sig, signode): @@ -114,7 +96,8 @@ indextext = self.get_index_text(objectname, name_obj) if indextext: self.indexnode['entries'].append(('single', indextext, - fullname, fullname)) + fullname.replace('$', '_S_'), + fullname)) def get_index_text(self, objectname, name_obj): name, obj = name_obj @@ -226,8 +209,10 @@ 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) + return make_refnode(builder, fromdocname, obj[0], + name.replace('$', '_S_'), contnode, name) def get_objects(self): for refname, (docname, type) in self.data['objects'].iteritems(): - yield refname, refname, type, docname, refname, 1 + yield refname, refname, type, docname, \ + refname.replace('$', '_S_'), 1 diff -Nru sphinx-1.0~hg20100604/sphinx/domains/python.py sphinx-1.0.7/sphinx/domains/python.py --- sphinx-1.0~hg20100604/sphinx/domains/python.py 2010-06-03 22:12:22.000000000 +0000 +++ sphinx-1.0.7/sphinx/domains/python.py 2011-01-08 22:07:04.000000000 +0000 @@ -5,7 +5,7 @@ The Python domain. - :copyright: Copyright 2007-2010 by the Sphinx team, see AUTHORS. + :copyright: Copyright 2007-2011 by the Sphinx team, see AUTHORS. :license: BSD, see LICENSE for details. """ @@ -33,7 +33,52 @@ )? $ # and nothing more ''', re.VERBOSE) -py_paramlist_re = re.compile(r'([\[\],])') # split at '[', ']' and ',' + +def _pseudo_parse_arglist(signode, arglist): + """"Parse" a list of arguments separated by commas. + + Arguments can have "optional" annotations given by enclosing them in + brackets. Currently, this will split at any comma, even if it's inside a + string literal (e.g. default argument value). + """ + paramlist = addnodes.desc_parameterlist() + stack = [paramlist] + try: + for argument in arglist.split(','): + argument = argument.strip() + ends_open = ends_close = 0 + while argument.startswith('['): + stack.append(addnodes.desc_optional()) + stack[-2] += stack[-1] + argument = argument[1:].strip() + while argument.startswith(']'): + stack.pop() + argument = argument[1:].strip() + while argument.endswith(']'): + ends_close += 1 + argument = argument[:-1].strip() + while argument.endswith('['): + ends_open += 1 + argument = argument[:-1].strip() + if argument: + stack[-1] += addnodes.desc_parameter(argument, argument) + while ends_open: + stack.append(addnodes.desc_optional()) + stack[-2] += stack[-1] + ends_open -= 1 + while ends_close: + stack.pop() + ends_close -= 1 + if len(stack) != 1: + raise IndexError + except IndexError: + # if there are too few or too many elements on the stack, just give up + # and treat the whole argument list as one argument, discarding the + # already partially populated paramlist node + signode += addnodes.desc_parameterlist() + signode[-1] += addnodes.desc_parameter(arglist, arglist) + else: + signode += paramlist class PyObject(ObjectDescription): @@ -49,10 +94,12 @@ TypedField('parameter', label=l_('Parameters'), names=('param', 'parameter', 'arg', 'argument', 'keyword', 'kwarg', 'kwparam'), - typerolename='obj', typenames=('paramtype', 'type')), + typerolename='obj', typenames=('paramtype', 'type'), + can_collapse=True), TypedField('variable', label=l_('Variables'), rolename='obj', names=('var', 'ivar', 'cvar'), - typerolename='obj', typenames=('vartype',)), + typerolename='obj', typenames=('vartype',), + can_collapse=True), GroupedField('exceptions', label=l_('Raises'), rolename='exc', names=('raises', 'raise', 'exception', 'except'), can_collapse=True), @@ -142,26 +189,7 @@ 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 + _pseudo_parse_arglist(signode, arglist) if retann: signode += addnodes.desc_returns(retann, retann) return fullname, name_prefix @@ -356,6 +384,9 @@ env.domaindata['py']['modules'][modname] = \ (env.docname, self.options.get('synopsis', ''), self.options.get('platform', ''), 'deprecated' in self.options) + # make a duplicate entry in 'objects' to facilitate searching for the + # module in PythonDomain.find_obj() + env.domaindata['py']['objects'][modname] = (env.docname, 'module') targetnode = nodes.target('', '', ids=['module-' + modname], ismod=True) self.state.document.note_explicit_target(targetnode) ret = [targetnode] @@ -544,32 +575,47 @@ if fn == docname: del self.data['modules'][modname] - def find_obj(self, env, modname, classname, name, type, searchorder=0): + def find_obj(self, env, modname, classname, name, type, searchmode=0): """ Find a Python object for "name", perhaps using the given module and/or - classname. + classname. Returns a list of (name, object entry) tuples. """ # skip parens if name[-2:] == '()': name = name[:-2] if not name: - return None, None + return [] objects = self.data['objects'] + matches = [] 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 + if searchmode == 1: + objtypes = self.objtypes_for_role(type) + if modname and classname: + fullname = modname + '.' + classname + '.' + name + if fullname in objects and objects[fullname][1] in objtypes: + newname = fullname + if not newname: + if modname and modname + '.' + name in objects and \ + objects[modname + '.' + name][1] in objtypes: + newname = modname + '.' + name + elif name in objects and objects[name][1] in objtypes: + newname = name + else: + # "fuzzy" searching mode + searchname = '.' + name + matches = [(name, objects[name]) for name in objects + if name.endswith(searchname) + and objects[name][1] in objtypes] else: + # NOTE: searching for exact match, object type is not considered if name in objects: newname = name + elif type == 'mod': + # only exact matches allowed for modules + return [] elif classname and classname + '.' + name in objects: newname = classname + '.' + name elif modname and modname + '.' + name in objects: @@ -585,35 +631,43 @@ 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] + if newname is not None: + matches.append((newname, objects[newname])) + return matches 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) + type, target, node, contnode): + modname = node.get('py:module') + clsname = node.get('py:class') + searchmode = node.hasattr('refspecific') and 1 or 0 + matches = self.find_obj(env, modname, clsname, target, + type, searchmode) + if not matches: + return None + elif len(matches) > 1: + env.warn(fromdocname, + 'more than one target found for cross-reference ' + '%r: %s' % (target, + ', '.join(match[0] for match in matches)), + node.line) + name, obj = matches[0] + + if obj[1] == 'module': + # get additional info for modules + docname, synopsis, platform, deprecated = self.data['modules'][name] + assert docname == obj[0] + title = name + if synopsis: + title += ': ' + synopsis + if deprecated: + title += _(' (deprecated)') + if platform: + title += ' (' + platform + ')' + return make_refnode(builder, fromdocname, docname, + 'module-' + name, 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) + return make_refnode(builder, fromdocname, obj[0], name, + contnode, name) def get_objects(self): for modname, info in self.data['modules'].iteritems(): diff -Nru sphinx-1.0~hg20100604/sphinx/domains/rst.py sphinx-1.0.7/sphinx/domains/rst.py --- sphinx-1.0~hg20100604/sphinx/domains/rst.py 2010-06-03 22:12:22.000000000 +0000 +++ sphinx-1.0.7/sphinx/domains/rst.py 2011-01-04 09:00:04.000000000 +0000 @@ -5,7 +5,7 @@ The reStructuredText domain. - :copyright: Copyright 2007-2010 by the Sphinx team, see AUTHORS. + :copyright: Copyright 2007-2011 by the Sphinx team, see AUTHORS. :license: BSD, see LICENSE for details. """ @@ -28,9 +28,10 @@ """ 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) + targetname = self.objtype + '-' + name + if targetname not in self.state.document.ids: + signode['names'].append(targetname) + signode['ids'].append(targetname) signode['first'] = (not self.names) self.state.document.note_explicit_target(signode) @@ -47,7 +48,7 @@ indextext = self.get_index_text(self.objtype, name) if indextext: self.indexnode['entries'].append(('single', indextext, - name, name)) + targetname, targetname)) def get_index_text(self, objectname, name): if self.objtype == 'directive': @@ -129,8 +130,9 @@ if (objtype, target) in objects: return make_refnode(builder, fromdocname, objects[objtype, target], - target, contnode, target) + objtype + '-' + target, + contnode, target + ' ' + objtype) def get_objects(self): for (typ, name), docname in self.data['objects'].iteritems(): - yield name, name, typ, docname, name, 1 + yield name, name, typ, docname, typ + '-' + name, 1 diff -Nru sphinx-1.0~hg20100604/sphinx/domains/std.py sphinx-1.0.7/sphinx/domains/std.py --- sphinx-1.0~hg20100604/sphinx/domains/std.py 2010-06-03 22:12:22.000000000 +0000 +++ sphinx-1.0.7/sphinx/domains/std.py 2011-01-08 15:34:57.000000000 +0000 @@ -5,11 +5,12 @@ The standard domain. - :copyright: Copyright 2007-2010 by the Sphinx team, see AUTHORS. + :copyright: Copyright 2007-2011 by the Sphinx team, see AUTHORS. :license: BSD, see LICENSE for details. """ import re +import unicodedata from docutils import nodes from docutils.parsers.rst import directives @@ -250,7 +251,7 @@ li.insert(0, indexnode) items.append((termtext, li)) if 'sorted' in self.options: - items.sort(key=lambda x: x[0].lower()) + items.sort(key=lambda x: unicodedata.normalize('NFD', x[0].lower())) new_dl.extend(item[1] for item in items) node.children = [new_dl] return [node] @@ -346,11 +347,13 @@ # links to tokens in grammar productions 'token': XRefRole(), # links to terms in glossary - 'term': XRefRole(lowercase=True, innernodeclass=nodes.emphasis), + 'term': XRefRole(lowercase=True, innernodeclass=nodes.emphasis, + warn_dangling=True), # links to headings or arbitrary labels - 'ref': XRefRole(lowercase=True, innernodeclass=nodes.emphasis), + 'ref': XRefRole(lowercase=True, innernodeclass=nodes.emphasis, + warn_dangling=True), # links to labels, without a different title - 'keyword': XRefRole(), + 'keyword': XRefRole(warn_dangling=True), } initial_data = { @@ -368,6 +371,13 @@ }, } + dangling_warnings = { + 'term': 'term not in glossary: %(target)s', + 'ref': 'undefined label: %(target)s (if the link has no caption ' + 'the label must precede a section header)', + 'keyword': 'unknown keyword: %(target)s', + } + def clear_doc(self, docname): for key, (fn, _) in self.data['progoptions'].items(): if fn == docname: @@ -425,27 +435,16 @@ 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) @@ -469,30 +468,29 @@ # 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) + 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) + return make_refnode(builder, fromdocname, docname, + labelid, contnode) else: - docname, labelid = self.data['objects'].get((typ, target), ('', '')) + objtypes = self.objtypes_for_role(typ) or [] + for objtype in objtypes: + if (objtype, target) in self.data['objects']: + docname, labelid = self.data['objects'][objtype, target] + break + else: + docname, labelid = '', '' 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) + return make_refnode(builder, fromdocname, docname, + labelid, contnode) def get_objects(self): for (prog, option), info in self.data['progoptions'].iteritems(): diff -Nru sphinx-1.0~hg20100604/sphinx/environment.py sphinx-1.0.7/sphinx/environment.py --- sphinx-1.0~hg20100604/sphinx/environment.py 2010-06-03 22:12:22.000000000 +0000 +++ sphinx-1.0.7/sphinx/environment.py 2011-01-08 15:38:56.000000000 +0000 @@ -5,7 +5,7 @@ Global creation environment. - :copyright: Copyright 2007-2010 by the Sphinx team, see AUTHORS. + :copyright: Copyright 2007-2011 by the Sphinx team, see AUTHORS. :license: BSD, see LICENSE for details. """ @@ -16,6 +16,7 @@ import codecs import imghdr import string +import unicodedata import cPickle as pickle from os import path from glob import glob @@ -58,11 +59,12 @@ 'input_encoding': 'utf-8-sig', 'doctitle_xform': False, 'sectsubtitle_xform': False, + 'halt_level': 5, } # This is increased every time an environment attribute is added # or changed to properly invalidate pickle files. -ENV_VERSION = 36 +ENV_VERSION = 39 default_substitutions = set([ @@ -293,6 +295,8 @@ # contains all built docnames self.dependencies = {} # docname -> set of dependent file # names, relative to documentation root + self.reread_always = set() # docnames to re-read unconditionally on + # next build # File metadata self.metadata = {} # docname -> dict of metadata items @@ -335,17 +339,14 @@ self.settings['warning_stream'] = WarningStream(func) def warn(self, docname, msg, lineno=None): - if docname: - if lineno is None: - lineno = '' - self._warnfunc(msg, '%s:%s' % (self.doc2path(docname), lineno)) - else: - self._warnfunc(msg) + # strange argument order is due to backwards compatibility + self._warnfunc(msg, (docname, lineno)) def clear_doc(self, docname): """Remove all traces of a source file in the inventory.""" if docname in self.all_docs: self.all_docs.pop(docname, None) + self.reread_always.discard(docname) self.metadata.pop(docname, None) self.dependencies.pop(docname, None) self.titles.pop(docname, None) @@ -428,6 +429,10 @@ '.doctree')): changed.add(docname) continue + # check the "reread always" list + if docname in self.reread_always: + changed.add(docname) + continue # check the mtime of the document mtime = self.all_docs[docname] newmtime = path.getmtime(self.doc2path(docname)) @@ -493,7 +498,8 @@ # if files were added or removed, all documents with globbed toctrees # must be reread if added or removed: - changed.update(self.glob_toctrees) + # ... but not those that already were removed + changed.update(self.glob_toctrees & self.found_docs) msg += '%s added, %s changed, %s removed' % (len(added), len(changed), len(removed)) @@ -508,8 +514,7 @@ self.clear_doc(docname) # read all new and changed files - to_read = added | changed - for docname in sorted(to_read): + for docname in sorted(added | changed): yield docname self.read_doc(docname, app=app) @@ -626,6 +631,11 @@ codecs.register_error('sphinx', self.warn_and_replace) class SphinxSourceClass(FileInput): + def __init__(self_, *args, **kwds): + # don't call sys.exit() on IOErrors + kwds['handle_io_errors'] = False + FileInput.__init__(self_, *args, **kwds) + def decode(self_, data): return data.decode(self_.encoding, 'sphinx') @@ -732,6 +742,15 @@ def note_dependency(self, filename): self.dependencies.setdefault(self.docname, set()).add(filename) + def note_reread(self): + self.reread_always.add(self.docname) + + def note_versionchange(self, type, version, node, lineno): + self.versionchanges.setdefault(version, []).append( + (type, self.temp_data['docname'], lineno, + self.temp_data.get('py:module'), + self.temp_data.get('object'), node.astext())) + # post-processing of read doctrees def filter_messages(self, doctree): @@ -818,9 +837,10 @@ imgtype = imghdr.what(f) finally: f.close() - except (OSError, IOError): - self.warn(docname, - 'image file %s not readable' % filename) + except (OSError, IOError), err: + self.warn(docname, 'image file %s not ' + 'readable: %s' % (filename, err), + node.line) if imgtype: candidates['image/' + imgtype] = new_imgpath else: @@ -1084,7 +1104,7 @@ finally: f.close() doctree.settings.env = self - doctree.reporter = Reporter(self.doc2path(docname), 2, 4, + doctree.reporter = Reporter(self.doc2path(docname), 2, 5, stream=WarningStream(self._warnfunc)) return doctree @@ -1129,32 +1149,62 @@ def _walk_depth(node, depth, maxdepth): """Utility: Cut a TOC at a specified depth.""" + + # For reading this function, it is useful to keep in mind the node + # structure of a toctree (using HTML-like node names for brevity): + # + # <ul> + # <li> + # <p><a></p> + # <p><a></p> + # ... + # <ul> + # ... + # </ul> + # </li> + # </ul> + for subnode in node.children[:]: if isinstance(subnode, (addnodes.compact_paragraph, nodes.list_item)): + # for <p> and <li>, just indicate the depth level and + # recurse to children subnode['classes'].append('toctree-l%d' % (depth-1)) _walk_depth(subnode, depth, maxdepth) + elif isinstance(subnode, nodes.bullet_list): + # for <ul>, determine if the depth is too large or if the + # entry is to be collapsed if maxdepth > 0 and depth > maxdepth: subnode.parent.replace(subnode, []) else: + # to find out what to collapse, *first* walk subitems, + # since that determines which children point to the + # current page _walk_depth(subnode, depth+1, maxdepth) - # cull sub-entries whose parents aren't 'current' - if (collapse and - depth > 1 and - 'current' not in subnode.parent['classes']): + if (collapse and depth > 1 and + 'iscurrent' not in subnode.parent): subnode.parent.remove(subnode) elif isinstance(subnode, nodes.reference): - # identify the toc entry pointing to the current document - if subnode['refuri'] == docname and \ - not subnode['anchorname']: - # tag the whole branch as 'current' - p = subnode - while p: - p['classes'].append('current') - p = p.parent + # for <a>, identify which entries point to the current + # document and therefore may not be collapsed + if subnode['refuri'] == docname: + if not subnode['anchorname']: + # give the whole branch a 'current' class + # (useful for styling it differently) + branchnode = subnode + while branchnode: + branchnode['classes'].append('current') + branchnode = branchnode.parent + # mark the list_item as "on current page" + if subnode.parent.parent.get('iscurrent'): + # but only if it's not already done + return + while subnode: + subnode['iscurrent'] = True + subnode = subnode.parent def _entries_from_toctree(toctreenode, separate=False, subtree=False): """Return TOC entries for a toctree node.""" @@ -1196,11 +1246,12 @@ self.warn(docname, 'toctree contains reference to document ' '%r that doesn\'t have a title: no link ' - 'will be generated' % ref) + 'will be generated' % ref, toctreenode.line) except KeyError: # this is raised if the included file does not exist self.warn(docname, 'toctree contains reference to ' - 'nonexisting document %r' % ref) + 'nonexisting document %r' % ref, + toctreenode.line) else: # if titles_only is given, only keep the main title and # sub-toctrees @@ -1264,9 +1315,10 @@ target = node['reftarget'] refdoc = node.get('refdoc', fromdocname) warned = False + domain = None try: - if node.has_key('refdomain') and node['refdomain']: + if 'refdomain' in node and node['refdomain']: # let the domain try to resolve the reference try: domain = self.domains[node['refdomain']] @@ -1308,12 +1360,17 @@ 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)) + if newnode is None and not warned and \ + (self.config.nitpicky or node.get('refwarn')): + if domain and typ in domain.dangling_warnings: + msg = domain.dangling_warnings[typ] + elif node.get('refdomain') != 'std': + msg = '%s:%s reference target not found: ' \ + '%%(target)s' % (node['refdomain'], typ) + else: + msg = '%s reference target not found: ' \ + '%%(target)s' % typ + self.warn(refdoc, msg % {'target': target}, node.line) except NoUri: newnode = contnode node.replace_self(newnode or contnode) @@ -1329,7 +1386,9 @@ if ret: node.replace_self(node.children) else: - node.replace_self([]) + # replacing by [] would result in an "Losing ids" exception + # if there is a target node before the only node + node.replace_self(nodes.comment()) # allow custom references to be resolved builder.app.emit('doctree-resolved', doctree, fromdocname) @@ -1385,7 +1444,8 @@ return rewrite_needed - def create_index(self, builder, _fixre=re.compile(r'(.*) ([(][^()]*[)])')): + def create_index(self, builder, group_entries=True, + _fixre=re.compile(r'(.*) ([(][^()]*[)])')): """Create the real index from the collected index entries.""" new = {} @@ -1443,48 +1503,49 @@ # sort the index entries; put all symbols at the front, even those # following the letters in ASCII, this is where the chr(127) comes from def keyfunc(entry, lcletters=string.ascii_lowercase + '_'): - lckey = entry[0].lower() + lckey = unicodedata.normalize('NFD', entry[0].lower()) if lckey[0:1] in lcletters: return chr(127) + lckey return lckey newlist = new.items() newlist.sort(key=keyfunc) - # fixup entries: transform - # func() (in module foo) - # func() (in module bar) - # into - # func() - # (in module foo) - # (in module bar) - oldkey = '' - oldsubitems = None - i = 0 - while i < len(newlist): - key, (targets, subitems) = newlist[i] - # cannot move if it has subitems; structure gets too complex - if not subitems: - m = _fixre.match(key) - if m: - if oldkey == m.group(1): - # prefixes match: add entry as subitem of the - # previous entry - oldsubitems.setdefault(m.group(2), [[], {}])[0].\ - extend(targets) - del newlist[i] - continue - oldkey = m.group(1) - else: - oldkey = key - oldsubitems = subitems - i += 1 + if group_entries: + # fixup entries: transform + # func() (in module foo) + # func() (in module bar) + # into + # func() + # (in module foo) + # (in module bar) + oldkey = '' + oldsubitems = None + i = 0 + while i < len(newlist): + key, (targets, subitems) = newlist[i] + # cannot move if it has subitems; structure gets too complex + if not subitems: + m = _fixre.match(key) + if m: + if oldkey == m.group(1): + # prefixes match: add entry as subitem of the + # previous entry + oldsubitems.setdefault(m.group(2), [[], {}])[0].\ + extend(targets) + del newlist[i] + continue + oldkey = m.group(1) + else: + oldkey = key + oldsubitems = subitems + i += 1 # group the entries by letter 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 - letter = k[0].upper() + letter = unicodedata.normalize('NFD', k[0])[0].upper() if letter in letters: return letter else: diff -Nru sphinx-1.0~hg20100604/sphinx/errors.py sphinx-1.0.7/sphinx/errors.py --- sphinx-1.0~hg20100604/sphinx/errors.py 2010-05-06 16:30:00.000000000 +0000 +++ sphinx-1.0.7/sphinx/errors.py 2011-01-04 09:00:04.000000000 +0000 @@ -6,7 +6,7 @@ Contains SphinxError and a few subclasses (in an extra module to avoid circular import problems). - :copyright: Copyright 2007-2010 by the Sphinx team, see AUTHORS. + :copyright: Copyright 2007-2011 by the Sphinx team, see AUTHORS. :license: BSD, see LICENSE for details. """ diff -Nru sphinx-1.0~hg20100604/sphinx/ext/autodoc.py sphinx-1.0.7/sphinx/ext/autodoc.py --- sphinx-1.0~hg20100604/sphinx/ext/autodoc.py 2010-06-05 20:50:05.000000000 +0000 +++ sphinx-1.0.7/sphinx/ext/autodoc.py 2011-01-08 22:07:04.000000000 +0000 @@ -7,13 +7,14 @@ the doctree, thus avoiding duplication between docstrings and documentation for those who like elaborate docstrings. - :copyright: Copyright 2007-2010 by the Sphinx team, see AUTHORS. + :copyright: Copyright 2007-2011 by the Sphinx team, see AUTHORS. :license: BSD, see LICENSE for details. """ import re import sys import inspect +import traceback from types import FunctionType, BuiltinFunctionType, MethodType, ClassType from docutils import nodes @@ -107,7 +108,7 @@ return getattr(self.reporter, name) def system_message(self, level, message, *children, **kwargs): - if 'line' in kwargs: + if 'line' in kwargs and 'source' not in kwargs: try: source, line = self.viewlist.items[kwargs['line']] except IndexError: @@ -164,11 +165,12 @@ lines.append('') return process -def between(marker, what=None, keepempty=False): +def between(marker, what=None, keepempty=False, exclude=False): """ - Return a listener that only keeps lines between lines that match the - *marker* regular expression. If no line matches, the resulting docstring - would be empty, so no change will be made unless *keepempty* is true. + Return a listener that either keeps, or if *exclude* is True excludes, lines + between lines that match the *marker* regular expression. If no line + matches, the resulting docstring would be empty, so no change will be made + unless *keepempty* is true. If *what* is a sequence of strings, only docstrings of a type in *what* will be processed. @@ -178,7 +180,7 @@ if what and what_ not in what: return deleted = 0 - delete = True + delete = not exclude orig_lines = lines[:] for i, line in enumerate(orig_lines): if delete: @@ -221,6 +223,8 @@ priority = 0 #: order if autodoc_member_order is set to 'groupwise' member_order = 0 + #: true if the generated content may contain titles + titles_allowed = False option_spec = {'noindex': bool_option} @@ -255,6 +259,9 @@ self.retann = None # the object to document (set after import_object succeeds) self.object = None + self.object_name = None + # the parent/owner of the object to document + self.parent = None # the module analyzer to get at attribute docs, or None self.analyzer = None @@ -320,18 +327,25 @@ """ try: __import__(self.modname) + parent = None obj = self.module = sys.modules[self.modname] for part in self.objpath: + parent = obj obj = self.get_attr(obj, part) + self.object_name = part + self.parent = parent self.object = obj return True # this used to only catch SyntaxError, ImportError and AttributeError, # but importing modules with side effects can raise all kinds of errors except Exception, err: + if self.env.app and not self.env.app.quiet: + self.env.app.info(traceback.format_exc().rstrip()) self.directive.warn( 'autodoc can\'t import/find %s %r, it reported error: ' '"%s", please check your spelling and sys.path' % (self.objtype, str(self.fullname), err)) + self.env.note_reread() return False def get_real_modname(self): @@ -456,6 +470,11 @@ if not no_docstring: encoding = self.analyzer and self.analyzer.encoding docstrings = self.get_doc(encoding) + if not docstrings: + # append at least a dummy docstring, so that the event + # autodoc-process-docstring is fired and can add some + # content if desired + docstrings.append([]) for i, line in enumerate(self.process_doc(docstrings)): self.add_line(line, sourcename, i) @@ -658,7 +677,7 @@ # parse right now, to get PycodeErrors on parsing (results will # be cached anyway) self.analyzer.find_attr_docs() - except PycodeError, err: + except PycodeError: # no source file -- e.g. for builtin and C modules self.analyzer = None # at least add the module.__file__ as a dependency @@ -675,7 +694,7 @@ # make sure that the result starts with an empty line. This is # necessary for some situations where another directive preprocesses # reST and no starting newline is present - self.add_line(u'', '') + self.add_line(u'', '<autodoc>') # format the object's signature, if any sig = self.format_signature() @@ -700,6 +719,7 @@ """ objtype = 'module' content_indent = u'' + titles_allowed = True option_spec = { 'members': members_option, 'undoc-members': bool_option, @@ -921,9 +941,9 @@ content = self.env.config.autoclass_content docstrings = [] - docstring = self.get_attr(self.object, '__doc__', None) - if docstring: - docstrings.append(docstring) + attrdocstring = self.get_attr(self.object, '__doc__', None) + if attrdocstring: + docstrings.append(attrdocstring) # for classes, what the "docstring" is can be controlled via a # config value; the default is only the class docstring @@ -1059,6 +1079,10 @@ def document_members(self, all_members=False): pass + def get_real_modname(self): + return self.get_attr(self.parent or self.object, '__module__', None) \ + or self.modname + class InstanceAttributeDocumenter(AttributeDocumenter): """ @@ -1163,7 +1187,7 @@ self.state.memo.reporter = AutodocReporter(self.result, self.state.memo.reporter) - if self.name == 'automodule': + if documenter.titles_allowed: node = nodes.section() # necessary so that the child nodes get the right source/line set node.document = self.state.document diff -Nru sphinx-1.0~hg20100604/sphinx/ext/autosummary/generate.py sphinx-1.0.7/sphinx/ext/autosummary/generate.py --- sphinx-1.0~hg20100604/sphinx/ext/autosummary/generate.py 2010-05-06 16:30:00.000000000 +0000 +++ sphinx-1.0.7/sphinx/ext/autosummary/generate.py 2011-01-15 14:04:24.000000000 +0000 @@ -14,7 +14,7 @@ generate: sphinx-autogen source/*.rst source/generated - :copyright: Copyright 2007-2010 by the Sphinx team, see AUTHORS. + :copyright: Copyright 2007-2011 by the Sphinx team, see AUTHORS. :license: BSD, see LICENSE for details. """ import os @@ -107,7 +107,7 @@ ensuredir(path) try: - obj, name = import_by_name(name) + name, obj, parent = import_by_name(name) except ImportError, e: warn('[autosummary] failed to import %r: %s' % (name, e)) continue @@ -123,7 +123,7 @@ f = open(fn, 'w') try: - doc = get_documenter(obj) + doc = get_documenter(obj, parent) if template_name is not None: template = template_env.get_template(template_name) @@ -137,7 +137,7 @@ def get_members(obj, typ, include_public=[]): items = [ name for name in dir(obj) - if get_documenter(getattr(obj, name)).objtype == typ + if get_documenter(getattr(obj, name), obj).objtype == typ ] public = [x for x in items if x in include_public or not x.startswith('_')] @@ -211,7 +211,7 @@ See `find_autosummary_in_lines`. """ try: - obj, real_name = import_by_name(name) + real_name, obj, parent = import_by_name(name) lines = pydoc.getdoc(obj).splitlines() return find_autosummary_in_lines(lines, module=name, filename=filename) except AttributeError: diff -Nru sphinx-1.0~hg20100604/sphinx/ext/autosummary/__init__.py sphinx-1.0.7/sphinx/ext/autosummary/__init__.py --- sphinx-1.0~hg20100604/sphinx/ext/autosummary/__init__.py 2010-05-06 16:30:00.000000000 +0000 +++ sphinx-1.0.7/sphinx/ext/autosummary/__init__.py 2011-01-15 14:08:58.000000000 +0000 @@ -49,7 +49,7 @@ resolved to a Python object, and otherwise it becomes simple emphasis. This can be used as the default role to make links 'smart'. - :copyright: Copyright 2007-2010 by the Sphinx team, see AUTHORS. + :copyright: Copyright 2007-2011 by the Sphinx team, see AUTHORS. :license: BSD, see LICENSE for details. """ @@ -134,27 +134,19 @@ return False isgetsetdescriptor = ismemberdescriptor -def get_documenter(obj): +def get_documenter(obj, parent): """ Get an autodoc.Documenter class suitable for documenting the given object """ - import sphinx.ext.autodoc as autodoc + from sphinx.ext.autodoc import AutoDirective, DataDocumenter - 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 + classes = [cls for cls in AutoDirective._registry.values() + if cls.can_document_member(obj, '', False, parent)] + if classes: + classes.sort(key=lambda cls: cls.priority) + return classes[-1] else: - return autodoc.DataDocumenter + return DataDocumenter # -- .. autosummary:: ---------------------------------------------------------- @@ -240,7 +232,7 @@ display_name = name.split('.')[-1] try: - obj, real_name = import_by_name(name, prefixes=prefixes) + real_name, obj, parent = import_by_name(name, prefixes=prefixes) except ImportError: self.warn('failed to import %s' % name) items.append((name, '', '', name)) @@ -248,7 +240,7 @@ # NB. using real_name here is important, since Documenters # handle module prefixes slightly differently - documenter = get_documenter(obj)(self, real_name) + documenter = get_documenter(obj, parent)(self, real_name) if not documenter.parse_name(): self.warn('failed to parse name %s' % real_name) items.append((display_name, '', '', real_name)) @@ -388,7 +380,8 @@ prefixed_name = '.'.join([prefix, name]) else: prefixed_name = name - return _import_by_name(prefixed_name), prefixed_name + obj, parent = _import_by_name(prefixed_name) + return prefixed_name, obj, parent except ImportError: tried.append(prefixed_name) raise ImportError('no module named %s' % ' or '.join(tried)) @@ -403,7 +396,8 @@ if modname: try: __import__(modname) - return getattr(sys.modules[modname], name_parts[-1]) + mod = sys.modules[modname] + return getattr(mod, name_parts[-1]), mod except (ImportError, IndexError, AttributeError): pass @@ -421,12 +415,14 @@ break if last_j < len(name_parts): + parent = None obj = sys.modules[modname] for obj_name in name_parts[last_j:]: + parent = obj obj = getattr(obj, obj_name) - return obj + return obj, parent else: - return sys.modules[modname] + return sys.modules[modname], None except (ValueError, ImportError, AttributeError, KeyError), e: raise ImportError(*e.args) @@ -449,7 +445,7 @@ prefixes = [None] #prefixes.insert(0, inliner.document.settings.env.currmodule) try: - obj, name = import_by_name(pnode['reftarget'], prefixes) + name, obj, parent = import_by_name(pnode['reftarget'], prefixes) except ImportError: content = pnode[0] r[0][0] = nodes.emphasis(rawtext, content[0].astext(), diff -Nru sphinx-1.0~hg20100604/sphinx/ext/coverage.py sphinx-1.0.7/sphinx/ext/coverage.py --- sphinx-1.0~hg20100604/sphinx/ext/coverage.py 2010-05-06 16:30:00.000000000 +0000 +++ sphinx-1.0.7/sphinx/ext/coverage.py 2011-01-04 09:00:04.000000000 +0000 @@ -6,7 +6,7 @@ Check Python modules and C API for coverage. Mostly written by Josip Dzolonga for the Google Highly Open Participation contest. - :copyright: Copyright 2007-2010 by the Sphinx team, see AUTHORS. + :copyright: Copyright 2007-2011 by the Sphinx team, see AUTHORS. :license: BSD, see LICENSE for details. """ diff -Nru sphinx-1.0~hg20100604/sphinx/ext/doctest.py sphinx-1.0.7/sphinx/ext/doctest.py --- sphinx-1.0~hg20100604/sphinx/ext/doctest.py 2010-05-06 16:30:00.000000000 +0000 +++ sphinx-1.0.7/sphinx/ext/doctest.py 2011-01-04 09:00:04.000000000 +0000 @@ -6,7 +6,7 @@ Mimic doctest by automatically executing code snippets and checking their results. - :copyright: Copyright 2007-2010 by the Sphinx team, see AUTHORS. + :copyright: Copyright 2007-2011 by the Sphinx team, see AUTHORS. :license: BSD, see LICENSE for details. """ diff -Nru sphinx-1.0~hg20100604/sphinx/ext/extlinks.py sphinx-1.0.7/sphinx/ext/extlinks.py --- sphinx-1.0~hg20100604/sphinx/ext/extlinks.py 2010-06-03 22:12:22.000000000 +0000 +++ sphinx-1.0.7/sphinx/ext/extlinks.py 2011-01-04 09:00:04.000000000 +0000 @@ -20,7 +20,7 @@ You can also give an explicit caption, e.g. :exmpl:`Foo <foo>`. - :copyright: Copyright 2007-2010 by the Sphinx team, see AUTHORS. + :copyright: Copyright 2007-2011 by the Sphinx team, see AUTHORS. :license: BSD, see LICENSE for details. """ diff -Nru sphinx-1.0~hg20100604/sphinx/ext/graphviz.py sphinx-1.0.7/sphinx/ext/graphviz.py --- sphinx-1.0~hg20100604/sphinx/ext/graphviz.py 2010-05-06 16:30:00.000000000 +0000 +++ sphinx-1.0.7/sphinx/ext/graphviz.py 2011-01-08 14:14:43.000000000 +0000 @@ -6,7 +6,7 @@ Allow graphviz-formatted graphs to be included in Sphinx-generated documents inline. - :copyright: Copyright 2007-2010 by the Sphinx team, see AUTHORS. + :copyright: Copyright 2007-2011 by the Sphinx team, see AUTHORS. :license: BSD, see LICENSE for details. """ @@ -236,7 +236,7 @@ raise nodes.SkipNode if fname is not None: - self.body.append('\\includegraphics{%s}' % fname) + self.body.append('\n\\includegraphics{%s}\n' % fname) raise nodes.SkipNode diff -Nru sphinx-1.0~hg20100604/sphinx/ext/ifconfig.py sphinx-1.0.7/sphinx/ext/ifconfig.py --- sphinx-1.0~hg20100604/sphinx/ext/ifconfig.py 2010-05-06 16:30:00.000000000 +0000 +++ sphinx-1.0.7/sphinx/ext/ifconfig.py 2011-01-04 09:00:04.000000000 +0000 @@ -16,7 +16,7 @@ namespace of the project configuration (that is, all variables from ``conf.py`` are available.) - :copyright: Copyright 2007-2010 by the Sphinx team, see AUTHORS. + :copyright: Copyright 2007-2011 by the Sphinx team, see AUTHORS. :license: BSD, see LICENSE for details. """ diff -Nru sphinx-1.0~hg20100604/sphinx/ext/inheritance_diagram.py sphinx-1.0.7/sphinx/ext/inheritance_diagram.py --- sphinx-1.0~hg20100604/sphinx/ext/inheritance_diagram.py 2010-05-06 16:30:00.000000000 +0000 +++ sphinx-1.0.7/sphinx/ext/inheritance_diagram.py 2011-01-15 09:06:08.000000000 +0000 @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -""" +r""" sphinx.ext.inheritance_diagram ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -32,7 +32,7 @@ The graph is inserted as a PNG+image map into HTML and a PDF in LaTeX. - :copyright: Copyright 2007-2010 by the Sphinx team, see AUTHORS. + :copyright: Copyright 2007-2011 by the Sphinx team, see AUTHORS. :license: BSD, see LICENSE for details. """ @@ -66,7 +66,7 @@ from all the way to the root "object", and then is able to generate a graphviz dot graph from them. """ - def __init__(self, class_names, currmodule, show_builtins=False): + def __init__(self, class_names, currmodule, show_builtins=False, parts=0): """ *class_names* is a list of child classes to show bases from. @@ -74,12 +74,11 @@ in the graph. """ self.class_names = class_names - self.classes = self._import_classes(class_names, currmodule) - self.all_classes = self._all_classes(self.classes) - if len(self.all_classes) == 0: + classes = self._import_classes(class_names, currmodule) + self.class_info = self._class_info(classes, show_builtins, parts) + if not self.class_info: raise InheritanceException('No classes found for ' 'inheritance diagram') - self.show_builtins = show_builtins def _import_class_or_module(self, name, currmodule): """ @@ -87,7 +86,7 @@ """ try: path, base = class_sig_re.match(name).groups() - except ValueError: + except (AttributeError, ValueError): raise InheritanceException('Invalid class or module %r specified ' 'for inheritance diagram' % name) @@ -129,36 +128,48 @@ 'not a class or module' % name) def _import_classes(self, class_names, currmodule): - """ - Import a list of classes. - """ + """Import a list of classes.""" classes = [] for name in class_names: classes.extend(self._import_class_or_module(name, currmodule)) return classes - def _all_classes(self, classes): - """ - Return a list of all classes that are ancestors of *classes*. + def _class_info(self, classes, show_builtins, parts): + """Return name and bases for all classes that are ancestors of + *classes*. + + *parts* gives the number of dotted name parts that is removed from the + displayed node names. """ all_classes = {} + builtins = __builtins__.values() def recurse(cls): - all_classes[cls] = None - for c in cls.__bases__: - if c not in all_classes: - recurse(c) + if not show_builtins and cls in builtins: + return + + nodename = self.class_name(cls, parts) + fullname = self.class_name(cls, 0) + + baselist = [] + all_classes[cls] = (nodename, fullname, baselist) + for base in cls.__bases__: + if not show_builtins and base in builtins: + continue + baselist.append(self.class_name(base, parts)) + if base not in all_classes: + recurse(base) for cls in classes: recurse(cls) - return all_classes.keys() + return all_classes.values() def class_name(self, cls, parts=0): - """ - Given a class object, return a fully-qualified name. This - works for things I've tested in matplotlib so far, but may not - be completely general. + """Given a class object, return a fully-qualified name. + + This works for things I've tested in matplotlib so far, but may not be + completely general. """ module = cls.__module__ if module == '__builtin__': @@ -174,7 +185,7 @@ """ Get all of the class names involved in the graph. """ - return [self.class_name(x) for x in self.all_classes] + return [fullname for (_, fullname, _) in self.class_info] # These are the default attrs for graphviz default_graph_attrs = { @@ -200,7 +211,7 @@ def _format_graph_attrs(self, attrs): return ''.join(['%s=%s;\n' % x for x in attrs.items()]) - def generate_dot(self, name, parts=0, urls={}, env=None, + def generate_dot(self, name, urls={}, env=None, graph_attrs={}, node_attrs={}, edge_attrs={}): """ Generate a graphviz dot graph from the classes that @@ -228,26 +239,17 @@ res.append('digraph %s {\n' % name) res.append(self._format_graph_attrs(g_attrs)) - for cls in self.all_classes: - if not self.show_builtins and cls in __builtins__.values(): - continue - - name = self.class_name(cls, parts) - + for name, fullname, bases in self.class_info: # Write the node this_node_attrs = n_attrs.copy() - url = urls.get(self.class_name(cls)) + url = urls.get(fullname) if url is not None: this_node_attrs['URL'] = '"%s"' % url res.append(' "%s" [%s];\n' % (name, self._format_node_attrs(this_node_attrs))) # Write the edges - for base in cls.__bases__: - if not self.show_builtins and base in __builtins__.values(): - continue - - base_name = self.class_name(base, parts) + for base_name in bases: res.append(' "%s" -> "%s" [%s];\n' % (base_name, name, self._format_node_attrs(e_attrs))) @@ -280,11 +282,15 @@ env = self.state.document.settings.env class_names = self.arguments[0].split() class_role = env.get_domain('py').role('class') + # Store the original content for use as a hash + node['parts'] = self.options.get('parts', 0) + node['content'] = ', '.join(class_names) # Create a graph starting with the list of classes try: - graph = InheritanceGraph(class_names, - env.temp_data.get('py:module')) + graph = InheritanceGraph( + class_names, env.temp_data.get('py:module'), + parts=node['parts']) except InheritanceException, err: return [node.document.reporter.warning(err.args[0], line=self.lineno)] @@ -300,9 +306,6 @@ # Store the graph object so we can use it to generate the # dot file later node['graph'] = graph - # Store the original content for use as a hash - node['parts'] = self.options.get('parts', 0) - node['content'] = ', '.join(class_names) return [node] @@ -316,7 +319,6 @@ image map. """ graph = node['graph'] - parts = node['parts'] graph_hash = get_graph_hash(node) name = 'inheritance%s' % graph_hash @@ -329,7 +331,7 @@ elif child.get('refid') is not None: urls[child['reftitle']] = '#' + child.get('refid') - dotcode = graph.generate_dot(name, parts, urls, env=self.builder.env) + dotcode = graph.generate_dot(name, urls, env=self.builder.env) render_dot_html(self, node, dotcode, [], 'inheritance', 'inheritance', alt='Inheritance diagram of ' + node['content']) raise nodes.SkipNode @@ -340,12 +342,11 @@ Output the graph for LaTeX. This will insert a PDF. """ graph = node['graph'] - parts = node['parts'] graph_hash = get_graph_hash(node) name = 'inheritance%s' % graph_hash - dotcode = graph.generate_dot(name, parts, env=self.builder.env, + dotcode = graph.generate_dot(name, env=self.builder.env, graph_attrs={'size': '"6.0,6.0"'}) render_dot_latex(self, node, dotcode, [], 'inheritance') raise nodes.SkipNode diff -Nru sphinx-1.0~hg20100604/sphinx/ext/__init__.py sphinx-1.0.7/sphinx/ext/__init__.py --- sphinx-1.0~hg20100604/sphinx/ext/__init__.py 2010-05-06 16:30:00.000000000 +0000 +++ sphinx-1.0.7/sphinx/ext/__init__.py 2011-01-04 09:00:04.000000000 +0000 @@ -5,6 +5,6 @@ Contains Sphinx features not activated by default. - :copyright: Copyright 2007-2010 by the Sphinx team, see AUTHORS. + :copyright: Copyright 2007-2011 by the Sphinx team, see AUTHORS. :license: BSD, see LICENSE for details. """ diff -Nru sphinx-1.0~hg20100604/sphinx/ext/intersphinx.py sphinx-1.0.7/sphinx/ext/intersphinx.py --- sphinx-1.0~hg20100604/sphinx/ext/intersphinx.py 2010-06-03 22:12:22.000000000 +0000 +++ sphinx-1.0.7/sphinx/ext/intersphinx.py 2011-01-04 09:00:04.000000000 +0000 @@ -20,7 +20,7 @@ also be specified individually, e.g. if the docs should be buildable without Internet access. - :copyright: Copyright 2007-2010 by the Sphinx team, see AUTHORS. + :copyright: Copyright 2007-2011 by the Sphinx team, see AUTHORS. :license: BSD, see LICENSE for details. """ @@ -109,7 +109,7 @@ if inv.find('://') != -1: f = urllib2.urlopen(inv) else: - f = open(path.join(app.srcdir, inv)) + f = open(path.join(app.srcdir, inv), 'rb') except Exception, err: app.warn('intersphinx inventory %r not fetchable due to ' '%s: %s' % (inv, err.__class__, err)) @@ -141,6 +141,8 @@ env = app.builder.env if not hasattr(env, 'intersphinx_cache'): env.intersphinx_cache = {} + env.intersphinx_inventory = {} + env.intersphinx_named_inventory = {} cache = env.intersphinx_cache update = False for key, value in app.config.intersphinx_mapping.iteritems(): @@ -191,10 +193,12 @@ return objtypes = ['%s:%s' % (domain, objtype) for objtype in objtypes] to_try = [(env.intersphinx_inventory, target)] + in_set = None if ':' in target: # first part may be the foreign doc set name setname, newtarget = target.split(':', 1) if setname in env.intersphinx_named_inventory: + in_set = setname to_try.append((env.intersphinx_named_inventory[setname], newtarget)) for inventory, target in to_try: for objtype in objtypes: @@ -203,11 +207,25 @@ proj, version, uri, dispname = inventory[objtype][target] newnode = nodes.reference('', '', internal=False, refuri=uri, reftitle='(in %s v%s)' % (proj, version)) - if dispname == '-': + if node.get('refexplicit'): + # use whatever title was given newnode.append(contnode) + elif dispname == '-': + # use whatever title was given, but strip prefix + title = contnode.astext() + if in_set and title.startswith(in_set+':'): + newnode.append(contnode.__class__(title[len(in_set)+1:], + title[len(in_set)+1:])) + else: + newnode.append(contnode) else: + # else use the given display name (used for :ref:) newnode.append(contnode.__class__(dispname, dispname)) return newnode + # at least get rid of the ':' in the target if no explicit title given + if in_set is not None and not node.get('refexplicit', True): + if len(contnode) and isinstance(contnode[0], nodes.Text): + contnode[0] = nodes.Text(newtarget, contnode[0].rawsource) def setup(app): diff -Nru sphinx-1.0~hg20100604/sphinx/ext/jsmath.py sphinx-1.0.7/sphinx/ext/jsmath.py --- sphinx-1.0~hg20100604/sphinx/ext/jsmath.py 2010-05-06 16:30:00.000000000 +0000 +++ sphinx-1.0.7/sphinx/ext/jsmath.py 2011-01-04 09:00:04.000000000 +0000 @@ -6,7 +6,7 @@ Set up everything for use of JSMath to display math in HTML via JavaScript. - :copyright: Copyright 2007-2010 by the Sphinx team, see AUTHORS. + :copyright: Copyright 2007-2011 by the Sphinx team, see AUTHORS. :license: BSD, see LICENSE for details. """ diff -Nru sphinx-1.0~hg20100604/sphinx/ext/mathbase.py sphinx-1.0.7/sphinx/ext/mathbase.py --- sphinx-1.0~hg20100604/sphinx/ext/mathbase.py 2010-05-06 16:30:00.000000000 +0000 +++ sphinx-1.0.7/sphinx/ext/mathbase.py 2011-01-15 08:44:17.000000000 +0000 @@ -5,7 +5,7 @@ Set up math support in source files and LaTeX/text output. - :copyright: Copyright 2007-2010 by the Sphinx team, see AUTHORS. + :copyright: Copyright 2007-2011 by the Sphinx team, see AUTHORS. :license: BSD, see LICENSE for details. """ @@ -69,6 +69,9 @@ node['nowrap'] = 'nowrap' in self.options node['docname'] = self.state.document.settings.env.docname ret = [node] + node.line = self.lineno + if hasattr(self, 'src'): + node.source = self.src if node['label']: tnode = nodes.target('', '', ids=['equation-' + node['label']]) self.state.document.note_explicit_target(tnode) diff -Nru sphinx-1.0~hg20100604/sphinx/ext/oldcmarkup.py sphinx-1.0.7/sphinx/ext/oldcmarkup.py --- sphinx-1.0~hg20100604/sphinx/ext/oldcmarkup.py 2010-06-03 22:12:22.000000000 +0000 +++ sphinx-1.0.7/sphinx/ext/oldcmarkup.py 2011-01-04 09:00:04.000000000 +0000 @@ -5,7 +5,7 @@ Extension for compatibility with old C markup (directives and roles). - :copyright: Copyright 2007-2010 by the Sphinx team, see AUTHORS. + :copyright: Copyright 2007-2011 by the Sphinx team, see AUTHORS. :license: BSD, see LICENSE for details. """ @@ -13,6 +13,10 @@ from sphinx.util.compat import Directive +_warned_oldcmarkup = False +WARNING_MSG = 'using old C markup; please migrate to new-style markup ' \ + '(e.g. c:function instead of cfunction), see ' \ + 'http://sphinx.pocoo.org/domains.html' class OldCDirective(Directive): has_content = True @@ -26,6 +30,9 @@ def run(self): env = self.state.document.settings.env + if not env.app._oldcmarkup_warned: + env.warn(env.docname, WARNING_MSG, self.lineno) + env.app._oldcmarkup_warned = True newname = 'c:' + self.name[1:] newdir = env.lookup_domain_element('directive', newname)[0] return newdir(newname, self.arguments, self.options, @@ -35,12 +42,18 @@ def old_crole(typ, rawtext, text, lineno, inliner, options={}, content=[]): env = inliner.document.settings.env + if not typ: + typ = env.config.default_role + if not env.app._oldcmarkup_warned: + env.warn(env.docname, WARNING_MSG) + env.app._oldcmarkup_warned = True 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._oldcmarkup_warned = False app.add_directive('cfunction', OldCDirective) app.add_directive('cmember', OldCDirective) app.add_directive('cmacro', OldCDirective) @@ -50,3 +63,4 @@ app.add_role('cfunc', old_crole) app.add_role('cmacro', old_crole) app.add_role('ctype', old_crole) + app.add_role('cmember', old_crole) diff -Nru sphinx-1.0~hg20100604/sphinx/ext/pngmath.py sphinx-1.0.7/sphinx/ext/pngmath.py --- sphinx-1.0~hg20100604/sphinx/ext/pngmath.py 2010-06-03 22:12:22.000000000 +0000 +++ sphinx-1.0.7/sphinx/ext/pngmath.py 2011-01-04 09:00:04.000000000 +0000 @@ -5,7 +5,7 @@ Render math in HTML via dvipng. - :copyright: Copyright 2007-2010 by the Sphinx team, see AUTHORS. + :copyright: Copyright 2007-2011 by the Sphinx team, see AUTHORS. :license: BSD, see LICENSE for details. """ diff -Nru sphinx-1.0~hg20100604/sphinx/ext/refcounting.py sphinx-1.0.7/sphinx/ext/refcounting.py --- sphinx-1.0~hg20100604/sphinx/ext/refcounting.py 2010-05-06 16:30:00.000000000 +0000 +++ sphinx-1.0.7/sphinx/ext/refcounting.py 2011-01-04 09:00:04.000000000 +0000 @@ -9,7 +9,7 @@ Usage: Set the `refcount_file` config value to the path to the reference count data file. - :copyright: Copyright 2007-2010 by the Sphinx team, see AUTHORS. + :copyright: Copyright 2007-2011 by the Sphinx team, see AUTHORS. :license: BSD, see LICENSE for details. """ diff -Nru sphinx-1.0~hg20100604/sphinx/ext/todo.py sphinx-1.0.7/sphinx/ext/todo.py --- sphinx-1.0~hg20100604/sphinx/ext/todo.py 2010-06-03 22:12:22.000000000 +0000 +++ sphinx-1.0.7/sphinx/ext/todo.py 2011-01-04 09:00:04.000000000 +0000 @@ -8,7 +8,7 @@ all todos of your project and lists them along with a backlink to the original location. - :copyright: Copyright 2007-2010 by the Sphinx team, see AUTHORS. + :copyright: Copyright 2007-2011 by the Sphinx team, see AUTHORS. :license: BSD, see LICENSE for details. """ diff -Nru sphinx-1.0~hg20100604/sphinx/ext/viewcode.py sphinx-1.0.7/sphinx/ext/viewcode.py --- sphinx-1.0~hg20100604/sphinx/ext/viewcode.py 2010-06-03 22:12:22.000000000 +0000 +++ sphinx-1.0.7/sphinx/ext/viewcode.py 2011-01-04 09:00:04.000000000 +0000 @@ -5,7 +5,7 @@ Add links to module code in Python object descriptions. - :copyright: Copyright 2007-2010 by the Sphinx team, see AUTHORS. + :copyright: Copyright 2007-2011 by the Sphinx team, see AUTHORS. :license: BSD, see LICENSE for details. """ @@ -47,10 +47,10 @@ for signode in objnode: if not isinstance(signode, addnodes.desc_signature): continue - modname = signode['module'] + modname = signode.get('module') if not modname: continue - fullname = signode['fullname'] + fullname = signode.get('fullname') if not has_tag(modname, fullname, env.docname): continue if fullname in names: @@ -104,7 +104,7 @@ # 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!) - maxindex = len(lines) + maxindex = len(lines) - 1 for name, docname in used.iteritems(): type, start, end = tags[name] backlink = urito(pagename, docname) + '#' + modname + '.' + name diff -Nru sphinx-1.0~hg20100604/sphinx/highlighting.py sphinx-1.0.7/sphinx/highlighting.py --- sphinx-1.0~hg20100604/sphinx/highlighting.py 2010-05-06 16:30:00.000000000 +0000 +++ sphinx-1.0.7/sphinx/highlighting.py 2011-01-04 09:00:04.000000000 +0000 @@ -5,7 +5,7 @@ Highlight code blocks using Pygments. - :copyright: Copyright 2007-2010 by the Sphinx team, see AUTHORS. + :copyright: Copyright 2007-2011 by the Sphinx team, see AUTHORS. :license: BSD, see LICENSE for details. """ @@ -207,7 +207,7 @@ lexer = lexers[lang] = get_lexer_by_name(lang) except ClassNotFound: if warn: - warn('Pygments lexer name %s is not known' % lang) + warn('Pygments lexer name %r is not known' % lang) return self.unhighlighted(source) else: raise @@ -240,7 +240,7 @@ # no HTML styles needed return '' if self.dest == 'html': - return self.fmter[0].get_style_defs() + return self.fmter[0].get_style_defs('.highlight') else: styledefs = self.fmter[0].get_style_defs() # workaround for Pygments < 0.12 diff -Nru sphinx-1.0~hg20100604/sphinx/__init__.py sphinx-1.0.7/sphinx/__init__.py --- sphinx-1.0~hg20100604/sphinx/__init__.py 2010-06-05 20:50:36.000000000 +0000 +++ sphinx-1.0.7/sphinx/__init__.py 2011-01-15 15:25:31.000000000 +0000 @@ -5,15 +5,15 @@ The Sphinx documentation toolchain. - :copyright: Copyright 2007-2010 by the Sphinx team, see AUTHORS. + :copyright: Copyright 2007-2011 by the Sphinx team, see AUTHORS. :license: BSD, see LICENSE for details. """ import sys from os import path -__version__ = '1.0b2+' -__released__ = '1.0b2' # used when Sphinx builds its own docs +__version__ = '1.0.7' +__released__ = '1.0.7' # used when Sphinx builds its own docs package_dir = path.abspath(path.dirname(__file__)) diff -Nru sphinx-1.0~hg20100604/sphinx/jinja2glue.py sphinx-1.0.7/sphinx/jinja2glue.py --- sphinx-1.0~hg20100604/sphinx/jinja2glue.py 2010-05-06 16:30:00.000000000 +0000 +++ sphinx-1.0.7/sphinx/jinja2glue.py 2011-01-15 13:16:57.000000000 +0000 @@ -5,7 +5,7 @@ Glue code for the jinja2 templating engine. - :copyright: Copyright 2007-2010 by the Sphinx team, see AUTHORS. + :copyright: Copyright 2007-2011 by the Sphinx team, see AUTHORS. :license: BSD, see LICENSE for details. """ @@ -35,6 +35,15 @@ return 'accesskey="%s"' % key return '' +class idgen(object): + def __init__(self): + self.id = 0 + def current(self): + return self.id + def next(self): + self.id += 1 + return self.id + class SphinxFileSystemLoader(FileSystemLoader): """FileSystemLoader subclass that is not so strict about '..' @@ -100,6 +109,7 @@ self.environment.filters['tobool'] = _tobool self.environment.globals['debug'] = contextfunction(pformat) self.environment.globals['accesskey'] = contextfunction(accesskey) + self.environment.globals['idgen'] = idgen if use_i18n: self.environment.install_gettext_translations( builder.app.translator) diff -Nru sphinx-1.0~hg20100604/sphinx/locale/bn/LC_MESSAGES/sphinx.js sphinx-1.0.7/sphinx/locale/bn/LC_MESSAGES/sphinx.js --- sphinx-1.0~hg20100604/sphinx/locale/bn/LC_MESSAGES/sphinx.js 1970-01-01 00:00:00.000000000 +0000 +++ sphinx-1.0.7/sphinx/locale/bn/LC_MESSAGES/sphinx.js 2011-01-04 09:00:04.000000000 +0000 @@ -0,0 +1 @@ +Documentation.addTranslations({"locale": "bn", "plural_expr": "(n != 1)", "messages": {"Search Results": "\u0985\u09a8\u09c1\u09b8\u09a8\u09cd\u09a7\u09be\u09a8\u09c7\u09b0 \u09ab\u09b2\u09be\u09ab\u09b2", "Preparing search...": "\u0985\u09a8\u09c1\u09b8\u09a8\u09cd\u09a7\u09be\u09a8\u09c7\u09b0 \u09aa\u09cd\u09b0\u09b8\u09cd\u09a4\u09c1\u09a4\u09bf \u099a\u09b2\u099b\u09c7...", "Your search did not match any documents. Please make sure that all words are spelled correctly and that you've selected enough categories.": "\u0986\u09aa\u09a8\u09be\u09b0 \u0985\u09a8\u09c1\u09b8\u09a8\u09cd\u09a7\u09be\u09a8\u09c7 \u0995\u09c7\u09be\u09a8 \u09ab\u09b2\u09be\u09ab\u09b2 \u09aa\u09be\u0993\u09df\u09be \u09af\u09be\u09df\u09a8\u09bf\u0964 \u0986\u09aa\u09a8\u09be\u09b0 \u0985\u09a8\u09c1\u09b8\u09a8\u09cd\u09a7\u09be\u09a8\u09c7\u09b0 \u09b6\u09ac\u09cd\u09a6\u0997\u09c1\u09b2\u09c7\u09be\u09b0 \u09b8\u09a0\u09bf\u0995 \u09ac\u09be\u09a8\u09be\u09a8 \u0993 \u09ac\u09bf\u09ad\u09be\u0997 \u09a8\u09bf\u09b0\u09cd\u09ac\u09be\u099a\u09a8 \u09a8\u09bf\u09b6\u09cd\u099a\u09bf\u09a4 \u0995\u09b0\u09c1\u09a8\u0964", "Search finished, found %s page(s) matching the search query.": "\u0985\u09a8\u09c1\u09b8\u09a8\u09cd\u09a7\u09be\u09a8 \u09b6\u09c7\u09b7 \u09b9\u09df\u09c7\u099b\u09c7, \u09ab\u09b2\u09be\u09ab\u09b2\u09c7 %s-\u099f\u09bf \u09aa\u09be\u09a4\u09be \u09aa\u09be\u0993\u09df\u09be \u0997\u09c7\u099b\u09c7\u0964", ", in ": ", -", "Permalink to this headline": "\u098f\u0987 \u09b6\u09bf\u09b0\u09c7\u09be\u09a8\u09be\u09ae\u09c7\u09b0 \u09aa\u09be\u09b0\u09cd\u09ae\u09be\u09b2\u09bf\u0999\u09cd\u0995", "Searching": "\u0985\u09a8\u09c1\u09b8\u09a8\u09cd\u09a7\u09be\u09a8 \u099a\u09b2\u099b\u09c7", "Permalink to this definition": "\u098f\u0987 \u09b8\u0982\u099c\u09cd\u099e\u09be\u09b0 \u09aa\u09be\u09b0\u09cd\u09ae\u09be\u09b2\u09bf\u0999\u09cd\u0995", "Hide Search Matches": "\u0985\u09a8\u09c1\u09b8\u09a8\u09cd\u09a7\u09be\u09a8\u09c7\u09b0 \u09ae\u09cd\u09af\u09be\u099a\u0997\u09c1\u09b2\u09c7\u09be \u09b2\u09c1\u0995\u09be\u09a8"}}); \ No newline at end of file Binary files /tmp/Rt1D5gzI2R/sphinx-1.0~hg20100604/sphinx/locale/bn/LC_MESSAGES/sphinx.mo and /tmp/0_5OtyEyzZ/sphinx-1.0.7/sphinx/locale/bn/LC_MESSAGES/sphinx.mo differ diff -Nru sphinx-1.0~hg20100604/sphinx/locale/bn/LC_MESSAGES/sphinx.po sphinx-1.0.7/sphinx/locale/bn/LC_MESSAGES/sphinx.po --- sphinx-1.0~hg20100604/sphinx/locale/bn/LC_MESSAGES/sphinx.po 1970-01-01 00:00:00.000000000 +0000 +++ sphinx-1.0.7/sphinx/locale/bn/LC_MESSAGES/sphinx.po 2011-01-04 09:00:04.000000000 +0000 @@ -0,0 +1,698 @@ +# Translations template 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.0pre/[?1034h2e1ab15e035e\n" +"Report-Msgid-Bugs-To: nasim.haque@gmail.com\n" +"POT-Creation-Date: 2009-11-08 16:28+0100\n" +"PO-Revision-Date: 2009-11-10 13:42+0100\n" +"Last-Translator: Nasimul Haque <nasim.haque@gmail.com>\n" +"Language-Team: Nasimul Haque <nasim.haque@gmail.com>\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:130 +#: sphinx/writers/latex.py:184 +#, python-format +msgid "%B %d, %Y" +msgstr "%B %d, %Y" + +#: sphinx/environment.py:348 +#: sphinx/themes/basic/genindex-single.html:2 +#: sphinx/themes/basic/genindex-split.html:2 +#: sphinx/themes/basic/genindex-split.html:5 +#: sphinx/themes/basic/genindex.html:2 +#: sphinx/themes/basic/genindex.html:5 +#: sphinx/themes/basic/genindex.html:48 +#: sphinx/themes/basic/layout.html:134 +#: sphinx/writers/latex.py:190 +msgid "Index" +msgstr "ইনডেক্স" + +#: sphinx/environment.py:349 +#: sphinx/writers/latex.py:189 +msgid "Module Index" +msgstr "মডিউল ইনডেক্স" + +#: sphinx/environment.py:350 +#: sphinx/themes/basic/defindex.html:16 +msgid "Search Page" +msgstr "অনুসন্ধান পাতা" + +#: sphinx/roles.py:167 +#, python-format +msgid "Python Enhancement Proposals!PEP %s" +msgstr "পাইথন উন্নয়ন পরামর্শ!PEP %s" + +#: sphinx/builders/changes.py:70 +msgid "Builtins" +msgstr "বিল্টইন সমূহ" + +#: sphinx/builders/changes.py:72 +msgid "Module level" +msgstr "মডিউল লেভেল" + +#: sphinx/builders/html.py:224 +#, python-format +msgid "%b %d, %Y" +msgstr "%b %d, %Y" + +#: sphinx/builders/html.py:243 +#: sphinx/themes/basic/defindex.html:21 +msgid "General Index" +msgstr "সাধারণ ইনডেক্স" + +#: sphinx/builders/html.py:243 +msgid "index" +msgstr "ইনডেক্স" + +#: sphinx/builders/html.py:247 +#: sphinx/builders/htmlhelp.py:220 +#: sphinx/builders/qthelp.py:133 +#: sphinx/themes/basic/defindex.html:19 +#: sphinx/themes/basic/modindex.html:2 +#: sphinx/themes/basic/modindex.html:13 +#: sphinx/themes/scrolls/modindex.html:2 +#: sphinx/themes/scrolls/modindex.html:13 +msgid "Global Module Index" +msgstr "গ্লোবাল মডিউল ইনডেক্স" + +#: sphinx/builders/html.py:248 +msgid "modules" +msgstr "মডিউল সমূহ" + +#: sphinx/builders/html.py:304 +msgid "next" +msgstr "পরবর্তী" + +#: sphinx/builders/html.py:313 +msgid "previous" +msgstr "পূর্ববর্তী" + +#: sphinx/builders/latex.py:162 +msgid " (in " +msgstr "(-" + +#: sphinx/directives/__init__.py:78 +#: sphinx/directives/__init__.py:79 +#: sphinx/directives/__init__.py:80 +#: sphinx/directives/__init__.py:81 +msgid "Raises" +msgstr "রেইজেস" + +#: sphinx/directives/__init__.py:82 +#: sphinx/directives/__init__.py:83 +#: sphinx/directives/__init__.py:84 +msgid "Variable" +msgstr "ভ্যারিয়েবল" + +#: sphinx/directives/__init__.py:85 +#: sphinx/directives/__init__.py:86 +#: sphinx/directives/__init__.py:92 +#: sphinx/directives/__init__.py:93 +msgid "Returns" +msgstr "রিটার্নস" + +#: sphinx/directives/__init__.py:94 +msgid "Return type" +msgstr "রিটার্ন টাইপ" + +#: sphinx/directives/__init__.py:169 +msgid "Parameter" +msgstr "প্যারামিটার" + +#: sphinx/directives/__init__.py:173 +msgid "Parameters" +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 "Author: " +msgstr "লেখক:" + +#: sphinx/directives/other.py:233 +msgid "See also" +msgstr "আরও দেখুন" + +#: sphinx/domains/c.py:124 +#, python-format +msgid "%s (C function)" +msgstr "%s (C ফাংশন)" + +#: sphinx/domains/c.py:126 +#, python-format +msgid "%s (C member)" +msgstr "%s (C মেম্বার)" + +#: sphinx/domains/c.py:128 +#, python-format +msgid "%s (C macro)" +msgstr "%s (C ম্যাক্রো)" + +#: sphinx/domains/c.py:130 +#, python-format +msgid "%s (C type)" +msgstr "%s (C টাইপ)" + +#: sphinx/domains/c.py:132 +#, python-format +msgid "%s (C variable)" +msgstr "%s (C ভ্যারিয়েবল)" + +#: sphinx/domains/c.py:162 +msgid "C function" +msgstr "C ফাংশন" + +#: sphinx/domains/c.py:163 +msgid "C member" +msgstr "C মেম্বার" + +#: sphinx/domains/c.py:164 +msgid "C macro" +msgstr "C ম্যাক্রো" + +#: sphinx/domains/c.py:165 +msgid "C type" +msgstr "C টাইপ" + +#: sphinx/domains/c.py:166 +msgid "C variable" +msgstr "C ভ্যারিয়েবল" + +#: sphinx/domains/python.py:186 +#, python-format +msgid "%s() (built-in function)" +msgstr "%s() (বিল্ট-ইন ফাংশন)" + +#: sphinx/domains/python.py:187 +#: sphinx/domains/python.py:244 +#: sphinx/domains/python.py:256 +#: sphinx/domains/python.py:269 +#, python-format +msgid "%s() (in module %s)" +msgstr "%s() (%s মডিউলে)" + +#: sphinx/domains/python.py:190 +#, python-format +msgid "%s (built-in variable)" +msgstr "%s (বিল্ট-ইন ভ্যারিয়েবল)" + +#: sphinx/domains/python.py:191 +#: sphinx/domains/python.py:282 +#, python-format +msgid "%s (in module %s)" +msgstr "%s (%s মডিউলে)" + +#: sphinx/domains/python.py:207 +#, python-format +msgid "%s (built-in class)" +msgstr "%s (বিল্ট-ইন ক্লাস)" + +#: sphinx/domains/python.py:208 +#, python-format +msgid "%s (class in %s)" +msgstr "%s (%s ক্লাসে)" + +#: sphinx/domains/python.py:248 +#, python-format +msgid "%s() (%s.%s method)" +msgstr "%s (%s.%s মেথড)" + +#: sphinx/domains/python.py:250 +#, python-format +msgid "%s() (%s method)" +msgstr "%s() (%s মেথড)" + +#: sphinx/domains/python.py:260 +#, python-format +msgid "%s() (%s.%s static method)" +msgstr "%s (%s.%s স্ট্যাটিক মেথড)" + +#: sphinx/domains/python.py:263 +#, python-format +msgid "%s() (%s static method)" +msgstr "%s() (%s স্ট্যাটিক মেথড)" + +#: sphinx/domains/python.py:273 +#, python-format +msgid "%s() (%s.%s class method)" +msgstr "%s() (%s.%s ক্লাস মেথড)" + +#: sphinx/domains/python.py:276 +#, python-format +msgid "%s() (%s class method)" +msgstr "%s() (%s ক্লাস মেথড)" + +#: sphinx/domains/python.py:286 +#, python-format +msgid "%s (%s.%s attribute)" +msgstr "%s (%s.%s এ্যট্রিবিউট)" + +#: sphinx/domains/python.py:288 +#, python-format +msgid "%s (%s attribute)" +msgstr "%s (%s এ্যট্রিবিউট)" + +#: sphinx/domains/python.py:334 +msgid "Platforms: " +msgstr "প্লাটফরম:" + +#: sphinx/domains/python.py:340 +#, python-format +msgid "%s (module)" +msgstr "%s (মডিউল)" + +#: sphinx/domains/python.py:396 +msgid "function" +msgstr "ফাংশন" + +#: sphinx/domains/python.py:397 +msgid "data" +msgstr "ডাটা" + +#: sphinx/domains/python.py:398 +msgid "class" +msgstr "ক্লাস" + +#: sphinx/domains/python.py:399 +#: sphinx/locale/__init__.py:161 +msgid "exception" +msgstr "এক্সেপশন" + +#: sphinx/domains/python.py:400 +msgid "method" +msgstr "মেথড" + +#: sphinx/domains/python.py:401 +msgid "attribute" +msgstr "এ্যট্রিবিউট" + +#: sphinx/domains/python.py:402 +#: sphinx/locale/__init__.py:157 +msgid "module" +msgstr "মডিউল" + +#: sphinx/domains/std.py:67 +#: sphinx/domains/std.py:83 +#, python-format +msgid "environment variable; %s" +msgstr "এনভায়রনমেন্ট ভ্যারিয়েবল; %s" + +#: sphinx/domains/std.py:156 +#, python-format +msgid "%scommand line option; %s" +msgstr "%sকমান্ড লাইন অপশন; %s" + +#: sphinx/domains/std.py:324 +msgid "glossary term" +msgstr "শব্দকোষ" + +#: sphinx/domains/std.py:325 +msgid "grammar token" +msgstr "ব্যকরণ টোকেন" + +#: sphinx/domains/std.py:326 +msgid "environment variable" +msgstr "এনভায়রনমেন্ট ভ্যারিয়েবল" + +#: sphinx/domains/std.py:327 +msgid "program option" +msgstr "প্রোগ্রাম অপশন" + +#: sphinx/ext/autodoc.py:892 +#, python-format +msgid " Bases: %s" +msgstr "বেস: %s" + +#: sphinx/ext/autodoc.py:925 +#, python-format +msgid "alias of :class:`%s`" +msgstr ":class:`%s` এর উপনাম" + +#: sphinx/ext/todo.py:40 +msgid "Todo" +msgstr "অসমাপ্ত কাজ" + +#: sphinx/ext/todo.py:98 +#, python-format +msgid "(The original entry is located in %s, line %d and can be found " +msgstr "(%s, %d লাইনে মূল অন্তর্ভুক্তিটি রয়েছে, যা পাওয়া যাবে" + +#: sphinx/ext/todo.py:104 +msgid "here" +msgstr "এখানে" + +#: sphinx/locale/__init__.py:138 +msgid "Attention" +msgstr "দৃষ্টি আকর্ষণ" + +#: sphinx/locale/__init__.py:139 +msgid "Caution" +msgstr "সতর্কীকরণ" + +#: sphinx/locale/__init__.py:140 +msgid "Danger" +msgstr "বিপজ্জনক" + +#: sphinx/locale/__init__.py:141 +msgid "Error" +msgstr "ভুল (এরর)" + +#: sphinx/locale/__init__.py:142 +msgid "Hint" +msgstr "আভাস" + +#: sphinx/locale/__init__.py:143 +msgid "Important" +msgstr "গুরুত্বপূর্ণ" + +#: sphinx/locale/__init__.py:144 +msgid "Note" +msgstr "নোট" + +#: sphinx/locale/__init__.py:145 +msgid "See Also" +msgstr "আরও দেখুন" + +#: sphinx/locale/__init__.py:146 +msgid "Tip" +msgstr "পরামর্শ" + +#: sphinx/locale/__init__.py:147 +msgid "Warning" +msgstr "সতর্কতা" + +#: sphinx/locale/__init__.py:151 +#, python-format +msgid "New in version %s" +msgstr "%s ভার্সনে নতুন" + +#: sphinx/locale/__init__.py:152 +#, python-format +msgid "Changed in version %s" +msgstr "%s ভার্সনে পরিবর্তিত" + +#: sphinx/locale/__init__.py:153 +#, python-format +msgid "Deprecated since version %s" +msgstr "%s ভার্সন থেকে ডেপ্রিকেটেড" + +#: sphinx/locale/__init__.py:158 +msgid "keyword" +msgstr "কিওয়ার্ড" + +#: sphinx/locale/__init__.py:159 +msgid "operator" +msgstr "অপারেটর" + +#: sphinx/locale/__init__.py:160 +msgid "object" +msgstr "অবজেক্ট" + +#: sphinx/locale/__init__.py:162 +msgid "statement" +msgstr "স্ট্যাটমেন্ট" + +#: sphinx/locale/__init__.py:163 +msgid "built-in function" +msgstr "বিল্ট-ইন ফাংশন" + +#: sphinx/themes/basic/defindex.html:2 +msgid "Overview" +msgstr "ভুমিকা" + +#: sphinx/themes/basic/defindex.html:11 +msgid "Indices and tables:" +msgstr "ইনডেক্স ও টেবিল সমূহ:" + +#: sphinx/themes/basic/defindex.html:14 +msgid "Complete Table of Contents" +msgstr "পূর্ণাঙ্গ সূচীপত্র" + +#: sphinx/themes/basic/defindex.html:15 +msgid "lists all sections and subsections" +msgstr "সকল অনুচ্ছেদ সমূহের তালিকা" + +#: sphinx/themes/basic/defindex.html:17 +msgid "search this documentation" +msgstr "এই সহায়িকাতে অনুসন্ধা করুন" + +#: sphinx/themes/basic/defindex.html:20 +msgid "quick access to all modules" +msgstr "সকল মডিউলে দ্রুত প্রবেশ" + +#: sphinx/themes/basic/defindex.html:22 +msgid "all functions, classes, terms" +msgstr "সকল ফাংশন, ক্লাস, টার্ম" + +#: sphinx/themes/basic/genindex-single.html:5 +#, python-format +msgid "Index – %(key)s" +msgstr "ইনডেক্স – %(key)s" + +#: sphinx/themes/basic/genindex-single.html:44 +#: sphinx/themes/basic/genindex-split.html:14 +#: sphinx/themes/basic/genindex-split.html:27 +#: sphinx/themes/basic/genindex.html:54 +msgid "Full index on one page" +msgstr "এক পাতায় সম্পূর্ণ ইনডেক্স" + +#: sphinx/themes/basic/genindex-split.html:7 +msgid "Index pages by letter" +msgstr "বর্ণানুসারে ইনডেক্স পাতা" + +#: sphinx/themes/basic/genindex-split.html:15 +msgid "can be huge" +msgstr "খুব বড় হতে পারে" + +#: sphinx/themes/basic/layout.html:10 +msgid "Navigation" +msgstr "নেভিগেশন" + +#: sphinx/themes/basic/layout.html:42 +msgid "Table Of Contents" +msgstr "সূচীপত্র" + +#: sphinx/themes/basic/layout.html:48 +msgid "Previous topic" +msgstr "পূর্ববর্তী টপিক" + +#: sphinx/themes/basic/layout.html:50 +msgid "previous chapter" +msgstr "পূর্ববর্তী অধ্যায়" + +#: sphinx/themes/basic/layout.html:53 +msgid "Next topic" +msgstr "পরবর্তী টপিক" + +#: sphinx/themes/basic/layout.html:55 +msgid "next chapter" +msgstr "পরবর্তী অধ্যায়" + +#: sphinx/themes/basic/layout.html:60 +msgid "This Page" +msgstr "এই পাতা" + +#: sphinx/themes/basic/layout.html:63 +msgid "Show Source" +msgstr "সোর্স দেখুন" + +#: sphinx/themes/basic/layout.html:73 +msgid "Quick search" +msgstr "দ্রুত অনুসন্ধান" + +#: sphinx/themes/basic/layout.html:76 +msgid "Go" +msgstr "যান" + +#: sphinx/themes/basic/layout.html:81 +msgid "Enter search terms or a module, class or function name." +msgstr "অনুসন্ধানের জন্য টার্ম, মডিউল, ক্লাস অথবা ফাংশনের নাম দিন।" + +#: sphinx/themes/basic/layout.html:122 +#, python-format +msgid "Search within %(docstitle)s" +msgstr "%(docstitle)s এর মধ্যে খুঁজুন" + +#: sphinx/themes/basic/layout.html:131 +msgid "About these documents" +msgstr "এই ডকুমেন্ট সম্পর্কে" + +#: sphinx/themes/basic/layout.html:137 +#: sphinx/themes/basic/search.html:2 +#: sphinx/themes/basic/search.html:5 +msgid "Search" +msgstr "অনুসন্ধান" + +#: sphinx/themes/basic/layout.html:140 +msgid "Copyright" +msgstr "কপিরাইট" + +#: sphinx/themes/basic/layout.html:187 +#: sphinx/themes/scrolls/layout.html:83 +#, python-format +msgid "© <a href=\"%(path)s\">Copyright</a> %(copyright)s." +msgstr "© <a href=\"%(path)s\">কপিরাইট</a> %(copyright)s." + +#: sphinx/themes/basic/layout.html:189 +#: sphinx/themes/scrolls/layout.html:85 +#, python-format +msgid "© Copyright %(copyright)s." +msgstr "© কপিরাইট %(copyright)s." + +#: sphinx/themes/basic/layout.html:193 +#: sphinx/themes/scrolls/layout.html:89 +#, python-format +msgid "Last updated on %(last_updated)s." +msgstr "%(last_updated)s সর্বশেষ পরিবর্তন করা হয়েছে।" + +#: sphinx/themes/basic/layout.html:196 +#: sphinx/themes/scrolls/layout.html:92 +#, python-format +msgid "Created using <a href=\"http://sphinx.pocoo.org/\">Sphinx</a> %(sphinx_version)s." +msgstr "<a href=\"http://sphinx.pocoo.org/\">Sphinx</a> %(sphinx_version)s দিয়ে তৈরী।" + +#: sphinx/themes/basic/modindex.html:36 +#: sphinx/themes/scrolls/modindex.html:37 +msgid "Deprecated" +msgstr "ডেপ্রিকেটেড" + +#: sphinx/themes/basic/opensearch.xml:4 +#, python-format +msgid "Search %(docstitle)s" +msgstr "%(docstitle)s-এ খুঁজুন" + +#: sphinx/themes/basic/search.html:9 +msgid "" +"Please activate JavaScript to enable the search\n" +" functionality." +msgstr "" +"অনুসন্ধান করার জন্য অনুগ্রহপূর্বক জাভাস্ক্রিপ্ট \n" +" সক্রিয় করুন।" + +#: sphinx/themes/basic/search.html:14 +msgid "" +"From here you can search these documents. Enter your search\n" +" words into the box below and click \"search\". Note that the search\n" +" function will automatically search for all of the words. Pages\n" +" containing fewer words won't appear in the result list." +msgstr "" +"এখান থেকে এই নথিগুলোতে আপনি অনুসন্ধান করতে পারবেন। \n" +" আপনার কাঙ্ক্ষিত শব্দসমূহ নিচের বাক্সে লিখুন এবং \"অনুসন্ধান\" বাটনে ক্লিক করুন।\n" +" উল্লেখ্য, সকল শব্দসমূহের উপস্থিতি নিয়ে অনুসন্ধান করা হবে। যেসব পাতায় সকল\n" +" শব্দ নেই সেগুলো বাদ দেয়া হবে।" + +#: sphinx/themes/basic/search.html:21 +msgid "search" +msgstr "খুঁজুন" + +#: sphinx/themes/basic/search.html:25 +#: sphinx/themes/basic/static/searchtools.js:473 +msgid "Search Results" +msgstr "অনুসন্ধানের ফলাফল" + +#: sphinx/themes/basic/search.html:27 +msgid "Your search did not match any results." +msgstr "আপনার অনুসন্ধানে কোন ফলাফল পাওয়া যায়নি।" + +#: sphinx/themes/basic/changes/frameset.html:5 +#: sphinx/themes/basic/changes/versionchanges.html:12 +#, python-format +msgid "Changes in Version %(version)s — %(docstitle)s" +msgstr "%(version)s — %(docstitle)s-এ পরিবর্তন সমূহ" + +#: sphinx/themes/basic/changes/rstsource.html:5 +#, python-format +msgid "%(filename)s — %(docstitle)s" +msgstr "%(filename)s — %(docstitle)s" + +#: 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:138 +#: sphinx/writers/html.py:462 +#: sphinx/writers/html.py:467 +msgid "Permalink to this headline" +msgstr "এই শিরোনামের পার্মালিঙ্ক" + +#: sphinx/themes/basic/static/doctools.js:144 +#: sphinx/writers/html.py:80 +msgid "Permalink to this definition" +msgstr "এই সংজ্ঞার পার্মালিঙ্ক" + +#: sphinx/themes/basic/static/doctools.js:173 +msgid "Hide Search Matches" +msgstr "অনুসন্ধানের ম্যাচগুলো লুকান" + +#: sphinx/themes/basic/static/searchtools.js:274 +msgid "Searching" +msgstr "অনুসন্ধান চলছে" + +#: sphinx/themes/basic/static/searchtools.js:279 +msgid "Preparing search..." +msgstr "অনুসন্ধানের প্রস্তুতি চলছে..." + +#: sphinx/themes/basic/static/searchtools.js:352 +msgid ", in " +msgstr ", -" + +#: sphinx/themes/basic/static/searchtools.js:475 +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:477 +#, python-format +msgid "Search finished, found %s page(s) matching the search query." +msgstr "অনুসন্ধান শেষ হয়েছে, ফলাফলে %s-টি পাতা পাওয়া গেছে।" + +#: sphinx/writers/latex.py:187 +msgid "Release" +msgstr "রিলিজ" + +#: sphinx/writers/latex.py:579 +msgid "Footnotes" +msgstr "পাদটীকা" + +#: sphinx/writers/latex.py:647 +msgid "continued from previous page" +msgstr "পূর্ববর্তী পাতা হতে চলমান" + +#: sphinx/writers/latex.py:652 +msgid "Continued on next page" +msgstr "পরবর্তী পাতাতে চলমান" + +#: sphinx/writers/text.py:166 +#, python-format +msgid "Platform: %s" +msgstr "প্লাটফরম: %s" + +#: sphinx/writers/text.py:428 +msgid "[image]" +msgstr "[ছবি]" + diff -Nru sphinx-1.0~hg20100604/sphinx/locale/da/LC_MESSAGES/sphinx.js sphinx-1.0.7/sphinx/locale/da/LC_MESSAGES/sphinx.js --- sphinx-1.0~hg20100604/sphinx/locale/da/LC_MESSAGES/sphinx.js 1970-01-01 00:00:00.000000000 +0000 +++ sphinx-1.0.7/sphinx/locale/da/LC_MESSAGES/sphinx.js 2011-01-04 09:00:04.000000000 +0000 @@ -0,0 +1 @@ +Documentation.addTranslations({"locale": "da", "plural_expr": "(n != 1)", "messages": {"Search Results": "S\u00f8geresultater", "Preparing search...": "Forbereder s\u00f8gning...", "Your search did not match any documents. Please make sure that all words are spelled correctly and that you've selected enough categories.": "Din s\u00f8gning gav ingen resultater. Kontroll\u00e9r venligst at alle ord er stavet korrekt, og at du har valgt nok kategorier.", "Search finished, found %s page(s) matching the search query.": "S\u00f8gningen fuldf\u00f8rt - fandt %s sider for denne s\u00f8gning.", ", in ": ", i ", "Permalink to this headline": "Permalink til denne overskrift", "Searching": "S\u00f8ger", "Permalink to this definition": "Permalink til denne definition", "Hide Search Matches": "Skjul s\u00f8geresultater"}}); \ No newline at end of file Binary files /tmp/Rt1D5gzI2R/sphinx-1.0~hg20100604/sphinx/locale/da/LC_MESSAGES/sphinx.mo and /tmp/0_5OtyEyzZ/sphinx-1.0.7/sphinx/locale/da/LC_MESSAGES/sphinx.mo differ diff -Nru sphinx-1.0~hg20100604/sphinx/locale/da/LC_MESSAGES/sphinx.po sphinx-1.0.7/sphinx/locale/da/LC_MESSAGES/sphinx.po --- sphinx-1.0~hg20100604/sphinx/locale/da/LC_MESSAGES/sphinx.po 1970-01-01 00:00:00.000000000 +0000 +++ sphinx-1.0.7/sphinx/locale/da/LC_MESSAGES/sphinx.po 2011-01-04 09:00:04.000000000 +0000 @@ -0,0 +1,678 @@ +# Translations template for Sphinx. +# Copyright (C) 2009 The Sphinx Team +# This file is distributed under the same license as the Sphinx project. +# +# Ask Hjorth Larsen <asklarsen@gmail.com>, 2010. +msgid "" +msgstr "" +"Project-Id-Version: Sphinx 1.0pre/[?1034h2e1ab15e035e\n" +"Report-Msgid-Bugs-To: EMAIL@ADDRESS\n" +"POT-Creation-Date: 2009-11-08 16:28+0100\n" +"PO-Revision-Date: 2010-06-03 23:47+0200\n" +"Last-Translator: Ask Hjorth Larsen <asklarsen@gmail.com>\n" +"Language-Team: Danish <dansk@dansk-gruppen.dk\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" + +# 21. april, 2010 +#: sphinx/environment.py:130 sphinx/writers/latex.py:184 +#, python-format +msgid "%B %d, %Y" +msgstr "%d. %B, %Y" + +#: sphinx/environment.py:348 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 "Indeks" + +#: sphinx/environment.py:349 sphinx/writers/latex.py:189 +msgid "Module Index" +msgstr "Modulindeks" + +# Ikke 'Søg på side' +#: sphinx/environment.py:350 sphinx/themes/basic/defindex.html:16 +msgid "Search Page" +msgstr "Søgeside" + +#: sphinx/roles.py:167 +#, python-format +msgid "Python Enhancement Proposals!PEP %s" +msgstr "Python Enhancement Proposals!PEP %s" + +#: sphinx/builders/changes.py:70 +msgid "Builtins" +msgstr "Indbyggede" + +#: sphinx/builders/changes.py:72 +msgid "Module level" +msgstr "Modulniveau" + +# Apr 21, 2010 +#: sphinx/builders/html.py:224 +#, python-format +msgid "%b %d, %Y" +msgstr "%d. %b, %Y" + +#: sphinx/builders/html.py:243 sphinx/themes/basic/defindex.html:21 +msgid "General Index" +msgstr "Generelt indeks" + +#: sphinx/builders/html.py:243 +msgid "index" +msgstr "indeks" + +#: sphinx/builders/html.py:247 sphinx/builders/htmlhelp.py:220 +#: sphinx/builders/qthelp.py:133 sphinx/themes/basic/defindex.html:19 +#: sphinx/themes/basic/modindex.html:2 sphinx/themes/basic/modindex.html:13 +#: sphinx/themes/scrolls/modindex.html:2 sphinx/themes/scrolls/modindex.html:13 +msgid "Global Module Index" +msgstr "Globalt modulindeks" + +#: sphinx/builders/html.py:248 +msgid "modules" +msgstr "moduler" + +#: sphinx/builders/html.py:304 +msgid "next" +msgstr "næste" + +#: sphinx/builders/html.py:313 +msgid "previous" +msgstr "forrige" + +#: sphinx/builders/latex.py:162 +msgid " (in " +msgstr " (i " + +#: sphinx/directives/__init__.py:78 sphinx/directives/__init__.py:79 +#: sphinx/directives/__init__.py:80 sphinx/directives/__init__.py:81 +msgid "Raises" +msgstr "Rejser" + +#: sphinx/directives/__init__.py:82 sphinx/directives/__init__.py:83 +#: sphinx/directives/__init__.py:84 +msgid "Variable" +msgstr "Variabel" + +#: sphinx/directives/__init__.py:85 sphinx/directives/__init__.py:86 +#: sphinx/directives/__init__.py:92 sphinx/directives/__init__.py:93 +msgid "Returns" +msgstr "Returnerer" + +#: sphinx/directives/__init__.py:94 +msgid "Return type" +msgstr "Returtype" + +#: sphinx/directives/__init__.py:169 +msgid "Parameter" +msgstr "Parameter" + +#: sphinx/directives/__init__.py:173 +msgid "Parameters" +msgstr "Parametre" + +#: sphinx/directives/other.py:127 +msgid "Section author: " +msgstr "Afsnitsforfatter: " + +#: sphinx/directives/other.py:129 +msgid "Module author: " +msgstr "Modulforfatter: " + +#: sphinx/directives/other.py:131 +msgid "Author: " +msgstr "Forfatter: " + +#: sphinx/directives/other.py:233 +msgid "See also" +msgstr "Se også" + +#: sphinx/domains/c.py:124 +#, python-format +msgid "%s (C function)" +msgstr "%s (C-funktion)" + +#: sphinx/domains/c.py:126 +#, python-format +msgid "%s (C member)" +msgstr "%s (C-medlem)" + +#: sphinx/domains/c.py:128 +#, python-format +msgid "%s (C macro)" +msgstr "%s (C-makro)" + +#: sphinx/domains/c.py:130 +#, python-format +msgid "%s (C type)" +msgstr "%s (C-type)" + +#: sphinx/domains/c.py:132 +#, python-format +msgid "%s (C variable)" +msgstr "%s (C-variabel)" + +#: sphinx/domains/c.py:162 +msgid "C function" +msgstr "C-funktion" + +#: sphinx/domains/c.py:163 +msgid "C member" +msgstr "C-medlem" + +#: sphinx/domains/c.py:164 +msgid "C macro" +msgstr "C-makro" + +#: sphinx/domains/c.py:165 +msgid "C type" +msgstr "C-type" + +#: sphinx/domains/c.py:166 +msgid "C variable" +msgstr "C-variabel" + +#: sphinx/domains/python.py:186 +#, python-format +msgid "%s() (built-in function)" +msgstr "%s() (indbygget funktion)" + +#: sphinx/domains/python.py:187 sphinx/domains/python.py:244 +#: sphinx/domains/python.py:256 sphinx/domains/python.py:269 +#, python-format +msgid "%s() (in module %s)" +msgstr "%s() (i modulet %s)" + +#: sphinx/domains/python.py:190 +#, python-format +msgid "%s (built-in variable)" +msgstr "%s (indbygget variabel)" + +#: sphinx/domains/python.py:191 sphinx/domains/python.py:282 +#, python-format +msgid "%s (in module %s)" +msgstr "%s (i modulet %s)" + +#: sphinx/domains/python.py:207 +#, python-format +msgid "%s (built-in class)" +msgstr "%s (indbygget klasse)" + +#: sphinx/domains/python.py:208 +#, python-format +msgid "%s (class in %s)" +msgstr "%s (klasse i %s)" + +#: sphinx/domains/python.py:248 +#, python-format +msgid "%s() (%s.%s method)" +msgstr "%s() (metode i %s.%s)" + +#: sphinx/domains/python.py:250 +#, python-format +msgid "%s() (%s method)" +msgstr "%s() (metode i %s)" + +#: sphinx/domains/python.py:260 +#, python-format +msgid "%s() (%s.%s static method)" +msgstr "%s() (statisk metode i %s.%s)" + +#: sphinx/domains/python.py:263 +#, python-format +msgid "%s() (%s static method)" +msgstr "%s() (statisk metode i %s)" + +#: sphinx/domains/python.py:273 +#, python-format +msgid "%s() (%s.%s class method)" +msgstr "%s() (klassemetode i %s.%s)" + +#: sphinx/domains/python.py:276 +#, python-format +msgid "%s() (%s class method)" +msgstr "%s() (klassemetode i %s)" + +#: sphinx/domains/python.py:286 +#, python-format +msgid "%s (%s.%s attribute)" +msgstr "%s (attribut i %s.%s)" + +#: sphinx/domains/python.py:288 +#, python-format +msgid "%s (%s attribute)" +msgstr "%s (attribut i %s)" + +#: sphinx/domains/python.py:334 +msgid "Platforms: " +msgstr "Platforme: " + +#: sphinx/domains/python.py:340 +#, python-format +msgid "%s (module)" +msgstr "%s (modul)" + +#: sphinx/domains/python.py:396 +msgid "function" +msgstr "funktion" + +#: sphinx/domains/python.py:397 +msgid "data" +msgstr "data" + +#: sphinx/domains/python.py:398 +msgid "class" +msgstr "klasse" + +#: sphinx/domains/python.py:399 sphinx/locale/__init__.py:161 +msgid "exception" +msgstr "undtagelse" + +#: sphinx/domains/python.py:400 +msgid "method" +msgstr "metode" + +#: sphinx/domains/python.py:401 +msgid "attribute" +msgstr "attribut" + +#: sphinx/domains/python.py:402 sphinx/locale/__init__.py:157 +msgid "module" +msgstr "modul" + +#: sphinx/domains/std.py:67 sphinx/domains/std.py:83 +#, python-format +msgid "environment variable; %s" +msgstr "miljøvariabel; %s" + +#: sphinx/domains/std.py:156 +#, python-format +msgid "%scommand line option; %s" +msgstr "%skommandolinjetilvalg; %s" + +#: sphinx/domains/std.py:324 +msgid "glossary term" +msgstr "begreb i ordliste" + +#: sphinx/domains/std.py:325 +msgid "grammar token" +msgstr "grammatisk element" + +#: sphinx/domains/std.py:326 +msgid "environment variable" +msgstr "miljøvariabel" + +#: sphinx/domains/std.py:327 +msgid "program option" +msgstr "programtilvalg" + +#: sphinx/ext/autodoc.py:892 +#, python-format +msgid " Bases: %s" +msgstr " Baser: %s" + +#: sphinx/ext/autodoc.py:925 +#, python-format +msgid "alias of :class:`%s`" +msgstr "alias for :class:`%s`" + +#: sphinx/ext/todo.py:40 +msgid "Todo" +msgstr "Todo" + +#: sphinx/ext/todo.py:98 +#, python-format +msgid "(The original entry is located in %s, line %d and can be found " +msgstr "(Det oprindelige punkt befinder sig i %s, linje %d, og kan findes " + +#: sphinx/ext/todo.py:104 +msgid "here" +msgstr "her" + +#: sphinx/locale/__init__.py:138 +msgid "Attention" +msgstr "Vær opmærksom" + +#: sphinx/locale/__init__.py:139 +msgid "Caution" +msgstr "Forsigtig" + +#: sphinx/locale/__init__.py:140 +msgid "Danger" +msgstr "Fare" + +#: sphinx/locale/__init__.py:141 +msgid "Error" +msgstr "Fejl" + +#: sphinx/locale/__init__.py:142 +msgid "Hint" +msgstr "Fif" + +#: sphinx/locale/__init__.py:143 +msgid "Important" +msgstr "Vigtigt" + +#: sphinx/locale/__init__.py:144 +msgid "Note" +msgstr "Bemærk" + +#: sphinx/locale/__init__.py:145 +msgid "See Also" +msgstr "Se også" + +#: sphinx/locale/__init__.py:146 +msgid "Tip" +msgstr "Tip" + +#: sphinx/locale/__init__.py:147 +msgid "Warning" +msgstr "Advarsel" + +#: sphinx/locale/__init__.py:151 +#, python-format +msgid "New in version %s" +msgstr "Ny i version %s" + +#: sphinx/locale/__init__.py:152 +#, python-format +msgid "Changed in version %s" +msgstr "Ændret i version %s" + +#: sphinx/locale/__init__.py:153 +#, python-format +msgid "Deprecated since version %s" +msgstr "Deprecieret siden version %s" + +#: sphinx/locale/__init__.py:158 +msgid "keyword" +msgstr "nøgleord" + +#: sphinx/locale/__init__.py:159 +msgid "operator" +msgstr "operator" + +#: sphinx/locale/__init__.py:160 +msgid "object" +msgstr "objekt" + +#: sphinx/locale/__init__.py:162 +msgid "statement" +msgstr "erklæring" + +#: sphinx/locale/__init__.py:163 +msgid "built-in function" +msgstr "indbygget funktion" + +#: sphinx/themes/basic/defindex.html:2 +msgid "Overview" +msgstr "Oversigt" + +#: sphinx/themes/basic/defindex.html:11 +msgid "Indices and tables:" +msgstr "Indeks og tabeller:" + +#: sphinx/themes/basic/defindex.html:14 +msgid "Complete Table of Contents" +msgstr "Fuldstændig indholdsfortegnelse" + +#: sphinx/themes/basic/defindex.html:15 +msgid "lists all sections and subsections" +msgstr "viser alle afsnit og underafsnit" + +#: sphinx/themes/basic/defindex.html:17 +msgid "search this documentation" +msgstr "søg i denne dokumentation" + +#: sphinx/themes/basic/defindex.html:20 +msgid "quick access to all modules" +msgstr "hurtig adgang til alle moduler" + +#: sphinx/themes/basic/defindex.html:22 +msgid "all functions, classes, terms" +msgstr "alle funktioner, klasser, begreber" + +#: sphinx/themes/basic/genindex-single.html:5 +#, python-format +msgid "Index – %(key)s" +msgstr "Indeks – %(key)s" + +#: sphinx/themes/basic/genindex-single.html:44 +#: sphinx/themes/basic/genindex-split.html:14 +#: sphinx/themes/basic/genindex-split.html:27 +#: sphinx/themes/basic/genindex.html:54 +msgid "Full index on one page" +msgstr "Fuldt indeks på én side" + +#: sphinx/themes/basic/genindex-split.html:7 +msgid "Index pages by letter" +msgstr "Indeksér sider efter bogstav" + +# refererer til indeks +#: sphinx/themes/basic/genindex-split.html:15 +msgid "can be huge" +msgstr "kan være enormt" + +#: sphinx/themes/basic/layout.html:10 +msgid "Navigation" +msgstr "Navigation" + +#: sphinx/themes/basic/layout.html:42 +msgid "Table Of Contents" +msgstr "Indholdsfortegnelse" + +#: sphinx/themes/basic/layout.html:48 +msgid "Previous topic" +msgstr "Forrige emne" + +#: sphinx/themes/basic/layout.html:50 +msgid "previous chapter" +msgstr "forrige kapitel" + +#: sphinx/themes/basic/layout.html:53 +msgid "Next topic" +msgstr "Næste emne" + +#: sphinx/themes/basic/layout.html:55 +msgid "next chapter" +msgstr "næste kapitel" + +#: sphinx/themes/basic/layout.html:60 +msgid "This Page" +msgstr "Denne side" + +#: sphinx/themes/basic/layout.html:63 +msgid "Show Source" +msgstr "Vis kilde" + +#: sphinx/themes/basic/layout.html:73 +msgid "Quick search" +msgstr "Hurtig søgning" + +# Referencen fra layout.html:76 er til en søgeknap +#: sphinx/themes/basic/layout.html:76 +msgid "Go" +msgstr "Søg" + +#: sphinx/themes/basic/layout.html:81 +msgid "Enter search terms or a module, class or function name." +msgstr "Indtast søgeord eller navnet på et modul, en klasse eller en funktion." + +#: sphinx/themes/basic/layout.html:122 +#, python-format +msgid "Search within %(docstitle)s" +msgstr "Søg i %(docstitle)s" + +#: sphinx/themes/basic/layout.html:131 +msgid "About these documents" +msgstr "Om disse dokumenter" + +#: sphinx/themes/basic/layout.html:137 sphinx/themes/basic/search.html:2 +#: sphinx/themes/basic/search.html:5 +msgid "Search" +msgstr "Søg" + +#: sphinx/themes/basic/layout.html:140 +msgid "Copyright" +msgstr "Ophavsret" + +#: sphinx/themes/basic/layout.html:187 sphinx/themes/scrolls/layout.html:83 +#, python-format +msgid "© <a href=\"%(path)s\">Copyright</a> %(copyright)s." +msgstr "© <a href=\"%(path)s\">Ophavsret</a> %(copyright)s." + +#: sphinx/themes/basic/layout.html:189 sphinx/themes/scrolls/layout.html:85 +#, python-format +msgid "© Copyright %(copyright)s." +msgstr "© Ophavsret %(copyright)s." + +# datoformatet passer ikke med "den %(last_updated)s" +#: sphinx/themes/basic/layout.html:193 sphinx/themes/scrolls/layout.html:89 +#, python-format +msgid "Last updated on %(last_updated)s." +msgstr "Sidst opdateret %(last_updated)s." + +#: sphinx/themes/basic/layout.html:196 sphinx/themes/scrolls/layout.html:92 +#, python-format +msgid "" +"Created using <a href=\"http://sphinx.pocoo.org/\">Sphinx</a> " +"%(sphinx_version)s." +msgstr "Bygget med <a href=\"http://sphinx.pocoo.org/\">Sphinx</a> %(sphinx_version)s." + +#: sphinx/themes/basic/modindex.html:36 sphinx/themes/scrolls/modindex.html:37 +msgid "Deprecated" +msgstr "Deprecieret" + +#: sphinx/themes/basic/opensearch.xml:4 +#, python-format +msgid "Search %(docstitle)s" +msgstr "Søg i %(docstitle)s" + +#: sphinx/themes/basic/search.html:9 +msgid "" +"Please activate JavaScript to enable the search\n" +" functionality." +msgstr "" +"Aktivér venligst JavaScript for at aktivere\n" +" søgefunktionalitet." + +#: sphinx/themes/basic/search.html:14 +msgid "" +"From here you can search these documents. Enter your search\n" +" words into the box below and click \"search\". Note that the search\n" +" function will automatically search for all of the words. Pages\n" +" containing fewer words won't appear in the result list." +msgstr "" +"Her fra kan du søge i disse dokumenter. Indtast dine søgeord\n" +" i boksen nedenfor og klik på \"søg\". Bemærk at søgefunktionen\n" +" automatisk vil søge på alle ordene. Sider, der indeholder\n" +" færre ord, vil ikke indgå i resultaterne." + +#: sphinx/themes/basic/search.html:21 +msgid "search" +msgstr "søg" + +#: sphinx/themes/basic/search.html:25 +#: sphinx/themes/basic/static/searchtools.js:473 +msgid "Search Results" +msgstr "Søgeresultater" + +#: sphinx/themes/basic/search.html:27 +msgid "Your search did not match any results." +msgstr "Din søgning gav ingen resultater." + +#: sphinx/themes/basic/changes/frameset.html:5 +#: sphinx/themes/basic/changes/versionchanges.html:12 +#, python-format +msgid "Changes in Version %(version)s — %(docstitle)s" +msgstr "Ændringer i version %(version)s — %(docstitle)s" + +#: sphinx/themes/basic/changes/rstsource.html:5 +#, python-format +msgid "%(filename)s — %(docstitle)s" +msgstr "%(filename)s — %(docstitle)s" + +#: sphinx/themes/basic/changes/versionchanges.html:17 +#, python-format +msgid "Automatically generated list of changes in version %(version)s" +msgstr "Automatisk oprettet liste af ændringer i version %(version)s" + +#: sphinx/themes/basic/changes/versionchanges.html:18 +msgid "Library changes" +msgstr "Biblioteksændringer" + +#: sphinx/themes/basic/changes/versionchanges.html:23 +msgid "C API changes" +msgstr "Ændringer i C-API" + +#: sphinx/themes/basic/changes/versionchanges.html:25 +msgid "Other changes" +msgstr "Andre ændringer" + +#: sphinx/themes/basic/static/doctools.js:138 sphinx/writers/html.py:462 +#: sphinx/writers/html.py:467 +msgid "Permalink to this headline" +msgstr "Permalink til denne overskrift" + +#: sphinx/themes/basic/static/doctools.js:144 sphinx/writers/html.py:80 +msgid "Permalink to this definition" +msgstr "Permalink til denne definition" + +#: sphinx/themes/basic/static/doctools.js:173 +msgid "Hide Search Matches" +msgstr "Skjul søgeresultater" + +#: sphinx/themes/basic/static/searchtools.js:274 +msgid "Searching" +msgstr "Søger" + +#: sphinx/themes/basic/static/searchtools.js:279 +msgid "Preparing search..." +msgstr "Forbereder søgning..." + +#: sphinx/themes/basic/static/searchtools.js:352 +msgid ", in " +msgstr ", i " + +#: sphinx/themes/basic/static/searchtools.js:475 +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 "Din søgning gav ingen resultater. Kontrollér venligst at alle ord er stavet korrekt, og at du har valgt nok kategorier." + +#: sphinx/themes/basic/static/searchtools.js:477 +#, python-format +msgid "Search finished, found %s page(s) matching the search query." +msgstr "Søgningen fuldført - fandt %s sider for denne søgning." + +#: sphinx/writers/latex.py:187 +msgid "Release" +msgstr "Udgave" + +#: sphinx/writers/latex.py:579 +msgid "Footnotes" +msgstr "Fodnoter" + +#: sphinx/writers/latex.py:647 +msgid "continued from previous page" +msgstr "fortsat fra forrige side" + +#: sphinx/writers/latex.py:652 +msgid "Continued on next page" +msgstr "Fortsættes på næste side" + +#: sphinx/writers/text.py:166 +#, python-format +msgid "Platform: %s" +msgstr "Platform: %s" + +#: sphinx/writers/text.py:428 +msgid "[image]" +msgstr "[billede]" + diff -Nru sphinx-1.0~hg20100604/sphinx/locale/__init__.py sphinx-1.0.7/sphinx/locale/__init__.py --- sphinx-1.0~hg20100604/sphinx/locale/__init__.py 2010-06-03 22:12:22.000000000 +0000 +++ sphinx-1.0.7/sphinx/locale/__init__.py 2011-01-04 09:00:04.000000000 +0000 @@ -5,7 +5,7 @@ Locale utilities. - :copyright: Copyright 2007-2010 by the Sphinx team, see AUTHORS. + :copyright: Copyright 2007-2011 by the Sphinx team, see AUTHORS. :license: BSD, see LICENSE for details. """ import gettext diff -Nru sphinx-1.0~hg20100604/sphinx/locale/lt/LC_MESSAGES/sphinx.js sphinx-1.0.7/sphinx/locale/lt/LC_MESSAGES/sphinx.js --- sphinx-1.0~hg20100604/sphinx/locale/lt/LC_MESSAGES/sphinx.js 1970-01-01 00:00:00.000000000 +0000 +++ sphinx-1.0.7/sphinx/locale/lt/LC_MESSAGES/sphinx.js 2011-01-04 09:00:04.000000000 +0000 @@ -0,0 +1 @@ +Documentation.addTranslations({"locale": "lt", "plural_expr": "(n%10==1 && n%100!=11 ? 0 : n%10>=2 && (n%100<10 || n%100>=20) ? 1 : 2)", "messages": {"Search Results": "Paie\u0161kos rezultatai", "Preparing search...": "Ruo\u0161iama paie\u0161ka...", "Your search did not match any documents. Please make sure that all words are spelled correctly and that you've selected enough categories.": "J\u016bs\u0173 paie\u0161ka neatitiko joki\u0173 dokument\u0173. Pra\u0161om patikrinti ar visi \u017eod\u017eiai teisingai \u012fvesti ir ar pasirinkote pakankamai kategorij\u0173.", "Search finished, found %s page(s) matching the search query.": "Paie\u0161ka baigta, paie\u0161kos rezultatus atitiko %s puslapis(-iai,-i\u0173)", ", in ": ", kuris yra ", "Expand sidebar": "I\u0161pl\u0117sti \u0161onin\u0119 juost\u0105", "Permalink to this headline": "Nuoroda \u012f \u0161i\u0105 antra\u0161t\u0119", "Searching": "Ie\u0161koma", "Collapse sidebar": "Pasl\u0117pti \u0161onin\u0119 juost\u0105", "Permalink to this definition": "Nuoroda \u012f \u0161\u012f apibr\u0117\u017eim\u0105", "Hide Search Matches": "Pasl\u0117pti paie\u0161kos rezultatus"}}); \ No newline at end of file Binary files /tmp/Rt1D5gzI2R/sphinx-1.0~hg20100604/sphinx/locale/lt/LC_MESSAGES/sphinx.mo and /tmp/0_5OtyEyzZ/sphinx-1.0.7/sphinx/locale/lt/LC_MESSAGES/sphinx.mo differ diff -Nru sphinx-1.0~hg20100604/sphinx/locale/lt/LC_MESSAGES/sphinx.po sphinx-1.0.7/sphinx/locale/lt/LC_MESSAGES/sphinx.po --- sphinx-1.0~hg20100604/sphinx/locale/lt/LC_MESSAGES/sphinx.po 1970-01-01 00:00:00.000000000 +0000 +++ sphinx-1.0.7/sphinx/locale/lt/LC_MESSAGES/sphinx.po 2011-01-04 09:00:04.000000000 +0000 @@ -0,0 +1,770 @@ +# Lithuanian translations for Sphinx. +# This file is distributed under the same license as the Sphinx project. +# DALIUS DOBRAVOLSKAS <DALIUS@SANDBOX.LT>, 2010. +# +msgid "" +msgstr "" +"Project-Id-Version: Sphinx 1.0pre/8b971dbc7d36\n" +"Report-Msgid-Bugs-To: dalius@sandbox.lt\n" +"POT-Creation-Date: 2010-05-24 23:53+0200\n" +"PO-Revision-Date: 2010-06-19 12:02+0300\n" +"Last-Translator: Dalius Dobravolskas <dalius@sandbox.lt>\n" +"Plural-Forms: nplurals=3; plural=(n%10==1 && n%100!=11 ? 0 : n%10>=2 && " +"(n%100<10 || n%100>=20) ? 1 : 2)\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=utf-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Generated-By: Babel 0.9.5\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 "" + +#: sphinx/builders/changes.py:72 +msgid "Builtins" +msgstr "Įtaisytieji" + +#: sphinx/builders/changes.py:74 +msgid "Module level" +msgstr "Modulio lygis" + +#: 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 "Bendras indeksas" + +#: sphinx/builders/html.py:285 +msgid "index" +msgstr "indeksas" + +#: sphinx/builders/html.py:345 +msgid "next" +msgstr "kitas" + +#: sphinx/builders/html.py:354 +msgid "previous" +msgstr "praeitas" + +#: sphinx/builders/latex.py:151 +msgid " (in " +msgstr " (kuris yra " + +#: sphinx/directives/other.py:127 +msgid "Section author: " +msgstr "Skyriaus autorius: " + +#: sphinx/directives/other.py:129 +msgid "Module author: " +msgstr "Modulio autorius: " + +#: sphinx/directives/other.py:131 +msgid "Code author: " +msgstr "Kodo autorius: " + +#: sphinx/directives/other.py:133 +msgid "Author: " +msgstr "Autorius: " + +#: sphinx/directives/other.py:238 +msgid "See also" +msgstr "Taip pat žiūrėkite" + +#: 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 "Parametrai" + +#: sphinx/domains/c.py:54 sphinx/domains/javascript.py:137 +#: sphinx/domains/python.py:59 +msgid "Returns" +msgstr "Grąžinamos reikšmės" + +#: sphinx/domains/c.py:56 sphinx/domains/python.py:61 +msgid "Return type" +msgstr "Grąžinamos reikšmės tipas" + +#: 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 narys)" + +#: sphinx/domains/c.py:137 +#, python-format +msgid "%s (C macro)" +msgstr "%s (C makrokomanda)" + +#: sphinx/domains/c.py:139 +#, python-format +msgid "%s (C type)" +msgstr "%s (C tipas)" + +#: sphinx/domains/c.py:141 +#, python-format +msgid "%s (C variable)" +msgstr "%s (C kintamasis)" + +#: 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 "narys" + +#: sphinx/domains/c.py:173 +msgid "macro" +msgstr "makrokomanda" + +#: sphinx/domains/c.py:174 sphinx/domains/cpp.py:1033 +msgid "type" +msgstr "tipas" + +#: sphinx/domains/c.py:175 +msgid "variable" +msgstr "kintamasis" + +#: sphinx/domains/cpp.py:876 +#, python-format +msgid "%s (C++ class)" +msgstr "" + +#: sphinx/domains/cpp.py:891 +#, python-format +msgid "%s (C++ type)" +msgstr "%s (C++ tipas)" + +#: sphinx/domains/cpp.py:910 +#, python-format +msgid "%s (C++ member)" +msgstr "%s (C++ narys)" + +#: 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 "klasė" + +#: sphinx/domains/javascript.py:117 sphinx/domains/python.py:221 +#, python-format +msgid "%s() (built-in function)" +msgstr "%s() (itaisytoji funkcija)" + +#: sphinx/domains/javascript.py:118 sphinx/domains/python.py:285 +#, python-format +msgid "%s() (%s method)" +msgstr "%s() (%s metodas)" + +#: sphinx/domains/javascript.py:120 +#, python-format +msgid "%s (global variable or constant)" +msgstr "%s (globalus kintamasis arba konstanta)" + +#: sphinx/domains/javascript.py:122 sphinx/domains/python.py:323 +#, python-format +msgid "%s (%s attribute)" +msgstr "%s (%s atributas)" + +#: sphinx/domains/javascript.py:131 +msgid "Arguments" +msgstr "Argumentais" + +#: sphinx/domains/javascript.py:134 +msgid "Throws" +msgstr "Išmeta" + +#: sphinx/domains/javascript.py:167 sphinx/domains/python.py:498 +msgid "data" +msgstr "duomenys" + +#: sphinx/domains/javascript.py:168 sphinx/domains/python.py:504 +msgid "attribute" +msgstr "atribudas" + +#: sphinx/domains/python.py:53 +msgid "Variables" +msgstr "Kintamieji" + +#: sphinx/domains/python.py:56 +msgid "Raises" +msgstr "Sukelia" + +#: 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() (modulyje %s)" + +#: sphinx/domains/python.py:225 +#, python-format +msgid "%s (built-in variable)" +msgstr "%s (įtaisytasis kintamasis)" + +#: sphinx/domains/python.py:226 sphinx/domains/python.py:317 +#, python-format +msgid "%s (in module %s)" +msgstr "%s (modulje %s)" + +#: sphinx/domains/python.py:242 +#, python-format +msgid "%s (built-in class)" +msgstr "%s (įtaisytoji klasė)" + +#: sphinx/domains/python.py:243 +#, python-format +msgid "%s (class in %s)" +msgstr "%s (klasė iš %s)" + +#: sphinx/domains/python.py:283 +#, python-format +msgid "%s() (%s.%s method)" +msgstr "%s() (%s.%s metodas)" + +#: sphinx/domains/python.py:295 +#, python-format +msgid "%s() (%s.%s static method)" +msgstr "%s() (%s.%s statinis metodas)" + +#: sphinx/domains/python.py:298 +#, python-format +msgid "%s() (%s static method)" +msgstr "%s() (%s statinis metodas)" + +#: sphinx/domains/python.py:308 +#, python-format +msgid "%s() (%s.%s class method)" +msgstr "%s() (%s.%s klasės metodas)" + +#: sphinx/domains/python.py:311 +#, python-format +msgid "%s() (%s class method)" +msgstr "%s() (%s klasės metodas)" + +#: sphinx/domains/python.py:321 +#, python-format +msgid "%s (%s.%s attribute)" +msgstr "%s (%s.%s atributas)" + +#: sphinx/domains/python.py:366 +msgid "Platforms: " +msgstr "Platformos: " + +#: sphinx/domains/python.py:372 +#, python-format +msgid "%s (module)" +msgstr "%s (modulis)" + +#: sphinx/domains/python.py:429 +msgid "Python Module Index" +msgstr "" + +#: sphinx/domains/python.py:430 +msgid "modules" +msgstr "moduliai" + +#: sphinx/domains/python.py:475 +msgid "Deprecated" +msgstr "Atmestas" + +#: sphinx/domains/python.py:500 sphinx/locale/__init__.py:162 +msgid "exception" +msgstr "išimtis" + +#: sphinx/domains/python.py:501 +msgid "method" +msgstr "metodas" + +#: sphinx/domains/python.py:502 +msgid "class method" +msgstr "klasės metodas" + +#: sphinx/domains/python.py:503 +msgid "static method" +msgstr "statinis metodas" + +#: sphinx/domains/python.py:505 sphinx/locale/__init__.py:158 +msgid "module" +msgstr "modulis" + +#: sphinx/domains/rst.py:53 +#, python-format +msgid "%s (directive)" +msgstr "%s (direktyva)" + +#: sphinx/domains/rst.py:55 +#, python-format +msgid "%s (role)" +msgstr "%s (rolė)" + +#: sphinx/domains/rst.py:103 +msgid "directive" +msgstr "direktyva" + +#: sphinx/domains/rst.py:104 +msgid "role" +msgstr "rolė" + +#: sphinx/domains/std.py:68 sphinx/domains/std.py:84 +#, python-format +msgid "environment variable; %s" +msgstr "aplinkos kintamasis; %s" + +#: sphinx/domains/std.py:160 +#, python-format +msgid "%scommand line option; %s" +msgstr "%skomandinės eilutės parinktis; %s" + +#: sphinx/domains/std.py:328 +msgid "glossary term" +msgstr "aiškinamasis terminas" + +#: sphinx/domains/std.py:329 +msgid "grammar token" +msgstr "gramatinė leksema" + +#: sphinx/domains/std.py:330 +msgid "reference label" +msgstr "nuorodos požymis" + +#: sphinx/domains/std.py:331 +msgid "environment variable" +msgstr "aplinkos kintamasis" + +#: sphinx/domains/std.py:332 +msgid "program option" +msgstr "programos parinktis" + +#: 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 "Indeksas" + +#: sphinx/domains/std.py:361 +msgid "Module Index" +msgstr "Modulio indeksas" + +#: sphinx/domains/std.py:362 sphinx/themes/basic/defindex.html:25 +msgid "Search Page" +msgstr "Paieškos puslapis" + +#: sphinx/ext/autodoc.py:917 +#, python-format +msgid " Bases: %s" +msgstr " Bazės: %s" + +#: sphinx/ext/autodoc.py:950 +#, python-format +msgid "alias of :class:`%s`" +msgstr ":class:`%s` alternatyvus vardas" + +#: sphinx/ext/todo.py:41 +msgid "Todo" +msgstr "Padaryti" + +#: sphinx/ext/todo.py:109 +#, python-format +msgid "(The <<original entry>> is located in %s, line %d.)" +msgstr "(<<original entry>> galima rasti %s, eilutėje %d.)" + +#: sphinx/ext/todo.py:117 +msgid "original entry" +msgstr "originalus įrašas" + +#: sphinx/ext/viewcode.py:66 +msgid "[source]" +msgstr "[šaltinis]" + +#: sphinx/ext/viewcode.py:109 +msgid "[docs]" +msgstr "[dokumentai]" + +#: sphinx/ext/viewcode.py:123 +msgid "Module code" +msgstr "Modulio kodas" + +#: sphinx/ext/viewcode.py:129 +#, python-format +msgid "<h1>Source code for %s</h1>" +msgstr "<h1>Kodas %s</h1>" + +#: sphinx/ext/viewcode.py:156 +msgid "Overview: module code" +msgstr "Apžvalga: modulio kodas" + +#: sphinx/ext/viewcode.py:157 +msgid "<h1>All modules for which code is available</h1>" +msgstr "<h1>Visi moduliai turintys kodą</h1>" + +#: sphinx/locale/__init__.py:139 +msgid "Attention" +msgstr "Dėmesio" + +#: sphinx/locale/__init__.py:140 +msgid "Caution" +msgstr "Atsargiai" + +#: sphinx/locale/__init__.py:141 +msgid "Danger" +msgstr "Pavojinga" + +#: sphinx/locale/__init__.py:142 +msgid "Error" +msgstr "Klaida" + +#: sphinx/locale/__init__.py:143 +msgid "Hint" +msgstr "Patarimas" + +#: sphinx/locale/__init__.py:144 +msgid "Important" +msgstr "Svarbu" + +#: sphinx/locale/__init__.py:145 +msgid "Note" +msgstr "Pastaba" + +#: sphinx/locale/__init__.py:146 +msgid "See Also" +msgstr "Taip pat žiūrėkite" + +#: sphinx/locale/__init__.py:147 +msgid "Tip" +msgstr "Patarimas" + +#: sphinx/locale/__init__.py:148 +msgid "Warning" +msgstr "Įspėjimas" + +#: sphinx/locale/__init__.py:152 +#, python-format +msgid "New in version %s" +msgstr "Nauja %s versijoje" + +#: sphinx/locale/__init__.py:153 +#, python-format +msgid "Changed in version %s" +msgstr "Pakeista %s versijoje" + +#: sphinx/locale/__init__.py:154 +#, python-format +msgid "Deprecated since version %s" +msgstr "Nebepalaikoma nuo %s versijos" + +#: sphinx/locale/__init__.py:159 +msgid "keyword" +msgstr "bazinis žodis" + +#: sphinx/locale/__init__.py:160 +msgid "operator" +msgstr "operatorius" + +#: sphinx/locale/__init__.py:161 +msgid "object" +msgstr "objektas" + +#: sphinx/locale/__init__.py:163 +msgid "statement" +msgstr "sakinis" + +#: sphinx/locale/__init__.py:164 +msgid "built-in function" +msgstr "įtaisytoji funkcija" + +#: sphinx/themes/agogo/layout.html:45 sphinx/themes/basic/globaltoc.html:10 +#: sphinx/themes/basic/localtoc.html:11 +msgid "Table Of Contents" +msgstr "Turinys" + +#: 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 "Paieška" + +#: sphinx/themes/agogo/layout.html:52 sphinx/themes/basic/searchbox.html:15 +msgid "Go" +msgstr "Pirmyn" + +#: sphinx/themes/agogo/layout.html:57 sphinx/themes/basic/searchbox.html:20 +msgid "Enter search terms or a module, class or function name." +msgstr "Įveskite paieškos terminą arba modulio, klasės ar funkcijos vardą." + +#: sphinx/themes/agogo/layout.html:78 sphinx/themes/basic/sourcelink.html:14 +msgid "Show Source" +msgstr "Rodyti pirminį kodą" + +#: sphinx/themes/basic/defindex.html:11 +msgid "Overview" +msgstr "Apžvalga" + +#: sphinx/themes/basic/defindex.html:20 +msgid "Indices and tables:" +msgstr "Indeksai ir lentelės:" + +#: sphinx/themes/basic/defindex.html:23 +msgid "Complete Table of Contents" +msgstr "Pilnas Turinys" + +#: sphinx/themes/basic/defindex.html:24 +msgid "lists all sections and subsections" +msgstr "surašyti visus skyrius ir poskyrius" + +#: sphinx/themes/basic/defindex.html:26 +msgid "search this documentation" +msgstr "ieškoti šiame dokumente" + +#: sphinx/themes/basic/defindex.html:28 +msgid "Global Module Index" +msgstr "Globalus Modulio Indeksas" + +#: sphinx/themes/basic/defindex.html:29 +msgid "quick access to all modules" +msgstr "greitas visų modulių pasiekimas" + +#: sphinx/themes/basic/defindex.html:31 +msgid "all functions, classes, terms" +msgstr "visos funkcijos, klasės ir terminai" + +#: sphinx/themes/basic/genindex-single.html:14 +#, python-format +msgid "Index – %(key)s" +msgstr "Indeksas – %(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 "Pilnas indeksas viename puslapyje" + +#: sphinx/themes/basic/genindex-split.html:16 +msgid "Index pages by letter" +msgstr "Indekso puslapiai pagal raidę" + +#: sphinx/themes/basic/genindex-split.html:25 +msgid "can be huge" +msgstr "gali būti didelis" + +#: sphinx/themes/basic/layout.html:23 +msgid "Navigation" +msgstr "Navigacija" + +#: sphinx/themes/basic/layout.html:113 +#, python-format +msgid "Search within %(docstitle)s" +msgstr "Ieškoti tarp %(docstitle)s" + +#: sphinx/themes/basic/layout.html:122 +msgid "About these documents" +msgstr "Apie šiuos dokumentus" + +#: sphinx/themes/basic/layout.html:131 +msgid "Copyright" +msgstr "Autoriaus teisės" + +#: sphinx/themes/basic/layout.html:180 +#, python-format +msgid "© <a href=\"%(path)s\">Copyright</a> %(copyright)s." +msgstr "© <a href=\"%(path)s\">Autoriaus teisės</a> %(copyright)s." + +#: sphinx/themes/basic/layout.html:182 +#, python-format +msgid "© Copyright %(copyright)s." +msgstr "© Autoriaus teisės %(copyright)s." + +#: sphinx/themes/basic/layout.html:186 +#, python-format +msgid "Last updated on %(last_updated)s." +msgstr "Paskutinis atnaujinimas %(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 "" +"Sukurta naudojant <a href=\"http://sphinx.pocoo.org/\">Sphinx</a> " +"%(sphinx_version)s." + +#: sphinx/themes/basic/opensearch.xml:4 +#, python-format +msgid "Search %(docstitle)s" +msgstr "Ieškoti %(docstitle)s" + +#: sphinx/themes/basic/relations.html:11 +msgid "Previous topic" +msgstr "Praeita tema" + +#: sphinx/themes/basic/relations.html:13 +msgid "previous chapter" +msgstr "praeita dalis" + +#: sphinx/themes/basic/relations.html:16 +msgid "Next topic" +msgstr "Kita tema" + +#: sphinx/themes/basic/relations.html:18 +msgid "next chapter" +msgstr "kita dalis" + +#: sphinx/themes/basic/search.html:18 +msgid "" +"Please activate JavaScript to enable the search\n" +" functionality." +msgstr "" +"Prašome aktyvuoti JavaScript, kad veiktų paieškos\n" +" funkcionalumas." + +#: 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 "" +"Čia jūs galite ieškoti šiuose dokumentuose. Įveskite savo paieškos\n žodžius į lauką apačioje ir paspauskite \"ieškoti\". Pastebėsime, kad paieškos\n funkcija automatiškai ieškos visų žodžių. Puslapiai,\n kuriuose yra mažiau žodžių nepasirodys tarp paieškos rezultatų." + +#: sphinx/themes/basic/search.html:30 +msgid "search" +msgstr "ieškoti" + +#: sphinx/themes/basic/search.html:34 +#: sphinx/themes/basic/static/searchtools.js:489 +msgid "Search Results" +msgstr "Paieškos rezultatai" + +#: sphinx/themes/basic/search.html:36 +msgid "Your search did not match any results." +msgstr "Jūsų paieška neatitiko jokių rezultatų" + +#: sphinx/themes/basic/searchbox.html:12 +msgid "Quick search" +msgstr "Greitoji paieška" + +#: sphinx/themes/basic/sourcelink.html:11 +msgid "This Page" +msgstr "Šis puslapis" + +#: sphinx/themes/basic/changes/frameset.html:5 +#: sphinx/themes/basic/changes/versionchanges.html:12 +#, python-format +msgid "Changes in Version %(version)s — %(docstitle)s" +msgstr "Pasikeitimai versijoje %(version)s — %(docstitle)s" + +#: sphinx/themes/basic/changes/rstsource.html:5 +#, python-format +msgid "%(filename)s — %(docstitle)s" +msgstr "%(filename)s — %(docstitle)s" + +#: sphinx/themes/basic/changes/versionchanges.html:17 +#, python-format +msgid "Automatically generated list of changes in version %(version)s" +msgstr "Automatiškai sugeneruotas pakeitimų %(version)s versijoje sąrašas" + +#: sphinx/themes/basic/changes/versionchanges.html:18 +msgid "Library changes" +msgstr "Bibliotekos pakeitimai" + +#: sphinx/themes/basic/changes/versionchanges.html:23 +msgid "C API changes" +msgstr "C API pakeitimai" + +#: sphinx/themes/basic/changes/versionchanges.html:25 +msgid "Other changes" +msgstr "Kiti pakeitimai" + +#: sphinx/themes/basic/static/doctools.js:154 sphinx/writers/html.py:482 +#: sphinx/writers/html.py:487 +msgid "Permalink to this headline" +msgstr "Nuoroda į šią antraštę" + +#: sphinx/themes/basic/static/doctools.js:160 sphinx/writers/html.py:87 +msgid "Permalink to this definition" +msgstr "Nuoroda į šį apibrėžimą" + +#: sphinx/themes/basic/static/doctools.js:189 +msgid "Hide Search Matches" +msgstr "Paslėpti paieškos rezultatus" + +#: sphinx/themes/basic/static/searchtools.js:285 +msgid "Searching" +msgstr "Ieškoma" + +#: sphinx/themes/basic/static/searchtools.js:290 +msgid "Preparing search..." +msgstr "Ruošiama paieška..." + +#: sphinx/themes/basic/static/searchtools.js:364 +msgid ", in " +msgstr ", kuris yra " + +#: 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 "Jūsų paieška neatitiko jokių dokumentų. Prašom patikrinti ar visi žodžiai teisingai įvesti ir ar pasirinkote pakankamai kategorijų." + +#: sphinx/themes/basic/static/searchtools.js:493 +#, python-format +msgid "Search finished, found %s page(s) matching the search query." +msgstr "Paieška baigta, paieškos rezultatus atitiko %s puslapis(-iai,-ių)" + +#: sphinx/themes/default/static/sidebar.js:66 +msgid "Expand sidebar" +msgstr "Išplėsti šoninę juostą" + +#: sphinx/themes/default/static/sidebar.js:79 +#: sphinx/themes/default/static/sidebar.js:106 +msgid "Collapse sidebar" +msgstr "Paslėpti šoninę juostą" + +#: sphinx/themes/haiku/layout.html:26 +msgid "Contents" +msgstr "Turinys" + +#: sphinx/writers/latex.py:171 +msgid "Release" +msgstr "Leidimas" + +#: sphinx/writers/latex.py:572 sphinx/writers/manpage.py:178 +msgid "Footnotes" +msgstr "Išnašos" + +#: sphinx/writers/latex.py:641 +msgid "continued from previous page" +msgstr "tęsinys iš praeito puslapio" + +#: sphinx/writers/latex.py:646 +msgid "Continued on next page" +msgstr "Tęsinys kitame puslapyje" + +#: sphinx/writers/text.py:422 +msgid "[image]" +msgstr "[paveiksliukas]" + diff -Nru sphinx-1.0~hg20100604/sphinx/locale/pt_BR/LC_MESSAGES/sphinx.js sphinx-1.0.7/sphinx/locale/pt_BR/LC_MESSAGES/sphinx.js --- sphinx-1.0~hg20100604/sphinx/locale/pt_BR/LC_MESSAGES/sphinx.js 2010-06-03 22:12:22.000000000 +0000 +++ sphinx-1.0.7/sphinx/locale/pt_BR/LC_MESSAGES/sphinx.js 2011-01-04 09:00:04.000000000 +0000 @@ -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 ", "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 +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": "Expandir painel lateral", "Permalink to this headline": "Link permanente para este t\u00edtulo", "Searching": "Pesquisando", "Collapse sidebar": "Recolher painel lateral", "Permalink to this definition": "Link permanente para esta defini\u00e7\u00e3o", "Hide Search Matches": "Esconder Resultados da Pesquisa"}}); \ No newline at end of file Binary files /tmp/Rt1D5gzI2R/sphinx-1.0~hg20100604/sphinx/locale/pt_BR/LC_MESSAGES/sphinx.mo and /tmp/0_5OtyEyzZ/sphinx-1.0.7/sphinx/locale/pt_BR/LC_MESSAGES/sphinx.mo differ diff -Nru sphinx-1.0~hg20100604/sphinx/locale/pt_BR/LC_MESSAGES/sphinx.po sphinx-1.0.7/sphinx/locale/pt_BR/LC_MESSAGES/sphinx.po --- sphinx-1.0~hg20100604/sphinx/locale/pt_BR/LC_MESSAGES/sphinx.po 2010-06-03 22:12:22.000000000 +0000 +++ sphinx-1.0.7/sphinx/locale/pt_BR/LC_MESSAGES/sphinx.po 2011-01-04 09:00:04.000000000 +0000 @@ -8,7 +8,7 @@ "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: 2010-05-24 23:54+0200\n" +"PO-Revision-Date: 2010-06-20 18:34-0300\n" "Last-Translator: Roger Demetrescu <roger.demetrescu@gmail.com>\n" "Language-Team: pt_BR <roger.demetrescu@gmail.com>\n" "Plural-Forms: nplurals=2; plural=(n > 1)\n" @@ -17,7 +17,8 @@ "Content-Transfer-Encoding: 8bit\n" "Generated-By: Babel 0.9.4\n" -#: sphinx/environment.py:106 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" @@ -41,7 +42,8 @@ msgid "%b %d, %Y" msgstr "%d/%m/%Y" -#: sphinx/builders/html.py:285 sphinx/themes/basic/defindex.html:30 +#: sphinx/builders/html.py:285 +#: sphinx/themes/basic/defindex.html:30 msgid "General Index" msgstr "Índice Geral" @@ -70,9 +72,8 @@ msgstr "Autor do módulo: " #: sphinx/directives/other.py:131 -#, fuzzy msgid "Code author: " -msgstr "Autor do módulo: " +msgstr "Autor do código: " #: sphinx/directives/other.py:133 msgid "Author: " @@ -85,18 +86,21 @@ #: sphinx/domains/__init__.py:253 #, python-format msgid "%s %s" -msgstr "" +msgstr "%s %s" -#: sphinx/domains/c.py:51 sphinx/domains/python.py:49 +#: 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/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 +#: sphinx/domains/c.py:56 +#: sphinx/domains/python.py:61 msgid "Return type" msgstr "Tipo de retorno" @@ -125,12 +129,15 @@ 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 +#: 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 +#: sphinx/domains/c.py:172 +#: sphinx/domains/cpp.py:1032 msgid "member" msgstr "membro" @@ -138,14 +145,14 @@ msgid "macro" msgstr "macro" -#: sphinx/domains/c.py:174 sphinx/domains/cpp.py:1033 +#: sphinx/domains/c.py:174 +#: sphinx/domains/cpp.py:1033 msgid "type" msgstr "tipo" #: sphinx/domains/c.py:175 -#, fuzzy msgid "variable" -msgstr "Variável" +msgstr "variável" #: sphinx/domains/cpp.py:876 #, python-format @@ -167,16 +174,19 @@ msgid "%s (C++ function)" msgstr "%s (função C++)" -#: sphinx/domains/cpp.py:1030 sphinx/domains/python.py:499 +#: sphinx/domains/cpp.py:1030 +#: sphinx/domains/python.py:499 msgid "class" msgstr "classe" -#: sphinx/domains/javascript.py:117 sphinx/domains/python.py:221 +#: sphinx/domains/javascript.py:117 +#: sphinx/domains/python.py:221 #, python-format msgid "%s() (built-in function)" msgstr "%s() (função interna)" -#: sphinx/domains/javascript.py:118 sphinx/domains/python.py:285 +#: sphinx/domains/javascript.py:118 +#: sphinx/domains/python.py:285 #, python-format msgid "%s() (%s method)" msgstr "%s() (método %s)" @@ -184,41 +194,44 @@ #: sphinx/domains/javascript.py:120 #, python-format msgid "%s (global variable or constant)" -msgstr "" +msgstr "%s (variável global ou constante)" -#: sphinx/domains/javascript.py:122 sphinx/domains/python.py:323 +#: 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 "" +msgstr "Gera" -#: sphinx/domains/javascript.py:167 sphinx/domains/python.py:498 +#: sphinx/domains/javascript.py:167 +#: sphinx/domains/python.py:498 msgid "data" -msgstr "" +msgstr "dado" -#: sphinx/domains/javascript.py:168 sphinx/domains/python.py:504 +#: 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" +msgstr "Variáveis" #: 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 +#: 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)" @@ -228,7 +241,8 @@ msgid "%s (built-in variable)" msgstr "%s (variável interna)" -#: sphinx/domains/python.py:226 sphinx/domains/python.py:317 +#: sphinx/domains/python.py:226 +#: sphinx/domains/python.py:317 #, python-format msgid "%s (in module %s)" msgstr "%s (no módulo %s)" @@ -259,14 +273,14 @@ msgstr "%s() (método estático %s)" #: sphinx/domains/python.py:308 -#, fuzzy, python-format +#, python-format msgid "%s() (%s.%s class method)" -msgstr "%s() (método %s.%s)" +msgstr "%s() (método de classe %s.%s)" #: sphinx/domains/python.py:311 -#, fuzzy, python-format +#, python-format msgid "%s() (%s class method)" -msgstr "%s() (método %s)" +msgstr "%s() (método de classe %s)" #: sphinx/domains/python.py:321 #, python-format @@ -283,9 +297,8 @@ msgstr "%s (módulo)" #: sphinx/domains/python.py:429 -#, fuzzy msgid "Python Module Index" -msgstr "Índice do Módulo" +msgstr "Índice de Módulos do Python" #: sphinx/domains/python.py:430 msgid "modules" @@ -295,47 +308,49 @@ msgid "Deprecated" msgstr "Obsoleto" -#: sphinx/domains/python.py:500 sphinx/locale/__init__.py:162 +#: sphinx/domains/python.py:500 +#: sphinx/locale/__init__.py:162 msgid "exception" msgstr "exceção" #: sphinx/domains/python.py:501 msgid "method" -msgstr "" +msgstr "método" #: sphinx/domains/python.py:502 -#, fuzzy, python-format +#, python-format msgid "class method" -msgstr "%s() (método %s)" +msgstr "método de classe" #: sphinx/domains/python.py:503 msgid "static method" msgstr "método estático" -#: sphinx/domains/python.py:505 sphinx/locale/__init__.py:158 +#: sphinx/domains/python.py:505 +#: sphinx/locale/__init__.py:158 msgid "module" msgstr "módulo" #: sphinx/domains/rst.py:53 #, python-format msgid "%s (directive)" -msgstr "" +msgstr "%s (diretiva)" #: sphinx/domains/rst.py:55 -#, fuzzy, python-format +#, python-format msgid "%s (role)" -msgstr "%s (módulo)" +msgstr "%s (papel)" #: sphinx/domains/rst.py:103 msgid "directive" -msgstr "" +msgstr "diretiva" #: sphinx/domains/rst.py:104 -#, fuzzy msgid "role" -msgstr "módulo" +msgstr "papel" -#: sphinx/domains/std.py:68 sphinx/domains/std.py:84 +#: sphinx/domains/std.py:68 +#: sphinx/domains/std.py:84 #, python-format msgid "environment variable; %s" msgstr "váriavel de ambiente; %s" @@ -347,15 +362,15 @@ #: sphinx/domains/std.py:328 msgid "glossary term" -msgstr "" +msgstr "Termo de glossário" #: sphinx/domains/std.py:329 msgid "grammar token" -msgstr "" +msgstr "token de gramática" #: sphinx/domains/std.py:330 msgid "reference label" -msgstr "" +msgstr "rótulo de referência" #: sphinx/domains/std.py:331 msgid "environment variable" @@ -363,13 +378,16 @@ #: sphinx/domains/std.py:332 msgid "program option" -msgstr "" +msgstr "opção de programa" -#: sphinx/domains/std.py:360 sphinx/themes/basic/genindex-single.html:11 +#: 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/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" @@ -378,19 +396,20 @@ msgid "Module Index" msgstr "Índice do Módulo" -#: sphinx/domains/std.py:362 sphinx/themes/basic/defindex.html:25 +#: sphinx/domains/std.py:362 +#: sphinx/themes/basic/defindex.html:25 msgid "Search Page" msgstr "Página de Pesquisa" #: sphinx/ext/autodoc.py:917 #, python-format msgid " Bases: %s" -msgstr "" +msgstr " Bases: %s" #: sphinx/ext/autodoc.py:950 #, python-format msgid "alias of :class:`%s`" -msgstr "" +msgstr "apelido de :class:`%s`" #: sphinx/ext/todo.py:41 msgid "Todo" @@ -407,29 +426,28 @@ #: sphinx/ext/viewcode.py:66 msgid "[source]" -msgstr "" +msgstr "[código fonte]" #: sphinx/ext/viewcode.py:109 msgid "[docs]" -msgstr "" +msgstr "[documentos]" #: sphinx/ext/viewcode.py:123 -#, fuzzy msgid "Module code" -msgstr "módulo" +msgstr "Código do módulo" #: sphinx/ext/viewcode.py:129 #, python-format msgid "<h1>Source code for %s</h1>" -msgstr "" +msgstr "<h1>Código fonte de %s</h1>" #: sphinx/ext/viewcode.py:156 msgid "Overview: module code" -msgstr "" +msgstr "Visão geral: código do módulo" #: sphinx/ext/viewcode.py:157 msgid "<h1>All modules for which code is available</h1>" -msgstr "" +msgstr "<h1>Todos os módulos onde este código está disponível</h1>" #: sphinx/locale/__init__.py:139 msgid "Attention" @@ -506,26 +524,31 @@ msgid "built-in function" msgstr "função interna" -#: sphinx/themes/agogo/layout.html:45 sphinx/themes/basic/globaltoc.html:10 +#: 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 +#: 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 +#: 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 +#: sphinx/themes/agogo/layout.html:57 +#: sphinx/themes/basic/searchbox.html:20 msgid "Enter search terms or a module, class or function name." -msgstr "Informe o nome de um módulo, classe ou função." +msgstr "Digite os termos da busca ou o nome de um módulo, classe ou função." -#: sphinx/themes/agogo/layout.html:78 sphinx/themes/basic/sourcelink.html:14 +#: sphinx/themes/agogo/layout.html:78 +#: sphinx/themes/basic/sourcelink.html:14 msgid "Show Source" msgstr "Exibir Fonte" @@ -615,12 +638,8 @@ #: sphinx/themes/basic/layout.html:189 #, python-format -msgid "" -"Created using <a href=\"http://sphinx.pocoo.org/\">Sphinx</a> " -"%(sphinx_version)s." -msgstr "" -"Criado com <a href=\"http://sphinx.pocoo.org/\">Sphinx</a> " -"%(sphinx_version)s." +msgid "Created using <a href=\"http://sphinx.pocoo.org/\">Sphinx</a> %(sphinx_version)s." +msgstr "Criado com <a href=\"http://sphinx.pocoo.org/\">Sphinx</a> %(sphinx_version)s." #: sphinx/themes/basic/opensearch.xml:4 #, python-format @@ -647,10 +666,9 @@ msgid "" "Please activate JavaScript to enable the search\n" " functionality." -msgstr "" +msgstr "Por favor ative o JavaScript para habilitar a funcionalidade de pesquisa." #: sphinx/themes/basic/search.html:23 -#, fuzzy msgid "" "From here you can search these documents. Enter your search\n" " words into the box below and click \"search\". Note that the search\n" @@ -658,11 +676,9 @@ " containing fewer words won't appear in the result list." msgstr "" "A partir daqui você pode pesquisar estes documentos. Preencha suas \n" -" palavras de pesquisa na caixa abaixo e clique em \"pesquisar\". " -"Observe que a função de pesquisa\n" +" palavras de pesquisa na caixa abaixo e clique em \"pesquisar\". Observe que a função de pesquisa\n" " irá pesquisar automaticamente por todas as palavras.\n" -" Páginas contendo menos palavras não irão aparecer na lista de " -"resultado." +" Páginas contendo menos palavras não irão aparecer na lista de resultado." #: sphinx/themes/basic/search.html:30 msgid "search" @@ -713,12 +729,14 @@ msgid "Other changes" msgstr "Outras alterações" -#: sphinx/themes/basic/static/doctools.js:154 sphinx/writers/html.py:482 +#: 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:160 sphinx/writers/html.py:87 +#: sphinx/themes/basic/static/doctools.js:160 +#: sphinx/writers/html.py:87 msgid "Permalink to this definition" msgstr "Link permanente para esta definição" @@ -739,51 +757,45 @@ msgstr ", em " #: 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 "" -"Sua pesquisa não encontrou nenhum documento. Por favor assegure-se de que" -" todas as palavras foram digitadas corretamente e de que você tenha " -"selecionado o mínimo de categorias." +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 "Sua pesquisa não encontrou nenhum documento. Por favor assegure-se de que todas as palavras foram digitadas corretamente e de que você tenha selecionado o mínimo de categorias." #: 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." +msgstr "Pesquisa finalizada, foram encontrada(s) %s página(s) que conferem com o critério de pesquisa." #: sphinx/themes/default/static/sidebar.js:66 msgid "Expand sidebar" -msgstr "" +msgstr "Expandir painel lateral" #: sphinx/themes/default/static/sidebar.js:79 #: sphinx/themes/default/static/sidebar.js:106 msgid "Collapse sidebar" -msgstr "" +msgstr "Recolher painel lateral" #: sphinx/themes/haiku/layout.html:26 msgid "Contents" -msgstr "" +msgstr "Conteúdo" #: sphinx/writers/latex.py:171 msgid "Release" msgstr "Versão" -#: sphinx/writers/latex.py:572 sphinx/writers/manpage.py:178 +#: sphinx/writers/latex.py:572 +#: sphinx/writers/manpage.py:178 msgid "Footnotes" -msgstr "" +msgstr "Notas de rodapé" #: sphinx/writers/latex.py:641 msgid "continued from previous page" -msgstr "" +msgstr "continuação da página anterior" #: sphinx/writers/latex.py:646 -#, fuzzy msgid "Continued on next page" -msgstr "Índice completo em uma página" +msgstr "Continua na próxima página" #: sphinx/writers/text.py:422 msgid "[image]" msgstr "[imagem]" + diff -Nru sphinx-1.0~hg20100604/sphinx/pycode/__init__.py sphinx-1.0.7/sphinx/pycode/__init__.py --- sphinx-1.0~hg20100604/sphinx/pycode/__init__.py 2010-05-06 16:30:00.000000000 +0000 +++ sphinx-1.0.7/sphinx/pycode/__init__.py 2011-01-04 09:00:04.000000000 +0000 @@ -5,7 +5,7 @@ Utilities parsing and analyzing Python code. - :copyright: Copyright 2007-2010 by the Sphinx team, see AUTHORS. + :copyright: Copyright 2007-2011 by the Sphinx team, see AUTHORS. :license: BSD, see LICENSE for details. """ @@ -195,6 +195,8 @@ self.srcname = srcname # file-like object yielding source lines self.source = source + # will be changed when found by parse() + self.encoding = sys.getdefaultencoding() # cache the source code as well pos = self.source.tell() @@ -227,15 +229,13 @@ self.parsetree = pydriver.parse_tokens(self.tokens) except parse.ParseError, err: raise PycodeError('parsing failed', err) - # find the source code encoding - encoding = sys.getdefaultencoding() + # find the source code encoding, if present comments = self.parsetree.get_prefix() for line in comments.splitlines()[:2]: match = _coding_re.search(line) if match is not None: - encoding = match.group(1) + self.encoding = match.group(1) break - self.encoding = encoding def find_attr_docs(self, scope=''): """Find class and module-level attributes and their documentation.""" diff -Nru sphinx-1.0~hg20100604/sphinx/pycode/nodes.py sphinx-1.0.7/sphinx/pycode/nodes.py --- sphinx-1.0~hg20100604/sphinx/pycode/nodes.py 2010-05-06 16:30:00.000000000 +0000 +++ sphinx-1.0.7/sphinx/pycode/nodes.py 2011-01-04 09:00:04.000000000 +0000 @@ -5,7 +5,7 @@ Parse tree node implementations. - :copyright: Copyright 2007-2010 by the Sphinx team, see AUTHORS. + :copyright: Copyright 2007-2011 by the Sphinx team, see AUTHORS. :license: BSD, see LICENSE for details. """ diff -Nru sphinx-1.0~hg20100604/sphinx/pycode/pgen2/driver.py sphinx-1.0.7/sphinx/pycode/pgen2/driver.py --- sphinx-1.0~hg20100604/sphinx/pycode/pgen2/driver.py 2010-05-06 16:30:00.000000000 +0000 +++ sphinx-1.0.7/sphinx/pycode/pgen2/driver.py 2011-01-04 09:00:04.000000000 +0000 @@ -120,7 +120,7 @@ head, tail = os.path.splitext(gt) if tail == ".txt": tail = "" - gp = head + tail + ".".join(map(str, sys.version_info)) + ".pickle" + gp = head + tail + ".".join(map(str, sys.version_info[:2])) + ".pickle" if force or not _newer(gp, gt): logger.info("Generating grammar tables from %s", gt) g = pgen.generate_grammar(gt) diff -Nru sphinx-1.0~hg20100604/sphinx/pycode/pgen2/parse.c sphinx-1.0.7/sphinx/pycode/pgen2/parse.c --- sphinx-1.0~hg20100604/sphinx/pycode/pgen2/parse.c 2010-05-06 16:30:00.000000000 +0000 +++ sphinx-1.0.7/sphinx/pycode/pgen2/parse.c 1970-01-01 00:00:00.000000000 +0000 @@ -1,4633 +0,0 @@ -/* 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 -#ifndef DL_EXPORT - #define DL_EXPORT(t) t -#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) - #define PyIndex_Check(o) PyNumber_Check(o) -#endif -#if PY_VERSION_HEX < 0x02060000 - #define Py_REFCNT(ob) (((PyObject*)(ob))->ob_refcnt) - #define Py_TYPE(ob) (((PyObject*)(ob))->ob_type) - #define Py_SIZE(ob) (((PyVarObject*)(ob))->ob_size) - #define PyVarObject_HEAD_INIT(type, size) \ - PyObject_HEAD_INIT(type) size, - #define PyType_Modified(t) - - typedef struct { - void *buf; - PyObject *obj; - Py_ssize_t len; - Py_ssize_t itemsize; - int readonly; - int ndim; - char *format; - Py_ssize_t *shape; - Py_ssize_t *strides; - Py_ssize_t *suboffsets; - void *internal; - } Py_buffer; - - #define PyBUF_SIMPLE 0 - #define PyBUF_WRITABLE 0x0001 - #define PyBUF_FORMAT 0x0004 - #define PyBUF_ND 0x0008 - #define PyBUF_STRIDES (0x0010 | PyBUF_ND) - #define PyBUF_C_CONTIGUOUS (0x0020 | PyBUF_STRIDES) - #define PyBUF_F_CONTIGUOUS (0x0040 | PyBUF_STRIDES) - #define PyBUF_ANY_CONTIGUOUS (0x0080 | PyBUF_STRIDES) - #define PyBUF_INDIRECT (0x0100 | PyBUF_STRIDES) - -#endif -#if PY_MAJOR_VERSION < 3 - #define __Pyx_BUILTIN_MODULE_NAME "__builtin__" -#else - #define __Pyx_BUILTIN_MODULE_NAME "builtins" -#endif -#if PY_MAJOR_VERSION >= 3 - #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 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) - #define PyInt_FromString PyLong_FromString - #define PyInt_FromUnicode PyLong_FromUnicode - #define PyInt_FromLong PyLong_FromLong - #define PyInt_FromSize_t PyLong_FromSize_t - #define PyInt_FromSsize_t PyLong_FromSsize_t - #define PyInt_AsLong PyLong_AsLong - #define PyInt_AS_LONG PyLong_AS_LONG - #define PyInt_AsSsize_t PyLong_AsSsize_t - #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 __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceDivide(x,y) -#endif -#if PY_MAJOR_VERSION >= 3 - #define PyMethod_New(func, self, klass) PyInstanceMethod_New(func) -#endif -#if !defined(WIN32) && !defined(MS_WINDOWS) - #ifndef __stdcall - #define __stdcall - #endif - #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 -#define __PYX_EXTERN_C extern -#endif -#include <math.h> -#define __PYX_HAVE_API__sphinx__pycode__pgen2__parse - -#ifdef __GNUC__ -#define INLINE __inline__ -#elif _WIN32 -#define INLINE __inline -#else -#define INLINE -#endif - -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_FromStringAndSize PyString_FromStringAndSize -#define __Pyx_PyBytes_AsString PyString_AsString -#else -#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*); -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_PyFloat_AsDouble(x) (PyFloat_CheckExact(x) ? PyFloat_AS_DOUBLE(x) : PyFloat_AsDouble(x)) - - -#ifdef __GNUC__ -/* Test for GCC > 2.95 */ -#if __GNUC__ > 2 || (__GNUC__ == 2 && (__GNUC_MINOR__ > 95)) -#define likely(x) __builtin_expect(!!(x), 1) -#define unlikely(x) __builtin_expect(!!(x), 0) -#else /* __GNUC__ > 2 ... */ -#define likely(x) (x) -#define unlikely(x) (x) -#endif /* __GNUC__ > 2 ... */ -#else /* __GNUC__ */ -#define likely(x) (x) -#define unlikely(x) (x) -#endif /* __GNUC__ */ - -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; - - -/* Type declarations */ - -/* "/home/gbr/devel/sphinx/sphinx/pycode/pgen2/parse.pyx":31 - * - * - * cdef class Parser: # <<<<<<<<<<<<<< - * cdef public object grammar - * cdef public object rootnode - */ - -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) - -#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 (!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)))) { - 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))) { - r = PySequence_GetItem(o, i); - } - else { - 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 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 */ - } - else { - PyObject *r, *m; - m = __Pyx_GetAttrString(L, "append"); - if (!m) return NULL; - r = PyObject_CallFunctionObjArgs(m, x, NULL); - Py_DECREF(m); - return r; - } -} - -#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 (!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))) - return PySequence_SetItem(o, i, v); - else { - PyObject *j = fits_long ? PyInt_FromLong(i) : PyLong_FromLongLong(i); - return __Pyx_SetItemInt_Generic(o, j, v); - } -} - -static void __Pyx_UnpackTupleError(PyObject *, Py_ssize_t index); /*proto*/ - -static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list); /*proto*/ - -static PyObject *__Pyx_GetName(PyObject *dict, PyObject *name); /*proto*/ - -static PyObject *__Pyx_CreateClass(PyObject *bases, PyObject *dict, PyObject *name, const char *modname); /*proto*/ - -static INLINE void __Pyx_ErrRestore(PyObject *type, PyObject *value, PyObject *tb); /*proto*/ -static INLINE void __Pyx_ErrFetch(PyObject **type, PyObject **value, PyObject **tb); /*proto*/ - -static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb); /*proto*/ - -static INLINE unsigned char __Pyx_PyInt_AsUnsignedChar(PyObject *); - -static INLINE unsigned short __Pyx_PyInt_AsUnsignedShort(PyObject *); - -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 PyObject *__pyx_builtin_Exception; -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.""" - * - * def __init__(self, msg, type, value, context): # <<<<<<<<<<<<<< - * Exception.__init__(self, "%s: type=%r, value=%r, context=%r" % - * (msg, type, value, context)) - */ - -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__ = {__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 = 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 (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); - } - 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_argument_unpacking_done:; - - /* "/home/gbr/devel/sphinx/sphinx/pycode/pgen2/parse.pyx":23 - * - * def __init__(self, msg, type, value, context): - * Exception.__init__(self, "%s: type=%r, value=%r, context=%r" % # <<<<<<<<<<<<<< - * (msg, type, value, context)) - * self.msg = msg - */ - __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): - * Exception.__init__(self, "%s: type=%r, value=%r, context=%r" % - * (msg, type, value, context)) # <<<<<<<<<<<<<< - * self.msg = msg - * self.type = type - */ - __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" % - * (msg, type, value, context)) - * self.msg = msg # <<<<<<<<<<<<<< - * self.type = type - * self.value = value - */ - 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)) - * self.msg = msg - * self.type = type # <<<<<<<<<<<<<< - * self.value = value - * self.context = context - */ - 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 - * self.type = type - * self.value = value # <<<<<<<<<<<<<< - * self.context = context - * - */ - 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 - * self.value = value - * self.context = context # <<<<<<<<<<<<<< - * - * - */ - 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; __Pyx_INCREF(Py_None); - goto __pyx_L0; - __pyx_L1_error:; - __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":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 - * #self.convert = convert or noconvert - */ - -static int __pyx_pf_6sphinx_6pycode_5pgen2_5parse_6Parser___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ -static int __pyx_pf_6sphinx_6pycode_5pgen2_5parse_6Parser___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { - PyObject *__pyx_v_grammar = 0; - PyObject *__pyx_v_convert = 0; - int __pyx_r; - 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; - } - } - 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_argument_unpacking_done:; - - /* "/home/gbr/devel/sphinx/sphinx/pycode/pgen2/parse.pyx":44 - * - * def __init__(self, grammar, convert=None): - * self.grammar = grammar # <<<<<<<<<<<<<< - * #self.convert = convert or noconvert - * - */ - __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":47 - * #self.convert = convert or noconvert - * - * self._grammar_dfas = grammar.dfas # <<<<<<<<<<<<<< - * self._grammar_labels = grammar.labels - * self._grammar_keywords = grammar.keywords - */ - __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_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_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_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_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:; - __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":54 - * self._grammar_start = grammar.start - * - * def setup(self, start=None): # <<<<<<<<<<<<<< - * if start is None: - * 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*/ -static PyObject *__pyx_pf_6sphinx_6pycode_5pgen2_5parse_6Parser_setup(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { - PyObject *__pyx_v_start = 0; - PyObject *__pyx_v_newnode; - PyObject *__pyx_v_stackentry; - 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; - } - } - 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_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":55 - * - * def setup(self, start=None): - * if start is None: # <<<<<<<<<<<<<< - * start = self._grammar_start - * # Each stack entry is a tuple: (dfa, state, node). - */ - __pyx_t_1 = (__pyx_v_start == Py_None); - if (__pyx_t_1) { - - /* "/home/gbr/devel/sphinx/sphinx/pycode/pgen2/parse.pyx":56 - * def setup(self, start=None): - * if start is None: - * start = self._grammar_start # <<<<<<<<<<<<<< - * # Each stack entry is a tuple: (dfa, state, node). - * # A node is a tuple: (type, value, context, children), - */ - __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_L6:; - - /* "/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_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_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_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() - * - */ - __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":64 - * self.stack = [stackentry] - * self.rootnode = None - * self.used_names = set() # Aliased to self.rootnode.used_names in pop() # <<<<<<<<<<<<<< - * - * def addtoken(self, int type, value, context): - */ - __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:; - __Pyx_XDECREF(__pyx_t_2); - __Pyx_XDECREF(__pyx_t_3); - __Pyx_AddTraceback("sphinx.pycode.pgen2.parse.Parser.setup"); - __pyx_r = NULL; - __pyx_L0:; - __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":66 - * self.used_names = set() # Aliased to self.rootnode.used_names in pop() - * - * 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 - */ - -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) { - int __pyx_v_type; - PyObject *__pyx_v_value = 0; - PyObject *__pyx_v_context = 0; - int __pyx_v_ilabel; - int __pyx_v_i; - int __pyx_v_t; - int __pyx_v_state; - int __pyx_v_newstate; - PyObject *__pyx_v_dfa; - PyObject *__pyx_v_node; - PyObject *__pyx_v_states; - PyObject *__pyx_v_first; - PyObject *__pyx_v_arcs; - PyObject *__pyx_v_v; - PyObject *__pyx_v_itsdfa; - PyObject *__pyx_v_itsstates; - PyObject *__pyx_v_itsfirst; - 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); - } - 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_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) # <<<<<<<<<<<<<< - * # Loop until the token is shifted; may raise exceptions - * while True: - */ - __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":72 - * ilabel = self.classify(type, value, context) - * # Loop until the token is shifted; may raise exceptions - * while True: # <<<<<<<<<<<<<< - * dfa, state, node = self.stack[-1] - * states, first = dfa - */ - while (1) { - __pyx_t_1 = 1; - if (!__pyx_t_1) break; - - /* "/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_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; - } - - /* "/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) && likely(PyTuple_GET_SIZE(__pyx_v_dfa) == 2)) { - PyObject* tuple = __pyx_v_dfa; - __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; - } - - /* "/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_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":77 - * arcs = states[state] - * # Look for a state with this label - * for i, newstate in arcs: # <<<<<<<<<<<<<< - * t, v = self._grammar_labels[i] - * if ilabel == i: - */ - if (PyList_CheckExact(__pyx_v_arcs) || PyTuple_CheckExact(__pyx_v_arcs)) { - __pyx_t_8 = 0; __pyx_t_5 = __pyx_v_arcs; __Pyx_INCREF(__pyx_t_5); - } else { - __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_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_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_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":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_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":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_t_1 = (__pyx_v_ilabel == __pyx_v_i); - if (__pyx_t_1) { - - /* "/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_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 # <<<<<<<<<<<<<< - * while states[state] == [(0, state)]: - * self.pop() - */ - __pyx_v_state = __pyx_v_newstate; - - /* "/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)]: # <<<<<<<<<<<<<< - * self.pop() - * if not self.stack: - */ - while (1) { - __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() # <<<<<<<<<<<<<< - * if not self.stack: - * # Done parsing! - */ - ((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":88 - * while states[state] == [(0, state)]: - * self.pop() - * if not self.stack: # <<<<<<<<<<<<<< - * # Done parsing! - * return True - */ - __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":90 - * if not self.stack: - * # Done parsing! - * return True # <<<<<<<<<<<<<< - * dfa, state, node = self.stack[-1] - * states, first = dfa - */ - __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_L13; - } - __pyx_L13:; - - /* "/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_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":92 - * return True - * dfa, state, node = self.stack[-1] - * states, first = dfa # <<<<<<<<<<<<<< - * # Done with this token - * return False - */ - if (PyTuple_CheckExact(__pyx_v_dfa) && likely(PyTuple_GET_SIZE(__pyx_v_dfa) == 2)) { - PyObject* tuple = __pyx_v_dfa; - __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":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_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_L10; - } - - /* "/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_t_10 = (__pyx_v_t >= 256); - if (__pyx_t_10) { - - /* "/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_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":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) && likely(PyTuple_GET_SIZE(__pyx_v_itsdfa) == 2)) { - PyObject* tuple = __pyx_v_itsdfa; - __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":99 - * itsdfa = self._grammar_dfas[t] - * itsstates, itsfirst = itsdfa - * if ilabel in itsfirst: # <<<<<<<<<<<<<< - * # Push a symbol - * self.push(t, itsdfa, newstate, context) - */ - __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":101 - * if ilabel in itsfirst: - * # Push a symbol - * self.push(t, itsdfa, newstate, context) # <<<<<<<<<<<<<< - * break # To continue the outer while loop - * else: - */ - __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":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_L9_break; - goto __pyx_L14; - } - __pyx_L14:; - goto __pyx_L10; - } - __pyx_L10:; - } - /*else*/ { - - /* "/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_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() # <<<<<<<<<<<<<< - * if not self.stack: - * # Done parsing, but another token is input - */ - ((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":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_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":109 - * if not self.stack: - * # Done parsing, but another token is input - * raise ParseError("too much input", # <<<<<<<<<<<<<< - * type, value, context) - * else: - */ - __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":110 - * # Done parsing, but another token is input - * raise ParseError("too much input", - * type, value, context) # <<<<<<<<<<<<<< - * else: - * # No success finding a transition - */ - __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_L16:; - goto __pyx_L15; - } - /*else*/ { - - /* "/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, 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_L15:; - } - __pyx_L9_break:; - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - } - - __pyx_r = Py_None; __Pyx_INCREF(Py_None); - goto __pyx_L0; - __pyx_L1_error:; - __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:; - __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":115 - * raise ParseError("bad input", 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, int __pyx_v_type, PyObject *__pyx_v_value, PyObject *__pyx_v_context) { - int __pyx_r; - 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_t_1 = (__pyx_v_type == 1); - if (__pyx_t_1) { - - /* "/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 - * 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 - * 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 - * 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; - } - __pyx_L4:; - goto __pyx_L3; - } - __pyx_L3:; - - /* "/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 self._grammar_tokens[type] - */ - __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":124 - * return self._grammar_keywords[value] - * if type not in self._grammar_tokens: - * raise ParseError("bad token", type, value, context) # <<<<<<<<<<<<<< - * return self._grammar_tokens[type] - * - */ - __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":125 - * if type not in self._grammar_tokens: - * raise ParseError("bad token", type, value, context) - * return self._grammar_tokens[type] # <<<<<<<<<<<<<< - * - * cdef void shift(self, type, value, newstate, context): - */ - __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:; - __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:; - __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":127 - * return self._grammar_tokens[type] - * - * cdef void shift(self, type, value, newstate, context): # <<<<<<<<<<<<<< - * """Shift a token. (Internal)""" - * 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_newnode; - 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_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":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_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":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) - */ - 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":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_t_6 = (__pyx_v_newnode != Py_None); - if (__pyx_t_6) { - - /* "/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_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":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_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:; - __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:; - __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":137 - * self.stack[-1] = (dfa, newstate, node) - * - * cdef void push(self, type, newdfa, newstate, context): # <<<<<<<<<<<<<< - * """Push a nonterminal. (Internal)""" - * dfa, state, node = self.stack[-1] - */ - -static void __pyx_f_6sphinx_6pycode_5pgen2_5parse_6Parser_push(struct __pyx_obj_6sphinx_6pycode_5pgen2_5parse_Parser *__pyx_v_self, PyObject *__pyx_v_type, PyObject *__pyx_v_newdfa, PyObject *__pyx_v_newstate, PyObject *__pyx_v_context) { - PyObject *__pyx_v_dfa; - PyObject *__pyx_v_state; - PyObject *__pyx_v_node; - PyObject *__pyx_v_newnode; - 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":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_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":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_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_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): - */ - 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:; - __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:; - __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":144 - * self.stack.append((newdfa, 0, newnode)) - * - * cdef void pop(self): # <<<<<<<<<<<<<< - * """Pop a nonterminal. (Internal)""" - * popdfa, popstate, popnode = self.stack.pop() - */ - -static void __pyx_f_6sphinx_6pycode_5pgen2_5parse_6Parser_pop(struct __pyx_obj_6sphinx_6pycode_5pgen2_5parse_Parser *__pyx_v_self) { - PyObject *__pyx_v_popdfa; - PyObject *__pyx_v_popstate; - PyObject *__pyx_v_popnode; - PyObject *__pyx_v_newnode; - PyObject *__pyx_v_dfa; - PyObject *__pyx_v_state; - PyObject *__pyx_v_node; - 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_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":147 - * """Pop a nonterminal. (Internal)""" - * popdfa, popstate, popnode = self.stack.pop() - * newnode = self.convert(popnode) # <<<<<<<<<<<<<< - * if newnode is not None: - * if self.stack: - */ - 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_t_6 = (__pyx_v_newnode != Py_None); - if (__pyx_t_6) { - - /* "/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_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":150 - * if newnode is not None: - * if self.stack: - * dfa, state, node = self.stack[-1] # <<<<<<<<<<<<<< - * node[-1].append(newnode) - * else: - */ - __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":151 - * if self.stack: - * dfa, state, node = self.stack[-1] - * node[-1].append(newnode) # <<<<<<<<<<<<<< - * else: - * self.rootnode = newnode - */ - __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":153 - * node[-1].append(newnode) - * else: - * self.rootnode = newnode # <<<<<<<<<<<<<< - * self.rootnode.used_names = self.used_names - * - */ - __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":154 - * else: - * self.rootnode = newnode - * self.rootnode.used_names = self.used_names # <<<<<<<<<<<<<< - * - * cdef convert(self, tuple raw_node): - */ - 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; - } - __pyx_L3:; - - 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); - __Pyx_XDECREF(__pyx_t_5); - __Pyx_WriteUnraisable("sphinx.pycode.pgen2.parse.Parser.pop"); - __pyx_L0:; - __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":156 - * self.rootnode.used_names = self.used_names - * - * cdef convert(self, tuple raw_node): # <<<<<<<<<<<<<< - * type, value, context, children = raw_node - * if children or type in self._grammar_number2symbol: - */ - -static PyObject *__pyx_f_6sphinx_6pycode_5pgen2_5parse_6Parser_convert(struct __pyx_obj_6sphinx_6pycode_5pgen2_5parse_Parser *__pyx_v_self, PyObject *__pyx_v_raw_node) { - PyObject *__pyx_v_type; - PyObject *__pyx_v_value; - PyObject *__pyx_v_context; - PyObject *__pyx_v_children; - 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, 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 (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":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_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; - } - if (__pyx_t_7) { - - /* "/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_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":162 - * # creating a new node. - * if len(children) == 1: - * return children[0] # <<<<<<<<<<<<<< - * return Node(type, children, context=context) - * else: - */ - __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":163 - * if len(children) == 1: - * return children[0] - * return Node(type, children, context=context) # <<<<<<<<<<<<<< - * else: - * return Leaf(type, value, context=context) - */ - __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":165 - * return Node(type, children, context=context) - * else: - * return Leaf(type, value, context=context) # <<<<<<<<<<<<<< - */ - __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; __Pyx_INCREF(Py_None); - 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); - __Pyx_AddTraceback("sphinx.pycode.pgen2.parse.Parser.convert"); - __pyx_r = 0; - __pyx_L0:; - __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; - -static PyObject *__pyx_tp_new_6sphinx_6pycode_5pgen2_5parse_Parser(PyTypeObject *t, PyObject *a, PyObject *k) { - struct __pyx_obj_6sphinx_6pycode_5pgen2_5parse_Parser *p; - PyObject *o = (*t->tp_alloc)(t, 0); - if (!o) return 0; - 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->rootnode = 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->rootnode); - 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); -} - -static int __pyx_tp_traverse_6sphinx_6pycode_5pgen2_5parse_Parser(PyObject *o, visitproc v, void *a) { - int e; - struct __pyx_obj_6sphinx_6pycode_5pgen2_5parse_Parser *p = (struct __pyx_obj_6sphinx_6pycode_5pgen2_5parse_Parser *)o; - if (p->grammar) { - e = (*v)(p->grammar, 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_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; - } - if (p->_grammar_tokens) { - e = (*v)(p->_grammar_tokens, a); if (e) return e; - } - if (p->_grammar_number2symbol) { - e = (*v)(p->_grammar_number2symbol, a); if (e) return e; - } - return 0; -} - -static int __pyx_tp_clear_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; - PyObject* tmp; - tmp = ((PyObject*)p->grammar); - p->grammar = 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->stack); - p->stack = ((PyObject *)Py_None); Py_INCREF(Py_None); - Py_XDECREF(tmp); - 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 = ((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 = ((PyObject *)Py_None); Py_INCREF(Py_None); - Py_XDECREF(tmp); - tmp = ((PyObject*)p->_grammar_tokens); - p->_grammar_tokens = ((PyObject *)Py_None); Py_INCREF(Py_None); - Py_XDECREF(tmp); - tmp = ((PyObject*)p->_grammar_number2symbol); - 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[] = { - {__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[] = { - {(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} -}; - -static PyNumberMethods __pyx_tp_as_number_Parser = { - 0, /*nb_add*/ - 0, /*nb_subtract*/ - 0, /*nb_multiply*/ - #if PY_MAJOR_VERSION < 3 - 0, /*nb_divide*/ - #endif - 0, /*nb_remainder*/ - 0, /*nb_divmod*/ - 0, /*nb_power*/ - 0, /*nb_negative*/ - 0, /*nb_positive*/ - 0, /*nb_absolute*/ - 0, /*nb_nonzero*/ - 0, /*nb_invert*/ - 0, /*nb_lshift*/ - 0, /*nb_rshift*/ - 0, /*nb_and*/ - 0, /*nb_xor*/ - 0, /*nb_or*/ - #if PY_MAJOR_VERSION < 3 - 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*/ - #endif - #if PY_MAJOR_VERSION < 3 - 0, /*nb_hex*/ - #endif - 0, /*nb_inplace_add*/ - 0, /*nb_inplace_subtract*/ - 0, /*nb_inplace_multiply*/ - #if PY_MAJOR_VERSION < 3 - 0, /*nb_inplace_divide*/ - #endif - 0, /*nb_inplace_remainder*/ - 0, /*nb_inplace_power*/ - 0, /*nb_inplace_lshift*/ - 0, /*nb_inplace_rshift*/ - 0, /*nb_inplace_and*/ - 0, /*nb_inplace_xor*/ - 0, /*nb_inplace_or*/ - 0, /*nb_floor_divide*/ - 0, /*nb_true_divide*/ - 0, /*nb_inplace_floor_divide*/ - 0, /*nb_inplace_true_divide*/ - #if (PY_MAJOR_VERSION >= 3) || (Py_TPFLAGS_DEFAULT & Py_TPFLAGS_HAVE_INDEX) - 0, /*nb_index*/ - #endif -}; - -static PySequenceMethods __pyx_tp_as_sequence_Parser = { - 0, /*sq_length*/ - 0, /*sq_concat*/ - 0, /*sq_repeat*/ - 0, /*sq_item*/ - 0, /*sq_slice*/ - 0, /*sq_ass_item*/ - 0, /*sq_ass_slice*/ - 0, /*sq_contains*/ - 0, /*sq_inplace_concat*/ - 0, /*sq_inplace_repeat*/ -}; - -static PyMappingMethods __pyx_tp_as_mapping_Parser = { - 0, /*mp_length*/ - 0, /*mp_subscript*/ - 0, /*mp_ass_subscript*/ -}; - -static PyBufferProcs __pyx_tp_as_buffer_Parser = { - #if PY_MAJOR_VERSION < 3 - 0, /*bf_getreadbuffer*/ - #endif - #if PY_MAJOR_VERSION < 3 - 0, /*bf_getwritebuffer*/ - #endif - #if PY_MAJOR_VERSION < 3 - 0, /*bf_getsegcount*/ - #endif - #if PY_MAJOR_VERSION < 3 - 0, /*bf_getcharbuffer*/ - #endif - #if PY_VERSION_HEX >= 0x02060000 - 0, /*bf_getbuffer*/ - #endif - #if PY_VERSION_HEX >= 0x02060000 - 0, /*bf_releasebuffer*/ - #endif -}; - -PyTypeObject __pyx_type_6sphinx_6pycode_5pgen2_5parse_Parser = { - PyVarObject_HEAD_INIT(0, 0) - __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*/ - 0, /*tp_print*/ - 0, /*tp_getattr*/ - 0, /*tp_setattr*/ - 0, /*tp_compare*/ - 0, /*tp_repr*/ - &__pyx_tp_as_number_Parser, /*tp_as_number*/ - &__pyx_tp_as_sequence_Parser, /*tp_as_sequence*/ - &__pyx_tp_as_mapping_Parser, /*tp_as_mapping*/ - 0, /*tp_hash*/ - 0, /*tp_call*/ - 0, /*tp_str*/ - 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_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*/ - 0, /*tp_richcompare*/ - 0, /*tp_weaklistoffset*/ - 0, /*tp_iter*/ - 0, /*tp_iternext*/ - __pyx_methods_6sphinx_6pycode_5pgen2_5parse_Parser, /*tp_methods*/ - __pyx_members_6sphinx_6pycode_5pgen2_5parse_Parser, /*tp_members*/ - __pyx_getsets_6sphinx_6pycode_5pgen2_5parse_Parser, /*tp_getset*/ - 0, /*tp_base*/ - 0, /*tp_dict*/ - 0, /*tp_descr_get*/ - 0, /*tp_descr_set*/ - 0, /*tp_dictoffset*/ - __pyx_pf_6sphinx_6pycode_5pgen2_5parse_6Parser___init__, /*tp_init*/ - 0, /*tp_alloc*/ - __pyx_tp_new_6sphinx_6pycode_5pgen2_5parse_Parser, /*tp_new*/ - 0, /*tp_free*/ - 0, /*tp_is_gc*/ - 0, /*tp_bases*/ - 0, /*tp_mro*/ - 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[] = { - {0, 0, 0, 0} -}; - -static void __pyx_init_filenames(void); /*proto*/ - -#if PY_MAJOR_VERSION >= 3 -static struct PyModuleDef __pyx_moduledef = { - PyModuleDef_HEAD_INIT, - __Pyx_NAMESTR("parse"), - __Pyx_DOCSTR(__pyx_k_6), /* m_doc */ - -1, /* m_size */ - __pyx_methods /* m_methods */, - NULL, /* m_reload */ - NULL, /* m_traverse */ - NULL, /* m_clear */ - NULL /* m_free */ -}; -#endif - -static __Pyx_StringTabEntry __pyx_string_tab[] = { - {&__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_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) { - #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; -} - -#if PY_MAJOR_VERSION < 3 -PyMODINIT_FUNC initparse(void); /*proto*/ -PyMODINIT_FUNC initparse(void) -#else -PyMODINIT_FUNC PyInit_parse(void); /*proto*/ -PyMODINIT_FUNC PyInit_parse(void) -#endif -{ - 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(); - __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(__Pyx_NAMESTR("parse"), __pyx_methods, __Pyx_DOCSTR(__pyx_k_6), 0, PYTHON_API_VERSION); - #else - __pyx_m = PyModule_Create(&__pyx_moduledef); - #endif - if (!__pyx_m) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; - #if PY_MAJOR_VERSION < 3 - Py_INCREF(__pyx_m); - #endif - __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 (__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;} - /*--- 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 (__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 ---*/ - /*--- Execution code ---*/ - - /* "/home/gbr/devel/sphinx/sphinx/pycode/pgen2/parse.pyx":15 - * """ - * - * from sphinx.pycode.nodes import Node, Leaf # <<<<<<<<<<<<<< - * - * DEF NAME = 1 - */ - __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 - * - * class ParseError(Exception): # <<<<<<<<<<<<<< - * """Exception to signal the parser is stuck.""" - * - */ - __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.""" - * - * def __init__(self, msg, type, value, context): # <<<<<<<<<<<<<< - * Exception.__init__(self, "%s: type=%r, value=%r, context=%r" % - * (msg, type, value, context)) - */ - __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. - * - */ - __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 -} - -static const char *__pyx_filenames[] = { - "parse.pyx", -}; - -/* Runtime support code */ - -static void __pyx_init_filenames(void) { - __pyx_f = __pyx_filenames; -} - -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) -{ - 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 - "%s() got an unexpected keyword argument '%U'", - function_name, key); - #endif -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) { - PyObject *__import__ = 0; - PyObject *empty_list = 0; - PyObject *module = 0; - PyObject *global_dict = 0; - PyObject *empty_dict = 0; - PyObject *list; - __import__ = __Pyx_GetAttrString(__pyx_b, "__import__"); - if (!__import__) - goto bad; - if (from_list) - list = from_list; - else { - empty_list = PyList_New(0); - if (!empty_list) - goto bad; - list = empty_list; - } - global_dict = PyModule_GetDict(__pyx_m); - if (!global_dict) - goto bad; - empty_dict = PyDict_New(); - if (!empty_dict) - goto bad; - module = PyObject_CallFunctionObjArgs(__import__, - name, global_dict, empty_dict, list, NULL); -bad: - Py_XDECREF(empty_list); - Py_XDECREF(__import__); - Py_XDECREF(empty_dict); - return module; -} - -static PyObject *__Pyx_GetName(PyObject *dict, PyObject *name) { - PyObject *result; - result = PyObject_GetAttr(dict, name); - if (!result) - PyErr_SetObject(PyExc_NameError, name); - return result; -} - -static PyObject *__Pyx_CreateClass( - PyObject *bases, PyObject *dict, PyObject *name, const char *modname) -{ - PyObject *py_modname; - PyObject *result = 0; - - #if PY_MAJOR_VERSION < 3 - py_modname = PyString_FromString(modname); - #else - py_modname = PyUnicode_FromString(modname); - #endif - if (!py_modname) - goto bad; - if (PyDict_SetItemString(dict, "__module__", py_modname) < 0) - goto bad; - #if PY_MAJOR_VERSION < 3 - result = PyClass_New(bases, dict, name); - #else - result = PyObject_CallFunctionObjArgs((PyObject *)&PyType_Type, name, bases, dict, NULL); - #endif -bad: - Py_XDECREF(py_modname); - return result; -} - -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 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); - Py_XINCREF(tb); - /* First, check the traceback argument, replacing None with NULL. */ - if (tb == Py_None) { - Py_DECREF(tb); - tb = 0; - } - else if (tb != NULL && !PyTraceBack_Check(tb)) { - PyErr_SetString(PyExc_TypeError, - "raise: arg 3 must be a traceback or None"); - goto raise_error; - } - /* Next, replace a missing value with None */ - if (value == NULL) { - value = Py_None; - Py_INCREF(value); - } - #if PY_VERSION_HEX < 0x02050000 - if (!PyClass_Check(type)) - #else - if (!PyType_Check(type)) - #endif - { - /* Raising an instance. The value should be a dummy. */ - if (value != Py_None) { - PyErr_SetString(PyExc_TypeError, - "instance exception may not have a separate value"); - goto raise_error; - } - /* Normalize to raise <class>, <instance> */ - Py_DECREF(value); - value = type; - #if PY_VERSION_HEX < 0x02050000 - if (PyInstance_Check(type)) { - type = (PyObject*) ((PyInstanceObject*)type)->in_class; - Py_INCREF(type); - } - else { - type = 0; - PyErr_SetString(PyExc_TypeError, - "raise: exception must be an old-style class or instance"); - goto raise_error; - } - #else - type = (PyObject*) Py_TYPE(type); - Py_INCREF(type); - if (!PyType_IsSubtype((PyTypeObject *)type, (PyTypeObject *)PyExc_BaseException)) { - PyErr_SetString(PyExc_TypeError, - "raise: exception class must be a subclass of BaseException"); - goto raise_error; - } - #endif - } - - __Pyx_ErrRestore(type, value, tb); - return; -raise_error: - Py_XDECREF(value); - Py_XDECREF(type); - Py_XDECREF(tb); - 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; - __Pyx_ErrFetch(&old_exc, &old_val, &old_tb); - #if PY_MAJOR_VERSION < 3 - ctx = PyString_FromString(name); - #else - ctx = PyUnicode_FromString(name); - #endif - __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) { -#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__", ob) < 0) - goto bad; - Py_DECREF(ob); - return 0; -bad: - Py_XDECREF(ob); - return -1; -} - -#include "compile.h" -#include "frameobject.h" -#include "traceback.h" - -static void __Pyx_AddTraceback(const char *funcname) { - PyObject *py_srcfile = 0; - PyObject *py_funcname = 0; - PyObject *py_globals = 0; - PyCodeObject *py_code = 0; - PyFrameObject *py_frame = 0; - - #if PY_MAJOR_VERSION < 3 - py_srcfile = PyString_FromString(__pyx_filename); - #else - py_srcfile = PyUnicode_FromString(__pyx_filename); - #endif - if (!py_srcfile) goto bad; - if (__pyx_clineno) { - #if PY_MAJOR_VERSION < 3 - py_funcname = PyString_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, __pyx_clineno); - #else - py_funcname = PyUnicode_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, __pyx_clineno); - #endif - } - else { - #if PY_MAJOR_VERSION < 3 - py_funcname = PyString_FromString(funcname); - #else - py_funcname = PyUnicode_FromString(funcname); - #endif - } - if (!py_funcname) goto bad; - py_globals = PyModule_GetDict(__pyx_m); - if (!py_globals) goto bad; - py_code = PyCode_New( - 0, /*int argcount,*/ - #if PY_MAJOR_VERSION >= 3 - 0, /*int kwonlyargcount,*/ - #endif - 0, /*int nlocals,*/ - 0, /*int stacksize,*/ - 0, /*int flags,*/ - __pyx_empty_bytes, /*PyObject *code,*/ - __pyx_empty_tuple, /*PyObject *consts,*/ - __pyx_empty_tuple, /*PyObject *names,*/ - __pyx_empty_tuple, /*PyObject *varnames,*/ - __pyx_empty_tuple, /*PyObject *freevars,*/ - __pyx_empty_tuple, /*PyObject *cellvars,*/ - py_srcfile, /*PyObject *filename,*/ - py_funcname, /*PyObject *name,*/ - __pyx_lineno, /*int firstlineno,*/ - __pyx_empty_bytes /*PyObject *lnotab*/ - ); - if (!py_code) goto bad; - py_frame = PyFrame_New( - PyThreadState_GET(), /*PyThreadState *tstate,*/ - py_code, /*PyCodeObject *code,*/ - py_globals, /*PyObject *globals,*/ - 0 /*PyObject *locals*/ - ); - if (!py_frame) goto bad; - py_frame->f_lineno = __pyx_lineno; - PyTraceBack_Here(py_frame); -bad: - Py_XDECREF(py_srcfile); - Py_XDECREF(py_funcname); - Py_XDECREF(py_code); - Py_XDECREF(py_frame); -} - -static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) { - while (t->p) { - #if PY_MAJOR_VERSION < 3 - if (t->is_unicode) { - *t->p = PyUnicode_DecodeUTF8(t->s, t->n - 1, NULL); - } else if (t->intern) { - *t->p = PyString_InternFromString(t->s); - } else { - *t->p = PyString_FromStringAndSize(t->s, t->n - 1); - } - #else /* Python 3+ has unicode identifiers */ - 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); - } - #endif - if (!*t->p) - return -1; - ++t; - } - return 0; -} - -/* Type Conversion Functions */ - -static INLINE int __Pyx_PyObject_IsTrue(PyObject* x) { - if (x == Py_True) return 1; - else if ((x == Py_False) | (x == Py_None)) return 0; - else return PyObject_IsTrue(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 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 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 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; -} - - -#endif /* Py_PYTHON_H */ diff -Nru sphinx-1.0~hg20100604/sphinx/pycode/pgen2/parse.pyx sphinx-1.0.7/sphinx/pycode/pgen2/parse.pyx --- sphinx-1.0~hg20100604/sphinx/pycode/pgen2/parse.pyx 2010-05-06 16:30:00.000000000 +0000 +++ sphinx-1.0.7/sphinx/pycode/pgen2/parse.pyx 1970-01-01 00:00:00.000000000 +0000 @@ -1,165 +0,0 @@ -# Copyright 2004-2005 Elemental Security, Inc. All Rights Reserved. -# Licensed to PSF under a Contributor Agreement. - -# Adapted from parse.py to be compiled with Cython by Georg Brandl. - -"""Parser engine for the grammar tables generated by pgen. - -The grammar table must be loaded first. - -See Parser/parser.c in the Python distribution for additional info on -how this parsing engine works. - -""" - -from sphinx.pycode.nodes import Node, Leaf - -DEF NAME = 1 - -class ParseError(Exception): - """Exception to signal the parser is stuck.""" - - def __init__(self, msg, type, value, context): - Exception.__init__(self, "%s: type=%r, value=%r, context=%r" % - (msg, type, value, context)) - self.msg = msg - self.type = type - self.value = value - self.context = context - - -cdef class Parser: - 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 - #self.convert = convert or noconvert - - 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 - self._grammar_start = grammar.start - - def setup(self, start=None): - if start is None: - 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. - 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() - - 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 - ilabel = self.classify(type, value, context) - # Loop until the token is shifted; may raise exceptions - while True: - dfa, state, node = self.stack[-1] - states, first = dfa - arcs = states[state] - # 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 - ## 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 - while states[state] == [(0, state)]: - self.pop() - if not self.stack: - # Done parsing! - return True - dfa, state, node = self.stack[-1] - 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 - itsdfa = self._grammar_dfas[t] - itsstates, itsfirst = itsdfa - if ilabel in itsfirst: - # Push a symbol - self.push(t, itsdfa, newstate, context) - break # To continue the outer while loop - else: - if (0, state) in arcs: - # 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", - type, value, context) - else: - # No success finding a transition - raise ParseError("bad input", 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 - 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 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) - if newnode is not None: - node[-1].append(newnode) - self.stack[-1] = (dfa, newstate, node) - - 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) - self.stack.append((newdfa, 0, newnode)) - - cdef void pop(self): - """Pop a nonterminal. (Internal)""" - popdfa, popstate, popnode = self.stack.pop() - newnode = self.convert(popnode) - if newnode is not None: - if self.stack: - dfa, state, node = self.stack[-1] - node[-1].append(newnode) - else: - self.rootnode = newnode - self.rootnode.used_names = self.used_names - - 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. - if len(children) == 1: - return children[0] - return Node(type, children, context=context) - else: - return Leaf(type, value, context=context) diff -Nru sphinx-1.0~hg20100604/sphinx/quickstart.py sphinx-1.0.7/sphinx/quickstart.py --- sphinx-1.0~hg20100604/sphinx/quickstart.py 2010-06-03 22:12:22.000000000 +0000 +++ sphinx-1.0.7/sphinx/quickstart.py 2011-01-04 09:00:04.000000000 +0000 @@ -5,7 +5,7 @@ Quickly setup documentation source to work with Sphinx. - :copyright: Copyright 2007-2010 by the Sphinx team, see AUTHORS. + :copyright: Copyright 2007-2011 by the Sphinx team, see AUTHORS. :license: BSD, see LICENSE for details. """ @@ -42,7 +42,7 @@ # If extensions (or modules to document with autodoc) are in another directory, # add these directories to sys.path here. If the directory is relative to the # documentation root, use os.path.abspath to make it absolute, like shown here. -#sys.path.append(os.path.abspath('.')) +#sys.path.insert(0, os.path.abspath('.')) # -- General configuration ----------------------------------------------------- @@ -186,8 +186,8 @@ # base URL from which the finished HTML is served. #html_use_opensearch = '' -# If nonempty, this is the file name suffix for HTML files (e.g. ".xhtml"). -#html_file_suffix = '' +# This is the file name suffix for HTML files (e.g. ".xhtml"). +#html_file_suffix = None # Output file base name for HTML help builder. htmlhelp_basename = '%(project_fn)sdoc' @@ -279,6 +279,9 @@ # The depth of the table of contents in toc.ncx. #epub_tocdepth = 3 + +# Allow duplicate toc entries. +#epub_tocdup = True ''' INTERSPHINX_CONFIG = ''' @@ -492,6 +495,7 @@ if "%%1" == "html" ( \t%%SPHINXBUILD%% -b html %%ALLSPHINXOPTS%% %%BUILDDIR%%/html +\tif errorlevel 1 exit /b 1 \techo. \techo.Build finished. The HTML pages are in %%BUILDDIR%%/html. \tgoto end @@ -499,6 +503,7 @@ if "%%1" == "dirhtml" ( \t%%SPHINXBUILD%% -b dirhtml %%ALLSPHINXOPTS%% %%BUILDDIR%%/dirhtml +\tif errorlevel 1 exit /b 1 \techo. \techo.Build finished. The HTML pages are in %%BUILDDIR%%/dirhtml. \tgoto end @@ -506,6 +511,7 @@ if "%%1" == "singlehtml" ( \t%%SPHINXBUILD%% -b singlehtml %%ALLSPHINXOPTS%% %%BUILDDIR%%/singlehtml +\tif errorlevel 1 exit /b 1 \techo. \techo.Build finished. The HTML pages are in %%BUILDDIR%%/singlehtml. \tgoto end @@ -513,6 +519,7 @@ if "%%1" == "pickle" ( \t%%SPHINXBUILD%% -b pickle %%ALLSPHINXOPTS%% %%BUILDDIR%%/pickle +\tif errorlevel 1 exit /b 1 \techo. \techo.Build finished; now you can process the pickle files. \tgoto end @@ -520,6 +527,7 @@ if "%%1" == "json" ( \t%%SPHINXBUILD%% -b json %%ALLSPHINXOPTS%% %%BUILDDIR%%/json +\tif errorlevel 1 exit /b 1 \techo. \techo.Build finished; now you can process the JSON files. \tgoto end @@ -527,6 +535,7 @@ if "%%1" == "htmlhelp" ( \t%%SPHINXBUILD%% -b htmlhelp %%ALLSPHINXOPTS%% %%BUILDDIR%%/htmlhelp +\tif errorlevel 1 exit /b 1 \techo. \techo.Build finished; now you can run HTML Help Workshop with the ^ .hhp project file in %%BUILDDIR%%/htmlhelp. @@ -535,6 +544,7 @@ if "%%1" == "qthelp" ( \t%%SPHINXBUILD%% -b qthelp %%ALLSPHINXOPTS%% %%BUILDDIR%%/qthelp +\tif errorlevel 1 exit /b 1 \techo. \techo.Build finished; now you can run "qcollectiongenerator" with the ^ .qhcp project file in %%BUILDDIR%%/qthelp, like this: @@ -546,6 +556,7 @@ if "%%1" == "devhelp" ( \t%%SPHINXBUILD%% -b devhelp %%ALLSPHINXOPTS%% %%BUILDDIR%%/devhelp +\tif errorlevel 1 exit /b 1 \techo. \techo.Build finished. \tgoto end @@ -553,6 +564,7 @@ if "%%1" == "epub" ( \t%%SPHINXBUILD%% -b epub %%ALLSPHINXOPTS%% %%BUILDDIR%%/epub +\tif errorlevel 1 exit /b 1 \techo. \techo.Build finished. The epub file is in %%BUILDDIR%%/epub. \tgoto end @@ -560,6 +572,7 @@ if "%%1" == "latex" ( \t%%SPHINXBUILD%% -b latex %%ALLSPHINXOPTS%% %%BUILDDIR%%/latex +\tif errorlevel 1 exit /b 1 \techo. \techo.Build finished; the LaTeX files are in %%BUILDDIR%%/latex. \tgoto end @@ -567,6 +580,7 @@ if "%%1" == "text" ( \t%%SPHINXBUILD%% -b text %%ALLSPHINXOPTS%% %%BUILDDIR%%/text +\tif errorlevel 1 exit /b 1 \techo. \techo.Build finished. The text files are in %%BUILDDIR%%/text. \tgoto end @@ -574,6 +588,7 @@ if "%%1" == "man" ( \t%%SPHINXBUILD%% -b man %%ALLSPHINXOPTS%% %%BUILDDIR%%/man +\tif errorlevel 1 exit /b 1 \techo. \techo.Build finished. The manual pages are in %%BUILDDIR%%/man. \tgoto end @@ -581,6 +596,7 @@ if "%%1" == "changes" ( \t%%SPHINXBUILD%% -b changes %%ALLSPHINXOPTS%% %%BUILDDIR%%/changes +\tif errorlevel 1 exit /b 1 \techo. \techo.The overview file is in %%BUILDDIR%%/changes. \tgoto end @@ -588,6 +604,7 @@ if "%%1" == "linkcheck" ( \t%%SPHINXBUILD%% -b linkcheck %%ALLSPHINXOPTS%% %%BUILDDIR%%/linkcheck +\tif errorlevel 1 exit /b 1 \techo. \techo.Link check complete; look for any errors in the above output ^ or in %%BUILDDIR%%/linkcheck/output.txt. @@ -596,6 +613,7 @@ if "%%1" == "doctest" ( \t%%SPHINXBUILD%% -b doctest %%ALLSPHINXOPTS%% %%BUILDDIR%%/doctest +\tif errorlevel 1 exit /b 1 \techo. \techo.Testing of doctests in the sources finished, look at the ^ results in %%BUILDDIR%%/doctest/output.txt. diff -Nru sphinx-1.0~hg20100604/sphinx/roles.py sphinx-1.0.7/sphinx/roles.py --- sphinx-1.0~hg20100604/sphinx/roles.py 2010-06-03 22:12:22.000000000 +0000 +++ sphinx-1.0.7/sphinx/roles.py 2011-01-08 15:16:43.000000000 +0000 @@ -5,7 +5,7 @@ Handlers for additional ReST roles. - :copyright: Copyright 2007-2010 by the Sphinx team, see AUTHORS. + :copyright: Copyright 2007-2011 by the Sphinx team, see AUTHORS. :license: BSD, see LICENSE for details. """ @@ -69,9 +69,10 @@ innernodeclass = nodes.literal def __init__(self, fix_parens=False, lowercase=False, - nodeclass=None, innernodeclass=None): + nodeclass=None, innernodeclass=None, warn_dangling=False): self.fix_parens = fix_parens self.lowercase = lowercase + self.warn_dangling = warn_dangling if nodeclass is not None: self.nodeclass = nodeclass if innernodeclass is not None: @@ -105,9 +106,9 @@ 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) + text = utils.unescape(text)[1:] if self.fix_parens: - text, tgt = self._fix_parens(env, False, text[1:], "") + text, tgt = self._fix_parens(env, False, text, "") innernode = self.innernodeclass(rawtext, text, classes=classes) return self.result_nodes(inliner.document, env, innernode, is_ref=False) @@ -133,6 +134,7 @@ refnode += self.innernodeclass(rawtext, title, classes=classes) # we also need the source document refnode['refdoc'] = env.docname + refnode['refwarn'] = self.warn_dangling # result_nodes allow further modification of return values return self.result_nodes(inliner.document, env, refnode, is_ref=True) @@ -173,6 +175,10 @@ indexnode['entries'] = [ ('single', _('Python Enhancement Proposals!PEP %s') % text, targetid, 'PEP %s' % text)] + anchor = '' + anchorindex = text.find('#') + if anchorindex > 0: + text, anchor = text[:anchorindex], text[anchorindex:] try: pepnum = int(text) except ValueError: @@ -182,12 +188,17 @@ return [prb], [msg] ref = inliner.document.settings.pep_base_url + 'pep-%04d' % pepnum sn = nodes.strong('PEP '+text, 'PEP '+text) - rn = nodes.reference('', '', internal=False, refuri=ref, classes=[typ]) + rn = nodes.reference('', '', internal=False, refuri=ref+anchor, + classes=[typ]) rn += sn return [indexnode, targetnode, rn], [] elif typ == 'rfc': indexnode['entries'] = [('single', 'RFC; RFC %s' % text, targetid, 'RFC %s' % text)] + anchor = '' + anchorindex = text.find('#') + if anchorindex > 0: + text, anchor = text[:anchorindex], text[anchorindex:] try: rfcnum = int(text) except ValueError: @@ -197,7 +208,8 @@ return [prb], [msg] ref = inliner.document.settings.rfc_base_url + inliner.rfc_url % rfcnum sn = nodes.strong('RFC '+text, 'RFC '+text) - rn = nodes.reference('', '', internal=False, refuri=ref, classes=[typ]) + rn = nodes.reference('', '', internal=False, refuri=ref+anchor, + classes=[typ]) rn += sn return [indexnode, targetnode, rn], [] @@ -205,8 +217,9 @@ _amp_re = re.compile(r'(?<!&)&(?![&\s])') def menusel_role(typ, rawtext, text, lineno, inliner, options={}, content=[]): + text = utils.unescape(text) if typ == 'menuselection': - text = utils.unescape(text).replace('-->', u'\N{TRIANGULAR BULLET}') + text = text.replace('-->', u'\N{TRIANGULAR BULLET}') spans = _amp_re.split(text) node = nodes.emphasis(rawtext=rawtext) diff -Nru sphinx-1.0~hg20100604/sphinx/search.py sphinx-1.0.7/sphinx/search.py --- sphinx-1.0~hg20100604/sphinx/search.py 2010-06-03 22:12:22.000000000 +0000 +++ sphinx-1.0.7/sphinx/search.py 2011-01-04 09:00:04.000000000 +0000 @@ -5,7 +5,7 @@ Create a search index for offline search. - :copyright: Copyright 2007-2010 by the Sphinx team, see AUTHORS. + :copyright: Copyright 2007-2011 by the Sphinx team, see AUTHORS. :license: BSD, see LICENSE for details. """ import re diff -Nru sphinx-1.0~hg20100604/sphinx/setup_command.py sphinx-1.0.7/sphinx/setup_command.py --- sphinx-1.0~hg20100604/sphinx/setup_command.py 2010-05-06 16:30:00.000000000 +0000 +++ sphinx-1.0.7/sphinx/setup_command.py 2011-01-08 09:06:31.000000000 +0000 @@ -8,7 +8,7 @@ :author: Sebastian Wiesner :contact: basti.wiesner@gmx.net - :copyright: Copyright 2007-2010 by the Sphinx team, see AUTHORS. + :copyright: Copyright 2007-2011 by the Sphinx team, see AUTHORS. :license: BSD, see LICENSE for details. """ @@ -35,13 +35,13 @@ cmdclass = {'build_sphinx': BuildDoc} name = 'My project' - version = 1.2 - release = 1.2.0 + version = '1.2' + release = '1.2.0' setup( name=name, author='Bernard Montgomery', version=release, - cmdclass={'build_sphinx': BuildDoc}, + cmdclass=cmdclass, # these are optional and override conf.py settings command_options={ 'build_sphinx': { @@ -110,7 +110,6 @@ build = self.get_finalized_command('build') self.build_dir = os.path.join(build.build_base, 'sphinx') self.mkpath(self.build_dir) - self.ensure_dirname('build_dir') self.doctree_dir = os.path.join(self.build_dir, 'doctrees') self.mkpath(self.doctree_dir) self.builder_target_dir = os.path.join(self.build_dir, self.builder) @@ -137,14 +136,11 @@ freshenv=self.fresh_env) try: - if self.all_files: - app.builder.build_all() - else: - app.builder.build_update() + app.build(force_all=self.all_files) except Exception, err: from docutils.utils import SystemMessage if isinstance(err, SystemMessage): - sys.stderr, darkred('reST markup error:') + print >>sys.stderr, darkred('reST markup error:') print >>sys.stderr, err.args[0].encode('ascii', 'backslashreplace') else: diff -Nru sphinx-1.0~hg20100604/sphinx/texinputs/Makefile sphinx-1.0.7/sphinx/texinputs/Makefile --- sphinx-1.0~hg20100604/sphinx/texinputs/Makefile 2010-05-06 16:30:00.000000000 +0000 +++ sphinx-1.0.7/sphinx/texinputs/Makefile 2011-01-04 09:00:04.000000000 +0000 @@ -14,6 +14,15 @@ all-dvi: $(ALLDVI) all-ps: all-dvi for f in *.dvi; do dvips $$f; done +all-pdf-ja: $(wildcard *.tex) + ebb $(wildcard *.pdf *.png *.gif *.jpeg) + platex -kanji=utf8 $(LATEXOPTS) '$<' + platex -kanji=utf8 $(LATEXOPTS) '$<' + platex -kanji=utf8 $(LATEXOPTS) '$<' + -mendex -U -f -d '$(basename $<).dic' -s python.ist '$(basename $<).idx' + platex -kanji=utf8 $(LATEXOPTS) '$<' + platex -kanji=utf8 $(LATEXOPTS) '$<' + dvipdfmx '$(basename $<).dvi' zip: all-$(FMT) mkdir $(ARCHIVEPREFIX)docs-$(FMT) @@ -49,8 +58,7 @@ pdflatex $(LATEXOPTS) '$<' clean: - rm -f *.pdf *.dvi *.ps - rm -f *.log *.ind *.aux *.toc *.syn *.idx *.out *.ilg *.pla + rm -f *.dvi *.log *.ind *.aux *.toc *.syn *.idx *.out *.ilg *.pla .PHONY: all all-pdf all-dvi all-ps clean diff -Nru sphinx-1.0~hg20100604/sphinx/texinputs/sphinx.sty sphinx-1.0.7/sphinx/texinputs/sphinx.sty --- sphinx-1.0~hg20100604/sphinx/texinputs/sphinx.sty 2010-05-06 16:30:00.000000000 +0000 +++ sphinx-1.0.7/sphinx/texinputs/sphinx.sty 2011-01-15 09:51:52.000000000 +0000 @@ -16,6 +16,7 @@ \RequirePackage{amsmath} % for \text \RequirePackage{makeidx} \RequirePackage{framed} +\RequirePackage{ifthen} \RequirePackage{color} % For highlighted code. \RequirePackage{fancyvrb} @@ -137,15 +138,11 @@ % Play with vspace to be able to keep the indentation. \newlength\distancetoright -\newlength\leftsidespace \def\mycolorbox#1{% - \setlength\leftsidespace{\@totalleftmargin}% \setlength\distancetoright{\linewidth}% \advance\distancetoright -\@totalleftmargin % - \noindent\hspace*{\@totalleftmargin}% \fcolorbox{VerbatimBorderColor}{VerbatimColor}{% \begin{minipage}{\distancetoright}% - \noindent\hspace*{-\leftsidespace}% #1 \end{minipage}% }% @@ -209,7 +206,7 @@ {\py@TitleColor\thesubsection}{0.5em}{\py@TitleColor}{\py@NormalColor} \titleformat{\subsubsection}{\py@HeaderFamily}% {\py@TitleColor\thesubsubsection}{0.5em}{\py@TitleColor}{\py@NormalColor} -\titleformat{\paragraph}{\large\py@HeaderFamily}% +\titleformat{\paragraph}{\small\py@HeaderFamily}% {\py@TitleColor}{0em}{\py@TitleColor}{\py@NormalColor} % {fulllineitems} is the main environment for object descriptions. @@ -240,21 +237,12 @@ \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 -% be used in practice, so a subsequent revision will change things -% again. This version has problems, but shows how to do something -% that proved more tedious than I'd expected, so I don't want to lose -% the example completely. -% -\newcommand{\grammartoken}[1]{\texttt{#1}} -\newenvironment{productionlist}[1][\@undefined]{ - \def\optional##1{{\Large[}##1{\Large]}} - \def\production##1##2{\hypertarget{grammar-token-##1}{}% - \code{##1}&::=&\code{##2}\\} - \def\productioncont##1{& &\code{##1}\\} - \def\token##1{##1} - \let\grammartoken=\token +% Production lists +% +\newenvironment{productionlist}{ +% \def\optional##1{{\Large[}##1{\Large]}} + \def\production##1##2{\\\code{##1}&::=&\code{##2}} + \def\productioncont##1{\\& &\code{##1}} \parindent=2em \indent \begin{tabular}{lcl} @@ -268,11 +256,11 @@ \newcommand{\py@heavybox}{ \setlength{\fboxrule}{1pt} - \setlength{\fboxsep}{7pt} + \setlength{\fboxsep}{6pt} \setlength{\py@noticelength}{\linewidth} \addtolength{\py@noticelength}{-2\fboxsep} \addtolength{\py@noticelength}{-2\fboxrule} - \setlength{\shadowsize}{3pt} + %\setlength{\shadowsize}{3pt} \Sbox \minipage{\py@noticelength} } @@ -282,15 +270,26 @@ \fbox{\TheSbox} } +\newcommand{\py@lightbox}{{% + \setlength\parskip{0pt}\par + \rule[0ex]{\linewidth}{0.5pt}% + \par\vspace{-0.5ex}% + }} +\newcommand{\py@endlightbox}{{% + \setlength{\parskip}{0pt}% + \par\rule[0.5ex]{\linewidth}{0.5pt}% + \par\vspace{-0.5ex}% + }} + % Some are quite plain: -\newcommand{\py@noticestart@note}{} -\newcommand{\py@noticeend@note}{} -\newcommand{\py@noticestart@hint}{} -\newcommand{\py@noticeend@hint}{} -\newcommand{\py@noticestart@important}{} -\newcommand{\py@noticeend@important}{} -\newcommand{\py@noticestart@tip}{} -\newcommand{\py@noticeend@tip}{} +\newcommand{\py@noticestart@note}{\py@lightbox} +\newcommand{\py@noticeend@note}{\py@endlightbox} +\newcommand{\py@noticestart@hint}{\py@lightbox} +\newcommand{\py@noticeend@hint}{\py@endlightbox} +\newcommand{\py@noticestart@important}{\py@lightbox} +\newcommand{\py@noticeend@important}{\py@endlightbox} +\newcommand{\py@noticestart@tip}{\py@lightbox} +\newcommand{\py@noticeend@tip}{\py@endlightbox} % Others gets more visible distinction: \newcommand{\py@noticestart@warning}{\py@heavybox} @@ -307,7 +306,7 @@ \newenvironment{notice}[2]{ \def\py@noticetype{#1} \csname py@noticestart@#1\endcsname - \par\strong{#2} + \strong{#2} }{\csname py@noticeend@\py@noticetype\endcsname} % Allow the release number to be specified independently of the @@ -446,6 +445,10 @@ linkcolor=InnerLinkColor,filecolor=OuterLinkColor, menucolor=OuterLinkColor,urlcolor=OuterLinkColor, citecolor=InnerLinkColor]{hyperref} +% Fix anchor placement for figures with captions. +% (Note: we don't use a package option here; instead, we give an explicit +% \capstart for figures that actually have a caption.) +\RequirePackage{hypcap} % From docutils.writers.latex2e \providecommand{\DUspan}[2]{% @@ -458,3 +461,21 @@ {#2}% node content }% close "span" } + +\providecommand*{\DUprovidelength}[2]{ + \ifthenelse{\isundefined{#1}}{\newlength{#1}\setlength{#1}{#2}}{} +} + +\DUprovidelength{\DUlineblockindent}{2.5em} +\ifthenelse{\isundefined{\DUlineblock}}{ + \newenvironment{DUlineblock}[1]{% + \list{}{\setlength{\partopsep}{\parskip} + \addtolength{\partopsep}{\baselineskip} + \setlength{\topsep}{0pt} + \setlength{\itemsep}{0.15\baselineskip} + \setlength{\parsep}{0pt} + \setlength{\leftmargin}{#1}} + \raggedright + } + {\endlist} +}{} diff -Nru sphinx-1.0~hg20100604/sphinx/themes/agogo/layout.html sphinx-1.0.7/sphinx/themes/agogo/layout.html --- sphinx-1.0~hg20100604/sphinx/themes/agogo/layout.html 2010-05-06 16:30:00.000000000 +0000 +++ sphinx-1.0.7/sphinx/themes/agogo/layout.html 2011-01-04 09:00:04.000000000 +0000 @@ -5,7 +5,7 @@ Sphinx layout template for the agogo theme, originally written by Andi Albrecht. - :copyright: Copyright 2007-2010 by the Sphinx team, see AUTHORS. + :copyright: Copyright 2007-2011 by the Sphinx team, see AUTHORS. :license: BSD, see LICENSE for details. #} {% extends "basic/layout.html" %} @@ -22,8 +22,8 @@ <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 }}" + {%- for rellink in rellinks|reverse %} + <a href="{{ pathto(rellink[0]) }}" title="{{ rellink[1]|striptags|e }}" {{ accesskey(rellink[2]) }}>{{ rellink[3] }}</a> {%- if not loop.last %}{{ reldelim2 }}{% endif %} {%- endfor %} @@ -67,8 +67,8 @@ <div class="footer-wrapper"> <div class="footer"> <div class="left"> - {%- for rellink in rellinks %} - <a href="{{ pathto(rellink[0]) }}" title="{{ rellink[1]|striptags }}" + {%- for rellink in rellinks|reverse %} + <a href="{{ pathto(rellink[0]) }}" title="{{ rellink[1]|striptags|e }}" {{ accesskey(rellink[2]) }}>{{ rellink[3] }}</a> {%- if not loop.last %}{{ reldelim2 }}{% endif %} {%- endfor %} diff -Nru sphinx-1.0~hg20100604/sphinx/themes/agogo/static/agogo.css_t sphinx-1.0.7/sphinx/themes/agogo/static/agogo.css_t --- sphinx-1.0~hg20100604/sphinx/themes/agogo/static/agogo.css_t 2010-06-03 22:12:22.000000000 +0000 +++ sphinx-1.0.7/sphinx/themes/agogo/static/agogo.css_t 2011-01-04 09:00:04.000000000 +0000 @@ -4,7 +4,7 @@ * * Sphinx stylesheet -- agogo theme. * - * :copyright: Copyright 2007-2010 by the Sphinx team, see AUTHORS. + * :copyright: Copyright 2007-2011 by the Sphinx team, see AUTHORS. * :license: BSD, see LICENSE for details. * */ @@ -326,6 +326,37 @@ /* Styles copied from basic theme */ +img.align-left, .figure.align-left, object.align-left { + clear: left; + float: left; + margin-right: 1em; +} + +img.align-right, .figure.align-right, object.align-right { + clear: right; + float: right; + margin-left: 1em; +} + +img.align-center, .figure.align-center, object.align-center { + display: block; + margin-left: auto; + margin-right: auto; +} + +.align-left { + text-align: left; +} + +.align-center { + clear: both; + text-align: center; +} + +.align-right { + text-align: right; +} + /* -- search page ----------------------------------------------------------- */ ul.search { diff -Nru sphinx-1.0~hg20100604/sphinx/themes/basic/defindex.html sphinx-1.0.7/sphinx/themes/basic/defindex.html --- sphinx-1.0~hg20100604/sphinx/themes/basic/defindex.html 2010-05-06 16:30:00.000000000 +0000 +++ sphinx-1.0.7/sphinx/themes/basic/defindex.html 2011-01-04 09:00:04.000000000 +0000 @@ -4,7 +4,7 @@ Default template for the "index" page. - :copyright: Copyright 2007-2010 by the Sphinx team, see AUTHORS. + :copyright: Copyright 2007-2011 by the Sphinx team, see AUTHORS. :license: BSD, see LICENSE for details. #} {% extends "layout.html" %} diff -Nru sphinx-1.0~hg20100604/sphinx/themes/basic/domainindex.html sphinx-1.0.7/sphinx/themes/basic/domainindex.html --- sphinx-1.0~hg20100604/sphinx/themes/basic/domainindex.html 2010-05-06 16:30:00.000000000 +0000 +++ sphinx-1.0.7/sphinx/themes/basic/domainindex.html 2011-01-15 13:43:33.000000000 +0000 @@ -4,7 +4,7 @@ Template for domain indices (module index, ...). - :copyright: Copyright 2007-2010 by the Sphinx team, see AUTHORS. + :copyright: Copyright 2007-2011 by the Sphinx team, see AUTHORS. :license: BSD, see LICENSE for details. #} {% extends "layout.html" %} @@ -19,7 +19,7 @@ {% endblock %} {% block body %} - {%- set curr_group = 0 %} + {%- set groupid = idgen() %} <h1>{{ indextitle }}</h1> @@ -33,15 +33,14 @@ <table class="indextable modindextable" cellspacing="0" cellpadding="2"> {%- for letter, entries in content %} <tr class="pcap"><td></td><td> </td><td></td></tr> - <tr class="cap"><td></td><td><a name="cap-{{ letter }}"> - <strong>{{ letter }}</strong></a></td><td></td></tr> + <tr class="cap" id="cap-{{ letter }}"><td></td><td> + <strong>{{ letter }}</strong></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 %}> + <tr{% if grouptype == 2 %} class="cg-{{ groupid.current() }}"{% endif %}> <td>{% if grouptype == 1 -%} - <img src="{{ pathto('_static/minus.png', 1) }}" id="toggle-{{ curr_group }}" - class="toggler" style="display: none" alt="-" /> + <img src="{{ pathto('_static/minus.png', 1) }}" class="toggler" + id="toggle-{{ groupid.next() }}" style="display: none" alt="-" /> {%- endif %}</td> <td>{% if grouptype == 2 %}   {% endif %} {% if page %}<a href="{{ pathto(page) }}#{{ anchor }}">{% endif -%} diff -Nru sphinx-1.0~hg20100604/sphinx/themes/basic/genindex.html sphinx-1.0.7/sphinx/themes/basic/genindex.html --- sphinx-1.0~hg20100604/sphinx/themes/basic/genindex.html 2010-05-06 16:30:00.000000000 +0000 +++ sphinx-1.0.7/sphinx/themes/basic/genindex.html 2011-01-15 13:38:27.000000000 +0000 @@ -4,7 +4,7 @@ Template for an "all-in-one" index. - :copyright: Copyright 2007-2010 by the Sphinx team, see AUTHORS. + :copyright: Copyright 2007-2011 by the Sphinx team, see AUTHORS. :license: BSD, see LICENSE for details. #} {% extends "layout.html" %} @@ -21,9 +21,9 @@ {%- for key, entries in genindexentries %} <h2 id="{{ key }}">{{ key }}</h2> -<table width="100%" class="indextable genindextable"><tr> +<table style="width: 100%" class="indextable genindextable"><tr> {%- for column in entries|slice(2) if column %} - <td width="33%" valign="top"><dl> + <td style="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 %} diff -Nru sphinx-1.0~hg20100604/sphinx/themes/basic/genindex-single.html sphinx-1.0.7/sphinx/themes/basic/genindex-single.html --- sphinx-1.0~hg20100604/sphinx/themes/basic/genindex-single.html 2010-05-06 16:30:00.000000000 +0000 +++ sphinx-1.0.7/sphinx/themes/basic/genindex-single.html 2011-01-15 13:38:45.000000000 +0000 @@ -4,7 +4,7 @@ Template for a "single" page of a split index. - :copyright: Copyright 2007-2010 by the Sphinx team, see AUTHORS. + :copyright: Copyright 2007-2011 by the Sphinx team, see AUTHORS. :license: BSD, see LICENSE for details. #} {% extends "layout.html" %} @@ -13,9 +13,9 @@ <h1 id="index">{% trans key=key %}Index – {{ key }}{% endtrans %}</h1> -<table width="100%" class="indextable"><tr> +<table style="width: 100%" class="indextable"><tr> {%- for column in entries|slice(2) if column %} - <td width="33%" valign="top"><dl> + <td style="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 %} diff -Nru sphinx-1.0~hg20100604/sphinx/themes/basic/genindex-split.html sphinx-1.0.7/sphinx/themes/basic/genindex-split.html --- sphinx-1.0~hg20100604/sphinx/themes/basic/genindex-split.html 2010-05-06 16:30:00.000000000 +0000 +++ sphinx-1.0.7/sphinx/themes/basic/genindex-split.html 2011-01-04 09:00:04.000000000 +0000 @@ -4,7 +4,7 @@ Template for a "split" index overview page. - :copyright: Copyright 2007-2010 by the Sphinx team, see AUTHORS. + :copyright: Copyright 2007-2011 by the Sphinx team, see AUTHORS. :license: BSD, see LICENSE for details. #} {% extends "layout.html" %} diff -Nru sphinx-1.0~hg20100604/sphinx/themes/basic/globaltoc.html sphinx-1.0.7/sphinx/themes/basic/globaltoc.html --- sphinx-1.0~hg20100604/sphinx/themes/basic/globaltoc.html 2010-05-06 16:30:00.000000000 +0000 +++ sphinx-1.0.7/sphinx/themes/basic/globaltoc.html 2011-01-04 09:00:04.000000000 +0000 @@ -4,7 +4,7 @@ Sphinx sidebar template: global table of contents. - :copyright: Copyright 2007-2010 by the Sphinx team, see AUTHORS. + :copyright: Copyright 2007-2011 by the Sphinx team, see AUTHORS. :license: BSD, see LICENSE for details. #} <h3><a href="{{ pathto(master_doc) }}">{{ _('Table Of Contents') }}</a></h3> diff -Nru sphinx-1.0~hg20100604/sphinx/themes/basic/layout.html sphinx-1.0.7/sphinx/themes/basic/layout.html --- sphinx-1.0~hg20100604/sphinx/themes/basic/layout.html 2010-05-06 16:30:00.000000000 +0000 +++ sphinx-1.0.7/sphinx/themes/basic/layout.html 2011-01-04 09:00:04.000000000 +0000 @@ -4,7 +4,7 @@ Master layout template for Sphinx themes. - :copyright: Copyright 2007-2010 by the Sphinx team, see AUTHORS. + :copyright: Copyright 2007-2011 by the Sphinx team, see AUTHORS. :license: BSD, see LICENSE for details. #} {%- block doctype -%} @@ -14,7 +14,7 @@ {%- set reldelim1 = reldelim1 is not defined and ' »' or reldelim1 %} {%- set reldelim2 = reldelim2 is not defined and ' |' or reldelim2 %} {%- set render_sidebar = (not embedded) and (not theme_nosidebar|tobool) and - (not sidebars == []) %} + (sidebars != []) %} {%- set url_root = pathto('', 1) %} {%- if url_root == '#' %}{% set url_root = '' %}{% endif %} @@ -24,7 +24,7 @@ <ul> {%- for rellink in rellinks %} <li class="right" {% if loop.first %}style="margin-right: 10px"{% endif %}> - <a href="{{ pathto(rellink[0]) }}" title="{{ rellink[1]|striptags }}" + <a href="{{ pathto(rellink[0]) }}" title="{{ rellink[1]|striptags|e }}" {{ accesskey(rellink[2]) }}>{{ rellink[3] }}</a> {%- if not loop.first %}{{ reldelim2 }}{% endif %}</li> {%- endfor %} @@ -88,7 +88,7 @@ {%- set titlesuffix = "" %} {%- endif %} {%- block htmltitle %} - <title>{{ title|striptags }}{{ titlesuffix }} + {{ title|striptags|e }}{{ titlesuffix }} {%- endblock %} @@ -101,7 +101,7 @@ URL_ROOT: '{{ url_root }}', VERSION: '{{ release|e }}', COLLAPSE_INDEX: false, - FILE_SUFFIX: '{{ file_suffix }}', + FILE_SUFFIX: '{{ '' if no_search_suffix else file_suffix }}', HAS_SOURCE: {{ has_source|lower }} }; @@ -132,13 +132,13 @@ {%- endif %} {%- if parents %} - + {%- endif %} {%- if next %} - + {%- endif %} {%- if prev %} - + {%- endif %} {%- endblock %} {%- block extrahead %} {% endblock %} diff -Nru sphinx-1.0~hg20100604/sphinx/themes/basic/localtoc.html sphinx-1.0.7/sphinx/themes/basic/localtoc.html --- sphinx-1.0~hg20100604/sphinx/themes/basic/localtoc.html 2010-05-06 16:30:00.000000000 +0000 +++ sphinx-1.0.7/sphinx/themes/basic/localtoc.html 2011-01-04 09:00:04.000000000 +0000 @@ -4,7 +4,7 @@ Sphinx sidebar template: local table of contents. - :copyright: Copyright 2007-2010 by the Sphinx team, see AUTHORS. + :copyright: Copyright 2007-2011 by the Sphinx team, see AUTHORS. :license: BSD, see LICENSE for details. #} {%- if display_toc %} diff -Nru sphinx-1.0~hg20100604/sphinx/themes/basic/page.html sphinx-1.0.7/sphinx/themes/basic/page.html --- sphinx-1.0~hg20100604/sphinx/themes/basic/page.html 2010-05-06 16:30:00.000000000 +0000 +++ sphinx-1.0.7/sphinx/themes/basic/page.html 2011-01-04 09:00:04.000000000 +0000 @@ -4,7 +4,7 @@ Master template for simple pages. - :copyright: Copyright 2007-2010 by the Sphinx team, see AUTHORS. + :copyright: Copyright 2007-2011 by the Sphinx team, see AUTHORS. :license: BSD, see LICENSE for details. #} {% extends "layout.html" %} diff -Nru sphinx-1.0~hg20100604/sphinx/themes/basic/relations.html sphinx-1.0.7/sphinx/themes/basic/relations.html --- sphinx-1.0~hg20100604/sphinx/themes/basic/relations.html 2010-05-06 16:30:00.000000000 +0000 +++ sphinx-1.0.7/sphinx/themes/basic/relations.html 2011-01-04 09:00:04.000000000 +0000 @@ -4,7 +4,7 @@ Sphinx sidebar template: relation links. - :copyright: Copyright 2007-2010 by the Sphinx team, see AUTHORS. + :copyright: Copyright 2007-2011 by the Sphinx team, see AUTHORS. :license: BSD, see LICENSE for details. #} {%- if prev %} diff -Nru sphinx-1.0~hg20100604/sphinx/themes/basic/searchbox.html sphinx-1.0.7/sphinx/themes/basic/searchbox.html --- sphinx-1.0~hg20100604/sphinx/themes/basic/searchbox.html 2010-05-06 16:30:00.000000000 +0000 +++ sphinx-1.0.7/sphinx/themes/basic/searchbox.html 2011-01-04 09:00:04.000000000 +0000 @@ -4,7 +4,7 @@ Sphinx sidebar template: quick search box. - :copyright: Copyright 2007-2010 by the Sphinx team, see AUTHORS. + :copyright: Copyright 2007-2011 by the Sphinx team, see AUTHORS. :license: BSD, see LICENSE for details. #} {%- if pagename != "search" %} diff -Nru sphinx-1.0~hg20100604/sphinx/themes/basic/search.html sphinx-1.0.7/sphinx/themes/basic/search.html --- sphinx-1.0~hg20100604/sphinx/themes/basic/search.html 2010-06-03 22:12:22.000000000 +0000 +++ sphinx-1.0.7/sphinx/themes/basic/search.html 2011-01-04 09:00:04.000000000 +0000 @@ -4,7 +4,7 @@ Template for the search page. - :copyright: Copyright 2007-2010 by the Sphinx team, see AUTHORS. + :copyright: Copyright 2007-2011 by the Sphinx team, see AUTHORS. :license: BSD, see LICENSE for details. #} {% extends "layout.html" %} diff -Nru sphinx-1.0~hg20100604/sphinx/themes/basic/sourcelink.html sphinx-1.0.7/sphinx/themes/basic/sourcelink.html --- sphinx-1.0~hg20100604/sphinx/themes/basic/sourcelink.html 2010-05-06 16:30:00.000000000 +0000 +++ sphinx-1.0.7/sphinx/themes/basic/sourcelink.html 2011-01-04 09:00:04.000000000 +0000 @@ -4,7 +4,7 @@ Sphinx sidebar template: "show source" link. - :copyright: Copyright 2007-2010 by the Sphinx team, see AUTHORS. + :copyright: Copyright 2007-2011 by the Sphinx team, see AUTHORS. :license: BSD, see LICENSE for details. #} {%- if show_source and has_source and sourcename %} diff -Nru sphinx-1.0~hg20100604/sphinx/themes/basic/static/basic.css sphinx-1.0.7/sphinx/themes/basic/static/basic.css --- sphinx-1.0~hg20100604/sphinx/themes/basic/static/basic.css 2010-06-03 22:12:22.000000000 +0000 +++ sphinx-1.0.7/sphinx/themes/basic/static/basic.css 2011-01-13 07:19:57.000000000 +0000 @@ -4,7 +4,7 @@ * * Sphinx stylesheet -- basic theme. * - * :copyright: Copyright 2007-2010 by the Sphinx team, see AUTHORS. + * :copyright: Copyright 2007-2011 by the Sphinx team, see AUTHORS. * :license: BSD, see LICENSE for details. * */ @@ -213,6 +213,24 @@ font-weight: bold; } +img.align-left, .figure.align-left, object.align-left { + clear: left; + float: left; + margin-right: 1em; +} + +img.align-right, .figure.align-right, object.align-right { + clear: right; + float: right; + margin-left: 1em; +} + +img.align-center, .figure.align-center, object.align-center { + display: block; + margin-left: auto; + margin-right: auto; +} + .align-left { text-align: left; } @@ -395,7 +413,7 @@ } .footnote:target { - background-color: #ffa + background-color: #ffa; } .line-block { @@ -426,6 +444,7 @@ pre { overflow: auto; + overflow-y: hidden; /* fixes display issues on Chrome browsers */ } td.linenos pre { diff -Nru sphinx-1.0~hg20100604/sphinx/themes/basic/static/doctools.js sphinx-1.0.7/sphinx/themes/basic/static/doctools.js --- sphinx-1.0~hg20100604/sphinx/themes/basic/static/doctools.js 2010-06-03 22:12:22.000000000 +0000 +++ sphinx-1.0.7/sphinx/themes/basic/static/doctools.js 2011-01-04 09:00:04.000000000 +0000 @@ -4,7 +4,7 @@ * * Sphinx JavaScript utilties for all documentation. * - * :copyright: Copyright 2007-2010 by the Sphinx team, see AUTHORS. + * :copyright: Copyright 2007-2011 by the Sphinx team, see AUTHORS. * :license: BSD, see LICENSE for details. * */ diff -Nru sphinx-1.0~hg20100604/sphinx/themes/basic/static/searchtools.js sphinx-1.0.7/sphinx/themes/basic/static/searchtools.js --- sphinx-1.0~hg20100604/sphinx/themes/basic/static/searchtools.js 2010-06-03 22:12:22.000000000 +0000 +++ sphinx-1.0.7/sphinx/themes/basic/static/searchtools.js 2011-01-04 09:00:04.000000000 +0000 @@ -4,7 +4,7 @@ * * Sphinx JavaScript utilties for the full-text search. * - * :copyright: Copyright 2007-2010 by the Sphinx team, see AUTHORS. + * :copyright: Copyright 2007-2011 by the Sphinx team, see AUTHORS. * :license: BSD, see LICENSE for details. * */ @@ -456,10 +456,23 @@ if (results.length) { var item = results.pop(); var listItem = $('
  • '); - listItem.append($('').attr( - 'href', - item[0] + DOCUMENTATION_OPTIONS.FILE_SUFFIX + - highlightstring + item[2]).html(item[1])); + if (DOCUMENTATION_OPTIONS.FILE_SUFFIX == '') { + // dirhtml builder + var dirname = item[0] + '/'; + if (dirname.match(/\/index\/$/)) { + dirname = dirname.substring(0, dirname.length-6); + } else if (dirname == 'index/') { + dirname = ''; + } + listItem.append($('').attr('href', + DOCUMENTATION_OPTIONS.URL_ROOT + dirname + + highlightstring + item[2]).html(item[1])); + } else { + // normal html builders + listItem.append($('').attr('href', + item[0] + DOCUMENTATION_OPTIONS.FILE_SUFFIX + + highlightstring + item[2]).html(item[1])); + } if (item[3]) { listItem.append($(' (' + item[3] + ')')); Search.output.append(listItem); @@ -472,10 +485,10 @@ if (data != '') { listItem.append($.makeSearchSummary(data, searchterms, hlterms)); Search.output.append(listItem); - listItem.slideDown(5, function() { - displayNextItem(); - }); } + listItem.slideDown(5, function() { + displayNextItem(); + }); }); } else { // no source available, just display title diff -Nru sphinx-1.0~hg20100604/sphinx/themes/default/layout.html sphinx-1.0.7/sphinx/themes/default/layout.html --- sphinx-1.0~hg20100604/sphinx/themes/default/layout.html 2010-06-03 22:12:22.000000000 +0000 +++ sphinx-1.0.7/sphinx/themes/default/layout.html 2011-01-04 09:00:04.000000000 +0000 @@ -4,7 +4,7 @@ Sphinx layout template for the default theme. - :copyright: Copyright 2007-2010 by the Sphinx team, see AUTHORS. + :copyright: Copyright 2007-2011 by the Sphinx team, see AUTHORS. :license: BSD, see LICENSE for details. #} {% extends "basic/layout.html" %} diff -Nru sphinx-1.0~hg20100604/sphinx/themes/default/static/default.css_t sphinx-1.0.7/sphinx/themes/default/static/default.css_t --- sphinx-1.0~hg20100604/sphinx/themes/default/static/default.css_t 2010-06-03 22:12:22.000000000 +0000 +++ sphinx-1.0.7/sphinx/themes/default/static/default.css_t 2011-01-04 09:00:04.000000000 +0000 @@ -4,7 +4,7 @@ * * Sphinx stylesheet -- default theme. * - * :copyright: Copyright 2007-2010 by the Sphinx team, see AUTHORS. + * :copyright: Copyright 2007-2011 by the Sphinx team, see AUTHORS. * :license: BSD, see LICENSE for details. * */ @@ -147,6 +147,12 @@ font-size: 1em; } +{% if theme_collapsiblesidebar|tobool %} +/* for collapsible sidebar */ +div#sidebarbutton { + background-color: {{ theme_sidebarbtncolor }}; +} +{% endif %} /* -- hyperlink styles ------------------------------------------------------ */ @@ -174,6 +180,11 @@ text-decoration: none; border-bottom: none; } + +a.external:visited { + text-decoration: none; + border-bottom: 1px dashed {{ theme_visitedlinkcolor }}; +} {% endif %} /* -- body styles ----------------------------------------------------------- */ diff -Nru sphinx-1.0~hg20100604/sphinx/themes/default/static/sidebar.js sphinx-1.0.7/sphinx/themes/default/static/sidebar.js --- sphinx-1.0~hg20100604/sphinx/themes/default/static/sidebar.js 2010-06-03 22:12:22.000000000 +0000 +++ sphinx-1.0.7/sphinx/themes/default/static/sidebar.js 2011-01-04 09:00:04.000000000 +0000 @@ -16,7 +16,7 @@ * 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. + * :copyright: Copyright 2007-2011 by the Sphinx team, see AUTHORS. * :license: BSD, see LICENSE for details. * */ @@ -91,6 +91,7 @@ '
    «
    ' ); var sidebarbutton = $('#sidebarbutton'); + light_color = sidebarbutton.css('background-color'); // find the height of the viewport to center the '<<' in the page var viewport_height; if (window.innerHeight) @@ -144,4 +145,4 @@ add_sidebar_button(); var sidebarbutton = $('#sidebarbutton'); set_position_from_cookie(); -}); \ No newline at end of file +}); diff -Nru sphinx-1.0~hg20100604/sphinx/themes/default/theme.conf sphinx-1.0.7/sphinx/themes/default/theme.conf --- sphinx-1.0~hg20100604/sphinx/themes/default/theme.conf 2010-06-03 22:12:22.000000000 +0000 +++ sphinx-1.0.7/sphinx/themes/default/theme.conf 2011-01-04 09:00:04.000000000 +0000 @@ -12,6 +12,7 @@ footerbgcolor = #11303d footertextcolor = #ffffff sidebarbgcolor = #1c4e63 +sidebarbtncolor = #3c6e83 sidebartextcolor = #ffffff sidebarlinkcolor = #98dbcc relbarbgcolor = #133f52 diff -Nru sphinx-1.0~hg20100604/sphinx/themes/epub/layout.html sphinx-1.0.7/sphinx/themes/epub/layout.html --- sphinx-1.0~hg20100604/sphinx/themes/epub/layout.html 2010-05-06 16:30:00.000000000 +0000 +++ sphinx-1.0.7/sphinx/themes/epub/layout.html 2011-01-04 09:00:04.000000000 +0000 @@ -4,7 +4,7 @@ Sphinx layout template for the epub theme. - :copyright: Copyright 2007-2010 by the Sphinx team, see AUTHORS. + :copyright: Copyright 2007-2011 by the Sphinx team, see AUTHORS. :license: BSD, see LICENSE for details. #} {% extends "basic/layout.html" %} diff -Nru sphinx-1.0~hg20100604/sphinx/themes/epub/static/epub.css sphinx-1.0.7/sphinx/themes/epub/static/epub.css --- sphinx-1.0~hg20100604/sphinx/themes/epub/static/epub.css 2010-05-06 16:30:00.000000000 +0000 +++ sphinx-1.0.7/sphinx/themes/epub/static/epub.css 2011-01-04 22:20:48.000000000 +0000 @@ -4,7 +4,7 @@ * * Sphinx stylesheet -- epub theme. * - * :copyright: Copyright 2007-2010 by the Sphinx team, see AUTHORS. + * :copyright: Copyright 2007-2011 by the Sphinx team, see AUTHORS. * :license: BSD, see LICENSE for details. * */ @@ -343,6 +343,7 @@ pre { font-family: "LiberationNarrow", monospace; overflow: auto; + overflow-y: hidden; } td.linenos pre { diff -Nru sphinx-1.0~hg20100604/sphinx/themes/haiku/layout.html sphinx-1.0.7/sphinx/themes/haiku/layout.html --- sphinx-1.0~hg20100604/sphinx/themes/haiku/layout.html 2010-05-06 16:30:00.000000000 +0000 +++ sphinx-1.0.7/sphinx/themes/haiku/layout.html 2011-01-04 09:00:04.000000000 +0000 @@ -4,7 +4,7 @@ Sphinx layout template for the haiku theme. - :copyright: Copyright 2007-2010 by the Sphinx team, see AUTHORS. + :copyright: Copyright 2007-2011 by the Sphinx team, see AUTHORS. :license: BSD, see LICENSE for details. #} {% extends "basic/layout.html" %} @@ -46,7 +46,7 @@ {%- endif -%}

    {{ shorttitle|e }}

    -

    {{ title|striptags }}

    +

    {{ title|striptags|e }}

    {%- endif %} {%- endblock %} @@ -65,4 +65,4 @@
    {{ nav() }}
    -{% endblock %} \ No newline at end of file +{% endblock %} diff -Nru sphinx-1.0~hg20100604/sphinx/themes/haiku/static/haiku.css_t sphinx-1.0.7/sphinx/themes/haiku/static/haiku.css_t --- sphinx-1.0~hg20100604/sphinx/themes/haiku/static/haiku.css_t 2010-05-06 16:30:00.000000000 +0000 +++ sphinx-1.0.7/sphinx/themes/haiku/static/haiku.css_t 2011-01-04 09:00:04.000000000 +0000 @@ -16,7 +16,7 @@ * Braden Ewing * Humdinger * - * :copyright: Copyright 2007-2010 by the Sphinx team, see AUTHORS. + * :copyright: Copyright 2007-2011 by the Sphinx team, see AUTHORS. * :license: BSD, see LICENSE for details. * */ @@ -292,7 +292,7 @@ line-height: 1.3; } -div.content li { +div.content ul > li { -moz-background-clip:border; -moz-background-inline-policy:continuous; -moz-background-origin:padding; diff -Nru sphinx-1.0~hg20100604/sphinx/themes/nature/static/nature.css_t sphinx-1.0.7/sphinx/themes/nature/static/nature.css_t --- sphinx-1.0~hg20100604/sphinx/themes/nature/static/nature.css_t 2010-05-06 16:30:00.000000000 +0000 +++ sphinx-1.0.7/sphinx/themes/nature/static/nature.css_t 2011-01-04 09:00:04.000000000 +0000 @@ -4,7 +4,7 @@ * * Sphinx stylesheet -- nature theme. * - * :copyright: Copyright 2007-2010 by the Sphinx team, see AUTHORS. + * :copyright: Copyright 2007-2011 by the Sphinx team, see AUTHORS. * :license: BSD, see LICENSE for details. * */ diff -Nru sphinx-1.0~hg20100604/sphinx/themes/scrolls/layout.html sphinx-1.0.7/sphinx/themes/scrolls/layout.html --- sphinx-1.0~hg20100604/sphinx/themes/scrolls/layout.html 2010-05-06 16:30:00.000000000 +0000 +++ sphinx-1.0.7/sphinx/themes/scrolls/layout.html 2011-01-04 09:00:04.000000000 +0000 @@ -5,7 +5,7 @@ Sphinx layout template for the scrolls theme, originally written by Armin Ronacher. - :copyright: Copyright 2007-2010 by the Sphinx team, see AUTHORS. + :copyright: Copyright 2007-2011 by the Sphinx team, see AUTHORS. :license: BSD, see LICENSE for details. #} {% extends "basic/layout.html" %} @@ -18,7 +18,7 @@

    {{ title|striptags }}

    + title="back to the documentation overview">{{ title|striptags|e }}
    {%- if prev %} @@ -39,4 +39,4 @@ {% block body %}{% endblock %}
    -{% endblock %} \ No newline at end of file +{% endblock %} diff -Nru sphinx-1.0~hg20100604/sphinx/themes/scrolls/static/scrolls.css_t sphinx-1.0.7/sphinx/themes/scrolls/static/scrolls.css_t --- sphinx-1.0~hg20100604/sphinx/themes/scrolls/static/scrolls.css_t 2010-05-06 16:30:00.000000000 +0000 +++ sphinx-1.0.7/sphinx/themes/scrolls/static/scrolls.css_t 2011-01-04 09:00:04.000000000 +0000 @@ -4,7 +4,7 @@ * * Sphinx stylesheet -- scrolls theme. * - * :copyright: Copyright 2007-2010 by the Sphinx team, see AUTHORS. + * :copyright: Copyright 2007-2011 by the Sphinx team, see AUTHORS. * :license: BSD, see LICENSE for details. * */ diff -Nru sphinx-1.0~hg20100604/sphinx/themes/sphinxdoc/layout.html sphinx-1.0.7/sphinx/themes/sphinxdoc/layout.html --- sphinx-1.0~hg20100604/sphinx/themes/sphinxdoc/layout.html 2010-05-06 16:30:00.000000000 +0000 +++ sphinx-1.0.7/sphinx/themes/sphinxdoc/layout.html 2011-01-04 09:00:04.000000000 +0000 @@ -4,7 +4,7 @@ Sphinx layout template for the sphinxdoc theme. - :copyright: Copyright 2007-2010 by the Sphinx team, see AUTHORS. + :copyright: Copyright 2007-2011 by the Sphinx team, see AUTHORS. :license: BSD, see LICENSE for details. #} {% extends "basic/layout.html" %} diff -Nru sphinx-1.0~hg20100604/sphinx/themes/sphinxdoc/static/sphinxdoc.css sphinx-1.0.7/sphinx/themes/sphinxdoc/static/sphinxdoc.css --- sphinx-1.0~hg20100604/sphinx/themes/sphinxdoc/static/sphinxdoc.css 2010-05-06 16:30:00.000000000 +0000 +++ sphinx-1.0.7/sphinx/themes/sphinxdoc/static/sphinxdoc.css 2011-01-04 09:00:04.000000000 +0000 @@ -5,7 +5,7 @@ * Sphinx stylesheet -- sphinxdoc theme. Originally created by * Armin Ronacher for Werkzeug. * - * :copyright: Copyright 2007-2010 by the Sphinx team, see AUTHORS. + * :copyright: Copyright 2007-2011 by the Sphinx team, see AUTHORS. * :license: BSD, see LICENSE for details. * */ diff -Nru sphinx-1.0~hg20100604/sphinx/themes/traditional/static/traditional.css sphinx-1.0.7/sphinx/themes/traditional/static/traditional.css --- sphinx-1.0~hg20100604/sphinx/themes/traditional/static/traditional.css 2010-05-06 16:30:00.000000000 +0000 +++ sphinx-1.0.7/sphinx/themes/traditional/static/traditional.css 2011-01-04 09:00:04.000000000 +0000 @@ -4,7 +4,7 @@ * * Sphinx stylesheet -- traditional docs.python.org theme. * - * :copyright: Copyright 2007-2010 by the Sphinx team, see AUTHORS. + * :copyright: Copyright 2007-2011 by the Sphinx team, see AUTHORS. * :license: BSD, see LICENSE for details. * */ diff -Nru sphinx-1.0~hg20100604/sphinx/theming.py sphinx-1.0.7/sphinx/theming.py --- sphinx-1.0~hg20100604/sphinx/theming.py 2010-05-06 16:30:00.000000000 +0000 +++ sphinx-1.0.7/sphinx/theming.py 2011-01-04 09:00:04.000000000 +0000 @@ -5,7 +5,7 @@ Theming support for HTML builders. - :copyright: Copyright 2007-2010 by the Sphinx team, see AUTHORS. + :copyright: Copyright 2007-2011 by the Sphinx team, see AUTHORS. :license: BSD, see LICENSE for details. """ diff -Nru sphinx-1.0~hg20100604/sphinx/util/compat.py sphinx-1.0.7/sphinx/util/compat.py --- sphinx-1.0~hg20100604/sphinx/util/compat.py 2010-05-06 16:30:00.000000000 +0000 +++ sphinx-1.0.7/sphinx/util/compat.py 2011-01-04 09:00:04.000000000 +0000 @@ -5,7 +5,7 @@ Stuff for docutils compatibility. - :copyright: Copyright 2007-2010 by the Sphinx team, see AUTHORS. + :copyright: Copyright 2007-2011 by the Sphinx team, see AUTHORS. :license: BSD, see LICENSE for details. """ diff -Nru sphinx-1.0~hg20100604/sphinx/util/console.py sphinx-1.0.7/sphinx/util/console.py --- sphinx-1.0~hg20100604/sphinx/util/console.py 2010-06-03 22:12:22.000000000 +0000 +++ sphinx-1.0.7/sphinx/util/console.py 2011-01-04 09:00:04.000000000 +0000 @@ -5,7 +5,7 @@ Format colored console output. - :copyright: Copyright 2007-2010 by the Sphinx team, see AUTHORS. + :copyright: Copyright 2007-2011 by the Sphinx team, see AUTHORS. :license: BSD, see LICENSE for details. """ diff -Nru sphinx-1.0~hg20100604/sphinx/util/docfields.py sphinx-1.0.7/sphinx/util/docfields.py --- sphinx-1.0~hg20100604/sphinx/util/docfields.py 2010-05-06 16:30:00.000000000 +0000 +++ sphinx-1.0.7/sphinx/util/docfields.py 2011-01-04 09:00:04.000000000 +0000 @@ -6,7 +6,7 @@ "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. + :copyright: Copyright 2007-2011 by the Sphinx team, see AUTHORS. :license: BSD, see LICENSE for details. """ @@ -67,7 +67,7 @@ fieldname += nodes.Text(' ') fieldname += self.make_xref(self.rolename, domain, fieldarg, nodes.Text) - fieldbody = nodes.field_body('', nodes.paragraph('', *content)) + fieldbody = nodes.field_body('', nodes.paragraph('', '', *content)) return nodes.field('', fieldname, fieldbody) @@ -129,26 +129,40 @@ is_typed = True def __init__(self, name, names=(), typenames=(), label=None, - rolename=None, typerolename=None): - GroupedField.__init__(self, name, names, label, rolename, False) + rolename=None, typerolename=None, can_collapse=False): + GroupedField.__init__(self, name, names, label, rolename, can_collapse) 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: + def handle_item(fieldarg, content): 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) + # NOTE: using .pop() here to prevent a single type node to be + # inserted twice into the doctree, which leads to + # inconsistencies later when references are resolved + fieldtype = types.pop(fieldarg) + if len(fieldtype) == 1 and isinstance(fieldtype[0], nodes.Text): + typename = u''.join(n.astext() for n in fieldtype) + par += self.make_xref(self.typerolename, domain, typename) + else: + par += fieldtype par += nodes.Text(')') par += nodes.Text(' -- ') par += content - listnode += nodes.list_item('', par) - fieldbody = nodes.field_body('', listnode) + return par + + fieldname = nodes.field_name('', self.label) + if len(items) == 1 and self.can_collapse: + fieldarg, content = items[0] + bodynode = handle_item(fieldarg, content) + else: + bodynode = self.list_type() + for fieldarg, content in items: + bodynode += nodes.list_item('', handle_item(fieldarg, content)) + fieldbody = nodes.field_body('', bodynode) return nodes.field('', fieldname, fieldbody) @@ -160,7 +174,7 @@ def __init__(self, directive): self.domain = directive.domain - if not hasattr(directive, '_doc_field_type_map'): + if '_doc_field_type_map' not in directive.__class__.__dict__: directive.__class__._doc_field_type_map = \ self.preprocess_fieldtypes(directive.__class__.doc_field_types) self.typemap = directive._doc_field_type_map @@ -222,7 +236,10 @@ 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) + content = filter( + lambda n: isinstance(n, nodes.Inline) or + isinstance(n, nodes.Text), + content) if content: types.setdefault(typename, {})[fieldarg] = content continue diff -Nru sphinx-1.0~hg20100604/sphinx/util/docstrings.py sphinx-1.0.7/sphinx/util/docstrings.py --- sphinx-1.0~hg20100604/sphinx/util/docstrings.py 2010-05-06 16:30:00.000000000 +0000 +++ sphinx-1.0.7/sphinx/util/docstrings.py 2011-01-04 09:00:04.000000000 +0000 @@ -5,7 +5,7 @@ Utilities for docstring processing. - :copyright: Copyright 2007-2010 by the Sphinx team, see AUTHORS. + :copyright: Copyright 2007-2011 by the Sphinx team, see AUTHORS. :license: BSD, see LICENSE for details. """ diff -Nru sphinx-1.0~hg20100604/sphinx/util/__init__.py sphinx-1.0.7/sphinx/util/__init__.py --- sphinx-1.0~hg20100604/sphinx/util/__init__.py 2010-05-06 16:30:00.000000000 +0000 +++ sphinx-1.0.7/sphinx/util/__init__.py 2011-01-07 09:05:02.000000000 +0000 @@ -5,7 +5,7 @@ Utility functions for Sphinx. - :copyright: Copyright 2007-2010 by the Sphinx team, see AUTHORS. + :copyright: Copyright 2007-2011 by the Sphinx team, see AUTHORS. :license: BSD, see LICENSE for details. """ @@ -114,9 +114,9 @@ def purge_doc(self, docname): for filename, (docs, _) in self.items(): docs.discard(docname) - #if not docs: - # del self[filename] - # self._existing.discard(filename) + if not docs: + del self[filename] + self._existing.discard(filename) def __getstate__(self): return self._existing @@ -166,9 +166,11 @@ """ Save the current exception's traceback in a temporary file. """ + import platform exc = traceback.format_exc() fd, path = tempfile.mkstemp('.log', 'sphinx-err-') os.write(fd, '# Sphinx version: %s\n' % sphinx.__version__) + os.write(fd, '# Python version: %s\n' % platform.python_version()) os.write(fd, '# Docutils version: %s %s\n' % (docutils.__version__, docutils.__version_details__)) os.write(fd, '# Jinja2 version: %s\n' % jinja2.__version__) @@ -202,7 +204,7 @@ lfilename = filename.lower() if lfilename.endswith('.pyo') or lfilename.endswith('.pyc'): filename = filename[:-1] - elif not lfilename.endswith('.py'): + elif not (lfilename.endswith('.py') or lfilename.endswith('.pyw')): raise PycodeError('source is not a .py file: %r' % filename) if not path.isfile(filename): raise PycodeError('source file is not present: %r' % filename) diff -Nru sphinx-1.0~hg20100604/sphinx/util/inspect.py sphinx-1.0.7/sphinx/util/inspect.py --- sphinx-1.0~hg20100604/sphinx/util/inspect.py 2010-05-06 16:30:00.000000000 +0000 +++ sphinx-1.0.7/sphinx/util/inspect.py 2011-01-04 09:00:04.000000000 +0000 @@ -5,7 +5,7 @@ Helpers for inspecting Python modules. - :copyright: Copyright 2007-2010 by the Sphinx team, see AUTHORS. + :copyright: Copyright 2007-2011 by the Sphinx team, see AUTHORS. :license: BSD, see LICENSE for details. """ diff -Nru sphinx-1.0~hg20100604/sphinx/util/jsdump.py sphinx-1.0.7/sphinx/util/jsdump.py --- sphinx-1.0~hg20100604/sphinx/util/jsdump.py 2010-05-06 16:30:00.000000000 +0000 +++ sphinx-1.0.7/sphinx/util/jsdump.py 2011-01-04 09:00:04.000000000 +0000 @@ -6,7 +6,7 @@ This module implements a simple JavaScript serializer. Uses the basestring encode function from simplejson by Bob Ippolito. - :copyright: Copyright 2007-2010 by the Sphinx team, see AUTHORS. + :copyright: Copyright 2007-2011 by the Sphinx team, see AUTHORS. :license: BSD, see LICENSE for details. """ diff -Nru sphinx-1.0~hg20100604/sphinx/util/jsonimpl.py sphinx-1.0.7/sphinx/util/jsonimpl.py --- sphinx-1.0~hg20100604/sphinx/util/jsonimpl.py 1970-01-01 00:00:00.000000000 +0000 +++ sphinx-1.0.7/sphinx/util/jsonimpl.py 2011-01-04 09:00:04.000000000 +0000 @@ -0,0 +1,48 @@ +# -*- coding: utf-8 -*- +""" + sphinx.util.jsonimpl + ~~~~~~~~~~~~~~~~~~~~ + + JSON serializer implementation wrapper. + + :copyright: Copyright 2007-2011 by the Sphinx team, see AUTHORS. + :license: BSD, see LICENSE for details. +""" + +import UserString + +try: + import json + # json-py's json module has not JSONEncoder; this will raise AttributeError + # if json-py is imported instead of the built-in json module + JSONEncoder = json.JSONEncoder +except (ImportError, AttributeError): + try: + import simplejson as json + JSONEncoder = json.JSONEncoder + except ImportError: + json = None + JSONEncoder = object + + +class SphinxJSONEncoder(JSONEncoder): + """JSONEncoder subclass that forces translation proxies.""" + def default(self, obj): + if isinstance(obj, UserString.UserString): + return unicode(obj) + return JSONEncoder.default(self, obj) + + +def dump(obj, fp, *args, **kwds): + kwds['cls'] = SphinxJSONEncoder + return json.dump(obj, fp, *args, **kwds) + +def dumps(obj, *args, **kwds): + kwds['cls'] = SphinxJSONEncoder + return json.dumps(obj, *args, **kwds) + +def load(*args, **kwds): + return json.load(*args, **kwds) + +def loads(*args, **kwds): + return json.loads(*args, **kwds) diff -Nru sphinx-1.0~hg20100604/sphinx/util/matching.py sphinx-1.0.7/sphinx/util/matching.py --- sphinx-1.0~hg20100604/sphinx/util/matching.py 2010-05-06 16:30:00.000000000 +0000 +++ sphinx-1.0.7/sphinx/util/matching.py 2011-01-04 09:00:04.000000000 +0000 @@ -5,7 +5,7 @@ Pattern-matching utility functions for Sphinx. - :copyright: Copyright 2007-2010 by the Sphinx team, see AUTHORS. + :copyright: Copyright 2007-2011 by the Sphinx team, see AUTHORS. :license: BSD, see LICENSE for details. """ diff -Nru sphinx-1.0~hg20100604/sphinx/util/nodes.py sphinx-1.0.7/sphinx/util/nodes.py --- sphinx-1.0~hg20100604/sphinx/util/nodes.py 2010-06-03 22:12:22.000000000 +0000 +++ sphinx-1.0.7/sphinx/util/nodes.py 2011-01-04 09:00:04.000000000 +0000 @@ -5,7 +5,7 @@ Docutils node-related utility functions for Sphinx. - :copyright: Copyright 2007-2010 by the Sphinx team, see AUTHORS. + :copyright: Copyright 2007-2011 by the Sphinx team, see AUTHORS. :license: BSD, see LICENSE for details. """ @@ -136,3 +136,10 @@ return key in self.children nodes.Node.__contains__ = _new_contains + +# monkey-patch Element.copy to copy the rawsource + +def _new_copy(self): + return self.__class__(self.rawsource, **self.attributes) + +nodes.Element.copy = _new_copy diff -Nru sphinx-1.0~hg20100604/sphinx/util/osutil.py sphinx-1.0.7/sphinx/util/osutil.py --- sphinx-1.0~hg20100604/sphinx/util/osutil.py 2010-05-06 16:30:00.000000000 +0000 +++ sphinx-1.0.7/sphinx/util/osutil.py 2011-01-04 09:00:04.000000000 +0000 @@ -5,7 +5,7 @@ Operating system-related utility functions for Sphinx. - :copyright: Copyright 2007-2010 by the Sphinx team, see AUTHORS. + :copyright: Copyright 2007-2011 by the Sphinx team, see AUTHORS. :license: BSD, see LICENSE for details. """ diff -Nru sphinx-1.0~hg20100604/sphinx/util/png.py sphinx-1.0.7/sphinx/util/png.py --- sphinx-1.0~hg20100604/sphinx/util/png.py 2010-05-06 16:30:00.000000000 +0000 +++ sphinx-1.0.7/sphinx/util/png.py 2011-01-04 09:00:04.000000000 +0000 @@ -5,7 +5,7 @@ PNG image manipulation helpers. - :copyright: Copyright 2007-2010 by the Sphinx team, see AUTHORS. + :copyright: Copyright 2007-2011 by the Sphinx team, see AUTHORS. :license: BSD, see LICENSE for details. """ diff -Nru sphinx-1.0~hg20100604/sphinx/util/pycompat.py sphinx-1.0.7/sphinx/util/pycompat.py --- sphinx-1.0~hg20100604/sphinx/util/pycompat.py 2010-06-03 22:12:22.000000000 +0000 +++ sphinx-1.0.7/sphinx/util/pycompat.py 2011-01-04 09:00:04.000000000 +0000 @@ -5,7 +5,7 @@ Stuff for Python version compatibility. - :copyright: Copyright 2007-2010 by the Sphinx team, see AUTHORS. + :copyright: Copyright 2007-2011 by the Sphinx team, see AUTHORS. :license: BSD, see LICENSE for details. """ diff -Nru sphinx-1.0~hg20100604/sphinx/util/smartypants.py sphinx-1.0.7/sphinx/util/smartypants.py --- sphinx-1.0~hg20100604/sphinx/util/smartypants.py 2010-05-06 16:30:00.000000000 +0000 +++ sphinx-1.0.7/sphinx/util/smartypants.py 2011-01-04 09:00:04.000000000 +0000 @@ -1,5 +1,6 @@ r""" -This is based on SmartyPants.py by `Chad Miller`_. +This is based on SmartyPants.py by `Chad Miller`_ , +version 1.5_1.6. Copyright and License ===================== @@ -75,14 +76,15 @@ def sphinx_smarty_pants(t): t = t.replace('"', '"') - t = educateDashesOldSchool(t) - t = educateQuotes(t) + t = educate_dashes_oldschool(t) + t = educate_quotes(t) t = t.replace('"', '"') return t # Constants for quote education. punct_class = r"""[!"#\$\%'()*+,-.\/:;<=>?\@\[\\\]\^_`{|}~]""" +end_of_word_class = r"""[\s.,;:!?)]""" close_class = r"""[^\ \t\r\n\[\{\(\-]""" dec_dashes = r"""–|—""" @@ -117,8 +119,8 @@ closing_double_quotes_regex = re.compile(r""" #(%s)? # character that indicates the quote should be closing " - (?=\s) - """ % (close_class,), re.VERBOSE) + (?=%s) + """ % (close_class, end_of_word_class), re.VERBOSE) closing_double_quotes_regex_2 = re.compile(r""" (%s) # character that indicates the quote should be closing @@ -151,7 +153,7 @@ (\s | s\b) """ % (close_class,), re.VERBOSE) -def educateQuotes(s): +def educate_quotes(s): """ Parameter: String. @@ -190,7 +192,7 @@ return s.replace('"', "“") -def educateQuotesLatex(s, dquotes=("``", "''")): +def educate_quotes_latex(s, dquotes=("``", "''")): """ Parameter: String. @@ -233,7 +235,7 @@ replace("\x03", "`").replace("\x04", "'") -def educateBackticks(s): +def educate_backticks(s): """ Parameter: String. Returns: The string, with ``backticks'' -style double quotes @@ -244,7 +246,7 @@ return s.replace("``", "“").replace("''", "”") -def educateSingleBackticks(s): +def educate_single_backticks(s): """ Parameter: String. Returns: The string, with `backticks' -style single quotes @@ -256,7 +258,7 @@ return s.replace('`', "‘").replace("'", "’") -def educateDashesOldSchool(s): +def educate_dashes_oldschool(s): """ Parameter: String. @@ -267,7 +269,7 @@ return s.replace('---', "—").replace('--', "–") -def educateDashesOldSchoolInverted(s): +def educate_dashes_oldschool_inverted(s): """ Parameter: String. @@ -275,7 +277,7 @@ an em-dash HTML entity, and each "---" translated to an en-dash HTML entity. Two reasons why: First, unlike the en- and em-dash syntax supported by - EducateDashesOldSchool(), it's compatible with existing + educate_dashes_oldschool(), it's compatible with existing entries written before SmartyPants 1.1, back when "--" was only used for em-dashes. Second, em-dashes are more common than en-dashes, and so it sort of makes sense that @@ -285,8 +287,7 @@ return s.replace('---', "–").replace('--', "—") - -def educateEllipses(s): +def educate_ellipses(s): """ Parameter: String. Returns: The string, with each instance of "..." translated to @@ -296,11 +297,3 @@ Example output: Huh…? """ return s.replace('...', "…").replace('. . .', "…") - - -__author__ = "Chad Miller " -__version__ = "1.5_1.5: Sat, 13 Aug 2005 15:50:24 -0400" -__url__ = "http://wiki.chad.org/SmartyPantsPy" -__description__ = \ - "Smart-quotes, smart-ellipses, and smart-dashes for weblog entries" \ - " in pyblosxom" diff -Nru sphinx-1.0~hg20100604/sphinx/util/tags.py sphinx-1.0.7/sphinx/util/tags.py --- sphinx-1.0~hg20100604/sphinx/util/tags.py 2010-05-06 16:30:00.000000000 +0000 +++ sphinx-1.0.7/sphinx/util/tags.py 2011-01-04 09:00:04.000000000 +0000 @@ -3,7 +3,7 @@ sphinx.util.tags ~~~~~~~~~~~~~~~~ - :copyright: Copyright 2007-2010 by the Sphinx team, see AUTHORS. + :copyright: Copyright 2007-2011 by the Sphinx team, see AUTHORS. :license: BSD, see LICENSE for details. """ diff -Nru sphinx-1.0~hg20100604/sphinx/util/texescape.py sphinx-1.0.7/sphinx/util/texescape.py --- sphinx-1.0~hg20100604/sphinx/util/texescape.py 2010-05-06 16:30:00.000000000 +0000 +++ sphinx-1.0.7/sphinx/util/texescape.py 2011-01-04 09:00:04.000000000 +0000 @@ -5,7 +5,7 @@ TeX escaping helper. - :copyright: Copyright 2007-2010 by the Sphinx team, see AUTHORS. + :copyright: Copyright 2007-2011 by the Sphinx team, see AUTHORS. :license: BSD, see LICENSE for details. """ diff -Nru sphinx-1.0~hg20100604/sphinx/writers/html.py sphinx-1.0.7/sphinx/writers/html.py --- sphinx-1.0~hg20100604/sphinx/writers/html.py 2010-06-03 22:12:22.000000000 +0000 +++ sphinx-1.0.7/sphinx/writers/html.py 2011-01-15 13:25:53.000000000 +0000 @@ -5,7 +5,7 @@ docutils writers handling Sphinx' custom nodes. - :copyright: Copyright 2007-2010 by the Sphinx team, see AUTHORS. + :copyright: Copyright 2007-2011 by the Sphinx team, see AUTHORS. :license: BSD, see LICENSE for details. """ @@ -21,7 +21,7 @@ from sphinx.util.smartypants import sphinx_smarty_pants try: - import Image # check for the Python Imaging Library + from PIL import Image # check for the Python Imaging Library except ImportError: Image = None @@ -159,7 +159,7 @@ # overwritten def visit_reference(self, node): atts = {'class': 'reference'} - if node.get('internal'): + if node.get('internal') or 'refuri' not in node: atts['class'] += ' internal' else: atts['class'] += ' external' @@ -232,8 +232,10 @@ lang = node['language'] if node.has_key('linenos'): linenos = node['linenos'] - highlighted = self.highlighter.highlight_block(node.rawsource, - lang, linenos) + def warner(msg): + self.builder.warn(msg, (self.builder.current_docname, node.line)) + highlighted = self.highlighter.highlight_block( + node.rawsource, lang, linenos, warn=warner) starttag = self.starttag(node, 'div', suffix='', CLASS='highlight-%s' % lang) self.body.append(starttag + highlighted + '\n') @@ -242,6 +244,12 @@ def visit_doctest_block(self, node): self.visit_literal_block(node) + # overwritten to add the
    (for XHTML compliance) + def visit_block_quote(self, node): + self.body.append(self.starttag(node, 'blockquote') + '
    ') + def depart_block_quote(self, node): + self.body.append('
    \n') + # overwritten def visit_literal(self, node): if len(node.children) == 1 and \ diff -Nru sphinx-1.0~hg20100604/sphinx/writers/__init__.py sphinx-1.0.7/sphinx/writers/__init__.py --- sphinx-1.0~hg20100604/sphinx/writers/__init__.py 2010-05-06 16:30:00.000000000 +0000 +++ sphinx-1.0.7/sphinx/writers/__init__.py 2011-01-04 09:00:04.000000000 +0000 @@ -5,6 +5,6 @@ Custom docutils writers. - :copyright: Copyright 2007-2010 by the Sphinx team, see AUTHORS. + :copyright: Copyright 2007-2011 by the Sphinx team, see AUTHORS. :license: BSD, see LICENSE for details. """ diff -Nru sphinx-1.0~hg20100604/sphinx/writers/latex.py sphinx-1.0.7/sphinx/writers/latex.py --- sphinx-1.0~hg20100604/sphinx/writers/latex.py 2010-06-03 22:12:22.000000000 +0000 +++ sphinx-1.0.7/sphinx/writers/latex.py 2011-01-15 10:39:37.000000000 +0000 @@ -8,7 +8,7 @@ Much of this code is adapted from Dave Kuhlman's "docpy" writer from his docutils sandbox. - :copyright: Copyright 2007-2010 by the Sphinx team, see AUTHORS. + :copyright: Copyright 2007-2011 by the Sphinx team, see AUTHORS. :license: BSD, see LICENSE for details. """ @@ -24,8 +24,9 @@ from sphinx.errors import SphinxError from sphinx.locale import admonitionlabels, versionlabels, _ from sphinx.util.osutil import ustrftime +from sphinx.util.pycompat import any from sphinx.util.texescape import tex_escape_map, tex_replace_map -from sphinx.util.smartypants import educateQuotesLatex +from sphinx.util.smartypants import educate_quotes_latex HEADER = r'''%% Generated by Sphinx. \def\sphinxdocclass{%(docclass)s} @@ -101,8 +102,10 @@ return '\\shorthandoff{"}' return '' - _ISO639_TO_BABEL = Babel._ISO639_TO_BABEL.copy() - _ISO639_TO_BABEL['sl'] = 'slovene' +# in latest trunk, the attribute is called Babel.language_codes and already +# includes Slovene +if hasattr(Babel, '_ISO639_TO_BABEL'): + Babel._ISO639_TO_BABEL['sl'] = 'slovene' class Table(object): @@ -112,6 +115,7 @@ self.colspec = None self.rowcount = 0 self.had_head = False + self.has_problematic = False self.has_verbatim = False self.caption = None self.longtable = False @@ -190,6 +194,14 @@ lang = babel.get_language() if lang: self.elements['classoptions'] += ',' + babel.get_language() + elif builder.config.language == 'ja': + self.elements['classoptions'] += ',english,dvipdfm' + # not elements of babel, but this should be above sphinx.sty. + # because pTeX (Japanese TeX) cannot handle this count. + self.elements['babel'] += r'\newcount\pdfoutput\pdfoutput=0' + # to make the pdf with correct encoded hyperref bookmarks + self.elements['preamble'] += \ + r'\AtBeginDvi{\special{pdf:tounicode EUC-UCS2}}' else: self.builder.warn('no Babel option known for language %r' % builder.config.language) @@ -224,10 +236,14 @@ else: self.top_sectionlevel = 1 self.next_section_ids = set() + self.next_figure_ids = set() + self.next_table_ids = set() # flags self.verbatim = None self.in_title = 0 self.in_production_list = 0 + self.in_footnote = 0 + self.in_caption = 0 self.first_document = 1 self.this_is_the_title = 1 self.literal_whitespace = 0 @@ -250,10 +266,10 @@ '\\label{%s}' % self.idescape(id) def hyperlink(self, id): - return '\\hyperref[%s]{' % (self.idescape(id)) + return '{\\hyperref[%s]{' % self.idescape(id) def hyperpageref(self, id): - return '\\autopageref*{%s}' % (self.idescape(id)) + return '\\autopageref*{%s}' % self.idescape(id) def idescape(self, id): return str(unicode(id).translate(tex_replace_map)) @@ -266,7 +282,8 @@ for i, (letter, entries) in enumerate(content): if i > 0: ret.append('\\indexspace\n') - ret.append('\\bigletter{%s}\n' % letter) + ret.append('\\bigletter{%s}\n' % + letter.translate(tex_escape_map)) for entry in entries: if not entry[3]: continue @@ -405,8 +422,9 @@ def visit_production(self, node): if node['tokenname']: - self.body.append('\\production{%s}{' % - self.encode(node['tokenname'])) + tn = node['tokenname'] + self.body.append(self.hypertarget('grammar-token-' + tn)) + self.body.append('\\production{%s}{' % self.encode(tn)) else: self.body.append('\\productioncont{') def depart_production(self, node): @@ -425,10 +443,8 @@ elif self.this_is_the_title: if len(node.children) != 1 and not isinstance(node.children[0], nodes.Text): - self.builder.warn( - 'document title is not a single Text node', - '%s:%s' % (self.builder.env.doc2path(self.curfilestack[-1]), - node.line or '')) + self.builder.warn('document title is not a single Text node', + (self.curfilestack[-1], node.line)) if not self.elements['title']: # text needs to be escaped since it is inserted into # the output literally @@ -461,8 +477,7 @@ self.builder.warn( 'encountered title node not in section, topic, table, ' 'admonition or sidebar', - '%s:%s' % (self.builder.env.doc2path(self.curfilestack[-1]), - node.line or '')) + (self.curfilestack[-1], node.line or '')) self.body.append('\\textbf{') self.context.append('}\n') self.in_title = 1 @@ -481,6 +496,8 @@ def visit_desc(self, node): self.body.append('\n\n\\begin{fulllineitems}\n') + if self.table: + self.table.has_problematic = True def depart_desc(self, node): self.body.append('\n\\end{fulllineitems}\n\n') @@ -580,9 +597,11 @@ raise nodes.SkipNode def visit_collected_footnote(self, node): + self.in_footnote += 1 self.body.append('\\footnote{') def depart_collected_footnote(self, node): self.body.append('}') + self.in_footnote -= 1 def visit_label(self, node): if isinstance(node.parent, nodes.citation): @@ -611,17 +630,25 @@ self.body = self._body if not self.table.longtable and self.table.caption is not None: self.body.append(u'\n\\begin{threeparttable}\n' - u'\\caption{%s}\n' % self.table.caption) + u'\\capstart\\caption{%s}\n' % self.table.caption) if self.table.longtable: self.body.append('\n\\begin{longtable}') + endmacro = '\\end{longtable}\n\n' elif self.table.has_verbatim: self.body.append('\n\\begin{tabular}') + endmacro = '\\end{tabular}\n\n' + elif self.table.has_problematic and not self.table.colspec: + # if the user has given us tabularcolumns, accept them and use + # tabulary nevertheless + self.body.append('\n\\begin{tabular}') + endmacro = '\\end{tabular}\n\n' else: self.body.append('\n\\begin{tabulary}{\\linewidth}') + endmacro = '\\end{tabulary}\n\n' if self.table.colspec: self.body.append(self.table.colspec) else: - if self.table.has_verbatim: + if self.table.has_problematic: colwidth = 0.95 / self.table.colcount colspec = ('p{%.3f\\linewidth}|' % colwidth) * \ self.table.colcount @@ -632,7 +659,10 @@ self.body.append('{|' + ('L|' * self.table.colcount) + '}\n') if self.table.longtable and self.table.caption is not None: self.body.append(u'\\caption{%s} \\\\\n' % self.table.caption) - + if self.table.caption is not None: + for id in self.next_table_ids: + self.body.append(self.hypertarget(id, anchor=False)) + self.next_table_ids.clear() if self.table.longtable: self.body.append('\\hline\n') self.body.append('\\endfirsthead\n\n') @@ -650,12 +680,7 @@ else: self.body.append('\\hline\n') self.body.extend(self.tablebody) - if self.table.longtable: - self.body.append('\\end{longtable}\n\n') - elif self.table.has_verbatim: - self.body.append('\\end{tabular}\n\n') - else: - self.body.append('\\end{tabulary}\n\n') + self.body.append(endmacro) if not self.table.longtable and self.table.caption is not None: self.body.append('\\end{threeparttable}\n\n') self.table = None @@ -720,6 +745,8 @@ def visit_bullet_list(self, node): if not self.compact_list: self.body.append('\\begin{itemize}\n' ) + if self.table: + self.table.has_problematic = True def depart_bullet_list(self, node): if not self.compact_list: self.body.append('\\end{itemize}\n' ) @@ -728,6 +755,8 @@ self.body.append('\\begin{enumerate}\n' ) if 'start' in node: self.body.append('\\setcounter{enumi}{%d}\n' % (node['start'] - 1)) + if self.table: + self.table.has_problematic = True def depart_enumerated_list(self, node): self.body.append('\\end{enumerate}\n' ) @@ -740,6 +769,8 @@ def visit_definition_list(self, node): self.body.append('\\begin{description}\n') + if self.table: + self.table.has_problematic = True def depart_definition_list(self, node): self.body.append('\\end{description}\n') @@ -769,6 +800,8 @@ def visit_field_list(self, node): self.body.append('\\begin{quote}\\begin{description}\n') + if self.table: + self.table.has_problematic = True def depart_field_list(self, node): self.body.append('\\end{description}\\end{quote}\n') @@ -790,6 +823,8 @@ def visit_centered(self, node): self.body.append('\n\\begin{center}') + if self.table: + self.table.has_problematic = True def depart_centered(self, node): self.body.append('\n\\end{center}') @@ -799,6 +834,8 @@ self.compact_list += 1 self.body.append('\\begin{itemize}\\setlength{\\itemsep}{0pt}' '\\setlength{\\parskip}{0pt}\n') + if self.table: + self.table.has_problematic = True def depart_hlist(self, node): self.compact_list -= 1 self.body.append('\\end{itemize}\n') @@ -886,11 +923,15 @@ pass def visit_figure(self, node): + ids = '' + for id in self.next_figure_ids: + ids += self.hypertarget(id, anchor=False) + self.next_figure_ids.clear() if node.has_key('width') and node.get('align', '') in ('left', 'right'): self.body.append('\\begin{wrapfigure}{%s}{%s}\n\\centering' % (node['align'] == 'right' and 'r' or 'l', node['width'])) - self.context.append('\\end{wrapfigure}\n') + self.context.append(ids + '\\end{wrapfigure}\n') else: if (not node.attributes.has_key('align') or node.attributes['align'] == 'center'): @@ -902,14 +943,18 @@ align = '\\begin{flush%s}' % node.attributes['align'] align_end = '\\end{flush%s}' % node.attributes['align'] self.body.append('\\begin{figure}[htbp]%s\n' % align) - self.context.append('%s\\end{figure}\n' % align_end) + if any(isinstance(child, nodes.caption) for child in node): + self.body.append('\\capstart\n') + self.context.append(ids + align_end + '\\end{figure}\n') def depart_figure(self, node): self.body.append(self.context.pop()) def visit_caption(self, node): + self.in_caption += 1 self.body.append('\\caption{') def depart_caption(self, node): self.body.append('}') + self.in_caption -= 1 def visit_legend(self, node): self.body.append('{\\small ') @@ -962,8 +1007,11 @@ def add_target(id): # indexing uses standard LaTeX index markup, so the targets # will be generated differently - if not id.startswith('index-'): - self.body.append(self.hypertarget(id)) + if id.startswith('index-'): + return + # do not generate \phantomsection in \section{} + anchor = not self.in_title + self.body.append(self.hypertarget(id, anchor=anchor)) # postpone the labels until after the sectioning command parindex = node.parent.index(node) @@ -979,6 +1027,20 @@ self.next_section_ids.add(node['refid']) self.next_section_ids.update(node['ids']) return + elif isinstance(next, nodes.figure): + # labels for figures go in the figure body, not before + if node.get('refid'): + self.next_figure_ids.add(node['refid']) + self.next_figure_ids.update(node['ids']) + return + elif isinstance(next, nodes.table): + # same for tables, but only if they have a caption + for n in node: + if isinstance(n, nodes.title): + if node.get('refid'): + self.next_table_ids.add(node['refid']) + self.next_table_ids.update(node['ids']) + return except IndexError: pass if 'refuri' in node: @@ -997,6 +1059,8 @@ self.body.append('\n\\end{flushright}\n') def visit_index(self, node, scre=re.compile(r';\s*')): + if not node.get('inline'): + self.body.append('\n') entries = node['entries'] for type, string, tid, _ in entries: if type == 'single': @@ -1047,9 +1111,9 @@ 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)) + self.context.append('}} (%s)' % self.hyperpageref(id)) else: - self.context.append('}') + self.context.append('}}') elif uri.startswith('%'): # references to documents or labels inside documents hashindex = uri.find('#') @@ -1063,23 +1127,15 @@ if len(node) and hasattr(node[0], 'attributes') and \ 'std-term' in node[0].get('classes', []): # don't add a pageref for glossary terms - self.context.append('}') + self.context.append('}}') else: if self.builder.config.latex_show_pagerefs: - self.context.append('} (%s)' % self.hyperpageref(id)) + self.context.append('}} (%s)' % self.hyperpageref(id)) else: - self.context.append('}') - elif uri.startswith('@token'): - if self.in_production_list: - self.body.append('\\token{') - else: - self.body.append('\\grammartoken{') - self.context.append('}') + self.context.append('}}') else: - self.builder.warn( - 'unusable reference target found: %s' % uri, - '%s:%s' % (self.builder.env.doc2path(self.curfilestack[-1]), - node.line or '')) + self.builder.warn('unusable reference target found: %s' % uri, + (self.curfilestack[-1], node.line)) self.context.append('') def depart_reference(self, node): self.body.append(self.context.pop()) @@ -1167,6 +1223,10 @@ if used: self.body.append('\\footnotemark[%s]' % num) else: + if self.in_caption: + raise UnsupportedError('%s:%s: footnotes in float captions ' + 'are not supported by LaTeX' % + (self.curfilestack[-1], node.line)) footnode.walkabout(self) self.footnotestack[-1][num][1] = True raise nodes.SkipChildren @@ -1184,13 +1244,17 @@ lang = node['language'] if node.has_key('linenos'): linenos = node['linenos'] - hlcode = self.highlighter.highlight_block(code, lang, linenos) + def warner(msg): + self.builder.warn(msg, (self.curfilestack[-1], node.line)) + hlcode = self.highlighter.highlight_block(code, lang, linenos, + warn=warner) # workaround for Unicode issue hlcode = hlcode.replace(u'€', u'@texteuro[]') # must use original Verbatim environment and "tabular" environment if self.table: hlcode = hlcode.replace('\\begin{Verbatim}', '\\begin{OriginalVerbatim}') + self.table.has_problematic = True self.table.has_verbatim = True # get consistent trailer hlcode = hlcode.rstrip()[:-14] # strip \end{Verbatim} @@ -1201,31 +1265,21 @@ visit_doctest_block = visit_literal_block depart_doctest_block = depart_literal_block - def visit_line_block(self, node): - """line-block: - * whitespace (including linebreaks) is significant - * inline markup is supported. - * serif typeface - """ - self.body.append('{\\raggedright{}') - self.literal_whitespace += 1 - def depart_line_block(self, node): - self.literal_whitespace -= 1 - # remove the last \\ - del self.body[-1] - self.body.append('}\n') - def visit_line(self, node): - self._line_start = len(self.body) + self.body.append('\item[] ') def depart_line(self, node): - if self._line_start == len(self.body): - # no output in this line -- add a nonbreaking space, else the - # \\ command will give an error - self.body.append('~') - if self.table is not None: - self.body.append('\\newline\n') + self.body.append('\n') + + def visit_line_block(self, node): + if isinstance(node.parent, nodes.line_block): + self.body.append('\\item[]\n' + '\\begin{DUlineblock}{\\DUlineblockindent}\n') else: - self.body.append('\\\\\n') + self.body.append('\n\\begin{DUlineblock}{0em}\n') + if self.table: + self.table.has_problematic = True + def depart_line_block(self, node): + self.body.append('\\end{DUlineblock}\n') def visit_block_quote(self, node): # If the block quote contains a single object and that object @@ -1239,6 +1293,8 @@ done = 1 if not done: self.body.append('\\begin{quote}\n') + if self.table: + self.table.has_problematic = True def depart_block_quote(self, node): done = 0 if len(node.children) == 1: @@ -1275,6 +1331,8 @@ def visit_option_list(self, node): self.body.append('\\begin{optionlist}{3cm}\n') + if self.table: + self.table.has_problematic = True def depart_option_list(self, node): self.body.append('\\end{optionlist}\n') @@ -1369,7 +1427,7 @@ self.verbatim += node.astext() else: text = self.encode(node.astext()) - self.body.append(educateQuotesLatex(text)) + self.body.append(educate_quotes_latex(text)) def depart_Text(self, node): pass diff -Nru sphinx-1.0~hg20100604/sphinx/writers/manpage.py sphinx-1.0.7/sphinx/writers/manpage.py --- sphinx-1.0~hg20100604/sphinx/writers/manpage.py 2010-06-03 22:12:22.000000000 +0000 +++ sphinx-1.0.7/sphinx/writers/manpage.py 2011-01-04 09:00:04.000000000 +0000 @@ -5,7 +5,7 @@ Manual page writer, extended for Sphinx custom nodes. - :copyright: Copyright 2007-2010 by the Sphinx team, see AUTHORS. + :copyright: Copyright 2007-2011 by the Sphinx team, see AUTHORS. :license: BSD, see LICENSE for details. """ diff -Nru sphinx-1.0~hg20100604/sphinx/writers/text.py sphinx-1.0.7/sphinx/writers/text.py --- sphinx-1.0~hg20100604/sphinx/writers/text.py 2010-06-03 22:12:22.000000000 +0000 +++ sphinx-1.0.7/sphinx/writers/text.py 2011-01-04 09:00:04.000000000 +0000 @@ -5,7 +5,7 @@ Custom docutils writer for plain text. - :copyright: Copyright 2007-2010 by the Sphinx team, see AUTHORS. + :copyright: Copyright 2007-2011 by the Sphinx team, see AUTHORS. :license: BSD, see LICENSE for details. """ diff -Nru sphinx-1.0~hg20100604/sphinx-autogen.py sphinx-1.0.7/sphinx-autogen.py --- sphinx-1.0~hg20100604/sphinx-autogen.py 2010-05-06 16:30:00.000000000 +0000 +++ sphinx-1.0.7/sphinx-autogen.py 2011-01-04 09:00:04.000000000 +0000 @@ -4,8 +4,8 @@ Sphinx - Python documentation toolchain ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - :copyright: 2007-2010 by Georg Brandl. - :license: BSD. + :copyright: Copyright 2007-2011 by the Sphinx team, see AUTHORS. + :license: BSD, see LICENSE for details. """ import sys diff -Nru sphinx-1.0~hg20100604/sphinx-build.py sphinx-1.0.7/sphinx-build.py --- sphinx-1.0~hg20100604/sphinx-build.py 2010-05-06 16:30:00.000000000 +0000 +++ sphinx-1.0.7/sphinx-build.py 2011-01-04 09:00:04.000000000 +0000 @@ -4,7 +4,7 @@ Sphinx - Python documentation toolchain ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - :copyright: Copyright 2007-2010 by the Sphinx team, see AUTHORS. + :copyright: Copyright 2007-2011 by the Sphinx team, see AUTHORS. :license: BSD, see LICENSE for details. """ diff -Nru sphinx-1.0~hg20100604/Sphinx.egg-info/PKG-INFO sphinx-1.0.7/Sphinx.egg-info/PKG-INFO --- sphinx-1.0~hg20100604/Sphinx.egg-info/PKG-INFO 2010-06-04 12:12:04.000000000 +0000 +++ sphinx-1.0.7/Sphinx.egg-info/PKG-INFO 2011-01-15 15:25:58.000000000 +0000 @@ -1,6 +1,6 @@ Metadata-Version: 1.0 Name: Sphinx -Version: 1.0b2-dev-20100604 +Version: 1.0.7 Summary: Python documentation generator Home-page: http://sphinx.pocoo.org/ Author: Georg Brandl @@ -47,6 +47,7 @@ Classifier: License :: OSI Approved :: BSD License Classifier: Operating System :: OS Independent Classifier: Programming Language :: Python +Classifier: Programming Language :: Python :: 2 Classifier: Topic :: Documentation Classifier: Topic :: Text Processing Classifier: Topic :: Utilities diff -Nru sphinx-1.0~hg20100604/Sphinx.egg-info/SOURCES.txt sphinx-1.0.7/Sphinx.egg-info/SOURCES.txt --- sphinx-1.0~hg20100604/Sphinx.egg-info/SOURCES.txt 2010-06-04 12:12:04.000000000 +0000 +++ sphinx-1.0.7/Sphinx.egg-info/SOURCES.txt 2011-01-15 15:25:59.000000000 +0000 @@ -38,6 +38,7 @@ doc/templating.rst doc/theming.rst doc/tutorial.rst +doc/_static/pocoo.png doc/_static/sphinx.png doc/_templates/index.html doc/_templates/indexsidebar.html @@ -138,14 +139,19 @@ sphinx/ext/autosummary/templates/autosummary/class.rst sphinx/ext/autosummary/templates/autosummary/module.rst sphinx/locale/__init__.py -sphinx/locale/__init__.pyc sphinx/locale/sphinx.pot +sphinx/locale/bn/LC_MESSAGES/sphinx.js +sphinx/locale/bn/LC_MESSAGES/sphinx.mo +sphinx/locale/bn/LC_MESSAGES/sphinx.po sphinx/locale/ca/LC_MESSAGES/sphinx.js sphinx/locale/ca/LC_MESSAGES/sphinx.mo sphinx/locale/ca/LC_MESSAGES/sphinx.po sphinx/locale/cs/LC_MESSAGES/sphinx.js sphinx/locale/cs/LC_MESSAGES/sphinx.mo sphinx/locale/cs/LC_MESSAGES/sphinx.po +sphinx/locale/da/LC_MESSAGES/sphinx.js +sphinx/locale/da/LC_MESSAGES/sphinx.mo +sphinx/locale/da/LC_MESSAGES/sphinx.po sphinx/locale/de/LC_MESSAGES/sphinx.js sphinx/locale/de/LC_MESSAGES/sphinx.mo sphinx/locale/de/LC_MESSAGES/sphinx.po @@ -167,6 +173,9 @@ sphinx/locale/ja/LC_MESSAGES/sphinx.js sphinx/locale/ja/LC_MESSAGES/sphinx.mo sphinx/locale/ja/LC_MESSAGES/sphinx.po +sphinx/locale/lt/LC_MESSAGES/sphinx.js +sphinx/locale/lt/LC_MESSAGES/sphinx.mo +sphinx/locale/lt/LC_MESSAGES/sphinx.po sphinx/locale/nl/LC_MESSAGES/sphinx.js sphinx/locale/nl/LC_MESSAGES/sphinx.mo sphinx/locale/nl/LC_MESSAGES/sphinx.po @@ -286,6 +295,7 @@ sphinx/util/docstrings.py sphinx/util/inspect.py sphinx/util/jsdump.py +sphinx/util/jsonimpl.py sphinx/util/matching.py sphinx/util/nodes.py sphinx/util/osutil.py @@ -330,6 +340,7 @@ tests/etree13/__init__.py tests/root/Makefile tests/root/autodoc.txt +tests/root/autodoc_fodder.py tests/root/autosummary.txt tests/root/bom.txt tests/root/conf.py diff -Nru sphinx-1.0~hg20100604/sphinx-quickstart.py sphinx-1.0.7/sphinx-quickstart.py --- sphinx-1.0~hg20100604/sphinx-quickstart.py 2010-05-06 16:30:00.000000000 +0000 +++ sphinx-1.0.7/sphinx-quickstart.py 2011-01-04 09:00:04.000000000 +0000 @@ -4,7 +4,7 @@ Sphinx - Python documentation toolchain ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - :copyright: Copyright 2007-2010 by the Sphinx team, see AUTHORS. + :copyright: Copyright 2007-2011 by the Sphinx team, see AUTHORS. :license: BSD, see LICENSE for details. """ diff -Nru sphinx-1.0~hg20100604/tests/root/autodoc_fodder.py sphinx-1.0.7/tests/root/autodoc_fodder.py --- sphinx-1.0~hg20100604/tests/root/autodoc_fodder.py 1970-01-01 00:00:00.000000000 +0000 +++ sphinx-1.0.7/tests/root/autodoc_fodder.py 2011-01-04 09:00:05.000000000 +0000 @@ -0,0 +1,7 @@ + +class MarkupError(object): + """ + .. note:: This is a docstring with a + small markup error which should have + correct location information. + """ diff -Nru sphinx-1.0~hg20100604/tests/root/autodoc.txt sphinx-1.0.7/tests/root/autodoc.txt --- sphinx-1.0~hg20100604/tests/root/autodoc.txt 2010-05-06 16:30:00.000000000 +0000 +++ sphinx-1.0.7/tests/root/autodoc.txt 2011-01-04 09:00:05.000000000 +0000 @@ -26,3 +26,9 @@ .. autoclass:: CustomDict :show-inheritance: :members: + + +.. automodule:: autodoc_fodder + :noindex: + + .. autoclass:: MarkupError diff -Nru sphinx-1.0~hg20100604/tests/root/conf.py sphinx-1.0.7/tests/root/conf.py --- sphinx-1.0~hg20100604/tests/root/conf.py 2010-06-03 22:12:22.000000000 +0000 +++ sphinx-1.0.7/tests/root/conf.py 2011-01-04 09:00:05.000000000 +0000 @@ -91,3 +91,4 @@ app.add_directive('clsdir', ClassDirective) app.add_object_type('userdesc', 'userdescrole', '%s (userdesc)', userdesc_parse, objname='user desc') + app.add_javascript('file://moo.js') diff -Nru sphinx-1.0~hg20100604/tests/root/markup.txt sphinx-1.0.7/tests/root/markup.txt --- sphinx-1.0~hg20100604/tests/root/markup.txt 2010-06-03 22:12:22.000000000 +0000 +++ sphinx-1.0.7/tests/root/markup.txt 2011-01-08 21:17:55.000000000 +0000 @@ -34,6 +34,16 @@ -h help --help also help +Line block: + +| line1 +| line2 +| line3 +| line4 +| line5 +| line6 +| line7 + Body directives ^^^^^^^^^^^^^^^ @@ -97,21 +107,23 @@ *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` +Adding \n to test unescaping. + +* :command:`command\\n` +* :dfn:`dfn\\n` +* :guilabel:`guilabel with &accelerator and \\n` +* :kbd:`kbd\\n` +* :mailheader:`mailheader\\n` +* :makevar:`makevar\\n` +* :manpage:`manpage\\n` +* :mimetype:`mimetype\\n` +* :newsgroup:`newsgroup\\n` +* :program:`program\\n` +* :regexp:`regexp\\n` +* :menuselection:`File --> Close\\n` * :menuselection:`&File --> &Print` -* :file:`a/{varpart}/b` -* :samp:`print {i}` +* :file:`a/{varpart}/b\\n` +* :samp:`print {i}\\n` *Linking inline markup* @@ -144,6 +156,8 @@ .. tabularcolumns:: |L|p{5cm}|R| +.. _my-table: + .. table:: my table +----+----------------+----+ diff -Nru sphinx-1.0~hg20100604/tests/root/objects.txt sphinx-1.0.7/tests/root/objects.txt --- sphinx-1.0~hg20100604/tests/root/objects.txt 2010-06-03 22:12:22.000000000 +0000 +++ sphinx-1.0.7/tests/root/objects.txt 2011-01-06 11:26:14.000000000 +0000 @@ -13,6 +13,9 @@ .. function:: func_with_module :module: foolib +Referring to :func:`func with no index `. +Referring to :func:`nothing <>`. + .. module:: mod :synopsis: Module synopsis. :platform: UNIX @@ -41,12 +44,23 @@ .. function:: func_without_module2() -> annotation +.. object:: long(parameter, \ + list) + another one + .. class:: TimeInt + Has only one parameter (triggers special behavior...) + + :param moo: |test| + :type moo: |test| + +.. |test| replace:: Moo + .. class:: Time(hour, minute, isdst) - :param hour: The year. - :type hour: TimeInt + :param year: The year. + :type year: TimeInt :param TimeInt minute: The minute. :param isdst: whether it's DST :type isdst: * some complex @@ -57,6 +71,10 @@ :ivar int hour: like *hour* :ivar minute: like *minute* :vartype minute: int + :param hour: Some parameter + :type hour: DuplicateType + :param hour: Duplicate param. Should not lead to crashes. + :type hour: DuplicateType C items @@ -143,3 +161,14 @@ Referencing :userdescrole:`myobj`. + + +CPP domain +========== + +.. cpp:class:: n::Array + + .. cpp:function:: T& operator[]( unsigned j ) + + .. cpp:function:: const T& operator[]( unsigned j ) const + diff -Nru sphinx-1.0~hg20100604/tests/run.py sphinx-1.0.7/tests/run.py --- sphinx-1.0~hg20100604/tests/run.py 2010-05-06 16:30:00.000000000 +0000 +++ sphinx-1.0.7/tests/run.py 2011-01-04 09:00:05.000000000 +0000 @@ -6,7 +6,7 @@ This script runs the Sphinx unit test suite. - :copyright: Copyright 2007-2010 by the Sphinx team, see AUTHORS. + :copyright: Copyright 2007-2011 by the Sphinx team, see AUTHORS. :license: BSD, see LICENSE for details. """ diff -Nru sphinx-1.0~hg20100604/tests/test_application.py sphinx-1.0.7/tests/test_application.py --- sphinx-1.0~hg20100604/tests/test_application.py 2010-05-06 16:30:00.000000000 +0000 +++ sphinx-1.0.7/tests/test_application.py 2011-01-04 09:00:05.000000000 +0000 @@ -5,7 +5,7 @@ Test the Sphinx class. - :copyright: Copyright 2007-2010 by the Sphinx team, see AUTHORS. + :copyright: Copyright 2007-2011 by the Sphinx team, see AUTHORS. :license: BSD, see LICENSE for details. """ diff -Nru sphinx-1.0~hg20100604/tests/test_autodoc.py sphinx-1.0.7/tests/test_autodoc.py --- sphinx-1.0~hg20100604/tests/test_autodoc.py 2010-05-06 16:30:00.000000000 +0000 +++ sphinx-1.0.7/tests/test_autodoc.py 2011-01-07 18:03:36.000000000 +0000 @@ -6,7 +6,7 @@ Test the autodoc extension. This tests mainly the Documenters; the auto directives are tested in a test source file translated by test_build. - :copyright: Copyright 2007-2010 by the Sphinx team, see AUTHORS. + :copyright: Copyright 2007-2011 by the Sphinx team, see AUTHORS. :license: BSD, see LICENSE for details. """ @@ -17,12 +17,14 @@ from sphinx.ext.autodoc import AutoDirective, add_documenter, \ ModuleLevelDocumenter, FunctionDocumenter, cut_lines, between, ALL +from StringIO import StringIO def setup_module(): global app, lid, options, directive app = TestApp() app.builder.env.app = app + app.builder.env.temp_data['docname'] = 'dummy' app.connect('autodoc-process-docstring', process_docstring) app.connect('autodoc-process-signature', process_signature) app.connect('autodoc-skip-member', skip_member) @@ -271,7 +273,7 @@ app.disconnect(lid) lid = app.connect('autodoc-process-docstring', between('---', ['function'])) - def f(): + def g(): """ first line --- @@ -279,9 +281,21 @@ --- third line """ - assert process('function', 'f', f) == ['second line', ''] + assert process('function', 'g', g) == ['second line', ''] app.disconnect(lid) + lid = app.connect('autodoc-process-docstring', between('---', ['function'], + exclude=True)) + def h(): + """ + first line + --- + second line + --- + third line + """ + assert process('function', 'h', h) == ['first line', 'third line', ''] + app.disconnect(lid) def test_new_documenter(): class MyDocumenter(ModuleLevelDocumenter): @@ -404,6 +418,7 @@ ('attribute', 'test_autodoc.Class.attr'), ('attribute', 'test_autodoc.Class.docattr'), ('attribute', 'test_autodoc.Class.udocattr'), + ('attribute', 'test_autodoc.Class.mdocattr'), ('attribute', 'test_autodoc.Class.inst_attr_comment'), ('attribute', 'test_autodoc.Class.inst_attr_string') ]) @@ -472,11 +487,19 @@ ' .. py:attribute:: Class.prop', ' .. py:attribute:: Class.docattr', ' .. py:attribute:: Class.udocattr', + ' .. py:attribute:: Class.mdocattr', ' .. py:attribute:: Class.inst_attr_comment', ' .. py:attribute:: Class.inst_attr_string', ' .. py:method:: Class.inheritedmeth()', ], 'class', 'Class', member_order='bysource', all_members=True) + del directive.env.temp_data['py:module'] + + # test attribute initialized to class instance from other module + directive.env.temp_data['autodoc:class'] = 'test_autodoc.Class' + assert_result_contains(u' should be documented as well - s\xfc\xdf', + 'attribute', 'mdocattr') + del directive.env.temp_data['autodoc:class'] # --- generate fodder ------------ @@ -540,6 +563,10 @@ udocattr = 'quux' u"""should be documented as well - süß""" + # initialized to any class imported from another module + mdocattr = StringIO() + """should be documented as well - süß""" + def __init__(self, arg): #: a documented instance attribute self.inst_attr_comment = None diff -Nru sphinx-1.0~hg20100604/tests/test_autosummary.py sphinx-1.0.7/tests/test_autosummary.py --- sphinx-1.0~hg20100604/tests/test_autosummary.py 2010-05-06 16:30:00.000000000 +0000 +++ sphinx-1.0.7/tests/test_autosummary.py 2011-01-04 09:00:05.000000000 +0000 @@ -5,7 +5,7 @@ Test the autosummary extension. - :copyright: Copyright 2007-2010 by the Sphinx team, see AUTHORS. + :copyright: Copyright 2007-2011 by the Sphinx team, see AUTHORS. :license: BSD, see LICENSE for details. """ diff -Nru sphinx-1.0~hg20100604/tests/test_build_html.py sphinx-1.0.7/tests/test_build_html.py --- sphinx-1.0~hg20100604/tests/test_build_html.py 2010-06-03 22:12:22.000000000 +0000 +++ sphinx-1.0.7/tests/test_build_html.py 2011-01-07 17:57:50.000000000 +0000 @@ -5,13 +5,12 @@ Test the HTML builder and check output against XPath. - :copyright: Copyright 2007-2010 by the Sphinx team, see AUTHORS. + :copyright: Copyright 2007-2011 by the Sphinx team, see AUTHORS. :license: BSD, see LICENSE for details. """ import os import re -import difflib import htmlentitydefs from StringIO import StringIO @@ -32,13 +31,19 @@ html_warnfile = StringIO() ENV_WARNINGS = """\ +%(root)s/autodoc_fodder.py:docstring of autodoc_fodder\\.MarkupError:2: \ +\\(WARNING/2\\) Explicit markup ends without a blank line; unexpected \ +unindent\\.\\n? %(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:\\d*: \\(WARNING/2\\) Encoding 'utf-8-sig' used for \ -reading included file u'wrongenc.inc' seems to be wrong, try giving an \ -:encoding: option +reading included file u'.*?wrongenc.inc' seems to be wrong, try giving an \ +:encoding: option\\n? %(root)s/includes.txt:4: WARNING: download file not readable: nonexisting.png +%(root)s/objects.txt:\\d*: WARNING: using old C markup; please migrate to \ +new-style markup \(e.g. c:function instead of cfunction\), see \ +http://sphinx.pocoo.org/domains.html """ HTML_WARNINGS = ENV_WARNINGS + """\ @@ -48,183 +53,205 @@ %(root)s/markup.txt:: WARNING: invalid pair index entry u'keyword; ' """ +def tail_check(check): + rex = re.compile(check) + def checker(nodes): + for node in nodes: + if node.tail and rex.search(node.tail): + return True + assert False, '%r not found in tail of any nodes %s' % (check, nodes) + return checker + + 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']": '', - ".//img[@src='../_images/img.png']": '', - ".//p": 'This is an include file.', - }, - '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/p": 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', + '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']", ''), + (".//img[@src='../_images/img.png']", ''), + (".//p", 'This is an include file.'), + ], + '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/p", 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']": '', + (".//meta[@name='author'][@content='Me']", ''), + (".//meta[@name='keywords'][@content='docs, sphinx']", ''), # a label created by ``.. _label:`` - ".//div[@id='label']": '', + (".//div[@id='label']", ''), # code with standard code blocks - ".//pre": '^some code$', + (".//pre", '^some code$'), # an option list - ".//span[@class='option']": '--help', + (".//span[@class='option']", '--help'), # admonitions - ".//p[@class='first admonition-title']": 'My Admonition', - ".//p[@class='last']": 'Note text.', - ".//p[@class='last']": 'Warning text.', + (".//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', + (".//li/strong", r'^command\\n$'), + (".//li/strong", r'^program\\n$'), + (".//li/em", r'^dfn\\n$'), + (".//li/tt/span[@class='pre']", r'^kbd\\n$'), + (".//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$', + (".//abbr[@title='abbreviation']", '^abbr$'), # version stuff - ".//span[@class='versionmodified']": 'New in version 0.6', + (".//span[@class='versionmodified']", 'New in version 0.6'), # footnote reference - ".//a[@class='footnote-reference']": r'\[1\]', + (".//a[@class='footnote-reference']", r'\[1\]'), # created by reference lookup - ".//a[@href='contents.html#ref1']": '', + (".//a[@href='contents.html#ref1']", ''), # ``seealso`` directive - ".//div/p[@class='first admonition-title']": 'See also', + (".//div/p[@class='first admonition-title']", 'See also'), # a ``hlist`` directive - ".//table[@class='hlist']/tr/td/ul/li": '^This$', + (".//table[@class='hlist']/tr/td/ul/li", '^This$'), # a ``centered`` directive - ".//p[@class='centered']/strong": 'LICENSE', + (".//p[@class='centered']/strong", 'LICENSE'), # a glossary - ".//dl/dt[@id='term-boson']": 'boson', + (".//dl/dt[@id='term-boson']", 'boson'), # a production list - ".//pre/strong": 'try_stmt', - ".//pre/a[@href='#grammar-token-try1_stmt']/tt/span": 'try1_stmt', + (".//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']": '', + (".//p", 'A global substitution.'), + (".//p", 'In HTML.'), + (".//p", 'In both.'), + (".//p", 'Always present'), + ], + 'objects.html': [ + (".//dt[@id='mod.Cls.meth1']", ''), + (".//dt[@id='errmod.Error']", ''), + (".//dt/tt", r'long\(parameter,\s* list\)'), + (".//dt/tt", 'another one'), + (".//a[@href='#mod.Cls'][@class='reference internal']", ''), + (".//dl[@class='userdesc']", ''), + (".//dt[@id='userdesc-myobj']", ''), + (".//a[@href='#userdesc-myobj'][@class='reference internal']", ''), # 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']": '', + (".//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']": '', + (".//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', + (".//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 ', - ".//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', + (".//h4", 'Custom sidebar'), + # docfields + (".//td[@class='field-body']/strong", '^moo$'), + (".//td[@class='field-body']/strong", + tail_check(r'\(Moo\) .* Moo')), + (".//td[@class='field-body']/ul/li/strong", '^hour$'), + (".//td[@class='field-body']/ul/li/em", '^DuplicateType$'), + (".//td[@class='field-body']/ul/li/em", + tail_check(r'.* Some parameter')), + ], + '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 '), + (".//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 ', - }, + (".//h4", 'Contents sidebar'), + # custom JavaScript + (".//script[@src='file://moo.js']", ''), + ], + '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 '), + ], } 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', - }) + HTML_XPATH['includes.html'].extend([ + (".//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'].extend([ + (".//pre/span", 'line 1'), + (".//pre/span", 'line 2'), + ]) class NslessParser(ET.XMLParser): """XMLParser that throws away namespaces in tag names.""" @@ -282,14 +309,14 @@ html_warnings_exp = HTML_WARNINGS % {'root': re.escape(app.srcdir)} assert re.match(html_warnings_exp + '$', html_warnings), \ 'Warnings don\'t match:\n' + \ - '\n'.join(difflib.ndiff(html_warnings_exp.splitlines(), - html_warnings.splitlines())) + '--- Expected (regex):\n' + html_warnings_exp + \ + '--- Got:\n' + html_warnings 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(): + for path, check in paths: yield check_xpath, etree, fname, path, check check_static_entries(app.builder.outdir) diff -Nru sphinx-1.0~hg20100604/tests/test_build_latex.py sphinx-1.0.7/tests/test_build_latex.py --- sphinx-1.0~hg20100604/tests/test_build_latex.py 2010-06-03 22:12:22.000000000 +0000 +++ sphinx-1.0.7/tests/test_build_latex.py 2011-01-04 09:00:05.000000000 +0000 @@ -5,14 +5,13 @@ Test the build process with LaTeX builder with the test root. - :copyright: Copyright 2007-2010 by the Sphinx team, see AUTHORS. + :copyright: Copyright 2007-2011 by the Sphinx team, see AUTHORS. :license: BSD, see LICENSE for details. """ import os import re import sys -import difflib from StringIO import StringIO from subprocess import Popen, PIPE @@ -42,8 +41,9 @@ latex_warnings_exp = LATEX_WARNINGS % {'root': app.srcdir} assert re.match(latex_warnings_exp + '$', latex_warnings), \ 'Warnings don\'t match:\n' + \ - '\n'.join(difflib.ndiff(latex_warnings_exp.splitlines(), - latex_warnings.splitlines())) + '--- Expected (regex):\n' + latex_warnings_exp + \ + '--- Got:\n' + latex_warnings + # file from latex_additional_files assert (app.outdir / 'svgimg.svg').isfile() diff -Nru sphinx-1.0~hg20100604/tests/test_build.py sphinx-1.0.7/tests/test_build.py --- sphinx-1.0~hg20100604/tests/test_build.py 2010-06-03 22:12:22.000000000 +0000 +++ sphinx-1.0.7/tests/test_build.py 2011-01-04 09:00:05.000000000 +0000 @@ -5,7 +5,7 @@ Test all builders that have no special checks. - :copyright: Copyright 2007-2010 by the Sphinx team, see AUTHORS. + :copyright: Copyright 2007-2011 by the Sphinx team, see AUTHORS. :license: BSD, see LICENSE for details. """ @@ -21,6 +21,10 @@ def test_pickle(app): app.builder.build_all() +@with_app(buildername='json') +def test_json(app): + app.builder.build_all() + @with_app(buildername='linkcheck') def test_linkcheck(app): app.builder.build_all() diff -Nru sphinx-1.0~hg20100604/tests/test_config.py sphinx-1.0.7/tests/test_config.py --- sphinx-1.0~hg20100604/tests/test_config.py 2010-05-06 16:30:00.000000000 +0000 +++ sphinx-1.0.7/tests/test_config.py 2011-01-04 09:00:05.000000000 +0000 @@ -6,7 +6,7 @@ Test the sphinx.config.Config class and its handling in the Application class. - :copyright: Copyright 2007-2010 by the Sphinx team, see AUTHORS. + :copyright: Copyright 2007-2011 by the Sphinx team, see AUTHORS. :license: BSD, see LICENSE for details. """ diff -Nru sphinx-1.0~hg20100604/tests/test_coverage.py sphinx-1.0.7/tests/test_coverage.py --- sphinx-1.0~hg20100604/tests/test_coverage.py 2010-05-06 16:30:00.000000000 +0000 +++ sphinx-1.0.7/tests/test_coverage.py 2011-01-04 09:00:05.000000000 +0000 @@ -5,7 +5,7 @@ Test the coverage builder. - :copyright: Copyright 2007-2010 by the Sphinx team, see AUTHORS. + :copyright: Copyright 2007-2011 by the Sphinx team, see AUTHORS. :license: BSD, see LICENSE for details. """ diff -Nru sphinx-1.0~hg20100604/tests/test_cpp_domain.py sphinx-1.0.7/tests/test_cpp_domain.py --- sphinx-1.0~hg20100604/tests/test_cpp_domain.py 2010-05-06 16:30:00.000000000 +0000 +++ sphinx-1.0.7/tests/test_cpp_domain.py 2011-01-04 09:00:05.000000000 +0000 @@ -5,7 +5,7 @@ Tests the C++ Domain - :copyright: Copyright 2007-2010 by the Sphinx team, see AUTHORS. + :copyright: Copyright 2007-2011 by the Sphinx team, see AUTHORS. :license: BSD, see LICENSE for details. """ diff -Nru sphinx-1.0~hg20100604/tests/test_doctest.py sphinx-1.0.7/tests/test_doctest.py --- sphinx-1.0~hg20100604/tests/test_doctest.py 2010-05-06 16:30:00.000000000 +0000 +++ sphinx-1.0.7/tests/test_doctest.py 2011-01-04 09:00:05.000000000 +0000 @@ -5,7 +5,7 @@ Test the doctest extension. - :copyright: Copyright 2007-2010 by the Sphinx team, see AUTHORS. + :copyright: Copyright 2007-2011 by the Sphinx team, see AUTHORS. :license: BSD, see LICENSE for details. """ diff -Nru sphinx-1.0~hg20100604/tests/test_env.py sphinx-1.0.7/tests/test_env.py --- sphinx-1.0~hg20100604/tests/test_env.py 2010-05-06 16:30:00.000000000 +0000 +++ sphinx-1.0.7/tests/test_env.py 2011-01-04 09:00:05.000000000 +0000 @@ -5,7 +5,7 @@ Test the BuildEnvironment class. - :copyright: Copyright 2007-2010 by the Sphinx team, see AUTHORS. + :copyright: Copyright 2007-2011 by the Sphinx team, see AUTHORS. :license: BSD, see LICENSE for details. """ @@ -28,7 +28,7 @@ def warning_emitted(file, text): for warning in warnings: - if len(warning) == 2 and file+':' in warning[1] and text in warning[0]: + if len(warning) == 2 and file in warning[1] and text in warning[0]: return True return False @@ -46,8 +46,8 @@ assert 'subdir/excluded' not in env.found_docs def test_images(): - assert warning_emitted('images.txt', 'image file not readable: foo.png') - assert warning_emitted('images.txt', 'nonlocal image URI found: ' + assert warning_emitted('images', 'image file not readable: foo.png') + assert warning_emitted('images', 'nonlocal image URI found: ' 'http://www.python.org/logo.png') tree = env.get_doctree('images') diff -Nru sphinx-1.0~hg20100604/tests/test_highlighting.py sphinx-1.0.7/tests/test_highlighting.py --- sphinx-1.0~hg20100604/tests/test_highlighting.py 2010-05-06 16:30:00.000000000 +0000 +++ sphinx-1.0.7/tests/test_highlighting.py 2011-01-04 09:00:05.000000000 +0000 @@ -5,7 +5,7 @@ Test the Pygments highlighting bridge. - :copyright: Copyright 2007-2010 by the Sphinx team, see AUTHORS. + :copyright: Copyright 2007-2011 by the Sphinx team, see AUTHORS. :license: BSD, see LICENSE for details. """ diff -Nru sphinx-1.0~hg20100604/tests/test_i18n.py sphinx-1.0.7/tests/test_i18n.py --- sphinx-1.0~hg20100604/tests/test_i18n.py 2010-05-06 16:30:00.000000000 +0000 +++ sphinx-1.0.7/tests/test_i18n.py 2011-01-04 09:00:05.000000000 +0000 @@ -5,7 +5,7 @@ Test locale features. - :copyright: Copyright 2007-2010 by the Sphinx team, see AUTHORS. + :copyright: Copyright 2007-2011 by the Sphinx team, see AUTHORS. :license: BSD, see LICENSE for details. """ diff -Nru sphinx-1.0~hg20100604/tests/test_intersphinx.py sphinx-1.0.7/tests/test_intersphinx.py --- sphinx-1.0~hg20100604/tests/test_intersphinx.py 2010-06-03 22:12:22.000000000 +0000 +++ sphinx-1.0.7/tests/test_intersphinx.py 2011-01-04 09:00:05.000000000 +0000 @@ -5,7 +5,7 @@ Test the intersphinx extension. - :copyright: Copyright 2007-2010 by the Sphinx team, see AUTHORS. + :copyright: Copyright 2007-2011 by the Sphinx team, see AUTHORS. :license: BSD, see LICENSE for details. """ @@ -80,7 +80,10 @@ 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_mapping = { + 'http://docs.python.org/': inv_file, + 'py3k': ('http://docs.python.org/py3k/', inv_file), + } app.config.intersphinx_cache_limit = 0 # load the inventory and check if it's done correctly @@ -91,22 +94,58 @@ ('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) + def fake_node(domain, type, target, content, **attrs): + contnode = nodes.emphasis(content, content) + node = addnodes.pending_xref('') + node['reftarget'] = target + node['reftype'] = type + node['refdomain'] = domain + node.attributes.update(attrs) + node += contnode + return node, contnode + + def reference_check(*args, **kwds): + node, contnode = fake_node(*args, **kwds) + return missing_reference(app, app.env, node, contnode) + + # check resolution when a target is found + rn = reference_check('py', 'func', 'module1.func', 'foo') 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 + assert rn[0].astext() == 'foo' # 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 + assert reference_check('py', 'foo', 'module1.func', 'foo') is None + assert reference_check('py', 'func', 'foo', 'foo') is None + assert reference_check('py', 'func', 'foo', 'foo') is None + + # check handling of prefixes + + # prefix given, target found: prefix is stripped + rn = reference_check('py', 'mod', 'py3k:module2', 'py3k:module2') + assert rn[0].astext() == 'module2' + + # prefix given, but not in title: nothing stripped + rn = reference_check('py', 'mod', 'py3k:module2', 'module2') + assert rn[0].astext() == 'module2' + + # prefix given, but explicit: nothing stripped + rn = reference_check('py', 'mod', 'py3k:module2', 'py3k:module2', + refexplicit=True) + assert rn[0].astext() == 'py3k:module2' + + # prefix given, target not found and nonexplicit title: prefix is stripped + node, contnode = fake_node('py', 'mod', 'py3k:unknown', 'py3k:unknown', + refexplicit=False) + rn = missing_reference(app, app.env, node, contnode) + assert rn is None + assert contnode[0].astext() == 'unknown' + + # prefix given, target not found and explicit title: nothing is changed + node, contnode = fake_node('py', 'mod', 'py3k:unknown', 'py3k:unknown', + refexplicit=True) + rn = missing_reference(app, app.env, node, contnode) + assert rn is None + assert contnode[0].astext() == 'py3k:unknown' diff -Nru sphinx-1.0~hg20100604/tests/test_markup.py sphinx-1.0.7/tests/test_markup.py --- sphinx-1.0~hg20100604/tests/test_markup.py 2010-06-03 22:12:22.000000000 +0000 +++ sphinx-1.0.7/tests/test_markup.py 2011-01-04 09:00:05.000000000 +0000 @@ -5,7 +5,7 @@ Test various Sphinx-specific markup extensions. - :copyright: Copyright 2007-2010 by the Sphinx team, see AUTHORS. + :copyright: Copyright 2007-2011 by the Sphinx team, see AUTHORS. :license: BSD, see LICENSE for details. """ diff -Nru sphinx-1.0~hg20100604/tests/test_metadata.py sphinx-1.0.7/tests/test_metadata.py --- sphinx-1.0~hg20100604/tests/test_metadata.py 2010-05-06 16:30:00.000000000 +0000 +++ sphinx-1.0.7/tests/test_metadata.py 2011-01-04 09:00:05.000000000 +0000 @@ -5,7 +5,7 @@ Test our handling of metadata in files with bibliographic metadata. - :copyright: Copyright 2007-2010 by the Sphinx team, see AUTHORS. + :copyright: Copyright 2007-2011 by the Sphinx team, see AUTHORS. :license: BSD, see LICENSE for details. """ diff -Nru sphinx-1.0~hg20100604/tests/test_quickstart.py sphinx-1.0.7/tests/test_quickstart.py --- sphinx-1.0~hg20100604/tests/test_quickstart.py 2010-05-06 16:30:00.000000000 +0000 +++ sphinx-1.0.7/tests/test_quickstart.py 2011-01-04 09:00:05.000000000 +0000 @@ -5,7 +5,7 @@ Test the sphinx.quickstart module. - :copyright: Copyright 2007-2010 by the Sphinx team, see AUTHORS. + :copyright: Copyright 2007-2011 by the Sphinx team, see AUTHORS. :license: BSD, see LICENSE for details. """ diff -Nru sphinx-1.0~hg20100604/tests/test_rst_domain.py sphinx-1.0.7/tests/test_rst_domain.py --- sphinx-1.0~hg20100604/tests/test_rst_domain.py 2010-05-06 16:30:00.000000000 +0000 +++ sphinx-1.0.7/tests/test_rst_domain.py 2011-01-04 09:00:05.000000000 +0000 @@ -5,7 +5,7 @@ Tests the reStructuredText domain. - :copyright: Copyright 2007-2010 by the Sphinx team, see AUTHORS. + :copyright: Copyright 2007-2011 by the Sphinx team, see AUTHORS. :license: BSD, see LICENSE for details. """ diff -Nru sphinx-1.0~hg20100604/tests/test_search.py sphinx-1.0.7/tests/test_search.py --- sphinx-1.0~hg20100604/tests/test_search.py 2010-05-06 16:30:00.000000000 +0000 +++ sphinx-1.0.7/tests/test_search.py 2011-01-04 09:00:05.000000000 +0000 @@ -5,7 +5,7 @@ Test the search index builder. - :copyright: Copyright 2007-2010 by the Sphinx team, see AUTHORS. + :copyright: Copyright 2007-2011 by the Sphinx team, see AUTHORS. :license: BSD, see LICENSE for details. """ diff -Nru sphinx-1.0~hg20100604/tests/test_theming.py sphinx-1.0.7/tests/test_theming.py --- sphinx-1.0~hg20100604/tests/test_theming.py 2010-05-06 16:30:00.000000000 +0000 +++ sphinx-1.0.7/tests/test_theming.py 2011-01-04 09:00:05.000000000 +0000 @@ -5,7 +5,7 @@ Test the Theme class. - :copyright: Copyright 2007-2010 by the Sphinx team, see AUTHORS. + :copyright: Copyright 2007-2011 by the Sphinx team, see AUTHORS. :license: BSD, see LICENSE for details. """ diff -Nru sphinx-1.0~hg20100604/tests/util.py sphinx-1.0.7/tests/util.py --- sphinx-1.0~hg20100604/tests/util.py 2010-05-06 16:30:00.000000000 +0000 +++ sphinx-1.0.7/tests/util.py 2011-01-04 09:00:05.000000000 +0000 @@ -3,7 +3,7 @@ Sphinx test suite utilities ~~~~~~~~~~~~~~~~~~~~~~~~~~~ - :copyright: Copyright 2007-2010 by the Sphinx team, see AUTHORS. + :copyright: Copyright 2007-2011 by the Sphinx team, see AUTHORS. :license: BSD, see LICENSE for details. """ diff -Nru sphinx-1.0~hg20100604/utils/check_sources.py sphinx-1.0.7/utils/check_sources.py --- sphinx-1.0~hg20100604/utils/check_sources.py 2010-05-06 16:30:00.000000000 +0000 +++ sphinx-1.0.7/utils/check_sources.py 2011-01-04 09:00:05.000000000 +0000 @@ -7,7 +7,7 @@ Make sure each Python file has a correct file header including copyright and license information. - :copyright: Copyright 2007-2010 by the Sphinx team, see AUTHORS. + :copyright: Copyright 2007-2011 by the Sphinx team, see AUTHORS. :license: BSD, see LICENSE for details. """