24 class VirtualenvAddEditDialog(QDialog, Ui_VirtualenvAddEditDialog): |
24 class VirtualenvAddEditDialog(QDialog, Ui_VirtualenvAddEditDialog): |
25 """ |
25 """ |
26 Class implementing a dialog to enter the data of a virtual environment. |
26 Class implementing a dialog to enter the data of a virtual environment. |
27 """ |
27 """ |
28 def __init__(self, manager, venvName="", venvDirectory="", |
28 def __init__(self, manager, venvName="", venvDirectory="", |
29 venvInterpreter="", venvVariant=3, isGlobal=False, |
29 venvInterpreter="", isGlobal=False, isConda=False, |
30 isConda=False, isRemote=False, execPath="", parent=None): |
30 isRemote=False, execPath="", parent=None): |
31 """ |
31 """ |
32 Constructor |
32 Constructor |
33 |
33 |
34 @param manager reference to the virtual environment manager |
34 @param manager reference to the virtual environment manager |
35 @type VirtualenvManager |
35 @type VirtualenvManager |
37 @type str |
37 @type str |
38 @param venvDirectory directory of the virtual environment |
38 @param venvDirectory directory of the virtual environment |
39 @type str |
39 @type str |
40 @param venvInterpreter Python interpreter of the virtual environment |
40 @param venvInterpreter Python interpreter of the virtual environment |
41 @type str |
41 @type str |
42 @param venvVariant Python variant of the virtual environment |
|
43 @type int |
|
44 @param isGlobal flag indicating a global environment |
42 @param isGlobal flag indicating a global environment |
45 @type bool |
43 @type bool |
46 @param isConda flag indicating an Anaconda virtual environment |
44 @param isConda flag indicating an Anaconda virtual environment |
47 @type bool |
45 @type bool |
48 @param isRemote flag indicating a remotely accessed environment |
46 @param isRemote flag indicating a remotely accessed environment |
80 self.nameEdit.setText(venvName) |
78 self.nameEdit.setText(venvName) |
81 self.targetDirectoryPicker.setText(venvDirectory, |
79 self.targetDirectoryPicker.setText(venvDirectory, |
82 toNative=not isRemote) |
80 toNative=not isRemote) |
83 self.pythonExecPicker.setText(venvInterpreter, |
81 self.pythonExecPicker.setText(venvInterpreter, |
84 toNative=not isRemote) |
82 toNative=not isRemote) |
85 self.variantComboBox.setCurrentIndex(3 - venvVariant) |
|
86 self.globalCheckBox.setChecked(isGlobal) |
83 self.globalCheckBox.setChecked(isGlobal) |
87 self.anacondaCheckBox.setChecked(isConda) |
84 self.anacondaCheckBox.setChecked(isConda) |
88 self.remoteCheckBox.setChecked(isRemote) |
85 self.remoteCheckBox.setChecked(isRemote) |
89 self.execPathEdit.setText(execPath) |
86 self.execPathEdit.setText(execPath) |
90 |
87 |
209 def getData(self): |
206 def getData(self): |
210 """ |
207 """ |
211 Public method to retrieve the entered data. |
208 Public method to retrieve the entered data. |
212 |
209 |
213 @return tuple containing the logical name, the directory, the |
210 @return tuple containing the logical name, the directory, the |
214 interpreter of the virtual environment, the Python variant, |
211 interpreter of the virtual environment, a flag indicating a |
215 a flag indicating a global environment, a flag indicating an |
212 global environment, a flag indicating an Anaconda environment, |
216 Anaconda environment, aflag indicating a remotely accessed |
213 a flag indicating a remotely accessed environment and a string |
217 environment and a string to be prepended to the PATH environment |
214 to be prepended to the PATH environment variable |
218 variable |
215 @rtype tuple of (str, str, str, bool, bool, bool, str) |
219 @rtype tuple of (str, str, str, int, bool, bool, bool, str) |
|
220 """ |
216 """ |
221 nativePaths = not self.remoteCheckBox.isChecked() |
217 nativePaths = not self.remoteCheckBox.isChecked() |
222 return ( |
218 return ( |
223 self.nameEdit.text(), |
219 self.nameEdit.text(), |
224 self.targetDirectoryPicker.text(toNative=nativePaths), |
220 self.targetDirectoryPicker.text(toNative=nativePaths), |
225 self.pythonExecPicker.text(toNative=nativePaths), |
221 self.pythonExecPicker.text(toNative=nativePaths), |
226 3 - self.variantComboBox.currentIndex(), |
|
227 self.globalCheckBox.isChecked(), |
222 self.globalCheckBox.isChecked(), |
228 self.anacondaCheckBox.isChecked(), |
223 self.anacondaCheckBox.isChecked(), |
229 self.remoteCheckBox.isChecked(), |
224 self.remoteCheckBox.isChecked(), |
230 self.execPathEdit.text(), |
225 self.execPathEdit.text(), |
231 ) |
226 ) |