CMS 3D CMS Logo

Classes | Functions
o2olib Namespace Reference

Classes

class  O2OJob
 
class  O2OJobConf
 
class  O2OJobMgr
 
class  O2OMgr
 
class  O2ORun
 
class  O2ORunMgr
 
class  O2OTool
 

Functions

def get_db_credentials (db_service, authPath)
 
def print_table (headers, table)
 

Function Documentation

◆ get_db_credentials()

def o2olib.get_db_credentials (   db_service,
  authPath 
)

Definition at line 64 of file o2olib.py.

64 def get_db_credentials( db_service, authPath):
65  (username, account, pwd) = auth.get_credentials( db_service[1], authPath )
66  return username,pwd
67 

Referenced by o2olib.O2OMgr.getSession().

◆ print_table()

def o2olib.print_table (   headers,
  table 
)

Definition at line 68 of file o2olib.py.

68 def print_table( headers, table ):
69  ws = []
70  for h in headers:
71  ws.append(len(h))
72  for row in table:
73  ind = 0
74  for c in row:
75  if ind<len(ws):
76  if len(c)> ws[ind]:
77  ws[ind] = len(c)
78  ind += 1
79 
80  def printf( row ):
81  line = ''
82  ind = 0
83  for w in ws:
84  fmt = '{:<%s}' %w
85  if ind<len(ws):
86  line += (fmt.format( row[ind] )+' ')
87  ind += 1
88  print(line)
89  printf( headers )
90  hsep = ''
91  for w in ws:
92  fmt = '{:-<%s}' %w
93  hsep += (fmt.format('')+' ')
94  print(hsep)
95  for row in table:
96  printf( row )
97 

References print().

Referenced by o2olib.O2OJobMgr.listJobs().

o2olib.print_table
def print_table(headers, table)
Definition: o2olib.py:68
o2olib.get_db_credentials
def get_db_credentials(db_service, authPath)
Definition: o2olib.py:64
print
void print(TMatrixD &m, const char *label=nullptr, bool mathematicaFormat=false)
Definition: Utilities.cc:46