Finished fixing code style issues detected by the extended style checker.

Sat, 11 Mar 2017 19:17:59 +0100

author
Detlev Offenbach <detlev@die-offenbachs.de>
date
Sat, 11 Mar 2017 19:17:59 +0100
changeset 5605
1950fe1a32c4
parent 5604
b047181a4a33
child 5606
da305d172769

Finished fixing code style issues detected by the extended style checker.

WebBrowser/AdBlock/AdBlockDialog.py file | annotate | diff | comparison | revisions
WebBrowser/AdBlock/AdBlockRule.py file | annotate | diff | comparison | revisions
WebBrowser/AdBlock/AdBlockTreeWidget.py file | annotate | diff | comparison | revisions
WebBrowser/Bookmarks/BookmarksImportDialog.py file | annotate | diff | comparison | revisions
WebBrowser/Bookmarks/BookmarksImporters/BookmarksImporter.py file | annotate | diff | comparison | revisions
WebBrowser/Bookmarks/BookmarksImporters/ChromeImporter.py file | annotate | diff | comparison | revisions
WebBrowser/Bookmarks/BookmarksImporters/FirefoxImporter.py file | annotate | diff | comparison | revisions
WebBrowser/Bookmarks/BookmarksImporters/HtmlImporter.py file | annotate | diff | comparison | revisions
WebBrowser/Bookmarks/BookmarksImporters/IExplorerImporter.py file | annotate | diff | comparison | revisions
WebBrowser/Bookmarks/BookmarksImporters/OperaImporter.py file | annotate | diff | comparison | revisions
WebBrowser/Bookmarks/BookmarksImporters/SafariImporter.py file | annotate | diff | comparison | revisions
WebBrowser/Bookmarks/BookmarksImporters/XbelImporter.py file | annotate | diff | comparison | revisions
WebBrowser/Bookmarks/BookmarksImporters/__init__.py file | annotate | diff | comparison | revisions
WebBrowser/FlashCookieManager/FlashCookieManagerDialog.py file | annotate | diff | comparison | revisions
WebBrowser/Network/EricSchemeHandler.py file | annotate | diff | comparison | revisions
WebBrowser/Network/QtHelpSchemeHandler.py file | annotate | diff | comparison | revisions
WebBrowser/OpenSearch/OpenSearchManager.py file | annotate | diff | comparison | revisions
WebBrowser/Passwords/PasswordManager.py file | annotate | diff | comparison | revisions
WebBrowser/QtHelp/HelpIndexWidget.py file | annotate | diff | comparison | revisions
WebBrowser/QtHelp/QtHelpDocumentationDialog.py file | annotate | diff | comparison | revisions
WebBrowser/QtHelp/QtHelpFiltersDialog.py file | annotate | diff | comparison | revisions
WebBrowser/TabManager/TabManagerWidget.py file | annotate | diff | comparison | revisions
--- a/WebBrowser/AdBlock/AdBlockDialog.py	Sat Mar 11 18:08:42 2017 +0100
+++ b/WebBrowser/AdBlock/AdBlockDialog.py	Sat Mar 11 19:17:59 2017 +0100
@@ -155,15 +155,15 @@
         menu.addAction(self.tr("Learn more about writing rules..."),
                        self.__learnAboutWritingFilters)
     
-    def addCustomRule(self, filter):
+    def addCustomRule(self, filterRule):
         """
         Public slot to add a custom AdBlock rule.
         
-        @param filter filter to be added (string)
+        @param filterRule filter to be added (string)
         """
         self.subscriptionsTabWidget.setCurrentIndex(
             self.subscriptionsTabWidget.count() - 1)
-        self.__currentTreeWidget.addRule(filter)
+        self.__currentTreeWidget.addRule(filterRule)
     
     def __addCustomRule(self):
         """
@@ -313,14 +313,14 @@
             self.useLimitedEasyListCheckBox.setVisible(isEasyList)
     
     @pyqtSlot(str)
-    def on_searchEdit_textChanged(self, filter):
+    def on_searchEdit_textChanged(self, filterRule):
         """
         Private slot to set a new filter on the current widget.
         
-        @param filter filter to be set (string)
+        @param filterRule filter to be set (string)
         """
         if self.__currentTreeWidget and self.adBlockGroup.isChecked():
-            self.__currentTreeWidget.filterString(filter)
+            self.__currentTreeWidget.filterString(filterRule)
     
     @pyqtSlot(bool)
     def on_adBlockGroup_toggled(self, state):
--- a/WebBrowser/AdBlock/AdBlockRule.py	Sat Mar 11 18:08:42 2017 +0100
+++ b/WebBrowser/AdBlock/AdBlockRule.py	Sat Mar 11 19:17:59 2017 +0100
@@ -42,11 +42,11 @@
     """
     Class implementing the AdBlock rule.
     """
-    def __init__(self, filter="", subscription=None):
+    def __init__(self, filterRule="", subscription=None):
         """
         Constructor
         
-        @param filter filter string of the rule (string)
+        @param filterRule filter string of the rule (string)
         @param subscription reference to the subscription object
             (AdBlockSubscription)
         """
@@ -86,7 +86,7 @@
         self.__objectSubrequestException = False
         self.__stringMatchRule = False
         
-        self.setFilter(filter)
+        self.setFilter(filterRule)
     
     def subscription(self):
         """
