src/eric7/CondaInterface/__init__.py

Thu, 11 Jul 2024 14:21:34 +0200

author
Detlev Offenbach <detlev@die-offenbachs.de>
date
Thu, 11 Jul 2024 14:21:34 +0200
branch
eric7
changeset 10840
c8045d0dbaa7
parent 10439
21c28b0f9e41
child 11090
f5f5f5803935
permissions
-rw-r--r--

MicroPython
- Updated the list of known CircuitPython boards for CPy 9.1.0.
- Updated the list of known UF2 capable boards.

6677
6299d69a218a Continued implementing environment creation with conda.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1 # -*- coding: utf-8 -*-
6299d69a218a Continued implementing environment creation with conda.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
2
10439
21c28b0f9e41 Updated copyright for 2024.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9653
diff changeset
3 # Copyright (c) 2019 - 2024 Detlev Offenbach <detlev@die-offenbachs.de>
6677
6299d69a218a Continued implementing environment creation with conda.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
4 #
6299d69a218a Continued implementing environment creation with conda.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
5
6299d69a218a Continued implementing environment creation with conda.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
6 """
6299d69a218a Continued implementing environment creation with conda.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
7 Package implementing the various conda related modules.
6299d69a218a Continued implementing environment creation with conda.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
8 """
6681
9c1513b488ef CondaInterface, VirtualenvConfigurationDialog: moved the version related functions to the CondaInterface package.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6677
diff changeset
9
6697
2f5c951bdf14 Conda interface: added capability to remove conda environments the conda way.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6681
diff changeset
10 import json
6681
9c1513b488ef CondaInterface, VirtualenvConfigurationDialog: moved the version related functions to the CondaInterface package.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6677
diff changeset
11
8318
962bce857696 Replaced all imports of PyQt5 to PyQt6 and started to replace code using obsoleted methods and adapt to the PyQt6 enum usage.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8312
diff changeset
12 from PyQt6.QtCore import QCoreApplication, QProcess
6681
9c1513b488ef CondaInterface, VirtualenvConfigurationDialog: moved the version related functions to the CondaInterface package.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6677
diff changeset
13
9413
80c06d472826 Changed the eric7 import statements to include the package name (i.e. eric7) in order to not fiddle with sys.path.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9221
diff changeset
14 from eric7 import Preferences
6681
9c1513b488ef CondaInterface, VirtualenvConfigurationDialog: moved the version related functions to the CondaInterface package.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6677
diff changeset
15
7249
0bf517e60f54 Fixed some code style issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7229
diff changeset
16 __CondaVersion = ()
6681
9c1513b488ef CondaInterface, VirtualenvConfigurationDialog: moved the version related functions to the CondaInterface package.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6677
diff changeset
17 __CondaVersionStr = ""
6697
2f5c951bdf14 Conda interface: added capability to remove conda environments the conda way.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6681
diff changeset
18 __CondaRootPrefix = ""
6724
ca89c7d94c94 Conda: started implementing the conda menu functionality
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6697
diff changeset
19 __CondaUserConfig = ""
6697
2f5c951bdf14 Conda interface: added capability to remove conda environments the conda way.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6681
diff changeset
20
2f5c951bdf14 Conda interface: added capability to remove conda environments the conda way.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6681
diff changeset
21 __initialized = False
6681
9c1513b488ef CondaInterface, VirtualenvConfigurationDialog: moved the version related functions to the CondaInterface package.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6677
diff changeset
22
9c1513b488ef CondaInterface, VirtualenvConfigurationDialog: moved the version related functions to the CondaInterface package.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6677
diff changeset
23
6697
2f5c951bdf14 Conda interface: added capability to remove conda environments the conda way.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6681
diff changeset
24 def __initializeCondaInterface():
6681
9c1513b488ef CondaInterface, VirtualenvConfigurationDialog: moved the version related functions to the CondaInterface package.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6677
diff changeset
25 """
6697
2f5c951bdf14 Conda interface: added capability to remove conda environments the conda way.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6681
diff changeset
26 Private module function to (re-)initialize the conda interface.
6681
9c1513b488ef CondaInterface, VirtualenvConfigurationDialog: moved the version related functions to the CondaInterface package.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6677
diff changeset
27 """
7250
d8bdc55aee1a Started to resolve code style issue M841.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7249
diff changeset
28 global __CondaVersionStr, __CondaVersion, __CondaRootPrefix
d8bdc55aee1a Started to resolve code style issue M841.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7249
diff changeset
29 global __CondaUserConfig, __initialized
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
30
6697
2f5c951bdf14 Conda interface: added capability to remove conda environments the conda way.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6681
diff changeset
31 if not __initialized:
6681
9c1513b488ef CondaInterface, VirtualenvConfigurationDialog: moved the version related functions to the CondaInterface package.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6677
diff changeset
32 exe = Preferences.getConda("CondaExecutable")
9c1513b488ef CondaInterface, VirtualenvConfigurationDialog: moved the version related functions to the CondaInterface package.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6677
diff changeset
33 if not exe:
9c1513b488ef CondaInterface, VirtualenvConfigurationDialog: moved the version related functions to the CondaInterface package.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6677
diff changeset
34 exe = "conda"
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
35
6681
9c1513b488ef CondaInterface, VirtualenvConfigurationDialog: moved the version related functions to the CondaInterface package.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6677
diff changeset
36 proc = QProcess()
6697
2f5c951bdf14 Conda interface: added capability to remove conda environments the conda way.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6681
diff changeset
37 proc.start(exe, ["info", "--json"])
8217
385f60c94548 Applied some more code simplifications suggested by the new Simplify checker.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7923
diff changeset
38 if not proc.waitForStarted(msecs=15000):
6681
9c1513b488ef CondaInterface, VirtualenvConfigurationDialog: moved the version related functions to the CondaInterface package.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6677
diff changeset
39 __CondaVersionStr = QCoreApplication.translate(
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
40 "CondaInterface", "<conda not found or not configured.>"
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
41 )
6681
9c1513b488ef CondaInterface, VirtualenvConfigurationDialog: moved the version related functions to the CondaInterface package.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6677
diff changeset
42 else:
8217
385f60c94548 Applied some more code simplifications suggested by the new Simplify checker.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7923
diff changeset
43 proc.waitForFinished(msecs=15000)
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
44 output = str(
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
45 proc.readAllStandardOutput(),
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
46 Preferences.getSystem("IOEncoding"),
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
47 "replace",
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
48 ).strip()
6697
2f5c951bdf14 Conda interface: added capability to remove conda environments the conda way.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6681
diff changeset
49 try:
2f5c951bdf14 Conda interface: added capability to remove conda environments the conda way.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6681
diff changeset
50 jsonDict = json.loads(output)
2f5c951bdf14 Conda interface: added capability to remove conda environments the conda way.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6681
diff changeset
51 except Exception:
6681
9c1513b488ef CondaInterface, VirtualenvConfigurationDialog: moved the version related functions to the CondaInterface package.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6677
diff changeset
52 __CondaVersionStr = QCoreApplication.translate(
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
53 "CondaInterface", "<conda returned invalid data.>"
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
54 )
6697
2f5c951bdf14 Conda interface: added capability to remove conda environments the conda way.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6681
diff changeset
55 return
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
56
7093
5b6c7e9f875d CondaInterface: fixed an issue obtaining the conda version info on Windows starting with conda 4.7.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6942
diff changeset
57 if "error" in jsonDict:
5b6c7e9f875d CondaInterface: fixed an issue obtaining the conda version info on Windows starting with conda 4.7.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6942
diff changeset
58 __CondaVersionStr = QCoreApplication.translate(
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
59 "CondaInterface", "<conda returned an error: {0}.>"
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
60 ).format(jsonDict["error"])
7093
5b6c7e9f875d CondaInterface: fixed an issue obtaining the conda version info on Windows starting with conda 4.7.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6942
diff changeset
61 else:
5b6c7e9f875d CondaInterface: fixed an issue obtaining the conda version info on Windows starting with conda 4.7.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6942
diff changeset
62 __CondaVersionStr = jsonDict["conda_version"]
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
63 __CondaVersion = tuple(int(i) for i in __CondaVersionStr.split("."))
7093
5b6c7e9f875d CondaInterface: fixed an issue obtaining the conda version info on Windows starting with conda 4.7.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6942
diff changeset
64 __CondaRootPrefix = jsonDict["root_prefix"]
8217
385f60c94548 Applied some more code simplifications suggested by the new Simplify checker.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7923
diff changeset
65 __CondaUserConfig = jsonDict.get("user_rc_path")
385f60c94548 Applied some more code simplifications suggested by the new Simplify checker.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7923
diff changeset
66 if __CondaUserConfig is None:
385f60c94548 Applied some more code simplifications suggested by the new Simplify checker.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7923
diff changeset
67 __CondaUserConfig = jsonDict.get("rc_path")
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
68
7093
5b6c7e9f875d CondaInterface: fixed an issue obtaining the conda version info on Windows starting with conda 4.7.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6942
diff changeset
69 __initialized = True
6681
9c1513b488ef CondaInterface, VirtualenvConfigurationDialog: moved the version related functions to the CondaInterface package.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6677
diff changeset
70
9c1513b488ef CondaInterface, VirtualenvConfigurationDialog: moved the version related functions to the CondaInterface package.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6677
diff changeset
71
9c1513b488ef CondaInterface, VirtualenvConfigurationDialog: moved the version related functions to the CondaInterface package.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6677
diff changeset
72 def condaVersion():
9c1513b488ef CondaInterface, VirtualenvConfigurationDialog: moved the version related functions to the CondaInterface package.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6677
diff changeset
73 """
9c1513b488ef CondaInterface, VirtualenvConfigurationDialog: moved the version related functions to the CondaInterface package.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6677
diff changeset
74 Module function to get the conda version.
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
75
6681
9c1513b488ef CondaInterface, VirtualenvConfigurationDialog: moved the version related functions to the CondaInterface package.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6677
diff changeset
76 @return tuple containing the conda version
9c1513b488ef CondaInterface, VirtualenvConfigurationDialog: moved the version related functions to the CondaInterface package.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6677
diff changeset
77 @rtype tuple of (int, int, int)
9c1513b488ef CondaInterface, VirtualenvConfigurationDialog: moved the version related functions to the CondaInterface package.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6677
diff changeset
78 """
6697
2f5c951bdf14 Conda interface: added capability to remove conda environments the conda way.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6681
diff changeset
79 __initializeCondaInterface()
6681
9c1513b488ef CondaInterface, VirtualenvConfigurationDialog: moved the version related functions to the CondaInterface package.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6677
diff changeset
80 return __CondaVersion
9c1513b488ef CondaInterface, VirtualenvConfigurationDialog: moved the version related functions to the CondaInterface package.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6677
diff changeset
81
9c1513b488ef CondaInterface, VirtualenvConfigurationDialog: moved the version related functions to the CondaInterface package.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6677
diff changeset
82
9c1513b488ef CondaInterface, VirtualenvConfigurationDialog: moved the version related functions to the CondaInterface package.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6677
diff changeset
83 def condaVersionStr():
9c1513b488ef CondaInterface, VirtualenvConfigurationDialog: moved the version related functions to the CondaInterface package.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6677
diff changeset
84 """
9c1513b488ef CondaInterface, VirtualenvConfigurationDialog: moved the version related functions to the CondaInterface package.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6677
diff changeset
85 Module function to get the conda version as a string.
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
86
6681
9c1513b488ef CondaInterface, VirtualenvConfigurationDialog: moved the version related functions to the CondaInterface package.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6677
diff changeset
87 @return conda version as a string
9c1513b488ef CondaInterface, VirtualenvConfigurationDialog: moved the version related functions to the CondaInterface package.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6677
diff changeset
88 @rtype str
9c1513b488ef CondaInterface, VirtualenvConfigurationDialog: moved the version related functions to the CondaInterface package.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6677
diff changeset
89 """
6697
2f5c951bdf14 Conda interface: added capability to remove conda environments the conda way.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6681
diff changeset
90 __initializeCondaInterface()
6681
9c1513b488ef CondaInterface, VirtualenvConfigurationDialog: moved the version related functions to the CondaInterface package.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6677
diff changeset
91 return __CondaVersionStr
6697
2f5c951bdf14 Conda interface: added capability to remove conda environments the conda way.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6681
diff changeset
92
2f5c951bdf14 Conda interface: added capability to remove conda environments the conda way.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6681
diff changeset
93
2f5c951bdf14 Conda interface: added capability to remove conda environments the conda way.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6681
diff changeset
94 def rootPrefix():
2f5c951bdf14 Conda interface: added capability to remove conda environments the conda way.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6681
diff changeset
95 """
2f5c951bdf14 Conda interface: added capability to remove conda environments the conda way.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6681
diff changeset
96 Module function to get the root prefix.
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
97
6697
2f5c951bdf14 Conda interface: added capability to remove conda environments the conda way.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6681
diff changeset
98 @return root prefix
2f5c951bdf14 Conda interface: added capability to remove conda environments the conda way.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6681
diff changeset
99 @rtype str
2f5c951bdf14 Conda interface: added capability to remove conda environments the conda way.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6681
diff changeset
100 """
2f5c951bdf14 Conda interface: added capability to remove conda environments the conda way.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6681
diff changeset
101 __initializeCondaInterface()
2f5c951bdf14 Conda interface: added capability to remove conda environments the conda way.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6681
diff changeset
102 return __CondaRootPrefix
2f5c951bdf14 Conda interface: added capability to remove conda environments the conda way.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6681
diff changeset
103
2f5c951bdf14 Conda interface: added capability to remove conda environments the conda way.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6681
diff changeset
104
6724
ca89c7d94c94 Conda: started implementing the conda menu functionality
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6697
diff changeset
105 def userConfiguration():
ca89c7d94c94 Conda: started implementing the conda menu functionality
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6697
diff changeset
106 """
ca89c7d94c94 Conda: started implementing the conda menu functionality
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6697
diff changeset
107 Module function to get the path of the user configuration file.
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
108
6724
ca89c7d94c94 Conda: started implementing the conda menu functionality
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6697
diff changeset
109 @return path of the user configuration file
ca89c7d94c94 Conda: started implementing the conda menu functionality
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6697
diff changeset
110 @rtype str
ca89c7d94c94 Conda: started implementing the conda menu functionality
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6697
diff changeset
111 """
ca89c7d94c94 Conda: started implementing the conda menu functionality
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6697
diff changeset
112 __initializeCondaInterface()
ca89c7d94c94 Conda: started implementing the conda menu functionality
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6697
diff changeset
113 return __CondaUserConfig
ca89c7d94c94 Conda: started implementing the conda menu functionality
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6697
diff changeset
114
ca89c7d94c94 Conda: started implementing the conda menu functionality
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6697
diff changeset
115
6738
a7f835b41606 CondaPackagesWidget: show an error string if conda is not available. No other interface element are shown in that case.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6724
diff changeset
116 def isCondaAvailable():
a7f835b41606 CondaPackagesWidget: show an error string if conda is not available. No other interface element are shown in that case.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6724
diff changeset
117 """
a7f835b41606 CondaPackagesWidget: show an error string if conda is not available. No other interface element are shown in that case.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6724
diff changeset
118 Module function to check the availability of conda.
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
119
6738
a7f835b41606 CondaPackagesWidget: show an error string if conda is not available. No other interface element are shown in that case.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6724
diff changeset
120 @return flag indicating conda availability
a7f835b41606 CondaPackagesWidget: show an error string if conda is not available. No other interface element are shown in that case.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6724
diff changeset
121 @rtype bool
a7f835b41606 CondaPackagesWidget: show an error string if conda is not available. No other interface element are shown in that case.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6724
diff changeset
122 """
a7f835b41606 CondaPackagesWidget: show an error string if conda is not available. No other interface element are shown in that case.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6724
diff changeset
123 __initializeCondaInterface()
a7f835b41606 CondaPackagesWidget: show an error string if conda is not available. No other interface element are shown in that case.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6724
diff changeset
124 return bool(__CondaVersion)
a7f835b41606 CondaPackagesWidget: show an error string if conda is not available. No other interface element are shown in that case.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6724
diff changeset
125
6741
33a82a20dd3a Fixed some code style issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6738
diff changeset
126
6697
2f5c951bdf14 Conda interface: added capability to remove conda environments the conda way.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6681
diff changeset
127 def resetInterface():
2f5c951bdf14 Conda interface: added capability to remove conda environments the conda way.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6681
diff changeset
128 """
2f5c951bdf14 Conda interface: added capability to remove conda environments the conda way.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6681
diff changeset
129 Module function to reset the conda interface.
2f5c951bdf14 Conda interface: added capability to remove conda environments the conda way.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6681
diff changeset
130 """
2f5c951bdf14 Conda interface: added capability to remove conda environments the conda way.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6681
diff changeset
131 global __initialized
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
132
6697
2f5c951bdf14 Conda interface: added capability to remove conda environments the conda way.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6681
diff changeset
133 __initialized = False

eric ide

mercurial