mirror of
https://github.com/alicevision/Meshroom.git
synced 2025-07-10 21:37:29 +02:00
[core] Simplify access to commands' prefix and suffix
This commit is contained in:
parent
46936768d1
commit
3d2dfcb91e
2 changed files with 14 additions and 4 deletions
|
@ -260,8 +260,8 @@ class Node(BaseNode):
|
||||||
meshroomComputeCmd += f" --iteration {chunk.range.iteration}"
|
meshroomComputeCmd += f" --iteration {chunk.range.iteration}"
|
||||||
|
|
||||||
runtimeEnv = chunk.node.nodeDesc.plugin.runtimeEnv
|
runtimeEnv = chunk.node.nodeDesc.plugin.runtimeEnv
|
||||||
cmdPrefix = chunk.node.nodeDesc.plugin.processEnv.getCommandPrefix()
|
cmdPrefix = chunk.node.nodeDesc.plugin.commandPrefix
|
||||||
cmdSuffix = chunk.node.nodeDesc.plugin.processEnv.getCommandSuffix()
|
cmdSuffix = chunk.node.nodeDesc.plugin.commandSuffix
|
||||||
self.executeChunkCommandLine(chunk, cmdPrefix + meshroomComputeCmd + cmdSuffix, env=runtimeEnv)
|
self.executeChunkCommandLine(chunk, cmdPrefix + meshroomComputeCmd + cmdSuffix, env=runtimeEnv)
|
||||||
|
|
||||||
|
|
||||||
|
@ -279,8 +279,8 @@ class CommandLineNode(BaseNode):
|
||||||
return MrNodeType.COMMANDLINE
|
return MrNodeType.COMMANDLINE
|
||||||
|
|
||||||
def buildCommandLine(self, chunk) -> str:
|
def buildCommandLine(self, chunk) -> str:
|
||||||
cmdPrefix = chunk.node.nodeDesc.plugin.processEnv.getCommandPrefix()
|
cmdPrefix = chunk.node.nodeDesc.plugin.commandPrefix
|
||||||
cmdSuffix = chunk.node.nodeDesc.plugin.processEnv.getCommandSuffix()
|
cmdSuffix = chunk.node.nodeDesc.plugin.commandSuffix
|
||||||
if chunk.node.isParallelized and chunk.node.size > 1:
|
if chunk.node.isParallelized and chunk.node.size > 1:
|
||||||
cmdSuffix = cmdSuffix + " " + self.commandLineRange.format(**chunk.range.toDict())
|
cmdSuffix = cmdSuffix + " " + self.commandLineRange.format(**chunk.range.toDict())
|
||||||
|
|
||||||
|
|
|
@ -395,6 +395,16 @@ class NodePlugin(BaseObject):
|
||||||
""" Return the environment dictionary for the runtime. """
|
""" Return the environment dictionary for the runtime. """
|
||||||
return self.processEnv.getEnvDict()
|
return self.processEnv.getEnvDict()
|
||||||
|
|
||||||
|
@property
|
||||||
|
def commandPrefix(self) -> str:
|
||||||
|
""" Return the command prefix for the NodePlugin's execution. """
|
||||||
|
return self.processEnv.getCommandPrefix()
|
||||||
|
|
||||||
|
@property
|
||||||
|
def commandSuffix(self) -> str:
|
||||||
|
""" Return the command suffix for the NodePlugin's execution. """
|
||||||
|
return self.processEnv.getCommandSuffix()
|
||||||
|
|
||||||
|
|
||||||
class NodePluginManager(BaseObject):
|
class NodePluginManager(BaseObject):
|
||||||
"""
|
"""
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue