src/eric7/CondaInterface/__init__.py

branch
eric7
changeset 9221
bf71ee032bb4
parent 9209
b99e7fd55fd3
child 9413
80c06d472826
--- a/src/eric7/CondaInterface/__init__.py	Wed Jul 13 11:16:20 2022 +0200
+++ b/src/eric7/CondaInterface/__init__.py	Wed Jul 13 14:55:47 2022 +0200
@@ -27,53 +27,52 @@
     """
     global __CondaVersionStr, __CondaVersion, __CondaRootPrefix
     global __CondaUserConfig, __initialized
-    
+
     if not __initialized:
         exe = Preferences.getConda("CondaExecutable")
         if not exe:
             exe = "conda"
-        
+
         proc = QProcess()
         proc.start(exe, ["info", "--json"])
         if not proc.waitForStarted(msecs=15000):
             __CondaVersionStr = QCoreApplication.translate(
-                "CondaInterface",
-                '<conda not found or not configured.>')
+                "CondaInterface", "<conda not found or not configured.>"
+            )
         else:
             proc.waitForFinished(msecs=15000)
-            output = str(proc.readAllStandardOutput(),
-                         Preferences.getSystem("IOEncoding"),
-                         'replace').strip()
+            output = str(
+                proc.readAllStandardOutput(),
+                Preferences.getSystem("IOEncoding"),
+                "replace",
+            ).strip()
             try:
                 jsonDict = json.loads(output)
             except Exception:
                 __CondaVersionStr = QCoreApplication.translate(
-                    "CondaInterface",
-                    '<conda returned invalid data.>')
+                    "CondaInterface", "<conda returned invalid data.>"
+                )
                 return
-            
+
             if "error" in jsonDict:
                 __CondaVersionStr = QCoreApplication.translate(
-                    "CondaInterface",
-                    '<conda returned an error: {0}.>').format(
-                    jsonDict["error"])
+                    "CondaInterface", "<conda returned an error: {0}.>"
+                ).format(jsonDict["error"])
             else:
                 __CondaVersionStr = jsonDict["conda_version"]
-                __CondaVersion = tuple(
-                    int(i) for i in __CondaVersionStr.split(".")
-                )
+                __CondaVersion = tuple(int(i) for i in __CondaVersionStr.split("."))
                 __CondaRootPrefix = jsonDict["root_prefix"]
                 __CondaUserConfig = jsonDict.get("user_rc_path")
                 if __CondaUserConfig is None:
                     __CondaUserConfig = jsonDict.get("rc_path")
-                
+
                 __initialized = True
 
 
 def condaVersion():
     """
     Module function to get the conda version.
-    
+
     @return tuple containing the conda version
     @rtype tuple of (int, int, int)
     """
@@ -84,7 +83,7 @@
 def condaVersionStr():
     """
     Module function to get the conda version as a string.
-    
+
     @return conda version as a string
     @rtype str
     """
@@ -95,7 +94,7 @@
 def rootPrefix():
     """
     Module function to get the root prefix.
-    
+
     @return root prefix
     @rtype str
     """
@@ -106,7 +105,7 @@
 def userConfiguration():
     """
     Module function to get the path of the user configuration file.
-    
+
     @return path of the user configuration file
     @rtype str
     """
@@ -117,7 +116,7 @@
 def isCondaAvailable():
     """
     Module function to check the availability of conda.
-    
+
     @return flag indicating conda availability
     @rtype bool
     """
@@ -130,5 +129,5 @@
     Module function to reset the conda interface.
     """
     global __initialized
-    
+
     __initialized = False

eric ide

mercurial