def createPage(display, filename, title): page = {} page['title'] = title; page['blocks'] = [] display[filename] = page return page def appendBlockToPage(page, block): page['blocks'].append(block) def createTable(title, cols): table = {'type' : 'table', 'title' : title} table['cols'] = cols table['rows'] = [] def appendRowToTable(table, row): table['rows'].append(row) def buildPages(display): for filename in display.keys(): page = display[filename] with open(DISPLAY_ROOT + filename, 'w') as f: f.write('
%s | ' % (title)) f.write('
---|
%s | ' % (v)) f.write('