comparison sat/core/sat_main.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 e347e32aa07f
children a97c43dc4924
comparison
equal deleted inserted replaced
2764:92af49cde255 2765:378188abe941
409 @raise exceptions.PasswordError: Profile password is wrong 409 @raise exceptions.PasswordError: Profile password is wrong
410 """ 410 """
411 if options is None: 411 if options is None:
412 options = {} 412 options = {}
413 413
414 def connectProfile(dummy=None): 414 def connectProfile(__=None):
415 if self.isConnected(profile): 415 if self.isConnected(profile):
416 log.info(_("already connected !")) 416 log.info(_("already connected !"))
417 return True 417 return True
418 418
419 if self.memory.isComponent(profile): 419 if self.memory.isComponent(profile):
420 d = xmpp.SatXMPPComponent.startConnection(self, profile, max_retries) 420 d = xmpp.SatXMPPComponent.startConnection(self, profile, max_retries)
421 else: 421 else:
422 d = xmpp.SatXMPPClient.startConnection(self, profile, max_retries) 422 d = xmpp.SatXMPPClient.startConnection(self, profile, max_retries)
423 return d.addCallback(lambda dummy: False) 423 return d.addCallback(lambda __: False)
424 424
425 d = self.memory.startSession(password, profile) 425 d = self.memory.startSession(password, profile)
426 d.addCallback(connectProfile) 426 d.addCallback(connectProfile)
427 return d 427 return d
428 428
490 return d_list 490 return d_list
491 491
492 def getContacts(self, profile_key): 492 def getContacts(self, profile_key):
493 client = self.getClient(profile_key) 493 client = self.getClient(profile_key)
494 494
495 def got_roster(dummy): 495 def got_roster(__):
496 ret = [] 496 ret = []
497 for item in client.roster.getItems(): # we get all items for client's roster 497 for item in client.roster.getItems(): # we get all items for client's roster
498 # and convert them to expected format 498 # and convert them to expected format
499 attr = client.roster.getAttributes(item) 499 attr = client.roster.getAttributes(item)
500 ret.append([item.jid.userhost(), attr, item.groups]) 500 ret.append([item.jid.userhost(), attr, item.groups])
1030 profile = client.profile 1030 profile = client.profile
1031 progress_dict = {} 1031 progress_dict = {}
1032 progress_all[profile] = progress_dict 1032 progress_all[profile] = progress_dict
1033 for ( 1033 for (
1034 progress_id, 1034 progress_id,
1035 (dummy, progress_metadata), 1035 (__, progress_metadata),
1036 ) in client._progress_cb.iteritems(): 1036 ) in client._progress_cb.iteritems():
1037 progress_dict[progress_id] = progress_metadata 1037 progress_dict[progress_id] = progress_metadata
1038 return progress_all 1038 return progress_all
1039 1039
1040 def progressGetAll(self, profile_key): 1040 def progressGetAll(self, profile_key):
1050 progress_all = {} 1050 progress_all = {}
1051 for client in clients: 1051 for client in clients:
1052 profile = client.profile 1052 profile = client.profile
1053 progress_dict = {} 1053 progress_dict = {}
1054 progress_all[profile] = progress_dict 1054 progress_all[profile] = progress_dict
1055 for progress_id, (progress_cb, dummy) in client._progress_cb.iteritems(): 1055 for progress_id, (progress_cb, __) in client._progress_cb.iteritems():
1056 progress_dict[progress_id] = progress_cb(progress_id, profile) 1056 progress_dict[progress_id] = progress_cb(progress_id, profile)
1057 return progress_all 1057 return progress_all
1058 1058
1059 def registerCallback(self, callback, *args, **kwargs): 1059 def registerCallback(self, callback, *args, **kwargs):
1060 """Register a callback. 1060 """Register a callback.