Modified the shutdown code logic to not check PyPI for changed packages. eric7

Mon, 12 Jul 2021 19:52:49 +0200

author
Detlev Offenbach <detlev@die-offenbachs.de>
date
Mon, 12 Jul 2021 19:52:49 +0200
branch
eric7
changeset 8466
bb21fd901f49
parent 8465
59bb8fdeef1b
child 8467
bccf0a3fa67c

Modified the shutdown code logic to not check PyPI for changed packages.

eric7/APIs/Python3/eric7.api file | annotate | diff | comparison | revisions
eric7/Documentation/Help/source.qch file | annotate | diff | comparison | revisions
eric7/Documentation/Help/source.qhp file | annotate | diff | comparison | revisions
eric7/Documentation/Source/eric7.PipInterface.PipPackagesWidget.html file | annotate | diff | comparison | revisions
eric7/Documentation/Source/eric7.Project.Project.html file | annotate | diff | comparison | revisions
eric7/PipInterface/PipPackagesWidget.py file | annotate | diff | comparison | revisions
eric7/Project/Project.py file | annotate | diff | comparison | revisions
eric7/UI/UserInterface.py file | annotate | diff | comparison | revisions
--- a/eric7/APIs/Python3/eric7.api	Sun Jul 11 16:29:12 2021 +0200
+++ b/eric7/APIs/Python3/eric7.api	Mon Jul 12 19:52:49 2021 +0200
@@ -7242,7 +7242,7 @@
 eric7.Project.Project.Project.clearHistories?4()
 eric7.Project.Project.Project.clearRecent?4()
 eric7.Project.Project.Project.clearStatusMonitorCachedState?4(name)
-eric7.Project.Project.Project.closeProject?4(reopen=False, noSave=False)
+eric7.Project.Project.Project.closeProject?4(reopen=False, noSave=False, shutdown=False)
 eric7.Project.Project.Project.completeRepopulateItem?7
 eric7.Project.Project.Project.copyDirectory?4(olddn, newdn)
 eric7.Project.Project.Project.createNewProject?4()
Binary file eric7/Documentation/Help/source.qch has changed
--- a/eric7/Documentation/Help/source.qhp	Sun Jul 11 16:29:12 2021 +0200
+++ b/eric7/Documentation/Help/source.qhp	Mon Jul 12 19:52:49 2021 +0200
@@ -10963,6 +10963,7 @@
       <keyword name="PipPackagesWidget.__isPipAvailable" id="PipPackagesWidget.__isPipAvailable" ref="eric7.PipInterface.PipPackagesWidget.html#PipPackagesWidget.__isPipAvailable" />
       <keyword name="PipPackagesWidget.__pipConfigure" id="PipPackagesWidget.__pipConfigure" ref="eric7.PipInterface.PipPackagesWidget.html#PipPackagesWidget.__pipConfigure" />
       <keyword name="PipPackagesWidget.__populateEnvironments" id="PipPackagesWidget.__populateEnvironments" ref="eric7.PipInterface.PipPackagesWidget.html#PipPackagesWidget.__populateEnvironments" />
+      <keyword name="PipPackagesWidget.__projectClosed" id="PipPackagesWidget.__projectClosed" ref="eric7.PipInterface.PipPackagesWidget.html#PipPackagesWidget.__projectClosed" />
       <keyword name="PipPackagesWidget.__purgeCache" id="PipPackagesWidget.__purgeCache" ref="eric7.PipInterface.PipPackagesWidget.html#PipPackagesWidget.__purgeCache" />
       <keyword name="PipPackagesWidget.__refreshPackagesList" id="PipPackagesWidget.__refreshPackagesList" ref="eric7.PipInterface.PipPackagesWidget.html#PipPackagesWidget.__refreshPackagesList" />
       <keyword name="PipPackagesWidget.__reinstallPackages" id="PipPackagesWidget.__reinstallPackages" ref="eric7.PipInterface.PipPackagesWidget.html#PipPackagesWidget.__reinstallPackages" />
