From b5e5664cbc6df8e1983cfe30c8e817acaa68179a Mon Sep 17 00:00:00 2001 From: Dominik Roth Date: Sun, 9 Jul 2023 16:31:35 +0200 Subject: [PATCH] more bugfixes --- slate/slate.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/slate/slate.py b/slate/slate.py index d1bc53c..21a983c 100644 --- a/slate/slate.py +++ b/slate/slate.py @@ -106,7 +106,7 @@ class Slate(): def deep_expand_vars(self, dict, **kwargs): self.apply_nested(dict, lambda x: self.expand_vars(x, **kwargs)) - def consume(self, conf, key, default=None, **kwargs): + def consume(self, conf, key, default=None, expand=False, **kwargs): keys_arr = key.split('.') if len(keys_arr) == 1: k = keys_arr[0] @@ -117,7 +117,9 @@ class Slate(): if k in conf: del conf[k] - if type(val) == str: + if expand: + self.deep_expand_vars(val, config=self._config, **kwargs) + elif type(val) == str: while val.find('{') != -1: val = self.expand_vars(val, config=self._config, **kwargs)