@@ -104,13 +104,13 @@
         """
         return self.__filter
     
-    def setFilter(self, filter):
+    def setFilter(self, filterRule):
         """
         Public method to set the rule filter string.
         
-        @param filter rule filter string (string)
+        @param filterRule rule filter string (string)
         """
-        self.__filter = filter
+        self.__filter = filterRule
         self.__parseFilter()
     
     def __parseFilter(self):
--- a/WebBrowser/AdBlock/AdBlockTreeWidget.py	Sat Mar 11 18:08:42 2017 +0100
+++ b/WebBrowser/AdBlock/AdBlockTreeWidget.py	Sat Mar 11 19:17:59 2017 +0100
@@ -106,26 +106,26 @@
         QApplication.restoreOverrideCursor()
         QApplication.processEvents()
     
-    def addRule(self, filter=""):
+    def addRule(self, filterRule=""):
         """
         Public slot to add a new rule.
         
-        @param filter filter to be added (string)
+        @param filterRule filter to be added (string)
         """
         if not self.__subscription.canEditRules():
             return
         
-        if not filter:
-            filter, ok = QInputDialog.getText(
+        if not filterRule:
+            filterRule, ok = QInputDialog.getText(
                 self,
                 self.tr("Add Custom Rule"),
                 self.tr("Write your rule here:"),
                 QLineEdit.Normal)
-            if not ok or filter == "":
+            if not ok or filterRule == "":
                 return
         
         from .AdBlockRule import AdBlockRule
-        rule = AdBlockRule(filter, self.__subscription)
+        rule = AdBlockRule(filterRule, self.__subscription)
         self.__subscription.addRule(rule)
     
     def removeRule(self):
--- a/WebBrowser/Bookmarks/BookmarksImportDialog.py	Sat Mar 11 18:08:42 2017 +0100
+++ b/WebBrowser/Bookmarks/BookmarksImportDialog.py	Sat Mar 11 19:17:59 2017 +0100
@@ -115,11 +115,11 @@
             else:
                 self.filePicker.setMode(E5PathPickerModes.OpenFileMode)
                 if Globals.isMacPlatform():
-                    filter = "*{0}".format(
+                    fileFilter = "*{0}".format(
                         os.path.splitext(self.__sourceFile)[1])
                 else:
-                    filter = self.__sourceFile
-                self.filePicker.setFilters(filter)
+                    fileFilter = self.__sourceFile
+                self.filePicker.setFilters(fileFilter)
             self.filePicker.setDefaultDirectory(self.__sourceDir)
         
         elif self.__currentPage == 1:
--- a/WebBrowser/Bookmarks/BookmarksImporters/BookmarksImporter.py	Sat Mar 11 18:08:42 2017 +0100
+++ b/WebBrowser/Bookmarks/BookmarksImporters/BookmarksImporter.py	Sat Mar 11 19:17:59 2017 +0100
@@ -16,11 +16,11 @@
     """
     Class implementing the base class for the bookmarks importers.
     """
-    def __init__(self, id="", parent=None):
+    def __init__(self, sourceId="", parent=None):
         """
         Constructor
         
-        @param id source ID (string)
+        @param sourceId source ID (string)
         @param parent reference to the parent object (QObject)
         """
         super(BookmarksImporter, self).__init__(parent)
@@ -29,7 +29,7 @@
         self._file = ""
         self._error = False
         self._errorString = ""
-        self._id = id
+        self._id = sourceId
     
     def setPath(self, path):
         """
--- a/WebBrowser/Bookmarks/BookmarksImporters/ChromeImporter.py	Sat Mar 11 18:08:42 2017 +0100
+++ b/WebBrowser/Bookmarks/BookmarksImporters/ChromeImporter.py	Sat Mar 11 19:17:59 2017 +0100
@@ -20,18 +20,18 @@
 import Globals
 
 
-def getImporterInfo(id):
+def getImporterInfo(sourceId):
     """
     Module function to get information for the given source id.
     
-    @param id id of the browser ("chrome" or "chromium")
+    @param sourceId id of the browser ("chrome" or "chromium")
     @return tuple with an icon (QPixmap), readable name (string), name of
         the default bookmarks file (string), an info text (string),
         a prompt (string) and the default directory of the bookmarks file
         (string)
     @exception ValueError raised to indicate an invalid browser ID
     """
-    if id == "chrome":
+    if sourceId == "chrome":
         if Globals.isWindowsPlatform():
             standardDir = os.path.expandvars(
                 "%USERPROFILE%\\AppData\\Local\\Google\\Chrome\\"
@@ -55,7 +55,7 @@
                 """Please choose the file to begin importing bookmarks."""),
             standardDir,
         )
-    elif id == "chromium":
+    elif sourceId == "chromium":
         if Globals.isWindowsPlatform():
             standardDir = os.path.expandvars(
                 "%USERPROFILE%\\AppData\\Local\\Google\\Chrome\\"
@@ -76,21 +76,22 @@
             standardDir,
         )
     else:
-        raise ValueError("Unsupported browser ID given ({0}).".format(id))
+        raise ValueError(
+            "Unsupported browser ID given ({0}).".format(sourceId))
 
 
 class ChromeImporter(BookmarksImporter):
     """
     Class implementing the Chrome bookmarks importer.
     """
