[gnome-music/bilelmoussaoui/adaptive-ui] Fix pep8 style issues



commit cf8a2dbd36226435d8e293f4c37ee7b5bcf6ffce
Author: Bilal Elmoussaoui <bil elmoussaoui gmail com>
Date:   Tue Sep 17 11:24:33 2019 +0200

    Fix pep8 style issues

 gnomemusic/views/albumsview.py      |  3 ++-
 gnomemusic/views/artistsview.py     |  3 ++-
 gnomemusic/views/baseview.py        |  5 +++--
 gnomemusic/views/playlistsview.py   |  4 +++-
 gnomemusic/views/songsview.py       |  3 ++-
 gnomemusic/widgets/headerbar.py     |  4 ++--
 gnomemusic/widgets/playertoolbar.py |  6 ++++--
 gnomemusic/window.py                | 19 +++++++++----------
 8 files changed, 27 insertions(+), 20 deletions(-)
---
diff --git a/gnomemusic/views/albumsview.py b/gnomemusic/views/albumsview.py
index d69a7334..a95494ac 100644
--- a/gnomemusic/views/albumsview.py
+++ b/gnomemusic/views/albumsview.py
@@ -82,7 +82,8 @@ class AlbumsView(Gtk.Stack):
             GObject.BindingFlags.BIDIRECTIONAL)
         self._album_widget.bind_property(
             "adaptive-view", self, "adaptive-view",
-            GObject.BindingFlags.BIDIRECTIONAL | GObject.BindingFlags.SYNC_CREATE)
+            GObject.BindingFlags.BIDIRECTIONAL
+            | GObject.BindingFlags.SYNC_CREATE)
 
         self.add(self._album_widget)
 
diff --git a/gnomemusic/views/artistsview.py b/gnomemusic/views/artistsview.py
index 86a37c26..84b21a4f 100644
--- a/gnomemusic/views/artistsview.py
+++ b/gnomemusic/views/artistsview.py
@@ -58,7 +58,8 @@ class ArtistsView(BaseView):
         sidebar_container.add(self._sidebar)
 
         super().__init__(
-            'artists', _("Artists"), "system-users-symbolic", application, sidebar_container)
+            'artists', _("Artists"), "system-users-symbolic",
+            application, sidebar_container)
 
         self._application = application
         self._artists = {}
diff --git a/gnomemusic/views/baseview.py b/gnomemusic/views/baseview.py
index 6a179821..7bc5ac09 100644
--- a/gnomemusic/views/baseview.py
+++ b/gnomemusic/views/baseview.py
@@ -24,7 +24,6 @@
 
 from gi.repository import GObject, Gtk, Handy
 
-from enum import IntEnum
 from gnomemusic.widgets.headerbar import HeaderBar
 from gnomemusic.utils import AdaptiveViewMode
 from gnomemusic import log
@@ -48,7 +47,9 @@ class BaseView(Gtk.Stack):
         :param GtkApplication application: The application object
         :param sidebar: The sidebar object (Default: Gtk.Box)
         """
-        Gtk.Stack.__init__(self, transition_type=Gtk.StackTransitionType.CROSSFADE, homogeneous=False)
+        super().__init__(
+            transition_type=Gtk.StackTransitionType.CROSSFADE,
+            homogeneous=False)
         self._leaflet = Handy.Leaflet()
         self._leaflet.props.vexpand = True
 
diff --git a/gnomemusic/views/playlistsview.py b/gnomemusic/views/playlistsview.py
index ee9ffe3e..eb8f3ec9 100644
--- a/gnomemusic/views/playlistsview.py
+++ b/gnomemusic/views/playlistsview.py
@@ -37,6 +37,7 @@ from gnomemusic.widgets.playlisttile import PlaylistTile
 from gnomemusic.widgets.songwidget import SongWidget
 from gnomemusic.utils import AdaptiveViewMode
 
+
 class PlaylistsView(BaseView):
     """Main view for playlists"""
 
@@ -58,7 +59,8 @@ class PlaylistsView(BaseView):
         self._pl_ctrls = PlaylistControls()
 
         super().__init__(
-            'playlists', _("Playlists"), "view-list-symbolic", application, sidebar_container)
+            'playlists', _("Playlists"), "view-list-symbolic",
+            application, sidebar_container)
 
         self._coremodel = application.props.coremodel
         self._model = self._coremodel.props.playlists_sort
diff --git a/gnomemusic/views/songsview.py b/gnomemusic/views/songsview.py
index 3f5e7359..ae11068c 100644
--- a/gnomemusic/views/songsview.py
+++ b/gnomemusic/views/songsview.py
@@ -54,7 +54,8 @@ class SongsView(BaseView):
         :param player: The main player object
         """
         self._coremodel = application.props.coremodel
