VirtualEnv/VirtualenvExecDialog.py

branch
conda
changeset 6676
536ad4fa35aa
parent 6645
ad476851d7e0
child 6677
6299d69a218a
--- a/VirtualEnv/VirtualenvExecDialog.py	Sat Jan 26 19:42:53 2019 +0100
+++ b/VirtualEnv/VirtualenvExecDialog.py	Sun Jan 27 12:39:53 2019 +0100
@@ -33,28 +33,13 @@
     This class starts a QProcess and displays a dialog that
     shows the output of the virtualenv or pyvenv process.
     """
-    def __init__(self, pyvenv, targetDir, venvName, openTarget, createLog,
-                 createScript, interpreter, venvManager, parent=None):
+    def __init__(self, configuration, venvManager, parent=None):
         """
         Constructor
         
-        @param pyvenv flag indicating the use of 'pyvenv'
-        @type bool
-        @param targetDir name of the virtualenv directory
-        @type str
-        @param venvName logical name for the virtual environment
-        @type str
-        @param openTarget flag indicating to open the virtualenv directory
-            in a file manager
-        @type bool
-        @param createLog flag indicating to create a log file of the
-            creation process
-        @type bool
-        @param createScript flag indicating to create a script to recreate
-            the virtual environment
-        @type bool
-        @param interpreter name of the python interpreter to use
-        @type str
+        @param configuration dictionary containing the configuration parameters
+            as returned by the command configuration dialog
+        @type dictResolver
         @param venvManager reference to the virtual environment manager
         @type VirtualenvManager
         @param parent reference to the parent widget
@@ -66,21 +51,22 @@
         self.buttonBox.button(QDialogButtonBox.Close).setEnabled(False)
         self.buttonBox.button(QDialogButtonBox.Cancel).setDefault(True)
         
-        self.__pyvenv = pyvenv
-        self.__targetDir = targetDir
-        self.__openTarget = openTarget
-        self.__createLog = createLog
-        self.__createScript = createScript
-        self.__venvName = venvName
+        self.__pyvenv = configuration["envType"] == "pyvenv"
+        self.__targetDir = configuration["targetDirectory"]
+        self.__openTarget = configuration["openTarget"]
+        self.__createLog = configuration["createLog"]
+        self.__createScript = configuration["createScript"]
+        self.__venvName = configuration["logicalName"]
         self.__venvManager = venvManager
         
         self.__process = None
         self.__cmd = ""
         
-        if pyvenv:
+        if self.__pyvenv:
             self.__calls = []
-            if interpreter:
-                self.__calls.append((interpreter, ["-m", "venv"]))
+            if configuration["pythonExe"]:
+                self.__calls.append((configuration["pythonExe"],
+                                     ["-m", "venv"]))
             self.__calls.extend([
                 (sys.executable.replace("w.exe", ".exe"),
                  ["-m", "venv"]),

eric ide

mercurial