CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros 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 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 
37  def __init__(self, formatter, pickleDir, logsDir, htmlDir):
38 
39  self.formatter = formatter
40 
41  self.configuration = Configuration
42 
43  self.logsDir = logsDir
44  self.pickleDir = pickleDir
45  self.htmlDir = htmlDir
46  return

Member Function Documentation

def showPage.BuildViewer.showResults (   self)

Definition at line 49 of file showPage.py.

References showPage.addDash(), stor::DQMEventProcessorResources::Requests.configuration, showPage.BuildViewer.configuration, showPage.createLogFiles(), showPage.getIB(), showPage.BuildViewer.logsDir, showPage.BuildViewer.pickleDir, and pickleFileParser.readPicFiles().

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

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().