-    def __init__(self, id="", parent=None):
+    def __init__(self, sourceId="", parent=None):
         """
         Constructor
         
-        @param id source ID (string)
+        @param sourceId source ID (string)
         @param parent reference to the parent object (QObject)
         """
-        super(ChromeImporter, self).__init__(id, parent)
+        super(ChromeImporter, self).__init__(sourceId, parent)
         
         self.__fileName = ""
     
--- a/WebBrowser/Bookmarks/BookmarksImporters/FirefoxImporter.py	Sat Mar 11 18:08:42 2017 +0100
+++ b/WebBrowser/Bookmarks/BookmarksImporters/FirefoxImporter.py	Sat Mar 11 19:17:59 2017 +0100
@@ -20,18 +20,18 @@
 import Globals
 
 
-def getImporterInfo(id):
+def getImporterInfo(sourceId):
     """
     Module function to get information for the given source id.
     
-    @param id id of the browser ("chrome" or "chromium")
+    @param sourceId id of the browser ("chrome" or "chromium")
     @return tuple with an icon (QPixmap), readable name (string), name of
         the default bookmarks file (string), an info text (string),
         a prompt (string) and the default directory of the bookmarks file
         (string)
     @exception ValueError raised to indicate an invalid browser ID
     """
-    if id == "firefox":
+    if sourceId == "firefox":
         if Globals.isWindowsPlatform():
             standardDir = os.path.expandvars(
                 "%APPDATA%\\Mozilla\\Firefox\\Profiles")
@@ -55,21 +55,22 @@
             standardDir,
         )
     else:
-        raise ValueError("Unsupported browser ID given ({0}).".format(id))
+        raise ValueError(
+            "Unsupported browser ID given ({0}).".format(sourceId))
 
 
 class FirefoxImporter(BookmarksImporter):
     """
     Class implementing the Chrome bookmarks importer.
     """
-    def __init__(self, id="", parent=None):
+    def __init__(self, sourceId="", parent=None):
         """
         Constructor
         
-        @param id source ID (string)
+        @param sourceId source ID (string)
         @param parent reference to the parent object (QObject)
         """
-        super(FirefoxImporter, self).__init__(id, parent)
+        super(FirefoxImporter, self).__init__(sourceId, parent)
         
         self.__fileName = ""
         self.__db = None
--- a/WebBrowser/Bookmarks/BookmarksImporters/HtmlImporter.py	Sat Mar 11 18:08:42 2017 +0100
+++ b/WebBrowser/Bookmarks/BookmarksImporters/HtmlImporter.py	Sat Mar 11 19:17:59 2017 +0100
@@ -18,18 +18,18 @@
 import UI.PixmapCache
 
 
-def getImporterInfo(id):
+def getImporterInfo(sourceId):
     """
     Module function to get information for the given HTML source id.
     
-    @param id id of the browser ("chrome" or "chromium")
+    @param sourceId id of the browser ("chrome" or "chromium")
     @return tuple with an icon (QPixmap), readable name (string), name of
         the default bookmarks file (string), an info text (string),
         a prompt (string) and the default directory of the bookmarks file
         (string)
     @exception ValueError raised to indicate an invalid browser ID
     """
-    if id == "html":
+    if sourceId == "html":
         return (
             UI.PixmapCache.getPixmap("html.png"),
             "HTML Netscape Bookmarks",
@@ -47,21 +47,22 @@
             "",
         )
     else:
-        raise ValueError("Unsupported browser ID given ({0}).".format(id))
+        raise ValueError(
+            "Unsupported browser ID given ({0}).".format(sourceId))
 
 
 class HtmlImporter(BookmarksImporter):
     """
     Class implementing the HTML bookmarks importer.
     """
-    def __init__(self, id="", parent=None):
+    def __init__(self, sourceId="", parent=None):
         """
         Constructor
         
-        @param id source ID (string)
+        @param sourceId source ID (string)
         @param parent reference to the parent object (QObject)
         """
-        super(HtmlImporter, self).__init__(id, parent)
+        super(HtmlImporter, self).__init__(sourceId, parent)
         
         self.__fileName = ""
         self.__inFile = None
--- a/WebBrowser/Bookmarks/BookmarksImporters/IExplorerImporter.py	Sat Mar 11 18:08:42 2017 +0100
+++ b/WebBrowser/Bookmarks/BookmarksImporters/IExplorerImporter.py	Sat Mar 11 19:17:59 2017 +0100
@@ -19,18 +19,18 @@
 import Globals
 
 
-def getImporterInfo(id):
+def getImporterInfo(sourceId):
     """
     Module function to get information for the given source id.
     
-    @param id id of the browser ("chrome" or "chromium")
+    @param sourceId id of the browser ("chrome" or "chromium")
     @return tuple with an icon (QPixmap), readable name (string), name of
         the default bookmarks file (string), an info text (string),
         a prompt (string) and the default directory of the bookmarks file
         (string)
     @exception ValueError raised to indicate an invalid browser ID
     """
-    if id == "ie":
+    if sourceId == "ie":
         if Globals.isWindowsPlatform():
             standardDir = os.path.expandvars(
                 "%USERPROFILE%\\Favorites")
@@ -51,21 +51,22 @@
             standardDir,
         )
     else:
