| The Gaudi Framework v27r1

- Main Page
- Related Pages
- Modules
- Namespaces
- Classes
- Files

- Namespace List
- Namespace Members

Functions
GaudiKernel.RootMap Namespace Reference

## Functions
def | _getPath
def | _getEntry (line)
def | _getBlock (line)
def | _procRootMap (rtmpfile, rtmapdict)
def | _procSysRootMap (rtmapdict)
def | _isRootMap (filename)
def | getMaps
def | _getLongestEntry (maps)
def | printMaps
def | shortPrintMaps
def | printKeys
def | checkDict

## Function Documentation

def GaudiKernel.RootMap._getBlock | ( |  | line | ) |
| private

Definition at line 28 of file RootMap.py.

28 def _getBlock(line):
29 if line.find("Begin"):
30 block=line.split()[-1]
31 return block
32
33
GaudiKernel.RootMap._getBlock
def _getBlock(line)
Definition: RootMap.py:28

def GaudiKernel.RootMap._getEntry | ( |  | line | ) |
| private

Definition at line 18 of file RootMap.py.

18 def _getEntry(line):
19 ll=line.split()
20 entry = ll[0]
21 entry=entry.replace("Library.","")
22 entry=entry.replace(":","")
23 entry=entry.replace("@",":")
24 entry=entry.replace("-"," ")
25 lib = ll[1]
26 return entry,lib
27
GaudiKernel.RootMap._getEntry
def _getEntry(line)
Definition: RootMap.py:18

def GaudiKernel.RootMap._getLongestEntry | ( |  | maps | ) |
| private

Definition at line 84 of file RootMap.py.

84 def _getLongestEntry(maps):
85 sz = 0
86 for k in maps.keys():
87 if len(k)>sz:
88 sz = len(k)
89 return sz
90
91
GaudiKernel.RootMap._getLongestEntry
def _getLongestEntry(maps)
Definition: RootMap.py:84

def GaudiKernel.RootMap._getPath | ( |  | pathstring = `""` | ) |
| private

Definition at line 7 of file RootMap.py.

7 def _getPath(pathstring = ""):
8 pthlist = []
9 if pathstring == "":
10 if sys.platform == "linux2":
11 pathstring = os.environ["LD_LIBRARY_PATH"]
12 else:
13 pathstring = os.environ["PATH"]
14 pthlist += pathstring.split(os.pathsep)
15 return pthlist
16
17
GaudiKernel.RootMap._getPath
def _getPath
Definition: RootMap.py:7

def GaudiKernel.RootMap._isRootMap | ( |  | filename | ) |
| private

Definition at line 64 of file RootMap.py.

64 def _isRootMap(filename):
65 # The file must begin with "rootmap"
66 if (filename.find("rootmap")==0) :
67 return True
68 return False
69
GaudiKernel.RootMap._isRootMap
def _isRootMap(filename)
Definition: RootMap.py:64

def GaudiKernel.RootMap._procRootMap | ( |  | rtmpfile,
|  |  | rtmapdict
| ) |  |
| private

Definition at line 34 of file RootMap.py.

34 def _procRootMap(rtmpfile,rtmapdict):
35 block = ""
36 for line in open(rtmpfile,'r'):
37 line = line[:-1]
38 if line:
39 if line[0] != '#':
40 entry,lib=_getEntry(line)
41 if not rtmapdict.has_key(entry):
42 rtmapdict[entry] = []
43 rtmapdict[entry].append((os.path.join(os.path.dirname(rtmpfile),lib),block))
44 else:
45 block=_getBlock(line)
46
GaudiKernel.RootMap._getEntry
def _getEntry(line)
Definition: RootMap.py:18
GaudiKernel.RootMap._getBlock
def _getBlock(line)
Definition: RootMap.py:28
GaudiKernel.RootMap._procRootMap
def _procRootMap(rtmpfile, rtmapdict)
Definition: RootMap.py:34

def GaudiKernel.RootMap._procSysRootMap | ( |  | rtmapdict | ) |
| private

Definition at line 47 of file RootMap.py.

