[gnome-music/wip/jfelder/mpris-cleanup: 22/25] mpris: Add doctring for all MPRIS methods

commit f82c3fc0b6a98b984074450fb8d39154eed5e05e
Author: Jean Felder <jfelder src gnome org>
Date:   Thu Apr 4 15:21:43 2019 +0200

    mpris: Add doctring for all MPRIS methods
    This should help distinguish internal methods from the methods exposed
    by the MPRIS specification.

 gnomemusic/mpris.py | 47 ++++++++++++++++++++++++++++++++++++++++++++---
 1 file changed, 44 insertions(+), 3 deletions(-)
diff --git a/gnomemusic/mpris.py b/gnomemusic/mpris.py
index 59a0c034..538db633 100644
--- a/gnomemusic/mpris.py
+++ b/gnomemusic/mpris.py
@@ -628,39 +628,50 @@ class MPRIS(DBusInterface):
     def _raise(self):
+        """Brings user interface to the front (MPRIS Method)."""
     def _quit(self):
+        """Causes the media player to stop running (MPRIS Method)."""
     def _next(self):
+        """Skips to the next track in the tracklist (MPRIS Method)."""
     def _previous(self):
+        """Skips to the previous track in the tracklist.
+        (MPRIS Method)
+        """
     def _pause(self):
+        """Pauses playback (MPRIS Method)."""
     def _play_pause(self):
+        """Play or Pauses playback (MPRIS Method)."""
     def _stop(self):
+        """Stop playback (MPRIS Method)."""
     def _play(self):
-        """Start or resume playback.
+        """Start or resume playback (MPRIS Method).
         If there is no track to play, this has no effect.
     def _seek(self, offset_msecond):
-        """Seek forward in the current track.
+        """Seek forward in the current track (MPRIS Method).
         Seek is relative to the current player position.
         If the value passed in would mean seeking beyond the end of the track,
         acts like a call to Next.
         :param int offset_msecond: number of microseconds
         current_position_second = self._player.get_position()
@@ -673,7 +684,7 @@ class MPRIS(DBusInterface):
     def _set_position(self, track_id, position_msecond):
-        """Set the current track position in microseconds.
+        """Set the current track position in microseconds (MPRIS Method)
         :param str track_id: The currently playing track's identifier
         :param int position_msecond: new position in microseconds
@@ -685,9 +696,23 @@ class MPRIS(DBusInterface):
         self._player.set_position(position_msecond / 1e6)
     def _open_uri(self, uri):
+        """Opens the Uri given as an argument (MPRIS Method).
+        Not implemented.
+        :param str uri: Uri of the track to load.
+        """
     def _get_tracks_metadata(self, track_paths):
+        """Gets all the metadata available for a set of tracks.
+        (MPRIS Method)
+        :param list track_paths: list of track ids
+        :returns: Metadata of the set of tracks given as input.
+        :rtype: list
+        """
         metadata = []
         for path in track_paths:
             index = self._path_list.index(path)
@@ -695,12 +720,24 @@ class MPRIS(DBusInterface):
         return metadata
     def _add_track(self, uri, after_track, set_as_current):
+        """Adds a URI in the TrackList. (MPRIS Method).
+        This is not implemented (CanEditTracks is set to False).
+        """
     def _remove_track(self, path):
+        """Removess an item from the TrackList. (MPRIS Method).
+        This is not implemented (CanEditTracks is set to False).
+        """
     def _go_to(self, path):
+        """Skip to the specified TrackId (MPRIS Method).
+        :param str path: Identifier of the track to skip to
+        """
         current_song_path = self._get_song_dbus_path(
         current_song_index = self._path_list.index(current_song_path)
@@ -708,6 +745,10 @@ class MPRIS(DBusInterface):
         self._player.play(goto_index - current_song_index)
     def _activate_playlist(self, playlist_path):
+        """Starts playing the given playlist (MPRIS Method).
+        :param str playlist_path: The id of the playlist to activate.
+        """
         playlist_id = self._get_playlist_from_dbus_path(playlist_path).get_id()

[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]