File indexing completed on 2024-04-06 12:33:20
0001 from builtins import range
0002 main_page_template = '''<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
0003 <html>
0004 <head>
0005 <link type="text/css" href="http://cern.ch/cms-project-tau-validation/styles.css" rel="stylesheet">
0006 <title>Tau ID Validation</title>
0007 </head>
0008 <body class="index">
0009 <div id="header">
0010 <A href="https://cms-project-tauvalidation.web.cern.ch/cms-project-tauvalidation/">Home</A>
0011 <A href="https://twiki.cern.ch/twiki/bin/view/CMS/SWGuideTauValidation">Wiki</A>
0012 </div>
0013 <hr>
0014 <div id="title">
0015 <h1>Tau ID Validation</h1>
0016 </div>
0017 <hr>
0018 <h2>Official releases validated:</h2>
0019 <ul>
0020 %s
0021 </ul>
0022 <h2>Special RelVal Validation:</h2>
0023 <ul>
0024 %s
0025 </ul>
0026 <h2>Custom validation, tests and other stuff:</h2>
0027 <ul>
0028 %s
0029 </ul>
0030 </body>
0031 </html>
0032 '''
0033 create_main_list_element = lambda x: ' <li><a href="%s/">%s</a></li>\n' % (x,x)
0034
0035 from string import Template
0036 usual_validation_template = Template('''<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
0037 <html>
0038 <head>
0039 <link type="text/css" href="http://cern.ch/cms-project-tau-validation/styles.css" rel="stylesheet">
0040 <title>$THIS_RELEASE Validation Results</title>
0041 </head>
0042 <body class="index">
0043 <div id="header">
0044 <A href="https://cms-project-tauvalidation.web.cern.ch/cms-project-tauvalidation/">Home</A>
0045 <A href="https://twiki.cern.ch/twiki/bin/view/CMS/SWGuideTauValidation">Wiki</A>
0046 </div>
0047 <hr>
0048 <div id="title">
0049 <h1>$THIS_RELEASE Validation Results</h1>
0050 </div>
0051 <hr>
0052 <h2>Configuration:</h2>
0053 <pre>
0054 $CONFIG
0055 </pre>
0056 <h2>Datasets:</h2>
0057 $DATASETS
0058 </body>
0059 </html>
0060 ''')
0061
0062 def usual_validation_dataset_template(dataset_name, root_link, ref_file, dir_link, paths_to_pictures, source_file):
0063 chunk_list = lambda l,n: [l[i:i+n] for i in range(0, len(l), n)]
0064 rows_paths = chunk_list(paths_to_pictures,2)
0065 cell_template = ' <td style="width: 640px;"><A href=%s><IMG src="%s" width="640" align="center" border="0"></A></td>'
0066 row_template = ''' <tr>
0067 %s </tr>\n'''
0068 rows = ''.join([row_template % ''.join([ cell_template % (path,path) for path in row]) for row in rows_paths])
0069 reference = '<A href=%s>Reference</A>' % ref_file if ref_file else 'Reference not available'
0070 source = '<A href=%s>Input Source</A>' % source_file if ref_file else 'Source not available'
0071 return ''' <h3>%s ( <A href=%s>Root File</A> ) ( %s ) ( %s ) ( <A href=%s>Full Directory Content</A> )</h3>
0072 <table style="text-align: left; " border="1" cellpadding="2" cellspacing="1">
0073 <tbody>
0074 %s
0075 </tbody>
0076 </table>
0077 ''' % (dataset_name, root_link, reference, source, dir_link, rows)