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