Browse Source

@staticmethod to ServerMessage.fromJSON

pull/1/head
Coin de Gamma 6 years ago
parent
commit
a3f4aeff35
  1. 3
      analytics/analytics/services/server_service.py

3
analytics/analytics/services/server_service.py

@ -27,6 +27,7 @@ class ServerMessage:
result['requestId'] = self.request_id result['requestId'] = self.request_id
return result return result
@staticmethod
def fromJSON(json: dict): def fromJSON(json: dict):
method = json['method'] method = json['method']
payload = None payload = None
@ -86,7 +87,7 @@ class ServerService:
if message.request_id is not None: if message.request_id is not None:
self.responses[message_object['requestId']] = message.payload self.responses[message_object['requestId']] = message.payload
return return
logger.debug(message.toJSON()) logger.debug(message.toJSON())
asyncio.ensure_future(self.on_message_handler(message)) asyncio.ensure_future(self.on_message_handler(message))
except Exception as e: except Exception as e:

Loading…
Cancel
Save