[gnome-music/wip/mschraal/no-prop-logging: 3/3] Remove @log decorator from properties
- From: Marinus Schraal <mschraal src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-music/wip/mschraal/no-prop-logging: 3/3] Remove @log decorator from properties
- Date: Thu, 19 Jul 2018 22:05:09 +0000 (UTC)
commit 05523658016cad42db4dde80aa753fef5e2f8cb8
Author: Marinus Schraal <mschraal gnome org>
Date: Sun May 20 09:00:49 2018 +0200
Remove @log decorator from properties
The @log & @GObject.Property decorator do not mix and fail to run in debug
mode.
Remove the @log decorator for now.
gnomemusic/albumartcache.py | 3 ---
gnomemusic/gstplayer.py | 8 --------
gnomemusic/player.py | 2 --
gnomemusic/scrobbler.py | 5 -----
gnomemusic/searchbar.py | 4 ----
gnomemusic/views/emptyview.py | 2 --
gnomemusic/views/playlistview.py | 1 -
gnomemusic/widgets/disclistboxwidget.py | 4 ----
gnomemusic/widgets/headerbar.py | 7 -------
gnomemusic/widgets/smoothscale.py | 2 --
gnomemusic/widgets/songwidget.py | 3 ---
gnomemusic/widgets/starimage.py | 4 ----
12 files changed, 45 deletions(-)
---
diff --git a/gnomemusic/albumartcache.py b/gnomemusic/albumartcache.py
index 62c40a2f..ac462f2e 100644
--- a/gnomemusic/albumartcache.py
+++ b/gnomemusic/albumartcache.py
@@ -302,7 +302,6 @@ class Art(GObject.GObject):
GLib.filename_to_uri(thumb_file.get_path(), None))
@GObject.Property
- @log
def surface(self):
if self._surface is None:
self._surface = DefaultIcon().get(
@@ -336,7 +335,6 @@ class ArtImage(Art):
self._image.set_from_surface(self._surface)
@GObject.Property
- @log
def image(self):
"""Returns the image object of the ArtImage class
@@ -347,7 +345,6 @@ class ArtImage(Art):
return self._image.set_from_surface(self._surface)
@image.setter
- @log
def image(self, image):
"""Set the image of the Art class instance""
diff --git a/gnomemusic/gstplayer.py b/gnomemusic/gstplayer.py
index 56831bcb..08a038bc 100644
--- a/gnomemusic/gstplayer.py
+++ b/gnomemusic/gstplayer.py
@@ -206,7 +206,6 @@ class GstPlayer(GObject.GObject):
return Playback.STOPPED
@GObject.Property
- @log
def state(self):
"""Current state of the player
@@ -216,7 +215,6 @@ class GstPlayer(GObject.GObject):
return self._get_playback_status()
@state.setter
- @log
def state(self, state):
"""Set state of the player
@@ -230,7 +228,6 @@ class GstPlayer(GObject.GObject):
self._player.set_state(Gst.State.PLAYING)
@GObject.Property
- @log
def url(self):
"""Current url loaded
@@ -240,7 +237,6 @@ class GstPlayer(GObject.GObject):
return self._player.props.uri
@url.setter
- @log
def url(self, url_):
"""url to load next
@@ -249,7 +245,6 @@ class GstPlayer(GObject.GObject):
self._player.set_property('uri', url_)
@GObject.Property
- @log
def position(self):
"""Current player position
@@ -262,7 +257,6 @@ class GstPlayer(GObject.GObject):
return position
@GObject.Property
- @log
def duration(self):
"""Total duration of current media
@@ -278,7 +272,6 @@ class GstPlayer(GObject.GObject):
# Setter provided to trigger a property signal.
# For internal use only.
@duration.setter
- @log
def duration(self, duration):
"""Set duration of current media (internal)
@@ -287,7 +280,6 @@ class GstPlayer(GObject.GObject):
self._duration = duration
@GObject.Property
- @log
def volume(self):
"""Get current volume
diff --git a/gnomemusic/player.py b/gnomemusic/player.py
index bdfff09e..7de6b765 100644
--- a/gnomemusic/player.py
+++ b/gnomemusic/player.py
@@ -356,7 +356,6 @@ class Player(GObject.GObject):
return True
@GObject.Property
- @log
def playing(self):
"""Returns if a song is currently played
@@ -602,7 +601,6 @@ class Player(GObject.GObject):
return self._player.state
@GObject.Property
- @log
def url(self):
"""GstPlayer url loaded
diff --git a/gnomemusic/scrobbler.py b/gnomemusic/scrobbler.py
index f269a6ef..b6ab4f64 100644
--- a/gnomemusic/scrobbler.py
+++ b/gnomemusic/scrobbler.py
@@ -91,7 +91,6 @@ class GoaLastFM(GObject.GObject):
self.disabled = klass.props.music_disabled
@GObject.Property(type=bool, default=True)
- @log
def disabled(self):
"""Retrieve the disabled status for the Last.fm account
@@ -101,7 +100,6 @@ class GoaLastFM(GObject.GObject):
return self._disabled
@disabled.setter
- @log
def disabled(self, value):
"""Set the disabled status for the Last.fm account
@@ -110,19 +108,16 @@ class GoaLastFM(GObject.GObject):
self._disabled = value
@GObject.Property
- @log
def secret(self):
"""Retrieve the Last.fm client secret"""
return self._authentication.props.client_secret
@GObject.Property
- @log
def client_id(self):
"""Retrieve the Last.fm client id"""
return self._authentication.props.client_id
@GObject.Property
- @log
def session_key(self):
"""Retrieve the Last.fm session key"""
return self._authentication.call_get_access_token_sync(None)[0]
diff --git a/gnomemusic/searchbar.py b/gnomemusic/searchbar.py
index f920cd41..cb2b14bc 100644
--- a/gnomemusic/searchbar.py
+++ b/gnomemusic/searchbar.py
@@ -75,12 +75,10 @@ class BaseManager(GObject.GObject):
self.selected_id = self.values[1][BaseModelColumns.ID]
@GObject.Property
- @log
def active(self):
return self.selected_id
@active.setter
- @log
def active(self, selected_id):
if selected_id == "":
return
@@ -135,12 +133,10 @@ class SourceManager(BaseManager):
self.values.append(value)
@GObject.Property
- @log
def active(self):
return super().active
@active.setter
- @log
def active(self, selected_id):
if selected_id == "":
return
diff --git a/gnomemusic/views/emptyview.py b/gnomemusic/views/emptyview.py
index cdc3916b..1ea8279b 100644
--- a/gnomemusic/views/emptyview.py
+++ b/gnomemusic/views/emptyview.py
@@ -73,7 +73,6 @@ class EmptyView(Gtk.Stack):
self._state = EmptyView.State.INITIAL
@GObject.Property(type=int, default=0, minimum=0, maximum=2)
- @log
def state(self):
"""Get the state of the empty view
@@ -83,7 +82,6 @@ class EmptyView(Gtk.Stack):
return self._state
@state.setter
- @log
def state(self, value):
"""Set the state of the empty view
diff --git a/gnomemusic/views/playlistview.py b/gnomemusic/views/playlistview.py
index 9de3e02e..9ed93ec7 100644
--- a/gnomemusic/views/playlistview.py
+++ b/gnomemusic/views/playlistview.py
@@ -737,7 +737,6 @@ class PlaylistView(BaseView):
self._songs_todelete.pop(media_id)
@GObject.Property(type=bool, default=False)
- @log
def rename_active(self):
"""Indicate if renaming dialog is active"""
return self._name_stack.get_visible_child_name() == 'renaming_dialog'
diff --git a/gnomemusic/widgets/disclistboxwidget.py b/gnomemusic/widgets/disclistboxwidget.py
index b1aca6ef..7d9ad2a7 100644
--- a/gnomemusic/widgets/disclistboxwidget.py
+++ b/gnomemusic/widgets/disclistboxwidget.py
@@ -55,7 +55,6 @@ class DiscSongsFlowBox(Gtk.FlowBox):
self.get_style_context().add_class('discsongsflowbox')
@GObject.Property(type=int, minimum=1, default=1)
- @log
def columns(self):
"""Number of columns for the song list
@@ -65,7 +64,6 @@ class DiscSongsFlowBox(Gtk.FlowBox):
return self._columns
@columns.setter
- @log
def columns(self, columns):
"""Set the number of columns to use
@@ -354,7 +352,6 @@ class DiscListBox(Gtk.Box):
self.foreach(child_select_none)
@GObject.Property(type=bool, default=False)
- @log
def selection_mode(self):
"""selection mode getter
@@ -364,7 +361,6 @@ class DiscListBox(Gtk.Box):
return self._selection_mode
@selection_mode.setter
- @log
def selection_mode(self, value):
"""selection-mode setter
diff --git a/gnomemusic/widgets/headerbar.py b/gnomemusic/widgets/headerbar.py
index fd1c107a..64131e4b 100644
--- a/gnomemusic/widgets/headerbar.py
+++ b/gnomemusic/widgets/headerbar.py
@@ -46,14 +46,12 @@ class SelectionBarMenuButton(Gtk.MenuButton):
def __repr__(self):
return "<SelectionBarMenuButton>"
- @log
def __init__(self):
super().__init__()
self._items_selected = 0
@GObject.Property(type=int, default=0, minimum=0)
- @log
def items_selected(self):
"""The number of items selected
@@ -63,7 +61,6 @@ class SelectionBarMenuButton(Gtk.MenuButton):
return self._items_selected
@items_selected.setter
- @log
def items_selected(self, value):
"""Set the number of items selected
@@ -145,7 +142,6 @@ class HeaderBar(Gtk.HeaderBar):
self._on_selection_mode_allowed_changed)
@GObject.Property(type=bool, default=False)
- @log
def selection_mode(self):
"""Selection mode
@@ -155,7 +151,6 @@ class HeaderBar(Gtk.HeaderBar):
return self._selection_mode
@selection_mode.setter
- @log
def selection_mode(self, mode):
"""Set the selection mode
@@ -172,7 +167,6 @@ class HeaderBar(Gtk.HeaderBar):
self._update()
@GObject.Property
- @log
def state(self):
"""State of the widget
@@ -182,7 +176,6 @@ class HeaderBar(Gtk.HeaderBar):
return self._state
@state.setter
- @log
def state(self, value):
"""Set state of the of widget
diff --git a/gnomemusic/widgets/smoothscale.py b/gnomemusic/widgets/smoothscale.py
index 31c0579e..b92c7f0b 100644
--- a/gnomemusic/widgets/smoothscale.py
+++ b/gnomemusic/widgets/smoothscale.py
@@ -70,7 +70,6 @@ class SmoothScale(Gtk.Scale):
# FIXME: This is a workaround for not being able to pass the player
# object via init when using Gtk.Builder.
@GObject.Property
- @log
def player(self):
"""The GstPlayer object used
@@ -80,7 +79,6 @@ class SmoothScale(Gtk.Scale):
return self._player
@player.setter
- @log
def player(self, player):
"""Set the GstPlayer object used
diff --git a/gnomemusic/widgets/songwidget.py b/gnomemusic/widgets/songwidget.py
index 606ba6aa..3dfa792c 100644
--- a/gnomemusic/widgets/songwidget.py
+++ b/gnomemusic/widgets/songwidget.py
@@ -156,7 +156,6 @@ class SongWidget(Gtk.EventBox):
self._star_image.props.hover = False
@GObject.Property(type=bool, default=False)
- @log
def selection_mode(self):
"""Selection mode
@@ -166,7 +165,6 @@ class SongWidget(Gtk.EventBox):
return self._selection_mode
@selection_mode.setter
- @log
def selection_mode(self, value):
"""Set the selection mode
@@ -179,7 +177,6 @@ class SongWidget(Gtk.EventBox):
self.props.selected = False
@GObject.Property
- @log
def state(self):
"""State of the widget
diff --git a/gnomemusic/widgets/starimage.py b/gnomemusic/widgets/starimage.py
index b70972c6..4ccb21d6 100644
--- a/gnomemusic/widgets/starimage.py
+++ b/gnomemusic/widgets/starimage.py
@@ -45,7 +45,6 @@ class StarImage(Gtk.Image):
self.show_all()
@GObject.Property(type=bool, default=False)
- @log
def favorite(self):
"""Return the current state of the widget
@@ -55,7 +54,6 @@ class StarImage(Gtk.Image):
return self._favorite
@favorite.setter
- @log
def favorite(self, value):
"""Set favorite
@@ -71,12 +69,10 @@ class StarImage(Gtk.Image):
self.unset_state_flags(Gtk.StateFlags.SELECTED)
@GObject.Property(type=bool, default=False)
- @log
def hover(self):
return self._hover
@hover.setter
- @log
def hover(self, value):
if value:
self.set_state_flags(Gtk.StateFlags.PRELIGHT, False)
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]