merge with 0.6

This commit is contained in:
Georg Brandl 2009-12-24 13:32:16 +01:00
commit 0238b8322d
13 changed files with 43 additions and 12 deletions

View File

@ -47,6 +47,13 @@ Release 1.0 (in development)
Release 0.6.4 (in development) Release 0.6.4 (in development)
============================== ==============================
* #299: Fix the mangling of quotes in some literal blocks.
* #292: Fix path to the search index for the ``dirhtml`` builder.
* Fix a Jython compatibility issue: make the dependence on the
``parser`` module optional.
* #238: In autodoc, catch all errors that occur on module import, * #238: In autodoc, catch all errors that occur on module import,
not just ``ImportError``. not just ``ImportError``.

View File

@ -46,10 +46,12 @@ included, please mail to `the Google group
* ObjectListView: http://objectlistview.sourceforge.net/python * ObjectListView: http://objectlistview.sourceforge.net/python
* Open ERP: http://doc.openerp.com/ * Open ERP: http://doc.openerp.com/
* OpenEXR: http://excamera.com/articles/26/doc/index.html * OpenEXR: http://excamera.com/articles/26/doc/index.html
* OpenGDA: http://www.opengda.org/gdadoc/html/
* OpenLayers: http://docs.openlayers.org/ * OpenLayers: http://docs.openlayers.org/
* openWNS: http://docs.openwns.org/ * openWNS: http://docs.openwns.org/
* Paste: http://pythonpaste.org/script/ * Paste: http://pythonpaste.org/script/
* Paver: http://www.blueskyonmars.com/projects/paver/ * Paver: http://www.blueskyonmars.com/projects/paver/
* Peach^3: http://peach3.nl/doc/latest/userdoc/
* Py on Windows: http://timgolden.me.uk/python-on-windows/ * Py on Windows: http://timgolden.me.uk/python-on-windows/
* Pyccuracy: http://www.pyccuracy.org/ * Pyccuracy: http://www.pyccuracy.org/
* PyCuda: http://documen.tician.de/pycuda/ * PyCuda: http://documen.tician.de/pycuda/
@ -62,6 +64,7 @@ included, please mail to `the Google group
* PyPubSub: http://pubsub.sourceforge.net/ * PyPubSub: http://pubsub.sourceforge.net/
* pyrticle: http://documen.tician.de/pyrticle/ * pyrticle: http://documen.tician.de/pyrticle/
* Pysparse: http://pysparse.sourceforge.net/ * Pysparse: http://pysparse.sourceforge.net/
* PyTango: http://www.tango-controls.org/static/PyTango/latest/doc/html/index.html
* Python: http://docs.python.org/ * Python: http://docs.python.org/
* python-apt: http://people.debian.org/~jak/python-apt-doc/ * python-apt: http://people.debian.org/~jak/python-apt-doc/
* PyUblas: http://documen.tician.de/pyublas/ * PyUblas: http://documen.tician.de/pyublas/

View File

@ -214,7 +214,7 @@ The following variables available in the templates:
List containing names of "public" methods in the class. Only available for List containing names of "public" methods in the class. Only available for
classes. classes.
.. data:: methods .. data:: attributes
List containing names of "public" attributes in the class. Only available List containing names of "public" attributes in the class. Only available
for classes. for classes.

View File

@ -74,8 +74,8 @@ render the block's content in the extended template -- unless you don't want
that content to show up. that content to show up.
Working the the builtin templates Working with the builtin templates
--------------------------------- ----------------------------------
The builtin **basic** theme supplies the templates that all builtin Sphinx The builtin **basic** theme supplies the templates that all builtin Sphinx
themes are based on. It has the following elements you can override or use: themes are based on. It has the following elements you can override or use:

View File

@ -16,7 +16,7 @@ from os import path
from docutils import nodes from docutils import nodes
from sphinx import package_dir, locale from sphinx import package_dir, locale
from sphinx.util import SEP, relative_uri from sphinx.util import SEP, EEXIST, relative_uri
from sphinx.environment import BuildEnvironment from sphinx.environment import BuildEnvironment
from sphinx.util.console import bold, purple, darkgreen, term_width_line from sphinx.util.console import bold, purple, darkgreen, term_width_line
@ -210,7 +210,7 @@ class Builder(object):
path.join(self.doctreedir, ENV_PICKLE_FILENAME)) path.join(self.doctreedir, ENV_PICKLE_FILENAME))
self.info('done') self.info('done')
except Exception, err: except Exception, err:
if type(err) is IOError and err.errno == 2: if type(err) is IOError and err.errno == EEXIST:
self.info('not found') self.info('not found')
else: else:
self.info('failed: %s' % err) self.info('failed: %s' % err)

View File

