Plugins/UiExtensionPlugins/PipInterface/PipFileSelectionDialog.py

changeset 6342
c79ecba9cde7
parent 6327
a1716d9210f4
child 6619
1d34365c082c
diff -r a00e63f6d766 -r c79ecba9cde7 Plugins/UiExtensionPlugins/PipInterface/PipFileSelectionDialog.py
--- a/Plugins/UiExtensionPlugins/PipInterface/PipFileSelectionDialog.py	Tue Jun 12 18:59:45 2018 +0200
+++ b/Plugins/UiExtensionPlugins/PipInterface/PipFileSelectionDialog.py	Tue Jun 12 19:01:06 2018 +0200
@@ -26,12 +26,12 @@
     """
     Class implementing a dialog to enter a file to be processed.
     """
-    def __init__(self, plugin, mode, install=True, parent=None):
+    def __init__(self, pip, mode, install=True, parent=None):
         """
         Constructor
         
-        @param plugin reference to the plugin object
-        @type PipInterfacePlugin
+        @param pip reference to the pip object
+        @type Pip
         @param mode mode of the dialog
         @type str
         @param install flag indicating an install action
@@ -70,10 +70,8 @@
         
         self.buttonBox.button(QDialogButtonBox.Ok).setEnabled(False)
         
-        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())
         
         self.userCheckBox.setVisible(install)
         
@@ -97,14 +95,13 @@
         """
         Public method to get the entered data.
         
-        @return tuple with the pip command, the name of the
+        @return tuple with the environment name, the name of the
             selected file and a flag indicating to install to the
             user install directory
         @rtype tuple of (str, str, bool)
         """
-        command = self.pipComboBox.currentText()
-        if command == self.__default:
-            command = ""
-        
-        return (command, self.filePicker.text(),
-                self.userCheckBox.isChecked())
+        return (
+            self.venvComboBox.currentText(),
+            self.filePicker.text(),
+            self.userCheckBox.isChecked()
+        )

eric ide

mercurial