Public Member Functions | |
def | __init__ |
def | showResults |
Public Attributes | |
configuration | |
formatter | |
htmlDir | |
logsDir | |
pickleDir |
Definition at line 34 of file showPage.py.
def showPage::BuildViewer::__init__ | ( | self, | |
formatter, | |||
pickleDir, | |||
logsDir, | |||
htmlDir | |||
) |
Definition at line 36 of file showPage.py.
def showPage::BuildViewer::showResults | ( | self | ) |
Definition at line 49 of file showPage.py.
00050 : 00051 00052 ib, wkDay = getIB(checkPath) 00053 00054 rulesResults = readPicFiles(self.pickleDir, True) 00055 createLogFiles(rulesResults, self.logsDir, wkDay) 00056 00057 self.formatter.writeAnchor(ref='top') 00058 self.formatter.writeH2("CMSSW code rules violation for "+ib) 00059 00060 self.formatter.startTable([20,20,20,20,50], 00061 ['Rule','Packages', 'Files','Sum of violations','Description'], id = 00062 'descriptionTable', tableAttr='border="0" cellspacing="5" cellpadding="5"') 00063 00064 for ruleName in rulesNames: 00065 try: 00066 ruleRes = rulesResults[ruleName] 00067 totalViolations = 0 00068 totalFiles = 0 00069 for package, packageResult in ruleRes: 00070 totalFiles += len(packageResult) 00071 for file, lines in packageResult: 00072 totalViolations += len(lines) 00073 self.formatter.writeRow([ruleName,str(len(ruleRes)), 00074 str(totalFiles), str(totalViolations), 00075 self.configuration[ruleName]['description']]) 00076 except KeyError: 00077 self.formatter.writeRow([ruleName,'-', '-', '-', 00078 self.configuration[ruleName]['description']]) 00079 self.formatter.endTable() 00080 00081 msg = """ 00082 <p> 00083 Click on the package links to get list of files 00084 </p> 00085 00086 """ 00087 self.formatter.write(msg) 00088 00089 colFmt = [ 50 ] 00090 colLab = ['Package'] 00091 00092 rules = ordering 00093 for rule in rules: 00094 colFmt.append(20) 00095 colLab.append('Rule %s' %rule) 00096 00097 self.formatter.startTable(colFmt, colLab, id = 'mainTable', cls='display', tableAttr='border="0" cellspacing="5" cellpadding="5"') 00098 00099 packages = [] 00100 table = [] 00101 tableRow = len(colLab)*tuple('') 00102 ruleNr = 0 00103 for ruleName in rules: 00104 try: 00105 ruleResult = rulesResults[ruleName] 00106 for package, packageResult in ruleResult: 00107 try: 00108 index = packages.index(package) 00109 tableRow = table[index] +(str(len(packageResult)),) 00110 table[index] = tableRow 00111 except ValueError: 00112 packages.append(package) 00113 tableRow = ('<a href="logs/'+package+'/log.html"/>'+package,) + tuple('-' for i in range(ruleNr)) + (str(len(packageResult)),) # 00114 table.append(tableRow) 00115 addDash(table, ruleNr) 00116 except KeyError: 00117 addDash(table, ruleNr) 00118 ruleNr += 1 00119 00120 for row in table: 00121 self.formatter.writeRow(row) 00122 00123 self.formatter.endTable() 00124 00125 return
Definition at line 36 of file showPage.py.
Definition at line 36 of file showPage.py.
Definition at line 36 of file showPage.py.
Definition at line 36 of file showPage.py.
Definition at line 36 of file showPage.py.