The imported module name must be unique. Otherwise the existing import will just be reused.

This commit is contained in:
Jeffrey Townsend
2016-11-30 22:12:27 +00:00
parent 56b2ca49f9
commit 176d9f6449

View File

@@ -428,7 +428,8 @@ class Base:
self.log.info("loading plugins from %s", pyPath)
with open(pyPath) as fd:
sfx = ('.py', 'U', imp.PY_SOURCE,)
mod = imp.load_module("plugin", fd, pyPath, sfx)
moduleName = os.path.splitext(os.path.basename(pyPath))[0]
mod = imp.load_module("onl_install_plugin_%s" % moduleName, fd, pyPath, sfx)
for attr in dir(mod):
klass = getattr(mod, attr)
if isinstance(klass, type) and issubclass(klass, Plugin):