[Python-checkins] r67039 - in doctools/trunk: sphinx/htmlwriter.py tests/path.py tests/root/markup.txt tests/test_build.py

georg.brandl python-checkins at python.org
Tue Oct 28 17:53:06 CET 2008


Author: georg.brandl
Date: Tue Oct 28 17:53:05 2008
New Revision: 67039
Log:
Fix for r67038.
Modified:
 doctools/trunk/sphinx/htmlwriter.py
 doctools/trunk/tests/path.py
 doctools/trunk/tests/root/markup.txt
 doctools/trunk/tests/test_build.py
Modified: doctools/trunk/sphinx/htmlwriter.py
==============================================================================
--- doctools/trunk/sphinx/htmlwriter.py	(original)
+++ doctools/trunk/sphinx/htmlwriter.py	Tue Oct 28 17:53:05 2008
@@ -194,9 +194,11 @@
 if node.has_key('linenos'):
 linenos = node['linenos']
 highlighted = self.highlighter.highlight_block(node.rawsource, lang, linenos)
- starttag = self.starttag(node, 'div', suffix='')[:-1]
- self.body.append(starttag + highlighted[4:]) # skip '<div' and replace by
- # one possibly containing id attr
+ starttag = self.starttag(node, 'div', suffix='')
+ if starttag != '<div>':
+ self.body.append(starttag + highlighted + '</div>\n')
+ else:
+ self.body.append(highlighted)
 raise nodes.SkipNode
 
 def visit_doctest_block(self, node):
Modified: doctools/trunk/tests/path.py
==============================================================================
--- doctools/trunk/tests/path.py	(original)
+++ doctools/trunk/tests/path.py	Tue Oct 28 17:53:05 2008
@@ -29,7 +29,7 @@
 
 from __future__ import generators
 
-import sys, warnings, os, fnmatch, glob, shutil, codecs, md5
+import sys, warnings, os, fnmatch, glob, shutil, codecs
 
 __version__ = '2.2'
 __all__ = ['path']
@@ -760,23 +760,6 @@
 finally:
 f.close()
 
- def read_md5(self):
- """ Calculate the md5 hash for this file.
-
- This reads through the entire file.
- """
- f = self.open('rb')
- try:
- m = md5.new()
- while True:
- d = f.read(8192)
- if not d:
- break
- m.update(d)
- finally:
- f.close()
- return m.digest()
-
 # --- Methods for querying the filesystem.
 
 exists = os.path.exists
Modified: doctools/trunk/tests/root/markup.txt
==============================================================================
--- doctools/trunk/tests/root/markup.txt	(original)
+++ doctools/trunk/tests/root/markup.txt	Tue Oct 28 17:53:05 2008
@@ -11,6 +11,11 @@
 :author: Me
 :keywords: docs, sphinx
 
+.. _label:
+
+::
+
+ some code
 
 Admonitions
 -----------
Modified: doctools/trunk/tests/test_build.py
==============================================================================
--- doctools/trunk/tests/test_build.py	(original)
+++ doctools/trunk/tests/test_build.py	Tue Oct 28 17:53:05 2008
@@ -58,6 +58,7 @@
 ".//meta[@name='author'][@content='Me']": '',
 ".//meta[@name='keywords'][@content='docs, sphinx']": '',
 ".//a[@href='contents.html#ref1']": '',
+ ".//div[@id='label']": '',
 },
 'desc.html': {
 ".//dt[@id='mod.Cls.meth1']": '',


More information about the Python-checkins mailing list

AltStyle によって変換されたページ (->オリジナル) /