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, authFile)
 
def print_table (headers, table)
 

Function Documentation

def o2olib.get_db_credentials (   db_service,
  authFile 
)

Definition at line 64 of file o2olib.py.

Referenced by o2olib.O2OMgr.getSession().

64 def get_db_credentials( db_service, authFile ):
65  (username, account, pwd) = auth.get_credentials( authPathEnvVar, db_service[1], authFile )
66  return username,pwd
67 
def get_db_credentials(db_service, authFile)
Definition: o2olib.py:64
def o2olib.print_table (   headers,
  table 
)

Definition at line 68 of file o2olib.py.

Referenced by o2olib.O2OJobMgr.listJobs().

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 
def print_table(headers, table)
Definition: o2olib.py:68