Pip, PipPackagesWidget, VirtualenvManager: fixed an issue causing environments for remote debugging being shown in the selection list.

Sat, 27 Apr 2019 19:27:50 +0200

author
Detlev Offenbach <detlev@die-offenbachs.de>
date
Sat, 27 Apr 2019 19:27:50 +0200
changeset 6975
3325bf3e7b2c
parent 6974
35b9fa8c9e66
child 6976
66913de629f6

Pip, PipPackagesWidget, VirtualenvManager: fixed an issue causing environments for remote debugging being shown in the selection list.

eric6/PipInterface/Pip.py file | annotate | diff | comparison | revisions
eric6/PipInterface/PipPackagesWidget.py file | annotate | diff | comparison | revisions
eric6/VirtualEnv/VirtualenvManager.py file | annotate | diff | comparison | revisions
--- a/eric6/PipInterface/Pip.py	Mon Apr 22 15:16:38 2019 +0200
+++ b/eric6/PipInterface/Pip.py	Sat Apr 27 19:27:50 2019 +0200
@@ -207,15 +207,19 @@
         
         return interpreter
     
-    def getVirtualenvNames(self):
+    def getVirtualenvNames(self, noRemote=False):
         """
         Public method to get a sorted list of virtual environment names.
         
+        @param noRemote flag indicating to exclude environments for remote
+            debugging
+        @type bool
         @return sorted list of virtual environment names
         @rtype list of str
         """
         return sorted(
-            e5App().getObject("VirtualEnvManager").getVirtualenvNames())
+            e5App().getObject("VirtualEnvManager").getVirtualenvNames(
+                noRemote=noRemote))
     
     def installPip(self, venvName, userSite=False):
         """
--- a/eric6/PipInterface/PipPackagesWidget.py	Mon Apr 22 15:16:38 2019 +0200
+++ b/eric6/PipInterface/PipPackagesWidget.py	Sat Apr 27 19:27:50 2019 +0200
@@ -133,7 +133,8 @@
         projectVenv = self.__pip.getProjectEnvironmentString()
         if projectVenv:
             self.environmentsComboBox.addItem(projectVenv)
-        self.environmentsComboBox.addItems(self.__pip.getVirtualenvNames())
+        self.environmentsComboBox.addItems(
+            self.__pip.getVirtualenvNames(noRemote=True))
     
     def __isPipAvailable(self):
         """
--- a/eric6/VirtualEnv/VirtualenvManager.py	Mon Apr 22 15:16:38 2019 +0200
+++ b/eric6/VirtualEnv/VirtualenvManager.py	Sat Apr 27 19:27:50 2019 +0200
@@ -515,14 +515,22 @@
         else:
             return ""
     
-    def getVirtualenvNames(self):
+    def getVirtualenvNames(self, noRemote=False):
         """
         Public method to get a list of defined virtual environments.
         
+        @param noRemote flag indicating to exclude environments for remote
+            debugging
+        @type bool
         @return list of defined virtual environments
         @rtype list of str
         """
-        return list(self.__virtualEnvironments.keys())
+        environments = list(self.__virtualEnvironments.keys())
+        if noRemote:
+            environments = [name for name in environments
+                            if not self.isRemoteEnvironment(name)]
+        
+        return environments
     
     def getVirtualenvNamesForVariant(self, variant):
         """

eric ide

mercurial