def main():
    args = get_parser().parse_args()

    print("Finding class: ", args.classname)

    for key, prot in Domain.getProtocols().items():
        print("key: ", key, "class: ", prot)

    ProtClass = Domain.findClass(args.classname)
    prot = ProtClass()

    for section in prot.iterDefinitionSections():
        label = section.getLabel()
        print("Section: ", label)
        for name, param in section.iterParams():
            printElement(param, "   ")
Exemplo n.º 2
0
n = len(sys.argv)

if n > 4:
    usage("Incorrect number of input parameters")

if n == 1:  # List all plugins
    plugins = Domain.getPlugins()
    print("Plugins:")
    for k, v in iteritems(plugins):
        print("-", k)

    print("Objects")
    pwutils.prettyDict(Domain.getObjects())

    print("Protocols")
    pwutils.prettyDict(Domain.getProtocols())

    print("Viewers")
    pwutils.prettyDict(Domain.getViewers())

elif n == 2:
    if sys.argv[1] in ['-h', '--help', 'help']:
        usage()

    pluginName = sys.argv[1]
    plugin = Domain.getPlugin(pluginName)
    print("Plugin: %s" % pluginName)
    for subName in [
            'constants', 'convert', 'protocols', 'wizards', 'viewers', 'tests'
    ]:
        sub, error = getSubmodule(plugin, pluginName, subName)