[#3075|Console] Fix config handling windows paths
The console config token parser was unable to handle windows paths starting with 'C:\'. Remove unneeded windows_checks.
This commit is contained in:
parent
507c5df984
commit
9bcda41700
|
@ -16,7 +16,6 @@ import shlex
|
||||||
|
|
||||||
from twisted.internet import defer
|
from twisted.internet import defer
|
||||||
|
|
||||||
from deluge.common import windows_check
|
|
||||||
from deluge.ui.client import client
|
from deluge.ui.client import client
|
||||||
from deluge.ui.console.parser import OptionParser, OptionParserError
|
from deluge.ui.console.parser import OptionParser, OptionParserError
|
||||||
from deluge.ui.console.utils.colors import strip_colors
|
from deluge.ui.console.utils.colors import strip_colors
|
||||||
|
@ -167,7 +166,6 @@ class BaseCommand(object):
|
||||||
return self.__doc__
|
return self.__doc__
|
||||||
|
|
||||||
def split(self, text):
|
def split(self, text):
|
||||||
if windows_check():
|
|
||||||
text = text.replace('\\', '\\\\')
|
text = text.replace('\\', '\\\\')
|
||||||
result = shlex.split(text)
|
result = shlex.split(text)
|
||||||
for i, s in enumerate(result):
|
for i, s in enumerate(result):
|
||||||
|
|
|
@ -55,6 +55,10 @@ def atom(src, token):
|
||||||
return False
|
return False
|
||||||
elif token[0] is tokenize.STRING or token[1] == '/':
|
elif token[0] is tokenize.STRING or token[1] == '/':
|
||||||
return token[-1].decode('string-escape')
|
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])
|
raise SyntaxError('malformed expression (%s)' % token[1])
|
||||||
|
|
||||||
|
|
|
@ -562,7 +562,7 @@ class EventLog(component.Component):
|
||||||
(state, t_name, torrent_id))
|
(state, t_name, torrent_id))
|
||||||
|
|
||||||
def on_torrent_finished_event(self, 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
|
import curses.beep
|
||||||
curses.beep()
|
curses.beep()
|
||||||
self.write('{!info!}Torrent Finished: %s ({!cyan!}%s{!info!})' %
|
self.write('{!info!}Torrent Finished: %s ({!cyan!}%s{!info!})' %
|
||||||
|
|
Loading…
Reference in New Issue