src/eric7/VirtualEnv/VirtualenvManager.py

branch
eric7
changeset 9434
ef86a77942f2
parent 9418
93698f6003d3
child 9473
3f23dbf37dbe
--- a/src/eric7/VirtualEnv/VirtualenvManager.py	Wed Oct 26 11:50:03 2022 +0200
+++ b/src/eric7/VirtualEnv/VirtualenvManager.py	Wed Oct 26 17:28:33 2022 +0200
@@ -81,6 +81,7 @@
         #   is_remote:      a flag indicating a remotely accessed environment
         #   exec_path:      a string to be prefixed to the PATH environment
         #                   setting
+        #   description     a description of the environment
         #
         envsToDelete = []
         for venvName in environments:
@@ -96,6 +97,8 @@
                     environment["is_remote"] = False
                 if "exec_path" not in environment:
                     environment["exec_path"] = ""
+                if "description" not in environment:
+                    environment["description"] = ""
                 self.__virtualEnvironments[venvName] = environment
 
         # now remove unsupported environments
@@ -121,6 +124,7 @@
                     "is_conda": False,
                     "is_remote": False,
                     "exec_path": "",
+                    "description": "",
                 }
 
         self.__saveSettings()
@@ -260,6 +264,7 @@
         isConda=False,
         isRemote=False,
         execPath="",
+        description="",
     ):
         """
         Public method to add a virtual environment.
@@ -279,6 +284,8 @@
         @param execPath search path string to be prepended to the PATH
             environment variable
         @type str
+        @param description descriptive text for the environment
+        @type str
         """
         if venvName in self.__virtualEnvironments:
             ok = EricMessageBox.yesNo(
@@ -319,6 +326,7 @@
                 "is_conda": isConda,
                 "is_remote": isRemote,
                 "exec_path": execPath,
+                "description": description,
             }
 
             self.__saveSettings()
@@ -335,6 +343,7 @@
         isConda,
         isRemote,
         execPath,
+        description,
     ):
         """
         Public method to change a virtual environment.
@@ -354,6 +363,8 @@
         @param execPath search path string to be prepended to the PATH
             environment variable
         @type str
+        @param description descriptive text for the environment
+        @type str
         """
         if venvName not in self.__virtualEnvironments:
             EricMessageBox.yesNo(
@@ -375,6 +386,7 @@
             "is_conda": isConda,
             "is_remote": isRemote,
             "exec_path": execPath,
+            "description": description,
         }
 
         self.__saveSettings()
@@ -392,6 +404,7 @@
         isConda,
         isRemote,
         execPath,
+        description,
     ):
         """
         Public method to substitute a virtual environment entry with a new
@@ -414,6 +427,8 @@
         @param execPath search path string to be prepended to the PATH
             environment variable
         @type str
+        @param description descriptive text for the environment
+        @type str
         """
         if oldVenvName not in self.__virtualEnvironments:
             EricMessageBox.yesNo(
@@ -431,11 +446,12 @@
         self.addVirtualEnv(
             venvName,
             venvDirectory,
-            venvInterpreter,
-            isGlobal,
-            isConda,
-            isRemote,
-            execPath,
+            venvInterpreter=venvInterpreter,
+            isGlobal=isGlobal,
+            isConda=isConda,
+            isRemote=isRemote,
+            execPath=execPath,
+            description=description,
         )
 
     def deleteVirtualEnvs(self, venvNames):

eric ide

mercurial