-        super().__init__('songs', _("Songs"), "emblem-music-symbolic", application)
+        super().__init__('songs', _("Songs"), "emblem-music-symbolic",
+                            application)
 
         self._iter_to_clean = None
 
diff --git a/gnomemusic/widgets/headerbar.py b/gnomemusic/widgets/headerbar.py
index 50a40888..10b76060 100644
--- a/gnomemusic/widgets/headerbar.py
+++ b/gnomemusic/widgets/headerbar.py
@@ -212,10 +212,10 @@ class HeaderBar(Gtk.HeaderBar):
         self._view = value
         if value == HeaderBar.View.WIDE:
             self._squeezer.set_child_enabled(self._title_wide_switcher,
-                                            True)
+                                                True)
         elif value == HeaderBar.View.NARROW:
             self._squeezer.set_child_enabled(self._title_narrow_switcher,
-                                              True)
+                                                True)
         else:
             self._squeezer.set_child_enabled(self._title_text, True)
 
diff --git a/gnomemusic/widgets/playertoolbar.py b/gnomemusic/widgets/playertoolbar.py
index 5f3a9380..c9405f12 100644
--- a/gnomemusic/widgets/playertoolbar.py
+++ b/gnomemusic/widgets/playertoolbar.py
@@ -126,7 +126,8 @@ class PlayerToolbar(Gtk.ActionBar):
             self._next_button.hide()
             self.timer.hide()
             self._cover_stack.props.size = Art.Size.XSMALL
-            self.child_set_property(self.buttons, "pack-type", Gtk.PackType.END)
+            self.child_set_property(self.buttons, "pack-type",
+                                    Gtk.PackType.END)
         else:
             self._progress_scale.show()
             self._repeat_box.show()
@@ -134,7 +135,8 @@ class PlayerToolbar(Gtk.ActionBar):
             self._next_button.show()
             self.timer.show()
             self._cover_stack.props.size = Art.Size.SMALL
-            self.child_set_property(self.buttons, "pack-type", Gtk.PackType.START)
+            self.child_set_property(self.buttons, "pack-type",
+                                    Gtk.PackType.START)
 
     @Gtk.Template.Callback()
     @log
diff --git a/gnomemusic/window.py b/gnomemusic/window.py
index 1580ce58..3968a3df 100644
--- a/gnomemusic/window.py
+++ b/gnomemusic/window.py
@@ -55,7 +55,8 @@ class Window(Gtk.ApplicationWindow):
 
     __gtype_name__ = "Window"
 
-    adaptive_view = GObject.Property(type=GObject.TYPE_INT, default=AdaptiveViewMode.MOBILE)
+    adaptive_view = GObject.Property(type=GObject.TYPE_INT,
+                                        default=AdaptiveViewMode.MOBILE)
     selected_items_count = GObject.Property(type=int, default=0, minimum=0)
     selection_mode = GObject.Property(type=bool, default=False)
 
@@ -135,8 +136,9 @@ class Window(Gtk.ApplicationWindow):
             "notify::search-mode-active", self._on_search_mode_changed)
 
         self._player_toolbar = PlayerToolbar()
-        self._player_toolbar.bind_property("adaptive-view", self, "adaptive-view",
-                                            GObject.BindingFlags.BIDIRECTIONAL | 
GObject.BindingFlags.SYNC_CREATE)
+        self._player_toolbar.bind_property(
+            "adaptive-view", self, "adaptive-view",
+            GObject.BindingFlags.BIDIRECTIONAL | GObject.BindingFlags.SYNC_CREATE)
         self._player_toolbar.props.player = self._player
 
         self._headerbar.connect(
@@ -288,9 +290,10 @@ class Window(Gtk.ApplicationWindow):
             if i.title:
                 self._stack.add_titled(i, i.name, i.title)
                 self._stack.child_set_property(i, "icon-name", i.icon)
-                i.bind_property("adaptive-view", self, "adaptive-view",
-                                    GObject.BindingFlags.BIDIRECTIONAL
-                                    | GObject.BindingFlags.SYNC_CREATE)
+                i.bind_property(
+                    "adaptive-view", self, "adaptive-view",
+                    GObject.BindingFlags.BIDIRECTIONAL
+                    | GObject.BindingFlags.SYNC_CREATE)
             else:
                 self._stack.add_named(i, i.name)
 
@@ -524,9 +527,6 @@ class Window(Gtk.ApplicationWindow):
 
     @log
     def _on_size_allocate(self, widget, allocation):
-        album_view = self.views[View.ALBUM]
-        artists_view = self.views[View.ARTIST]
-
         if allocation.width < 650:
             self.props.adaptive_view = AdaptiveViewMode.MOBILE
             self._headerbar.view = HeaderBar.View.TITLE
@@ -557,4 +557,3 @@ class Window(Gtk.ApplicationWindow):
 
         self.props.selection_mode = False
         playlist_dialog.destroy()
-


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