commit 8f30e18d8aabfd25239aff9cc4dd03a1488798ec Author: juga0 juga@riseup.net Date: Tue Jul 24 17:09:19 2018 +0000
Add _expand_paths function as suggested by pastly --- sbws/util/config.py | 7 +++++++ 1 file changed, 7 insertions(+)
diff --git a/sbws/util/config.py b/sbws/util/config.py index ee7bde7..325b713 100644 --- a/sbws/util/config.py +++ b/sbws/util/config.py @@ -25,6 +25,13 @@ _LOG_LEVELS = ['debug', 'info', 'warning', 'error', 'critical'] log = logging.getLogger(__name__)
+def _expand_path(path): + """Expand path string containing shell variables and ~ constructions + into their values. + """ + return os.path.expanduser(os.path.expandvars(path)) + + def _create_user_config_file(fname): """Copy minimal user config to user config path.""" if not os.path.isfile(fname):