47 def _procSysRootMap(rtmapdict):
48 if os.environ.has_key("ROOTSYS"):
49 rtmpfile = os.path.join(os.environ["ROOTSYS"],"etc","system.rootmap")
50 block = ""
51 for line in open(rtmpfile,'r'):
52 line = line[:-1]
53 if line:
54 if line[0] != '#':
55 entry,lib=_getEntry(line)
56 if not rtmapdict.has_key(entry):
57 rtmapdict[entry] = []
58 rtmapdict[entry].append((os.path.join(os.environ["ROOTSYS"],"lib",lib),block))
59 else:
60 block=_getBlock(line)
61 else:
62 print "WARNING: No ROOTSYS defined!"
63
GaudiKernel.RootMap._getEntry
def _getEntry(line)
Definition: RootMap.py:18
GaudiKernel.RootMap._getBlock
def _getBlock(line)
Definition: RootMap.py:28
GaudiKernel.RootMap._procSysRootMap
def _procSysRootMap(rtmapdict)
Definition: RootMap.py:47

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

Definition at line 134 of file RootMap.py.

134 def checkDict(maps,recomp=None):
135 kys = maps.keys()
136 kys.sort()
137 if recomp: kys = filter(recomp.search,kys)
138 for k in kys:
139 if len(maps[k])>1:
140 print "!!!!!!!!!!!! WARNING - More than one entry !!!!!!!!!!"
141 print k
142 for l in maps[k]:
143 for m in l:
144 print "\t%s"%m,
145 print " "
146 return
147
GaudiKernel.RootMap.checkDict
def checkDict
Definition: RootMap.py:134

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

Definition at line 70 of file RootMap.py.

70 def getMaps(pathstring = "",sysrtmap=False):
71 rtmapdict = dict()
72 pthlist = _getPath(pathstring)
73 if sysrtmap :
74 _procSysRootMap(rtmapdict)
75 for p in pthlist:
76 try:
77 for f in filter(_isRootMap,os.listdir(p)):
78 rtmpfile = os.path.join(p,f)
79 if (os.path.exists(rtmpfile)):
80 _procRootMap(rtmpfile,rtmapdict)
81 except: pass
82 return rtmapdict
83
GaudiKernel.RootMap._getPath
def _getPath
Definition: RootMap.py:7
GaudiKernel.RootMap.getMaps
def getMaps
Definition: RootMap.py:70
GaudiKernel.RootMap._procRootMap
def _procRootMap(rtmpfile, rtmapdict)
Definition: RootMap.py:34
GaudiKernel.RootMap._procSysRootMap
def _procSysRootMap(rtmapdict)
Definition: RootMap.py:47

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

Definition at line 123 of file RootMap.py.

123 def printKeys(maps,recomp=None):
124 kys = maps.keys()
125 kys.sort()
126 if recomp: kys = filter(recomp.search,kys)
127 for k in kys:
128 if len(maps[k])>1:
129 print "!!!!!!!!!!!! WARNING - More than one entry !!!!!!!!!!"
130 for l in maps[k]:
131 print k
132 return
133
GaudiKernel.RootMap.printKeys
def printKeys
Definition: RootMap.py:123

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

Definition at line 92 of file RootMap.py.

92 def printMaps(maps,recomp=None):
93 linelen = _getLongestEntry(maps)
94 frmat = r"%-" + str(linelen) + "s\t"
95 kys = maps.keys()
96 kys.sort()
97 if recomp: kys = filter(recomp.search,kys)
98 for k in kys:
99 if len(maps[k])>1:
100 print "!!!!!!!!!!!! WARNING - More than one entry !!!!!!!!!!"
101 for l in maps[k]:
102 print frmat%k,
103 for m in l:
104 print m,
105 print " "
106 return
107
GaudiKernel.RootMap._getLongestEntry
def _getLongestEntry(maps)
Definition: RootMap.py:84
GaudiKernel.RootMap.printMaps
def printMaps
Definition: RootMap.py:92

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

Definition at line 108 of file RootMap.py.

108 def shortPrintMaps(maps,recomp=None):
109 kys = maps.keys()
110 kys.sort()
111 if recomp: kys = filter(recomp.search,kys)
112 for k in kys:
113 if len(maps[k])>1:
114 print k,"!!!!!!!!!!!! WARNING - More than one entry !!!!!!!!!!"
115 else:
116 print k
117 for l in maps[k]:
118 for m in l:
119 print "\t%s"%m,
120 print " "
121 return
122
GaudiKernel.RootMap.shortPrintMaps
def shortPrintMaps
Definition: RootMap.py:108