summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorSimeon Simeonov2022-04-10 22:21:41 +0200
committerSimeon Simeonov2022-04-10 22:21:41 +0200
commitd15ee60ca7ad62004c5e036203f095cc27660f90 (patch)
tree0fc478fe2cab5cd670137ad4d4dbd75fd4b68b36 /src
parente36f260c2ebc5e21724e5eedf0a91d2bc66cceec (diff)
Introduce a new macro (%p) representing the parent value of a given key
Diffstat (limited to 'src')
-rwxr-xr-xsrc/etoolkit/etoolkit.py6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/etoolkit/etoolkit.py b/src/etoolkit/etoolkit.py
index d8221a5..9b95a73 100755
--- a/src/etoolkit/etoolkit.py
+++ b/src/etoolkit/etoolkit.py
@@ -342,6 +342,12 @@ class EtoolkitInstance:
342 if not value: 342 if not value:
343 # perhaps unset instead of skipping? 343 # perhaps unset instead of skipping?
344 continue 344 continue
345 if isinstance(value, str) and '%p' in value:
346 macros['%p'] = (
347 self._parent.get_environ().get(key, '')
348 if self._parent is not None
349 else ''
350 )
345 if isinstance(value, str) and value.startswith('enc-val$1$'): 351 if isinstance(value, str) and value.startswith('enc-val$1$'):
346 value = self._decrypt_value(value) 352 value = self._decrypt_value(value)
347 if isinstance(value, str) and value.endswith(':'): 353 if isinstance(value, str) and value.endswith(':'):