Definition at line 6 of file AtlRunQueryPageMaker.py.
◆ _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',
''))
37 page =
open(
"%s/atlas-runquery.html" % os.path.dirname(__file__).
replace(
'python/CoolRunQuery/html',
'html'))
39 top, bottom = re.match(
"(.*)<!--INSERTQUERYRESULT-->(.*)", s, re.S|re.M).
group(1,2)
41 top =
"".
join(re.match(
"(.*)<!--START_EXAMPLES-->.*<!--END_EXAMPLES-->(.*)", top, re.S|re.M).
group(1,2))
◆ 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)
13 if origQuery
is not None:
14 top = top.replace(
'name="q"',
'name="q" value="%s"' % origQuery)
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)
23 fh =
open(
"%s/index.html" % QC.datapath,
"w")
24 print (top, file = fh)
25 print (body, file = fh)
26 print (bottom, file = fh)
29 cls._copySomeFilesToCache()
The documentation for this class was generated from the following file:
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)