mpd: Remove newline escaping code.
This was added for #881, where the correct fix turned out to be to remove comments from the responses. We should still add some sanity checks for verifying that our responses at the very least only contain printable chars.
This commit is contained in:
parent
08a8d5c43b
commit
541412dbfc
@ -196,17 +196,12 @@ class MpdDispatcher(object):
|
||||
|
||||
def _format_lines(self, line):
|
||||
if isinstance(line, dict):
|
||||
return [self._escape_newlines('%s: %s' % (key, value))
|
||||
for (key, value)
|
||||
in line.items()]
|
||||
return ['%s: %s' % (key, value) for (key, value) in line.items()]
|
||||
if isinstance(line, tuple):
|
||||
(key, value) = line
|
||||
return [self._escape_newlines('%s: %s' % (key, value))]
|
||||
return ['%s: %s' % (key, value)]
|
||||
return [line]
|
||||
|
||||
def _escape_newlines(self, text):
|
||||
return text.replace('\n', '\\n')
|
||||
|
||||
|
||||
class MpdContext(object):
|
||||
"""
|
||||
|
||||
Loading…
Reference in New Issue
Block a user