Mercurial > libervia-backend
comparison sat/plugins/plugin_xep_0065.py @ 2765:378188abe941
misc: replaced all "dummy" by the more conventional and readable "__" ("_" being used for gettext)
author | Goffi <goffi@goffi.org> |
---|---|
date | Fri, 11 Jan 2019 11:13:15 +0100 |
parents | 56f94936df1e |
children | 003b8b4b56a7 |
comparison
equal
deleted
inserted
replaced
2764:92af49cde255 | 2765:378188abe941 |
---|---|
697 self.connector.disconnect() | 697 self.connector.disconnect() |
698 | 698 |
699 def getSession(self): | 699 def getSession(self): |
700 return self.session | 700 return self.session |
701 | 701 |
702 def startTransfer(self, dummy=None, chunk_size=None): | 702 def startTransfer(self, __=None, chunk_size=None): |
703 self.session[TIMER_KEY].cancel() | 703 self.session[TIMER_KEY].cancel() |
704 self._protocol_instance.startTransfer(chunk_size) | 704 self._protocol_instance.startTransfer(chunk_size) |
705 | 705 |
706 def clientConnectionFailed(self, connector, reason): | 706 def clientConnectionFailed(self, connector, reason): |
707 log.debug(u"Connection failed") | 707 log.debug(u"Connection failed") |
1017 d = self.connectCandidate( | 1017 d = self.connectCandidate( |
1018 client, candidate, session_hash, peer_session_hash, delay | 1018 client, candidate, session_hash, peer_session_hash, delay |
1019 ) | 1019 ) |
1020 if connection_cb is not None: | 1020 if connection_cb is not None: |
1021 d.addCallback( | 1021 d.addCallback( |
1022 lambda dummy, candidate=candidate, client=client: connection_cb( | 1022 lambda __, candidate=candidate, client=client: connection_cb( |
1023 client, candidate | 1023 client, candidate |
1024 ) | 1024 ) |
1025 ) | 1025 ) |
1026 if connection_eb is not None: | 1026 if connection_eb is not None: |
1027 d.addErrback(connection_eb, client, candidate) | 1027 d.addErrback(connection_eb, client, candidate) |
1201 | 1201 |
1202 if candidate.type == XEP_0065.TYPE_PROXY: | 1202 if candidate.type == XEP_0065.TYPE_PROXY: |
1203 log.info(u"A Socks5 proxy is used") | 1203 log.info(u"A Socks5 proxy is used") |
1204 d = self.connectCandidate(client, candidate, session_data["hash"]) | 1204 d = self.connectCandidate(client, candidate, session_data["hash"]) |
1205 d.addCallback( | 1205 d.addCallback( |
1206 lambda dummy: candidate.activate( | 1206 lambda __: candidate.activate( |
1207 session_data["id"], session_data["peer_jid"], client | 1207 session_data["id"], session_data["peer_jid"], client |
1208 ) | 1208 ) |
1209 ) | 1209 ) |
1210 d.addErrback(self._activationEb) | 1210 d.addErrback(self._activationEb) |
1211 else: | 1211 else: |
1212 d = defer.succeed(None) | 1212 d = defer.succeed(None) |
1213 | 1213 |
1214 d.addCallback(lambda dummy: candidate.startTransfer(session_data["hash"])) | 1214 d.addCallback(lambda __: candidate.startTransfer(session_data["hash"])) |
1215 | 1215 |
1216 def _activationEb(self, failure): | 1216 def _activationEb(self, failure): |
1217 log.warning(u"Proxy activation error: {}".format(failure.value)) | 1217 log.warning(u"Proxy activation error: {}".format(failure.value)) |
1218 | 1218 |
1219 def _IQNegotiationEb(self, stanza_err, session_data, client): | 1219 def _IQNegotiationEb(self, stanza_err, session_data, client): |