[pypy-svn] rev 1486 - pypy/trunk/doc/funding/tools

stephan at codespeak.net stephan at codespeak.net
Tue Sep 30 20:32:15 CEST 2003


Author: stephan
Date: Tue Sep 30 20:32:15 2003
New Revision: 1486

Modified:
   pypy/trunk/doc/funding/tools/format.py
Log:
bugfixed format

Modified: pypy/trunk/doc/funding/tools/format.py
==============================================================================
--- pypy/trunk/doc/funding/tools/format.py	(original)
+++ pypy/trunk/doc/funding/tools/format.py	Tue Sep 30 20:32:15 2003
@@ -211,6 +211,9 @@
 
     def any(self,txt):
         if txt.find('DELETE:BEGIN') != -1:
+            if not self.write:
+                print >> sys.stderr,self.outbuf[-20:]
+                raise Exception('No closing DELETE:END found')
             self.initStartCut()
         elif txt.find('DELETE:END') != -1:
             self.initStopCut()
@@ -222,19 +225,24 @@
         self.write = False
         self.level = 0
         while 1:
+            if self.level > 2:
+                print >> sys.stderr,'LEN',len(self.outbuf)
+                print >> sys.stderr, self.outbuf[-10:]
+                raise Exception
             last = self.outbuf.pop()
             last = last.strip()
+            print >> sys.stderr,'startCut',last,self.level
             if last.startswith('</'):
                 self.level += 1
                 continue
             elif last.endswith('/>'):
                 continue
             tag = self.extractTagName(last)
-            print >> sys.stderr,'startCut',last,self.level,tag
             if tag and not self.level:
                 break
             elif tag:
                 self.level -= 1
+        print >> sys.stderr,'DONE'
 
     def initStopCut(self):
         self.write = True


More information about the Pypy-commit mailing list