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