VirtualEnv/VirtualenvConfigurationDialog.py

branch
conda
changeset 6681
9c1513b488ef
parent 6678
5f1de9e59227
child 6684
37e280d711af
diff -r c5f7b2e9a06d -r 9c1513b488ef VirtualEnv/VirtualenvConfigurationDialog.py
--- a/VirtualEnv/VirtualenvConfigurationDialog.py	Mon Jan 28 20:03:25 2019 +0100
+++ b/VirtualEnv/VirtualenvConfigurationDialog.py	Tue Jan 29 19:48:13 2019 +0100
@@ -28,6 +28,8 @@
 import Preferences
 import Utilities
 
+import CondaInterface
+
 
 class VirtualenvConfigurationDialog(QDialog, Ui_VirtualenvConfigurationDialog):
     """
@@ -98,6 +100,9 @@
         elif self.__condaFound:
             self.condaButton.setChecked(True)
         
+        self.condaInsecureCheckBox.setEnabled(
+            CondaInterface.condaVersion() >= (4, 3, 18))
+        
         msh = self.minimumSizeHint()
         self.resize(max(self.width(), msh.width()), msh.height())
     
@@ -145,7 +150,8 @@
         enable = not self.condaCloneGroup.isChecked()
         self.condaPackagesEdit.setEnabled(enable)
         self.condaPythonEdit.setEnabled(enable)
-        self.condaInsecureCheckBox.setEnabled(enable)
+        self.condaInsecureCheckBox.setEnabled(
+            enable and CondaInterface.condaVersion() >= (4, 3, 18))
         self.condaDryrunCheckBox.setEnabled(enable)
         
         # select page
@@ -367,29 +373,9 @@
         Private method to determine the conda version and set the respective
         label.
         """
-        exe = Preferences.getConda("CondaExecutable")
-        if not exe:
-            exe = "conda"
-        
-        proc = QProcess()
-        proc.start(exe, ["--version"])
-        if not proc.waitForStarted(5000):
-            self.__condaFound = False
-            version = self.tr('<conda not found or not configured.>')
-        else:
-            proc.waitForFinished(5000)
-            output = str(proc.readAllStandardOutput(),
-                         Preferences.getSystem("IOEncoding"),
-                         'replace').strip()
-            match = re.match(self.__versionRe, output)
-            if match:
-                self.__condaFound = True
-                version = match.group(1)
-            else:
-                self.__condaFound = False
-                version = self.tr('<conda returned strange version info.')
+        self.__condaFound = bool(CondaInterface.condaVersion())
         self.condaButton.setText(self.tr(
-            "conda Version: {0}".format(version)))
+            "conda Version: {0}".format(CondaInterface.condaVersionStr())))
         self.condaButton.setEnabled(self.__condaFound)
         if not self.__condaFound:
             self.condaButton.setChecked(False)

eric ide

mercurial