mirror of
https://github.com/alicevision/Meshroom.git
synced 2025-07-13 06:47:26 +02:00
[core] plugins: Make ProcessEnv
a generic parent class
More specific classes will inherit from it.
This commit is contained in:
parent
97f2e0f198
commit
210d1fba4e
1 changed files with 21 additions and 4 deletions
|
@ -57,13 +57,30 @@ class ProcessEnvType(Enum):
|
|||
class ProcessEnv(BaseObject):
|
||||
"""
|
||||
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__()
|
||||
self.binPaths: list = [Path(folder, "bin")]
|
||||
self.libPaths: list = [Path(folder, "lib"), Path(folder, "lib64")]
|
||||
self.pythonPathFolders: list = [Path(folder)] + self.binPaths
|
||||
self._folder = folder
|
||||
self._processEnvType: ProcessEnvType = envType
|
||||
|
||||
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):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue