mirror of
https://github.com/alicevision/Meshroom.git
synced 2025-05-21 21:16:29 +02:00
[core] Add default relative paths to the command line variables
Add 2 default entries to the command line variables: - `nodeCacheFolder`, which contains the location of the cache folder - `nodeSourceCodeFolder`, which contains the location of the file describing the node
This commit is contained in:
parent
40fd46d476
commit
6cbb97d9a8
2 changed files with 15 additions and 4 deletions
|
@ -362,7 +362,14 @@ class Attribute(BaseObject):
|
|||
Return the value. If it is a string, expressions will be evaluated.
|
||||
'''
|
||||
if isinstance(self.value, str):
|
||||
return Template(self.value).safe_substitute(os.environ)
|
||||
substituted = Template(self.value).safe_substitute(os.environ)
|
||||
try:
|
||||
varResolved = substituted.format(**self.node._cmdVars)
|
||||
return varResolved
|
||||
except (KeyError, IndexError):
|
||||
# Catch KeyErrors and IndexErros to be able to open files created prior to the support of
|
||||
# relative variables (when self.node._cmdVars was not used to evaluate expressions in the attribute)
|
||||
return substituted
|
||||
return self.value
|
||||
|
||||
def getValueStr(self, withQuotes=True):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue