diff options
author | Aaron LI <aaronly.me@outlook.com> | 2016-11-15 10:13:11 +0800 |
---|---|---|
committer | Aaron LI <aaronly.me@outlook.com> | 2016-11-15 10:13:11 +0800 |
commit | 0ec84f939da1d2da883a4265f4fc92395c00281d (patch) | |
tree | 0a89b5e1ebcc8a983734cb99a12f9ce53ec18692 /fg21sim | |
parent | 84ea536064c01928ce33c413e0d92d2ab2e82237 (diff) | |
download | fg21sim-0ec84f939da1d2da883a4265f4fc92395c00281d.tar.bz2 |
webui: websocket.py: Accept "~" for the "userconfig"
Diffstat (limited to 'fg21sim')
-rw-r--r-- | fg21sim/webui/websocket.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/fg21sim/webui/websocket.py b/fg21sim/webui/websocket.py index dffd864..0e7f07f 100644 --- a/fg21sim/webui/websocket.py +++ b/fg21sim/webui/websocket.py @@ -352,7 +352,7 @@ class FG21simWSHandler(tornado.websocket.WebSocketHandler): # Ignore "workdir" and "configfile" continue elif key == "userconfig": - if os.path.isabs(value): + if os.path.isabs(os.path.expanduser(value)): self.configs.userconfig = value else: errors[key] = "Not an absolute path" @@ -390,7 +390,7 @@ class FG21simWSHandler(tornado.websocket.WebSocketHandler): """ success = False error = None - if os.path.isabs(userconfig): + if os.path.isabs(os.path.expanduser(userconfig)): try: self.configs.read_userconfig(userconfig) success = True |