| # Gaudi Framework, version v25r0 |

Home |  | Generated: Mon Feb 17 2014

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

- Namespace List
- Namespace Members

All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
Functions
GaudiKernel.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 GaudiKernel.RootMap._getBlock | ( |  | line | ) |
| private

Definition at line 28 of file RootMap.py.

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

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

Definition at line 18 of file RootMap.py.

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

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

Definition at line 84 of file RootMap.py.

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

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

Definition at line 7 of file RootMap.py.

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

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

Definition at line 64 of file RootMap.py.

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

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

Definition at line 34 of file RootMap.py.

34
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((os.path.join(os.path.dirname(rtmpfile),lib),block))
45 else:
46 block=_getBlock(line)

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

Definition at line 47 of file RootMap.py.

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

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

Definition at line 134 of file RootMap.py.

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

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

Definition at line 70 of file RootMap.py.

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

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

Definition at line 123 of file RootMap.py.

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

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

Definition at line 92 of file RootMap.py.

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

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

Definition at line 108 of file RootMap.py.

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