def __init__(self, **kwargs): super().__init__() self.logger = logging.getLogger( 'platypush:plugin:' + get_plugin_name_by_class(self.__class__)) if 'logging' in kwargs: self.logger.setLevel(getattr(logging, kwargs['logging'].upper())) self.registered_actions = set( get_decorators(self.__class__, climb_class_hierarchy=True).get('action', []))
def __init__(self, plugin, prefix='', html_doc: bool = False): self.name = plugin.__module__[len(prefix):] self.html_doc = html_doc self.doc = self.to_html( plugin.__doc__) if html_doc and plugin.__doc__ else plugin.__doc__ self.actions = { action_name: ActionModel(getattr(plugin, action_name), html_doc=html_doc) for action_name in get_decorators( plugin, climb_class_hierarchy=True).get('action', []) }