From c3193f3c7085d45c9762e0cac37bdeb7bc3e9cd1 Mon Sep 17 00:00:00 2001 From: Andrew Resch Date: Sat, 3 Oct 2009 22:53:21 +0000 Subject: [PATCH] Add support for forward slashes in config setting --- deluge/ui/console/commands/config.py | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/deluge/ui/console/commands/config.py b/deluge/ui/console/commands/config.py index 69151c8f4..04f8f7e22 100644 --- a/deluge/ui/console/commands/config.py +++ b/deluge/ui/console/commands/config.py @@ -60,6 +60,21 @@ def atom(next, token): return tuple(out) elif token[0] is tokenize.STRING: return token[1][1:-1].decode("string-escape") + elif token[1] == "/": + count = token[-1].count("/") + # Check for a trailing / since it messes things up + trail = False + if token[-1][-1] == "/": + count -= 1 + trail = True + for i in xrange(count * 2 - 1): + token = next() + # Check for trailing / and remove it + path = token[-1].decode("string-escape") + if trail: + path = path[0:-1] + token = next() + return path elif token[0] is tokenize.NUMBER: try: return int(token[1], 0)