CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
List of all members | Public Member Functions | Public Attributes
showPage.BuildViewer Class Reference
Inheritance diagram for showPage.BuildViewer:

Public Member Functions

def __init__
 
def showResults
 

Public Attributes

 configuration
 
 formatter
 
 htmlDir
 
 logsDir
 
 pickleDir
 

Detailed Description

Definition at line 36 of file showPage.py.

Constructor & Destructor Documentation

def showPage.BuildViewer.__init__ (   self,
  formatter,
  pickleDir,
  logsDir,
  htmlDir 
)

Definition at line 38 of file showPage.py.

38 
39  def __init__(self, formatter, pickleDir, logsDir, htmlDir):
40 
41  self.formatter = formatter
42 
43  self.configuration = Configuration
44 
45  self.logsDir = logsDir
46  self.pickleDir = pickleDir
47  self.htmlDir = htmlDir
48  return

Member Function Documentation

def showPage.BuildViewer.showResults (   self)

Definition at line 51 of file showPage.py.

References showPage.addDash(), showPage.BuildViewer.configuration, o2olib.O2OJobConf.configuration, CTPPSPixelDAQMappingESSourceXML.configuration, TotemDAQMappingESSourceXML.configuration, JsonOutputProducer.configuration, showPage.createLogFiles(), showPage.getIB(), showPage.BuildViewer.logsDir, showPage.BuildViewer.pickleDir, sistrip::SpyUtilities.range(), pickleFileParser.readPicFiles(), and str.

51 
52  def showResults(self):
53 
54  ib, wkDay = getIB(checkPath)
55 
56  rulesResults = readPicFiles(self.pickleDir, True)
57  createLogFiles(rulesResults, self.logsDir, ib)
58 
59  self.formatter.writeAnchor(ref='top')
60  self.formatter.writeH2("CMSSW code rules violation for "+ib)
61 
62  self.formatter.startTable([20,20,20,20,50],
63 ['Rule','Packages', 'Files','Sum of violations','Description'], id =
64 'descriptionTable', tableAttr='border="0" cellspacing="5" cellpadding="5"')
65 
66  for ruleName in rulesNames:
67  try:
68  ruleRes = rulesResults[ruleName]
69  totalViolations = 0
70  totalFiles = 0
71  for package, packageResult in ruleRes:
72  totalFiles += len(packageResult)
73  for file, lines in packageResult:
74  totalViolations += len(lines)
75  self.formatter.writeRow([ruleName,str(len(ruleRes)),
76 str(totalFiles), str(totalViolations),
77 self.configuration[ruleName]['description']])
78  except KeyError:
79  self.formatter.writeRow([ruleName,'-', '-', '-',
80 self.configuration[ruleName]['description']])
81  self.formatter.endTable()
82 
83  msg = """
84 <p>
85 Click on the package links to get list of files
86 </p>
87 
88 """
89  self.formatter.write(msg)
90 
91  colFmt = [ 50 ]
92  colLab = ['Package']
93 
94  rules = ordering
95  for rule in rules:
96  colFmt.append(20)
97  colLab.append('Rule %s' %rule)
98 
99  self.formatter.startTable(colFmt, colLab, id = 'mainTable', cls='display', tableAttr='border="0" cellspacing="5" cellpadding="5"')
100 
101  packages = []
102  table = []
103  tableRow = len(colLab)*tuple('')
104  ruleNr = 0
105  for ruleName in rules:
106  try:
107  ruleResult = rulesResults[ruleName]
108  for package, packageResult in ruleResult:
109  try:
110  index = packages.index(package)
111  tableRow = table[index] +(str(len(packageResult)),)
112  table[index] = tableRow
113  except ValueError:
114  packages.append(package)
115  tableRow = ('<a href="logs/'+package+'/log.html"/>'+package,) + tuple('-' for i in range(ruleNr)) + (str(len(packageResult)),) #
116  table.append(tableRow)
117  addDash(table, ruleNr)
118  except KeyError:
119  addDash(table, ruleNr)
120  ruleNr += 1
121 
122  for row in table:
123  self.formatter.writeRow(row)
124 
125  self.formatter.endTable()
126 
127  return
def addDash
Definition: showPage.py:128
const uint16_t range(const Frame &aFrame)
def createLogFiles
Definition: showPage.py:140
def getIB
Definition: showPage.py:19
#define str(s)

Member Data Documentation

showPage.BuildViewer.configuration

Definition at line 42 of file showPage.py.

Referenced by showPage.BuildViewer.showResults().

showPage.BuildViewer.formatter

Definition at line 40 of file showPage.py.

showPage.BuildViewer.htmlDir

Definition at line 46 of file showPage.py.

showPage.BuildViewer.logsDir

Definition at line 44 of file showPage.py.

Referenced by showPage.BuildViewer.showResults().

showPage.BuildViewer.pickleDir

Definition at line 45 of file showPage.py.

Referenced by showPage.BuildViewer.showResults().