def load(self, name, force_reload_if_unmanaged=False):
if name in sys.modules and name not in self.plugins:
# we're getting an already loaded module, which we has not been
# loaded through PluginManager, return it from sys.modules and
# add it to our list
module = sys.modules[name]
if force_reload_if_unmanaged:
importlib.reload(module)
else:
module = importlib.import_module(name)
self.plugins.add(name)
return module
评论列表
文章目录