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