Fix: Validate plugins separately from constructor
Otherwise plugins that inject data via __plugin_init__ won't work properly
This commit is contained in:
parent
8a41cef00b
commit
0ed8afd999
1 changed files with 4 additions and 3 deletions
|
|
@ -109,9 +109,7 @@ class PluginInfo(object):
|
|||
self._url = url
|
||||
self._license = license
|
||||
|
||||
self._validate()
|
||||
|
||||
def _validate(self):
|
||||
def validate(self):
|
||||
# if the plugin still uses __plugin_implementations__, log a deprecation warning and put the first
|
||||
# item into __plugin_implementation__
|
||||
if hasattr(self.instance, self.__class__.attr_implementations):
|
||||
|
|
@ -484,6 +482,9 @@ class PluginManager(object):
|
|||
# initialize the plugin
|
||||
plugin.init()
|
||||
|
||||
# validate the plugin
|
||||
plugin.validate()
|
||||
|
||||
# evaluate registered hooks
|
||||
for hook, callback in plugin.hooks.items():
|
||||
self.plugin_hooks[hook].append((name, callback))
|
||||
|
|
|
|||
Loading…
Reference in a new issue