def emit(self, **kwargs): self._add_notify_time(kwargs) notification = json.dumps({'jsonrpc': '2.0', 'method': self._event_id, 'params': kwargs}) self.log.debug("Sending event %s", notification) self._cb(notification)
def encode(self): res = { 'jsonrpc': '2.0', 'method': self.method, 'params': self.params, 'id': self.id } return json.dumps(res, 'utf-8')
def emit(self, **kwargs): self._add_notify_time(kwargs) notification = json.dumps({ 'jsonrpc': '2.0', 'method': self._event_id, 'params': kwargs }) self.log.debug("Sending event %s", notification) self._cb(notification)
def encode(self): res = self.toDict() return json.dumps(res, 'utf-8')