From d15ee60ca7ad62004c5e036203f095cc27660f90 Mon Sep 17 00:00:00 2001 From: Simeon Simeonov Date: Sun, 10 Apr 2022 22:21:41 +0200 Subject: Introduce a new macro (%p) representing the parent value of a given key --- src/etoolkit/etoolkit.py | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'src') 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: if not value: # perhaps unset instead of skipping? continue + if isinstance(value, str) and '%p' in value: + macros['%p'] = ( + self._parent.get_environ().get(key, '') + if self._parent is not None + else '' + ) if isinstance(value, str) and value.startswith('enc-val$1$'): value = self._decrypt_value(value) if isinstance(value, str) and value.endswith(':'): -- cgit v1.3