| # Gaudi Framework, version v22r4 |

Home |  | Generated: Fri Sep 2 2011

# root_map_dump.py

Go to the documentation of this file.

    00001 #!/usr/bin/env python
    00002
    00003 import os.path
    00004 from GaudiKernel.RootMap import getMaps, checkDict
    00005 from GaudiKernel.RootMap import printMaps, shortPrintMaps
    00006 from GaudiKernel.RootMap import printKeys
    00007
    00008
    00009 def _help(argv):
    00010   print """
    00011   %s [-h] [-s|-e|-c] [-r] [-p pattern] [listofpath]
    00012
    00013      -h: dump this Help
    00014      -s: Short format print
    00015      -e: print Entry names only
    00016      -c: only Checks duplication of entries
    00017      -r: print also $ROOTSYS/etc/system.rootmap
    00018      -p: print only pattern matching (Python style) entries
    00019
    00020   dump rootmap dictionaries informations. If no path is given, the
    00021   LD_LIBRARY_PATH is used. By default, prints the name of the entry,
    00022   its corresponding library and its block definition inside the
    00023   rootmap file(s) on separate lines. The output is sorted according to
    00024   the name of the entry. A Warning is issued if an entry appears
    00025   several times.
    00026   """%os.path.basename(argv[0])
    00027
    00028
    00029
    00030 if __name__ == "__main__":
    00031   import getopt
    00032   import sys
    00033   printFunc = printMaps
    00034   sysrtmap = False
    00035   pattern = None
    00036   try:
    00037     opts, args = getopt.getopt(sys.argv[1:], 'hsecrp:')
    00038   except getopt.GetoptError:
    00039     _help(sys.argv)
    00040     sys.exit(2)
    00041   for op,ar in opts :
    00042     if op == '-h':
    00043       _help(sys.argv)
    00044       sys.exit(0)
    00045     if op == '-s': printFunc = shortPrintMaps
    00046     if op == '-e': printFunc = printKeys
    00047     if op == '-c': printFunc = checkDict
    00048     if op == '-r': sysrtmap  = True
    00049     if op == '-p':
    00050       import re
    00051       pattern = re.compile(ar)
    00052   if args:
    00053     for p in args:
    00054       maps = getMaps(p,sysrtmap)
    00055       printFunc(maps,pattern)
    00056   else:
    00057     maps = getMaps("",sysrtmap)
    00058     printFunc(maps,pattern)

All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Defines