Escape spaces in paths in legacy mode 'add' command. This also makes backslashes unsupported(but you're a bad person for having them in paths anyway)

This commit is contained in:
Asmageddon 2012-03-12 20:27:59 +01:00
parent a24c679510
commit 8819ec0575

View File

@ -99,6 +99,7 @@ class Command(BaseCommand):
return defer.DeferredList(deferreds)
def complete(self, line):
line = line.replace("\ ", " ")
line = os.path.abspath(os.path.expanduser(line))
ret = []
if os.path.exists(line):
@ -132,5 +133,6 @@ class Command(BaseCommand):
if os.path.isdir(p):
p += "/"
ret.append(p)
for i in range(0, len(ret)):
ret[i] = ret[i].replace(" ", r"\ ")
return ret