[py-svn] r33449 - py/dist/py/test/tracer

guido at codespeak.net guido at codespeak.net
Thu Oct 19 12:47:02 CEST 2006


Author: guido
Date: Thu Oct 19 12:47:00 2006
New Revision: 33449

Modified:
   py/dist/py/test/tracer/genrest.py
Log:
Removing 'write_index' methods from writers, they were a hack to make the index
appear on top of the document which isn't required anymore (since the order
of the write_section calls is improved so that the index is written first).


Modified: py/dist/py/test/tracer/genrest.py
==============================================================================
--- py/dist/py/test/tracer/genrest.py	(original)
+++ py/dist/py/test/tracer/genrest.py	Thu Oct 19 12:47:00 2006
@@ -55,9 +55,6 @@
     def __init__(self, output=sys.stdout):
         self.output = output
     
-    def write_index(self, data):
-        self.write_section('index', data)
-
     def write_section(self, name, data):
         text = "Written file: %s.txt" % (name,)
         self.output.write(text + "\n")
@@ -79,9 +76,6 @@
         filename = '%s.txt' % (name,)
         self.directory.ensure(filename).write(data)
 
-    def write_index(self, data):
-        self.write_section('index', data)
-
     def rewrite_link(self, type, targetname, targetfilename):
         # we assume the result will get converted to HTML...
         return '%s.html' % (targetfilename,)
@@ -95,15 +89,6 @@
         self.fp.write(data)
         self.fp.flush()
 
-    def write_index(self, data):
-        self.fp.seek(0)
-        curdata = self.fp.read()
-        data += curdata
-        self.fp.seek(0)
-        self.fp.truncate(0)
-        self.fp.write(data)
-        self.fp.flush()
-
     _defined_targets = []
     def rewrite_link(self, type, targetname, targetbasename):
         if targetname in self._defined_targets:
@@ -131,7 +116,7 @@
         funclst = self.write_function_list(indexlst)
         indexlst.append(Title("Exported classes:", belowchar="-"))
         classlst = self.write_class_list(indexlst)
-        self.writer.write_index(Rest(*indexlst).text())
+        self.writer.write_section('index', Rest(*indexlst).text())
         for sectionname, restitems in funclst:
             self.writer.write_section(sectionname, Rest(*restitems).text())
         for sectionname, classdata in classlst:



More information about the pytest-commit mailing list