[gnome-music/wip/mschraal/duration-fixes: 5/5] corealbum: Various minor cleanups
- From: Marinus Schraal <mschraal src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-music/wip/mschraal/duration-fixes: 5/5] corealbum: Various minor cleanups
- Date: Wed, 24 Jul 2019 19:59:28 +0000 (UTC)
commit b28073a5f1f89dc266bb6633da55d6f3668cda10
Author: Marinus Schraal <mschraal gnome org>
Date: Mon Jul 22 15:52:16 2019 +0200
corealbum: Various minor cleanups
* Remove old style logging
* Add __repr__
* Add a few docstrings
gnomemusic/corealbum.py | 17 +++++++++++++----
1 file changed, 13 insertions(+), 4 deletions(-)
---
diff --git a/gnomemusic/corealbum.py b/gnomemusic/corealbum.py
index a1030b2f..f1834915 100644
--- a/gnomemusic/corealbum.py
+++ b/gnomemusic/corealbum.py
@@ -23,10 +23,9 @@
# delete this exception statement from your version.
import gi
-gi.require_version('Grl', '0.3')
+gi.require_version("Grl", "0.3")
from gi.repository import Gio, Grl, GObject
-from gnomemusic import log
import gnomemusic.utils as utils
@@ -41,8 +40,15 @@ class CoreAlbum(GObject.GObject):
title = GObject.Property(type=str)
year = GObject.Property(type=str, default="----")
- @log
+ def __repr__(self):
+ return "<CoreAlbum>"
+
def __init__(self, media, coremodel):
+ """Initiate the CoreAlbum object
+
+ :param Grl.Media media: A media object
+ :param CoreModel coremodel: The CoreModel to use models from
+ """
super().__init__()
self._coremodel = coremodel
@@ -50,8 +56,11 @@ class CoreAlbum(GObject.GObject):
self._selected = False
self.update(media)
- @log
def update(self, media):
+ """Update the CoreAlbum object with new info
+
+ :param Grl.Media media: A media object
+ """
self.props.media = media
self.props.artist = utils.get_artist_name(media)
self.props.composer = media.get_composer()
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]