Mercurial > hgrepos > Python > libs > ConfigMix
changeset 33:3ee21f868440
Implement a "posixpath" filter to convert file path strings to use forward slashes.
Needed for Mako configuration.
| author | Franz Glasner <f.glasner@feldmann-mg.com> |
|---|---|
| date | Mon, 21 Mar 2016 13:49:05 +0100 |
| parents | 6faddf796623 |
| children | 4ebce3b7deae |
| files | configmix/variables.py |
| diffstat | 1 files changed, 6 insertions(+), 1 deletions(-) [+] |
line wrap: on
line diff
--- a/configmix/variables.py Fri Mar 18 09:28:44 2016 +0100 +++ b/configmix/variables.py Mon Mar 21 13:49:05 2016 +0100 @@ -8,7 +8,7 @@ import os from functools import wraps -from .compat import PY2, text_to_native_os_str, native_os_str_to_text +from .compat import PY2, text_to_native_os_str, native_os_str_to_text, u __all__ = [] @@ -114,3 +114,8 @@ @filter("abspath") def abspath_impl(config, v): return os.path.abspath(v) + + +@filter("posixpath") +def posixpath_impl(config, v): + return v.replace(u('\\'), u('/'))
