From 8240dbbb557e7ef56b51e9d6d04e9b0e35e0c1ab Mon Sep 17 00:00:00 2001 From: Thomas Adamcik Date: Fri, 29 Oct 2010 20:36:38 +0200 Subject: [PATCH] Add docstrings --- mopidy/frontends/mpd/translator.py | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/mopidy/frontends/mpd/translator.py b/mopidy/frontends/mpd/translator.py index 28d1e08b..ccd83fde 100644 --- a/mopidy/frontends/mpd/translator.py +++ b/mopidy/frontends/mpd/translator.py @@ -80,10 +80,24 @@ def playlist_to_mpd_format(playlist, *args, **kwargs): return tracks_to_mpd_format(playlist.tracks, *args, **kwargs) def uri_to_mpd_relative_path(uri): + """ + Strip uri and LOCAL_MUSIC_FOLDER part of uri. + + :param uri: the uri + :type uri: string + :rtype: string + """ path = path_to_uri(settings.LOCAL_MUSIC_FOLDER) return re.sub('^' + re.escape(path), '', uri) def tracks_to_tag_cache_format(tracks): + """ + Format list of tracks for output to MPD tag cache + + :param tracks: the tracks + :type tracks: list of :class:`mopidy.models.Track` + :rtype: list of lists of two-tuples + """ result = [ ('info_begin',), ('mpd_version', protocol.VERSION),