Added missing close event handler. eric7 release-10.2.1

Fri, 26 May 2023 10:45:38 +0200

author
Detlev Offenbach <detlev@die-offenbachs.de>
date
Fri, 26 May 2023 10:45:38 +0200
branch
eric7
changeset 100
882358a3f96e
parent 99
ace98e6afc04
child 101
4f8febb9513e

Added missing close event handler.

ChangeLog file | annotate | diff | comparison | revisions
PluginCheckerVulture.epj file | annotate | diff | comparison | revisions
PluginVulture.py file | annotate | diff | comparison | revisions
PluginVulture.zip file | annotate | diff | comparison | revisions
VultureChecker/Documentation/source/Plugin_Checker_Vulture.VultureChecker.VultureCheckerDialog.html file | annotate | diff | comparison | revisions
VultureChecker/VultureCheckerDialog.py file | annotate | diff | comparison | revisions
--- a/ChangeLog	Sat Dec 31 16:27:41 2022 +0100
+++ b/ChangeLog	Fri May 26 10:45:38 2023 +0200
@@ -1,9 +1,12 @@
 ChangeLog
 ---------
-Version 10.2.0
+Version 10.2.1:
+- bug fixes
+
+Version 10.2.0:
 - adapted some import statements to eric 23.1 and newer
 
-Version 10.1.0
+Version 10.1.0:
 - adapted the import statements to the new structure
 
 Version 10.0.2:
