The Gaudi Framework  v36r1 (3e2fb5a8)
root_map_dump.py
Go to the documentation of this file.
1 #!/usr/bin/env python
2 
12 
13 from __future__ import print_function
14 import os.path
15 from GaudiKernel.RootMap import getMaps, checkDict
16 from GaudiKernel.RootMap import printMaps, shortPrintMaps
17 from GaudiKernel.RootMap import printKeys
18 
19 
20 def _help(argv):
21  print("""
22  %s [-h] [-s|-e|-c] [-r] [-p pattern] [listofpath]
23 
24  -h: dump this Help
25  -s: Short format print
26  -e: print Entry names only
27  -c: only Checks duplication of entries
28  -r: print also $ROOTSYS/etc/system.rootmap
29  -p: print only pattern matching (Python style) entries
30 
31  dump rootmap dictionaries informations. If no path is given, the
32  LD_LIBRARY_PATH is used. By default, prints the name of the entry,
33  its corresponding library and its block definition inside the
34  rootmap file(s) on separate lines. The output is sorted according to
35  the name of the entry. A Warning is issued if an entry appears
36  several times.
37  """ % os.path.basename(argv[0]))
38 
39 
40 if __name__ == "__main__":
41  import getopt
42  import sys
43  printFunc = printMaps
44  sysrtmap = False
45  pattern = None
46  try:
47  opts, args = getopt.getopt(sys.argv[1:], 'hsecrp:')
48  except getopt.GetoptError:
49  _help(sys.argv)
50  sys.exit(2)
51  for op, ar in opts:
52  if op == '-h':
53  _help(sys.argv)
54  sys.exit(0)
55  if op == '-s':
56  printFunc = shortPrintMaps
57  if op == '-e':
58  printFunc = printKeys
59  if op == '-c':
60  printFunc = checkDict
61  if op == '-r':
62  sysrtmap = True
63  if op == '-p':
64  import re
65  pattern = re.compile(ar)
66  if args:
67  for p in args:
68  maps = getMaps(p, sysrtmap)
69  printFunc(maps, pattern)
70  else:
71  maps = getMaps("", sysrtmap)
72  printFunc(maps, pattern)
root_map_dump._help
def _help(argv)
Definition: root_map_dump.py:20
root_map_dump.printFunc
printFunc
Definition: root_map_dump.py:43
GaudiKernel.RootMap
Definition: RootMap.py:1
GaudiKernel.RootMap.getMaps
def getMaps(pathstring="", sysrtmap=False)
Definition: RootMap.py:87