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 34 of file showPage.py.

Constructor & Destructor Documentation

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

Definition at line 36 of file showPage.py.

36  def __init__(self, formatter, pickleDir, logsDir, htmlDir):
37 
38  self.formatter = formatter
39 
40  self.configuration = Configuration
41 
42  self.logsDir = logsDir
43  self.pickleDir = pickleDir
44  self.htmlDir = htmlDir
45  return
46 
def __init__(self, formatter, pickleDir, logsDir, htmlDir)
Definition: showPage.py:36

Member Function Documentation

def showPage.BuildViewer.showResults (   self)

Definition at line 49 of file showPage.py.

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

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

Member Data Documentation

showPage.BuildViewer.configuration

Definition at line 40 of file showPage.py.

Referenced by showPage.BuildViewer.showResults().

showPage.BuildViewer.formatter

Definition at line 38 of file showPage.py.

showPage.BuildViewer.htmlDir

Definition at line 44 of file showPage.py.

showPage.BuildViewer.logsDir

Definition at line 42 of file showPage.py.

Referenced by showPage.BuildViewer.showResults().

showPage.BuildViewer.pickleDir

Definition at line 43 of file showPage.py.

Referenced by showPage.BuildViewer.showResults().