示例#1
0
def main():
	# Setup the renderer to make the html list
	renderer = pystache.Renderer()
	
	footer = time.asctime(time.localtime())
	title = 'Index'
	sources = [{'rack' : a[0]} for a in cdblib.getAllAndSort('CableDatabase', 'sourceID')]
	
	
	data = renderer.render_path('index.mustache', {'footer' : footer,
	                                               'title'  : title,
	                                               'sourceList' : sources})
	
	print "Content-type: text/html\n\n";
	print data
示例#2
0
def main():
	
	# Setup the renderer to make the html list
	
	searchRows = list()
	for col,name in zip(cdblib.dbColumns, cdblib.columnNames):
		searchRow = dict()
		searchRow['sourceOptions'] = makeDict(cdblib.getAllAndSort('CableDatabase',col))
		searchRow['name'] = col
		searchRow['title'] = name
		searchRows.append(searchRow)
	
	renderer = pystache.Renderer()
	data = renderer.render_path('searchForm.mustache', {'searchRows' : searchRows,
		                                                'title' : 'Search Cable Database'})
	print data
示例#3
0
def main():
    # Setup the renderer to make the html list
    renderer = pystache.Renderer()

    footer = time.asctime(time.localtime())
    title = 'Index'
    sources = [{
        'rack': a[0]
    } for a in cdblib.getAllAndSort('CableDatabase', 'sourceID')]

    data = renderer.render_path('index.mustache', {
        'footer': footer,
        'title': title,
        'sourceList': sources
    })

    print "Content-type: text/html\n\n"
    print data
示例#4
0
def main():

    # Setup the renderer to make the html list

    searchRows = list()
    for col, name in zip(cdblib.dbColumns, cdblib.columnNames):
        searchRow = dict()
        searchRow['sourceOptions'] = makeDict(
            cdblib.getAllAndSort('CableDatabase', col))
        searchRow['name'] = col
        searchRow['title'] = name
        searchRows.append(searchRow)

    renderer = pystache.Renderer()
    data = renderer.render_path('searchForm.mustache', {
        'searchRows': searchRows,
        'title': 'Search Cable Database'
    })
    print data