CMS 3D CMS Logo

Functions
TablePrint Namespace Reference

Functions

def PrettyPrintTable (Headers, Data, ColWidths, WarningCol=[], border='*')
 
def PrintHLine (ColWidths, border)
 
def PrintLine (line, ColWidths, Warn, border)
 

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

Definition at line 17 of file TablePrint.py.

References TriggerAnalyzer.write().

Referenced by PrettyPrintTable().

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

Definition at line 26 of file TablePrint.py.

References edm.print(), str, TriggerAnalyzer.write(), and ComparisonHelper.zip().

Referenced by PrettyPrintTable().

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