def main(): base.begin() # Print the preamble and opening html tag. base.header(title="Acceptance Test Database") # Print the header. base.top() # Print the top portion of the body (title, buttons). This remains the same for every page. print get() base.bottom() # Print footer (if applicable) and closing body and html tags.
import mysql.connector from summary_functions import get import module_functions import sys if len(sys.argv) != 1: sys.stdout = open('%(loc)s/summary.html' %{'loc':sys.argv[1]}, 'w') else: #cgi header print "Content-type: text/html\n" base.header(title='Summary') base.top() List_of_rows = get() print '<div class="row">' print '<div class="col-md-12">' print '<table class="table" style="width:100%">' print '<tbody>' print '<tr>' print '<th> S/N </th>' print '<th colspan=2> Tests Passed </th>' print '<th colspan=2> Tests Remaining </th>' #print '<th> Final Status </th>' print '</tr>' for row in List_of_rows: print '<tr>' if len(sys.argv) == 1:
import cgi import base from connect import connect import mysql.connector from summary_functions import get import module_functions #cgi header print "Content-type: text/html\n" base.header(title='Summary') base.top() List_of_rows = get() print '<div class="row">' print '<div class="col-md-12">' print '<table class="table" style="width:100%">' print '<tbody>' print '<tr>' print '<th> S/N </th>' print '<th colspan=2> Tests Passed </th>' print '<th colspan=2> Tests Remaining </th>' #print '<th> Final Status </th>' print '</tr>' for row in List_of_rows: print '<tr>' print '<td> <a href=module.py?card_id=%(id)s&serial_num=%(serial)s> %(serial)s </a></td>' %{'serial':row[0], 'id':row[1]}