CMS 3D CMS Logo

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

References PrintHLine(), PrintLine(), and ComparisonHelper.zip().

Referenced by PrescaleChecker.main().

7 
8 def PrettyPrintTable(Headers,Data,ColWidths,WarningCol=[],border='*'):
9  PrintHLine(ColWidths,border)
10  PrintLine(Headers,ColWidths,False,border)
11  PrintHLine(ColWidths,border)
12  if WarningCol==[]:
13  WarningCol=[False]*len(Data)
14  for [line,Warn] in zip(Data,WarningCol):
15  PrintLine(line,ColWidths,Warn,border)
16  PrintHLine(ColWidths,border)
OutputIterator zip(InputIterator1 first1, InputIterator1 last1, InputIterator2 first2, InputIterator2 last2, OutputIterator result, Compare comp)
def PrettyPrintTable
Definition: TablePrint.py:7
def PrintLine
Definition: TablePrint.py:26
def PrintHLine
Definition: TablePrint.py:17
def TablePrint.PrintHLine (   ColWidths,
  border 
)

Definition at line 17 of file TablePrint.py.

References sistrip::SpyUtilities.range(), and write.

Referenced by PrettyPrintTable().

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

Definition at line 26 of file TablePrint.py.

References print(), sistrip::SpyUtilities.range(), str, write, and ComparisonHelper.zip().

Referenced by PrettyPrintTable().

26 
27 def PrintLine(line,ColWidths,Warn,border):
28  assert Warn in [True,False]
29  try:
30  assert len(line)==len(ColWidths)
31  except:
32  print(line)
33  print(ColWidths)
34  raise
35  if Warn:
36  write(bcolors.FAIL)
37  for [width, entry] in zip(ColWidths,line):
38  write(border)
39  try:
40  entry = str(entry)
41  except:
42  print("\n\n\n Weird Data .. Bailing out\n\n")
43  sys.exit(0)
44  for i in range(width):
45  if i==0:
46  write(' ')
47  elif i<len(entry)+1:
48  write(entry[i-1])
49  else:
50  write(' ')
51  write(border)
52  write('\n')
53  write(bcolors.ENDC)
const uint16_t range(const Frame &aFrame)
OutputIterator zip(InputIterator1 first1, InputIterator1 last1, InputIterator2 first2, InputIterator2 last2, OutputIterator result, Compare comp)
void print(TMatrixD &m, const char *label=nullptr, bool mathematicaFormat=false)
Definition: Utilities.cc:47
def PrintLine
Definition: TablePrint.py:26
#define str(s)

Variable Documentation

TablePrint.write = sys.stdout.write

Definition at line 5 of file TablePrint.py.

Referenced by DTCompactMapWriter.buildSteering(), evf::EvFDaqDirector.contactFileBroker(), RawEventFileWriterForBU.doOutputEvent(), ExternalLHEProducer.executeScript(), DTCompactMapWriter.fillReadOutMap(), MuScleFitFilter.filter(), RawEventFileWriterForBU.finishFileWrite(), FWPartialConfigSaveGUI.FWPartialConfigSaveGUI(), evf::EvFDaqDirector.grabNextJsonFile(), evf::EvFDaqDirector.grabNextJsonFromRaw(), produceOfflineValidationTex.main(), gen::Py8InterfaceBase.makeTmpSLHA(), AlignmentIORootBase.openRoot(), PrintHLine(), PrintLine(), BPHWriteSpecificDecay.produce(), CaloGeometryDBEP< T, U >.produceAligned(), gen::Py8InterfaceBase.Py8InterfaceBase(), l1t::MicroGMTLUT.save(), DTCtcp.Send(), gen::Pythia6Service.setSLHAFromHeader(), edm::shared_memory::WorkerMonitorThread.sig_handler(), edm::shared_memory::WorkerMonitorThread.stop(), edm::storage::File.syswrite(), edm::service::CondorStatusService.updateImpl(), TriggerAnalyzer.write(), createJobs.writeAlignCfg(), TStorageFactoryFile.WriteBuffer(), createJobs.writeGatherCfg(), and createJobs.writeValidationCfg().