Mercurial > hgrepos > Python > libs > ConfigMix
diff configmix/variables.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 | d2751a80d9b7 |
line wrap: on
line diff
--- a/configmix/variables.py Thu Jun 24 20:52:21 2021 +0200 +++ b/configmix/variables.py Thu Jun 24 21:20:37 2021 +0200 @@ -17,8 +17,8 @@ import platform from functools import wraps -from .compat import PY2, native_os_str_to_text, u -from .constants import REF_NAMESPACE +from .compat import PY2, native_os_str_to_text, text_to_native_os_str, u +from .constants import REF_NAMESPACE, NONE_FILTER, EMPTY_FILTER _MARKER = object() @@ -244,7 +244,7 @@ return v.upper() -@filter("None") +@filter(text_to_native_os_str(NONE_FILTER, encoding="ascii")) def None_filter_impl(config, v): """Identity. @@ -255,7 +255,7 @@ return v -@filter("Empty") +@filter(text_to_native_os_str(EMPTY_FILTER, encoding="ascii")) def Empty_filter_impl(config, v): """Identity.
