mirror of
https://git.deluge-torrent.org/deluge
synced 2025-08-02 22:48:40 +00:00
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:
parent
a24c679510
commit
8819ec0575
1 changed files with 3 additions and 1 deletions
|
@ -99,6 +99,7 @@ class Command(BaseCommand):
|
||||||
return defer.DeferredList(deferreds)
|
return defer.DeferredList(deferreds)
|
||||||
|
|
||||||
def complete(self, line):
|
def complete(self, line):
|
||||||
|
line = line.replace("\ ", " ")
|
||||||
line = os.path.abspath(os.path.expanduser(line))
|
line = os.path.abspath(os.path.expanduser(line))
|
||||||
ret = []
|
ret = []
|
||||||
if os.path.exists(line):
|
if os.path.exists(line):
|
||||||
|
@ -132,5 +133,6 @@ class Command(BaseCommand):
|
||||||
if os.path.isdir(p):
|
if os.path.isdir(p):
|
||||||
p += "/"
|
p += "/"
|
||||||
ret.append(p)
|
ret.append(p)
|
||||||
|
for i in range(0, len(ret)):
|
||||||
|
ret[i] = ret[i].replace(" ", r"\ ")
|
||||||
return ret
|
return ret
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue