Mon, 22 Jan 2024 11:55:16 +0100
Fixed some issues and removed some commented code.
--- 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.",
--- 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>