From: kaliko Date: Wed, 9 Dec 2009 09:21:56 +0000 (+0000) Subject: * write properly end lines in playlist /o\ X-Git-Url: http://git.kaliko.me/?p=mpd-goodies.git;a=commitdiff_plain;h=3a2a74abe7f1e9916b12cd4f7f90ff6bfc12e890 * write properly end lines in playlist /o\ --- diff --git a/mtopls b/mtopls index d447889..e1d5dac 100755 --- a/mtopls +++ b/mtopls @@ -48,7 +48,6 @@ class MtoPls(object): self.cli = mconnect() self.current = self.cli.currentsong() self.cli.disconnect() - print self.current self._consume_sopt() self._create_playlist() self._controls_perm() @@ -91,6 +90,7 @@ class MtoPls(object): def _create_playlist(self): if not isfile(self.pls_path): + # TODO: add M3U header sys.stdout.write('Create new playlist: %s\n' % self.pls_path) open(self.pls_path, 'a').close() @@ -108,8 +108,10 @@ class MtoPls(object): def _run(self): """""" + # TODO: controls file is not already in playlist fd = open(self.pls_path, 'a') fd.write(self.current.get('file')) + fd.write('\n') fd.close() # Script starts here