CMS 3D CMS Logo

List of all members | Public Member Functions | Public Attributes
Formatter.SimpleHTMLFormatter Class Reference

Public Member Functions

def __del__ (self)
 
def __init__ (self, title="CMS SDT pages ", style=None, outFile=sys.stdout, scriptCode='')
 
def addScriptCode (self, scriptCode)
 
def endTable (self)
 
def headers (self)
 
def showLine (self)
 
def startTable (self, colSizes, colLabels, id=None, cls=None, tableAttr=None)
 
def trailers (self)
 
def write (self, arg="", bold=False)
 
def writeAnchor (self, ref="")
 
def writeB (self, arg="")
 
def writeBr (self)
 
def writeH1 (self, arg="")
 
def writeH2 (self, arg="")
 
def writeH3 (self, arg="")
 
def writeRow (self, args, bold=False, cls=None)
 
def writeStyledRow (self, args, styles)
 

Public Attributes

 format
 
 headersDone
 
 outFile
 
 scriptCode
 
 style
 
 title
 

Detailed Description

Definition at line 66 of file Formatter.py.

Constructor & Destructor Documentation

◆ __init__()

def Formatter.SimpleHTMLFormatter.__init__ (   self,
  title = "CMS SDT pages ",
  style = None,
  outFile = sys.stdout,
  scriptCode = '' 
)

Definition at line 68 of file Formatter.py.

68  def __init__(self, title="CMS SDT pages ", style=None, outFile=sys.stdout, scriptCode='') :
69  import time
70 
71  self.headersDone = False
72  self.title=title
73  self.style = style
74  self.scriptCode = scriptCode
75  self.outFile = outFile
76  self.format = ""
77 
78  return
79 
def __init__(self, dataset, job_number, job_id, job_name, isDA, isMC, applyBOWS, applyEXTRACOND, extraconditions, runboundary, lumilist, intlumi, maxevents, gt, allFromGT, alignmentDB, alignmentTAG, apeDB, apeTAG, bowDB, bowTAG, vertextype, tracktype, refittertype, ttrhtype, applyruncontrol, ptcut, CMSSW_dir, the_dir)

◆ __del__()

def Formatter.SimpleHTMLFormatter.__del__ (   self)

Definition at line 83 of file Formatter.py.

References Formatter.SimpleHTMLFormatter.headersDone, EcalPerEvtMatacqAnalyzer.outFile, L1TdeCSCTF.outFile, Formatter.SimpleHTMLFormatter.outFile, EcalMatacqAnalyzer.outFile, EcalTestPulseAnalyzer.outFile, ZdcTBAnalysis.outFile, Formatter.SimpleHTMLFormatter.trailers(), and Formatter.SimpleHTMLFormatter.write().

83  def __del__(self) :
84  if self.headersDone :
85  self.trailers()
86  else: # in case nothing has been written yet, output an empty page ...
87  self.outFile.write( "Content-Type: text/html" + '\n') # HTML is following
88  self.outFile.write( '\n') # blank line, end of headers
89  self.outFile.write( "<html> " + '\n')
90  self.outFile.write( "</html> " + '\n')
91 
92  return
93 

Member Function Documentation

◆ addScriptCode()

def Formatter.SimpleHTMLFormatter.addScriptCode (   self,
  scriptCode 
)

Definition at line 80 of file Formatter.py.

References Formatter.SimpleHTMLFormatter.scriptCode.

80  def addScriptCode(self, scriptCode):
81  self.scriptCode += scriptCode
82 

◆ endTable()

def Formatter.SimpleHTMLFormatter.endTable (   self)

Definition at line 188 of file Formatter.py.

References EcalPerEvtMatacqAnalyzer.outFile, L1TdeCSCTF.outFile, Formatter.SimpleHTMLFormatter.outFile, EcalMatacqAnalyzer.outFile, EcalTestPulseAnalyzer.outFile, ZdcTBAnalysis.outFile, and Formatter.SimpleHTMLFormatter.write().

188  def endTable(self) :
189  # we assume that headers are done by now !!
190  self.outFile.write( "</tbody>" + '\n')
191  self.outFile.write( "</table>" + '\n')
192 

◆ headers()

def Formatter.SimpleHTMLFormatter.headers (   self)

Definition at line 194 of file Formatter.py.