--- a/eric7/Documentation/Source/eric7.PipInterface.PipPackagesWidget.html	Sun Jul 11 16:29:12 2021 +0200
+++ b/eric7/Documentation/Source/eric7.PipInterface.PipPackagesWidget.html	Mon Jul 12 19:52:49 2021 +0200
@@ -145,6 +145,10 @@
 <td>Private method to get a list of environments and populate the selector.</td>
 </tr>
 <tr>
+<td><a href="#PipPackagesWidget.__projectClosed">__projectClosed</a></td>
+<td>Private slot to handle the projectClosed signal.</td>
+</tr>
+<tr>
 <td><a href="#PipPackagesWidget.__purgeCache">__purgeCache</a></td>
 <td>Private slot to empty the pip cache.</td>
 </tr>
@@ -503,6 +507,20 @@
 <p>
         Private method to get a list of environments and populate the selector.
 </p>
+<a NAME="PipPackagesWidget.__projectClosed" ID="PipPackagesWidget.__projectClosed"></a>
+<h4>PipPackagesWidget.__projectClosed</h4>
+<b>__projectClosed</b>(<i>shutdown</i>)
+
+<p>
+        Private slot to handle the projectClosed signal.
+</p>
+<dl>
+
+<dt><i>shutdown</i> (bool)</dt>
+<dd>
+flag indicating the IDE shutdown
+</dd>
+</dl>
 <a NAME="PipPackagesWidget.__purgeCache" ID="PipPackagesWidget.__purgeCache"></a>
 <h4>PipPackagesWidget.__purgeCache</h4>
 <b>__purgeCache</b>(<i></i>)
--- a/eric7/Documentation/Source/eric7.Project.Project.html	Sun Jul 11 16:29:12 2021 +0200
+++ b/eric7/Documentation/Source/eric7.Project.Project.html	Mon Jul 12 19:52:49 2021 +0200
@@ -115,9 +115,10 @@
 <dd>
 emitted to signal a change of the project
 </dd>
-<dt>projectClosed()</dt>
-<dd>
-emitted after a project was closed
+<dt>projectClosed(shutdown)</dt>
+<dd>
+emitted after a project was closed sending
+        a flag indicating the IDE shutdown operation
 </dd>
 <dt>projectClosedHooks()</dt>
 <dd>
@@ -2136,26 +2137,36 @@
 </dl>
 <a NAME="Project.closeProject" ID="Project.closeProject"></a>
 <h4>Project.closeProject</h4>
-<b>closeProject</b>(<i>reopen=False, noSave=False</i>)
+<b>closeProject</b>(<i>reopen=False, noSave=False, shutdown=False</i>)
 
 <p>
         Public slot to close the current project.
 </p>
 <dl>
 
-<dt><i>reopen</i></dt>
-<dd>
-flag indicating a reopening of the project (boolean)
-</dd>
-<dt><i>noSave</i></dt>
-<dd>
-flag indicating to not perform save actions (boolean)
+<dt><i>reopen</i> (bool)</dt>
+<dd>
+flag indicating a reopening of the project
+</dd>
+<dt><i>noSave</i> (bool)</dt>
+<dd>
+flag indicating to not perform save actions
+</dd>
+<dt><i>shutdown</i> (bool)</dt>
+<dd>
+flag indicating the IDE shutdown
 </dd>
 </dl>
 <dl>
 <dt>Return:</dt>
 <dd>
-flag indicating success (boolean)
+flag indicating success
+</dd>
+</dl>
+<dl>
+<dt>Return Type:</dt>
+<dd>
+bool
 </dd>
 </dl>
 <a NAME="Project.copyDirectory" ID="Project.copyDirectory"></a>
--- a/eric7/PipInterface/PipPackagesWidget.py	Sun Jul 11 16:29:12 2021 +0200
+++ b/eric7/PipInterface/PipPackagesWidget.py	Mon Jul 12 19:52:49 2021 +0200
@@ -217,7 +217,7 @@
         project.projectOpened.connect(
             self.on_refreshButton_clicked)
         project.projectClosed.connect(
-            self.on_refreshButton_clicked)
+            self.__projectClosed)
         
         self.__initPipMenu()
         self.__populateEnvironments()
