src/eric7/QScintilla/Editor.py

branch
eric7-maintenance
changeset 10079
0222a480e93d
parent 10004
983477114d3c
parent 10069
435cc5875135
child 10148
31ba20629af4
diff -r 097199aec4bd -r 0222a480e93d src/eric7/QScintilla/Editor.py
--- a/src/eric7/QScintilla/Editor.py	Tue May 02 10:20:23 2023 +0200
+++ b/src/eric7/QScintilla/Editor.py	Sat May 27 19:02:58 2023 +0200
@@ -64,7 +64,7 @@
 TemplateCompletionListID = 2
 ReferencesListID = 3
 
-ReferenceItem = collections.namedtuple(
+ReferenceItem = collections.namedtuple(  # noqa: U200
     "ReferenceItem", ["modulePath", "codeLine", "line", "column"]
 )
 
@@ -144,7 +144,7 @@
     lastEditPositionAvailable = pyqtSignal()
     refreshed = pyqtSignal()
     settingsRead = pyqtSignal()
-    mouseDoubleClick = pyqtSignal(QPoint, int)
+    mouseDoubleClick = pyqtSignal(QPoint, Qt.MouseButton)
 
     WarningCode = 1
     WarningStyle = 2
@@ -2310,7 +2310,7 @@
             lineno = self.markerLine(self.lastHighlight)
             self.ensureVisible(lineno + 1)
 
-    def highlight(self, line=None, error=False, syntaxError=False):
+    def highlight(self, line=None, error=False, syntaxError=False):  # noqa: U100
         """
         Public method to highlight [or de-highlight] a particular line.
 
@@ -2357,16 +2357,16 @@
 
     def __modified(
         self,
-        pos,
+        pos,  # noqa: U100
         mtype,
-        text,
-        length,
+        text,  # noqa: U100
+        length,  # noqa: U100
         linesAdded,
         line,
-        foldNow,
-        foldPrev,
-        token,
-        annotationLinesAdded,
+        foldNow,  # noqa: U100
+        foldPrev,  # noqa: U100
+        token,  # noqa: U100
+        annotationLinesAdded,  # noqa: U100
     ):
         """
         Private method to handle changes of the number of lines.
@@ -3047,13 +3047,12 @@
     ## Change tracing methods below
     ###########################################################################
 
-    def __createChangeMarkerPixmap(self, key, size=16, width=4):
+    def __createChangeMarkerPixmap(self, key, size=16):
         """
         Private method to create a pixmap for the change markers.
 
         @param key key of the color to use (string)
         @param size size of the pixmap (integer)
-        @param width width of the marker line (integer)
         @return create pixmap (QPixmap)
         """
         pixmap = QPixmap(size, size)
@@ -3329,7 +3328,7 @@
                     )
                 else:
                     txt, self.encoding = Utilities.readEncodedFile(fn)
-        except (UnicodeDecodeError, OSError) as why:
+        except (OSError, UnicodeDecodeError) as why:
             EricMessageBox.critical(
                 self.vm,
                 self.tr("Open File"),
@@ -3449,7 +3448,7 @@
             if createBackup and perms_valid:
                 os.chmod(fn, permissions)
             return True
-        except (OSError, Utilities.CodingError, UnicodeError) as why:
+        except (OSError, UnicodeError, Utilities.CodingError) as why:
             EricMessageBox.critical(
                 self,
                 self.tr("Save File"),
@@ -3619,13 +3618,11 @@
             )
             return False
 
-    def saveFileAs(self, path=None, toProject=False):
+    def saveFileAs(self, path=None):
         """
         Public slot to save a file with a new name.
 
         @param path directory to save the file in (string)
-        @param toProject flag indicating a save to project operation
-            (boolean)
         @return tuple of two values (boolean, string) giving a success
             indicator and the name of the saved file
         """
@@ -3744,7 +3741,7 @@
                 QsciScintilla.SC_FOLDACTION_EXPAND,
             )
 
-    def __marginClicked(self, margin, line, modifiers):
+    def __marginClicked(self, margin, line, modifiers):  # noqa: U100
         """
         Private slot to handle the marginClicked signal.
 
@@ -6686,7 +6683,9 @@
     ## Warning handling methods below
     ###########################################################################
 
-    def toggleWarning(self, line, col, warning, msg="", warningType=WarningCode):
+    def toggleWarning(
+        self, line, col, warning, msg="", warningType=WarningCode  # noqa: U100
+    ):
         """
         Public method to toggle a warning indicator.
 
@@ -7223,7 +7222,7 @@
         self.undoAvailable.emit(self.isUndoAvailable())
         self.redoAvailable.emit(self.isRedoAvailable())
 
-    def close(self, alsoDelete=False):
+    def close(self):
         """
         Public method called when the window gets closed.
 
@@ -7231,7 +7230,6 @@
         ViewManager.closeEditor, which in turn calls our closeIt
         method.
 
-        @param alsoDelete ignored
         @return flag indicating a successful close of the editor (boolean)
         """
         return self.vm.closeEditor(self)
@@ -8033,9 +8031,9 @@
             # template viewer is not active
             return
 
-        if templateViewer.hasTemplate(templateName, self.getLanguage()):
+        if templateViewer.hasTemplate(templateName, language):
             self.extendSelectionWordLeft()
-            templateViewer.applyNamedTemplate(templateName, self.getLanguage())
+            templateViewer.applyNamedTemplate(templateName, language)
 
     #######################################################################
     ## Project related methods

eric ide

mercurial