#!/usr/bin/python import MySQLdb import sys import cgi import cgitb cgitb.enable() import os dbhost = "hallddb.jlab.org" dbuser = 'datmon' dbpass = '' dbname = 'data_monitoring' conn=MySQLdb.connect(host=dbhost, user=dbuser, db=dbname) curs=conn.cursor() #runPeriodList = [ 'RunPeriod-2014-10', 'RunPeriod-2015-01', 'RunPeriod-2015-03', # 'RunPeriod-2015-06', 'RunPeriod-2015-12', 'RunPeriod-2016-02', # 'RunPeriod-2016-10', 'RunPeriod-2017-01' ] runPeriodList = [ ] def loadRunPeriodList(): # hacK! global runPeriodList cmd = "select distinct run_period from version_info" curs.execute(cmd) runPeriodList = [ el[0] for el in curs.fetchall() ] # print the HTTP header def printHTTPheader(): print "Content-type: text/html\n\n" # print the HTML head section def printHTMLHead(title): print "
" print "