CMS 3D CMS Logo

web_templates.py
Go to the documentation of this file.
1 from builtins import range
2 main_page_template = '''<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
3 <html>
4 <head>
5  <link type="text/css" href="http://cern.ch/cms-project-tau-validation/styles.css" rel="stylesheet">
6  <title>Tau ID Validation</title>
7 </head>
8 <body class="index">
9  <div id="header">
10  <A href="https://cms-project-tauvalidation.web.cern.ch/cms-project-tauvalidation/">Home</A>
11  <A href="https://twiki.cern.ch/twiki/bin/view/CMS/SWGuideTauValidation">Wiki</A>
12  </div>
13  <hr>
14  <div id="title">
15  <h1>Tau ID Validation</h1>
16  </div>
17  <hr>
18  <h2>Official releases validated:</h2>
19  <ul>
20 %s
21  </ul>
22  <h2>Special RelVal Validation:</h2>
23  <ul>
24 %s
25  </ul>
26  <h2>Custom validation, tests and other stuff:</h2>
27  <ul>
28 %s
29  </ul>
30 </body>
31 </html>
32 '''
33 create_main_list_element = lambda x: ' <li><a href="%s/">%s</a></li>\n' % (x,x)
34 
35 from string import Template
36 usual_validation_template = Template('''<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
37 <html>
38 <head>
39  <link type="text/css" href="http://cern.ch/cms-project-tau-validation/styles.css" rel="stylesheet">
40  <title>$THIS_RELEASE Validation Results</title>
41 </head>
42 <body class="index">
43  <div id="header">
44  <A href="https://cms-project-tauvalidation.web.cern.ch/cms-project-tauvalidation/">Home</A>
45  <A href="https://twiki.cern.ch/twiki/bin/view/CMS/SWGuideTauValidation">Wiki</A>
46  </div>
47  <hr>
48  <div id="title">
49  <h1>$THIS_RELEASE Validation Results</h1>
50  </div>
51  <hr>
52  <h2>Configuration:</h2>
53  <pre>
54 $CONFIG
55  </pre>
56  <h2>Datasets:</h2>
57 $DATASETS
58 </body>
59 </html>
60 ''')
61 
62 def usual_validation_dataset_template(dataset_name, root_link, ref_file, dir_link, paths_to_pictures, source_file):
63  chunk_list = lambda l,n: [l[i:i+n] for i in range(0, len(l), n)]
64  rows_paths = chunk_list(paths_to_pictures,2)
65  cell_template = ' <td style="width: 640px;"><A href=%s><IMG src="%s" width="640" align="center" border="0"></A></td>'
66  row_template = ''' <tr>
67 %s </tr>\n'''
68  rows = ''.join([row_template % ''.join([ cell_template % (path,path) for path in row]) for row in rows_paths])
69  reference = '<A href=%s>Reference</A>' % ref_file if ref_file else 'Reference not available'
70  source = '<A href=%s>Input Source</A>' % source_file if ref_file else 'Source not available' #ALL source files seem empty... need to check
71  return ''' <h3>%s ( <A href=%s>Root File</A> ) ( %s ) ( %s ) ( <A href=%s>Full Directory Content</A> )</h3>
72  <table style="text-align: left; " border="1" cellpadding="2" cellspacing="1">
73  <tbody>
74 %s
75  </tbody>
76  </table>
77 ''' % (dataset_name, root_link, reference, source, dir_link, rows)
def usual_validation_dataset_template(dataset_name, root_link, ref_file, dir_link, paths_to_pictures, source_file)
static std::string join(char **cmd)
Definition: RemoteFile.cc:18