changeset 15038:3f4d337cb80a

minirst: drop debug code This standalone mode no longer works due to the mechanics of import and util. When run not as part of a package, the import of util causes an import of the built-in posix module, which doesn't contain the expected symbols. This is difficult to fix in Py2.4.
author Matt Mackall <mpm@selenic.com>
date Thu, 11 Aug 2011 22:40:41 -0500
parents df47381b41d6
children c981f4a9ea74
files mercurial/minirst.py
diffstat 1 files changed, 1 insertions(+), 25 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/minirst.py	Thu Aug 11 22:05:57 2011 -0500
+++ b/mercurial/minirst.py	Thu Aug 11 22:40:41 2011 -0500
@@ -18,7 +18,7 @@
 when adding support for new constructs.
 """
 
-import re, sys
+import re
 import util, encoding
 from i18n import _
 
@@ -553,27 +553,3 @@
         text = formatblocks(s[2], width)
         lines.append([(section, l) for l in text.splitlines(True)])
     return lines
-
-if __name__ == "__main__":
-    from pprint import pprint
-
-    def debug(func, *args):
-        blocks = func(*args)
-        print "*** after %s:" % func.__name__
-        pprint(blocks)
-        print
-        return blocks
-
-    text = sys.stdin.read()
-    blocks = debug(findblocks, text)
-    blocks = debug(findliteralblocks, blocks)
-    blocks, pruned = debug(prunecontainers, blocks, sys.argv[1:])
-    blocks = debug(inlineliterals, blocks)
-    blocks = debug(splitparagraphs, blocks)
-    blocks = debug(updatefieldlists, blocks)
-    blocks = debug(updateoptionlists, blocks)
-    blocks = debug(findsections, blocks)
-    blocks = debug(addmargins, blocks)
-    blocks = debug(prunecomments, blocks)
-    blocks = debug(findadmonitions, blocks)
-    print '\n'.join(formatblock(b, 30) for b in blocks)