#---------------------------------------------------------------------- # poohelp2html.py JJS 4/13/97 # # This module converts POO help files into HTML. It is a stand- # alone utility, not used or needed by the POO engine. # #---------------------------------------------------------------------- import poohelp import os from time import * import string gTopic = '' def header(title): out = "
[Top]
'
out = out + "
| ' + word(w) + ' | ' out = out + '
' elif l[:7] == "Syntax:": out = out + 'Syntax: ' + \ l[8:] + '
' else: out = out + string.join( map(lambda w:word(w), string.split(l) )) out = out + '\n' return out #--------------------------------------------------------------- # load database print "Loading database..." poohelp.hLoad() print "Creating html files..." # change directory #os.mkdir('poohelp') os.chdir('poohelp') # create the main file print "index.html..." f = open('index.html', 'w') f.write(header('POO Help')) f.write(body( poohelp.help()) ) f.write(footer(1)) # create particular topic files for gTopic in poohelp.helpDB.keys(): filename = gTopic + ".html" print filename+"..." f = open(filename, 'w') f.write(header(gTopic)) f.write(body( poohelp.help(gTopic) )) f.write(footer()) print "All done!"