review: Typos and code formating

This commit is contained in:
Thomas Adamcik 2014-01-17 23:52:18 +01:00
parent 43e16ddb65
commit 08b7d199f7
5 changed files with 7 additions and 7 deletions

View File

@ -57,8 +57,8 @@ class LibraryProvider(object):
root_directory = None
"""
:class:`models.Ref.directory` instance with an uri and name set
representing the root of this libraries browse tree. URIs must
:class:`models.Ref.directory` instance with a URI and name set
representing the root of this library's browse tree. URIs must
use one of the schemes supported by the backend, and name should
be set to a human friendly value.

View File

@ -52,12 +52,12 @@ class LibraryController(object):
The only valid exception to this is checking the scheme, as it is used
to route browse requests to the correct backend.
For example, the dummy library's ``/bar`` directory could bereturned
For example, the dummy library's ``/bar`` directory could be returned
like this::
Ref.directory(uri='dummy:directory:/bar', name='bar')
:param bytestring uri: uri to browse
:param string uri: URI to browse
:rtype: list of :class:`mopidy.models.Ref`
"""
if uri is None:

View File

@ -62,7 +62,7 @@ class _BrowseCache(object):
for i in range(len(parts)):
self._cache.setdefault(parent, collections.OrderedDict())
directory = b'/'.join(parts[:i+1])
directory = '/'.join(parts[:i+1])
dir_uri = translator.path_to_local_directory_uri(directory)
dir_ref = models.Ref.directory(uri=dir_uri, name=parts[i])
self._cache[parent][dir_uri] = dir_ref

View File

@ -34,7 +34,7 @@ def path_to_local_track_uri(relpath):
def path_to_local_directory_uri(relpath):
"""Convert path releative to media_dir to local directory URI."""
"""Convert path relative to :confval:`local/media_dir` directory URI."""
if isinstance(relpath, unicode):
relpath = relpath.encode('utf-8')
return b'local:directory:%s' % urllib.quote(relpath)

View File

@ -302,7 +302,7 @@ class MpdContext(object):
uri = None
for part in parts:
for ref in self.core.library.browse(uri).get():
if ref.type == ref.DIRECTORY and part == ref.name:
if ref.type == ref.DIRECTORY and ref.name == part:
uri = ref.uri
break
else: