CMS 3D CMS Logo

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

Functions

def PrettyPrintTable
 
def PrintHLine
 
def PrintLine
 

Variables

 write = sys.stdout.write
 

Function Documentation

def TablePrint.PrettyPrintTable (   Headers,
  Data,
  ColWidths,
  WarningCol = [],
  border = '*' 
)

Definition at line 5 of file TablePrint.py.

References PrintHLine(), and PrintLine().

Referenced by PrescaleChecker.main().

5 
6 def PrettyPrintTable(Headers,Data,ColWidths,WarningCol=[],border='*'):
7  PrintHLine(ColWidths,border)
8  PrintLine(Headers,ColWidths,False,border)
9  PrintHLine(ColWidths,border)
10  if WarningCol==[]:
11  WarningCol=[False]*len(Data)
12  for [line,Warn] in zip(Data,WarningCol):
13  PrintLine(line,ColWidths,Warn,border)
14  PrintHLine(ColWidths,border)
def PrettyPrintTable
Definition: TablePrint.py:5
def PrintLine
Definition: TablePrint.py:24
def PrintHLine
Definition: TablePrint.py:15
def TablePrint.PrintHLine (   ColWidths,
  border 
)

Definition at line 15 of file TablePrint.py.

References write.

Referenced by PrettyPrintTable().

15 
16 def PrintHLine(ColWidths,border): ## writes a horizontal line of the right width
17  #write = sys.stdout.write
18  for entry in ColWidths:
19  write(border)
20  for i in range(entry):
21  write(border)
22  write(border)
23  write('\n')
def PrintHLine
Definition: TablePrint.py:15
def TablePrint.PrintLine (   line,
  ColWidths,
  Warn,
  border 
)

Definition at line 24 of file TablePrint.py.

References write.

Referenced by PrettyPrintTable().

24 
25 def PrintLine(line,ColWidths,Warn,border):
26  assert Warn in [True,False]
27  try:
28  assert len(line)==len(ColWidths)
29  except:
30  print line
31  print ColWidths
32  raise
33  if Warn:
34  write(bcolors.FAIL)
35  for [width, entry] in zip(ColWidths,line):
36  write(border)
37  try:
38  entry = str(entry)
39  except:
40  print "\n\n\n Weird Data .. Bailing out\n\n"
41  sys.exit(0)
42  for i in range(width):
43  if i==0:
44  write(' ')
45  elif i<len(entry)+1:
46  write(entry[i-1])
47  else:
48  write(' ')
49  write(border)
50  write('\n')
51  write(bcolors.ENDC)
def PrintLine
Definition: TablePrint.py:24

Variable Documentation

TablePrint.write = sys.stdout.write

Definition at line 3 of file TablePrint.py.

Referenced by CollectionDumper< T >.analyze(), DTCompactMapWriter.buildSteering(), HcalLutManager.create_lut_loader(), HcalLutManager.createAllLutXmlFiles(), HcalLutManager.createAllLutXmlFilesFromCoder(), HcalLutManager.createAllLutXmlFilesLinAsciiCompCoder(), HcalLutManager.createCompLutXmlFilesFromCoder(), HcalLutManager.createLinLutXmlFiles(), DBlmapWriter.createLMap(), HcalLutManager.createLutXmlFiles_HBEFFromCoder_HOFromAscii(), HcalLutManager.createLutXmlFiles_HBEFFromCoder_HOFromAscii_ZDC(), SimpleProfiler.doWrite(), ExternalLHEProducer.executeScript(), DTCompactMapWriter.fillReadOutMap(), MuScleFitFilter.filter(), spf::SherpackFetcher.FnFileGet(), HcalLutManager.get_xml_files_from_db(), CrabTask.CrabTask.initializeTask(), CmsswTask.CmsswTask.initTask(), HcalChannelQualityXml.makeXmlFromAsciiStream(), AlignmentIORootBase.openRoot(), PrintHLine(), PrintLine(), BoostedTopProducer.produce(), CaloGeometryDBEP< T, U >.produceAligned(), edm::multicore::MessageReceiverForSource.receive(), evf::FUEventProcessor.receivingAndMonitor(), DTCtcp.Send(), XMLDOMBlock.write(), createJobs.writeAlignCfg(), tools.writeCfg(), createJobs.writeGatherCfg(), MillePedeVariablesIORoot.writeMillePedeVariables(), and createJobs.writeValidationCfg().