@ -22,7 +22,7 @@ except ImportError:
from docutils import nodes from docutils import nodes
from sphinx.errors import SphinxError from sphinx.errors import SphinxError
from sphinx.util import ensuredir from sphinx.util import ensuredir, ENOENT
from sphinx.util.compat import Directive from sphinx.util.compat import Directive
@ -111,7 +111,7 @@ def render_dot(self, code, options, format, prefix='graphviz'):
try: try:
p = Popen(dot_args, stdout=PIPE, stdin=PIPE, stderr=PIPE) p = Popen(dot_args, stdout=PIPE, stdin=PIPE, stderr=PIPE)
except OSError, err: except OSError, err:
if err.errno != 2: # No such file or directory if err.errno != ENOENT: # No such file or directory
raise raise
self.builder.warn('dot command %r cannot be run (needed for graphviz ' self.builder.warn('dot command %r cannot be run (needed for graphviz '
'output), check the graphviz_dot setting' % 'output), check the graphviz_dot setting' %

View File

@ -23,7 +23,7 @@ except ImportError:
from docutils import nodes from docutils import nodes
from sphinx.errors import SphinxError from sphinx.errors import SphinxError
from sphinx.util import ensuredir from sphinx.util import ensuredir, ENOENT
from sphinx.util.png import read_png_depth, write_png_depth from sphinx.util.png import read_png_depth, write_png_depth
from sphinx.ext.mathbase import setup_math as mathbase_setup, wrap_displaymath from sphinx.ext.mathbase import setup_math as mathbase_setup, wrap_displaymath
@ -119,7 +119,7 @@ def render_math(self, math):
try: try:
p = Popen(ltx_args, stdout=PIPE, stderr=PIPE) p = Popen(ltx_args, stdout=PIPE, stderr=PIPE)
except OSError, err: except OSError, err:
if err.errno != 2: # No such file or directory if err.errno != ENOENT: # No such file or directory
raise raise
self.builder.warn('LaTeX command %r cannot be run (needed for math ' self.builder.warn('LaTeX command %r cannot be run (needed for math '
'display), check the pngmath_latex setting' % 'display), check the pngmath_latex setting' %
@ -147,7 +147,7 @@ def render_math(self, math):
try: try:
p = Popen(dvipng_args, stdout=PIPE, stderr=PIPE) p = Popen(dvipng_args, stdout=PIPE, stderr=PIPE)
except OSError, err: except OSError, err:
if err.errno != 2: # No such file or directory if err.errno != ENOENT: # No such file or directory
raise raise
self.builder.warn('dvipng command %r cannot be run (needed for math ' self.builder.warn('dvipng command %r cannot be run (needed for math '
'display), check the pngmath_dvipng setting' % 'display), check the pngmath_dvipng setting' %

View File

@ -41,5 +41,5 @@
{% endblock %} {% endblock %}
{% block footer %} {% block footer %}
{{ super() }} {{ super() }}
<script type="text/javascript" src="searchindex.js"></script> <script type="text/javascript" src="{{ pathto('searchindex.js', 1) }}"></script>
{% endblock %} {% endblock %}

View File

@ -26,6 +26,9 @@ from os import path
import docutils import docutils
import sphinx import sphinx
# Errnos that we need.
EEXIST = getattr(errno, 'EEXIST', 0)
ENOENT = getattr(errno, 'ENOENT', 0)
# Generally useful regular expressions. # Generally useful regular expressions.
ws_re = re.compile(r'\s+') ws_re = re.compile(r'\s+')
@ -70,7 +73,7 @@ def ensuredir(path):
os.makedirs(path) os.makedirs(path)
except OSError, err: except OSError, err:
# 0 for Jython/Win32 # 0 for Jython/Win32
if err.errno not in [0, getattr(errno, 'EEXIST', 0)]: if err.errno not in [0, EEXIST]:
raise raise

View File

@ -501,6 +501,12 @@ class SmartyPantsHTMLTranslator(HTMLTranslator):
finally: finally:
self.no_smarty -= 1 self.no_smarty -= 1
def visit_literal_block(self, node):
self.no_smarty += 1
def depart_literal_block(self, node):
self.no_smarty -= 1
def visit_literal_emphasis(self, node): def visit_literal_emphasis(self, node):
self.no_smarty += 1 self.no_smarty += 1
self.visit_emphasis(node) self.visit_emphasis(node)

View File

@ -56,3 +56,12 @@ Test if dedenting before parsing works.
.. cssclass:: inc-pyobj-dedent .. cssclass:: inc-pyobj-dedent
.. literalinclude:: literal.inc .. literalinclude:: literal.inc
:pyobject: Bar.baz :pyobject: Bar.baz
Docutils include with "literal"
===============================
While not recommended, it should work (and leave quotes alone).
.. include:: quotes.inc
:literal:
:tab-width: 4

1
tests/root/quotes.inc Normal file
View File

@ -0,0 +1 @@
Testing "quotes" in literal 'included' text.

View File

@ -77,6 +77,8 @@ HTML_XPATH = {
".//pre": u'Max Strauß', ".//pre": u'Max Strauß',
".//a[@href='_downloads/img.png']": '', ".//a[@href='_downloads/img.png']": '',
".//a[@href='_downloads/img1.png']": '', ".//a[@href='_downloads/img1.png']": '',
".//pre": u'"quotes"',
".//pre": u"'included'",
}, },
'autodoc.html': { 'autodoc.html': {
".//dt[@id='test_autodoc.Class']": '', ".//dt[@id='test_autodoc.Class']": '',