CMS 3D CMS Logo

List of all members | Public Member Functions | Public Attributes
showPage.BuildViewer Class Reference
Inheritance diagram for showPage.BuildViewer:

Public Member Functions

def __init__ (self, formatter, pickleDir, logsDir, htmlDir)
 
def showResults (self)
 

Public Attributes

 configuration
 
 formatter
 
 htmlDir
 
 logsDir
 
 pickleDir
 

Detailed Description

Definition at line 36 of file showPage.py.

Constructor & Destructor Documentation

◆ __init__()

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

Definition at line 38 of file showPage.py.

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

Member Function Documentation

◆ showResults()

def showPage.BuildViewer.showResults (   self)

Definition at line 51 of file showPage.py.

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

References showPage.addDash(), showPage.BuildViewer.configuration, CTPPSPixelDAQMappingESSourceXML.configuration, TotemDAQMappingESSourceXML.configuration, JsonOutputProducer.configuration, showPage.createLogFiles(), showPage.BuildViewer.formatter, showPage.getIB(), showPage.BuildViewer.logsDir, showPage.BuildViewer.pickleDir, FastTimerService_cff.range, pickleFileParser.readPicFiles(), str, and writeEcalDQMStatus.write.

Member Data Documentation

◆ configuration

showPage.BuildViewer.configuration

Definition at line 42 of file showPage.py.

Referenced by showPage.BuildViewer.showResults().

◆ formatter

showPage.BuildViewer.formatter

Definition at line 40 of file showPage.py.

Referenced by showPage.BuildViewer.showResults().

◆ htmlDir

showPage.BuildViewer.htmlDir

Definition at line 46 of file showPage.py.

◆ logsDir

showPage.BuildViewer.logsDir

Definition at line 44 of file showPage.py.

Referenced by showPage.BuildViewer.showResults().

◆ pickleDir

showPage.BuildViewer.pickleDir

Definition at line 45 of file showPage.py.

Referenced by showPage.BuildViewer.showResults().

FastTimerService_cff.range
range
Definition: FastTimerService_cff.py:34
showPage.createLogFiles
def createLogFiles(rulesResult, logsDir, ib)
Definition: showPage.py:140
str
#define str(s)
Definition: TestProcessor.cc:53
writeEcalDQMStatus.write
write
Definition: writeEcalDQMStatus.py:48
pickleFileParser.readPicFiles
def readPicFiles(directory, toSplit=False)
Definition: pickleFileParser.py:16
showPage.getIB
def getIB(pathIn)
Definition: showPage.py:19
showPage.addDash
def addDash(table, ruleNr)
Definition: showPage.py:128