VirtualEnv/VirtualenvExecDialog.py

branch
maintenance
changeset 6826
c6dda2cbe081
parent 6696
706185900558
diff -r d14ddbfbbd36 -r c6dda2cbe081 VirtualEnv/VirtualenvExecDialog.py
--- a/VirtualEnv/VirtualenvExecDialog.py	Sat Feb 16 10:27:50 2019 +0100
+++ b/VirtualEnv/VirtualenvExecDialog.py	Sat Mar 02 11:15:24 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 dict
         @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"]),
@@ -250,7 +236,7 @@
         """
         Private method to log some output.
         
-        @param s output sstring to log (string)
+        @param s output string to log (string)
         """
         self.contents.insertPlainText(s)
         self.contents.ensureCursorVisible()

eric ide

mercurial