From 98101ea4112f6845c24002098c109b77385f50e3 Mon Sep 17 00:00:00 2001 From: Nogare Date: Wed, 14 Mar 2012 23:40:13 -0400 Subject: [PATCH] Implement a call to os.sep in regards to auto completion Added small amount of code which calls os.sep so we know if we should append "/" or "\\" to the end of a dir. --- deluge/ui/console/commands/add.py | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/deluge/ui/console/commands/add.py b/deluge/ui/console/commands/add.py index 701566ce7..c349f1e59 100644 --- a/deluge/ui/console/commands/add.py +++ b/deluge/ui/console/commands/add.py @@ -113,7 +113,10 @@ class Command(BaseCommand): continue f = os.path.join(line, f) if os.path.isdir(f): - f += "/" + if os.sep == '\\': # Windows path support :| + f += "\\" + else: # \o/ Unix + f += "/" ret.append(f) else: # This is a file, but we could be looking for another file that @@ -131,7 +134,10 @@ class Command(BaseCommand): p = os.path.join(os.path.dirname(line), f) if os.path.isdir(p): - p += "/" + if os.sep == '\\': # Windows path support :| + p += "\\" + else: # \o/ Unix + p += "/" ret.append(p) for i in range(0, len(ret)): ret[i] = ret[i].replace(" ", r"\ ")