From 8e1452d5bcae38c9f3cd4db16cc51e403dee024c Mon Sep 17 00:00:00 2001 From: Fabien Castan Date: Fri, 5 Jan 2018 16:59:31 +0100 Subject: [PATCH] [core] add quotes on strings to deal with space characters on command line --- meshroom/core/graph.py | 4 +++- meshroom/nodes/aliceVision/CameraInit.py | 2 +- meshroom/submitters/simpleFarmSubmitter.py | 2 +- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/meshroom/core/graph.py b/meshroom/core/graph.py index c5b2dc8e..d8c12f23 100644 --- a/meshroom/core/graph.py +++ b/meshroom/core/graph.py @@ -249,6 +249,8 @@ class Attribute(BaseObject): if isinstance(self.attributeDesc, desc.ChoiceParam) and not self.attributeDesc.exclusive: assert(isinstance(self.value, collections.Sequence) and not isinstance(self.value, basestring)) return self.attributeDesc.joinChar.join(self.value) + if isinstance(self.attributeDesc, (desc.StringParam, desc.File)): + return '"{}"'.format(self.value) return str(self.value) def isDefault(self): @@ -825,7 +827,7 @@ class Node(BaseObject): **cmdVars) attr._invalidationValue = attr.attributeDesc.value.format( **cmdVarsNoCache) - v = attr.value + v = attr.getValueStr() cmdVars[name] = '--{name} {value}'.format(name=name, value=v) cmdVars[name + 'Value'] = str(v) diff --git a/meshroom/nodes/aliceVision/CameraInit.py b/meshroom/nodes/aliceVision/CameraInit.py index e54a17bc..90d8da7a 100644 --- a/meshroom/nodes/aliceVision/CameraInit.py +++ b/meshroom/nodes/aliceVision/CameraInit.py @@ -179,7 +179,7 @@ class CameraInit(desc.CommandLineNode): def buildCommandLine(self, chunk): cmd = desc.CommandLineNode.buildCommandLine(self, chunk) if chunk.node.viewpointsFile: - cmd += ' --input ' + chunk.node.viewpointsFile + cmd += ' --input "{}"'.format(chunk.node.viewpointsFile) return cmd def processChunk(self, chunk): diff --git a/meshroom/submitters/simpleFarmSubmitter.py b/meshroom/submitters/simpleFarmSubmitter.py index 45bda497..3ff9b055 100644 --- a/meshroom/submitters/simpleFarmSubmitter.py +++ b/meshroom/submitters/simpleFarmSubmitter.py @@ -44,7 +44,7 @@ class SimpleFarmSubmitter(BaseSubmitter): task = simpleFarm.Task( name=node.nodeType, - command='meshroom_compute --node {nodeName} {meshroomFile} {parallelArgs} --extern'.format( + command='meshroom_compute --node {nodeName} "{meshroomFile}" {parallelArgs} --extern'.format( nodeName=node.name, meshroomFile=meshroomFile, parallelArgs=parallelArgs), tags=tags, rezPackages=[self.MESHROOM_PACKAGE],