Fixed some issues and removed some commented code. eric7 release-10.1.1

Mon, 22 Jan 2024 11:55:16 +0100

author
Detlev Offenbach <detlev@die-offenbachs.de>
date
Mon, 22 Jan 2024 11:55:16 +0100
branch
eric7
changeset 15
e01d64ca960f
parent 14
215c4e41b986
child 16
e144657c1fe1

Fixed some issues and removed some commented code.

PluginPyright.py file | annotate | diff | comparison | revisions
PluginPyright.zip file | annotate | diff | comparison | revisions
PyrightChecker/PyrightCheckerDialog.py file | annotate | diff | comparison | revisions
PyrightChecker/PyrightCheckerDialog.ui file | annotate | diff | comparison | revisions
changelog.md file | annotate | diff | comparison | revisions
--- a/PluginPyright.py	Thu Jan 04 11:42:47 2024 +0100
+++ b/PluginPyright.py	Mon Jan 22 11:55:16 2024 +0100
@@ -24,7 +24,7 @@
     "author": "Detlev Offenbach <detlev@die-offenbachs.de>",
     "autoactivate": True,
     "deactivateable": True,
-    "version": "10.1.0",
+    "version": "10.1.1",
     "className": "PyrightPlugin",
     "packageName": "PyrightChecker",
     "shortDescription": "Plug-in to check Python sources for typing issues.",
Binary file PluginPyright.zip has changed
--- a/PyrightChecker/PyrightCheckerDialog.py	Thu Jan 04 11:42:47 2024 +0100
+++ b/PyrightChecker/PyrightCheckerDialog.py	Mon Jan 22 11:55:16 2024 +0100
@@ -47,6 +47,7 @@
     except AttributeError:
         SeverityForEditor["information"] = Editor.WarningCode
 
+
 class PyrightCheckerDialog(QDialog, Ui_PyrightCheckerDialog):
     """
     Class documentation goes here.
@@ -78,16 +79,6 @@
             "information": self.tr("Information"),
         }
 
-        ##self.__severityForEditor = {"warning": Editor.WarningCode}
-        ##try:
-            ##self.__severityForEditor["error"] = Editor.WarningError
-        ##except AttributeError:
-            ##self.__severityForEditor["error"] = Editor.WarningCode
-        ##try:
-            ##self.__severityForEditor["information"] = Editor.WarningInfo
-        ##except AttributeError:
-            ##self.__severityForEditor["information"] = Editor.WarningCode
-##
         self.__exitCodeMapping = {
             0: self.tr("No issues detected"),
             1: self.tr("Issues detected"),
@@ -413,7 +404,11 @@
         @param column column the item was activated in
         @type int
         """
-        if self.__hasResults and item.parent():
+        if (
+            self.__hasResults
+            and item.parent()
+            and item.data(0, self.filenameRole) is not None
+        ):
             fn = os.path.abspath(item.data(0, self.filenameRole))
             start = item.data(0, self.startRole)
             severity = item.data(0, self.severityRole)
@@ -455,21 +450,22 @@
 
         for index in selectedIndexes:
             itm = self.resultList.topLevelItem(index)
-            fn = os.path.abspath(itm.data(0, self.filenameRole))
-            vm.openSourceFile(fn, 1)
-            editor = vm.getOpenEditor(fn)
-            self.__clearEditorErrors(editor)
-            for cindex in range(itm.childCount()):
-                citm = itm.child(cindex)
-                start = citm.data(0, self.startRole)
-                severity = citm.data(0, self.severityRole)
-                editor.toggleWarning(
-                    start["line"] + 1,
-                    start["character"] + 1,
-                    True,
-                    citm.text(2),
-                    warningType=SeverityForEditor[severity],
-                )
+            if itm.data(0, self.filenameRole) is not None:
+                fn = os.path.abspath(itm.data(0, self.filenameRole))
+                vm.openSourceFile(fn, 1)
+                editor = vm.getOpenEditor(fn)
+                self.__clearEditorErrors(editor)
+                for cindex in range(itm.childCount()):
+                    citm = itm.child(cindex)
+                    start = citm.data(0, self.startRole)
+                    severity = citm.data(0, self.severityRole)
+                    editor.toggleWarning(
+                        start["line"] + 1,
+                        start["character"] + 1,
+                        True,
+                        citm.text(2),
+                        warningType=SeverityForEditor[severity],
+                    )
 
     @pyqtSlot()
     def on_startButton_clicked(self):
--- a/PyrightChecker/PyrightCheckerDialog.ui	Thu Jan 04 11:42:47 2024 +0100
+++ b/PyrightChecker/PyrightCheckerDialog.ui	Mon Jan 22 11:55:16 2024 +0100
@@ -208,6 +208,9 @@
            <property name="sortingEnabled">
             <bool>true</bool>
            </property>
+           <property name="expandsOnDoubleClick">
+            <bool>false</bool>
+           </property>
            <column>
             <property name="text">
              <string>File/Line</string>
--- a/changelog.md	Thu Jan 04 11:42:47 2024 +0100
+++ b/changelog.md	Mon Jan 22 11:55:16 2024 +0100
@@ -1,6 +1,10 @@
 ChangeLog
 ---------
 
+__Version 10.1.1__
+
+- bug fixes
+
 __Version 10.1.0__
 
 - adjusted some code for eric7 24.2 and newer

eric ide

mercurial