-        raise ValueError("Unsupported browser ID given ({0}).".format(id))
+        raise ValueError(
+            "Unsupported browser ID given ({0}).".format(sourceId))
 
 
 class IExplorerImporter(BookmarksImporter):
     """
     Class implementing the Chrome bookmarks importer.
     """
-    def __init__(self, id="", parent=None):
+    def __init__(self, sourceId="", parent=None):
         """
         Constructor
         
-        @param id source ID (string)
+        @param sourceId source ID (string)
         @param parent reference to the parent object (QObject)
         """
-        super(IExplorerImporter, self).__init__(id, parent)
+        super(IExplorerImporter, self).__init__(sourceId, parent)
         
         self.__fileName = ""
     
@@ -107,11 +108,12 @@
         importRootNode = BookmarkNode(BookmarkNode.Folder)
         folders[self.__fileName] = importRootNode
         
-        for dir, subdirs, files in os.walk(self.__fileName):
+        for directory, subdirs, files in os.walk(self.__fileName):
             for subdir in subdirs:
-                path = os.path.join(dir, subdir)
-                if dir in folders:
-                    folder = BookmarkNode(BookmarkNode.Folder, folders[dir])
+                path = os.path.join(directory, subdir)
+                if directory in folders:
+                    folder = BookmarkNode(BookmarkNode.Folder,
+                                          folders[directory])
                 else:
                     folder = BookmarkNode(BookmarkNode.Folder, importRootNode)
                 folder.title = subdir.replace("&", "&&")
@@ -120,7 +122,7 @@
             for file in files:
                 name, ext = os.path.splitext(file)
                 if ext.lower() == ".url":
-                    path = os.path.join(dir, file)
+                    path = os.path.join(directory, file)
                     try:
                         f = open(path, "r")
                         contents = f.read()
@@ -133,9 +135,9 @@
                             url = line.replace("URL=", "")
                             break
                     if url:
-                        if dir in folders:
+                        if directory in folders:
                             bookmark = BookmarkNode(BookmarkNode.Bookmark,
-                                                    folders[dir])
+                                                    folders[directory])
                         else:
                             bookmark = BookmarkNode(BookmarkNode.Bookmark,
                                                     importRootNode)
--- a/WebBrowser/Bookmarks/BookmarksImporters/OperaImporter.py	Sat Mar 11 18:08:42 2017 +0100
+++ b/WebBrowser/Bookmarks/BookmarksImporters/OperaImporter.py	Sat Mar 11 19:17:59 2017 +0100
@@ -19,18 +19,18 @@
 import Globals
 
 
-def getImporterInfo(id):
+def getImporterInfo(sourceId):
     """
     Module function to get information for the given source id.
     
-    @param id id of the browser ("chrome" or "chromium")
+    @param sourceId id of the browser ("chrome" or "chromium")
     @return tuple with an icon (QPixmap), readable name (string), name of
         the default bookmarks file (string), an info text (string),
         a prompt (string) and the default directory of the bookmarks file
         (string)
     @exception ValueError raised to indicate an invalid browser ID
     """
-    if id == "opera":
+    if sourceId == "opera":
         if Globals.isWindowsPlatform():
             standardDir = os.path.expandvars("%APPDATA%\\Opera\\Opera")
         elif Globals.isMacPlatform():
@@ -52,21 +52,22 @@
             standardDir,
         )
     else:
-        raise ValueError("Unsupported browser ID given ({0}).".format(id))
+        raise ValueError(
+            "Unsupported browser ID given ({0}).".format(sourceId))
 
 
 class OperaImporter(BookmarksImporter):
     """
     Class implementing the Opera bookmarks importer.
     """
-    def __init__(self, id="", parent=None):
+    def __init__(self, sourceId="", parent=None):
         """
         Constructor
         
-        @param id source ID (string)
+        @param sourceId source ID (string)
         @param parent reference to the parent object (QObject)
         """
-        super(OperaImporter, self).__init__(id, parent)
+        super(OperaImporter, self).__init__(sourceId, parent)
         
         self.__fileName = ""
     
--- a/WebBrowser/Bookmarks/BookmarksImporters/SafariImporter.py	Sat Mar 11 18:08:42 2017 +0100
+++ b/WebBrowser/Bookmarks/BookmarksImporters/SafariImporter.py	Sat Mar 11 19:17:59 2017 +0100
@@ -21,18 +21,18 @@
 from Utilities import binplistlib
 
 
-def getImporterInfo(id):
+def getImporterInfo(sourceId):
     """
     Module function to get information for the given source id.
     
-    @param id id of the browser ("chrome" or "chromium")
+    @param sourceId id of the browser ("chrome" or "chromium")
     @return tuple with an icon (QPixmap), readable name (string), name of
         the default bookmarks file (string), an info text (string),
         a prompt (string) and the default directory of the bookmarks file
         (string)
     @exception ValueError raised to indicate an invalid browser ID
     """
-    if id == "safari":
+    if sourceId == "safari":
         if Globals.isWindowsPlatform():
             standardDir = os.path.expandvars(
                 "%APPDATA%\\Apple Computer\\Safari")
@@ -55,21 +55,22 @@
             standardDir,
         )
     else:
