mirror of
https://github.com/Pardus-LiderAhenk/ahenk
synced 2024-11-25 21:42:21 +03:00
base enums added to abstract plugin
This commit is contained in:
parent
edcc058f74
commit
6a3957401e
1 changed files with 9 additions and 3 deletions
|
@ -4,15 +4,17 @@
|
|||
# Author: Volkan Şahin <volkansah.in> <bm.volkansahin@gmail.com>
|
||||
|
||||
from base.Scope import Scope
|
||||
from base.util.util import Util
|
||||
from base.model.enum.ContentType import ContentType
|
||||
from base.model.enum.MessageCode import MessageCode
|
||||
from base.system.system import System
|
||||
from base.util.util import Util
|
||||
|
||||
|
||||
class AbstractPlugin(Util):
|
||||
class AbstractPlugin(Util, System):
|
||||
"""This is base class for plugins"""
|
||||
|
||||
def __init__(self):
|
||||
super(Util, self).__init__()
|
||||
super(AbstractPlugin, self).__init__()
|
||||
self.scope = Scope.getInstance()
|
||||
|
||||
def handle_task(profile_data, context):
|
||||
|
@ -21,6 +23,9 @@ class AbstractPlugin(Util):
|
|||
def get_message_code(self):
|
||||
return MessageCode
|
||||
|
||||
def get_content_type(self):
|
||||
return ContentType
|
||||
|
||||
def get_logger(self):
|
||||
try:
|
||||
return Scope.getInstance().getLogger()
|
||||
|
@ -28,6 +33,7 @@ class AbstractPlugin(Util):
|
|||
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()
|
||||
|
|
Loading…
Reference in a new issue