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
13 if origQuery is not None:
14 top = top.replace('name="q"','name="q" value="%s"' % origQuery)
15
16
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