[core] plugins: Make ProcessEnv a generic parent class

More specific classes will inherit from it.
This commit is contained in:
Candice Bentéjac 2025-06-10 17:02:17 +02:00
parent 97f2e0f198
commit 210d1fba4e

View file

@ -57,13 +57,30 @@ class ProcessEnvType(Enum):
class ProcessEnv(BaseObject): class ProcessEnv(BaseObject):
""" """
Describes the environment required by a node's process. Describes the environment required by a node's process.
Args:
folder: the source folder for the process.
envType: (optional) the type of process environment.
uri: (optional) the Unique Resource Identifier to activate the environment.
""" """
def __init__(self, folder: str): def __init__(self, folder: str, envType: ProcessEnvType = ProcessEnvType.DEFAULT):
super().__init__() super().__init__()
self.binPaths: list = [Path(folder, "bin")] self._folder = folder
self.libPaths: list = [Path(folder, "lib"), Path(folder, "lib64")] self._processEnvType: ProcessEnvType = envType
self.pythonPathFolders: list = [Path(folder)] + self.binPaths
def getEnvDict(self) -> dict:
""" Return the environment dictionary if it has been modified, None otherwise. """
return None
def getCommandPrefix(self) -> str:
""" Return the prefix to the command line that will be executed by the process. """
return ""
def getCommandSuffix(self) -> str:
""" Return the suffix to the command line that will be executed by the process. """
return ""
class NodePluginStatus(Enum): class NodePluginStatus(Enum):