blob: f64e83773a15536afe3454d558e306a8e119dee3 (
plain)
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
|
#!/usr/bin/python
import cgi, os, sys
page = """\
Location: %s\r\n\r
"""
# Get access to directories
tko = os.path.dirname(os.path.realpath(os.path.abspath(sys.argv[0])))
sys.path.insert(0, tko)
autodir = os.path.abspath(os.path.join(tko, '..'))
# Define function for retrieving logs
try:
import site_retrieve_logs
retrieve_logs = site_retrieve_logs.retrieve_logs
del site_retrieve_logs
except ImportError:
def retrieve_logs(autodir, job_path):
pass
# Get form fields
form = cgi.FieldStorage(keep_blank_values=True)
# Retrieve logs
job_path = form['job'].value[1:]
keyval = retrieve_logs(autodir, job_path)
# Redirect to results page
testname = ''
if 'test' in form:
testname = form['test'].value
path = "%s%s" % (form['job'].value, testname)
print page % path
|