00043 :
00044 parser = argparse.ArgumentParser(prog=os.path.basename(sys.argv[0]),description="Lumi DB schema operations.")
00045
00046 parser.add_argument('-c',dest='connect',action='store',required=True,help='connect string to lumiDB')
00047 parser.add_argument('-P',dest='authpath',action='store',help='path to authentication file')
00048 parser.add_argument('action',choices=['create','createbranch','drop','describe','addindex','dropindex'],help='action on the schema')
00049 parser.add_argument('--verbose',dest='verbose',action='store_true',help='verbose')
00050 parser.add_argument('--debug',dest='debug',action='store_true',help='debug mode')
00051
00052 args=parser.parse_args()
00053 connectstring=args.connect
00054 if args.debug:
00055 msg=coral.MessageStream('')
00056 msg.setMsgVerbosity(coral.message_Level_Debug)
00057 svc = coral.ConnectionService()
00058 if args.authpath and len(args.authpath)!=0:
00059 os.environ['CORAL_AUTH_PATH']=args.authpath
00060 session=svc.connect(connectstring,accessMode=coral.access_Update)
00061 if args.action == 'create':
00062 createLumi(session)
00063 if args.action == 'createbranch':
00064 createBranch(session,'TRUNK',None,'root')
00065 createBranch(session,'NORM','TRUNK','hold normalization factor')
00066 createBranch(session,'DATA','TRUNK','hold data')
00067 if args.action == 'drop':
00068 dropLumi(session)
00069 if args.action == 'describe':
00070 describeLumi(session)
00071 if args.action == 'addindex':
00072 createIndex(session)
00073 if args.action == 'dropindex':
00074 dropIndex(session)
00075 if args.verbose :
print 'verbose mode'