Пример #1
0
def get_all_plugins():
    global W, PLUGINS, PLUGNFO, PLUGNFOk

    ret = []

    for p in PLUGINS:
        uri = p.get_uri().as_uri()

        if uri in BLACKLIST:
            continue
        if MODGUI_SHOW_MODE == 2 and uri not in CLOUD_PLUGINS:
            continue
        if MODGUI_SHOW_MODE == 3 and uri not in WHITELIST:
            continue

        # check if it's already cached
        if uri in PLUGNFOk and PLUGNFO[uri]:
            if PLUGNFO[uri]['gui'] or MODGUI_SHOW_MODE != 1:
                ret.append(PLUGNFO[uri])
            continue

        # skip plugins without modgui if so requested
        if MODGUI_SHOW_MODE == 1 and not plugin_has_modgui(W, p):
            continue

        # get new info
        PLUGNFO[uri] = get_plugin_info2(W, p)
        ret.append(PLUGNFO[uri])

    return ret
Пример #2
0
Файл: lv2.py Проект: EQ4/mod-ui
def get_all_plugins():
    global W, PLUGINS, PLUGNFO, PLUGNFOk

    ret = []

    for p in PLUGINS:
        uri = p.get_uri().as_uri()

        if uri in BLACKLIST:
            continue
        if MODGUI_SHOW_MODE == 2 and uri not in CLOUD_PLUGINS:
            continue
        if MODGUI_SHOW_MODE == 3 and uri not in WHITELIST:
            continue

        # check if it's already cached
        if uri in PLUGNFOk and PLUGNFO[uri]:
            if PLUGNFO[uri]['gui'] or MODGUI_SHOW_MODE != 1:
                ret.append(PLUGNFO[uri])
            continue

        # skip plugins without modgui if so requested
        if MODGUI_SHOW_MODE == 1 and not plugin_has_modgui(W, p):
            continue

        # get new info
        PLUGNFO[uri] = get_plugin_info2(W, p)
        ret.append(PLUGNFO[uri])

    return ret
Пример #3
0
def add_bundle_to_lilv_world(bundlepath, returnPlugins=False):
    global W, BUNDLES, PLUGINS, PLUGNFO, PLUGNFOk

    # lilv wants the last character as the separator
    if not bundlepath.endswith(os.sep):
        bundlepath += os.sep

    # stop now if bundle is already loaded
    if bundlepath in BUNDLES:
        return [] if returnPlugins else False

    # In case returnPlugins is used
    addedPlugins = []

    # convert bundle string into a lilv node
    bundlenode = lilv.lilv_new_file_uri(W.me, None, bundlepath)

    # load the bundle
    W.load_bundle(bundlenode)

    # free bundlenode, no longer needed
    lilv.lilv_node_free(bundlenode)

    # add to loaded list
    BUNDLES.append(bundlepath)

    # fill in for any new plugins that appeared
    for p in PLUGINS:
        uri = p.get_uri().as_uri()

        # check if it's already cached
        if uri in PLUGNFOk and PLUGNFO[uri]:
            continue

        # get new info
        PLUGNFO[uri] = get_plugin_info2(W, p)
        PLUGNFOk.append(uri)

        if returnPlugins:
            addedPlugins.append(uri)

    return addedPlugins if returnPlugins else True
Пример #4
0
Файл: lv2.py Проект: EQ4/mod-ui
def add_bundle_to_lilv_world(bundlepath, returnPlugins = False):
    global W, BUNDLES, PLUGINS, PLUGNFO, PLUGNFOk

    # lilv wants the last character as the separator
    if not bundlepath.endswith(os.sep):
        bundlepath += os.sep

    # stop now if bundle is already loaded
    if bundlepath in BUNDLES:
        return [] if returnPlugins else False

    # In case returnPlugins is used
    addedPlugins = []

    # convert bundle string into a lilv node
    bundlenode = lilv.lilv_new_file_uri(W.me, None, bundlepath)

    # load the bundle
    W.load_bundle(bundlenode)

    # free bundlenode, no longer needed
    lilv.lilv_node_free(bundlenode)

    # add to loaded list
    BUNDLES.append(bundlepath)

    # fill in for any new plugins that appeared
    for p in PLUGINS:
        uri = p.get_uri().as_uri()

        # check if it's already cached
        if uri in PLUGNFOk and PLUGNFO[uri]:
            continue

        # get new info
        PLUGNFO[uri] = get_plugin_info2(W, p)
        PLUGNFOk.append(uri)

        if returnPlugins:
            addedPlugins.append(uri)

    return addedPlugins if returnPlugins else True
