1
0
mirror of https://github.com/EDCD/EDMarketConnector.git synced 2025-04-21 11:27:38 +03:00
This commit is contained in:
Jonathan Harris 2017-06-12 01:04:41 +01:00
parent 320b1977c2
commit 7ebd71b127

@ -51,7 +51,7 @@ def load_plugins():
with open(found[plugname], "rb") as plugfile:
plugmod = imp.load_module(plugname, plugfile, found[plugname].encode(sys.getfilesystemencoding()),
(".py", "r", imp.PY_SOURCE))
if "plugin_start" in dir(plugmod):
if hasattr(plugmod, "plugin_start"):
newname = plugmod.plugin_start()
PLUGINS[newname and unicode(newname) or plugname] = plugmod
@ -71,9 +71,7 @@ def _get_plugin_func(plugname, funcname):
:param funcname:
:return:
"""
if funcname in dir(PLUGINS[plugname]):
return getattr(PLUGINS[plugname], funcname)
return None
return getattr(PLUGINS[plugname], funcname, None)
def get_plugin_app(plugname, parent):