21 lines
459 B
Python
21 lines
459 B
Python
#!/usr/bin/env python3
|
|
|
|
class Dispatcher:
|
|
_plugins = dict()
|
|
|
|
def __init__(self) -> None:
|
|
pass
|
|
|
|
def runPlugin(self, plugin, *args) -> dict:
|
|
"""
|
|
We run the puglin. The result of this function
|
|
is the report of the audit
|
|
"""
|
|
return self._plugins[plugin](self, *args)
|
|
|
|
@classmethod
|
|
def register_plugins(cls, plugin):
|
|
cls._plugins[plugin.__name__] = plugin
|
|
return plugin
|
|
|