aboutsummaryrefslogtreecommitdiffstats
path: root/fg21sim/webui/websocket.py
diff options
context:
space:
mode:
authorAaron LI <aaronly.me@outlook.com>2016-11-15 10:13:11 +0800
committerAaron LI <aaronly.me@outlook.com>2016-11-15 10:13:11 +0800
commit0ec84f939da1d2da883a4265f4fc92395c00281d (patch)
tree0a89b5e1ebcc8a983734cb99a12f9ce53ec18692 /fg21sim/webui/websocket.py
parent84ea536064c01928ce33c413e0d92d2ab2e82237 (diff)
downloadfg21sim-0ec84f939da1d2da883a4265f4fc92395c00281d.tar.bz2
webui: websocket.py: Accept "~" for the "userconfig"
Diffstat (limited to 'fg21sim/webui/websocket.py')
-rw-r--r--fg21sim/webui/websocket.py4
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