From 84ea536064c01928ce33c413e0d92d2ab2e82237 Mon Sep 17 00:00:00 2001 From: Aaron LI Date: Tue, 15 Nov 2016 10:11:05 +0800 Subject: configs/manager.py: Expand "~" when read userconfig --- fg21sim/configs/manager.py | 3 +++ 1 file changed, 3 insertions(+) (limited to 'fg21sim/configs') diff --git a/fg21sim/configs/manager.py b/fg21sim/configs/manager.py index 4997437..70c32b5 100644 --- a/fg21sim/configs/manager.py +++ b/fg21sim/configs/manager.py @@ -197,6 +197,8 @@ class ConfigManager: ---------- userconfig : str Filename/path to the user configuration file. + Generally, an absolute path should be provided. + The prefix ``~`` (tilde) is also allowed and will be expanded. NOTE ---- @@ -204,6 +206,7 @@ class ConfigManager: configurations are *reset* before loading the supplied user configuration file. """ + userconfig = os.path.expanduser(userconfig) try: config = open(userconfig).read().split("\n") except IOError: -- cgit v1.2.2