1 from __future__ import with_statement
\r
4 if len(sys.argv) < 1:
\r
5 print "Usage: " + sys.argv[0] + " [hhc index file] [output file]"
\r
9 if len(sys.argv) == 3:
\r
10 outfile = sys.argv[2]
\r
12 data_structures = []
\r
14 section_start = re.compile(r"<LI>.*? value=\"((File List)|(Data Structures)|(Main Page)|(Directory Hierarchy))\".*$")
\r
16 data_section = False
\r
17 file_section = False
\r
19 with open(sys.argv[1], "r") as f:
\r
20 with open(outfile, "w+") as out:
\r
22 if re.search(section_start, line):
\r
23 if line.find("Data Structures") != -1:
\r
25 file_section = False
\r
26 elif line.find("File List") != -1:
\r
27 data_section = False
\r
30 data_section = False
\r
31 file_section = False
\r
34 data_structures.append(line)
\r
37 elif re.search(r"^<\/UL>$", line):
\r
38 for i in data_structures:
\r