From 0ec84f939da1d2da883a4265f4fc92395c00281d Mon Sep 17 00:00:00 2001 From: Aaron LI Date: Tue, 15 Nov 2016 10:13:11 +0800 Subject: webui: websocket.py: Accept "~" for the "userconfig" --- fg21sim/webui/websocket.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'fg21sim') 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 -- cgit v1.2.2