-        raise ValueError("Unsupported browser ID given ({0}).".format(id))
+        raise ValueError(
+            "Unsupported browser ID given ({0}).".format(sourceId))
 
 
 class SafariImporter(BookmarksImporter):
     """
     Class implementing the Apple Safari bookmarks importer.
     """
-    def __init__(self, id="", parent=None):
+    def __init__(self, sourceId="", parent=None):
         """
         Constructor
         
-        @param id source ID (string)
+        @param sourceId source ID (string)
         @param parent reference to the parent object (QObject)
         """
-        super(SafariImporter, self).__init__(id, parent)
+        super(SafariImporter, self).__init__(sourceId, parent)
         
         self.__fileName = ""
     
--- a/WebBrowser/Bookmarks/BookmarksImporters/XbelImporter.py	Sat Mar 11 18:08:42 2017 +0100
+++ b/WebBrowser/Bookmarks/BookmarksImporters/XbelImporter.py	Sat Mar 11 19:17:59 2017 +0100
@@ -18,18 +18,18 @@
 import UI.PixmapCache
 
 
-def getImporterInfo(id):
+def getImporterInfo(sourceId):
     """
     Module function to get information for the given XBEL source id.
     
-    @param id id of the browser ("chrome" or "chromium")
+    @param sourceId id of the browser ("chrome" or "chromium")
     @return tuple with an icon (QPixmap), readable name (string), name of
         the default bookmarks file (string), an info text (string),
         a prompt (string) and the default directory of the bookmarks file
         (string)
     @exception ValueError raised to indicate an invalid browser ID
     """
-    if id == "e5browser":
+    if sourceId == "e5browser":
         from ..BookmarksManager import BookmarksManager
         bookmarksFile = BookmarksManager.getFileName()
         return (
@@ -46,7 +46,7 @@
                 """Please choose the file to begin importing bookmarks."""),
             os.path.dirname(bookmarksFile),
         )
-    elif id == "konqueror":
+    elif sourceId == "konqueror":
         if os.path.exists(os.path.expanduser("~/.kde4")):
             standardDir = os.path.expanduser("~/.kde4/share/apps/konqueror")
         elif os.path.exists(os.path.expanduser("~/.kde")):
@@ -67,7 +67,7 @@
                 """Please choose the file to begin importing bookmarks."""),
             standardDir,
         )
-    elif id == "xbel":
+    elif sourceId == "xbel":
         return (
             UI.PixmapCache.getPixmap("xbel.png"),
             "XBEL Bookmarks",
@@ -84,21 +84,22 @@
             "",
         )
     else:
-        raise ValueError("Unsupported browser ID given ({0}).".format(id))
+        raise ValueError(
+            "Unsupported browser ID given ({0}).".format(sourceId))
 
 
 class XbelImporter(BookmarksImporter):
     """
     Class implementing the XBEL bookmarks importer.
     """
-    def __init__(self, id="", parent=None):
+    def __init__(self, sourceId="", parent=None):
         """
         Constructor
         
-        @param id source ID (string)
+        @param sourceId source ID (string)
         @param parent reference to the parent object (QObject)
         """
-        super(XbelImporter, self).__init__(id, parent)
+        super(XbelImporter, self).__init__(sourceId, parent)
         
         self.__fileName = ""
     
--- a/WebBrowser/Bookmarks/BookmarksImporters/__init__.py	Sat Mar 11 18:08:42 2017 +0100
+++ b/WebBrowser/Bookmarks/BookmarksImporters/__init__.py	Sat Mar 11 19:17:59 2017 +0100
@@ -55,71 +55,71 @@
     return importers
 
 
-def getImporterInfo(id):
+def getImporterInfo(sourceId):
     """
     Module function to get information for the given source id.
     
-    @param id source id to get info for (string)
+    @param sourceId source id to get info for (string)
     @return tuple with an icon (QPixmap), readable name (string), name of
         the default bookmarks file (string), an info text (string),
         a prompt (string) and the default directory of the bookmarks
         file (string)
     @exception ValueError raised to indicate an unsupported importer
     """
-    if id in ["e5browser", "xbel", "konqueror"]:
+    if sourceId in ["e5browser", "xbel", "konqueror"]:
         from . import XbelImporter
-        return XbelImporter.getImporterInfo(id)
-    elif id == "html":
+        return XbelImporter.getImporterInfo(sourceId)
+    elif sourceId == "html":
         from . import HtmlImporter
-        return HtmlImporter.getImporterInfo(id)
-    elif id in ["chrome", "chromium"]:
+        return HtmlImporter.getImporterInfo(sourceId)
+    elif sourceId in ["chrome", "chromium"]:
         from . import ChromeImporter
-        return ChromeImporter.getImporterInfo(id)
-    elif id == "opera":
+        return ChromeImporter.getImporterInfo(sourceId)
+    elif sourceId == "opera":
         from . import OperaImporter
-        return OperaImporter.getImporterInfo(id)
-    elif id == "firefox":
+        return OperaImporter.getImporterInfo(sourceId)
+    elif sourceId == "firefox":
         from . import FirefoxImporter
-        return FirefoxImporter.getImporterInfo(id)
-    elif id == "ie":
+        return FirefoxImporter.getImporterInfo(sourceId)
+    elif sourceId == "ie":
         from . import IExplorerImporter
