1 |
#!/usr/bin/env python
|
2 |
|
3 |
import sys, os, commands,string, re
|
4 |
import exceptions
|
5 |
|
6 |
try:
|
7 |
import xml.dom.ext.reader
|
8 |
except:
|
9 |
print "\t PyXML not found: ready to install..."
|
10 |
crabdir=os.getenv('CRABDIR')
|
11 |
## Let the user set up PyXML by hand
|
12 |
#msg="Need to setup the PyXML python module. Do the following:\n"
|
13 |
#msg+=" cd %s/DLSAPI\n"%crabdir
|
14 |
#msg+=" ./InstallPyXML.sh"
|
15 |
#print msg
|
16 |
## set up PyXML automatically
|
17 |
cmd='cd %s/DLSAPI;\n ./InstallPyXML.sh'%crabdir
|
18 |
ecode = os.system(cmd)
|
19 |
if ecode!=0:
|
20 |
msg="\t Failed running : %s"%cmd
|
21 |
raise Exception(msg)
|
22 |
else:
|
23 |
print "\t Updating PYTHONPATH"
|
24 |
libPath="%s/DLSAPI"%crabdir
|
25 |
sys.path.append(libPath)
|
26 |
|
27 |
sys.exit(0)
|