misc: replaced all "dummy" by the more conventional and readable "__" ("_" being used for gettext)
This commit is contained in:
parent
fa0179f87e
commit
7a9ee35cfc
1 changed files with 215 additions and 215 deletions
|
|
@ -353,14 +353,14 @@ class Memory(object):
|
|||
"""
|
||||
profile = self.getProfileName(profile)
|
||||
|
||||
def createSession(dummy):
|
||||
def createSession(__):
|
||||
"""Called once params are loaded."""
|
||||
self._entities_cache[profile] = {}
|
||||
log.info(u"[{}] Profile session started".format(profile))
|
||||
return False
|
||||
|
||||
def backendInitialised(dummy):
|
||||
def doStartSession(dummy=None):
|
||||
def backendInitialised(__):
|
||||
def doStartSession(__=None):
|
||||
if self.isSessionStarted(profile):
|
||||
log.info("Session already started!")
|
||||
return True
|
||||
|
|
@ -558,7 +558,7 @@ class Memory(object):
|
|||
|
||||
d = self.params.createProfile(name, component)
|
||||
|
||||
def initPersonalKey(dummy):
|
||||
def initPersonalKey(__):
|
||||
# be sure to call this after checking that the profile doesn't exist yet
|
||||
personal_key = BlockCipher.getRandomKey(
|
||||
base64=True
|
||||
|
|
@ -567,24 +567,24 @@ class Memory(object):
|
|||
{C.MEMORY_CRYPTO_KEY: personal_key}, profile=name
|
||||
) # will be encrypted by setParam
|
||||
|
||||
def startFakeSession(dummy):
|
||||
def startFakeSession(__):
|
||||
# avoid ProfileNotConnected exception in setParam
|
||||
self._entities_cache[name] = None
|
||||
self.params.loadIndParams(name)
|
||||
|
||||
def stopFakeSession(dummy):
|
||||
def stopFakeSession(__):
|
||||
del self._entities_cache[name]
|
||||
self.params.purgeProfile(name)
|
||||
|
||||
d.addCallback(initPersonalKey)
|
||||
d.addCallback(startFakeSession)
|
||||
d.addCallback(
|
||||
lambda dummy: self.setParam(
|
||||
lambda __: self.setParam(
|
||||
C.PROFILE_PASS_PATH[1], password, C.PROFILE_PASS_PATH[0], profile_key=name
|
||||
)
|
||||
)
|
||||
d.addCallback(stopFakeSession)
|
||||
d.addCallback(lambda dummy: self.auth_sessions.profileDelUnique(name))
|
||||
d.addCallback(lambda __: self.auth_sessions.profileDelUnique(name))
|
||||
return d
|
||||
|
||||
def asyncDeleteProfile(self, name, force=False):
|
||||
|
|
@ -596,7 +596,7 @@ class Memory(object):
|
|||
@return: a Deferred instance
|
||||
"""
|
||||
|
||||
def cleanMemory(dummy):
|
||||
def cleanMemory(__):
|
||||
self.auth_sessions.profileDelUnique(name)
|
||||
try:
|
||||
del self._entities_cache[name]
|
||||
|
|
@ -1100,7 +1100,7 @@ class Memory(object):
|
|||
|
||||
return d.addCallback(cb)
|
||||
|
||||
def done(dummy):
|
||||
def done(__):
|
||||
log.debug(
|
||||
_(u"Personal data (%(ns)s, %(key)s) has been successfuly encrypted")
|
||||
% {"ns": C.MEMORY_CRYPTO_NAMESPACE, "key": data_key}
|
||||
|
|
|
|||
Loading…
Reference in a new issue