CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups 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 128 of file showPage.py.

Referenced by showPage.BuildViewer.showResults().

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

Definition at line 140 of file showPage.py.

References join(), and numberConverter().

Referenced by showPage.BuildViewer.showResults().

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

Definition at line 19 of file showPage.py.

References submitPVValidationJobs.split().

Referenced by showPage.BuildViewer.showResults().

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

Definition at line 207 of file showPage.py.

References print(), and run().

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

Definition at line 133 of file showPage.py.

References str.

Referenced by createLogFiles().

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

Definition at line 163 of file showPage.py.

References join(), sistrip::SpyUtilities.range(), and str.

Referenced by main().

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

Variable Documentation

string showPage.__author__ = "Aurelija"

Definition at line 5 of file showPage.py.

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

Definition at line 6 of file showPage.py.