References Formatter.SimpleHTMLFormatter.headersDone, EcalPerEvtMatacqAnalyzer.outFile, L1TdeCSCTF.outFile, Formatter.SimpleHTMLFormatter.outFile, EcalMatacqAnalyzer.outFile, EcalTestPulseAnalyzer.outFile, ZdcTBAnalysis.outFile, Formatter.SimpleHTMLFormatter.scriptCode, Formatter.SimpleHTMLFormatter.style, Formatter.SimpleAsciiFormatter.title, classes.PlotData.title, EventStringOutputBranches::NamedBranchPtr.title, DB_ME.title, TriggerOutputBranches::NamedBranchPtr.title, FWTriggerTableView::Column.title, cscdqm::HistoBookRequest.title, TableOutputBranches::NamedBranchPtr.title, LumiOutputBranches::NamedBranchPtr.title, MainPageGenerator.MainPageGenerator.title, DQMGenericClient::EfficOption.title, DQMGenericClient::ProfileOption.title, dqmoffline::l1t::HistDefinition.title, SiPixelGenErrorHeader.title, Formatter.SimpleHTMLFormatter.title, python.rootplot.utilities.Hist2D.title, ecaldqm::binning::AxisSpecs.title, big::bigHeader.title, TestHits.title, TestSmoothHits.title, SiPixelTemplateHeader2D.title, HistogramManager.title, TestTrackHits.title, python.rootplot.utilities.Hist.title, Geometry.title, TkAlMap.TkAlMap.title, TrackerMap.title, SiPixelTemplateHeader.title, python.rootplot.utilities.HistStack.title, templateHelper::SiPixelTemplateHeaderInfo< PayloadType, StoreType, TransientType, myType, myParam >::header_info.title, and Formatter.SimpleHTMLFormatter.write().

Referenced by Formatter.SimpleHTMLFormatter.showLine(), Formatter.SimpleHTMLFormatter.write(), Formatter.SimpleHTMLFormatter.writeAnchor(), Formatter.SimpleHTMLFormatter.writeB(), Formatter.SimpleHTMLFormatter.writeBr(), Formatter.SimpleHTMLFormatter.writeH1(), Formatter.SimpleHTMLFormatter.writeH2(), and Formatter.SimpleHTMLFormatter.writeH3().

194  def headers(self) :
195  # make sure to write the headers only once ...
196  if not self.headersDone :
197 
198  self.outFile.write( "<html> " + '\n')
199 
200  self.outFile.write( "<head> " + '\n')
201 
202  if self.style:
203  self.outFile.write( self.style + '\n')
204 
205  self.outFile.write( "<TITLE>" + self.title + "</TITLE>" + '\n')
206  if self.scriptCode:
207  self.outFile.write( self.scriptCode + '\n' )
208  self.outFile.write( "</head> " + '\n')
209  self.outFile.write( "<body>" + '\n')
210  self.headersDone = True
211 
212  return
213 

◆ showLine()

def Formatter.SimpleHTMLFormatter.showLine (   self)

◆ startTable()

def Formatter.SimpleHTMLFormatter.startTable (   self,
  colSizes,
  colLabels,
  id = None,
  cls = None,
  tableAttr = None 
)

Definition at line 137 of file Formatter.py.

References EcalPerEvtMatacqAnalyzer.outFile, L1TdeCSCTF.outFile, Formatter.SimpleHTMLFormatter.outFile, EcalMatacqAnalyzer.outFile, EcalTestPulseAnalyzer.outFile, ZdcTBAnalysis.outFile, and Formatter.SimpleHTMLFormatter.write().

137  def startTable(self, colSizes, colLabels, id=None, cls=None, tableAttr=None) :
138  # we assume that html headers are done by now !!
139  tableString = '<table '
140  if tableAttr:
141  tableString += tableAttr
142  if id:
143  tableString += ' id="'+id+'" '
144  if cls:
145  tableString += ' class="'+cls+'" '
146  tableString += '>'
147  self.outFile.write( tableString + '\n')
148 
149  self.outFile.write( " <thead>\n <tr>" + '\n')
150  for col in colLabels :
151  self.outFile.write( " <th> <b>" + col + "</b> </th>" + '\n')
152  self.outFile.write( " </tr>\n</thead>" + '\n')
153  self.outFile.write( " <tbody>" + '\n')
154  return
155 

◆ trailers()

def Formatter.SimpleHTMLFormatter.trailers (   self)

Definition at line 215 of file Formatter.py.

References Formatter.SimpleHTMLFormatter.headersDone, EcalPerEvtMatacqAnalyzer.outFile, L1TdeCSCTF.outFile, Formatter.SimpleHTMLFormatter.outFile, EcalMatacqAnalyzer.outFile, EcalTestPulseAnalyzer.outFile, ZdcTBAnalysis.outFile, and Formatter.SimpleHTMLFormatter.write().

