Ejemplo n.º 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
Ejemplo n.º 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
Ejemplo n.º 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
Ejemplo n.º 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