summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorCalum Lind <calumlind+deluge@gmail.com>2012-11-06 21:27:02 +0000
committerCalum Lind <calumlind+deluge@gmail.com>2012-11-06 21:27:02 +0000
commitb67bae31bab50c7a5b9b9312500d8dff819e8fa1 (patch)
treece4fccc56b6e57747ea184343168c0c63007580d
parent5cb85472c66cae5271d41c60cdea53b039bc154a (diff)
downloaddeluge-b67bae31.tar.gz
deluge-b67bae31.tar.bz2
deluge-b67bae31.zip
Fix #2174 : Console: Unable to add torrent via URL
-rw-r--r--deluge/ui/console/main.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/deluge/ui/console/main.py b/deluge/ui/console/main.py
index 55a5c689d..ea7d43adf 100644
--- a/deluge/ui/console/main.py
+++ b/deluge/ui/console/main.py
@@ -40,6 +40,7 @@ import logging
import optparse
import re
import locale
+import shlex
from twisted.internet import defer, reactor
@@ -266,7 +267,7 @@ class BaseCommand(object):
def split(self, text):
if deluge.common.windows_check():
text = text.replace('\\', '\\\\')
- result = re.split(r"(?<!\\) ", text)
+ result = shlex.split(text)
for i, s in enumerate(result):
result[i] = s.replace(r'\ ', ' ')
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)
self.events.append(s)
else:
- print colors.strip_colors(s.encode(self.encoding)) \ No newline at end of file
+ print colors.strip_colors(s.encode(self.encoding))