From 01cd597321ee0f8554c9c96d8de93773385b4f8a Mon Sep 17 00:00:00 2001 From: Stein Magnus Jodal Date: Mon, 2 Aug 2010 23:02:03 +0200 Subject: [PATCH 1/7] MPD: Use CPID in 'delete' --- mopidy/mpd/frontend.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/mopidy/mpd/frontend.py b/mopidy/mpd/frontend.py index b8c4d098..8804f1b7 100644 --- a/mopidy/mpd/frontend.py +++ b/mopidy/mpd/frontend.py @@ -290,19 +290,19 @@ class MpdFrontend(object): end = int(end) else: end = len(self.backend.current_playlist.tracks) - tracks = self.backend.current_playlist.tracks[start:end] - if not tracks: + cp_tracks = self.backend.current_playlist.cp_tracks[start:end] + if not cp_tracks: raise MpdArgError(u'Bad song index', command=u'delete') - for track in tracks: - self.backend.current_playlist.remove(id=track.id) + for (cpid, track) in cp_tracks: + self.backend.current_playlist.remove(cpid=cpid) @handle_pattern(r'^delete "(?P\d+)"$') def _current_playlist_delete_songpos(self, songpos): """See :meth:`_current_playlist_delete_range`""" try: songpos = int(songpos) - track = self.backend.current_playlist.tracks[songpos] - self.backend.current_playlist.remove(id=track.id) + (cpid, track) = self.backend.current_playlist.cp_tracks[songpos] + self.backend.current_playlist.remove(cpid=cpid) except IndexError: raise MpdArgError(u'Bad song index', command=u'delete') From 999de87d0737ed200051c198d14183c22530b33d Mon Sep 17 00:00:00 2001 From: Stein Magnus Jodal Date: Mon, 2 Aug 2010 23:02:51 +0200 Subject: [PATCH 2/7] MPD: Use CPID in 'plchangesposid' output --- mopidy/mpd/frontend.py | 6 +++--- tests/mpd/current_playlist_test.py | 12 +++++++----- 2 files changed, 10 insertions(+), 8 deletions(-) diff --git a/mopidy/mpd/frontend.py b/mopidy/mpd/frontend.py index 8804f1b7..259271f3 100644 --- a/mopidy/mpd/frontend.py +++ b/mopidy/mpd/frontend.py @@ -518,10 +518,10 @@ class MpdFrontend(object): # XXX Naive implementation that returns all tracks as changed if int(version) != self.backend.current_playlist.version: result = [] - for position, track in enumerate( - self.backend.current_playlist.tracks): + for (position, (cpid, track)) in enumerate( + self.backend.current_playlist.cp_tracks): result.append((u'cpos', position)) - result.append((u'Id', track.id)) + result.append((u'Id', cpid)) return result @handle_pattern(r'^shuffle$') diff --git a/tests/mpd/current_playlist_test.py b/tests/mpd/current_playlist_test.py index 5a7b6ca4..4372ed19 100644 --- a/tests/mpd/current_playlist_test.py +++ b/tests/mpd/current_playlist_test.py @@ -317,15 +317,17 @@ class CurrentPlaylistHandlerTest(unittest.TestCase): self.assert_(u'OK' in result) def test_plchangesposid(self): - self.b.current_playlist.load( - [Track(id=11), Track(id=12), Track(id=13)]) + self.b.current_playlist.load([Track(), Track(), Track()]) result = self.h.handle_request(u'plchangesposid "0"') self.assert_(u'cpos: 0' in result) - self.assert_(u'Id: 11' in result) + self.assert_(u'Id: %d' % self.b.current_playlist.cp_tracks[0][0] + in result) self.assert_(u'cpos: 2' in result) - self.assert_(u'Id: 12' in result) + self.assert_(u'Id: %d' % self.b.current_playlist.cp_tracks[1][0] + in result) self.assert_(u'cpos: 2' in result) - self.assert_(u'Id: 13' in result) + self.assert_(u'Id: %d' % self.b.current_playlist.cp_tracks[2][0] + in result) self.assert_(u'OK' in result) def test_shuffle_without_range(self): From c83ac35758a413a0a6355edcd6671e69a04e6f4d Mon Sep 17 00:00:00 2001 From: Stein Magnus Jodal Date: Tue, 3 Aug 2010 09:07:33 +0200 Subject: [PATCH 3/7] MPD: Add more docs and tests to 'playlistsearch' --- mopidy/mpd/frontend.py | 6 ++++++ tests/mpd/current_playlist_test.py | 6 +++++- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/mopidy/mpd/frontend.py b/mopidy/mpd/frontend.py index 259271f3..bddeef8a 100644 --- a/mopidy/mpd/frontend.py +++ b/mopidy/mpd/frontend.py @@ -474,6 +474,7 @@ class MpdFrontend(object): return self.backend.current_playlist.mpd_format(start, end) @handle_pattern(r'^playlistsearch "(?P[^"]+)" "(?P[^"]+)"$') + @handle_pattern(r'^playlistsearch (?P\S+) "(?P[^"]+)"$') def _current_playlist_playlistsearch(self, tag, needle): """ *musicpd.org, current playlist section:* @@ -482,6 +483,11 @@ class MpdFrontend(object): Searches case-sensitively for partial matches in the current playlist. + + *GMPC:* + + - does not add quotes around the tag + - uses ``filename`` and ``any`` as tags """ raise MpdNotImplemented # TODO diff --git a/tests/mpd/current_playlist_test.py b/tests/mpd/current_playlist_test.py index 4372ed19..e8dd9748 100644 --- a/tests/mpd/current_playlist_test.py +++ b/tests/mpd/current_playlist_test.py @@ -304,7 +304,11 @@ class CurrentPlaylistHandlerTest(unittest.TestCase): self.assert_(u'OK' in result) def test_playlistsearch(self): - result = self.h.handle_request(u'playlistsearch "tag" "needle"') + result = self.h.handle_request(u'playlistsearch "any" "needle"') + self.assert_(u'ACK [0@0] {} Not implemented' in result) + + def test_playlistsearch_without_quotes(self): + result = self.h.handle_request(u'playlistsearch any "needle"') self.assert_(u'ACK [0@0] {} Not implemented' in result) def test_plchanges(self): From 243cff0f6cdb29906fcd0a476361e1ae88427d4e Mon Sep 17 00:00:00 2001 From: Stein Magnus Jodal Date: Tue, 3 Aug 2010 14:45:46 +0200 Subject: [PATCH 4/7] Release v0.1.0a3 --- docs/changes.rst | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/docs/changes.rst b/docs/changes.rst index 2cb979c5..4a8dc2d1 100644 --- a/docs/changes.rst +++ b/docs/changes.rst @@ -4,10 +4,18 @@ Changes This change log is used to track all major changes to Mopidy. -0.1.0a3 (unreleased) + +0.1.0a3 (2010-08-03) ==================== -We got an updated :doc:`release roadmap `! +In the last two months, Mopidy's MPD frontend has gotten lots of stability +fixes and error handling improvements, proper support for having the same track +multiple times in a playlist, and support for IPv6. We have also fixed the +choppy playback on the libspotify backend. For the road ahead of us, we got an +updated :doc:`release roadmap ` with our goals for the 0.1 +to 0.3 releases. + +Enjoy the best alpha relase of Mopidy ever :-) **Changes** From 1cfddf3d90f296854ef8b5b43ac094aff10cd947 Mon Sep 17 00:00:00 2001 From: Stein Magnus Jodal Date: Tue, 3 Aug 2010 14:55:08 +0200 Subject: [PATCH 5/7] Ready for v0.1.0a4 development --- docs/changes.rst | 10 ++++++++++ mopidy/__init__.py | 2 +- tests/version_test.py | 3 ++- 3 files changed, 13 insertions(+), 2 deletions(-) diff --git a/docs/changes.rst b/docs/changes.rst index 4a8dc2d1..df969f27 100644 --- a/docs/changes.rst +++ b/docs/changes.rst @@ -5,6 +5,16 @@ Changes This change log is used to track all major changes to Mopidy. +0.1.0a4 (in development) +======================== + +Another great release. + +**Changes** + +- None yet. + + 0.1.0a3 (2010-08-03) ==================== diff --git a/mopidy/__init__.py b/mopidy/__init__.py index 707e8f03..b19b5e00 100644 --- a/mopidy/__init__.py +++ b/mopidy/__init__.py @@ -1,7 +1,7 @@ from mopidy import settings as raw_settings def get_version(): - return u'0.1.0a3' + return u'0.1.0a4' def get_mpd_protocol_version(): return u'0.16.0' diff --git a/tests/version_test.py b/tests/version_test.py index 5831d119..6ab3ee2f 100644 --- a/tests/version_test.py +++ b/tests/version_test.py @@ -10,7 +10,8 @@ class VersionTest(unittest.TestCase): def test_versions_can_be_strictly_ordered(self): self.assert_(SV('0.1.0a0') < SV('0.1.0a1')) self.assert_(SV('0.1.0a2') < SV(get_version())) - self.assert_(SV(get_version()) < SV('0.1.0a4')) + self.assert_(SV('0.1.0a3') < SV(get_version())) + self.assert_(SV(get_version()) < SV('0.1.0a5')) self.assert_(SV('0.1.0a0') < SV('0.1.0')) self.assert_(SV('0.1.0') < SV('0.1.1')) self.assert_(SV('0.1.1') < SV('0.2.0')) From 9ff3175b4469c6423ea75532ed2a625cb3a54020 Mon Sep 17 00:00:00 2001 From: Stein Magnus Jodal Date: Tue, 3 Aug 2010 15:13:37 +0200 Subject: [PATCH 6/7] Exit early if not Python >= 2.6, < 3 --- docs/changes.rst | 2 +- mopidy/__init__.py | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/docs/changes.rst b/docs/changes.rst index df969f27..11d98905 100644 --- a/docs/changes.rst +++ b/docs/changes.rst @@ -12,7 +12,7 @@ Another great release. **Changes** -- None yet. +- Exit early if not Python >= 2.6, < 3. 0.1.0a3 (2010-08-03) diff --git a/mopidy/__init__.py b/mopidy/__init__.py index b19b5e00..13ce67c8 100644 --- a/mopidy/__init__.py +++ b/mopidy/__init__.py @@ -1,3 +1,7 @@ +import sys +if not (2, 6) <= sys.version_info < (3,): + sys.exit(u'Mopidy requires Python >= 2.6, < 3') + from mopidy import settings as raw_settings def get_version(): From aac9cf13594bb5fd7797c3f323ce645d6e5606ef Mon Sep 17 00:00:00 2001 From: Stein Magnus Jodal Date: Wed, 4 Aug 2010 13:00:20 +0200 Subject: [PATCH 7/7] Include Sphinx scripts, pylintrc, tests and test data in PyPI packages --- MANIFEST.in | 9 +++++---- docs/changes.rst | 2 ++ 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/MANIFEST.in b/MANIFEST.in index 6235b2c8..cb752f87 100644 --- a/MANIFEST.in +++ b/MANIFEST.in @@ -1,4 +1,5 @@ -include COPYING -include *.rst -include requirements*.txt -recursive-include docs *.rst +include COPYING pylintrc *.rst *.txt +recursive-include docs * +prune docs/_build +recursive-include tests *.py +recursive-include tests/data * diff --git a/docs/changes.rst b/docs/changes.rst index 11d98905..b9981c53 100644 --- a/docs/changes.rst +++ b/docs/changes.rst @@ -13,6 +13,8 @@ Another great release. **Changes** - Exit early if not Python >= 2.6, < 3. +- Include Sphinx scripts for building docs, pylintrc, tests and test data in + the packages created by ``setup.py`` for i.e. PyPI. 0.1.0a3 (2010-08-03)