mirror of
https://github.com/Pardus-LiderAhenk/ahenk
synced 2024-11-10 08:52:21 +03:00
abstract plugin fixes
This commit is contained in:
parent
060ac2c5c8
commit
c0f1772eb6
1 changed files with 15 additions and 14 deletions
|
@ -14,26 +14,27 @@ class AbstractPlugin(Util):
|
|||
def __init__(self):
|
||||
super(Util, self).__init__()
|
||||
self.scope = Scope.getInstance()
|
||||
self.message_code = MessageCode
|
||||
|
||||
def handle_task(profile_data, context):
|
||||
Scope.getInstance().getLogger().error('[PluginPolicy] Handle function not found')
|
||||
Scope.getInstance().getLogger().error('[AbstractPlugin] Handle function not found')
|
||||
|
||||
@property
|
||||
def logger(self):
|
||||
def get_message_code(self):
|
||||
return MessageCode
|
||||
|
||||
def get_logger(self):
|
||||
try:
|
||||
return self.scope.getLogger()
|
||||
return Scope.getInstance().getLogger()
|
||||
except Exception as e:
|
||||
self.scope.getLogger().error('[PluginPolicy] A problem occurred while getting logger. Error Message: {}'.format(str(e)))
|
||||
self.scope.getLogger().error('[AbstractPlugin] A problem occurred while getting logger. Error Message: {}'.format(str(e)))
|
||||
return None
|
||||
|
||||
def configuration_manager(self):
|
||||
try:
|
||||
return self.scope.getConfigurationManager()
|
||||
except Exception as e:
|
||||
self.logger().error('[PluginPolicy] A problem occurred while getting configuration manager. Error Message: {}'.format(str(e)))
|
||||
return None
|
||||
def configuration_manager(self):
|
||||
try:
|
||||
return self.scope.getConfigurationManager()
|
||||
except Exception as e:
|
||||
self.logger().error('[AbstractPlugin] A problem occurred while getting configuration manager. Error Message: {}'.format(str(e)))
|
||||
return None
|
||||
|
||||
def plugin_path(self):
|
||||
return self.configuration_manager().get('PLUGIN', 'pluginfolderpath')
|
||||
|
||||
def plugin_path(self):
|
||||
return self.configuration_manager().get('PLUGIN', 'pluginfolderpath')
|
||||
|
|
Loading…
Reference in a new issue