-        return IExplorerImporter.getImporterInfo(id)
-    elif id == "safari":
+        return IExplorerImporter.getImporterInfo(sourceId)
+    elif sourceId == "safari":
         from . import SafariImporter
-        return SafariImporter.getImporterInfo(id)
+        return SafariImporter.getImporterInfo(sourceId)
     else:
-        raise ValueError("Invalid importer ID given ({0}).".format(id))
+        raise ValueError("Invalid importer ID given ({0}).".format(sourceId))
 
 
-def getImporter(id, parent=None):
+def getImporter(sourceId, parent=None):
     """
     Module function to get an importer for the given source id.
     
-    @param id source id to get an importer for (string)
+    @param sourceId source id to get an importer for (string)
     @param parent reference to the parent object (QObject)
     @return bookmarks importer (BookmarksImporter)
     @exception ValueError raised to indicate an unsupported importer
     """
-    if id in ["e5browser", "xbel", "konqueror"]:
+    if sourceId in ["e5browser", "xbel", "konqueror"]:
         from . import XbelImporter
-        return XbelImporter.XbelImporter(id, parent)
-    elif id == "html":
+        return XbelImporter.XbelImporter(sourceId, parent)
+    elif sourceId == "html":
         from . import HtmlImporter
-        return HtmlImporter.HtmlImporter(id, parent)
-    elif id in ["chrome", "chromium"]:
+        return HtmlImporter.HtmlImporter(sourceId, parent)
+    elif sourceId in ["chrome", "chromium"]:
         from . import ChromeImporter
-        return ChromeImporter.ChromeImporter(id, parent)
-    elif id == "opera":
+        return ChromeImporter.ChromeImporter(sourceId, parent)
+    elif sourceId == "opera":
         from . import OperaImporter
-        return OperaImporter.OperaImporter(id, parent)
-    elif id == "firefox":
+        return OperaImporter.OperaImporter(sourceId, parent)
+    elif sourceId == "firefox":
         from . import FirefoxImporter
-        return FirefoxImporter.FirefoxImporter(id, parent)
-    elif id == "ie":
+        return FirefoxImporter.FirefoxImporter(sourceId, parent)
+    elif sourceId == "ie":
         from . import IExplorerImporter
-        return IExplorerImporter.IExplorerImporter(id, parent)
-    elif id == "safari":
+        return IExplorerImporter.IExplorerImporter(sourceId, parent)
+    elif sourceId == "safari":
         from . import SafariImporter
-        return SafariImporter.SafariImporter(id, parent)
+        return SafariImporter.SafariImporter(sourceId, parent)
     else:
-        raise ValueError("No importer for ID {0}.".format(id))
+        raise ValueError("No importer for ID {0}.".format(sourceId))
--- a/WebBrowser/FlashCookieManager/FlashCookieManagerDialog.py	Sat Mar 11 18:08:42 2017 +0100
+++ b/WebBrowser/FlashCookieManager/FlashCookieManagerDialog.py	Sat Mar 11 19:17:59 2017 +0100
@@ -149,26 +149,26 @@
             self.blackList.addItem(origin)
     
     @pyqtSlot(str)
-    def on_filterEdit_textChanged(self, filter):
+    def on_filterEdit_textChanged(self, filterStr):
         """
         Private slot to filter the cookies list.
         
-        @param filter filter text
+        @param filterStr filter text
         @type str
         """
-        if not filter:
+        if not filterStr:
             # show all in collapsed state
             for index in range(self.cookiesList.topLevelItemCount()):
                 self.cookiesList.topLevelItem(index).setHidden(False)
                 self.cookiesList.topLevelItem(index).setExpanded(False)
         else:
             # show matching in expanded state
-            filter = filter.lower()
+            filterStr = filterStr.lower()
             for index in range(self.cookiesList.topLevelItemCount()):
                 txt = "." + self.cookiesList.topLevelItem(index)\
                     .text(0).lower()
                 self.cookiesList.topLevelItem(index).setHidden(
-                    filter not in txt)
+                    filterStr not in txt)
                 self.cookiesList.topLevelItem(index).setExpanded(True)
     
     @pyqtSlot(QTreeWidgetItem, QTreeWidgetItem)
--- a/WebBrowser/Network/EricSchemeHandler.py	Sat Mar 11 18:08:42 2017 +0100
+++ b/WebBrowser/Network/EricSchemeHandler.py	Sat Mar 11 19:17:59 2017 +0100
@@ -58,9 +58,9 @@
         """
         Private slot handling the closed signal of a reply.
         """
-        object = self.sender()
-        if object and object in self.__replies:
-            self.__replies.remove(object)
+        reply = self.sender()
+        if reply and reply in self.__replies:
+            self.__replies.remove(reply)
 
 
 class EricSchemeReply(QIODevice):
--- a/WebBrowser/Network/QtHelpSchemeHandler.py	Sat Mar 11 18:08:42 2017 +0100
+++ b/WebBrowser/Network/QtHelpSchemeHandler.py	Sat Mar 11 19:17:59 2017 +0100
@@ -89,9 +89,9 @@
         """
         Private slot handling the closed signal of a reply.
         """
-        object = self.sender()
-        if object and object in self.__replies:
-            self.__replies.remove(object)
+        reply = self.sender()
+        if reply and reply in self.__replies:
+            self.__replies.remove(reply)
 
 
 class QtHelpSchemeReply(QIODevice):
