diff sat/memory/memory.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 5060cbeec01e
children 003b8b4b56a7
line wrap: on
line diff
--- a/sat/memory/memory.py	Fri Jan 11 10:18:02 2019 +0100
+++ b/sat/memory/memory.py	Fri Jan 11 11:13:15 2019 +0100
@@ -353,14 +353,14 @@
         """
         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 @@
 
         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 @@
                 {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 @@
         @return: a Deferred instance
         """
 
-        def cleanMemory(dummy):
+        def cleanMemory(__):
             self.auth_sessions.profileDelUnique(name)
             try:
                 del self._entities_cache[name]
@@ -1100,7 +1100,7 @@
 
             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}