CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions | Private Attributes
html.HtmlReport Class Reference

Public Member Functions

def __init__
 
def addPlots
 
def beginSample
 
def write
 

Private Attributes

 _base
 
 _currentSection
 
 _index
 
 _newBaseDir
 
 _sections
 
 _title
 

Detailed Description

Definition at line 397 of file html.py.

Constructor & Destructor Documentation

def html.HtmlReport.__init__ (   self,
  validationName,
  newBaseDir,
  baseUrl = None 
)

Definition at line 398 of file html.py.

399  def __init__(self, validationName, newBaseDir, baseUrl=None):
400  self._title = "Tracking validation "+validationName
401  self._newBaseDir = newBaseDir
402  self._base = baseUrl
404  self._index = [
405  '<html>',
406  ' <head>',
407  ' <title>%s</title>' % self._title,
408  ]
409  if self._base is not None:
410  self._index.append(' <base href="%s"/>' % self._base)
411  self._index.extend([
412  ' </head>',
413  ' <body>',
414  ])
416  self._sections = collections.OrderedDict()
def __init__
Definition: html.py:398

Member Function Documentation

def html.HtmlReport.addPlots (   self,
  args,
  kwargs 
)

Definition at line 425 of file html.py.

426  def addPlots(self, *args, **kwargs):
427  self._currentSection.addPlots(*args, **kwargs)
def addPlots
Definition: html.py:425
def html.HtmlReport.beginSample (   self,
  sample,
  fastVsFull = False 
)

Definition at line 417 of file html.py.

References Vispa.Main.SplitterTab.SplitterToolBar._sections, and html.HtmlReport._sections.

418  def beginSample(self, sample, fastVsFull=False):
419  key = (sample.digest(), fastVsFull)
420  if key in self._sections:
421  self._currentSection = self._sections[key]
422  else:
423  self._currentSection = IndexSection(sample, fastVsFull, self._title, self._base)
424  self._sections[key] = self._currentSection
def beginSample
Definition: html.py:417
def html.HtmlReport.write (   self)

Definition at line 428 of file html.py.

References SeedingNode< DATA >._index, Vispa.Share.FindAlgorithm.FindAlgorithm._index, RPCMuonExtraStruct._index, python.cmstools.EventTree._index, python.cmstools.EventBranch._index, html.HtmlReport._index, html.HtmlReport._newBaseDir, Vispa.Main.SplitterTab.SplitterToolBar._sections, and html.HtmlReport._sections.

429  def write(self):
430  # Reorder sections such that Fast vs. Full becomes just after the corresponding Fast
431  keys = self._sections.iterkeys()
432  newkeys = []
433  for key in keys:
434  if not key[1]:
435  newkeys.append(key)
436  continue
437  # is fast vs full
438  ind_fast = newkeys.index( (key[0], False) )
439  newkeys.insert(ind_fast+1, key)
440 
441  for key in newkeys:
442  section = self._sections[key]
443  self._index.extend(section.write(self._newBaseDir))
444 
445  self._index.extend([
446  " </body>",
447  "</html>",
448  ])
449 
450  f = open(os.path.join(self._newBaseDir, "index.html"), "w")
451  for line in self._index:
452  f.write(line)
453  f.write("\n")
454  f.close()

Member Data Documentation

html.HtmlReport._base
private

Definition at line 401 of file html.py.

html.HtmlReport._currentSection
private

Definition at line 420 of file html.py.

html.HtmlReport._index
private

Definition at line 403 of file html.py.

Referenced by html.HtmlReport.write().

html.HtmlReport._newBaseDir
private

Definition at line 400 of file html.py.

Referenced by validation.Validation._doPlots(), validation.Validation._doPlotsFastFull(), validation.Validation._doPlotsPileup(), validation.Validation.createHtmlReport(), and html.HtmlReport.write().

html.HtmlReport._sections
private

Definition at line 415 of file html.py.

Referenced by html.HtmlReport.beginSample(), betterConfigParser.BetterConfigParser.items(), betterConfigParser.BetterConfigParser.write(), and html.HtmlReport.write().

html.HtmlReport._title
private

Definition at line 399 of file html.py.

Referenced by plotting.Subtract.create(), plotting.FakeDuplicate.create(), and plotting.Plot.create().