Mercurial > p > roundup > code
view tools/build_html @ 718:e10c37f53efd
fixed SCRIPT_NAME in ZRoundup for instances not at top level of Zope
(thanks dman)
fixed some sorting issues that were breaking some unit tests under py2.2
mailgw test output dir was confusing the init test (but only on 2.2 *shrug*)
fixed bug in the init unit test that meant only the bsddb test ran if it
could (it clobbered the anydbm test)
| author | Richard Jones <richard@users.sourceforge.net> |
|---|---|
| date | Wed, 15 May 2002 03:27:16 +0000 |
| parents | 71bf8f97fe30 |
| children |
line wrap: on
line source
#! /usr/bin/python import sys import os.path import glob import html import dps.utils try: from restructuredtext import Parser except ImportError: from dps.parsers.restructuredtext import Parser if sys.argv[1:] == '--help': print """ Usage: build_html Converts all structured text (.stx) files to html files. """ sys.exit(1) def to_html(filename): parser = Parser() input = open(filename).read() document = dps.utils.newdocument() parser.parse(input, document) formatter = html.DumbHTMLFormatter() return formatter.format_document(document) for filename in glob.glob('*.stx'): htmlfile = "%s.html" % os.path.splitext(filename)[0] print "%s -> %s" % (filename, htmlfile) f=open(htmlfile, 'wb') f.write(to_html(filename)) f.close()
