13 Print help messages for gaudi components
15 from __future__
import print_function
16 from Gaudi
import Configuration
21 if __name__ ==
"__main__":
22 from optparse
import OptionParser
23 parser = OptionParser(
24 prog=os.path.basename(sys.argv[0]), usage=
"%prog [options] ")
31 help=
"list all available components.")
37 help=
"dump all info about component of given name.")
38 parser.set_defaults(root=os.path.join(
"..",
"python"))
39 opts, args = parser.parse_args()
45 cfgDb = Configuration.cfgDb
47 print(
"Available components:\n%s" % (21 *
"="))
48 for item
in sorted(cfgDb):
49 print(
" %s (from %s)" % (item, cfgDb[item][
"lib"]))
54 print(
"Component %s not found." % (name))
56 print(
"\nDumping component information for %s:\n%s" %
57 (name, (35 + len(name)) *
"="))
58 print(
" Library: %s" % (cfgDb[name][
"lib"]))
59 print(
" Package: %s" % (cfgDb[name][
"package"]))
60 print(
"\nProperties:\n%s" % (11 *
"-"))
62 properties = getattr(Configurables,
63 name)().getPropertiesWithDescription()
64 except AttributeError:
65 print(
" Not a configurable component. No properties to show.")
67 for label, (value, desc)
in sorted(properties.iteritems()):
68 print((
" %s\t : %s\t (%s) " % (label, value, str(desc).replace(
69 "None",
" no description "))).expandtabs(30))