Fix #2174 : Console: Unable to add torrent via URL
This commit is contained in:
parent
5cb85472c6
commit
b67bae31ba
|
@ -40,6 +40,7 @@ import logging
|
||||||
import optparse
|
import optparse
|
||||||
import re
|
import re
|
||||||
import locale
|
import locale
|
||||||
|
import shlex
|
||||||
|
|
||||||
from twisted.internet import defer, reactor
|
from twisted.internet import defer, reactor
|
||||||
|
|
||||||
|
@ -266,7 +267,7 @@ class BaseCommand(object):
|
||||||
def split(self, text):
|
def split(self, text):
|
||||||
if deluge.common.windows_check():
|
if deluge.common.windows_check():
|
||||||
text = text.replace('\\', '\\\\')
|
text = text.replace('\\', '\\\\')
|
||||||
result = re.split(r"(?<!\\) ", text)
|
result = shlex.split(text)
|
||||||
for i, s in enumerate(result):
|
for i, s in enumerate(result):
|
||||||
result[i] = s.replace(r'\ ', ' ')
|
result[i] = s.replace(r'\ ', ' ')
|
||||||
result = filter(lambda s: s != '', result)
|
result = filter(lambda s: s != '', result)
|
||||||
|
@ -475,4 +476,4 @@ Please use commands from the command line, eg:\n
|
||||||
component.get("LegacyUI").add_line(s, False)
|
component.get("LegacyUI").add_line(s, False)
|
||||||
self.events.append(s)
|
self.events.append(s)
|
||||||
else:
|
else:
|
||||||
print colors.strip_colors(s.encode(self.encoding))
|
print colors.strip_colors(s.encode(self.encoding))
|
||||||
|
|
Loading…
Reference in New Issue