--- a/WebBrowser/OpenSearch/OpenSearchManager.py	Sat Mar 11 18:08:42 2017 +0100
+++ b/WebBrowser/OpenSearch/OpenSearchManager.py	Sat Mar 11 19:17:59 2017 +0100
@@ -342,17 +342,17 @@
         
         @param dirName name of the directory to write the files to (string)
         """
-        dir = QDir()
-        if not dir.mkpath(dirName):
+        qdir = QDir()
+        if not qdir.mkpath(dirName):
             return
-        dir.setPath(dirName)
+        qdir.setPath(dirName)
         
         from .OpenSearchWriter import OpenSearchWriter
         writer = OpenSearchWriter()
         
         for engine in list(self.__engines.values()):
             name = self.generateEngineFileName(engine.name())
-            fileName = dir.filePath(name)
+            fileName = qdir.filePath(name)
             
             file = QFile(fileName)
             if not file.open(QIODevice.WriteOnly):
@@ -388,9 +388,9 @@
         
         success = False
         
-        dir = QDir(dirName)
-        for name in dir.entryList(["*.xml"]):
-            fileName = dir.filePath(name)
+        qdir = QDir(dirName)
+        for name in qdir.entryList(["*.xml"]):
+            fileName = qdir.filePath(name)
             if self.__addEngineByFile(fileName):
                 success = True
         
--- a/WebBrowser/Passwords/PasswordManager.py	Sat Mar 11 18:08:42 2017 +0100
+++ b/WebBrowser/Passwords/PasswordManager.py	Sat Mar 11 19:17:59 2017 +0100
@@ -396,9 +396,10 @@
         for key in self.__logins:
             progress.setValue(count)
             QCoreApplication.processEvents()
-            username, hash = self.__logins[key]
-            hash = Utilities.crypto.pwRecode(hash, oldPassword, newPassword)
-            self.__logins[key] = (username, hash)
+            username, pwHash = self.__logins[key]
+            pwHash = Utilities.crypto.pwRecode(
+                pwHash, oldPassword, newPassword)
+            self.__logins[key] = (username, pwHash)
             count += 1
         
         # step 2: do the login forms
--- a/WebBrowser/QtHelp/HelpIndexWidget.py	Sat Mar 11 18:08:42 2017 +0100
+++ b/WebBrowser/QtHelp/HelpIndexWidget.py	Sat Mar 11 19:17:59 2017 +0100
@@ -130,16 +130,16 @@
             link = dlg.link()
         return link
     
-    def __filterIndices(self, filter):
+    def __filterIndices(self, indexFilter):
         """
-        Private slot to filter the indices according to the given filter.
+        Private slot to filter the indexes according to the given filter.
         
-        @param filter filter to be used (string)
+        @param indexFilter filter to be used (string)
         """
-        if '*' in filter:
-            self.__index.filterIndices(filter, filter)
+        if '*' in indexFilter:
+            self.__index.filterIndices(indexFilter, indexFilter)
         else:
-            self.__index.filterIndices(filter)
+            self.__index.filterIndices(indexFilter)
     
     def __enableSearchEdit(self):
         """
--- a/WebBrowser/QtHelp/QtHelpDocumentationDialog.py	Sat Mar 11 18:08:42 2017 +0100
+++ b/WebBrowser/QtHelp/QtHelpDocumentationDialog.py	Sat Mar 11 19:17:59 2017 +0100
@@ -176,9 +176,9 @@
                 if not res:
                     return
             self.__unregisteredDocs.append(ns)
-            for id in openedDocs:
-                if openedDocs[id] == ns and id not in self.__tabsToClose:
-                    self.__tabsToClose.append(id)
+            for docId in openedDocs:
+                if openedDocs[docId] == ns and docId not in self.__tabsToClose:
+                    self.__tabsToClose.append(docId)
             itm = self.documentsList.takeItem(self.documentsList.row(item))
             del itm
             
--- a/WebBrowser/QtHelp/QtHelpFiltersDialog.py	Sat Mar 11 18:08:42 2017 +0100
+++ b/WebBrowser/QtHelp/QtHelpFiltersDialog.py	Sat Mar 11 19:17:59 2017 +0100
@@ -43,22 +43,22 @@
         self.filtersList.clear()
         self.attributesList.clear()
         
-        help = QHelpEngineCore(self.__engine.collectionFile())
-        help.setupData()
+        helpEngineCore = QHelpEngineCore(self.__engine.collectionFile())
+        helpEngineCore.setupData()
         
         self.__removedFilters = []
         self.__filterMap = {}
         self.__filterMapBackup = {}
         self.__removedAttributes = []
         
-        for filter in help.customFilters():
-            atts = help.filterAttributes(filter)
-            self.__filterMapBackup[filter] = atts
-            if filter not in self.__filterMap:
-                self.__filterMap[filter] = atts
+        for customFilter in helpEngineCore.customFilters():
+            atts = helpEngineCore.filterAttributes(customFilter)
+            self.__filterMapBackup[customFilter] = atts
+            if customFilter not in self.__filterMap:
+                self.__filterMap[customFilter] = atts
         
         self.filtersList.addItems(sorted(self.__filterMap.keys()))
