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



commit 8254fbcff6756aa458959165f56332cfc72b3a89
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 b0c0f0a6..8aa3f14b 100644
--- a/gnomemusic/mpris.py
+++ b/gnomemusic/mpris.py
@@ -615,39 +615,50 @@ class MPRIS(DBusInterface):
         self._reload_playlists()
 
     def _raise(self):
+        """Brings user interface to the front (MPRIS Method)."""
         self._app.do_activate()
 
     def _quit(self):
+        """Causes the media player to stop running (MPRIS Method)."""
         self._app.quit()
 
     def _next(self):
+        """Skips to the next track in the tracklist (MPRIS Method)."""
         self._player.next()
 
     def _previous(self):
+        """Skips to the previous track in the tracklist.
+
+        (MPRIS Method)
+        """
         self._player.previous()
 
     def _pause(self):
+        """Pauses playback (MPRIS Method)."""
         self._player.pause()
 
     def _play_pause(self):
+        """Play or Pauses playback (MPRIS Method)."""
         self._player.play_pause()
 
     def _stop(self):
+        """Stop playback (MPRIS Method)."""
         self._player.stop()
 
     def _play(self):
-        """Start or resume playback.
+        """Start or resume playback (MPRIS Method).
 
         If there is no track to play, this has no effect.
         """
         self._player.play()
 
     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()
@@ -660,7 +671,7 @@ class MPRIS(DBusInterface):
             self._player.next()
 
     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
@@ -672,9 +683,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.
+        """
         pass
 
     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)
@@ -682,12 +707,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).
+        """
         pass
 
     def _remove_track(self, path):
+        """Removess an item from the TrackList. (MPRIS Method).
+
+        This is not implemented (CanEditTracks is set to False).
+        """
         pass
 
     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)
         goto_index = self._path_list.index(path)
@@ -695,6 +732,10 @@ class MPRIS(DBusInterface):
         self.player.play(song_offset=song_offset)
 
     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()
         self._playlists.activate_playlist(playlist_id)
 


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