From 9d4bac931e70ff4352039250f4682db4cfa917ea Mon Sep 17 00:00:00 2001 From: Anton Khirnov Date: Tue, 3 Mar 2009 07:50:24 +0100 Subject: Remove local unicode hacks from mpd. --- nephilim/mpclient.py | 2 +- nephilim/mpd.py | 9 +++------ 2 files changed, 4 insertions(+), 7 deletions(-) (limited to 'nephilim') diff --git a/nephilim/mpclient.py b/nephilim/mpclient.py index 26b4d13..ceaaeab 100644 --- a/nephilim/mpclient.py +++ b/nephilim/mpclient.py @@ -233,7 +233,7 @@ class MPClient(QtCore.QObject): try: self._client.command_list_ok_begin() for path in paths: - self._client.addid(unicode(path)) + self._client.addid(path.encode('utf-8')) ret = self._client.command_list_end() self._updatePlaylist() if self._curState == 'stop': diff --git a/nephilim/mpd.py b/nephilim/mpd.py index 2d14bb6..30aba98 100644 --- a/nephilim/mpd.py +++ b/nephilim/mpd.py @@ -141,17 +141,14 @@ class MPDClient(object): self._commandlist.append(retval) def _writeline(self, line): - self._wfile.write(("%s\n" % line).encode('utf-8')) + self._wfile.write("%s\n" % line) self._wfile.flush() def _writecommand(self, command, args=[]): parts = [command] for arg in args: - if type(arg)==int: - parts.append('"%i"' % arg) - else: - parts.append(u'"%s"' % escape(arg)) - self._writeline(u" ".join(parts)) + parts.append('"%s"' % escape(str(arg))) + self._writeline(" ".join(parts)) def _readline(self): line = self._rfile.readline() -- cgit v1.2.3