-        for attr in help.filterAttributes():
+        for attr in helpEngineCore.filterAttributes():
             QTreeWidgetItem(self.attributesList, [attr])
         self.attributesList.sortItems(0, Qt.AscendingOrder)
         
@@ -103,8 +103,8 @@
         if self.filtersList.currentItem() is None:
             return
         
-        filter = self.filtersList.currentItem().text()
-        if filter not in self.__filterMap:
+        customFilter = self.filtersList.currentItem().text()
+        if customFilter not in self.__filterMap:
             return
         
         newAtts = []
@@ -112,7 +112,7 @@
             itm = self.attributesList.topLevelItem(index)
             if itm.checkState(0) == Qt.Checked:
                 newAtts.append(itm.text(0))
-        self.__filterMap[filter] = newAtts
+        self.__filterMap[customFilter] = newAtts
     
     @pyqtSlot()
     def on_attributesList_itemSelectionChanged(self):
@@ -127,19 +127,20 @@
         """
         Private slot to add a new filter.
         """
-        filter, ok = QInputDialog.getText(
+        customFilter, ok = QInputDialog.getText(
             None,
             self.tr("Add Filter"),
             self.tr("Filter name:"),
             QLineEdit.Normal)
-        if not filter:
+        if not customFilter:
             return
         
-        if filter not in self.__filterMap:
-            self.__filterMap[filter] = []
-            self.filtersList.addItem(filter)
+        if customFilter not in self.__filterMap:
+            self.__filterMap[customFilter] = []
+            self.filtersList.addItem(customFilter)
         
-        itm = self.filtersList.findItems(filter, Qt.MatchCaseSensitive)[0]
+        itm = self.filtersList.findItems(
+            customFilter, Qt.MatchCaseSensitive)[0]
         self.filtersList.setCurrentItem(itm)
     
     @pyqtSlot()
@@ -193,9 +194,9 @@
             
             attr = itm.text(0)
             self.__removedAttributes.append(attr)
-            for filter in self.__filterMap:
-                if attr in self.__filterMap[filter]:
-                    self.__filterMap[filter].remove(attr)
+            for customFilter in self.__filterMap:
+                if attr in self.__filterMap[customFilter]:
+                    self.__filterMap[customFilter].remove(attr)
             
             del itm
     
@@ -206,8 +207,8 @@
         """
         # step 1: determine all used attributes
         attributes = set()
-        for filter in self.__filterMap:
-            attributes |= set(self.__filterMap[filter])
+        for customFilter in self.__filterMap:
+            attributes |= set(self.__filterMap[customFilter])
         
         # step 2: select all unused attribute items
         self.attributesList.clearSelection()
@@ -241,12 +242,12 @@
         if len(self.__filterMapBackup) != len(self.__filterMap):
             filtersChanged = True
         else:
-            for filter in self.__filterMapBackup:
-                if filter not in self.__filterMap:
+            for customFilter in self.__filterMapBackup:
+                if customFilter not in self.__filterMap:
                     filtersChanged = True
                 else:
-                    oldFilterAtts = self.__filterMapBackup[filter]
-                    newFilterAtts = self.__filterMap[filter]
+                    oldFilterAtts = self.__filterMapBackup[customFilter]
+                    newFilterAtts = self.__filterMap[customFilter]
                     if len(oldFilterAtts) != len(newFilterAtts):
                         filtersChanged = True
                     else:
@@ -259,10 +260,11 @@
                     break
         
         if filtersChanged:
-            for filter in self.__removedFilters:
-                self.__engine.removeCustomFilter(filter)
-            for filter in self.__filterMap:
-                self.__engine.addCustomFilter(filter, self.__filterMap[filter])
+            for customFilter in self.__removedFilters:
+                self.__engine.removeCustomFilter(customFilter)
+            for customFilter in self.__filterMap:
+                self.__engine.addCustomFilter(
+                    customFilter, self.__filterMap[customFilter])
         
         if self.__removedAttributes:
             self.__removeAttributes()
--- a/WebBrowser/TabManager/TabManagerWidget.py	Sat Mar 11 18:08:42 2017 +0100
+++ b/WebBrowser/TabManager/TabManagerWidget.py	Sat Mar 11 19:17:59 2017 +0100
@@ -142,15 +142,15 @@
                     
                     self.__mw.bookmarksManager().addBookmark(folder, bookmark)
     
-    def __setGroupType(self, type):
+    def __setGroupType(self, groupType):
         """
         Private method to set the 'Group By' type.
         
-        @param type 'Group By' type to be set
+        @param groupType 'Group By' type to be set
         @type int (0 - 2)
         """
-        self.__groupType = type
-        Preferences.setWebBrowser("TabManagerGroupByType", type)
+        self.__groupType = groupType
+        Preferences.setWebBrowser("TabManagerGroupByType", groupType)
     
     def domainFromUrl(self, url, useHostName=False):
         """
@@ -215,9 +215,9 @@
         if act is None:
             return
         
-        type = act.data()
-        if self.__groupType != type:
-            self.__setGroupType(type)
+        groupType = act.data()
+        if self.__groupType != groupType:
+            self.__setGroupType(groupType)
             self.delayedRefreshTree()
             self.groupTypeChanged.emit(self.__groupType)
     

eric ide

mercurial