mirror of
https://github.com/Schrolli91/BOSWatch.git
synced 2026-01-01 14:20:00 +01:00
edit pluginloader.py
This commit is contained in:
parent
f32b6c73cf
commit
3f7d341fff
|
|
@ -16,19 +16,18 @@ def getPlugins():
|
|||
# plugins have to be a subdir with MainModule, if not skip
|
||||
if not os.path.isdir(location) or not i + ".py" in os.listdir(location):
|
||||
continue
|
||||
logging.debug("found plugin: "+i)
|
||||
|
||||
# is the plugin enabled in the config-file?
|
||||
try:
|
||||
usePlugin = int(globals.config.get("Plugins", i))
|
||||
except: #no entry for plugin found in config-file, skip
|
||||
logging.warning("Plugin not in config: "+i)
|
||||
logging.warning("Plugin not in config: %s", i)
|
||||
|
||||
logging.debug("use Plugin: "+str(usePlugin))
|
||||
|
||||
if usePlugin:
|
||||
info = imp.find_module(i, [location])
|
||||
plugins.append({"name": i, "info": info})
|
||||
logging.debug("append Plugin: "+i)
|
||||
logging.debug("use Plugin: %s", i)
|
||||
return plugins
|
||||
|
||||
def loadPlugin(plugin):
|
||||
|
|
|
|||
Loading…
Reference in a new issue