CMS 3D CMS Logo

Classes | Functions | Variables
showPage Namespace Reference

Classes

class  BuildViewer
 

Functions

def addDash (table, ruleNr)
 
def createLogFiles (rulesResult, logsDir, ib)
 
def getIB (pathIn)
 
def main ()
 
def numberConverter (number)
 
def run (pickleDir, logsDir, htmlDir)
 

Variables

 __author__
 
 __date__
 

Function Documentation

def showPage.addDash (   table,
  ruleNr 
)

Definition at line 126 of file showPage.py.

Referenced by showPage.BuildViewer.showResults().

126 def addDash(table, ruleNr):
127  for index, tableRow in enumerate(table):
128  if len(tableRow)-1 != ruleNr + 1:
129  table[index] = table[index] + ('-',)
130 
def addDash(table, ruleNr)
Definition: showPage.py:126
def showPage.createLogFiles (   rulesResult,
  logsDir,
  ib 
)

Definition at line 138 of file showPage.py.

References join(), numberConverter(), and cmsPerfRegress.rmtree().

Referenced by showPage.BuildViewer.showResults().

138 def createLogFiles(rulesResult, logsDir, ib):
139  logDir = join(logsDir,"logs")
140  if os.path.exists(logDir):
141  rmtree(logDir)
142  for ruleName in rulesNames:
143  try:
144  ruleResult = rulesResult[ruleName]
145  for package, packageResult in ruleResult:
146  logsDir = join(logDir, package)
147  if not os.path.exists(logsDir): os.makedirs(logsDir, 0o755)
148  file = open(join(logsDir, "log.html"), 'a')
149  file.write('Rule %s'%ruleName)
150  file.write("<br/>")
151  for path, lineNumbers in packageResult:
152  for line in lineNumbers:
153  directory = join(package, path)
154  file.write('<a href="http://cmslxr.fnal.gov/lxr/source/%s?v=%s#%s">%s:%s</a>\n'%(directory, ib, numberConverter(line), directory, line))
155  file.write("<br/>")
156  file.write('\n')
157  file.close()
158  except KeyError:
159  pass
160 
def createLogFiles(rulesResult, logsDir, ib)
Definition: showPage.py:138
def numberConverter(number)
Definition: showPage.py:131
static std::string join(char **cmd)
Definition: RemoteFile.cc:18
def showPage.getIB (   pathIn)

Definition at line 17 of file showPage.py.

References createfilelist.int, and split.

Referenced by showPage.BuildViewer.showResults().

17 def getIB(pathIn):
18 
19  ib = None
20  wkDay = None
21  dirs = os.path.abspath(pathIn).split('/')
22  for item in dirs:
23  if item.startswith('CMSSW_'):
24  ib = item
25  break
26 
27  if ib:
28  import datetime
29  fooYr, m, d, hr = ib.split('-')
30  wkDay = datetime.date( int(fooYr[-4:]), int(m), int(d) ).strftime("%a")
31 
32  return ib, wkDay
33 
def getIB(pathIn)
Definition: showPage.py:17
double split
Definition: MVATrainer.cc:139
def showPage.main ( )

Definition at line 205 of file showPage.py.

References run().

205 def main():
206 
207  parser = OptionParser()
208  parser.add_option("-l", "-L", dest="logDir", help = "creates log files to DIRECTORY", metavar = "DIRECTORY", default = os.getcwd())
209  parser.add_option("-p", "-P", dest="pickleDir", help = "reads pickle files from DIRECTORY", metavar = "DIRECTORY", default = os.getcwd())
210  parser.add_option("-c", "-C", dest="htmlDir", help = "creates cmsCRPage.html file to DIRECTORY", metavar = "DIRECTORY", default = os.getcwd())
211  (options, args) = parser.parse_args()
212 
213  logsDir = options.logDir
214  pickleDir = options.pickleDir
215  htmlDir = options.htmlDir
216 
217  if not os.path.exists(logsDir):
218  print "Error: wrong directory %s"%logsDir
219  return
220 
221  if not os.path.exists(pickleDir):
222  print "Error: wrong directory %s"%pickleDir
223  return
224 
225  if not os.path.exists(htmlDir):
226  print "Error: wrong directory %s"%htmlDir
227  return
228 
229  run(pickleDir, logsDir, htmlDir)
230 
231  return
232 
def run(pickleDir, logsDir, htmlDir)
Definition: showPage.py:161
def main()
Definition: showPage.py:205
def showPage.numberConverter (   number)

Definition at line 131 of file showPage.py.

References harvestTrackValidationPlots.str.

Referenced by createLogFiles().

131 def numberConverter(number):
132  number = str(number)
133  length = len(number)
134  if length < 3:
135  number = (3-length)*str(0) + number
136  return number
137 
def numberConverter(number)
Definition: showPage.py:131
def showPage.run (   pickleDir,
  logsDir,
  htmlDir 
)

Definition at line 161 of file showPage.py.

References join(), and harvestTrackValidationPlots.str.

Referenced by main().

161 def run(pickleDir, logsDir, htmlDir):
162  aoSorting = ""
163  for i in range(len(ordering)):
164  aoSorting += "["+ str(i+1) +",'desc'],"
165  aoSorting += "[0, 'asc']"
166 
167  style = """
168 
169  <style type="text/css" title="currentStyle">
170  @import "/SDT/html/jsExt/dataTables/media/css/demo_table.css";
171  </style>
172 
173  <script type="text/javascript" src="/SDT/html/jsExt/dataTables/media/js/jquery.js"></script>
174  <script type="text/javascript" src="/SDT/html/jsExt/dataTables/media/js/jquery.dataTables.js"></script>
175 
176  <script type="text/javascript" charset="utf-8">
177  /* Initialise the table with the required column sorting data types */
178  $(document).ready(function() {
179  $('#mainTable').dataTable( {
180  "oLanguage": {
181  "sLengthMenu": "Display _MENU_ records per page",
182  "sInfoEmpty": "Showing 0 to 0 of 0 records"
183  },
184  "aaSorting": [%s]
185  } );
186  $('#descriptionTable').dataTable( {
187  "aaSorting": [[0, 'asc']],
188  "bPaginate": false,
189  "bLengthChange": false,
190  "bFilter": false,
191  "bSort": false,
192  "bInfo": false,
193  "bAutoWidth": false
194  });
195  $('#descriptionTable thead th').css({'border-bottom': '1px solid black'});
196  } );
197  </script>
198  """%(aoSorting)
199 
200  fmtr = SimpleHTMLFormatter(title="CMSSW integration builds", style=style, outFile = open(join(htmlDir,"cmsCRPage.html"), "w"))
201 
202  bv = BuildViewer(fmtr, pickleDir, logsDir, htmlDir)
203  bv.showResults()
204 
def run(pickleDir, logsDir, htmlDir)
Definition: showPage.py:161
static std::string join(char **cmd)
Definition: RemoteFile.cc:18

Variable Documentation

showPage.__author__
private

Definition at line 3 of file showPage.py.

showPage.__date__
private

Definition at line 4 of file showPage.py.