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

Sat, 11 Mar 2017 14:35:22 +0100

author
Detlev Offenbach <detlev@die-offenbachs.de>
date
Sat, 11 Mar 2017 14:35:22 +0100
changeset 5603
4f2dd0850803
parent 5602
77755a5ea30c
child 5604
b047181a4a33

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

PyUnit/UnittestDialog.py file | annotate | diff | comparison | revisions
QScintilla/Editor.py file | annotate | diff | comparison | revisions
QScintilla/EditorButtonsWidget.py file | annotate | diff | comparison | revisions
QScintilla/Exporters/ExporterBase.py file | annotate | diff | comparison | revisions
QScintilla/Exporters/__init__.py file | annotate | diff | comparison | revisions
QScintilla/MiniEditor.py file | annotate | diff | comparison | revisions
QScintilla/QsciScintillaCompat.py file | annotate | diff | comparison | revisions
QScintilla/Shell.py file | annotate | diff | comparison | revisions
QScintilla/TypingCompleters/CompleterPython.py file | annotate | diff | comparison | revisions
Tasks/TaskFilter.py file | annotate | diff | comparison | revisions
Tasks/TaskViewer.py file | annotate | diff | comparison | revisions
Templates/TemplateViewer.py file | annotate | diff | comparison | revisions
Toolbox/Startup.py file | annotate | diff | comparison | revisions
Tools/UIPreviewer.py file | annotate | diff | comparison | revisions
UI/CompareDialog.py file | annotate | diff | comparison | revisions
UI/EmailDialog.py file | annotate | diff | comparison | revisions
UI/FindFileDialog.py file | annotate | diff | comparison | revisions
UI/LogView.py file | annotate | diff | comparison | revisions
UI/NumbersWidget.py file | annotate | diff | comparison | revisions
UI/SymbolsWidget.py file | annotate | diff | comparison | revisions
Utilities/BackgroundClient.py file | annotate | diff | comparison | revisions
Utilities/uic.py file | annotate | diff | comparison | revisions
VCS/VersionControl.py file | annotate | diff | comparison | revisions
--- a/PyUnit/UnittestDialog.py	Sat Mar 11 13:11:29 2017 +0100
+++ b/PyUnit/UnittestDialog.py	Sat Mar 11 14:35:22 2017 +0100
@@ -200,12 +200,12 @@
             py3Extensions = \
                 ' '.join(["*{0}".format(ext)
                           for ext in self.dbs.getExtensions('Python3')])
