-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgetOutputDir.py
39 lines (32 loc) · 1020 Bytes
/
getOutputDir.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
import sys
sys.path.append('/grid/fermiapp/products/larsoft/larbatch/v01_22_00/bin')
from project import *
def main(argv):
xmlfile=""
projectname=""
stagename=""
args = argv[1:]
while len(args) > 0:
if args[0] == '--xml' and len(args) > 1:
xmlfile = args[1]
del args[0:2]
elif args[0] == '--project' and len(args) > 1:
projectname = args[1]
del args[0:2]
elif args[0] == '--stage' and len(args) > 1:
stagename = args[1]
del args[0:2]
else:
print 'Unknown option %s' % args[0]
return 1
projects = get_projects("/sbnd/app/users/dbrailsf/mcc/scratch/prodsingle_sbnd_test.xml")
project = select_project(projects, projectname, stagename)
if project != None:
if projectname == '':
projectname = project.name
else:
raise RuntimeError, 'No project selected.\n'
stage = project.get_stage(stagename)
print stage.outdir
if __name__ == '__main__':
sys.exit(main(sys.argv))