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 addNote
 
def addPlots
 
def addTable
 
def beginSample
 
def write
 

Private Attributes

 _currentSection
 
 _index
 
 _newBaseDir
 
 _sections
 
 _title
 

Detailed Description

Definition at line 624 of file html.py.

Constructor & Destructor Documentation

def html.HtmlReport.__init__ (   self,
  validationName,
  newBaseDir 
)

Definition at line 625 of file html.py.

626  def __init__(self, validationName, newBaseDir):
627  self._title = "Tracking validation "+validationName
628  self._newBaseDir = newBaseDir
630  self._index = [
631  '<html>',
632  ' <head>',
633  ' <title>%s</title>' % self._title,
634  ' </head>',
635  ' <body>',
636  ]
638  self._sections = collections.OrderedDict()
def __init__
Definition: html.py:625

Member Function Documentation

def html.HtmlReport.addNote (   self,
  note 
)

Definition at line 639 of file html.py.

640  def addNote(self, note):
641  self._index.append(' <p>%s</p>'%note)
def addNote
Definition: html.py:639
def html.HtmlReport.addPlots (   self,
  args,
  kwargs 
)

Definition at line 650 of file html.py.

651  def addPlots(self, *args, **kwargs):
652  self._currentSection.addPlots(*args, **kwargs)
def addPlots
Definition: html.py:650
def html.HtmlReport.addTable (   self,
  args,
  kwargs 
)

Definition at line 653 of file html.py.

654  def addTable(self, *args, **kwargs):
655  self._currentSection.addTable(*args, **kwargs)
def addTable
Definition: html.py:653
def html.HtmlReport.beginSample (   self,
  sample,
  fastVsFull = False 
)

Definition at line 642 of file html.py.

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

643  def beginSample(self, sample, fastVsFull=False):
644  key = (sample.digest(), fastVsFull)
645  if key in self._sections:
646  self._currentSection = self._sections[key]
647  else:
648  self._currentSection = IndexSection(sample, fastVsFull, self._title)
649  self._sections[key] = self._currentSection
def beginSample
Definition: html.py:642
def html.HtmlReport.write (   self)

Definition at line 656 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.

657  def write(self):
658  # Reorder sections such that Fast vs. Full becomes just after the corresponding Fast
659  keys = self._sections.iterkeys()
660  newkeys = []
661  for key in keys:
662  if not key[1]:
663  newkeys.append(key)
664  continue
665  # is fast vs full
666  ind_fast = newkeys.index( (key[0], False) )
667  newkeys.insert(ind_fast+1, key)
668 
669  for key in newkeys:
670  section = self._sections[key]
671  self._index.extend(section.write(self._newBaseDir))
672 
673  self._index.extend([
674  " </body>",
675  "</html>",
676  ])
677 
678  f = open(os.path.join(self._newBaseDir, "index.html"), "w")
679  for line in self._index:
680  f.write(line)
681  f.write("\n")
682  f.close()

Member Data Documentation

html.HtmlReport._currentSection
private

Definition at line 645 of file html.py.

html.HtmlReport._index
private

Definition at line 629 of file html.py.

Referenced by html.HtmlReport.write().

html.HtmlReport._newBaseDir
private

Definition at line 627 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 637 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 626 of file html.py.

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