@@ -233,6 +233,17 @@
         
         self.__packageDetailsDialog = None
     
+    @pyqtSlot(bool)
+    def __projectClosed(self, shutdown):
+        """
+        Private slot to handle the projectClosed signal.
+        
+        @param shutdown flag indicating the IDE shutdown
+        @type bool
+        """
+        if not shutdown:
+            self.on_refreshButton_clicked()
+    
     def __populateEnvironments(self):
         """
         Private method to get a list of environments and populate the selector.
--- a/eric7/Project/Project.py	Sun Jul 11 16:29:12 2021 +0200
+++ b/eric7/Project/Project.py	Mon Jul 12 19:52:49 2021 +0200
@@ -90,7 +90,8 @@
     @signal projectOpened() emitted after a project file was read
     @signal projectClosedHooks() emitted after a project file was closed but
         before the projectClosed() signal is sent
-    @signal projectClosed() emitted after a project was closed
+    @signal projectClosed(shutdown) emitted after a project was closed sending
+        a flag indicating the IDE shutdown operation
     @signal projectFileRenamed(str, str) emitted after a file of the project
         has been renamed
     @signal projectPropertiesChanged() emitted after the project properties
@@ -142,7 +143,7 @@
     projectOpenedHooks = pyqtSignal()
     projectOpened = pyqtSignal()
     projectClosedHooks = pyqtSignal()
-    projectClosed = pyqtSignal()
+    projectClosed = pyqtSignal(bool)
     projectFileRenamed = pyqtSignal(str, str)
     projectPropertiesChanged = pyqtSignal()
     directoryRemoved = pyqtSignal(str)
@@ -2077,7 +2078,7 @@
                 self.pdata[key] = newPdata[key][:]
             
             # repopulate the model
-            self.__model.projectClosed()
+            self.__model.projectClosed(False)
             self.__model.projectOpened()
         
     def copyDirectory(self, olddn, newdn):
@@ -3161,7 +3162,7 @@
             self.sessActGrp.setEnabled(ok)
             self.menuSessionAct.setEnabled(ok)
             self.projectClosedHooks.emit()
-            self.projectClosed.emit()
+            self.projectClosed.emit(False)
             self.projectOpenedHooks.emit()
             self.projectOpened.emit()
             return ok
@@ -3197,13 +3198,18 @@
         self.loadedDiagram and self.loadedDiagram.close()
         
     @pyqtSlot()
-    def closeProject(self, reopen=False, noSave=False):
+    def closeProject(self, reopen=False, noSave=False, shutdown=False):
         """
         Public slot to close the current project.
         
-        @param reopen flag indicating a reopening of the project (boolean)
-        @param noSave flag indicating to not perform save actions (boolean)
-        @return flag indicating success (boolean)
+        @param reopen flag indicating a reopening of the project
+        @type bool
+        @param noSave flag indicating to not perform save actions
+        @type bool
+        @param shutdown flag indicating the IDE shutdown
+        @type bool
+        @return flag indicating success
+        @rtype bool
         """
         # save the list of recently opened projects
         self.__saveRecent()
@@ -3296,7 +3302,7 @@
         
         self.__model.projectClosed()
         self.projectClosedHooks.emit()
-        self.projectClosed.emit()
+        self.projectClosed.emit(shutdown)
         
         return True
 
--- a/eric7/UI/UserInterface.py	Sun Jul 11 16:29:12 2021 +0200
+++ b/eric7/UI/UserInterface.py	Mon Jul 12 19:52:49 2021 +0200
@@ -6965,7 +6965,7 @@
         
         self.__astViewer.hide()
         
-        if not self.project.closeProject():
+        if not self.project.closeProject(shutdown=True):
             return False
         
         if not self.multiProject.closeMultiProject():

eric ide

mercurial