[Python-checkins] r75854 - python/branches/release26-maint/Doc/tools/sphinxext/pyspecific.py
georg.brandl
python-checkins at python.org
Tue Oct 27 21:13:07 CET 2009
Author: georg.brandl
Date: Tue Oct 27 21:13:06 2009
New Revision: 75854
Log:
Create the function before using it.
Modified:
python/branches/release26-maint/Doc/tools/sphinxext/pyspecific.py
Modified: python/branches/release26-maint/Doc/tools/sphinxext/pyspecific.py
==============================================================================
--- python/branches/release26-maint/Doc/tools/sphinxext/pyspecific.py (original)
+++ python/branches/release26-maint/Doc/tools/sphinxext/pyspecific.py Tue Oct 27 21:13:06 2009
@@ -21,10 +21,6 @@
Body.enum.converters['upperroman'] = lambda x: None
# monkey-patch HTML translator to give versionmodified paragraphs a class
-from sphinx.writers.html import HTMLTranslator
-from sphinx.locale import versionlabels
-HTMLTranslator.visit_versionmodified = new_visit_versionmodified
-
def new_visit_versionmodified(self, node):
self.body.append(self.starttag(node, 'p', CLASS=node['type']))
text = versionlabels[node['type']] % node['version']
@@ -34,6 +30,9 @@
text += '.'
self.body.append('<span class="versionmodified">%s</span>' % text)
+from sphinx.writers.html import HTMLTranslator
+from sphinx.locale import versionlabels
+HTMLTranslator.visit_versionmodified = new_visit_versionmodified
# Support for marking up and linking to bugs.python.org issues
More information about the Python-checkins
mailing list