Пример #5
0
def get_plugin_info(uri):
    global W, PLUGINS, PLUGNFO

    # check if it exists
    if uri not in PLUGNFO.keys():
        raise Exception

    # check if it's already cached
    if PLUGNFO[uri]:
        return PLUGNFO[uri]

    # look for it
    for p in PLUGINS:
        if p.get_uri().as_uri() != uri:
            continue
        # found it
        PLUGNFO[uri] = get_plugin_info2(W, p)
        return PLUGNFO[uri]

    # not found
    raise Exception
Пример #6
0
def get_plugin_info(uri):
    global W, PLUGINS, PLUGNFO, PLUGNFOk

    # check if it exists
    if uri not in PLUGNFOk:
        raise Exception

    # check if it's already cached
    if PLUGNFO[uri]:
        return PLUGNFO[uri]

    # look for it
    for p in PLUGINS:
        if p.get_uri().as_uri() != uri:
            continue
        # found it
        print("NOTICE: Plugin '%s' was not cached, scanning it now..." % uri)
        PLUGNFO[uri] = get_plugin_info2(W, p)
        return PLUGNFO[uri]

    # not found
    raise Exception
Пример #7
0
Файл: lv2.py Проект: EQ4/mod-ui
def get_plugin_info(uri):
    global W, PLUGINS, PLUGNFO, PLUGNFOk

    # check if it exists
    if uri not in PLUGNFOk:
        raise Exception

    # check if it's already cached
    if PLUGNFO[uri]:
        return PLUGNFO[uri]

    # look for it
    for p in PLUGINS:
        if p.get_uri().as_uri() != uri:
            continue
        # found it
        print("NOTICE: Plugin '%s' was not cached, scanning it now..." % uri)
        PLUGNFO[uri] = get_plugin_info2(W, p)
        return PLUGNFO[uri]

    # not found
    raise Exception
Пример #8
0
def add_bundle_to_lilv_world(bundlepath):
    global W, BUNDLES, PLUGINS, PLUGNFO

    # lilv wants the last character as the separator
    if not bundlepath.endswith(os.sep):
        bundlepath += os.sep

    # stop now if bundle is already loaded
    if bundlepath in BUNDLES:
        return False

    # convert bundle string into a lilv node
    bundlenode = lilv.lilv_new_file_uri(W.me, None, bundlepath)

    # load the bundle
    W.load_bundle(bundlenode)

    # free bundlenode, no longer needed
    lilv.lilv_node_free(bundlenode)

    # add to world
    BUNDLES.append(bundlepath)

    # fill in for any new plugins that appeared
    keys = PLUGNFO.keys()

    for p in PLUGINS:
        uri = p.get_uri().as_uri()

        # check if it's already cached
        if uri in keys and PLUGNFO[uri]:
            continue

        # get new info
        PLUGNFO[uri] = get_plugin_info2(W, p)

    return True
Пример #9
0
def get_all_plugins():
    global W, PLUGINS, PLUGNFO

    ret  = []
    keys = PLUGNFO.keys()

    for p in PLUGINS:
        uri = p.get_uri().as_uri()

        # check if it's already cached
        if uri in keys and PLUGNFO[uri]:
            if PLUGNFO[uri]['gui'] or not MODGUIS_ONLY:
                ret.append(PLUGNFO[uri])
            continue

        # skip plugins without modgui if so requested
        if MODGUIS_ONLY and not plugin_has_modgui(W, p):
            continue

        # get new info
        PLUGNFO[uri] = get_plugin_info2(W, p)
        ret.append(PLUGNFO[uri])

    return ret