Plugins/UiExtensionPlugins/PipInterface/PipSelectionDialog.py

changeset 6342
c79ecba9cde7
parent 6327
a1716d9210f4
child 6619
1d34365c082c
--- a/Plugins/UiExtensionPlugins/PipInterface/PipSelectionDialog.py	Tue Jun 12 18:59:45 2018 +0200
+++ b/Plugins/UiExtensionPlugins/PipInterface/PipSelectionDialog.py	Tue Jun 12 19:01:06 2018 +0200
@@ -18,22 +18,20 @@
     """
     Class implementing a dialog to select the pip executable to be used.
     """
-    def __init__(self, plugin, parent=None):
+    def __init__(self, pip, parent=None):
         """
         Constructor
         
-        @param plugin reference to the plugin object
-        @type ToolPipPlugin
+        @param pip reference to the pip object
+        @type Pip
         @param parent reference to the parent widget
         @type QWidget
         """
         super(PipSelectionDialog, self).__init__(parent)
         self.setupUi(self)
         
-        self.__default = self.tr("<Default>")
-        pipExecutables = sorted(plugin.getPreferences("PipExecutables"))
-        self.pipComboBox.addItem(self.__default)
-        self.pipComboBox.addItems(pipExecutables)
+        self.venvComboBox.addItem(pip.getDefaultEnvironmentString())
+        self.venvComboBox.addItems(pip.getVirtualenvNames())
         
         msh = self.minimumSizeHint()
         self.resize(max(self.width(), msh.width()), msh.height())
@@ -42,12 +40,11 @@
         """
         Public method to get the entered data.
         
-        @return tuple with the pip command and a flag indicating to install
-            to the user install directory
+        @return tuple with the environment name and a flag indicating to
+            install to the user install directory
         @rtype tuple of (str, bool)
         """
-        command = self.pipComboBox.currentText()
-        if command == self.__default:
-            command = ""
-        
-        return command, self.userCheckBox.isChecked()
+        return (
+            self.venvComboBox.currentText(),
+            self.userCheckBox.isChecked(),
+        )

eric ide

mercurial