minor bug fixes

This commit is contained in:
Volkan Şahin 2016-03-14 17:42:17 +02:00
parent 885be4972d
commit 4008aae6e6
4 changed files with 3 additions and 6 deletions

View file

@ -66,7 +66,7 @@ class Scope(object):
self.pluginManager = pluginManager self.pluginManager = pluginManager
def getTaskManager(self): def getTaskManager(self):
return self.TaskManager return self.taskManager
def setTaskManager(self,taskManager): def setTaskManager(self,taskManager):
self.taskManager = taskManager self.taskManager = taskManager

View file

@ -20,14 +20,13 @@ class ExecutionManager(object):
self.task_manager = scope.getTaskManager() self.task_manager = scope.getTaskManager()
self.logger=scope.getLogger() self.logger=scope.getLogger()
self.event_manager.register_event('EXECUTE_TASK',self.execute_task)
self.event_manager.register_event('EXECUTE_SCRIPT',self.execute_script) self.event_manager.register_event('EXECUTE_SCRIPT',self.execute_script)
self.event_manager.register_event('REQUEST_FILE',self.request_file) self.event_manager.register_event('REQUEST_FILE',self.request_file)
self.event_manager.register_event('MOVE_FILE',self.move_file) self.event_manager.register_event('MOVE_FILE',self.move_file)
self.event_manager.register_event('TASK',self.add_task) self.event_manager.register_event('TASK',self.add_task)
def add_task(self,arg): def add_task(self,arg):
self.logger.debug('[ExecutionManager] Executing task...') self.logger.debug('[ExecutionManager] Adding new task...')
task = Task(arg) task = Task(arg)
self.task_manager.addTask(task) self.task_manager.addTask(task)

View file

@ -11,6 +11,6 @@ class MessageFactory(object):
return "Message receivden response" return "Message receivden response"
elif type == MessageType.TASK_PROCESSING: elif type == MessageType.TASK_PROCESSING:
return "Message processing response" return "Message processing response"
else else:
return None return None
createMessage = staticmethod(createMessage) createMessage = staticmethod(createMessage)

View file

@ -7,9 +7,7 @@ class Task(object):
"""docstring for Task""" """docstring for Task"""
def __init__(self,message): def __init__(self,message):
self.payload = json.loads(message) self.payload = json.loads(message)
print(self.payload)
self.request = self.payload['request'] self.request = self.payload['request']
print(self.request)
@property @property
def task_id(self): def task_id(self):