15 import sys, os, time, string, getopt
23 content_processor.reset()
25 markups = content_processor.process_content( block.content )
29 for markup
in markups:
30 text.extend( markup.beautify( first ) )
34 lines = [
" /*************************************************************************"]
36 lines.append(
" *" + l )
43 print "\nDocBeauty 0.1 Usage information\n"
44 print " docbeauty [options] file1 [file2 ...]\n"
45 print "using the following options:\n"
46 print " -h : print this page"
47 print " -b : backup original files with the 'orig' extension"
49 print " --backup : same as -b"
53 """main program loop"""
58 opts, args = getopt.getopt( sys.argv[1:], \
61 except getopt.GetoptError:
75 if opt[0]
in (
"-h",
"--help" ):
79 if opt[0]
in (
"-b",
"--backup" ):
87 for filename
in file_list:
88 source_processor.parse_file( filename )
90 for block
in source_processor.blocks:
93 new_name = filename +
".new"
97 file = open( new_name,
"wt" )
98 for block
in source_processor.blocks:
99 for line
in block.lines:
109 if __name__ ==
'__main__':