response message was opened

This commit is contained in:
Volkan Şahin 2016-05-09 14:13:41 +03:00
parent b857e5d15d
commit 5310354aaf

View file

@ -65,6 +65,8 @@ class Plugin(threading.Thread):
self.context = Context()
def run(self):
while self.keep_run:
try:
try:
@ -77,11 +79,10 @@ class Plugin(threading.Thread):
self.logger.debug('[Plugin] Executing task')
command = Scope.getInstance().getPluginManager().findCommand(self.getName(), item_obj.get_command_cls_id().lower())
command.handle_task(item_obj, self.context)
# TODO create response message from context and item_obj. item_obj is task
response = Response(type=MessageType.TASK_STATUS.value, id=item_obj.get_id(), code=self.context.get('responseCode'), message=self.context.get('responseMessage'), data=self.context.get('responseData'), content_type=self.context.get('contentType'))
# self.response_queue.put(self.messaging.response_msg(response)) #TODO DEBUG
# Scope.getInstance().getMessager().send_direct_message(self.messaging.task_status_msg(response)) # TODO REMOVE
Scope.getInstance().getMessager().send_direct_message(self.messaging.task_status_msg(response)) # TODO REMOVE
# Empty context for next use
self.context.empty_data()
@ -104,7 +105,7 @@ class Plugin(threading.Thread):
response = Response(type=MessageType.POLICY_STATUS.value, id=item_obj.get_id(), code=self.context.get('responseCode'), message=self.context.get('responseMessage'), data=self.context.get('responseData'), content_type=self.context.get('contentType'), execution_id=execution_id, policy_version=policy_ver)
# self.response_queue.put(self.messaging.response_msg(response)) #TODO DEBUG
# Scope.getInstance().getMessager().send_direct_message(self.messaging.policy_status_msg(response)) # TODO REMOVE
Scope.getInstance().getMessager().send_direct_message(self.messaging.policy_status_msg(response)) # TODO REMOVE
# Empty context for next use
self.context.empty_data()