ATLAS Offline Software
LumiCalcRecover.py
Go to the documentation of this file.
1 #!/usr/bin/env python
2 
3 # Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
4 
5 from __future__ import print_function
6 
7 import os
8 import glob
9 import cgitb
10 
11 # Enable debugging output for CGI
12 cgitb.enable()
13 
14 # Use imp to import directly from path in cgi-bin?
15 import imp
16 
17 if os.environ.get('SERVER_NAME', '') == 'atlas-lumicalc-dev.cern.ch':
18  lcmod = imp.load_source('LumiCalc', '/var/www/lumicalc_dev/athena/LumiBlock/LumiCalc/python/LumiCalcHtml.py')
19 else:
20  lcmod = imp.load_source('LumiCalc', '/var/www/lumicalc/athena/LumiBlock/LumiCalc/python/LumiCalcHtml.py')
21 
22 lc = lcmod.LumiCalc()
23 
24 lc.workdir = os.getcwd()
25 lc.subdir = os.path.basename(os.path.normpath(lc.workdir))
26 try:
27  lc.grlfn = os.path.basename(glob.glob(lc.workdir+'/*.xml')[0])
28 except Exception:
29  lc.grlfn = ''
30 
31 lc.f = open(lc.workdir+'/working.html', 'a')
32 lc.parseOutput()
33 lc.printTable()
34 lc.printWarnings()
35 lc.printLinks()
36 lc.printFinish()
37 lc.cleanUp()
38 
39 # Redirect
40 print ('Content-Type: text/html')
41 print ()# Blank line, end of headers
42 print ('<html><head>')
43 print ('<meta http-equiv="Refresh" content="0; url=result.html">')
44 print ('</head></html>')
Trk::open
@ open
Definition: BinningType.h:40