Mercurial > libervia-backend
comparison sat/plugins/plugin_xep_0166.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 |
---|---|
874 transport_d.addCallback(addElement, content_elt) | 874 transport_d.addCallback(addElement, content_elt) |
875 defers_list.append(transport_d) | 875 defers_list.append(transport_d) |
876 | 876 |
877 d_list = defer.DeferredList(defers_list) | 877 d_list = defer.DeferredList(defers_list) |
878 d_list.addCallback( | 878 d_list.addCallback( |
879 lambda dummy: self._callPlugins( | 879 lambda __: self._callPlugins( |
880 client, | 880 client, |
881 XEP_0166.A_PREPARE_RESPONDER, | 881 XEP_0166.A_PREPARE_RESPONDER, |
882 session, | 882 session, |
883 app_method_name=None, | 883 app_method_name=None, |
884 elements=False, | 884 elements=False, |
885 ) | 885 ) |
886 ) | 886 ) |
887 d_list.addCallback(lambda dummy: iq_elt.send()) | 887 d_list.addCallback(lambda __: iq_elt.send()) |
888 | 888 |
889 def changeState(dummy, session): | 889 def changeState(__, session): |
890 session["state"] = STATE_ACTIVE | 890 session["state"] = STATE_ACTIVE |
891 | 891 |
892 d_list.addCallback(changeState, session) | 892 d_list.addCallback(changeState, session) |
893 d_list.addCallback( | 893 d_list.addCallback( |
894 lambda dummy: self._callPlugins( | 894 lambda __: self._callPlugins( |
895 client, XEP_0166.A_ACCEPTED_ACK, session, elements=False | 895 client, XEP_0166.A_ACCEPTED_ACK, session, elements=False |
896 ) | 896 ) |
897 ) | 897 ) |
898 d_list.addErrback(self._iqError, session["id"], client) | 898 d_list.addErrback(self._iqError, session["id"], client) |
899 return d_list | 899 return d_list |
918 elements=False, | 918 elements=False, |
919 force_element=reason_elt, | 919 force_element=reason_elt, |
920 ) | 920 ) |
921 terminate_dlist = defer.DeferredList(terminate_defers) | 921 terminate_dlist = defer.DeferredList(terminate_defers) |
922 | 922 |
923 terminate_dlist.addCallback(lambda dummy: self._delSession(client, session["id"])) | 923 terminate_dlist.addCallback(lambda __: self._delSession(client, session["id"])) |
924 client.send(xmlstream.toResponse(request, "result")) | 924 client.send(xmlstream.toResponse(request, "result")) |
925 | 925 |
926 def onSessionAccept(self, client, request, jingle_elt, session): | 926 def onSessionAccept(self, client, request, jingle_elt, session): |
927 """Method called once session is accepted | 927 """Method called once session is accepted |
928 | 928 |
949 | 949 |
950 negociate_dlist = defer.DeferredList(negociate_defers) | 950 negociate_dlist = defer.DeferredList(negociate_defers) |
951 | 951 |
952 # after negociations we start the transfer | 952 # after negociations we start the transfer |
953 negociate_dlist.addCallback( | 953 negociate_dlist.addCallback( |
954 lambda dummy: self._callPlugins( | 954 lambda __: self._callPlugins( |
955 client, XEP_0166.A_START, session, app_method_name=None, elements=False | 955 client, XEP_0166.A_START, session, app_method_name=None, elements=False |
956 ) | 956 ) |
957 ) | 957 ) |
958 | 958 |
959 def _onSessionCb(self, result, client, request, jingle_elt, session): | 959 def _onSessionCb(self, result, client, request, jingle_elt, session): |
1107 | 1107 |
1108 negociate_dlist = defer.DeferredList(negociate_defers) | 1108 negociate_dlist = defer.DeferredList(negociate_defers) |
1109 | 1109 |
1110 # after negociations we start the transfer | 1110 # after negociations we start the transfer |
1111 negociate_dlist.addCallback( | 1111 negociate_dlist.addCallback( |
1112 lambda dummy: self._callPlugins( | 1112 lambda __: self._callPlugins( |
1113 client, XEP_0166.A_START, session, app_method_name=None, elements=False | 1113 client, XEP_0166.A_START, session, app_method_name=None, elements=False |
1114 ) | 1114 ) |
1115 ) | 1115 ) |
1116 | 1116 |
1117 def onTransportReject(self, client, request, jingle_elt, session): | 1117 def onTransportReject(self, client, request, jingle_elt, session): |