| # Gaudi Framework, version v22r2 |

Home |  | Generated: Tue May 10 2011

Functions

# 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.

    00029                    :
    00030     if line.find("Begin"):
    00031         block=line.split()[-1]
    00032     return block
    00033

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

Definition at line 18 of file RootMap.py.

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

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

Definition at line 84 of file RootMap.py.

    00085                           :
    00086     sz = 0
    00087     for k in maps.keys():
    00088         if len(k)>sz:
    00089             sz = len(k)
    00090     return sz
    00091

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

Definition at line 7 of file RootMap.py.

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

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

Definition at line 64 of file RootMap.py.

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

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

Definition at line 34 of file RootMap.py.

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

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

Definition at line 47 of file RootMap.py.

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

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

Definition at line 134 of file RootMap.py.

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

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

Definition at line 70 of file RootMap.py.

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

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

Definition at line 123 of file RootMap.py.

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

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

Definition at line 92 of file RootMap.py.

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

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

Definition at line 108 of file RootMap.py.

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

All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Defines