[gnome-music/wip/mschraal/flake8-fixes] Fix warnings with new Flake8



commit c855efb47f7e6ad908043433bd9ab649dca10093
Author: Marinus Schraal <mschraal gnome org>
Date:   Fri Nov 9 08:44:43 2018 +0100

    Fix warnings with new Flake8

 gnomemusic/__init__.py                   |  5 +++--
 gnomemusic/albumartcache.py              |  4 ++--
 gnomemusic/player.py                     |  4 ++--
 gnomemusic/widgets/albumcover.py         |  4 ++--
 gnomemusic/widgets/albumwidget.py        |  4 ++--
 gnomemusic/widgets/artistalbumswidget.py |  4 ++--
 gnomemusic/widgets/artistalbumwidget.py  |  4 ++--
 gnomemusic/widgets/disclistboxwidget.py  |  4 ++--
 gnomemusic/widgets/headerbar.py          | 12 ++++++------
 gnomemusic/widgets/songwidget.py         |  4 ++--
 10 files changed, 25 insertions(+), 24 deletions(-)
---
diff --git a/gnomemusic/__init__.py b/gnomemusic/__init__.py
index 3278b5e7..452bfdbd 100644
--- a/gnomemusic/__init__.py
+++ b/gnomemusic/__init__.py
@@ -84,8 +84,9 @@ class TrackerWrapper:
                 self.tracker = Tracker.SparqlConnection.get(None)
             except Exception as e:
                 from sys import exit
-                logger.error("Cannot connect to tracker, error '%s'\Exiting",
-                             str(e))
+                logger.error(
+                    "Cannot connect to tracker, error {}\nExiting".format(
+                        str(e)))
                 exit(1)
 
         def __str__(self):
diff --git a/gnomemusic/albumartcache.py b/gnomemusic/albumartcache.py
index cbda74c3..27ce2ec4 100644
--- a/gnomemusic/albumartcache.py
+++ b/gnomemusic/albumartcache.py
@@ -651,8 +651,8 @@ class RemoteArt(GObject.GObject):
         # FIXME: Passing the iostream here, otherwise it gets
         # closed. PyGI specific issue?
         ostream.splice_async(
-            istream, Gio.OutputStreamSpliceFlags.CLOSE_SOURCE |
-            Gio.OutputStreamSpliceFlags.CLOSE_TARGET, GLib.PRIORITY_LOW,
+            istream, Gio.OutputStreamSpliceFlags.CLOSE_SOURCE
+            | Gio.OutputStreamSpliceFlags.CLOSE_TARGET, GLib.PRIORITY_LOW,
             None, self._splice_callback, [tmp_file, iostream])
 
     @log
diff --git a/gnomemusic/player.py b/gnomemusic/player.py
index 6e81b8a2..e4760e67 100644
--- a/gnomemusic/player.py
+++ b/gnomemusic/player.py
@@ -521,8 +521,8 @@ class Player(GObject.GObject):
         self._playlist.connect('song-validated', self._on_song_validated)
         self._playlist.bind_property(
             'repeat-mode', self, 'repeat-mode',
-            GObject.BindingFlags.SYNC_CREATE |
-            GObject.BindingFlags.BIDIRECTIONAL)
+            GObject.BindingFlags.SYNC_CREATE
+            | GObject.BindingFlags.BIDIRECTIONAL)
 
         self._new_clock = True
 
diff --git a/gnomemusic/widgets/albumcover.py b/gnomemusic/widgets/albumcover.py
index e78e2694..f76ecb65 100644
--- a/gnomemusic/widgets/albumcover.py
+++ b/gnomemusic/widgets/albumcover.py
@@ -82,8 +82,8 @@ class AlbumCover(Gtk.FlowBoxChild):
 
         self.bind_property(
             'selected', self._check, 'active',
-            GObject.BindingFlags.BIDIRECTIONAL |
-            GObject.BindingFlags.SYNC_CREATE)
+            GObject.BindingFlags.BIDIRECTIONAL
+            | GObject.BindingFlags.SYNC_CREATE)
         self.bind_property(
             'selection-mode', self._check, 'visible',
             GObject.BindingFlags.BIDIRECTIONAL)
diff --git a/gnomemusic/widgets/albumwidget.py b/gnomemusic/widgets/albumwidget.py
index c924b670..ecdc2c93 100644
--- a/gnomemusic/widgets/albumwidget.py
+++ b/gnomemusic/widgets/albumwidget.py
@@ -87,8 +87,8 @@ class AlbumWidget(Gtk.EventBox):
 
         self.bind_property(
             'selection-mode', self._parent_view, 'selection-mode',
-            GObject.BindingFlags.BIDIRECTIONAL |
-            GObject.BindingFlags.SYNC_CREATE)
+            GObject.BindingFlags.BIDIRECTIONAL
+            | GObject.BindingFlags.SYNC_CREATE)
 
         self.bind_property(
             'selected-items-count', self._parent_view, 'selected-items-count')
