mirror of
https://github.com/EDCD/EDMarketConnector.git
synced 2025-04-21 11:27:38 +03:00
Tidy
This commit is contained in:
parent
320b1977c2
commit
7ebd71b127
6
plug.py
6
plug.py
@ -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):
|
||||
|
Loading…
x
Reference in New Issue
Block a user