mirror of
https://github.com/yweber/lodel2.git
synced 2025-12-03 17:26:54 +01:00
Add _activate check when plugins are loaded
This commit is contained in:
parent
8204f97fc5
commit
23e29b4336
1 changed files with 9 additions and 0 deletions
|
|
@ -124,6 +124,15 @@ class Plugin(object):
|
|||
##@brief Register hooks etc
|
||||
def load(self):
|
||||
from lodel import logger
|
||||
try:
|
||||
res = self.module._activate()
|
||||
except AttributeError:
|
||||
logger.debug("No _activate method found for plugin %s. Assuming plugin is ready to be loaded")
|
||||
res = True
|
||||
|
||||
if not(res is True):
|
||||
raise PluginError(res)
|
||||
|
||||
try:
|
||||
return self._import_from_init_var(LOADER_FILENAME_VARNAME)
|
||||
except AttributeError:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue