diff sat/memory/sqlite.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 6487b8855c9a
children 003b8b4b56a7
line wrap: on
line diff
--- a/sat/memory/sqlite.py	Fri Jan 11 10:18:02 2019 +0100
+++ b/sat/memory/sqlite.py	Fri Jan 11 11:13:15 2019 +0100
@@ -289,7 +289,7 @@
         def setComponent(profile_id):
             id_ = profile_id[0][0]
             d_comp = self.dbpool.runQuery("INSERT INTO components(profile_id, entry_point) VALUES (?, ?)", (id_, component))
-            d_comp.addCallback(lambda dummy: profile_id)
+            d_comp.addCallback(lambda __: profile_id)
             return d_comp
 
         def profile_created(profile_id):
@@ -401,7 +401,7 @@
 
     ## History
 
-    def _addToHistoryCb(self, dummy, data):
+    def _addToHistoryCb(self, __, data):
         # Message metadata were successfuly added to history
         # now we can add message and subject
         uid = data['uid']
@@ -409,7 +409,7 @@
             for lang, value in data[key].iteritems():
                 d = self.dbpool.runQuery("INSERT INTO {key}(history_uid, {key}, language) VALUES (?,?,?)".format(key=key),
                     (uid, value, lang or None))
-                d.addErrback(lambda dummy: log.error(_(u"Can't save following {key} in history (uid: {uid}, lang:{lang}): {value}".format(
+                d.addErrback(lambda __: log.error(_(u"Can't save following {key} in history (uid: {uid}, lang:{lang}): {value}".format(
                     key=key, uid=uid, lang=lang, value=value))))
         try:
             thread = data['extra']['thread']
@@ -419,7 +419,7 @@
             thread_parent = data['extra'].get('thread_parent')
             d = self.dbpool.runQuery("INSERT INTO thread(history_uid, thread_id, parent_id) VALUES (?,?,?)",
                 (uid, thread, thread_parent))
-            d.addErrback(lambda dummy: log.error(_(u"Can't save following thread in history (uid: {uid}): thread:{thread}), parent:{parent}".format(
+            d.addErrback(lambda __: log.error(_(u"Can't save following thread in history (uid: {uid}): thread:{thread}), parent:{parent}".format(
                 uid=uid, thread=thread, parent=thread_parent))))
 
     def _addToHistoryEb(self, failure_, data):
@@ -1362,7 +1362,7 @@
         if rows:
             log.info("fixing duplicate timestamp")
             fixed = []
-            for timestamp, dummy in rows:
+            for timestamp, __ in rows:
                 ids_rows = yield self.dbpool.runQuery("SELECT id from history where timestamp=?", (timestamp,))
                 for idx, (id_,) in enumerate(ids_rows):
                     fixed.append(id_)
@@ -1486,7 +1486,7 @@
                 list_.append(d)
 
             d_list = defer.DeferredList(list_)
-            d_list.addCallback(lambda dummy: ret)
+            d_list.addCallback(lambda __: ret)
             return d_list
 
         def updateLiberviaConf(values):
@@ -1507,6 +1507,6 @@
 
         d = self.dbpool.runQuery("SELECT id FROM profiles WHERE name='libervia'")
         d.addCallback(updateLiberviaConf)
-        d.addCallback(lambda dummy: self.dbpool.runQuery("SELECT profile_id,value FROM param_ind WHERE category=? AND name=?", xmpp_pass_path))
+        d.addCallback(lambda __: self.dbpool.runQuery("SELECT profile_id,value FROM param_ind WHERE category=? AND name=?", xmpp_pass_path))
         d.addCallback(encrypt_values)
         return d