| The Gaudi Framework v29r0 (ff2e7097)

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

- Namespace List
- Namespace Members

Functions
GaudiKernel.RootMap Namespace Reference

## Functions
def | _getPath (pathstring="")
def | _getEntry (line)
def | _getBlock (line)
def | _procRootMap (rtmpfile, rtmapdict)
def | _procSysRootMap (rtmapdict)
def | _isRootMap (filename)
def | getMaps (pathstring="", sysrtmap=False)
def | _getLongestEntry (maps)
def | printMaps (maps, recomp=None)
def | shortPrintMaps (maps, recomp=None)
def | printKeys (maps, recomp=None)
def | checkDict (maps, recomp=None)

## Function Documentation

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

Definition at line 29 of file RootMap.py.

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

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
28
GaudiKernel.RootMap._getEntry
def _getEntry(line)
Definition: RootMap.py:18

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

Definition at line 92 of file RootMap.py.

92 def _getLongestEntry(maps):
93 sz = 0
94 for k in maps.keys():
95 if len(k) > sz:
96 sz = len(k)
97 return sz
98
99
GaudiKernel.RootMap._getLongestEntry
def _getLongestEntry(maps)
Definition: RootMap.py:92

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(pathstring="")
Definition: RootMap.py:7

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

Definition at line 69 of file RootMap.py.

69 def _isRootMap(filename):
70 # The file must begin with "rootmap"
71 if (filename.find("rootmap") == 0):
72 return True
73 return False
74
75
GaudiKernel.RootMap._isRootMap
def _isRootMap(filename)
Definition: RootMap.py:69

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

Definition at line 35 of file RootMap.py.

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

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

Definition at line 50 of file RootMap.py.

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

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

Definition at line 148 of file RootMap.py.

148 def checkDict(maps, recomp=None):
149 kys = maps.keys()
150 kys.sort()
151 if recomp:
152 kys = filter(recomp.search, kys)
153 for k in kys:
154 if len(maps[k]) > 1:
155 print "!!!!!!!!!!!! WARNING - More than one entry !!!!!!!!!!"
156 print k
157 for l in maps[k]:
158 for m in l:
159 print "\t%s" % m,
160 print " "
161 return
162
GaudiKernel.RootMap.checkDict
def checkDict(maps, recomp=None)
Definition: RootMap.py:148

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

Definition at line 76 of file RootMap.py.

76 def getMaps(pathstring="", sysrtmap=False):
77 rtmapdict = dict()
78 pthlist = _getPath(pathstring)
79 if sysrtmap:
80 _procSysRootMap(rtmapdict)
81 for p in pthlist:
82 try:
83 for f in filter(_isRootMap, os.listdir(p)):
84 rtmpfile = os.path.join(p, f)
85 if (os.path.exists(rtmpfile)):
86 _procRootMap(rtmpfile, rtmapdict)
87 except:
88 pass
89 return rtmapdict
90
91
GaudiKernel.RootMap._getPath
def _getPath(pathstring="")
Definition: RootMap.py:7
GaudiKernel.RootMap.getMaps
def getMaps(pathstring="", sysrtmap=False)
Definition: RootMap.py:76
GaudiKernel.RootMap._procRootMap
def _procRootMap(rtmpfile, rtmapdict)
Definition: RootMap.py:35
GaudiKernel.RootMap._procSysRootMap
def _procSysRootMap(rtmapdict)
Definition: RootMap.py:50

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

Definition at line 135 of file RootMap.py.

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

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

Definition at line 100 of file RootMap.py.

100 def printMaps(maps, recomp=None):
101 linelen = _getLongestEntry(maps)
102 frmat = r"%-" + str(linelen) + "s\t"
103 kys = maps.keys()
104 kys.sort()
105 if recomp:
106 kys = filter(recomp.search, kys)
107 for k in kys:
108 if len(maps[k]) > 1:
109 print "!!!!!!!!!!!! WARNING - More than one entry !!!!!!!!!!"
110 for l in maps[k]:
111 print frmat % k,
112 for m in l:
113 print m,
114 print " "
115 return
116
117
GaudiKernel.RootMap._getLongestEntry
def _getLongestEntry(maps)
Definition: RootMap.py:92
GaudiKernel.RootMap.printMaps
def printMaps(maps, recomp=None)
Definition: RootMap.py:100

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

Definition at line 118 of file RootMap.py.

118 def shortPrintMaps(maps, recomp=None):
119 kys = maps.keys()
120 kys.sort()
121 if recomp:
122 kys = filter(recomp.search, kys)
123 for k in kys:
124 if len(maps[k]) > 1:
125 print k, "!!!!!!!!!!!! WARNING - More than one entry !!!!!!!!!!"
126 else:
127 print k
128 for l in maps[k]:
129 for m in l:
130 print "\t%s" % m,
131 print " "
132 return
133
134
GaudiKernel.RootMap.shortPrintMaps
def shortPrintMaps(maps, recomp=None)
Definition: RootMap.py:118