3 Print help messages for gaudi components 5 from Gaudi
import Configuration
10 if __name__ ==
"__main__":
11 from optparse
import OptionParser
12 parser = OptionParser(
13 prog=os.path.basename(sys.argv[0]), usage=
"%prog [options] ")
20 help=
"list all available components.")
26 help=
"dump all info about component of given name.")
27 parser.set_defaults(root=os.path.join(
"..",
"python"))
28 opts, args = parser.parse_args()
34 cfgDb = Configuration.cfgDb
36 print "Available components:\n%s" % (21 *
"=")
37 for item
in sorted(cfgDb):
38 print " %s (from %s)" % (item, cfgDb[item][
"lib"])
43 print "Component %s not found." % (name)
45 print "\nDumping component information for %s:\n%s" % (
46 name, (35 + len(name)) *
"=")
47 print " Library: %s" % (cfgDb[name][
"lib"])
48 print " Package: %s" % (cfgDb[name][
"package"])
49 print "\nProperties:\n%s" % (11 *
"-")
51 properties = getattr(Configurables,
52 name)().getPropertiesWithDescription()
53 except AttributeError:
54 print " Not a configurable component. No properties to show." 56 for label, (value, desc)
in sorted(properties.iteritems()):
57 print(
" %s\t : %s\t (%s) " % (label, value, str(desc).replace(
58 "None",
" no description "))).expandtabs(30)