Mercurial > hgrepos > Python > libs > ConfigMix
diff configmix/config.py @ 357:dd454e1efea4
Use constants for the names of the "None" and "Empty" filters
| author | Franz Glasner <fzglas.hg@dom66.de> |
|---|---|
| date | Thu, 24 Jun 2021 21:20:37 +0200 |
| parents | 2b209bdf6995 |
| children | 1941f0188e81 |
line wrap: on
line diff
--- a/configmix/config.py Thu Jun 24 20:52:21 2021 +0200 +++ b/configmix/config.py Thu Jun 24 21:20:37 2021 +0200 @@ -29,7 +29,7 @@ from .variables import lookup_varns, lookup_filter from .compat import u, uchr -from .constants import REF_NAMESPACE +from .constants import REF_NAMESPACE, NONE_FILTER, EMPTY_FILTER _MARKER = object() @@ -345,10 +345,10 @@ return s varname, filters = self._split_filters(s[start+2:end]) try: - if "None" in filters: + if NONE_FILTER in filters: varvalue = self._apply_filters( filters, self.getvar_s(varname, default=None)) - elif "Empty" in filters: + elif EMPTY_FILTER in filters: varvalue = self._apply_filters( filters, self.getvar_s(varname, default=u(""))) else:
