ATLAS Offline Software
Public Member Functions | Private Member Functions | List of all members
python.html.AtlRunQueryPageMaker.PageMaker Class Reference
Collaboration diagram for python.html.AtlRunQueryPageMaker.PageMaker:

Public Member Functions

def makePage (cls, body, origQuery=None, extraReplace=None, removeExamples=False)
 
def getBlankPage (cls, removeExamples=False)
 

Private Member Functions

def _copySomeFilesToCache (cls)
 

Detailed Description

Definition at line 6 of file AtlRunQueryPageMaker.py.

Member Function Documentation

◆ _copySomeFilesToCache()

def python.html.AtlRunQueryPageMaker.PageMaker._copySomeFilesToCache (   cls)
private

Definition at line 46 of file AtlRunQueryPageMaker.py.

46  def _copySomeFilesToCache(cls):
47  from subprocess import call
48  from CoolRunQuery.AtlRunQueryQueryConfig import QC
49  call("mkdir -p %s/css" % QC.datapath, shell=True)
50  call("cp html/css/atlas-runquery-lb.css %s/css/" % QC.datapath, shell=True)

◆ getBlankPage()

def python.html.AtlRunQueryPageMaker.PageMaker.getBlankPage (   cls,
  removeExamples = False 
)

Definition at line 33 of file AtlRunQueryPageMaker.py.

33  def getBlankPage(cls, removeExamples=False):
34  if '/var/vhost' in os.path.dirname(__file__):
35  page = open("%s/index.html" % os.path.dirname(__file__).replace('CoolRunQuery/html',''))
36  else:
37  page = open("%s/atlas-runquery.html" % os.path.dirname(__file__).replace('python/CoolRunQuery/html','html'))
38  s = page.read()
39  top, bottom = re.match("(.*)<!--INSERTQUERYRESULT-->(.*)", s, re.S|re.M).group(1,2)
40  if removeExamples:
41  top = "".join(re.match("(.*)<!--START_EXAMPLES-->.*<!--END_EXAMPLES-->(.*)", top, re.S|re.M).group(1,2))
42  return (top,bottom)
43 
44 

◆ makePage()

def python.html.AtlRunQueryPageMaker.PageMaker.makePage (   cls,
  body,
  origQuery = None,
  extraReplace = None,
  removeExamples = False 
)

Definition at line 9 of file AtlRunQueryPageMaker.py.

9  def makePage(cls, body, origQuery=None, extraReplace=None, removeExamples=False):
10  from CoolRunQuery.AtlRunQueryQueryConfig import QC
11  (top, bottom) = cls.getBlankPage(removeExamples=removeExamples)
12  # put in the original query
13  if origQuery is not None:
14  top = top.replace('name="q"','name="q" value="%s"' % origQuery)
15 
16  # extra replacements
17  if extraReplace is not None:
18  for pat,repl in extraReplace:
19  p = re.compile(pat,re.S)
20  top = p.sub(repl, top)
21  bottom = p.sub(repl, bottom)
22 
23  fh = open("%s/index.html" % QC.datapath, "w")
24  print (top, file = fh)
25  print (body, file = fh)
26  print (bottom, file = fh)
27  fh.close()
28 
29  cls._copySomeFilesToCache()
30 
31 

The documentation for this class was generated from the following file:
replace
std::string replace(std::string s, const std::string &s2, const std::string &s3)
Definition: hcg.cxx:307
python.trfUtils.call
def call(args, bufsize=0, executable=None, stdin=None, preexec_fn=None, close_fds=False, shell=False, cwd=None, env=None, universal_newlines=False, startupinfo=None, creationflags=0, message="", logger=msg, loglevel=None, timeout=None, retry=2, timefactor=1.5, sleeptime=10)
Definition: trfUtils.py:155
TCS::join
std::string join(const std::vector< std::string > &v, const char c=',')
Definition: Trigger/TrigT1/L1Topo/L1TopoCommon/Root/StringUtils.cxx:10
Trk::open
@ open
Definition: BinningType.h:40
CaloLCW_tf.group
group
Definition: CaloLCW_tf.py:28