3 Usage: make_index.py <html_ref_file> [ > <output_func_index_file> ]
4 This script parses html reference file, creates alphabetical list of
5 functions and list of examples ]
13 func_decl_re = re.compile( r'<a name="decl_(.+?)"' )
16 for l in f.xreadlines():
17 llist = func_decl_re.findall(l)
20 if ll.startswith('Cv'):
21 struct_list.append(ll)
22 elif ll.startswith('Ipl'):
23 struct_list.append(ll)
24 elif ll.startswith('cvm'):
25 sublist = func_list.get(ll[3], [])
27 func_list[ll[3]] = sublist
28 elif ll.startswith('cv'):
29 sublist = func_list.get(ll[2], [])
31 func_list[ll[2]] = sublist
36 func_letters = func_list.keys()
43 for letter in func_letters:
44 print '<hr><h3>%s</h3>\n<table width="100%%">' % letter
45 sublist = func_list[letter]
47 col_len = (len(sublist)+columns-1)/columns
48 #if col_len*columns > len(sublist):
49 # sublist.append( "" * (col_len*columns - len(sublist)) )
50 for i in range(col_len):
52 for j in range(columns):
53 if i + j*col_len < len(sublist):
54 fn = sublist[i+j*col_len]
55 fn_short = fn.lstrip(string.lowercase)
56 print '<td width="25%%"><a href="#decl_%s">%s</a></td>' % (fn, fn_short)
58 print '<td width="25%%"></td>'