misc: replaced all "dummy" by the more conventional and readable "__" ("_" being used for gettext)

This commit is contained in:
Goffi 2019-01-11 11:13:15 +01:00
commit 7a9ee35cfc

View file

@ -225,7 +225,7 @@ class MiscAccount(object):
@return Deferred
"""
d = self.createProfile(password, jid_s, profile)
d.addCallback(lambda dummy: self.sendEmails(email, profile))
d.addCallback(lambda __: self.sendEmails(email, profile))
return d
def createProfile(self, password, jid_s, profile):
@ -246,7 +246,7 @@ class MiscAccount(object):
return defer.fail(Failure(exceptions.ConflictError))
d = self.host.memory.createProfile(profile, password)
d.addCallback(lambda dummy: self.profileCreated(password, jid_s, profile))
d.addCallback(lambda __: self.profileCreated(password, jid_s, profile))
return d
def profileCreated(self, password, jid_s, profile):
@ -267,7 +267,7 @@ class MiscAccount(object):
jid_ = jid.JID(jid_s)
d = self.host.plugins["XEP-0077"].registerNewAccount(jid_, password)
def setParams(dummy):
def setParams(__):
self.host.memory.setParam(
"JabberID", jid_s, "Connection", profile_key=profile
)
@ -280,9 +280,9 @@ class MiscAccount(object):
self.host.memory.asyncDeleteProfile(profile)
return failure
d.addCallback(lambda dummy: self.host.memory.startSession(password, profile))
d.addCallback(lambda __: self.host.memory.startSession(password, profile))
d.addCallback(setParams)
d.addCallback(lambda dummy: self.host.memory.stopSession(profile))
d.addCallback(lambda __: self.host.memory.stopSession(profile))
d.addErrback(removeProfile)
return d
@ -317,12 +317,12 @@ class MiscAccount(object):
admins_emails_txt = u", ".join([u"<" + addr + u">" for addr in admins_emails])
d_admin.addCallbacks(
lambda dummy: log.debug(
lambda __: log.debug(
u"Account creation notification sent to admin(s) {}".format(
admins_emails_txt
)
),
lambda dummy: log.error(
lambda __: log.error(
u"Failed to send account creation notification to admin {}".format(
admins_emails_txt
)
@ -343,7 +343,7 @@ class MiscAccount(object):
# FIXME: delete the profile if the email could not been sent?
d_user = sat_email.sendEmail(self.host, [email], subject, body)
d_user.addCallbacks(
lambda dummy: log.debug(
lambda __: log.debug(
u"Account creation confirmation sent to <{}>".format(email)
),
self._sendEmailEb,
@ -485,7 +485,7 @@ class MiscAccount(object):
@param password (str): the new password
@param profile (str): %(doc_profile)s
"""
session_id, dummy = self._sessions.newSession(
session_id, __ = self._sessions.newSession(
{"new_password": password}, profile=profile
)
form_ui = xml_tools.XMLUI(
@ -511,7 +511,7 @@ class MiscAccount(object):
password = self._sessions.profileGet(data["session_id"], profile)["new_password"]
del self._sessions[data["session_id"]]
def passwordChanged(dummy):
def passwordChanged(__):
d = self.host.memory.setParam(
C.PROFILE_PASS_PATH[1],
password,
@ -519,7 +519,7 @@ class MiscAccount(object):
profile_key=profile,
)
d.addCallback(
lambda dummy: self.host.memory.setParam(
lambda __: self.host.memory.setParam(
"Password", password, "Connection", profile_key=profile
)
)
@ -576,7 +576,7 @@ class MiscAccount(object):
"""
client = self.host.getClient(profile)
def userDeleted(dummy):
def userDeleted(__):
# FIXME: client should be disconnected at this point, so 2 next loop should be removed (to be confirmed)
for jid_ in client.roster._jids: # empty roster
@ -594,7 +594,7 @@ class MiscAccount(object):
d = self.host.plugins["GROUPBLOG"].deleteAllGroupBlogsAndComments(
profile_key=profile
)
d.addCallback(lambda dummy: delete_profile())
d.addCallback(lambda __: delete_profile())
else:
delete_profile()
@ -739,7 +739,7 @@ class MiscAccount(object):
d = self.createProfile(password, jid_s, jid_s)
d.addCallback(
lambda dummy: self.host.memory.getProfileName(jid_s)
lambda __: self.host.memory.getProfileName(jid_s)
) # checks if the profile has been successfuly created
d.addCallback(self.host.connect, password, {}, 0)