[gnome-music/wip/mschraal/pep8fixes] PEP-8 fixes
- From: Marinus Schraal <mschraal src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-music/wip/mschraal/pep8fixes] PEP-8 fixes
- Date: Fri, 15 Dec 2017 16:39:23 +0000 (UTC)
commit 9fd483fa7f94d043b57497d066c6fea5ee3cd541
Author: Florian Darfeuille <florian darfeuille outlook com>
Date: Mon Dec 11 14:48:00 2017 +0000
PEP-8 fixes
Fixes warnings for E111, E201, E202, E203, E302, E711, E712.
https://bugzilla.gnome.org/show_bug.cgi?id=791481
gnomemusic/player.py | 2 +-
gnomemusic/query.py | 5 +++--
gnomemusic/views/baseview.py | 4 ++--
gnomemusic/views/songsview.py | 2 +-
gnomemusic/widgets/disclistboxwidget.py | 2 +-
gnomemusic/window.py | 2 +-
6 files changed, 9 insertions(+), 8 deletions(-)
---
diff --git a/gnomemusic/player.py b/gnomemusic/player.py
index eabb283..8ce9153 100644
--- a/gnomemusic/player.py
+++ b/gnomemusic/player.py
@@ -894,7 +894,7 @@ class Player(GObject.GObject):
timing from the user, for updating the songPlaybackTimeLabel.
"""
# Don't run until progressScale has been realized
- if self.progressScale.get_realized() == False:
+ if self.progressScale.get_realized() is False:
return
# Update self.timeout
diff --git a/gnomemusic/query.py b/gnomemusic/query.py
index 95f26b0..e70cfa7 100644
--- a/gnomemusic/query.py
+++ b/gnomemusic/query.py
@@ -37,6 +37,7 @@ sparql_midnight_dateTime_format = "%Y-%m-%dT00:00:00Z"
SECONDS_PER_DAY = 86400
PUNCTUATION_FILTER = " !\\\"#$%&'()*+,-./:;<=>?@[\\\\]^_`{|}~"
+
class Query():
music_folder = None
@@ -72,7 +73,7 @@ class Query():
:return: The sparql order by statement
:rtype: str
"""
- return """tracker:title-order(%(attr)s)""" % { 'attr': attr };
+ return """tracker:title-order(%(attr)s)""" % {'attr': attr};
@staticmethod
def all_albums():
@@ -988,7 +989,7 @@ class Query():
FILTER ( tracker:id(?urn) = "%(media_id)s" )
}
""".replace('\n', '').strip() % {
- 'media_id' : media_id
+ 'media_id': media_id
}
return query
diff --git a/gnomemusic/views/baseview.py b/gnomemusic/views/baseview.py
index 3dd344e..2052575 100644
--- a/gnomemusic/views/baseview.py
+++ b/gnomemusic/views/baseview.py
@@ -270,10 +270,10 @@ class BaseView(Gtk.Stack):
def _set_selection(self, value, parent=None):
count = 0
itr = self.model.iter_children(parent)
- while itr != None:
+ while itr is not None:
if self.model.iter_has_child(itr):
count += self._set_selection(value, itr)
- if self.model[itr][5] != None:
+ if self.model[itr][5] is not None:
self.model[itr][6] = value
count += 1
itr = self.model.iter_next(itr)
diff --git a/gnomemusic/views/songsview.py b/gnomemusic/views/songsview.py
index c1b8c3c..9a2b5ab 100644
--- a/gnomemusic/views/songsview.py
+++ b/gnomemusic/views/songsview.py
@@ -90,7 +90,7 @@ class SongsView(BaseView):
try:
itr = self.model.get_iter(path)
- except ValueError as err :
+ except ValueError as err:
logger.warn("Error: {}, {}".format(err.__class__, err))
return
diff --git a/gnomemusic/widgets/disclistboxwidget.py b/gnomemusic/widgets/disclistboxwidget.py
index 328d206..91761c5 100644
--- a/gnomemusic/widgets/disclistboxwidget.py
+++ b/gnomemusic/widgets/disclistboxwidget.py
@@ -381,7 +381,7 @@ class DiscBox(Gtk.Box):
def _toggle_widget_selection(self, child):
song_widget = child.get_child()
song_widget.check_button.set_visible(self._selection_mode)
- if self._selection_mode == False:
+ if self._selection_mode is False:
if song_widget.check_button.get_active():
song_widget.check_button.set_active(False)
diff --git a/gnomemusic/window.py b/gnomemusic/window.py
index f2a474d..87c8233 100644
--- a/gnomemusic/window.py
+++ b/gnomemusic/window.py
@@ -409,7 +409,7 @@ class Window(Gtk.ApplicationWindow):
# Play / Pause on Ctrl + SPACE
if (event.keyval == Gdk.KEY_space
and event_and_modifiers == Gdk.ModifierType.CONTROL_MASK):
- self.player.play_pause()
+ self.player.play_pause()
# Play previous on Ctrl + B
if (event.keyval == Gdk.KEY_b
and event_and_modifiers == Gdk.ModifierType.CONTROL_MASK):
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]