test
CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
Classes | Functions | Variables
showPage Namespace Reference

Classes

class  BuildViewer
 

Functions

def addDash
 
def createLogFiles
 
def getIB
 
def main
 
def numberConverter
 
def run
 

Variables

string __author__ = "Aurelija"
 
string __date__ = "$2010-08-12 10.50.40$"
 

Function Documentation

def showPage.addDash (   table,
  ruleNr 
)

Definition at line 126 of file showPage.py.

Referenced by showPage.BuildViewer.showResults().

127 def addDash(table, ruleNr):
128  for index, tableRow in enumerate(table):
129  if len(tableRow)-1 != ruleNr + 1:
130  table[index] = table[index] + ('-',)
def addDash
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().

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

Referenced by showPage.BuildViewer.showResults().

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

Definition at line 205 of file showPage.py.

References run().

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

Definition at line 131 of file showPage.py.

Referenced by createLogFiles().

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

Definition at line 161 of file showPage.py.

References join().

Referenced by main().

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

Variable Documentation

string showPage.__author__ = "Aurelija"

Definition at line 3 of file showPage.py.

string showPage.__date__ = "$2010-08-12 10.50.40$"

Definition at line 4 of file showPage.py.