def printPullSheet(keys): color = {None : '#F62217', 0 : '#F62217', 1: '#000000'} rows = cdblib.doCableSearch(keys) rdict = [dict(label = row[0] - 100000, type = '{0} ({1})'.format(row[7],row[16]), use = row[8], source = row[9], path = row[12], destination = row[10], color = color[row[13]]) for row in rows] # Setup the renderer to make the html list renderer = pystache.Renderer() data = renderer.render_path('pullsheet.mustache', {'title' : 'Cable Pullsheet', 'footer' : time.asctime(time.localtime()), 'sourceList' : rdict}) print data
def printTableData(keys): rows = cdblib.doCableSearch(keys) rdict = [dict(label = cdblib.makeCableLabel(row,'{A/B}'), type = row[7], longType = row[16], use = row[8], source = row[9], destination = row[10], path = row[12], wiring = row[11], installed = row[13]) for row in rows] # Setup the renderer to make the html list renderer = pystache.Renderer() data = renderer.render_path('tableData.mustache', {'footer' : time.asctime(time.localtime()), 'title' : 'Cable Data', 'sourceList' : rdict, 'idlist' : ",".join(["{0}".format(row[0]) for row in rows])}) print data