mirror of
https://github.com/Schrolli91/BOSWatch.git
synced 2025-12-06 07:42:03 +01:00
change Module Names
This commit is contained in:
parent
39300f8c7c
commit
2d64d468a8
|
|
@ -7,8 +7,6 @@ import imp
|
|||
import os
|
||||
|
||||
PluginFolder = "./plugins"
|
||||
MainModule = "__init__"
|
||||
|
||||
|
||||
def getPlugins():
|
||||
plugins = []
|
||||
|
|
@ -16,7 +14,7 @@ def getPlugins():
|
|||
for i in possibleplugins:
|
||||
location = os.path.join(PluginFolder, i)
|
||||
# plugins have to be a subdir with MainModule, if not skip
|
||||
if not os.path.isdir(location) or not MainModule + ".py" in os.listdir(location):
|
||||
if not os.path.isdir(location) or not i + ".py" in os.listdir(location):
|
||||
continue
|
||||
logging.debug("found plugin: "+i)
|
||||
|
||||
|
|
@ -28,10 +26,10 @@ def getPlugins():
|
|||
|
||||
logging.debug("use Plugin: "+str(usePlugin))
|
||||
if usePlugin:
|
||||
info = imp.find_module(MainModule, [location])
|
||||
info = imp.find_module(i, [location])
|
||||
plugins.append({"name": i, "info": info})
|
||||
logging.debug("append Plugin: "+i)
|
||||
return plugins
|
||||
|
||||
def loadPlugin(plugin):
|
||||
return imp.load_module(MainModule, *plugin["info"])
|
||||
return imp.load_module(plugin["name"], *plugin["info"])
|
||||
Loading…
Reference in a new issue