Formatting
This commit is contained in:
parent
6b7e7d2889
commit
eb4bf2e8bf
@ -90,7 +90,7 @@ class MpdDispatcher(object):
|
|||||||
def _authenticate_filter(self, request, response, filter_chain):
|
def _authenticate_filter(self, request, response, filter_chain):
|
||||||
if self.authenticated:
|
if self.authenticated:
|
||||||
return self._call_next_filter(request, response, filter_chain)
|
return self._call_next_filter(request, response, filter_chain)
|
||||||
elif settings.MPD_SERVER_PASSWORD is None:
|
elif settings.MPD_SERVER_PASSWORD is None:
|
||||||
self.authenticated = True
|
self.authenticated = True
|
||||||
return self._call_next_filter(request, response, filter_chain)
|
return self._call_next_filter(request, response, filter_chain)
|
||||||
else:
|
else:
|
||||||
@ -161,6 +161,7 @@ class MpdDispatcher(object):
|
|||||||
def _has_error(self, response):
|
def _has_error(self, response):
|
||||||
return response and response[-1].startswith(u'ACK')
|
return response and response[-1].startswith(u'ACK')
|
||||||
|
|
||||||
|
|
||||||
### Filter: call handler
|
### Filter: call handler
|
||||||
|
|
||||||
def _call_handler_filter(self, request, response, filter_chain):
|
def _call_handler_filter(self, request, response, filter_chain):
|
||||||
@ -241,11 +242,10 @@ class MpdContext(object):
|
|||||||
"""
|
"""
|
||||||
The backend. An instance of :class:`mopidy.backends.base.Backend`.
|
The backend. An instance of :class:`mopidy.backends.base.Backend`.
|
||||||
"""
|
"""
|
||||||
if self._backend is not None:
|
if self._backend is None:
|
||||||
return self._backend
|
backend_refs = ActorRegistry.get_by_class(Backend)
|
||||||
backend_refs = ActorRegistry.get_by_class(Backend)
|
assert len(backend_refs) == 1, 'Expected exactly one running backend.'
|
||||||
assert len(backend_refs) == 1, 'Expected exactly one running backend.'
|
self._backend = backend_refs[0].proxy()
|
||||||
self._backend = backend_refs[0].proxy()
|
|
||||||
return self._backend
|
return self._backend
|
||||||
|
|
||||||
@property
|
@property
|
||||||
@ -253,9 +253,8 @@ class MpdContext(object):
|
|||||||
"""
|
"""
|
||||||
The mixer. An instance of :class:`mopidy.mixers.base.BaseMixer`.
|
The mixer. An instance of :class:`mopidy.mixers.base.BaseMixer`.
|
||||||
"""
|
"""
|
||||||
if self._mixer is not None:
|
if self._mixer is None:
|
||||||
return self._mixer
|
mixer_refs = ActorRegistry.get_by_class(BaseMixer)
|
||||||
mixer_refs = ActorRegistry.get_by_class(BaseMixer)
|
assert len(mixer_refs) == 1, 'Expected exactly one running mixer.'
|
||||||
assert len(mixer_refs) == 1, 'Expected exactly one running mixer.'
|
self._mixer = mixer_refs[0].proxy()
|
||||||
self._mixer = mixer_refs[0].proxy()
|
|
||||||
return self._mixer
|
return self._mixer
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user