Started to fix some unused loop variable warnings.

Mon, 12 Mar 2018 19:57:16 +0100

author
Detlev Offenbach <detlev@die-offenbachs.de>
date
Mon, 12 Mar 2018 19:57:16 +0100
changeset 6187
2cc7e3629784
parent 6186
83451f10f3eb
child 6188
5a6ae3be31e6

Started to fix some unused loop variable warnings.

DataViews/CodeMetrics.py file | annotate | diff | comparison | revisions
DataViews/PyProfileDialog.py file | annotate | diff | comparison | revisions
E5Gui/E5GenericDiffHighlighter.py file | annotate | diff | comparison | revisions
E5Gui/E5SideBar.py file | annotate | diff | comparison | revisions
E5Gui/E5ToolBarManager.py file | annotate | diff | comparison | revisions
HexEdit/HexEditUndoStack.py file | annotate | diff | comparison | revisions
PluginManager/PluginManager.py file | annotate | diff | comparison | revisions
WebBrowser/SafeBrowsing/SafeBrowsingManager.py file | annotate | diff | comparison | revisions
WebBrowser/WebBrowserWindow.py file | annotate | diff | comparison | revisions
install-i18n.py file | annotate | diff | comparison | revisions
--- a/DataViews/CodeMetrics.py	Mon Mar 12 19:49:46 2018 +0100
+++ b/DataViews/CodeMetrics.py	Mon Mar 12 19:57:16 2018 +0100
@@ -171,7 +171,7 @@
         @param key the key to be incremented
         @param value the increment (int)
         """
-        for counterId, level, row in self.active:
+        for counterId, _level, _row in self.active:
             counters = self.counters.setdefault(counterId, {})
             counters[key] = counters.setdefault(key, 0) + value
 
--- a/DataViews/PyProfileDialog.py	Mon Mar 12 19:49:46 2018 +0100
+++ b/DataViews/PyProfileDialog.py	Mon Mar 12 19:57:16 2018 +0100
@@ -169,7 +169,7 @@
             self.resultList.setSortingEnabled(False)
             
             # now go through all the files
-            for func, (cc, nc, tt, ct, callers) in list(self.stats.items()):
+            for func, (cc, nc, tt, ct, _callers) in list(self.stats.items()):
                 if self.cancelled:
                     return
                 
--- a/E5Gui/E5GenericDiffHighlighter.py	Mon Mar 12 19:49:46 2018 +0100
+++ b/E5Gui/E5GenericDiffHighlighter.py	Mon Mar 12 19:57:16 2018 +0100
@@ -62,7 +62,7 @@
         @param rules set of highlighting rules (list of tuples of rule
             pattern (string) and highlighting format (QTextCharFormat))
         """
-        for idx, ruleFormat in enumerate(rules):
+        for _idx, ruleFormat in enumerate(rules):
             rule, formats = ruleFormat
             terminal = rule.startswith(TERMINAL(''))
             if terminal:
--- a/E5Gui/E5SideBar.py	Mon Mar 12 19:49:46 2018 +0100
+++ b/E5Gui/E5SideBar.py	Mon Mar 12 19:57:16 2018 +0100
@@ -617,7 +617,7 @@
         self.__maxSize = max(stream.readUInt16(), maxSize)
         count = stream.readUInt16()
         self.splitterSizes = []
-        for i in range(count):
+        for _ in range(count):
             self.splitterSizes.append(stream.readUInt16())
         
         self.__autoHide = stream.readBool()
--- a/E5Gui/E5ToolBarManager.py	Mon Mar 12 19:49:46 2018 +0100
+++ b/E5Gui/E5ToolBarManager.py	Mon Mar 12 19:57:16 2018 +0100
@@ -549,11 +549,11 @@
             return False
         
         toolBarCount = stream.readUInt16()
-        for i in range(toolBarCount):
+        for _i in range(toolBarCount):
             objectName = Utilities.readStringFromStream(stream)
             actionCount = stream.readUInt16()
             actions = []
-            for j in range(actionCount):
+            for _j in range(actionCount):
                 actionName = Utilities.readStringFromStream(stream)
                 if actionName:
                     action = self.__findAction(actionName)
@@ -572,12 +572,12 @@
         oldCustomToolBars = self.__customToolBars[:]
         
         toolBarCount = stream.readUInt16()
-        for i in range(toolBarCount):
+        for _i in range(toolBarCount):
             objectName = Utilities.readStringFromStream(stream)
             toolBarTitle = Utilities.readStringFromStream(stream)
             actionCount = stream.readUInt16()
             actions = []
-            for j in range(actionCount):
+            for _j in range(actionCount):
                 actionName = Utilities.readStringFromStream(stream)
                 if actionName:
                     action = self.__findAction(actionName)
