CMS 3D CMS Logo

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