ViewVC Help
View File | Revision Log | Show Annotations | Root Listing
root/cvsroot/COMP/CRAB/python/DLSInfo.py
(Generate patch)

Comparing COMP/CRAB/python/DLSInfo.py (file contents):
Revision 1.6 by afanfani, Thu May 18 18:46:22 2006 UTC vs.
Revision 1.8 by afanfani, Tue May 30 23:33:58 2006 UTC

# Line 5 | Line 5 | from crab_exceptions import *
5   from crab_util import *
6   import common
7  
8 < import dlsApi
9 < import dlsClient
10 < from dlsDataObjects import DlsLocation, DlsFileBlock, DlsEntry
8 > try:
9 >    import dlsApi
10 >    import dlsClient
11 >    from dlsDataObjects import DlsLocation, DlsFileBlock, DlsEntry
12 > except:
13 >    try:
14 >        Crabpydir=commands.getoutput('which crab')
15 >        Topdir=string.replace(Crabpydir,'/python/crab','')
16 >        sys.path.append(Topdir+'/DLSAPI')
17 >        import dlsApi
18 >        import dlsClient
19 >        from dlsDataObjects import DlsLocation, DlsFileBlock, DlsEntry
20 >    except:
21 >        msg="ERROR no DLS API available"
22 >        raise CrabException(msg)
23 >                                                                                            
24 > ## for python 2.2 add the pyexpat.so to PYTHONPATH
25 > pythonV=sys.version.split(' ')[0]
26 > if pythonV.find('2.2') >= 0 :
27 > Crabpydir=commands.getoutput('which crab')
28 > Topdir=string.replace(Crabpydir,'/python/crab','')
29 > extradir=Topdir+'/DLSAPI/extra'
30 > if sys.path.count(extradir) <= 0:
31 >   if os.path.exists(extradir):
32 >    sys.path.insert(0, extradir)
33  
34  
35   class DLSError:
# Line 44 | Line 66 | class DLSInfo:
66             except:
67               crabdir=os.getenv('CRABDIR')
68   ## Let the user set up PyXML by hand
69 <             msg="Need to setup the PyXML python module. Do the following:\n"
70 <             msg+="  cd %s/DLSAPI\n"%crabdir
71 <             msg+="  ./InstallPyXML.sh"
69 >             msg="There is no setup of PyXML python module required by DLS (DLI). Do the following:\n"
70 >             msg+=" - check that in  %s/configure  the function configureDLSAPI is not commented \n"%crabdir
71 >             msg+=" - uncomment it and re-run the configuration :"
72 >             msg+="\n    cd %s\n"%crabdir
73 >             msg+="     ./configure\n"
74 >             msg+="     source crab.(c)sh\n"
75               raise CrabException(msg)
76  
77          elif type=="DLS_TYPE_MYSQL":

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines