From 571ebbf42b8917977898442aaa0985c8c17b4249 Mon Sep 17 00:00:00 2001 From: Georg Brandl Date: Tue, 10 Nov 2009 22:43:59 +0000 Subject: [PATCH 1/7] Add news entry on Jython compatibility. --- CHANGES | 3 +++ 1 file changed, 3 insertions(+) diff --git a/CHANGES b/CHANGES index 7e07e7896..b69898224 100644 --- a/CHANGES +++ b/CHANGES @@ -1,6 +1,9 @@ Release 0.6.4 (in development) ============================== +* 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``. From 98437cfd2888c53a1e89c649a35729c4c52ca98a Mon Sep 17 00:00:00 2001 From: Georg Brandl Date: Tue, 1 Dec 2009 21:04:46 +0100 Subject: [PATCH 2/7] Fix typo. --- doc/templating.rst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/doc/templating.rst b/doc/templating.rst index 61657547d..0148ed32c 100644 --- a/doc/templating.rst +++ b/doc/templating.rst @@ -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: From a3f11db6b75271e75d6e72ce0af217d8812c66fb Mon Sep 17 00:00:00 2001 From: Georg Brandl Date: Tue, 15 Dec 2009 19:05:39 +0100 Subject: [PATCH 3/7] Add some examples. --- EXAMPLES | 3 +++ 1 file changed, 3 insertions(+) diff --git a/EXAMPLES b/EXAMPLES index 6f6375773..1bb38cbce 100644 --- a/EXAMPLES +++ b/EXAMPLES @@ -44,10 +44,12 @@ included, please mail to `the Google group * NumPy: http://docs.scipy.org/doc/numpy/reference/ * ObjectListView: http://objectlistview.sourceforge.net/python * OpenEXR: http://excamera.com/articles/26/doc/index.html +* OpenGDA: http://www.opengda.org/gdadoc/html/ * OpenLayers: http://docs.openlayers.org/ * openWNS: http://docs.openwns.org/ * Paste: http://pythonpaste.org/script/ * Paver: http://www.blueskyonmars.com/projects/paver/ +* Peach^3: http://peach3.nl/doc/latest/userdoc/ * Py on Windows: http://timgolden.me.uk/python-on-windows/ * PyCuda: http://documen.tician.de/pycuda/ * PyEphem: http://rhodesmill.org/pyephem/ @@ -59,6 +61,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/ From 0dc0837e010d74fa03c1760be9721deb6ddf73d8 Mon Sep 17 00:00:00 2001 From: Georg Brandl Date: Thu, 24 Dec 2009 12:58:53 +0100 Subject: [PATCH 4/7] #301: use errno values from errno module. --- sphinx/builders/__init__.py | 4 ++-- sphinx/ext/graphviz.py | 4 ++-- sphinx/ext/pngmath.py | 6 +++--- sphinx/util/__init__.py | 5 ++++- 4 files changed, 11 insertions(+), 8 deletions(-) diff --git a/sphinx/builders/__init__.py b/sphinx/builders/__init__.py index 3fb0d469f..ebabe0e0e 100644 --- a/sphinx/builders/__init__.py +++ b/sphinx/builders/__init__.py @@ -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) diff --git a/sphinx/ext/graphviz.py b/sphinx/ext/graphviz.py index 449d9524a..e804cb1e2 100644 --- a/sphinx/ext/graphviz.py +++ b/sphinx/ext/graphviz.py @@ -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' % diff --git a/sphinx/ext/pngmath.py b/sphinx/ext/pngmath.py index 02f46e3d3..a3df27e43 100644 --- a/sphinx/ext/pngmath.py +++ b/sphinx/ext/pngmath.py @@ -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' % diff --git a/sphinx/util/__init__.py b/sphinx/util/__init__.py index ae778fde3..41ad34af8 100644 --- a/sphinx/util/__init__.py +++ b/sphinx/util/__init__.py @@ -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+') @@ -69,7 +72,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 From 64c534b03b6d8dce875f614e6c5e793b9eca524f Mon Sep 17 00:00:00 2001 From: Georg Brandl Date: Thu, 24 Dec 2009 13:06:34 +0100 Subject: [PATCH 5/7] #292: Fix path to the search index for the ``dirhtml`` builder. --- CHANGES | 2 ++ sphinx/themes/basic/search.html | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/CHANGES b/CHANGES index b69898224..431120a10 100644 --- a/CHANGES +++ b/CHANGES @@ -1,6 +1,8 @@ Release 0.6.4 (in development) ============================== +* #292: Fix path to the search index for the ``dirhtml`` builder. + * Fix a Jython compatibility issue: make the dependence on the ``parser`` module optional. diff --git a/sphinx/themes/basic/search.html b/sphinx/themes/basic/search.html index 224d87b86..96c406527 100644 --- a/sphinx/themes/basic/search.html +++ b/sphinx/themes/basic/search.html @@ -41,5 +41,5 @@ {% endblock %} {% block footer %} {{ super() }} - + {% endblock %} From 88e54f951bb7c11eb1acebe7e0d242a56a0fb437 Mon Sep 17 00:00:00 2001 From: Georg Brandl Date: Thu, 24 Dec 2009 13:19:07 +0100 Subject: [PATCH 6/7] #299: Fix the mangling of quotes in "include:: :literal:" blocks. --- CHANGES | 2 ++ sphinx/writers/html.py | 6 ++++++ tests/root/includes.txt | 9 +++++++++ tests/root/quotes.inc | 1 + tests/test_build.py | 2 ++ 5 files changed, 20 insertions(+) create mode 100644 tests/root/quotes.inc diff --git a/CHANGES b/CHANGES index 431120a10..d901ed72b 100644 --- a/CHANGES +++ b/CHANGES @@ -1,6 +1,8 @@ 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 diff --git a/sphinx/writers/html.py b/sphinx/writers/html.py index c15e5ce5b..eab7ce464 100644 --- a/sphinx/writers/html.py +++ b/sphinx/writers/html.py @@ -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) diff --git a/tests/root/includes.txt b/tests/root/includes.txt index 0976bf4a8..693c57057 100644 --- a/tests/root/includes.txt +++ b/tests/root/includes.txt @@ -51,3 +51,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 diff --git a/tests/root/quotes.inc b/tests/root/quotes.inc new file mode 100644 index 000000000..276cc56ba --- /dev/null +++ b/tests/root/quotes.inc @@ -0,0 +1 @@ +Testing "quotes" in literal 'included' text. diff --git a/tests/test_build.py b/tests/test_build.py index 4c25c1468..ea7c3e43d 100644 --- a/tests/test_build.py +++ b/tests/test_build.py @@ -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']": '', From 023b41b391a931b731253c03390041d15f8e9967 Mon Sep 17 00:00:00 2001 From: Georg Brandl Date: Thu, 24 Dec 2009 13:29:11 +0100 Subject: [PATCH 7/7] #296: fix copy-paste oversight. --- doc/ext/autosummary.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/ext/autosummary.rst b/doc/ext/autosummary.rst index 1c4ae3da9..9d75cb0cb 100644 --- a/doc/ext/autosummary.rst +++ b/doc/ext/autosummary.rst @@ -211,7 +211,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.