- 论坛徽章:
- 0
|
f=file('/tmp/'+pro)
while True:
line = f.readline()
if len(line)==0:
break;
a=[]
readtoarray(a, line)
key=a[0]
del a[0]
if key in dict:
dict[key].append(a)
else:
dict[key]=[a]
f.close()
#datelist=[]
for d in dict:
datelist.append(d)
datelist.sort()
#os.system('echo "passw0rd"|gsa_login -p liuycdl')
print "<html>"
print '''<script>
function dosubmit( dateobj ) {
dateobj.form.submit();
}
</script>'''
#for product, combo_name in DICTFILES.items():
def showframe():
dict={}
datelist=[]
product = 'SVC4.3'
if form.has_key("product"):
product = form["product"].value
if form.has_key("type"):
type = form["type"].value
#pfile='/gsa/bvrgsa/home/m/a/mayao/testindex/' + product + '.intrinsic.index'
pfile=INDEX_PATH + product + '.index'
loadfile(dict, datelist, pfile, product)
#print datelist[0]
l=len(datelist)
selected=datelist[l-1]
if form.has_key("rundate"):
selected=form["rundate"].value
print '''
<hr noshade>
<h1>''' + product + ' ' + selected + '''</h1>
<form method=post action="/cgi-bin/nightly_frame.cgi">
<table width="100%">
<tr>
<th colspan="3" align="center">
<h3>
<u>''' + type + '''</u>
<u>''' + type + '''</u>
</h3>
</th>
<th colspan="3" align="center">
<input type=hidden name=product value="''' + product + '''">
<select name="rundate" onChange="dosubmit(this);">
'''
for i in range (1, l+1):
if datelist[l-i]==selected:
print '<option value="' + datelist[l-i] + '" selected>',datelist[l-i],'</option>'
else:
print '<option value="' + datelist[l-i] + '">',datelist[l-i],'</option>'
print '''
</select>
</th>
</tr>
</table>
</form>
<table width="100%">
</table>
<table width="90%" border=2>
<tr>
<th width="10%" align="center">Test Date</th>
<th width="18%" align="center">System Notes</th>
<th width="15%" align="center">System IP</th>
<th width="10%" align="center">System Notes</th>
<th width="13%" align="center">CLI Command</th>
<th width="10%" align="center">Test Results</th>
<th width="20%" align="center">Detail Report</th>
</tr>
'''
for item in dict[selected]:
print '''
<tr>
<th width="18%" align="center">''' + item[0] + '''</th>
<th width="15%" align="center">''' + item[1] + '''</th>
<th width="10%" align="center">''' + item[2] + '''</th>
<th width="13%" align="center">''' + item[3] + '''</th>
<th width="10%" align="center">''' + item[4] + '''</th>
<th width="10%" align="center">''' + item[5] + '''</th>
<th width="20%" align="center"><a href=https://bvrgsa.ibm.com/projects/i''' + item[6] + ''' target="_new">Click here</a></th>
</tr>'''
print '''</table>
'''
showframe()
print "</html>" |
|