From 85a34d943be2bf73e3bcde723b3c21909eb2c6ab Mon Sep 17 00:00:00 2001 From: Stein Magnus Jodal Date: Sun, 14 Feb 2010 01:01:45 +0100 Subject: [PATCH 1/2] Add paragraph on code style --- docs/development.rst | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/docs/development.rst b/docs/development.rst index 2a39b327..3f4897db 100644 --- a/docs/development.rst +++ b/docs/development.rst @@ -24,10 +24,25 @@ modular, so we can extend it with other backends in the future, like file playback and other online music services such as Last.fm. +Code style +========== + +We generally follow the `PEP-8 `_ +style guidelines, with a couple of notable exceptions: + +- We only indent continuation lines with an addition four spaces relative to + the previous line. +- An exception to the previous exception: When continuing control flow + statements like ``if``, ``for`` and ``while``, indent the continuation lines + with eight spaces, so that it is indented an additional level compared to the + following block of code. + + Running tests ============= -To run tests, you need a couple of dependiencies. Some can be installed through Debian/Ubuntu package management:: +To run tests, you need a couple of dependencies. Some can be installed through +Debian/Ubuntu package management:: sudo aptitude install python-coverage From 0e3a98b328c174e2d8571c2c3bfc9fcf9c5c2e52 Mon Sep 17 00:00:00 2001 From: Stein Magnus Jodal Date: Sun, 14 Feb 2010 01:04:27 +0100 Subject: [PATCH 2/2] Document return type of get_by_uri and get_by_id --- mopidy/backends/__init__.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/mopidy/backends/__init__.py b/mopidy/backends/__init__.py index 8b6de67c..962e91ba 100644 --- a/mopidy/backends/__init__.py +++ b/mopidy/backends/__init__.py @@ -74,6 +74,7 @@ class BaseCurrentPlaylistController(object): :param id: track ID :type id: int + :rtype: :class:`mopidy.models.Track` """ matches = filter(lambda t: t.id == id, self._playlist.tracks) if matches: @@ -87,6 +88,7 @@ class BaseCurrentPlaylistController(object): :param uri: track URI :type uri: string + :rtype: :class:`mopidy.models.Track` """ matches = filter(lambda t: t.uri == uri, self._playlist.tracks) if matches: