diff --git a/deluge/ui/console/cmdline/command.py b/deluge/ui/console/cmdline/command.py index a59b90e69..262182bfe 100644 --- a/deluge/ui/console/cmdline/command.py +++ b/deluge/ui/console/cmdline/command.py @@ -16,7 +16,6 @@ import shlex from twisted.internet import defer -from deluge.common import windows_check from deluge.ui.client import client from deluge.ui.console.parser import OptionParser, OptionParserError from deluge.ui.console.utils.colors import strip_colors @@ -167,8 +166,7 @@ class BaseCommand(object): return self.__doc__ def split(self, text): - if windows_check(): - text = text.replace('\\', '\\\\') + text = text.replace('\\', '\\\\') result = shlex.split(text) for i, s in enumerate(result): result[i] = s.replace(r'\ ', ' ') diff --git a/deluge/ui/console/cmdline/commands/config.py b/deluge/ui/console/cmdline/commands/config.py index dae25ee4f..d9132d739 100644 --- a/deluge/ui/console/cmdline/commands/config.py +++ b/deluge/ui/console/cmdline/commands/config.py @@ -55,6 +55,10 @@ def atom(src, token): return False elif token[0] is tokenize.STRING or token[1] == '/': return token[-1].decode('string-escape') + elif token[1].isalpha(): + # Parse Windows paths e.g. 'C:\\xyz' or 'C:/xyz'. + if next()[1] == ':' and next()[1] in '\/': + return token[-1].decode('string-escape') raise SyntaxError('malformed expression (%s)' % token[1]) diff --git a/deluge/ui/console/main.py b/deluge/ui/console/main.py index 35d83e831..0435a805a 100644 --- a/deluge/ui/console/main.py +++ b/deluge/ui/console/main.py @@ -562,7 +562,7 @@ class EventLog(component.Component): (state, t_name, torrent_id)) def on_torrent_finished_event(self, torrent_id): - if not deluge.common.windows_check() and component.get('TorrentList').config['ring_bell']: + if component.get('TorrentList').config['ring_bell']: import curses.beep curses.beep() self.write('{!info!}Torrent Finished: %s ({!cyan!}%s{!info!})' %