ATLAS Offline Software
Loading...
Searching...
No Matches
WebPlots.py
Go to the documentation of this file.
1# Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
2
3"""
4ATLAS beam spot server for pre-made web plots (e.g. weekly beam spot history).
5"""
6
7__author__ = 'Juerg Beringer'
8__version__ = 'WebPlots.py atlas/athena'
9
10from BeamSpotWebPage import BeamSpotWebPage
11
12import sys, os, time
13
14errorPage = """\
15<div class="errormsg">
16We're sorry - this plot (%s) is currently not available.
17</div>
18"""
19
20page = """
21<div class="boldtext">
22Last updated: %s
23</div>
24<img id="webplot" src="/webplots/%s">
25"""
26
28
29 def __init__(self):
30 BeamSpotWebPage.__init__(self)
31 self.pageConfig['pageTitle'] = 'ATLAS Beam Spot Overview'
32
33 def content(self,**args):
34 plotName = args.get('plot','summary-weekly.gif')
35 webPlotDir = self.globalConfig['webPlotDir']
36 filePath = os.path.join(webPlotDir,plotName)
37 if not os.path.exists(filePath):
38 return errorPage % plotName
39 lastUpdate = time.ctime(os.path.getctime(filePath))
40 return page % (lastUpdate,plotName)
content(self, **args)
Definition WebPlots.py:33