13 Print help messages for gaudi components 
   15 from __future__ 
import print_function
 
   22 from Gaudi 
import Configuration
 
   24 if __name__ == 
"__main__":
 
   25     from optparse 
import OptionParser
 
   27     parser = OptionParser(prog=os.path.basename(sys.argv[0]), usage=
"%prog [options] ")
 
   34         help=
"list all available components.",
 
   41         help=
"dump all info about component of given name.",
 
   43     parser.set_defaults(root=os.path.join(
"..", 
"python"))
 
   44     opts, args = parser.parse_args()
 
   50     cfgDb = Configuration.cfgDb
 
   52         print(
"Available components:\n%s" % (21 * 
"="))
 
   53         for item 
in sorted(cfgDb):
 
   54             print(
"  %s (from %s)" % (item, cfgDb[item][
"lib"]))
 
   59             print(
"Component %s not found." % (name))
 
   62             "\nDumping component information for %s:\n%s" 
   63             % (name, (35 + len(name)) * 
"=")
 
   65         print(
"  Library: %s" % (cfgDb[name][
"lib"]))
 
   66         print(
"  Package: %s" % (cfgDb[name][
"package"]))
 
   67         print(
"\nProperties:\n%s" % (11 * 
"-"))
 
   69             properties = getattr(Configurables, name)().getPropertiesWithDescription()
 
   70         except AttributeError:
 
   71             print(
"  Not a configurable component. No properties to show.")
 
   73         for label, (value, desc) 
in sorted(properties.iteritems()):
 
   77                     % (label, value, str(desc).replace(
"None", 
" no description "))