VirtualEnv/VirtualenvAddEditDialog.py

changeset 6349
17b3c75913de
parent 6341
a00e63f6d766
child 6362
ec32d1d7f525
diff -r d6c0b8ab1fc6 -r 17b3c75913de VirtualEnv/VirtualenvAddEditDialog.py
--- a/VirtualEnv/VirtualenvAddEditDialog.py	Fri Jun 15 18:49:48 2018 +0200
+++ b/VirtualEnv/VirtualenvAddEditDialog.py	Sat Jun 16 13:34:22 2018 +0200
@@ -27,7 +27,7 @@
     Class implementing a dialog to enter the data of a virtual environment.
     """
     def __init__(self, manager, venvName="", venvDirectory="",
-                 venvInterpreter="", parent=None):
+                 venvInterpreter="", venvVariant=3, parent=None):
         """
         Constructor
         
@@ -39,6 +39,8 @@
         @type str
         @param venvInterpreter Python interpreter of the virtual environment
         @type str
+        @param venvVariant Python variant of the virtual environment
+        @type int
         @param parent reference to the parent widget
         @type QWidget
         """
@@ -63,6 +65,7 @@
         self.nameEdit.setText(venvName)
         self.targetDirectoryPicker.setText(venvDirectory)
         self.pythonExecPicker.setText(venvInterpreter)
+        self.variantComboBox.setCurrentIndex(3 - venvVariant)
         self.globalCheckBox.setChecked(self.__editMode and
                                        not bool(venvDirectory))
         
@@ -151,19 +154,21 @@
         """
         Public method to retrieve the entered data.
         
-        @return tuple containing the logical name, the directory and the
-            interpreter of the virtual environment
-        @rtype tuple of (str, str, str)
+        @return tuple containing the logical name, the directory, the
+            interpreter of the virtual environment and the Python variant
+        @rtype tuple of (str, str, str, int)
         """
         if self.globalCheckBox.isChecked():
             return (
                 self.nameEdit.text(),
                 "",
                 self.pythonExecPicker.text(),
+                3 - self.variantComboBox.currentIndex(),
             )
         else:
             return (
                 self.nameEdit.text(),
                 self.targetDirectoryPicker.text(),
                 self.pythonExecPicker.text(),
+                3 - self.variantComboBox.currentIndex(),
             )

eric ide

mercurial