This repository has been archived by the owner on Jul 9, 2020. It is now read-only.
forked from CiaranGodfrey/RunInfoDiffer
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathviewDiffer.py
executable file
·77 lines (55 loc) · 1.96 KB
/
viewDiffer.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
#!/usr/bin/python
import cgi
import cgitb; cgitb.enable()
import Run_Info_Diff
def getHeader():
header = """
<html>
<head>
<title>Runinfo Diff</title>
</head>
<body>
"""
return header
def getFooter():
footer = """
<!-- begin footer -->
</body>
</html>
"""
return footer
def is_an_int(data):
try:
int(data)
return True
except ValueError:
return False
def color_print(text):
if text == "":
pass
elif text[0] == "+":
print "<span style=\"color:green;\">"+text+"</span>"+"<br>"
elif text[0] == "-":
print "<span style=\"color:red;\">"+text+"</span>"+"<br>"
else:
print text+"<br>"
def print_form(runnumber1, runnumber2, partitions, link, label):
print "<form action="+link+" method='get' type='submit'>"
print "<div><input type='hidden' name='runnumber1' value="+str(runnumber1)+"></div>"
print "<div><input type='hidden' name='runnumber2' value="+str(runnumber2)+"></div>"
if 'HCAL_HO' in partitions:
print "<div><input type='hidden' name='partition' value='HCAL_HO'></div>"
if 'HCAL_HF' in partitions:
print "<div><input type='hidden' name='partition' value='HCAL_HF'></div>"
if 'HCAL_HBHE' in partitions:
print "<div><input type='hidden' name='partition' value='HCAL_HBHE'></div>"
if 'HCAL_HBHEa' in partitions:
print "<div><input type='hidden' name='partition' value='HCAL_HBHEa'></div>"
if 'HCAL_HBHEb' in partitions:
print "<div><input type='hidden' name='partition' value='HCAL_HBHEb'></div>"
if 'HCAL_HBHEc' in partitions:
print "<div><input type='hidden' name='partition' value='HCAL_HBHEc'></div>"
if 'HCAL_Laser' in partitions:
print "<div><input type='hidden' name='partition' value='HCAL_Laser'></div>"
print "<input type='submit' value='"+label+"' />"
print "</form>"