diff --git a/gnomemusic/widgets/artistalbumswidget.py b/gnomemusic/widgets/artistalbumswidget.py
index 02445b34..b9150d71 100644
--- a/gnomemusic/widgets/artistalbumswidget.py
+++ b/gnomemusic/widgets/artistalbumswidget.py
@@ -128,8 +128,8 @@ class ArtistAlbumsWidget(Gtk.Box):
 
         self.bind_property(
             'selection-mode', widget, 'selection-mode',
-            GObject.BindingFlags.BIDIRECTIONAL |
-            GObject.BindingFlags.SYNC_CREATE)
+            GObject.BindingFlags.BIDIRECTIONAL
+            | GObject.BindingFlags.SYNC_CREATE)
 
         self._album_box.pack_start(widget, False, False, 0)
         self._widgets.append(widget)
diff --git a/gnomemusic/widgets/artistalbumwidget.py b/gnomemusic/widgets/artistalbumwidget.py
index 2aa59fde..8d8fda88 100644
--- a/gnomemusic/widgets/artistalbumwidget.py
+++ b/gnomemusic/widgets/artistalbumwidget.py
@@ -79,8 +79,8 @@ class ArtistAlbumWidget(Gtk.Box):
 
         self.bind_property(
             'selection-mode', self._disc_list_box, 'selection-mode',
-            GObject.BindingFlags.BIDIRECTIONAL |
-            GObject.BindingFlags.SYNC_CREATE)
+            GObject.BindingFlags.BIDIRECTIONAL
+            | GObject.BindingFlags.SYNC_CREATE)
 
         self._title.props.label = self._album_title
         year = utils.get_media_year(self._media)
diff --git a/gnomemusic/widgets/disclistboxwidget.py b/gnomemusic/widgets/disclistboxwidget.py
index d839eae2..b6a8ff46 100644
--- a/gnomemusic/widgets/disclistboxwidget.py
+++ b/gnomemusic/widgets/disclistboxwidget.py
@@ -306,8 +306,8 @@ class DiscListBox(Gtk.Box):
 
         self.bind_property(
             'selection-mode', widget, 'selection-mode',
-            GObject.BindingFlags.BIDIRECTIONAL |
-            GObject.BindingFlags.SYNC_CREATE)
+            GObject.BindingFlags.BIDIRECTIONAL
+            | GObject.BindingFlags.SYNC_CREATE)
         self.bind_property(
             'selection-mode-allowed', widget, 'selection-mode-allowed',
             GObject.BindingFlags.SYNC_CREATE)
diff --git a/gnomemusic/widgets/headerbar.py b/gnomemusic/widgets/headerbar.py
index 5db06299..3b362982 100644
--- a/gnomemusic/widgets/headerbar.py
+++ b/gnomemusic/widgets/headerbar.py
@@ -122,8 +122,8 @@ class HeaderBar(Gtk.HeaderBar):
 
         self.bind_property(
             "selection-mode", self, "show-close-button",
-            GObject.BindingFlags.INVERT_BOOLEAN |
-            GObject.BindingFlags.SYNC_CREATE)
+            GObject.BindingFlags.INVERT_BOOLEAN
+            | GObject.BindingFlags.SYNC_CREATE)
         self.bind_property(
             "selection-mode", self._cancel_button, "visible")
         self.bind_property(
@@ -134,15 +134,15 @@ class HeaderBar(Gtk.HeaderBar):
             GObject.BindingFlags.BIDIRECTIONAL)
         self.bind_property(
             "stack", self._stack_switcher, "stack",
-            GObject.BindingFlags.BIDIRECTIONAL |
-            GObject.BindingFlags.SYNC_CREATE)
+            GObject.BindingFlags.BIDIRECTIONAL
+            | GObject.BindingFlags.SYNC_CREATE)
         self.bind_property(
             "selected-items-count", self._selection_menu,
             "selected-items-count")
         self.bind_property(
             "search-mode-enabled", self._search_button, "active",
-            GObject.BindingFlags.BIDIRECTIONAL |
-            GObject.BindingFlags.SYNC_CREATE)
+            GObject.BindingFlags.BIDIRECTIONAL
+            | GObject.BindingFlags.SYNC_CREATE)
 
         self.connect(
             "notify::selection-mode-allowed",
diff --git a/gnomemusic/widgets/songwidget.py b/gnomemusic/widgets/songwidget.py
index 75bcaaa7..4322f8a8 100644
--- a/gnomemusic/widgets/songwidget.py
+++ b/gnomemusic/widgets/songwidget.py
@@ -111,8 +111,8 @@ class SongWidget(Gtk.EventBox):
 
         self.bind_property(
             'selected', self._select_button, 'active',
-            GObject.BindingFlags.BIDIRECTIONAL |
-            GObject.BindingFlags.SYNC_CREATE)
+            GObject.BindingFlags.BIDIRECTIONAL
+            | GObject.BindingFlags.SYNC_CREATE)
         self.bind_property(
             'show-duration', self._duration_label, 'visible',
             GObject.BindingFlags.SYNC_CREATE)


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