CMS 3D CMS Logo

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

Functions

def main
 

Variables

string __author__ = 'Giacomo Govi'
 

Function Documentation

def o2oRun.main (   argv)

Definition at line 12 of file o2oRun.py.

12 
13 def main( argv ):
14 
15  parser = argparse.ArgumentParser()
16  parser.add_argument("executable", type=str, help="wrapper for O2O jobs")
17  parser.add_argument("-n","--name", type=str, help="the O2O job name" )
18  parser.add_argument("-d","--dev", action="store_true", help="bookkeeping in dev database")
19  parser.add_argument("-p","--private", action="store_true", help="bookkeeping in private database")
20  parser.add_argument("-a","--auth", type=str, help="path of the authentication file")
21  args = parser.parse_args()
22 
23  if not args.name:
24  parser.error("Job name not given.")
25 
26  command = args.executable
27 
28  db_service = None
29  if not args.private:
30  if args.dev:
31  db_service = o2olib.dev_db_service
32  else:
33  db_service = o2olib.prod_db_service
34  runMgr = o2olib.O2ORunMgr()
35  ret = -1
36  if runMgr.connect( db_service, args.auth ):
37  ret = runMgr.executeJob( args.name, command )
38  return ret
def main
Definition: o2oRun.py:12

Variable Documentation

string o2oRun.__author__ = 'Giacomo Govi'

Definition at line 5 of file o2oRun.py.