From 8238e955b815794b5316a4d94f8a2087d9443d97 Mon Sep 17 00:00:00 2001 From: Stein Magnus Jodal Date: Sat, 14 Aug 2010 00:55:25 +0200 Subject: [PATCH] Bundle a Spotify appkey with the libspotify backend --- MANIFEST.in | 1 + docs/changes.rst | 2 ++ mopidy/backends/libspotify/session_manager.py | 2 +- mopidy/backends/libspotify/spotify_appkey.key | Bin 0 -> 321 bytes mopidy/settings.py | 5 ----- setup.py | 1 + 6 files changed, 5 insertions(+), 6 deletions(-) create mode 100644 mopidy/backends/libspotify/spotify_appkey.key diff --git a/MANIFEST.in b/MANIFEST.in index 8a73b481..38819adb 100644 --- a/MANIFEST.in +++ b/MANIFEST.in @@ -1,4 +1,5 @@ include LICENSE pylintrc *.rst *.txt +include mopidy/backends/libspotify/spotify_appkey.key recursive-include docs * prune docs/_build recursive-include tests *.py diff --git a/docs/changes.rst b/docs/changes.rst index 7b154915..c20b2ad1 100644 --- a/docs/changes.rst +++ b/docs/changes.rst @@ -23,6 +23,8 @@ Another great release. - Remove :mod:`mopidy.backends.despotify`, as Despotify is little maintained and the Libspotify backend is working much better. - :mod:`mopidy.backends.libspotify` is now the default backend. +- A Spotify application key is now bundled with the source. The + ``SPOTIFY_LIB_APPKEY`` setting is thus removed. - MPD frontend: - Relocate from :mod:`mopidy.mpd` to :mod:`mopidy.frontends.mpd`. diff --git a/mopidy/backends/libspotify/session_manager.py b/mopidy/backends/libspotify/session_manager.py index 2de6ae63..707423aa 100644 --- a/mopidy/backends/libspotify/session_manager.py +++ b/mopidy/backends/libspotify/session_manager.py @@ -13,7 +13,7 @@ logger = logging.getLogger('mopidy.backends.libspotify.session_manager') class LibspotifySessionManager(SpotifySessionManager, threading.Thread): cache_location = os.path.expanduser(settings.SPOTIFY_LIB_CACHE) settings_location = os.path.expanduser(settings.SPOTIFY_LIB_CACHE) - appkey_file = os.path.expanduser(settings.SPOTIFY_LIB_APPKEY) + appkey_file = os.path.join(os.path.dirname(__file__), 'spotify_appkey.key') user_agent = 'Mopidy %s' % get_version() def __init__(self, username, password, core_queue, output_queue): diff --git a/mopidy/backends/libspotify/spotify_appkey.key b/mopidy/backends/libspotify/spotify_appkey.key new file mode 100644 index 0000000000000000000000000000000000000000..1f840b962d9245820e73803ae5995650b4f84f62 GIT binary patch literal 321 zcmV-H0lxkL&xsG-pVlEz7LL?2e{+JtQpZk(M<9(;xguUY#VZNv&txxTh0nuFe(N{} zC?#&u)&58KeoT-KpSTN{8Wb)hzuj?jZNaN?^McImAMP|w&4GR8DyOK-#=V!cSw`&V5lyby`QwVzk}bWQ#Ui#m2fN)=wRSqK33~=D8OATMF|fdmT#G0B?yVov-+)u7w0gkTjyb{I{VGW`-;#R z$iCRsr@I8@9i#w7y@Y$>dnR3OOhWI%a!F~QeP*7Os+7-($V~m!LFZ(l=H!@+PtT&9 literal 0 HcmV?d00001 diff --git a/mopidy/settings.py b/mopidy/settings.py index 949b2e06..b17af913 100644 --- a/mopidy/settings.py +++ b/mopidy/settings.py @@ -160,11 +160,6 @@ MPD_SERVER_HOSTNAME = u'127.0.0.1' #: Default: 6600 MPD_SERVER_PORT = 6600 -#: Path to your libspotify application key. -#: -#: Used by :mod:`mopidy.backends.libspotify`. -SPOTIFY_LIB_APPKEY = u'~/.mopidy/spotify_appkey.key' - #: Path to the libspotify cache. #: #: Used by :mod:`mopidy.backends.libspotify`. diff --git a/setup.py b/setup.py index 76c38e4b..fabc8353 100644 --- a/setup.py +++ b/setup.py @@ -75,6 +75,7 @@ setup( author='Stein Magnus Jodal', author_email='stein.magnus@jodal.no', packages=packages, + package_data={'mopidy': ['backends/libspotify/spotify_appkey.key']}, cmdclass=cmdclasses, data_files=data_files, scripts=['bin/mopidy'],