Пример #1
0
 def getBinToPluginDict():
     localPlugins = Domain.getPlugins()
     binToPluginDict = {}
     for p, pobj in localPlugins.items():
         pinfo = PluginInfo(name=p, plugin=pobj, remote=False)
         pbins = pinfo.getBinVersions()
         binToPluginDict.update({k: p for k in pbins})
         pbinsNoVersion = set([b.split('-', 1)[0] for b in pbins])
         binToPluginDict.update({k: p for k in pbinsNoVersion})
     return binToPluginDict
Пример #2
0
    """ Get the first non empty line from doc. """
    if doc:
        for lines in doc.split('\n'):
            l = lines.strip()
            if l:
                return l
    return ''


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']: