eric6/WebBrowser/SafeBrowsing/SafeBrowsingCache.py

changeset 7628
f904d0eef264
parent 7360
9190402e4505
child 7759
51aa6c6b66f7
diff -r 7f643d41464e -r f904d0eef264 eric6/WebBrowser/SafeBrowsing/SafeBrowsingCache.py
--- a/eric6/WebBrowser/SafeBrowsing/SafeBrowsingCache.py	Wed Jun 17 17:12:21 2020 +0200
+++ b/eric6/WebBrowser/SafeBrowsing/SafeBrowsingCache.py	Wed Jun 17 20:18:54 2020 +0200
@@ -284,12 +284,14 @@
             VALUES
                 (?, ?, ?, ?, ?, current_timestamp)
         """
-        updateQueryStr = """
+        updateQueryStr = (
+            """
             UPDATE full_hash SET
-                expires_at=datetime(current_timestamp, '+{0} SECONDS')
+            expires_at=datetime(current_timestamp, '+{0} SECONDS')
             WHERE value=? AND threat_type=? AND platform_type=? AND
             threat_entry_type=?
-        """.format(int(cacheDuration))
+            """.format(int(cacheDuration))
+        )
         
         db = QSqlDatabase.database(self.__connectionName)
         if db.isOpen():
@@ -352,10 +354,12 @@
         @param keepExpiredFor time period in seconds of entries to be expired
         @type int or float
         """
-        queryStr = """
+        queryStr = (
+            """
             DELETE FROM full_hash
-                WHERE expires_at=datetime(current_timestamp, '{0} SECONDS')
-        """.format(int(keepExpiredFor))
+            WHERE expires_at=datetime(current_timestamp, '{0} SECONDS')
+            """.format(int(keepExpiredFor))
+        )
         
         db = QSqlDatabase.database(self.__connectionName)
         if db.isOpen():
@@ -381,12 +385,14 @@
             in the cache
         @type int or float
         """
-        queryStr = """
+        queryStr = (
+            """
             UPDATE hash_prefix
             SET negative_expires_at=datetime(current_timestamp, '+{0} SECONDS')
             WHERE value=? AND threat_type=? AND platform_type=? AND
             threat_entry_type=?
-        """.format(int(negativeCacheDuration))
+            """.format(int(negativeCacheDuration))
+        )
         
         db = QSqlDatabase.database(self.__connectionName)
         if db.isOpen():
@@ -657,11 +663,13 @@
         @param indexes list of indexes of prefixes to be removed
         @type list of int
         """
-        queryStr = """
+        queryStr = (
+            """
             DELETE FROM hash_prefix
             WHERE threat_type=? AND platform_type=? AND
             threat_entry_type=? AND value IN ({0})
-        """
+            """
+        )
         batchSize = 40
         
         prefixesToRemove = self.getHashPrefixValuesToRemove(
@@ -692,3 +700,6 @@
                             QEventLoop.AllEvents, self.maxProcessEventsTime)
                 finally:
                     db.commit()
+
+#
+# eflag: noqa = S608

eric ide

mercurial