comparison configmix/config.py @ 637:4499e9b4855d

The ``{{::DEL::}}`` is not subject to interpolation any more. This fixes the handling of these deletion markers when merging configurations: sometimes they were tried to be interpolated -- and this failed.
author Franz Glasner <f.glasner@feldmann-mg.com>
date Fri, 04 Mar 2022 17:35:27 +0100
parents 764d4185c76a
children d35f41e15404
comparison
equal deleted inserted replaced
636:301cf2337fde 637:4499e9b4855d
27 except ImportError: 27 except ImportError:
28 from urlparse import urlsplit 28 from urlparse import urlsplit
29 29
30 from .variables import lookup_varns, lookup_filter 30 from .variables import lookup_varns, lookup_filter
31 from .compat import u, uchr, n, str_and_u, PY2 31 from .compat import u, uchr, n, str_and_u, PY2
32 from .constants import REF_NAMESPACE, NONE_FILTER, EMPTY_FILTER 32 from .constants import REF_NAMESPACE, NONE_FILTER, EMPTY_FILTER, DEL_VALUE
33 try: 33 try:
34 from ._speedups import (fast_unquote, fast_quote, fast_pathstr2path, 34 from ._speedups import (fast_unquote, fast_quote, fast_pathstr2path,
35 _fast_split_ns, _fast_split_filters, 35 _fast_split_ns, _fast_split_filters,
36 _fast_getvarl, _fast_getvarl_s, 36 _fast_getvarl, _fast_getvarl_s,
37 _fast_getvar, _fast_getvar_s, 37 _fast_getvar, _fast_getvar_s,
928 928
929 def py_interpolate_variables(self, s): 929 def py_interpolate_variables(self, s):
930 """Expand all variables in the single string `s`""" 930 """Expand all variables in the single string `s`"""
931 len_s = len(s) 931 len_s = len(s)
932 if len_s < 4: 932 if len_s < 4:
933 return s
934 if s == DEL_VALUE:
933 return s 935 return s
934 start = s.find(_STARTTOK, 0) 936 start = s.find(_STARTTOK, 0)
935 if start < 0: 937 if start < 0:
936 return s 938 return s
937 res = self.__interpolation_cache.get(s, _MARKER) 939 res = self.__interpolation_cache.get(s, _MARKER)