aboutsummaryrefslogtreecommitdiffstats
path: root/fg21sim
diff options
context:
space:
mode:
authorAaron LI <aaronly.me@outlook.com>2016-11-15 10:11:05 +0800
committerAaron LI <aaronly.me@outlook.com>2016-11-15 10:11:05 +0800
commit84ea536064c01928ce33c413e0d92d2ab2e82237 (patch)
tree26504ad9315fd59ae057f692405359be20ab8e93 /fg21sim
parentf0c5b31f7ae844922a056dcea40562144046496d (diff)
downloadfg21sim-84ea536064c01928ce33c413e0d92d2ab2e82237.tar.bz2
configs/manager.py: Expand "~" when read userconfig
Diffstat (limited to 'fg21sim')
-rw-r--r--fg21sim/configs/manager.py3
1 files changed, 3 insertions, 0 deletions
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: