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)
==============================
* #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,
not just ``ImportError``.

View File

@ -46,10 +46,12 @@ included, please mail to `the Google group
* ObjectListView: http://objectlistview.sourceforge.net/python
* Open ERP: http://doc.openerp.com/
* OpenEXR: http://excamera.com/articles/26/doc/index.html
* OpenGDA: http://www.opengda.org/gdadoc/html/
* OpenLayers: http://docs.openlayers.org/
* openWNS: http://docs.openwns.org/
* Paste: http://pythonpaste.org/script/
* Paver: http://www.blueskyonmars.com/projects/paver/
* Peach^3: http://peach3.nl/doc/latest/userdoc/
* Py on Windows: http://timgolden.me.uk/python-on-windows/
* Pyccuracy: http://www.pyccuracy.org/
* PyCuda: http://documen.tician.de/pycuda/
@ -62,6 +64,7 @@ included, please mail to `the Google group
* PyPubSub: http://pubsub.sourceforge.net/
* pyrticle: http://documen.tician.de/pyrticle/
* Pysparse: http://pysparse.sourceforge.net/
* PyTango: http://www.tango-controls.org/static/PyTango/latest/doc/html/index.html
* Python: http://docs.python.org/
* python-apt: http://people.debian.org/~jak/python-apt-doc/
* 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
classes.
.. data:: methods
.. data:: attributes
List containing names of "public" attributes in the class. Only available
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.
Working the the builtin templates
---------------------------------
Working with the builtin templates
----------------------------------
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:

View File

@ -16,7 +16,7 @@ from os import path
from docutils import nodes
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.util.console import bold, purple, darkgreen, term_width_line
@ -210,7 +210,7 @@ class Builder(object):
path.join(self.doctreedir, ENV_PICKLE_FILENAME))
self.info('done')
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')
else:
self.info('failed: %s' % err)

View File

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

View File

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

View File

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

View File

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

View File

@ -501,6 +501,12 @@ class SmartyPantsHTMLTranslator(HTMLTranslator):
finally:
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):
self.no_smarty += 1
self.visit_emphasis(node)

View File

@ -56,3 +56,12 @@ Test if dedenting before parsing works.
.. cssclass:: inc-pyobj-dedent
.. literalinclude:: literal.inc
: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ß',
".//a[@href='_downloads/img.png']": '',
".//a[@href='_downloads/img1.png']": '',
".//pre": u'"quotes"',
".//pre": u"'included'",
},
'autodoc.html': {
".//dt[@id='test_autodoc.Class']": '',