Referenced by Formatter.SimpleHTMLFormatter.__del__().

215  def trailers(self) :
216  # write only if headers have been written ...
217  if self.headersDone :
218  self.outFile.write( "</body>" + '\n')
219  self.outFile.write( "</html> " + '\n')
220  pass
221  return
222 
223 

◆ write()

◆ writeAnchor()

def Formatter.SimpleHTMLFormatter.writeAnchor (   self,
  ref = "" 
)

◆ writeB()

def Formatter.SimpleHTMLFormatter.writeB (   self,
  arg = "" 
)

◆ writeBr()

def Formatter.SimpleHTMLFormatter.writeBr (   self)

◆ writeH1()

def Formatter.SimpleHTMLFormatter.writeH1 (   self,
  arg = "" 
)

◆ writeH2()

def Formatter.SimpleHTMLFormatter.writeH2 (   self,
  arg = "" 
)

◆ writeH3()

def Formatter.SimpleHTMLFormatter.writeH3 (   self,
  arg = "" 
)

◆ writeRow()

def Formatter.SimpleHTMLFormatter.writeRow (   self,
  args,
  bold = False,
  cls = None 
)

Definition at line 156 of file Formatter.py.

References EcalPerEvtMatacqAnalyzer.outFile, L1TdeCSCTF.outFile, Formatter.SimpleHTMLFormatter.outFile, EcalMatacqAnalyzer.outFile, EcalTestPulseAnalyzer.outFile, ZdcTBAnalysis.outFile, str, nano_mu_digi_cff.strip, and Formatter.SimpleHTMLFormatter.write().

156  def writeRow(self, args, bold=False, cls=None) :
157  # we assume that headers are done by now !!
158 
159  if cls:
160  self.outFile.write( ' <tr class="'+cls+'"> \n')
161  else:
162  self.outFile.write( " <tr>" + '\n')
163  for arg in args:
164  if str(arg).strip() == "" : arg = "&nbsp;"
165  if bold: self.outFile.write( '<td class=cellbold> ' )
166  else: self.outFile.write( " <td> " )
167  self.outFile.write( arg )
168 
169  self.outFile.write( " </td>" + '\n')
170  self.outFile.write( " </tr> " + '\n')
171 
172  return
173 
#define str(s)

◆ writeStyledRow()

def Formatter.SimpleHTMLFormatter.writeStyledRow (   self,
  args,
  styles 
)

Definition at line 174 of file Formatter.py.

References EcalPerEvtMatacqAnalyzer.outFile, L1TdeCSCTF.outFile, Formatter.SimpleHTMLFormatter.outFile, EcalMatacqAnalyzer.outFile, EcalTestPulseAnalyzer.outFile, ZdcTBAnalysis.outFile, str, nano_mu_digi_cff.strip, Formatter.SimpleHTMLFormatter.write(), and reco.zip().

174  def writeStyledRow(self, args, styles) :
175  # we assume that headers are done by now !!
176  self.outFile.write( " <tr>" + '\n')
177  for arg, cellStyle in zip(args, styles):
178  if str(arg).strip() == "" : arg = "&nbsp;"
179  cellStyle = cellStyle.strip()
180  if cellStyle != '' : self.outFile.write( '<td class='+cellStyle+'> ' )
181  else: self.outFile.write( " <td> " )
182  self.outFile.write( arg )
183  self.outFile.write( " </td>" + '\n')
184  self.outFile.write( " </tr> " + '\n')
185 
186  return
187 
ALPAKA_FN_HOST_ACC ALPAKA_FN_INLINE constexpr float zip(ConstView const &tracks, int32_t i)
Definition: TracksSoA.h:90
#define str(s)

Member Data Documentation

◆ format

Formatter.SimpleHTMLFormatter.format

Definition at line 76 of file Formatter.py.

Referenced by progressbar.Timer.update(), and progressbar.FormatLabel.update().

◆ headersDone

Formatter.SimpleHTMLFormatter.headersDone

◆ outFile

◆ scriptCode

Formatter.SimpleHTMLFormatter.scriptCode

◆ style

Formatter.SimpleHTMLFormatter.style

Definition at line 73 of file Formatter.py.

Referenced by Formatter.SimpleHTMLFormatter.headers().

◆ title

Formatter.SimpleHTMLFormatter.title

Definition at line 72 of file Formatter.py.

Referenced by Formatter.SimpleHTMLFormatter.headers().