mirror of
https://github.com/EDCD/EDMarketConnector.git
synced 2025-06-08 03:12:33 +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:
|
with open(found[plugname], "rb") as plugfile:
|
||||||
plugmod = imp.load_module(plugname, plugfile, found[plugname].encode(sys.getfilesystemencoding()),
|
plugmod = imp.load_module(plugname, plugfile, found[plugname].encode(sys.getfilesystemencoding()),
|
||||||
(".py", "r", imp.PY_SOURCE))
|
(".py", "r", imp.PY_SOURCE))
|
||||||
if "plugin_start" in dir(plugmod):
|
if hasattr(plugmod, "plugin_start"):
|
||||||
newname = plugmod.plugin_start()
|
newname = plugmod.plugin_start()
|
||||||
PLUGINS[newname and unicode(newname) or plugname] = plugmod
|
PLUGINS[newname and unicode(newname) or plugname] = plugmod
|
||||||
|
|
||||||
@ -71,9 +71,7 @@ def _get_plugin_func(plugname, funcname):
|
|||||||
:param funcname:
|
:param funcname:
|
||||||
:return:
|
:return:
|
||||||
"""
|
"""
|
||||||
if funcname in dir(PLUGINS[plugname]):
|
return getattr(PLUGINS[plugname], funcname, None)
|
||||||
return getattr(PLUGINS[plugname], funcname)
|
|
||||||
return None
|
|
||||||
|
|
||||||
|
|
||||||
def get_plugin_app(plugname, parent):
|
def get_plugin_app(plugname, parent):
|
||||||
|
Loading…
x
Reference in New Issue
Block a user