--- a/HexEdit/HexEditUndoStack.py	Mon Mar 12 19:49:46 2018 +0100
+++ b/HexEdit/HexEditUndoStack.py	Mon Mar 12 19:57:16 2018 +0100
@@ -181,7 +181,7 @@
             else:
                 txt = self.tr("Deleting %n byte(s)", "", length)
                 self.beginMacro(txt)
-                for cnt in range(length):
+                for _cnt in range(length):
                     uc = HexEditUndoCommand(
                         self.__chunks, HexEditCommand.RemoveAt, pos, 0)
                     self.push(uc)
--- a/PluginManager/PluginManager.py	Mon Mar 12 19:49:46 2018 +0100
+++ b/PluginManager/PluginManager.py	Mon Mar 12 19:57:16 2018 +0100
@@ -883,7 +883,7 @@
         """
         pluginDict = {}
         
-        for name, module in \
+        for _name, module in \
             list(self.__onDemandActiveModules.items()) + \
                 list(self.__onDemandInactiveModules.items()):
             if getattr(module, "pluginType") == type_ and \
@@ -909,7 +909,7 @@
         @param name name of the plugin type (string)
         @return preview pixmap (QPixmap)
         """
-        for modname, module in \
+        for _modname, module in \
             list(self.__onDemandActiveModules.items()) + \
                 list(self.__onDemandInactiveModules.items()):
             if getattr(module, "pluginType") == type_ and \
@@ -1089,7 +1089,7 @@
         """
         vcsDict = {}
         
-        for name, module in \
+        for _name, module in \
             list(self.__onDemandActiveModules.items()) + \
                 list(self.__onDemandInactiveModules.items()):
             if getattr(module, "pluginType") == "version_control":
@@ -1350,7 +1350,7 @@
         
         @param type_ type of the plugin to clear private data for (string)
         """
-        for name, module in \
+        for _name, module in \
             list(self.__onDemandActiveModules.items()) + \
             list(self.__onDemandInactiveModules.items()) + \
             list(self.__activeModules.items()) + \
--- a/WebBrowser/SafeBrowsing/SafeBrowsingManager.py	Mon Mar 12 19:49:46 2018 +0100
+++ b/WebBrowser/SafeBrowsing/SafeBrowsingManager.py	Mon Mar 12 19:57:16 2018 +0100
@@ -246,7 +246,7 @@
         
         # step 2: update threat lists
         threatListsForRemove = {}
-        for threatList, clientState in self.__cache.getThreatLists():
+        for threatList, _clientState in self.__cache.getThreatLists():
             threatListsForRemove[repr(threatList)] = threatList
         threatLists = self.__apiClient.getThreatLists()
         maximum = len(threatLists)
@@ -404,7 +404,7 @@
         matchingFullHashes = set()
         isPotentialThreat = False
         # Lookup hash prefixes which match full URL hash
-        for threatList, hashPrefix, negativeCacheExpired in \
+        for _threatList, hashPrefix, negativeCacheExpired in \
                 self.__cache.lookupHashPrefix(cues):
             for fullHash in fullHashes:
                 if fullHash.startswith(hashPrefix):
@@ -486,7 +486,7 @@
         negativeCacheDuration = int(
             fullHashResponses["negativeCacheDuration"].rstrip("s"))
         for prefixValue in hashPrefixes:
-            for threatList, clientState in threatLists:
+            for threatList, _clientState in threatLists:
                 self.__cache.updateHashPrefixExpiration(
                     threatList, prefixValue, negativeCacheDuration)
     
--- a/WebBrowser/WebBrowserWindow.py	Mon Mar 12 19:49:46 2018 +0100
+++ b/WebBrowser/WebBrowserWindow.py	Mon Mar 12 19:57:16 2018 +0100
@@ -4289,11 +4289,11 @@
                 self.__setStatusBarVisible(act.isChecked())
             
             elif name == "__SHOW__":
-                for text, tb in list(self.__toolbars.values()):
+                for _text, tb in list(self.__toolbars.values()):
                     tb.show()
             
             elif name == "__HIDE__":
-                for text, tb in list(self.__toolbars.values()):
+                for _text, tb in list(self.__toolbars.values()):
                     tb.hide()
             
             else:
@@ -4558,7 +4558,7 @@
                 self.__searchWidget.hide()
                 self.__tabWidget.tabBar().hide()
                 if Preferences.getWebBrowser("ShowToolbars"):
-                    for title, toolbar in self.__toolbars.values():
+                    for _title, toolbar in self.__toolbars.values():
                         if toolbar is not self.__bookmarksToolBar:
                             toolbar.hide()
                 self.__navigationBar.exitFullScreenButton().setVisible(True)
--- a/install-i18n.py	Mon Mar 12 19:49:46 2018 +0100
+++ b/install-i18n.py	Mon Mar 12 19:57:16 2018 +0100
@@ -106,7 +106,7 @@
 
     global platBinDir
     
-    for opt, arg in optlist:
+    for opt, _arg in optlist:
         if opt == "-h":
             usage(0)
         elif opt == "-p":

eric ide

mercurial