#!/usr/bin/env python """ Usage: make_index.py [ > ] This script parses html reference file, creates alphabetical list of functions and list of examples ] """ import sys, re, string f = open(sys.argv[1]) func_list = {} struct_list = [] func_decl_re = re.compile( r'" columns = 3 for letter in func_letters: print '

%s

\n' % letter sublist = func_list[letter] sublist.sort() col_len = (len(sublist)+columns-1)/columns #if col_len*columns > len(sublist): # sublist.append( "" * (col_len*columns - len(sublist)) ) for i in range(col_len): print '' for j in range(columns): if i + j*col_len < len(sublist): fn = sublist[i+j*col_len] fn_short = fn.lstrip(string.lowercase) print '' % (fn, fn_short) else: print '' print '' print "
%s
"