Mercurial > libervia-backend
comparison libervia/backend/plugins/plugin_exp_jingle_stream.py @ 4341:e9971a4b0627
remove uses of twisted.internet.defer.returnValue
This function has been deprecated in Twisted 24.7.0.
author | Povilas Kanapickas <povilas@radix.lt> |
---|---|
date | Wed, 11 Dec 2024 01:17:09 +0200 |
parents | 0d7bb4df2343 |
children |
comparison
equal
deleted
inserted
replaced
4340:ea72364131d5 | 4341:e9971a4b0627 |
---|---|
265 security_limit=SECURITY_LIMIT, | 265 security_limit=SECURITY_LIMIT, |
266 profile=client.profile, | 266 profile=client.profile, |
267 ) | 267 ) |
268 | 268 |
269 if not C.bool(confirm_data["answer"]): | 269 if not C.bool(confirm_data["answer"]): |
270 defer.returnValue(False) | 270 return False |
271 try: | 271 try: |
272 port = int(confirm_data["port"]) | 272 port = int(confirm_data["port"]) |
273 except (ValueError, KeyError): | 273 except (ValueError, KeyError): |
274 raise exceptions.DataError(_("given port is invalid")) | 274 raise exceptions.DataError(_("given port is invalid")) |
275 endpoint = endpoints.TCP4ClientEndpoint(reactor, "localhost", port) | 275 endpoint = endpoints.TCP4ClientEndpoint(reactor, "localhost", port) |
277 yield endpoint.connect(factory) | 277 yield endpoint.connect(factory) |
278 content_data["stream_object"] = factory | 278 content_data["stream_object"] = factory |
279 finished_d = content_data["finished_d"] = defer.Deferred() | 279 finished_d = content_data["finished_d"] = defer.Deferred() |
280 args = [client, session, content_name, content_data] | 280 args = [client, session, content_name, content_data] |
281 finished_d.addCallbacks(self._finished_cb, self._finished_eb, args, None, args) | 281 finished_d.addCallbacks(self._finished_cb, self._finished_eb, args, None, args) |
282 defer.returnValue(True) | 282 return True |
283 | 283 |
284 def jingle_handler(self, client, action, session, content_name, desc_elt): | 284 def jingle_handler(self, client, action, session, content_name, desc_elt): |
285 content_data = session["contents"][content_name] | 285 content_data = session["contents"][content_name] |
286 application_data = content_data["application_data"] | 286 application_data = content_data["application_data"] |
287 if action in (self._j.A_ACCEPTED_ACK, self._j.A_SESSION_INITIATE): | 287 if action in (self._j.A_ACCEPTED_ACK, self._j.A_SESSION_INITIATE): |