From 8ddff80ce382be4a5cb6566d08141de1b83bdffc Mon Sep 17 00:00:00 2001 From: Stein Magnus Jodal Date: Sun, 14 Mar 2010 00:23:26 +0100 Subject: [PATCH] docs: Add docs on all available backends --- docs/api/backends.rst | 37 ++++++++++++++++++++++++++++++++++ docs/development/internals.rst | 37 ---------------------------------- mopidy/backends/despotify.py | 24 ++++++++++++++++++++++ mopidy/backends/dummy.py | 7 +++++++ mopidy/backends/libspotify.py | 18 +++++++++++++++++ 5 files changed, 86 insertions(+), 37 deletions(-) diff --git a/docs/api/backends.rst b/docs/api/backends.rst index ee53761b..e099fbf8 100644 --- a/docs/api/backends.rst +++ b/docs/api/backends.rst @@ -30,3 +30,40 @@ Backend API :synopsis: Backend interface. :members: :undoc-members: + + +Spotify backends +================ + +:mod:`mopidy.backends.despotify` -- Despotify backend +----------------------------------------------------- + +.. automodule:: mopidy.backends.despotify + :synopsis: Spotify backend using the despotify library. + :members: + + +:mod:`mopidy.backends.libspotify` -- Libspotify backend +------------------------------------------------------- + +.. automodule:: mopidy.backends.libspotify + :synopsis: Spotify backend using the libspotify library. + :members: + + +Other backends +============== + +:mod:`mopidy.backends.dummy` -- Dummy backend +--------------------------------------------- + +.. automodule:: mopidy.backends.dummy + :synopsis: Dummy backend used for testing. + :members: + + +GStreamer backend +----------------- + +``GstreamerBackend`` is pending merge from `adamcik/mopidy/gstreamer +`_. diff --git a/docs/development/internals.rst b/docs/development/internals.rst index 9c38f654..10a79152 100644 --- a/docs/development/internals.rst +++ b/docs/development/internals.rst @@ -31,40 +31,3 @@ not Mopidy. "spytify" -> "despotify" [ label="use C library" ] "DespotifyBackend" -> "AlsaMixer" [ label="use mixer API" ] "AlsaMixer" -> "alsaaudio" [ label="use Python library" ] - - -Notes on despotify/spytify -========================== - -`spytify `_ -is the Python bindings for the open source `despotify `_ -library. It got no documentation to speak of, but a couple of examples are -available. - -A list of the issues we currently experience with spytify, both bugs and -features we wished was there: - -- r503: Sometimes segfaults when traversing stored playlists, their tracks, - artists, and albums. As it is not predictable, it may be a concurrency issue. - -- r503: Segfaults when looking up playlists, both your own lists and other - peoples shared lists. To reproduce:: - - >>> import spytify - >>> s = spytify.Spytify('alice', 'secret') - >>> s.lookup('spotify:user:klette:playlist:5rOGYPwwKqbAcVX8bW4k5V') - Segmentation fault - - -Notes on libspotify/pyspotify -============================================ - -`pyspotify `_ is the Python bindings for -the official Spotify library, libspotify. It got no documentation to speak of, -but multiple examples are available. Like libspotify, pyspotify's calls are -mostly asynchronous. - -A list of the issues we currently experience with pyspotify, both bugs and -features we wished was there: - -- None at the moment. diff --git a/mopidy/backends/despotify.py b/mopidy/backends/despotify.py index 349f3a9a..14616bae 100644 --- a/mopidy/backends/despotify.py +++ b/mopidy/backends/despotify.py @@ -14,6 +14,30 @@ logger = logging.getLogger(u'backends.despotify') ENCODING = 'utf-8' class DespotifyBackend(BaseBackend): + """ + A Spotify backend which uses the open source `despotify library + `_. + + `spytify `_ + is the Python bindings for the despotify library. It got litle + documentation, but a couple of examples are available. + + **Issues** + + - r503: Sometimes segfaults when traversing stored playlists, their tracks, + artists, and albums. As it is not predictable, it may be a concurrency + issue. + + - r503: Segfaults when looking up playlists, both your own lists and other + peoples shared lists. To reproduce:: + + >>> import spytify + >>> s = spytify.Spytify('alice', 'secret') + >>> s.lookup('spotify:user:klette:playlist:5rOGYPwwKqbAcVX8bW4k5V') + Segmentation fault + + """ + def __init__(self, *args, **kwargs): super(DespotifyBackend, self).__init__(*args, **kwargs) self.current_playlist = DespotifyCurrentPlaylistController(backend=self) diff --git a/mopidy/backends/dummy.py b/mopidy/backends/dummy.py index 96a87e7d..0da24c44 100644 --- a/mopidy/backends/dummy.py +++ b/mopidy/backends/dummy.py @@ -4,6 +4,13 @@ from mopidy.backends import (BaseBackend, BaseCurrentPlaylistController, from mopidy.models import Playlist class DummyBackend(BaseBackend): + """ + A backend which implements the backend API in the simplest way possible. + Used in tests of the frontends. + + Handles URIs starting with ``dummy:``. + """ + def __init__(self, *args, **kwargs): super(DummyBackend, self).__init__(*args, **kwargs) self.current_playlist = DummyCurrentPlaylistController(backend=self) diff --git a/mopidy/backends/libspotify.py b/mopidy/backends/libspotify.py index d2fabaf1..086920b5 100644 --- a/mopidy/backends/libspotify.py +++ b/mopidy/backends/libspotify.py @@ -17,6 +17,24 @@ logger = logging.getLogger(u'backends.libspotify') ENCODING = 'utf-8' class LibspotifyBackend(BaseBackend): + """ + A Spotify backend which uses the official `libspotify library + `_. + + `pyspotify `_ is the Python bindings + for libspotify. It got no documentation, but multiple examples are + available. Like libspotify, pyspotify's calls are mostly asynchronous. + + This backend should also work with `openspotify + `_, but we haven't tested + that yet. + + **Issues** + + - libspotify is badly packaged. See + http://getsatisfaction.com/spotify/topics/libspotify_please_fix_the_installation_script. + """ + def __init__(self, *args, **kwargs): super(LibspotifyBackend, self).__init__(*args, **kwargs) self.current_playlist = LibspotifyCurrentPlaylistController(