| # Gaudi Framework, version v21r7 |

Home |  | Generated: 22 Jan 2010

# RootMap Namespace Reference

## Functions
def | _getPath
def | _getEntry
def | _getBlock
def | _procRootMap
def | _procSysRootMap
def | _isRootMap
def | getMaps
def | _getLongestEntry
def | printMaps
def | shortPrintMaps
def | printKeys
def | checkDict

## Function Documentation

def RootMap::_getBlock | ( |  | line | ) | `[private]`

Definition at line 28 of file RootMap.py.

    00028                    :
    00029     if line.find("Begin"):
    00030         block=line.split()[-1]
    00031     return block
    00032
    00033
    def _procRootMap(rtmpfile,rtmapdict):

def RootMap::_getEntry | ( |  | line | ) | `[private]`

Definition at line 18 of file RootMap.py.

    00018                    :
    00019     ll=line.split()
    00020     entry = ll[0]
    00021     entry=entry.replace("Library.","")
    00022     entry=entry.replace(":","")
    00023     entry=entry.replace("@",":")
    00024     entry=entry.replace("-"," ")
    00025     lib = ll[1]
    00026     return entry,lib
    00027
    def _getBlock(line):

def RootMap::_getLongestEntry | ( |  | maps | ) | `[private]`

Definition at line 84 of file RootMap.py.

    00084                           :
    00085     sz = 0
    00086     for k in maps.keys():
    00087         if len(k)>sz:
    00088             sz = len(k)
    00089     return sz
    00090
    00091
    def printMaps(maps,recomp=None):

def RootMap::_getPath | ( |  | pathstring = `""` | ) | `[private]`

Definition at line 7 of file RootMap.py.

    00007                              :
    00008     pthlist = []
    00009     if pathstring == "":
    00010         if sys.platform == "linux2":
    00011             pathstring = os.environ["LD_LIBRARY_PATH"]
    00012         else:
    00013             pathstring = os.environ["PATH"]
    00014     pthlist += pathstring.split(os.pathsep)
    00015     return pthlist
    00016
    00017
    def _getEntry(line):

def RootMap::_isRootMap | ( |  | filename | ) | `[private]`

Definition at line 64 of file RootMap.py.

    00064                         :
    00065     # The file must begin with "rootmap"
    00066     if (filename.find("rootmap")==0) :
    00067         return True
    00068     return False
    00069
    def getMaps(pathstring = "",sysrtmap=False):

def RootMap::_procRootMap | ( |  | rtmpfile,
|  |  | rtmapdict |
| ) |  |  | `[private]`

Definition at line 34 of file RootMap.py.

    00034                                     :
    00035     block = ""
    00036     for line in open(rtmpfile,'r'):
    00037         line = line[:-1]
    00038         if line:
    00039             if line[0] != '#':
    00040                 entry,lib=_getEntry(line)
    00041                 if not rtmapdict.has_key(entry):
    00042                     rtmapdict[entry] = []
    00043                 rtmapdict[entry].append((os.path.join(os.path.dirname(rtmpfile),lib),block))
    00044             else:
    00045                 block=_getBlock(line)
    00046
    def _procSysRootMap(rtmapdict):

def RootMap::_procSysRootMap | ( |  | rtmapdict | ) | `[private]`

Definition at line 47 of file RootMap.py.

    00047                               :
    00048     if os.environ.has_key("ROOTSYS"):
    00049         rtmpfile = os.path.join(os.environ["ROOTSYS"],"etc","system.rootmap")
    00050         block = ""
    00051         for line in open(rtmpfile,'r'):
    00052             line = line[:-1]
    00053             if line:
    00054                 if line[0] != '#':
    00055                     entry,lib=_getEntry(line)
    00056                     if not rtmapdict.has_key(entry):
    00057                         rtmapdict[entry] = []
    00058                     rtmapdict[entry].append((os.path.join(os.environ["ROOTSYS"],"lib",lib),block))
    00059                 else:
    00060                     block=_getBlock(line)
    00061     else:
    00062         print "WARNING: No ROOTSYS defined!"
    00063
    def _isRootMap(filename):

def RootMap::checkDict | ( |  | maps,
|  |  | recomp = `None` |
| ) |  |  |

Definition at line 134 of file RootMap.py.

    00134                                :
    00135     kys = maps.keys()
    00136     kys.sort()
    00137     if recomp: kys = filter(recomp.search,kys)
    00138     for k in kys:
    00139         if len(maps[k])>1:
    00140             print "!!!!!!!!!!!! WARNING - More than one entry !!!!!!!!!!"
    00141             print k
    00142             for l in maps[k]:
    00143                 for m in l:
    00144                     print "\t%s"%m,
    00145                 print " "
    00146     return
        return

def RootMap::getMaps | ( |  | pathstring = `""`,
|  |  | sysrtmap = `False` |
| ) |  |  |

Definition at line 70 of file RootMap.py.

    00070                                            :
    00071     rtmapdict = dict()
    00072     pthlist = _getPath(pathstring)
    00073     if sysrtmap :
    00074         _procSysRootMap(rtmapdict)
    00075     for p in pthlist:
    00076         try:
    00077             for f in filter(_isRootMap,os.listdir(p)):
    00078                 rtmpfile = os.path.join(p,f)
    00079                 if (os.path.exists(rtmpfile)):
    00080                     _procRootMap(rtmpfile,rtmapdict)
    00081         except: pass
    00082     return rtmapdict
    00083
    def _getLongestEntry(maps):

def RootMap::printKeys | ( |  | maps,
|  |  | recomp = `None` |
| ) |  |  |

Definition at line 123 of file RootMap.py.

    00123                                :
    00124     kys = maps.keys()
    00125     kys.sort()
    00126     if recomp: kys = filter(recomp.search,kys)
    00127     for k in kys:
    00128         if len(maps[k])>1:
    00129             print "!!!!!!!!!!!! WARNING - More than one entry !!!!!!!!!!"
    00130         for l in maps[k]:
    00131             print k
    00132     return
    00133
    def checkDict(maps,recomp=None):

def RootMap::printMaps | ( |  | maps,
|  |  | recomp = `None` |
| ) |  |  |

Definition at line 92 of file RootMap.py.

    00092                                :
    00093     linelen = _getLongestEntry(maps)
    00094     frmat = r"%-" + str(linelen) + "s\t"
    00095     kys = maps.keys()
    00096     kys.sort()
    00097     if recomp: kys = filter(recomp.search,kys)
    00098     for k in kys:
    00099         if len(maps[k])>1:
    00100             print "!!!!!!!!!!!! WARNING - More than one entry !!!!!!!!!!"
    00101         for l in maps[k]:
    00102             print frmat%k,
    00103             for m in l:
    00104                 print m,
    00105             print " "
    00106     return
    00107
    def shortPrintMaps(maps,recomp=None):

def RootMap::shortPrintMaps | ( |  | maps,
|  |  | recomp = `None` |
| ) |  |  |

Definition at line 108 of file RootMap.py.

    00108                                     :
    00109     kys = maps.keys()
    00110     kys.sort()
    00111     if recomp: kys = filter(recomp.search,kys)
    00112     for k in kys:
    00113         if len(maps[k])>1:
    00114             print k,"!!!!!!!!!!!! WARNING - More than one entry !!!!!!!!!!"
    00115         else:
    00116             print k
    00117         for l in maps[k]:
    00118             for m in l:
    00119                 print "\t%s"%m,
    00120             print " "
    00121     return
    00122
    def printKeys(maps,recomp=None):