-            filter = self.tr(
+            fileFilter = self.tr(
                 "Python3 Files ({1});;Python2 Files ({0});;All Files (*)")\
                 .format(py2Extensions, py3Extensions)
         else:
-            filter = self.tr("Python Files (*.py);;All Files (*)")
-        self.testsuitePicker.setFilters(filter)
+            fileFilter = self.tr("Python Files (*.py);;All Files (*)")
+        self.testsuitePicker.setFilters(fileFilter)
         
     @pyqtSlot(str)
     def on_testsuitePicker_pathSelected(self, suite):
@@ -504,43 +504,43 @@
         
         self.unittestStopped.emit()
 
-    def testFailed(self, test, exc, id):
+    def testFailed(self, test, exc, testId):
         """
         Public method called if a test fails.
         
         @param test name of the test (string)
         @param exc string representation of the exception (string)
-        @param id id of the test (string)
+        @param testId id of the test (string)
         """
         self.failCount += 1
         self.progressCounterFailureCount.setText(str(self.failCount))
         itm = QListWidgetItem(self.tr("Failure: {0}").format(test))
         itm.setData(Qt.UserRole, (test, exc))
         self.errorsListWidget.insertItem(0, itm)
-        self.__failedTests.append(id)
+        self.__failedTests.append(testId)
         
-    def testErrored(self, test, exc, id):
+    def testErrored(self, test, exc, testId):
         """
         Public method called if a test errors.
         
         @param test name of the test (string)
         @param exc string representation of the exception (string)
-        @param id id of the test (string)
+        @param testId id of the test (string)
         """
         self.errorCount += 1
         self.progressCounterErrorCount.setText(str(self.errorCount))
         itm = QListWidgetItem(self.tr("Error: {0}").format(test))
         itm.setData(Qt.UserRole, (test, exc))
         self.errorsListWidget.insertItem(0, itm)
-        self.__failedTests.append(id)
+        self.__failedTests.append(testId)
         
-    def testSkipped(self, test, reason, id):
+    def testSkipped(self, test, reason, testId):
         """
         Public method called if a test was skipped.
         
         @param test name of the test (string)
         @param reason reason for skipping the test (string)
-        @param id id of the test (string)
+        @param testId id of the test (string)
         """
         self.skippedCount += 1
         self.progressCounterSkippedCount.setText(str(self.skippedCount))
@@ -548,13 +548,13 @@
         itm.setForeground(Qt.blue)
         self.testsListWidget.insertItem(1, itm)
         
-    def testFailedExpected(self, test, exc, id):
+    def testFailedExpected(self, test, exc, testId):
         """
         Public method called if a test fails expectedly.
         
         @param test name of the test (string)
         @param exc string representation of the exception (string)
-        @param id id of the test (string)
+        @param testId id of the test (string)
         """
         self.expectedFailureCount += 1
         self.progressCounterExpectedFailureCount.setText(
@@ -563,12 +563,12 @@
         itm.setForeground(Qt.blue)
         self.testsListWidget.insertItem(1, itm)
         
-    def testSucceededUnexpected(self, test, id):
+    def testSucceededUnexpected(self, test, testId):
         """
         Public method called if a test succeeds unexpectedly.
         
         @param test name of the test (string)
-        @param id id of the test (string)
+        @param testId id of the test (string)
         """
         self.unexpectedSuccessCount += 1
         self.progressCounterUnexpectedSuccessCount.setText(
--- a/QScintilla/Editor.py	Sat Mar 11 13:11:29 2017 +0100
+++ b/QScintilla/Editor.py	Sat Mar 11 14:35:22 2017 +0100
@@ -1273,7 +1273,7 @@
         @return name of the selected pygments lexer (string)
         """
         from pygments.lexers import get_all_lexers
-        lexerList = sorted([l[0] for l in get_all_lexers()])
+        lexerList = sorted(l[0] for l in get_all_lexers())
         try:
             lexerSel = lexerList.index(
                 self.getLanguage(normalized=False, forPygments=True))
@@ -3002,9 +3002,9 @@
         if self.fileName:
             filterPattern = "(*{0})".format(
                 os.path.splitext(self.fileName)[1])
-            for filter in Lexers.getSaveFileFiltersList(True):
-                if filterPattern in filter:
-                    defaultFilter = filter
+            for fileFilter in Lexers.getSaveFileFiltersList(True):
+                if filterPattern in fileFilter:
+                    defaultFilter = fileFilter
                     break
             else:
                 defaultFilter = Preferences.getEditor("DefaultSaveFilter")
@@ -4647,14 +4647,14 @@
         elif self.autoCompletionSource() != QsciScintilla.AcsNone:
             self.autoCompleteQScintilla()
     
-    def __completionListSelected(self, id, txt):
+    def __completionListSelected(self, listId, txt):
         """
         Private slot to handle the selection from the completion list.
         
-        @param id the ID of the user list (should be 1) (integer)
+        @param listId the ID of the user list (should be 1 or 2) (integer)
         @param txt the selected text (string)
         """
-        if id == EditorAutoCompletionListID:
+        if listId == EditorAutoCompletionListID:
             lst = txt.split()
             if len(lst) > 1:
                 txt = lst[0]
@@ -4674,7 +4674,7 @@
                     txt = txt[len(wLeft):]
             self.insert(txt)
             self.setCursorPosition(line, col + len(txt))
-        elif id == TemplateCompletionListID:
+        elif listId == TemplateCompletionListID:
             self.__applyTemplate(txt, self.getLanguage())
     
     def canProvideDynamicAutoCompletion(self):
@@ -7337,12 +7337,12 @@
         """
         self.__inSharedEdit = True
         self.__savedText = self.text()
-        hash = str(
+        hashStr = str(
             QCryptographicHash.hash(
                 Utilities.encode(self.__savedText, self.encoding)[0],
                 QCryptographicHash.Sha1).toHex(),
             encoding="utf-8")
-        self.__send(Editor.StartEditToken, hash)
+        self.__send(Editor.StartEditToken, hashStr)
     
     def sendSharedEdit(self):
         """
@@ -7432,12 +7432,12 @@
             self.__inRemoteSharedEdit = True
             self.setReadOnly(True)
             self.__updateReadOnly()
-            hash = str(
+            hashStr = str(
                 QCryptographicHash.hash(
                     Utilities.encode(self.text(), self.encoding)[0],
                     QCryptographicHash.Sha1).toHex(),
                 encoding="utf-8")
-            if hash != argsString:
+            if hashStr != argsString:
                 # text is different to the remote site, request to sync it
                 self.__isSyncing = True
                 self.__send(Editor.RequestSyncToken, argsString)
@@ -7515,13 +7515,13 @@
         @param argsString string containing the command parameters (string)
         """
         if self.__inSharedEdit:
-            hash = str(
+            hashStr = str(
                 QCryptographicHash.hash(
                     Utilities.encode(self.__savedText, self.encoding)[0],
                     QCryptographicHash.Sha1).toHex(),
                 encoding="utf-8")
             
-            if hash == argsString:
+            if hashStr == argsString:
                 self.__send(Editor.SyncToken, self.__savedText)
     
     def __processSyncCommand(self, argsString):
--- a/QScintilla/EditorButtonsWidget.py	Sat Mar 11 13:11:29 2017 +0100
+++ b/QScintilla/EditorButtonsWidget.py	Sat Mar 11 14:35:22 2017 +0100
@@ -211,11 +211,11 @@
         
         self.__headerMenu.triggered.connect(self.__headerMenuTriggered)
     
-    def __addButton(self, format, iconName, toolTip):
+    def __addButton(self, formatName, iconName, toolTip):
         """
         Private method to add a format button.
         
-        @param format unique name of the format
+        @param formatName unique name of the format
         @type str
         @param iconName name of the icon for the button
         @type str
@@ -227,9 +227,9 @@
         button = QToolButton(self.__buttonsWidget)
         button.setIcon(UI.PixmapCache.getIcon(iconName))
         button.setToolTip(toolTip)
-        button.clicked.connect(lambda: self.__formatClicked(format))
+        button.clicked.connect(lambda: self.__formatClicked(formatName))
         self.__layout.addWidget(button)
-        self.__buttons[format] = button
+        self.__buttons[formatName] = button
         
         return button
     
@@ -288,40 +288,40 @@
             if Preferences.getEditor("HideFormatButtons"):
                 self.setVisible(self.__provider.kind() != "none")
     
-    def __formatClicked(self, format):
+    def __formatClicked(self, formatName):
         """
         Private slot to handle a format button being clicked.
         
-        @param format format type of the button
+        @param formatName format type of the button
         @type str
         """
-        if format == "bold":
+        if formatName == "bold":
             self.__provider.bold(self.__editor)
-        elif format == "italic":
+        elif formatName == "italic":
             self.__provider.italic(self.__editor)
-        elif format == "strikethrough":
+        elif formatName == "strikethrough":
             self.__provider.strikethrough(self.__editor)
-        elif format.startswith("header"):
+        elif formatName.startswith("header"):
             try:
-                level = int(format[-1])
+                level = int(formatName[-1])
                 self.__provider.header(self.__editor, level)
             except ValueError:
                 pass
-        elif format == "code":
+        elif formatName == "code":
             self.__provider.code(self.__editor)
-        elif format == "codeBlock":
+        elif formatName == "codeBlock":
             self.__provider.codeBlock(self.__editor)
-        elif format == "quote":
+        elif formatName == "quote":
             self.__provider.quote(self.__editor)
-        elif format == "hyperlink":
+        elif formatName == "hyperlink":
             self.__provider.hyperlink(self.__editor)
-        elif format == "line":
+        elif formatName == "line":
             self.__provider.line(self.__editor)
-        elif format == "image":
+        elif formatName == "image":
             self.__provider.image(self.__editor)
-        elif format == "bulletedList":
+        elif formatName == "bulletedList":
             self.__provider.bulletedList(self.__editor)
-        elif format == "numberedList":
+        elif formatName == "numberedList":
             self.__provider.numberedList(self.__editor)
     
     def __headerMenuTriggered(self, act):
@@ -331,8 +331,8 @@
         @param act action of the headers menu that was triggered
         @type QAction
         """
-        format = act.data()
-        self.__formatClicked(format)
+        formatName = act.data()
+        self.__formatClicked(formatName)
     
     def __editorSelectionChanged(self):
         """
--- a/QScintilla/Exporters/ExporterBase.py	Sat Mar 11 13:11:29 2017 +0100
+++ b/QScintilla/Exporters/ExporterBase.py	Sat Mar 11 14:35:22 2017 +0100
@@ -30,22 +30,21 @@
         super(ExporterBase, self).__init__(parent)
         self.editor = editor
     
-    def _getFileName(self, filter):
+    def _getFileName(self, fileFilter):
         """
         Protected method to get the file name of the export file from the user.
         
-        @param filter the filter string to be used (string). The filter for
+        @param fileFilter the filter string to be used (string). The filter for
             "All Files (*)" is appended by this method.
         @return file name entered by the user (string)
         """
-        filter_ = filter
-        filter_ += ";;"
-        filter_ += QCoreApplication.translate('Exporter', "All Files (*)")
+        fileFilter += ";;"
+        fileFilter += QCoreApplication.translate('Exporter', "All Files (*)")
         fn, selectedFilter = E5FileDialog.getSaveFileNameAndFilter(
             self.editor,
             self.tr("Export source"),
             "",
-            filter_,
+            fileFilter,
             "",
             E5FileDialog.Options(E5FileDialog.DontConfirmOverwrite))
         
--- a/QScintilla/Exporters/__init__.py	Sat Mar 11 13:11:29 2017 +0100
+++ b/QScintilla/Exporters/__init__.py	Sat Mar 11 14:35:22 2017 +0100
@@ -31,29 +31,29 @@
     return supportedFormats
 
 
-def getExporter(format, editor):
+def getExporter(exporterFormat, editor):
     """
     Module function to instantiate an exporter object for a given format.
     
-    @param format format of the exporter (string)
+    @param exporterFormat format of the exporter (string)
     @param editor reference to the editor object (QScintilla.Editor.Editor)
     @return reference to the instanciated exporter object
         (QScintilla.Exporter.Exporter)
     """
     try:
-        if format == "HTML":
+        if exporterFormat == "HTML":
             from .ExporterHTML import ExporterHTML
             return ExporterHTML(editor)
-        elif format == "PDF":
+        elif exporterFormat == "PDF":
             from .ExporterPDF import ExporterPDF
             return ExporterPDF(editor)
-        elif format == "RTF":
+        elif exporterFormat == "RTF":
             from .ExporterRTF import ExporterRTF
             return ExporterRTF(editor)
-        elif format == "TeX":
+        elif exporterFormat == "TeX":
             from .ExporterTEX import ExporterTEX
             return ExporterTEX(editor)
-        elif format == "ODT":
+        elif exporterFormat == "ODT":
             from .ExporterODT import ExporterODT
             return ExporterODT(editor)
     except ImportError:
--- a/QScintilla/MiniEditor.py	Sat Mar 11 13:11:29 2017 +0100
+++ b/QScintilla/MiniEditor.py	Sat Mar 11 14:35:22 2017 +0100
@@ -2721,7 +2721,7 @@
         @return name of the selected pygments lexer (string)
         """
         from pygments.lexers import get_all_lexers
-        lexerList = sorted([l[0] for l in get_all_lexers()])
+        lexerList = sorted(l[0] for l in get_all_lexers())
         try:
             lexerSel = lexerList.index(self.getLanguage())
         except ValueError:
--- a/QScintilla/QsciScintillaCompat.py	Sat Mar 11 13:11:29 2017 +0100
+++ b/QScintilla/QsciScintillaCompat.py	Sat Mar 11 14:35:22 2017 +0100
@@ -1432,28 +1432,28 @@
     ###########################################################################
     
     if "showUserList" not in QsciScintilla.__dict__:
-        def showUserList(self, id, lst):
+        def showUserList(self, listId, lst):
             """
             Public method to show a user supplied list.
             
-            @param id id of the list (integer)
+            @param listId id of the list (integer)
             @param lst list to be show (list of strings)
             """
-            if id <= 0:
+            if listId <= 0:
                 return
             
             self.SendScintilla(
                 QsciScintilla.SCI_AUTOCSETSEPARATOR,
                 ord(self.UserSeparator))
             self.SendScintilla(
-                QsciScintilla.SCI_USERLISTSHOW, id,
+                QsciScintilla.SCI_USERLISTSHOW, listId,
                 self._encodeString(self.UserSeparator.join(lst)))
     
     ###########################################################################
     ## work-arounds for buggy behavior
     ###########################################################################
     
-    def __completionListSelected(self, id, txt):
+    def __completionListSelected(self, listId, txt):
         """
         Private slot to handle the selection from the completion list.
         
@@ -1462,7 +1462,7 @@
         list but not giving it back when an item is selected via a
         double-click.
         
-        @param id the ID of the user list (integer)
+        @param listId the ID of the user list (integer)
         @param txt the selected text (string)
         """
         self.activateWindow()
--- a/QScintilla/Shell.py	Sat Mar 11 13:11:29 2017 +0100
+++ b/QScintilla/Shell.py	Sat Mar 11 14:35:22 2017 +0100
@@ -1513,20 +1513,20 @@
             idx -= 1
         return idx
         
-    def focusNextPrevChild(self, next):
+    def focusNextPrevChild(self, nextChild):
         """
         Public method to stop Tab moving to the next window.
         
         While the user is entering a multi-line command, the movement to
         the next window by the Tab key being pressed is suppressed.
         
-        @param next next window
+        @param nextChild next window
         @return flag indicating the movement
         """
-        if next and self.inContinue:
+        if nextChild and self.inContinue:
             return False
         
-        return QsciScintillaCompat.focusNextPrevChild(self, next)
+        return QsciScintillaCompat.focusNextPrevChild(self, nextChild)
         
     def contextMenuEvent(self, ev):
         """
@@ -1621,14 +1621,14 @@
             self.__insertText(txt)
             self.completionText = ""
         
-    def __completionListSelected(self, id, txt):
+    def __completionListSelected(self, listId, txt):
         """
         Private slot to handle the selection from the completion list.
         
-        @param id the ID of the user list (should be 1) (integer)
+        @param listId the ID of the user list (should be 1) (integer)
         @param txt the selected text (string)
         """
-        if id == 1:
+        if listId == 1:
             if self.completionText != "":
                 txt = txt.replace(self.completionText, "")
             self.__insertText(txt)
--- a/QScintilla/TypingCompleters/CompleterPython.py	Sat Mar 11 13:11:29 2017 +0100
+++ b/QScintilla/TypingCompleters/CompleterPython.py	Sat Mar 11 14:35:22 2017 +0100
@@ -9,7 +9,7 @@
 
 from __future__ import unicode_literals
 try:
-    chr = unichr
+    chr = unichr        # __IGNORE_WARNING_M131__
 except NameError:
     pass
 
--- a/Tasks/TaskFilter.py	Sat Mar 11 13:11:29 2017 +0100
+++ b/Tasks/TaskFilter.py	Sat Mar 11 14:35:22 2017 +0100
@@ -46,29 +46,29 @@
         """
         self.active = enabled
     
-    def setSummaryFilter(self, filter):
+    def setSummaryFilter(self, filterStr):
         """
         Public method to set the description filter.
         
-        @param filter a regular expression for the description filter
+        @param filterStr a regular expression for the description filter
             to set (string) or None
         """
-        if not filter:
+        if not filterStr:
             self.summaryFilter = None
         else:
-            self.summaryFilter = QRegExp(filter)
+            self.summaryFilter = QRegExp(filterStr)
     
-    def setFileNameFilter(self, filter):
+    def setFileNameFilter(self, filterStr):
         """
         Public method to set the filename filter.
         
-        @param filter a wildcard expression for the filename filter
+        @param filterStr a wildcard expression for the filename filter
             to set (string) or None
         """
-        if not filter:
+        if not filterStr:
             self.filenameFilter = None
         else:
-            self.filenameFilter = QRegExp(filter)
+            self.filenameFilter = QRegExp(filterStr)
             self.filenameFilter.setPatternSyntax(QRegExp.Wildcard)
     
     def setTypeFilter(self, taskType):
--- a/Tasks/TaskViewer.py	Sat Mar 11 13:11:29 2017 +0100
+++ b/Tasks/TaskViewer.py	Sat Mar 11 14:35:22 2017 +0100
@@ -656,7 +656,7 @@
         """
         Private slot to configure scan options for project tasks.
         """
-        filter, ok = QInputDialog.getText(
+        scanFilter, ok = QInputDialog.getText(
             self,
             self.tr("Scan Filter Patterns"),
             self.tr("Enter filename patterns of files"
@@ -664,7 +664,7 @@
             QLineEdit.Normal,
             self.projectTasksScanFilter)
         if ok:
-            self.projectTasksScanFilter = filter
+            self.projectTasksScanFilter = scanFilter
     
     def regenerateProjectTasks(self, quiet=False):
         """
@@ -686,8 +686,9 @@
         filterList = [f.strip() for f in self.projectTasksScanFilter.split(",")
                       if f.strip()]
         if filterList:
-            for filter in filterList:
-                files = [f for f in files if not fnmatch.fnmatch(f, filter)]
+            for scanFilter in filterList:
+                files = [f for f in files
+                         if not fnmatch.fnmatch(f, scanFilter)]
         
         # remove all project tasks
         self.clearProjectTasks(fileOnly=True)
--- a/Templates/TemplateViewer.py	Sat Mar 11 13:11:29 2017 +0100
+++ b/Templates/TemplateViewer.py	Sat Mar 11 14:35:22 2017 +0100
@@ -318,14 +318,14 @@
         for line in txt.splitlines():
             ind = line.find(var)
             if ind >= 0:
-                format = var[1:-1].split(':', 1)[1]
-                if format == 'rl':
+                variableFormat = var[1:-1].split(':', 1)[1]
+                if variableFormat == 'rl':
                     prefix = line[:ind]
                     postfix = line[ind + len(var):]
                     for v in val.splitlines():
                         t = "{0}{1}{2}{3}{4}".format(
                             t, os.linesep, prefix, v, postfix)
-                elif format == 'ml':
+                elif variableFormat == 'ml':
                     indent = line.replace(line.lstrip(), "")
                     prefix = line[:ind]
                     postfix = line[ind + len(var):]
@@ -688,27 +688,27 @@
             return
         
         ok = False
-        vars = itm.getVariables()
+        variables = itm.getVariables()
         varValues = self.__getPredefinedVars()
         
         # Remove predefined variables from list so user doesn't have to fill
         # these values out in the dialog.
         for v in list(varValues.keys()):
-            if v in vars:
-                vars.remove(v)
+            if v in variables:
+                variables.remove(v)
         
-        if vars:
+        if variables:
             if Preferences.getTemplates("SingleDialog"):
                 from .TemplateMultipleVariablesDialog import \
                     TemplateMultipleVariablesDialog
-                dlg = TemplateMultipleVariablesDialog(vars, self)
+                dlg = TemplateMultipleVariablesDialog(variables, self)
                 if dlg.exec_() == QDialog.Accepted:
                     varValues.update(dlg.getVariables())
                     ok = True
             else:
                 from .TemplateSingleVariableDialog import \
                     TemplateSingleVariableDialog
-                for var in vars:
+                for var in variables:
                     dlg = TemplateSingleVariableDialog(var, self)
                     if dlg.exec_() == QDialog.Accepted:
                         varValues[var] = dlg.getVariable()
--- a/Toolbox/Startup.py	Sat Mar 11 13:11:29 2017 +0100
+++ b/Toolbox/Startup.py	Sat Mar 11 14:35:22 2017 +0100
@@ -104,8 +104,8 @@
         (int, QTranslator)
     """
     trans = QTranslator(None)
-    for dir in dirs:
-        loaded = trans.load(tn, dir)
+    for directory in dirs:
+        loaded = trans.load(tn, directory)
         if loaded:
             return (trans, True)
     
--- a/Tools/UIPreviewer.py	Sat Mar 11 13:11:29 2017 +0100
+++ b/Tools/UIPreviewer.py	Sat Mar 11 14:35:22 2017 +0100
@@ -456,16 +456,16 @@
         defaultExt = "PNG"
         filters = ""
         formats = QImageWriter.supportedImageFormats()
-        for format in formats:
+        for imageFormat in formats:
             filters = "{0}*.{1} ".format(
-                filters, bytes(format).decode().lower())
-        filter = self.tr("Images ({0})").format(filters[:-1])
+                filters, bytes(imageFormat).decode().lower())
+        fileFilter = self.tr("Images ({0})").format(filters[:-1])
         
         fname = E5FileDialog.getSaveFileName(
             self,
             self.tr("Save Image"),
             "",
-            filter)
+            fileFilter)
         if not fname:
             return
             
--- a/UI/CompareDialog.py	Sat Mar 11 13:11:29 2017 +0100
+++ b/UI/CompareDialog.py	Sat Mar 11 14:35:22 2017 +0100
@@ -179,20 +179,21 @@
             self.file1Picker.setText(filename)
         super(CompareDialog, self).show()
         
-    def __appendText(self, pane, linenumber, line, format, interLine=False):
+    def __appendText(self, pane, linenumber, line, charFormat,
+                     interLine=False):
         """
         Private method to append text to the end of the contents pane.
         
         @param pane text edit widget to append text to (QTextedit)
         @param linenumber number of line to insert (string)
         @param line text to insert (string)
-        @param format text format to be used (QTextCharFormat)
+        @param charFormat text format to be used (QTextCharFormat)
         @param interLine flag indicating interline changes (boolean)
         """
         tc = pane.textCursor()
         tc.movePosition(QTextCursor.End)
         pane.setTextCursor(tc)
-        pane.setCurrentCharFormat(format)
+        pane.setCurrentCharFormat(charFormat)
         if interLine:
             pane.insertPlainText("{0} ".format(linenumber))
             for txt in re.split(self.markerPattern, line):
@@ -202,7 +203,7 @@
                         tc = pane.textCursor()
                         tc.movePosition(QTextCursor.End)
                         pane.setTextCursor(tc)
-                        pane.setCurrentCharFormat(format)
+                        pane.setCurrentCharFormat(charFormat)
                         pane.insertPlainText(txt1)
                     tc = pane.textCursor()
                     tc.movePosition(QTextCursor.End)
--- a/UI/EmailDialog.py	Sat Mar 11 13:11:29 2017 +0100
+++ b/UI/EmailDialog.py	Sat Mar 11 14:35:22 2017 +0100
@@ -374,10 +374,10 @@
         @param deleteFile flag indicating to delete the file after it has
             been sent (boolean)
         """
-        type = mimetypes.guess_type(fname)[0]
-        if not type:
-            type = "application/octet-stream"
-        QTreeWidgetItem(self.attachments, [fname, type])
+        mimeType = mimetypes.guess_type(fname)[0]
+        if not mimeType:
+            mimeType = "application/octet-stream"
+        QTreeWidgetItem(self.attachments, [fname, mimeType])
         self.attachments.header().resizeSections(QHeaderView.ResizeToContents)
         self.attachments.header().setStretchLastSection(True)
         
--- a/UI/FindFileDialog.py	Sat Mar 11 13:11:29 2017 +0100
+++ b/UI/FindFileDialog.py	Sat Mar 11 14:35:22 2017 +0100
@@ -447,7 +447,7 @@
                 fn = file
             # read the file and split it into textlines
             try:
-                text, encoding, hash = Utilities.readEncodedFileWithHash(fn)
+                text, encoding, hashStr = Utilities.readEncodedFileWithHash(fn)
                 lines = text.splitlines(True)
             except (UnicodeError, IOError):
                 progress += 1
@@ -480,7 +480,7 @@
                         line = "- {0}\n+ {1}".format(
                             line, self.__stripEol(rline))
                     self.__createItem(file, count, line, start, end,
-                                      rline, hash)
+                                      rline, hashStr)
                     
                     if self.feelLikeCheckBox.isChecked():
                         fn = os.path.join(self.project.ppath, file)
@@ -608,7 +608,7 @@
                 
                 # read the file and split it into textlines
                 try:
-                    text, encoding, hash = \
+                    text, encoding, hashStr = \
                         Utilities.readEncodedFileWithHash(fn)
                     lines = text.splitlines(True)
                 except (UnicodeError, IOError) as err:
@@ -626,7 +626,7 @@
                 
                 # Check the original and the current hash. Skip the file,
                 # if hashes are different.
-                if origHash != hash:
+                if origHash != hashStr:
                     E5MessageBox.critical(
                         self,
                         self.tr("Replace in Files"),
@@ -634,7 +634,7 @@
                             """<p>The current and the original hash of the"""
                             """ file <b>{0}</b> are different. Skipping it."""
                             """</p><p>Hash 1: {1}</p><p>Hash 2: {2}</p>""")
-                        .format(fn, origHash, hash)
+                        .format(fn, origHash, hashStr)
                     )
                     progress += 1
                     self.findProgress.setValue(progress)
--- a/UI/LogView.py	Sat Mar 11 13:11:29 2017 +0100
+++ b/UI/LogView.py	Sat Mar 11 14:35:22 2017 +0100
@@ -176,8 +176,8 @@
             filters = self.__stderrFilter + self.__stdxxxFilter
         else:
             filters = self.__stdoutFilter + self.__stdxxxFilter
-        for filter in filters:
-            if filter in message:
+        for msgFilter in filters:
+            if msgFilter in message:
                 return True
         
         return False
--- a/UI/NumbersWidget.py	Sat Mar 11 13:11:29 2017 +0100
+++ b/UI/NumbersWidget.py	Sat Mar 11 14:35:22 2017 +0100
@@ -210,11 +210,11 @@
         self.__model.setBitsAndValue(self.__bytes * 8, self.__input)
         self.__model.dataChanged.connect(self.__binModelDataChanged)
     
-    def __formatNumbers(self, format):
+    def __formatNumbers(self, numberFormat):
         """
         Private method to format the various number inputs.
         
-        @param format number format indicator (integer)
+        @param numberFormat number format indicator (integer)
         """
         self.__block(True)
         
@@ -224,7 +224,7 @@
         self.hexEdit.setStyleSheet("")
         
         # determine byte count
-        bytes = 8
+        byteCount = 8
         tmp = self.__input
         for i in range(8):
             c = (tmp & 0xff00000000000000) >> 7 * 8
@@ -233,35 +233,35 @@
             if c != 0xff and self.__input < 0:
                 break
             tmp <<= 8
-            bytes -= 1
-        if bytes == 0:
-            bytes = 1
-        self.__bytes = bytes
+            byteCount -= 1
+        if byteCount == 0:
+            byteCount = 1
+        self.__bytes = byteCount
         
         bytesIn = self.sizeBox.itemData(self.sizeBox.currentIndex()) // 8
-        if bytesIn and bytes > bytesIn:
+        if bytesIn and byteCount > bytesIn:
             self.sizeBox.setStyleSheet(self.__badNumberSheet)
         else:
             self.sizeBox.setStyleSheet("")
         
         # octal
-        if format != 8:
+        if numberFormat != 8:
             self.octEdit.setText("{0:0{1}o}".format(self.__input, bytesIn * 3))
         
         # decimal
-        if format != 10:
+        if numberFormat != 10:
             self.decEdit.setText("{0:d}".format(self.__input))
         
         # hexadecimal
-        if format != 16:
+        if numberFormat != 16:
             self.hexEdit.setText("{0:0{1}x}".format(self.__input, bytesIn * 2))
         
         # octal
-        if format != 8:
+        if numberFormat != 8:
             self.octEdit.setText("{0:0{1}o}".format(self.__input, bytesIn * 3))
         
         # binary
-        if format != 2:
+        if numberFormat != 2:
             num = "{0:0{1}b}".format(self.__input, bytesIn * 8)
             self.binEdit.setText(num)
         
--- a/UI/SymbolsWidget.py	Sat Mar 11 13:11:29 2017 +0100
+++ b/UI/SymbolsWidget.py	Sat Mar 11 14:35:22 2017 +0100
@@ -360,28 +360,29 @@
         @param role role of the data to retrieve (integer)
         @return requested data
         """
-        id = self.__tables[self.__currentTableIndex][0] + index.row()
+        symbolId = self.__tables[self.__currentTableIndex][0] + index.row()
         
         if role == Qt.DisplayRole:
             col = index.column()
             if col == 0:
-                return self.__locale.toString(id)
+                return self.__locale.toString(symbolId)
             elif col == 1:
-                return chr(id)
+                return chr(symbolId)
             elif col == 2:
-                return "0x{0:04x}".format(id)
+                return "0x{0:04x}".format(symbolId)
             elif col == 3:
-                if id in html_entities.codepoint2name:
-                    return "&{0};".format(html_entities.codepoint2name[id])
+                if symbolId in html_entities.codepoint2name:
+                    return "&{0};".format(
+                        html_entities.codepoint2name[symbolId])
             elif col == 4:
-                return unicodedata.name(chr(id), '').title()
+                return unicodedata.name(chr(symbolId), '').title()
         
         if role == Qt.BackgroundColorRole:
             if index.column() == 0:
                 return QColor(Qt.lightGray)
         
         if role == Qt.TextColorRole:
-            char = chr(id)
+            char = chr(symbolId)
             if self.__isDigit(char):
                 return QColor(Qt.darkBlue)
             elif self.__isLetter(char):
@@ -552,10 +553,10 @@
         """
         Private slot to move the table to the entered symbol id.
         """
-        id = self.symbolSpinBox.value()
+        symbolId = self.symbolSpinBox.value()
         first, last = self.__model.getTableBoundaries(
             self.__model.getTableIndex())
-        row = id - first
+        row = symbolId - first
         self.symbolsTable.selectRow(row)
         self.symbolsTable.scrollTo(
             self.__model.index(row, 0), QAbstractItemView.PositionAtCenter)
--- a/Utilities/BackgroundClient.py	Sat Mar 11 13:11:29 2017 +0100
+++ b/Utilities/BackgroundClient.py	Sat Mar 11 14:35:22 2017 +0100
@@ -11,7 +11,7 @@
 
 from __future__ import unicode_literals
 try:
-    bytes = unicode
+    bytes = unicode         # __IGNORE_WARNING_M131__
     import StringIO as io   # __IGNORE_EXCEPTION__
 except NameError:
     import io       # __IGNORE_WARNING__
--- a/Utilities/uic.py	Sat Mar 11 13:11:29 2017 +0100
+++ b/Utilities/uic.py	Sat Mar 11 14:35:22 2017 +0100
@@ -25,12 +25,12 @@
     return py_dir, "Ui_{0}".format(py_file)
 
 
-def compileUiFiles(dir, recurse=False):
+def compileUiFiles(directory, recurse=False):
     """
     Module function to compile the .ui files of a directory tree to Python
     sources.
     
-    @param dir name of a directory to scan for .ui files (string)
+    @param directory name of a directory to scan for .ui files (string)
     @param recurse flag indicating to recurse into subdirectories (boolean)
     """
-    compileUiDir(dir, recurse, __pyName)
+    compileUiDir(directory, recurse, __pyName)
--- a/VCS/VersionControl.py	Sat Mar 11 13:11:29 2017 +0100
+++ b/VCS/VersionControl.py	Sat Mar 11 14:35:22 2017 +0100
@@ -524,15 +524,15 @@
         if key in self.interestingDataKeys:
             self.otherData[key] = value
         
-    def vcsSetDataFromDict(self, dict):
+    def vcsSetDataFromDict(self, dictionary):
         """
         Public method used to set entries in the otherData dictionary.
         
-        @param dict dictionary to pick entries from
+        @param dictionary dictionary to pick entries from
         """
         for key in self.interestingDataKeys:
-            if key in dict:
-                self.otherData[key] = dict[key]
+            if key in dictionary:
+                self.otherData[key] = dictionary[key]
         
     #####################################################################
     ## below are some utility methods

eric ide

mercurial