summaryrefslogtreecommitdiff
path: root/mpd.py
diff options
context:
space:
mode:
authorjerous <jerous@gmail.com>2008-10-15 21:19:29 +0200
committerjerous <jerous@gmail.com>2008-10-15 21:19:29 +0200
commitbd543fb9c6683f72019fca66463f033ecb7dff5f (patch)
treedbe5ec57af0f6291c90e43d56a052727d1a69fd9 /mpd.py
parent7e75e58fa770368fb84800a0127927498782e63d (diff)
better handling of UTF in mpd
showing progress when adding song to playlist
Diffstat (limited to 'mpd.py')
-rw-r--r--mpd.py9
1 files changed, 6 insertions, 3 deletions
diff --git a/mpd.py b/mpd.py
index 384f856..d7eea05 100644
--- a/mpd.py
+++ b/mpd.py
@@ -141,14 +141,17 @@ class MPDClient(object):
self._commandlist.append(retval)
def _writeline(self, line):
- self._wfile.write("%s\n" % line)
+ self._wfile.write(("%s\n" % line).encode('utf-8'))
self._wfile.flush()
def _writecommand(self, command, args=[]):
parts = [command]
for arg in args:
- parts.append('"%s"' % escape(str(arg)))
- self._writeline(" ".join(parts))
+ if type(arg)==int:
+ parts.append('"%i"' % arg)
+ else:
+ parts.append(u'"%s"' % escape(arg))
+ self._writeline(u" ".join(parts))
def _readline(self):
line = self._rfile.readline()