diff options
author | Anton Khirnov <wyskas@gmail.com> | 2009-03-03 07:50:24 +0100 |
---|---|---|
committer | Anton Khirnov <wyskas@gmail.com> | 2009-03-03 07:50:24 +0100 |
commit | 9d4bac931e70ff4352039250f4682db4cfa917ea (patch) | |
tree | d48837eba3eeb0e6945074a0b333af228883594e /nephilim | |
parent | c9f59dde4620b4d02b18cf1fcfaded0d22f77b6e (diff) |
Remove local unicode hacks from mpd.
Diffstat (limited to 'nephilim')
-rw-r--r-- | nephilim/mpclient.py | 2 | ||||
-rw-r--r-- | nephilim/mpd.py | 9 |
2 files changed, 4 insertions, 7 deletions
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() |