13Print help messages for gaudi components 
   21from Gaudi 
import Configuration
 
   23if __name__ == 
"__main__":
 
   24    from optparse 
import OptionParser
 
   26    parser = OptionParser(prog=os.path.basename(sys.argv[0]), usage=
"%prog [options] ")
 
   33        help=
"list all available components.",
 
   40        help=
"dump all info about component of given name.",
 
   42    parser.set_defaults(root=os.path.join(
"..", 
"python"))
 
   43    opts, args = parser.parse_args()
 
   49    cfgDb = Configuration.cfgDb
 
   51        print(
"Available components:\n%s" % (21 * 
"="))
 
   52        for item 
in sorted(cfgDb):
 
   53            print(
"  %s (from %s)" % (item, cfgDb[item][
"lib"]))
 
   58            print(
"Component %s not found." % (name))
 
   61            "\nDumping component information for %s:\n%s" 
   62            % (name, (35 + len(name)) * 
"=")
 
   64        print(
"  Library: %s" % (cfgDb[name][
"lib"]))
 
   65        print(
"  Package: %s" % (cfgDb[name][
"package"]))
 
   66        print(
"\nProperties:\n%s" % (11 * 
"-"))
 
   68            properties = getattr(Configurables, name)().getPropertiesWithDescription()
 
   69        except AttributeError:
 
   70            print(
"  Not a configurable component. No properties to show.")
 
   72        for label, (value, desc) 
in sorted(properties.iteritems()):
 
   76                    % (label, value, str(desc).replace(
"None", 
" no description "))