2 from __future__
import print_function
14 from ROOT
import gSystem
17 gSystem.Load(
'libDataQualityUtils')
18 from ROOT
import dqutils
27 def handiWithComparisons(name, resultsFile, htmlDir, runlistLoc, compare, browserMenu, allDirsScriptDir, jsRoot=1):
36 if (htmlDir.rfind(
"/") != (len(htmlDir)-1)):
41 dirs = dirsstring.rsplit()
42 for subHtmlDir
in dirs:
43 if(
not os.access(subHtmlDir, os.F_OK)):
45 os.makedirs(subHtmlDir)
47 print(
'Cannot create directory "' + subHtmlDir +
'"; exiting.')
53 if (name.find(
'minutes10_') > -1):
55 digit = ((t[len(t)-1]).
split(
','))[0]
57 low_limit =
int((digit-1.0)*10.0/LBlength+1)
58 hi_limit =
int(digit*10.0/LBlength)
59 LB_range =
', LB '+
str(low_limit)+
' - ' +
str(hi_limit)
60 elif (name.find(
'minutes30_') > -1):
63 low_limit =
int((digit-1.0)*30.0/LBlength+1)
64 hi_limit =
int(digit*30.0/LBlength)
65 LB_range =
', LB '+
str(low_limit)+
' - ' +
str(hi_limit)
68 resultsFile, htmlDir,
True, (name+LB_range), jsRoot)
70 print(
"There are no histograms in this file; writing a dummy index file")
71 if(
not os.access(htmlDir, os.F_OK)):
75 print(
'Cannot create directory "' + htmlDir +
'"; exiting.')
77 dummyIndex = htmlDir +
"/index.html"
78 d =
open(dummyIndex,
'w')
79 d.write(
'<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">\n')
80 d.write(
'<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">\n')
82 d.write(
'<title>Error</title>\n')
85 d.write(
'<h1>Error:</h1>\n')
87 'No histograms found for display. Check the <tt>han</tt> configuration\n')
88 d.write(
'to make sure it is consistent with the <tt>han</tt> input file.\n')
94 s = total.rsplit(
'\n')
97 if (len(s[number-1]) < 1):
103 htmlDir, name, s, number, resultsFile, allDirsScriptDir)
106 htmlDir, name, s, number, resultsFile)
108 for x
in range(0, len(dirlist)):
110 namelist[x], dirlist[x], runlistLoc, compare, allDirsScriptDir, jsRoot)
112 namelist[x], dirlist[x],
'Red', runlistLoc, compare, allDirsScriptDir, jsRoot)
114 namelist[x], dirlist[x],
'Yellow', runlistLoc, compare, allDirsScriptDir, jsRoot)
116 namelist[x], dirlist[x],
'Green', runlistLoc, compare, allDirsScriptDir, jsRoot)
121 for path
in jsonFileCull:
122 if os.path.isfile(path):
123 os.system(
"rm "+path)
127 g =
open(htmlDir+
'AllDirs.xml',
'w')
128 g.write(
'<?xml version="1.0" encoding="ISO-8859-1"?>\n')
133 for x
in range(0, number):
137 shortNameDir = namedir
138 namediri = namedir.rfind(
"/")
140 shortNameDir = namedir[namediri+1:]
141 if namedir ==
'<top_level>':
142 shortNameDir =
'Overall Status'
143 spaces_new = s[x].
find(sp[0][0])
144 if ((x < number-1)
and (s[x+1].rsplit())[3] ==
'ass'):
148 if spaces_new > spaces:
151 g.write(
'<dir tag=\"'+sub+
'dir\" id=\"' + shortNameDir +
152 '\" status=\"'+sp[1]+
'\" histo = \"' + histo +
'\">\n')
154 elif spaces_new == spaces:
155 g.write(
'</dir>\n<dir tag=\"'+sub+
'dir\" id=\"' + shortNameDir +
156 '\" status=\"'+sp[1] +
'\" histo = \"' + histo +
'\">\n')
158 diff = spaces - spaces_new
163 sub = sub[3:len(sub)]
165 g.write(
'<dir tag=\"'+sub+
'dir\" id=\"' + shortNameDir +
166 '\" status=\"'+sp[1] +
'\" histo = \"' + histo +
'\">\n')
168 if namedir ==
'<top_level>':
170 g.write(
'<a href="'+namedir +
'/toplevel.html">' +
171 shortNameDir +
'</a>\n')
173 g.write(
'<a href="'+namedir +
'/index.html" >' +
174 shortNameDir +
'</a>\n')
177 for x
in range(0, num_lists):
179 sub = sub[3:len(sub)]
184 g =
open(htmlDir+
'index.html',
'w')
185 g.write(
'<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">\n')
186 g.write(
'<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">\n')
188 g.write(
'<meta http-equiv="Content-Type" content="text/html;charset=utf-8" />\n')
189 g.write(
'<title>' + name +
'</title>\n')
190 g.write(
'<link rel="stylesheet" href="AutomChecks.css" type="text/css" />\n')
191 g.write(
'<link rel="stylesheet" href="https://atlasdqm.web.cern.ch/atlasdqm/css/mktree.css"/>\n')
192 g.write(
'<script type="text/javascript" src="https://atlasdqm.web.cern.ch/atlasdqm/js/mktree.js"></script>\n')
197 '<font class="DQGroup">[<a href="#" onclick="history.go(-1);return false;">Back</a>]</font>')
199 g.write(
'<h1>' + name +
': Monitoring and Automatic Checks</h1>\n')
211 g.write(
'<tr><td>Click to expand</td></tr>\n')
212 g.write(
'<tr valign="top">\n<td width="500"><font class="DQGroup">\n')
213 for x
in range(0, number):
217 shortNameDir = namedir
218 namediri = namedir.rfind(
"/")
220 shortNameDir = namedir[namediri+1:]
221 if namedir ==
'<top_level>':
222 shortNameDir =
'Overall Status'
223 spaces_new = s[x].
find(sp[0][0])
224 if spaces_new > spaces:
226 g.write(
'<ul%s>\n<li>' %
227 (
' class="mktree"' if namedir ==
'<top_level>' else ''))
229 elif spaces_new == spaces:
230 g.write(
'</li>\n<li>')
233 diff = spaces - spaces_new
235 g.write(
'</ul></li>\n')
242 if ((x < number-1)
and (s[x+1].rsplit())[3] ==
'ass'):
243 if namedir ==
'<top_level>':
245 g.write(
'<a href="'+namedir +
246 '/toplevel.html">'+shortNameDir +
':</a>')
248 g.write(
'<a href="'+namedir +
249 '/index.html" >'+shortNameDir +
':</a>')
250 g.write(
' <font class="' +
251 sp[1]+
'">' + sp[1] +
'</font>\n')
253 namelist.append(namedir)
255 g.write(shortNameDir +
':')
256 g.write(
' <font class="' +
257 sp[1]+
'">' + sp[1] +
'</font>\n')
261 for x
in range(0, num_lists-1):
262 g.write(
'</ul></li>\n')
266 g.write(
'</font></td>\n</tr>\n</table>')
267 g.write(
'</body>\n</html>\n')
269 return dirlist, namelist
273 g =
open(htmlDir+
'index.html',
'w')
274 g.write(
'<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">\n')
275 g.write(
'<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">\n')
277 g.write(
'<meta http-equiv="Content-Type" content="text/html;charset=utf-8" />\n')
278 g.write(
'<title>' + name +
'</title>\n')
279 g.write(
'<link rel="stylesheet" href="AutomChecks.css" type="text/css" />\n')
280 g.write(
'<link rel="stylesheet" href="'+AllDirsScriptDir +
281 '/mktree/mktree.css" type="text/css" />')
282 g.write(
'<script type="text/javascript" src="'+AllDirsScriptDir +
283 '/AllDirs.js"><!-- dont contract--></script>\n')
284 g.write(
'<script type="text/javascript" src="'+AllDirsScriptDir +
285 '/mktree/mktree.js"><!-- dont contract--></script>\n')
287 g.write(
'<body onLoad=\"loadXMLDoc(\'AllDirs.xml\');\">')
289 '<font class="DQGroup">[<a href="#" onclick="history.go(-1);return false;">Back</a>]</font>')
290 g.write(
'<h1>' + name +
': Monitoring and Automatic Checks</h1>\n')
292 g.write(
'<div id=\"Select_subdir\">\n</div>\n')
297 g.write(
'<div id=\"Display_dir\">\n</div>\n')
298 g.write(
'</body>\n</html>\n')
306 for x
in range(0, number):
311 if ((x < number-1)
and (s[x+1].rsplit())[3] ==
'ass'):
312 if namedir ==
'<top_level>':
315 namelist.append(namedir)
317 return dirlist, namelist
320 def makeSubDirFile(htmlDir, name, s, number, subname, assessIndex, runlistLoc, compare, AllDirsScriptDir, jsRoot):
323 h =
open(htmlDir+
'/'+subname+
'/toplevel.html',
'w')
324 subnameTitle =
'Top Level'
326 h =
open(htmlDir+
'/'+subname+
'/index.html',
'w')
327 subnameTitle = subname
328 h.write(
'<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">\n')
329 h.write(
'<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">\n')
331 h.write(
'<meta http-equiv="Content-Type" content="text/html;charset=utf-8" />\n')
332 h.write(
'<title>' + name +
' ' + subnameTitle +
'</title>\n')
333 h.write(
'<link rel="stylesheet" href="AutomChecks.css" type="text/css" />\n')
334 h.write(
'<script type="text/javascript" src="'+AllDirsScriptDir +
335 '/AllDirs.js"><!-- dont contract--></script>\n')
339 '<font class="DQGroup">[<a href="#" onclick="history.go(-1);return false;">Back</a>]</font>')
345 h.write(
'<table>\n<tr valign="top">\n<td width="250"></td>\n')
346 h.write(
'<td width="300" align="center"><h2>' +
347 name+
' '+subnameTitle+
'</h2>\n')
348 h.write(
'<a href="Red.html">[Only Red]</a>\n')
349 h.write(
'<a href="Yellow.html">[Only Yellow]</a>\n')
350 h.write(
'<a href="Green.html">[Only Green]</a></td>\n')
351 h.write(
'<td width="250">\n<font class="Note">Click on images for details and full size.</font>\n')
352 h.write(
'</td>\n</tr>\n</table>\n')
353 h.write(
'<table cellpadding="4" cellspacing="20">\n')
357 while(sp[3] ==
'ass' and y < number):
359 titleStream = s[y].rsplit(
" title ")
360 title = titleStream[1]
363 h.write(
'<tr>\n<td class="' + sp[1] +
'" align="center"><a href="'+sp[0]+
'.html" class="hintanchor" onmouseover="showhint(\'' + title+
'\', this, event, \'400px\')"><img src="' +
364 sp[0] +
'.png" height="200" alt="' + name +
' ' + subname+
'/'+sp[0]+
'.png" /></a><br/><div style="text-overflow:ellipsis;overflow:hidden;max-width:240px">'+sp[0]+
'</div></td>\n')
366 h.write(
'<td class="' + sp[1] +
'" align="center"><a href="'+sp[0]+
'.html" class="hintanchor" onmouseover="showhint(\'' + title+
'\', this, event, \'500px\')"><img src="' + sp[0] +
367 '.png" height="200" alt="' + name +
' ' + subname+
'/'+sp[0]+
'.png" /></a><br/><div style="text-overflow:ellipsis;overflow:hidden;max-width:240px">'+sp[0]+
'</div></td>\n</tr>\n')
370 h.write(
'<td class="' + sp[1] +
'" align="center"><a href="'+sp[0]+
'.html" class="hintanchor" onmouseover="showhint(\'' + title+
'\', this, event, \'400px\')"><img src="' +
371 sp[0] +
'.png" height="200" alt="' + name +
' ' + subname+
'/'+sp[0]+
'.png" /></a><br/><div style="text-overflow:ellipsis;overflow:hidden;max-width:240px">'+sp[0]+
'</div></td>\n')
372 temp = s[y].rsplit(
" title ")
375 runlistLoc, compare, jsRoot)
381 h.write(
'</table>\n</center>\n</body>\n</html>\n')
385 def makeColorFile(htmlDir, name, s, number, subname, assessIndex, color, runlistLoc, compare, AllDirsScriptDir, jsRoot):
388 h =
open(htmlDir+
'/'+subname+
'/'+color+
'.html',
'w')
389 subnameTitle =
'Top Level'
391 h =
open(htmlDir+
'/'+subname+
'/'+color+
'.html',
'w')
392 subnameTitle = subname
393 h.write(
'<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">\n')
394 h.write(
'<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">\n')
396 h.write(
'<meta http-equiv="Content-Type" content="text/html;charset=utf-8" />\n')
397 h.write(
'<title>' + name +
' ' + subnameTitle +
' ' + color +
'</title>\n')
398 h.write(
'<link rel="stylesheet" href="AutomChecks.css" type="text/css" />\n')
399 h.write(
'<script type="text/javascript" src="'+AllDirsScriptDir +
400 '/AllDirs.js"><!-- dont contract--></script>\n')
404 '<font class="DQGroup">[<a href="#" onclick="history.go(-1);return false;">Back</a>]</font>')
406 h.write(
'<table>\n<tr valign="top">\n<td width="250"></td>\n')
407 h.write(
'<td width="300"><h2>'+name+
' ' +
408 subnameTitle+
': ' + color +
' only</h2>\n')
409 h.write(
'<a href="Red.html">[Only Red]</a>\n')
410 h.write(
'<a href="Yellow.html">[Only Yellow]</a>\n')
411 h.write(
'<a href="Green.html">[Only Green]</a></td>\n')
412 h.write(
'<td width="250">\n<font class="Note">Click on images for details and full size.</font>\n')
413 h.write(
'</td>\n</tr>\n</table>\n')
414 h.write(
'<table cellpadding="4" cellspacing="20">\n')
419 while(sp[3] ==
'ass' and y < number):
420 titleStream = s[y].rsplit(
" title ")
421 title = titleStream[1]
427 h.write(
'<tr>\n<td class="' + sp[1] +
'"><a href="'+sp[0]+
'.html" class="hintanchor" onmouseover="showhint(\''+title +
428 '\', this, event, \'400px\')"><img src="' + sp[0] +
'.png" height="200" alt="' + name +
' ' + subname+
'/'+sp[0]+
'.png" /></a></td>\n')
430 h.write(
'<td class="' + sp[1] +
'"><a href="'+sp[0]+
'.html" class="hintanchor" onmouseover="showhint(\''+title +
431 '\', this, event, \'500px\')"><img src="' + sp[0] +
'.png" height="200" alt="' + name +
' ' + subname+
'/'+sp[0]+
'.png" /></a></td>\n</tr>\n')
434 h.write(
'<td class="' + sp[1] +
'"><a href="'+sp[0]+
'.html" class="hintanchor" onmouseover="showhint(\'' + title +
435 '\', this, event, \'400px\')"><img src="' + sp[0] +
'.png" height="200" alt="' + name +
' ' + subname+
'/'+sp[0]+
'.png" /></a></td>\n')
436 temp = s[y].rsplit(
" title ")
439 runlistLoc, compare, jsRoot)
445 h.write(
'</table>\n')
447 h.write(
'<h3> No '+color+
' histograms </h3>\n')
448 h.write(
'</center>\n</body>\n</html>\n')
453 k.write(
'<tr><td> </td></tr>\n')
454 k.write(
'<tr><td colspan="2">\n')
456 k.write(
'<caption>'+limitName+
'</caption>\n')
458 k.write(
'<td width="340" align="center" colspan="4">\n')
459 k.write(
'<font color="'+lowColor+
'">XXXXXXX</font><b>I</b>\n')
460 k.write(
'<font color="#ffd700">XXXXXXX</font><b>I</b>\n')
461 k.write(
'<font color="'+hiColor+
'">XXXXXXX</font></td>\n')
462 k.write(
'</tr><tr>\n')
463 k.write(
'<td width="92"></td>\n')
464 k.write(
'<td width="78" align="center">' + loVal +
'</td>\n')
465 k.write(
'<td width="78" align="center">' + hiVal +
'</td>\n')
466 k.write(
'<td width="92"></td>\n')
467 k.write(
'</tr>\n</table>\n')
472 runmatch = re.compile(
'^Run ([0-9]+), ([0-9]+)/(.+)$')
473 subrunmatch = re.compile(
'^Run ([0-9]+), (.+)_(.*), ([0-9]+)/(.+)$')
474 rm = runmatch.match(name)
475 srm = subrunmatch.match(name)
477 run, proc_ver, stream = rm.groups()
480 elif srm
is not None:
481 run, period_type, period, proc_ver, stream = srm.groups()
483 run, period_type, period, proc_ver, stream = [
None]*5
485 k =
open(htmlDir+
'/'+subname+
'/'+sp[0]+
'.html',
'w')
486 k.write(
'<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">\n')
487 k.write(
'<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">\n')
489 k.write(
'<meta http-equiv="Content-Type" content="text/html;charset=utf-8" />\n')
490 k.write(
'<title>'+name +
' ' + subname +
' ' + sp[0]+
'</title>\n')
491 k.write(
'<link rel="stylesheet" href="AutomChecks.css" type="text/css" />\n')
492 k.write(
'<script src="https://cdnjs.cloudflare.com/ajax/libs/require.js/2.1.10/require.min.js"></script>\n')
493 k.write(
'<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/2.0.3/jquery.min.js"></script>')
497 k.write(
'<center>\n')
498 k.write(
'<table>\n<tr valign="top">\n')
500 '<td width="250"><font class="DQGroup">[<a href="#" onclick="history.go(-1);return false;">Back</a>]</font></td>\n')
501 k.write(
'<td width="500"><h2>'+name +
' ' +
502 subname+
'/'+sp[0]+
'</h2></td>\n')
503 k.write(
'<td width="250"></td>\n</tr>\n')
504 for x
in range(4, len(sp)-1):
505 if (
'inputname' in sp[x]):
507 k.write(
'<tr><td width="250"></td><td width="500">Location in ROOT file: ' +
508 inputname +
'</td>\n</tr>\n')
509 k.write(
'</table>\n')
510 k.write(
'<table cellpadding="10">\n<tr>\n')
511 k.write(
'<td>\n<table width="400">\n')
513 '<tr><td colspan="2"><font class="Heading">Assessment Details:</font></td></tr>\n')
514 k.write(
'<tr><td> </td></tr>\n')
515 k.write(
'<tr><td align="right"><font class="DatumName">Name:</font></td>')
516 k.write(
'<td>' + sp[0] +
'</td></tr>\n')
517 k.write(
'<tr><td align="right"><font class="DatumName">Status:</font></td>')
518 k.write(
'<td><font class="' + sp[1] +
'">' + sp[1] +
'</font></td></tr>\n')
519 k.write(
'<tr><td align="right"><font class="DatumName">Algorithm:</font></td>')
520 k.write(
'<td>'+sp[2]+
'</td></tr>\n')
530 if 'Green' in sp[cc]:
531 currentHeading =
'limits'
533 limitName = sp[cc][:spi]
534 Green =
float(sp[cc+1])
538 if (cG > 0
and cR > 0):
541 "Green", sp[cR], sp[cG])
544 "Red", sp[cG], sp[cR])
547 elif 'Red' in sp[cc]:
548 currentHeading =
'limits'
549 spi = sp[cc].
find(
"Red")
550 limitName = sp[cc][:spi]
555 if (cG > 0
and cR > 0):
558 "Green", sp[cR], sp[cG])
561 "Red", sp[cG], sp[cR])
564 elif sp[cc] ==
"Results":
565 currentHeading =
'results'
566 k.write(
'<tr><td> </td></tr>\n')
568 '<tr><td colspan="2"><font class="Heading">Results:</font></td></tr>\n')
569 k.write(
'<tr><td> </td></tr>\n')
572 elif sp[cc] ==
"Config":
573 currentHeading =
'config'
574 k.write(
'<tr><td> </td></tr>\n')
576 '<tr><td colspan="2"><font class="Heading">Configuration Parameters:</font></td></tr>\n')
577 k.write(
'<tr><td> </td></tr>\n')
580 elif sp[cc] ==
"entries:":
581 currentHeading =
'nentries'
583 '<tr><td align="right"><font class="DatumName">Num. of Entries:</font> </td>')
584 k.write(
'<td>'+sp[cc+1]+
'</td></tr>\n')
587 elif sp[cc] ==
"Underflow:":
589 '<tr><td align="right"><font class="DatumName">Underflow:</font> </td>')
590 k.write(
'<td>'+sp[cc+1]+
'</td></tr>\n')
593 elif sp[cc] ==
"Overflow:":
595 '<tr><td align="right"><font class="DatumName">Overflow:</font> </td>')
596 k.write(
'<td>'+sp[cc+1]+
'</td></tr>\n')
599 elif cc < len(sp)-1
and 'inputname' not in sp[cc]:
600 if currentHeading ==
'results':
601 namecache.append(sp[cc-2])
602 if ':' not in sp[cc]:
607 name =
' '.
join([namecache[-1]])
609 from six.moves
import urllib
610 resultname = name.rsplit(
':', 1)[0]
612 if algorithm ==
'RepeatAlgorithm' and resultname.endswith(
'|Status'):
613 resultval = {
'1':
'Red',
'2':
'Yellow',
614 '3':
'Green'}[resultval]
615 if compare
and run
is not None:
616 if period_type ==
'run':
617 queryurl =
'http://atlasdqm.cern.ch:8080/dqmfquery/query?histogram=%s&result=%s&error=&stream=%s&period_type=%s&source=tier0&proc_ver=%s&low_run=%s&high_run=&low_y=&high_y=&outputtype=png' % (
618 urllib.parse.quote_plus(subname+
'/'+sp[0]), urllib.parse.quote_plus(resultname), stream.strip(), period_type, proc_ver,
int(run)-1000)
620 '<tr><td align="right"><b><a href="%s">%s</a>:</b></td>' % (queryurl, resultname))
621 k.write(
'<td>'+resultval+
'</td></tr>\n')
623 queryurl1 =
'http://atlasdqm.cern.ch:8080/dqmfquery/query?histogram=%s&result=%s&error=&stream=%s&period_type=%s&source=tier0&proc_ver=%s&low_run=%s&high_run=&low_y=&high_y=&outputtype=png' % (
624 urllib.parse.quote_plus(subname+
'/'+sp[0]), urllib.parse.quote_plus(resultname), stream.strip(), period_type, proc_ver,
int(run)-1000)
625 queryurl2 =
'http://atlasdqm.cern.ch:8080/dqmfquery/query?histogram=%s&result=%s&error=&stream=%s&period_type=%s&source=tier0&proc_ver=%s&low_run=%s&high_run=%s&low_y=&high_y=&outputtype=png' % (
626 urllib.parse.quote_plus(subname+
'/'+sp[0]), urllib.parse.quote_plus(resultname), stream.strip(), period_type, proc_ver, run, run)
628 '<tr><td align="right"><b><a href="%s">%s</a>:</b></td>' % (queryurl1, resultname))
630 '<td>'+resultval+
' (<a href="%s">History for this run</a>)</td></tr>\n' % queryurl2)
632 k.write(
'<tr><td align="right"><b> %s: </b></td>' %
634 k.write(
'<td>'+resultval+
'</td></tr>\n')
636 k.write(
'<tr><td align="right"><b>'+sp[cc]+
' </b></td>')
637 if sp[cc+1:cc+3] == [
'Multiple',
'references']:
638 k.write(
'<td>'+
' '.
join(sp[cc+1:cc+3])+
'</td></tr>\n')
642 k.write(
'<td>'+sp[cc+1]+
'</td></tr>\n')
648 k.write(
'</table>\n</td>\n')
649 jsonPath = htmlDir+
'/'+subname+
'/'+sp[0]+
".json" if sp[0]
else ""
651 jsonFileCull.add(jsonPath)
652 jsonFile =
open(jsonPath,
'r')
if os.path.isfile(jsonPath)
else ""
654 if((jsRoot & 2)
and os.path.isfile(jsonPath)):
656 jsonStr = jsonFile.read()
657 jsonStr = jsonStr.replace(
'\n',
'')
659 '<td><div id="root_plot_1" style="width: 600px; height: 400px"></div></td>\n<script>\n requirejs.config( { paths: { \'JSRootCore\' : \'https://root.cern.ch/js/dev//scripts/JSRootCore\', \'JSRootPainter\' : \'https://root.cern.ch/js/dev//scripts/JSRootPainter\', } });require([\'JSRootCore\', \'JSRootPainter\'], function(Core, Painter) {\n var obj = Core.parse(\''+jsonStr+
'\');\nPainter.draw("root_plot_1", obj, ""); });</script>\n')
661 k.write(
'<td><a href="toplevel.html"><img src="' +
662 sp[0] +
'.png" alt="' + name +
' ' + subname+
'/'+sp[0]+
'.png" /></a></td>\n')
664 if((jsRoot & 2)
and os.path.isfile(jsonPath)):
666 jsonStr = jsonFile.read()
667 jsonStr = jsonStr.replace(
'\n',
'')
669 '<td><div id="root_plot_2" style="width: 600px; height: 400px"></div></td>\n<script>\n requirejs.config( { paths: { \'JSRootCore\' : \'https://root.cern.ch/js/dev//scripts/JSRootCore\', \'JSRootPainter\' : \'https://root.cern.ch/js/dev//scripts/JSRootPainter\', } });require([\'JSRootCore\', \'JSRootPainter\'], function(Core, Painter) {\n var obj = Core.parse(\''+jsonStr+
'\');\nPainter.draw("root_plot_2", obj, ""); });</script>\n')
671 k.write(
'<td><a href="index.html"><img src="' +
672 sp[0] +
'.png" alt="' + name +
' ' + subname+
'/'+sp[0]+
'.png" /></a></td>\n')
673 k.write(
'</tr></table>\n')
674 k.write(
'</center>\n')
675 now = time.localtime()
677 lastUpdate =
"Last Update: "+time.strftime(
'%Y-%m-%d %H:%M %Z', now)
678 k.write(
'</br><font class=\"Note\">'+lastUpdate+
'</font><br />\n')
728 k.write(
'</body>\n</html>\n')
733 k =
open(htmlDir+
'index.html',
'w')
734 k.write(
'<html>\n<frameset rows="200,*">\n')
735 k.write(
'<frame src="'+name+
'AllDirs.html">\n')
738 k.write(
'<frame src="'+subname+
'/index.html" name="showframe"> \n')
740 k.write(
'<frame src="'+subname +
741 '/toplevel.html" name="showframe"> \n')
742 k.write(
'</frameset>\n</html> \n')
747 css =
open(htmlDir+
'/'+subname+
'/'+name+
'AutomChecks.css',
'w')
749 'BODY\n{\n background: #E6E6FA;\n color: #000000;\n font-family: helvetica,sans-serif;\n}\n')
751 'H1\n{\n font-family: helvetica,sans-serif;\n font-size: x-large;\n text-align: left;\n}\n')
753 'H2\n{\n font-family: helvetica,sans-serif;\n font-size: large;\n text-align: center;\n}\n')
755 'H3\n{\n font-family: helvetica,sans-serif;\n font-size: medium;\n text-align: left;\n}\n')
756 css.write(
'A IMG\n{\n border: none;\n}\n')
757 css.write(
'FONT.Info\n{\n color: black;\n font-style: italic;\n}\n')
759 'FONT.Heading\n{\n color: black;\n font-weight: bold;\n font-size: large;\n}\n')
760 css.write(
'FONT.DatumName\n{\n color: black;\n font-weight: bold;\n}\n')
761 css.write(
'FONT.Note\n{\n color: black;\n font-size: small;\n}\n')
762 css.write(
'FONT.DQGroup\n{\n font-size: small;\n}\n')
763 css.write(
'FONT.Red\n{\n color: red;\n font-weight: bold;\n}\n')
764 css.write(
'FONT.Yellow\n{\n color: #ffd700;\n font-weight: bold;\n}\n')
765 css.write(
'FONT.Green\n{\n color: green;\n font-weight: bold;\n}\n')
766 css.write(
'FONT.Disabled\n{\n color: black;\n font-weight: bold;\n}\n')
767 css.write(
'FONT.Undefined\n{\n color: gray;\n}\n')
768 css.write(
'FONT.NoCheck\n{\n color: black;\n font-weight: bold;\n}\n')
769 css.write(
'TD.Red\n{\n background-color: red;\n}\n')
770 css.write(
'TD.Yellow\n{\n background-color: #ffd700;\n}\n')
771 css.write(
'TD.Green\n{\n background-color: green;\n}\n')
772 css.write(
'TD.Disabled\n{\n background-color: black;\n}\n')
773 css.write(
'TD.Undef\n{\n background-color: gray;\n}\n')
774 css.write(
'TD.NoCheck\n{\n background-color: #E6E6FA;\n}\n')
775 css.write(
'.hintanchor\n{\n font-weight: bold; \n color: navy; \n }\n')
776 css.write(
'#hintbox{\n position:absolute; \n top: 0; \n background-color: lightyellow; \n width: 150px; \n padding: 3px; \n border:1px solid black; \n')
777 css.write(
'font:normal 15px Verdana;\n line-height:18px; \n z-index:100; \n border-right: 3px solid black; \n border-bottom: 3px solid black; \n visibility: hidden;\n }')
783 dirsstring = of.stringListSystemPaths(location)
790 total = of.stringAllDQAssessments()
798 cnvType = 1
if jsRoot == 1
else 3
799 nSaved = of.saveAllHistograms(location, drawRefs, run_min_LB, cnvType)