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
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
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
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
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
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
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