--- a/PluginCheckerVulture.epj	Sat Dec 31 16:27:41 2022 +0100
+++ b/PluginCheckerVulture.epj	Fri May 26 10:45:38 2023 +0200
@@ -1,7 +1,7 @@
 {
   "header": {
     "comment": "eric project file for project PluginCheckerVulture",
-    "copyright": "Copyright (C) 2022 Detlev Offenbach, detlev@die-offenbachs.de"
+    "copyright": "Copyright (C) 2023 Detlev Offenbach, detlev@die-offenbachs.de"
   },
   "project": {
     "AUTHOR": "Detlev Offenbach",
@@ -11,6 +11,7 @@
           "AllowStarArgAny": false,
           "AllowUntypedDefs": false,
           "AllowUntypedNested": false,
+          "CheckFutureAnnotations": false,
           "DispatchDecorators": [
             "singledispatch",
             "singledispatchmethod"
@@ -62,9 +63,9 @@
         "CopyrightAuthor": "",
         "CopyrightMinFileSize": 0,
         "DocstringType": "eric_black",
-        "EnabledCheckerCategories": "C, D, E, M, N, S, Y, W",
+        "EnabledCheckerCategories": "C, D, E, M, N, S, Y, U, W",
         "ExcludeFiles": "*/Ui_*.py, */*_rc.py, */vulture/*",
-        "ExcludeMessages": "C101,E265,E266,E305,E402,M201,M301,M302,M303,M304,M305,M306,M307,M308,M311,M312,M313,M314,M315,M321,M701,M702,M811,M834,N802,N803,N807,N808,N821,W293,W503,Y119,Y401,Y402",
+        "ExcludeMessages": "C101,E265,E266,E305,E402,M201,M301,M302,M303,M304,M305,M306,M307,M308,M311,M312,M313,M314,M315,M321,M701,M702,M811,M834,N802,N803,N807,N808,N821,U200,W293,W503,Y119,Y401,Y402",
         "FixCodes": "",
         "FixIssues": false,
         "FutureChecker": "",
@@ -80,6 +81,14 @@
         "MaxCodeComplexity": 10,
         "MaxDocLineLength": 88,
         "MaxLineLength": 88,
+        "NameOrderChecker": {
+          "ApplicationPackageNames": [],
+          "CombinedAsImports": false,
+          "SortCaseSensitive": false,
+          "SortFromFirst": false,
+          "SortIgnoringStyle": false,
+          "SortOrder": "natural"
+        },
         "NoFixCodes": "E501",
         "RepeatMessages": true,
         "SecurityChecker": {
@@ -113,6 +122,19 @@
           "WeakKeySizeRsaMedium": "2048"
         },
         "ShowIgnored": false,
+        "UnusedChecker": {
+          "IgnoreAbstract": true,
+          "IgnoreDunderGlobals": true,
+          "IgnoreDunderMethods": true,
+          "IgnoreEventHandlerMethods": true,
+          "IgnoreLambdas": false,
+          "IgnoreNestedFunctions": false,
+          "IgnoreOverload": true,
+          "IgnoreOverride": true,
+          "IgnoreSlotMethods": true,
+          "IgnoreStubs": true,
+          "IgnoreVariadicNames": false
+        },
         "ValidEncodings": "latin-1, utf-8"
       },
       "Vulture": {
@@ -214,7 +236,7 @@
     ],
     "OTHERTOOLSPARMS": {
       "Black": {
-        "exclude": "/(\\.direnv|\\.eggs|\\.git|\\.hg|\\.mypy_cache|\\.nox|\\.tox|\\.venv|venv|\\.svn|_build|buck-out|build|dist|__pypackages__)/",
+        "exclude": "/(\\.direnv|\\.eggs|\\.git|\\.hg|\\.mypy_cache|\\.nox|\\.tox|\\.venv|venv|\\.svn|\\.ipynb_checkpoints|_build|buck-out|build|dist|__pypackages__)/",
         "extend-exclude": "",
         "force-exclude": "",
         "line-length": 88,
@@ -222,11 +244,11 @@
         "skip-string-normalization": false,
         "source": "project",
         "target-version": [
-          "py37",
-          "py38",
+          "py311",
+          "py310",
           "py39",
-          "py310",
-          "py311"
+          "py38",
+          "py37"
         ]
       },
       "isort": {
--- a/PluginVulture.py	Sat Dec 31 16:27:41 2022 +0100
+++ b/PluginVulture.py	Fri May 26 10:45:38 2023 +0200
@@ -26,7 +26,7 @@
 author = "Detlev Offenbach <detlev@die-offenbachs.de>"
 autoactivate = True
 deactivateable = True
-version = "10.2.0"
+version = "10.2.1"
 className = "VulturePlugin"
 packageName = "VultureChecker"
 shortDescription = "Plug-in to detect unused code using the 'vulture' library"
@@ -273,7 +273,7 @@
                     )
                     print("Using default.")
 
-    def __projectShowMenu(self, menuName, menu):
+    def __projectShowMenu(self, menuName, menu):  # noqa: U100
         """
         Private slot called, when the the project menu or a submenu is
         about to be shown.
Binary file PluginVulture.zip has changed
--- a/VultureChecker/Documentation/source/Plugin_Checker_Vulture.VultureChecker.VultureCheckerDialog.html	Sat Dec 31 16:27:41 2022 +0100
+++ b/VultureChecker/Documentation/source/Plugin_Checker_Vulture.VultureChecker.VultureCheckerDialog.html	Fri May 26 10:45:38 2023 +0200
@@ -67,6 +67,10 @@
 <td>Private slot handling the completion of a batch job.</td>
 </tr>
 <tr>
+<td><a href="#VultureCheckerDialog.__cancel">__cancel</a></td>
+<td>Private method to cancel the current check run.</td>
+</tr>
+<tr>
 <td><a href="#VultureCheckerDialog.__createErrorItem">__createErrorItem</a></td>
 <td>Private slot to create a new error item in the result list.</td>
 </tr>
@@ -175,6 +179,10 @@
 <td>Public method to clear all results.</td>
 </tr>
 <tr>
+<td><a href="#VultureCheckerDialog.closeEvent">closeEvent</a></td>
+<td>Protected method to handle a close event.</td>
+</tr>
+<tr>
 <td><a href="#VultureCheckerDialog.on_buttonBox_clicked">on_buttonBox_clicked</a></td>
 <td>Private slot called by a button of the button box clicked.</td>
 </tr>
@@ -234,6 +242,13 @@
 <p>
         Private slot handling the completion of a batch job.
 </p>
+<a NAME="VultureCheckerDialog.__cancel" ID="VultureCheckerDialog.__cancel"></a>
+<h4>VultureCheckerDialog.__cancel</h4>
+<b>__cancel</b>(<i></i>)
+
+<p>
+        Private method to cancel the current check run.
+</p>
 <a NAME="VultureCheckerDialog.__createErrorItem" ID="VultureCheckerDialog.__createErrorItem"></a>
 <h4>VultureCheckerDialog.__createErrorItem</h4>
 <b>__createErrorItem</b>(<i>filename, message</i>)
@@ -666,6 +681,20 @@
 <p>
         Public method to clear all results.
 </p>
+<a NAME="VultureCheckerDialog.closeEvent" ID="VultureCheckerDialog.closeEvent"></a>
+<h4>VultureCheckerDialog.closeEvent</h4>
+<b>closeEvent</b>(<i>evt</i>)
+
+<p>
+        Protected method to handle a close event.
+</p>
+<dl>
+
+<dt><i>evt</i> (QCloseEvent)</dt>
+<dd>
+reference to the close event
+</dd>
+</dl>
 <a NAME="VultureCheckerDialog.on_buttonBox_clicked" ID="VultureCheckerDialog.on_buttonBox_clicked"></a>
 <h4>VultureCheckerDialog.on_buttonBox_clicked</h4>
 <b>on_buttonBox_clicked</b>(<i>button</i>)
--- a/VultureChecker/VultureCheckerDialog.py	Sat Dec 31 16:27:41 2022 +0100
+++ b/VultureChecker/VultureCheckerDialog.py	Fri May 26 10:45:38 2023 +0200
@@ -397,6 +397,26 @@
                 )
                 itm.setFirstColumnSpanned(True)
 
+    def __cancel(self):
+        """
+        Private method to cancel the current check run.
+        """
+        self.cancelled = True
+        if self.__batch:
+            self.vultureService.cancelVultureCheckBatch()
+            QTimer.singleShot(1000, self.__finish)
+        else:
+            self.__finish()
+
+    def closeEvent(self, evt):
+        """
+        Protected method to handle a close event.
+
+        @param evt reference to the close event
+        @type QCloseEvent
+        """
+        self.__cancel()
+
     @pyqtSlot(QAbstractButton)
     def on_buttonBox_clicked(self, button):
         """
@@ -408,12 +428,7 @@
         if button == self.buttonBox.button(QDialogButtonBox.StandardButton.Close):
             self.close()
         elif button == self.buttonBox.button(QDialogButtonBox.StandardButton.Cancel):
-            self.cancelled = True
-            if self.__batch:
-                self.vultureService.cancelVultureCheckBatch()
-                QTimer.singleShot(1000, self.__finish)
-            else:
-                self.__finish()
+            self.__cancel()
 
     @pyqtSlot()
     def on_startButton_clicked(self):

eric ide

mercurial