[gnome-music/gnome-3-12] make pep8 happy
- From: Vadim Rutkovsky <vrutkovsky src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-music/gnome-3-12] make pep8 happy
- Date: Mon, 14 Apr 2014 09:24:33 +0000 (UTC)
commit aa0f36d8855f22b4fc661ac3ec8bcdb9fc4f2903
Author: Vadim Rutkovsky <vrutkovs redhat com>
Date: Mon Apr 14 11:12:56 2014 +0200
make pep8 happy
gnomemusic/albumArtCache.py | 4 ++--
gnomemusic/player.py | 16 ++++++++--------
gnomemusic/searchbar.py | 2 +-
gnomemusic/view.py | 6 +++---
gnomemusic/widgets.py | 13 ++++++-------
gnomemusic/window.py | 4 ++--
6 files changed, 22 insertions(+), 23 deletions(-)
---
diff --git a/gnomemusic/albumArtCache.py b/gnomemusic/albumArtCache.py
index 95bc8b5..e98d976 100644
--- a/gnomemusic/albumArtCache.py
+++ b/gnomemusic/albumArtCache.py
@@ -329,7 +329,7 @@ class AlbumArtCache:
def _draw_rounded_path(self, x, y, width, height, radius):
key = "%dx%d %dx%d:%d" % (width, height, x, y, radius)
self.frame_lock.acquire()
- if not key in self.frame_cache:
+ if key not in self.frame_cache:
surface = cairo.ImageSurface(cairo.FORMAT_ARGB32, width, height)
ctx = cairo.Context(surface)
ctx.new_sub_path()
@@ -386,7 +386,7 @@ class AlbumArtCache:
if not uri:
return
- if not uri in self.requested_uris:
+ if uri not in self.requested_uris:
request = GetUriRequest(uri, artist, album, self._on_get_uri_request_finish, data)
self.requested_uris[uri] = request
else:
diff --git a/gnomemusic/player.py b/gnomemusic/player.py
index 57de796..f7352d3 100644
--- a/gnomemusic/player.py
+++ b/gnomemusic/player.py
@@ -148,10 +148,10 @@ class Player(GObject.GObject):
@log
def _on_bus_state_changed(self, bus, message):
- #Note: not all state changes are signaled through here, in particular
- #transitions between Gst.State.READY and Gst.State.NULL are never async
- #and thus don't cause a message
- #In practice, self means only Gst.State.PLAYING and Gst.State.PAUSED are
+ # Note: not all state changes are signaled through here, in particular
+ # transitions between Gst.State.READY and Gst.State.NULL are never async
+ # and thus don't cause a message
+ # In practice, self means only Gst.State.PLAYING and Gst.State.PAUSED are
self._sync_playing()
@log
@@ -190,7 +190,7 @@ class Player(GObject.GObject):
self.currentTrack = None
self.load(self.get_current_media())
else:
- #Stop playback
+ # Stop playback
self.stop()
self.playBtn.set_image(self._playImage)
self.progressScale.set_value(0)
@@ -327,7 +327,7 @@ class Player(GObject.GObject):
@log
def _get_playing(self):
ok, state, pending = self.player.get_state(0)
- #log('get playing(), [ok, state, pending] = [%s, %s, %s]'.format(ok, state, pending))
+ # log('get playing(), [ok, state, pending] = [%s, %s, %s]'.format(ok, state, pending))
if ok == Gst.StateChangeReturn.ASYNC:
return pending == Gst.State.PLAYING
elif ok == Gst.StateChangeReturn.SUCCESS:
@@ -646,12 +646,12 @@ class Player(GObject.GObject):
else:
duration = self.player.query_duration(Gst.Format.TIME)
if duration:
- #Rewind a second back before the track end
+ # Rewind a second back before the track end
self.player.seek_simple(Gst.Format.TIME, Gst.SeekFlags.FLUSH | Gst.SeekFlags.KEY_UNIT,
duration[1] - 1000000000)
self.emit('seeked', (duration[1] - 1000000000) / 1000)
return True
- #MPRIS
+ # MPRIS
@log
def Stop(self):
diff --git a/gnomemusic/searchbar.py b/gnomemusic/searchbar.py
index b369d31..6b55b46 100644
--- a/gnomemusic/searchbar.py
+++ b/gnomemusic/searchbar.py
@@ -1,4 +1,4 @@
-from gi.repository import Gtk, Gd
+from gi.repository import Gtk, Gd, GObject
from gnomemusic import log
import logging
logger = logging.getLogger(__name__)
diff --git a/gnomemusic/view.py b/gnomemusic/view.py
index 26d6320..4c31a51 100644
--- a/gnomemusic/view.py
+++ b/gnomemusic/view.py
@@ -234,7 +234,7 @@ class ViewContainer(Stack):
vScrollbar = self.view.get_vscrollbar()
revealAreaHeight = 32
- #if there's no vscrollbar, or if it's not visible, hide the button
+ # if there's no vscrollbar, or if it's not visible, hide the button
if not vScrollbar or not vScrollbar.get_visible():
self._loadMore.set_block(True)
return
@@ -244,7 +244,7 @@ class ViewContainer(Stack):
page_size = self.vadjustment.get_page_size()
end = False
- #special case self values which happen at construction
+ # special case self values which happen at construction
if (value == 0) and (upper == 1) and (page_size == 1):
end = False
else:
@@ -336,7 +336,7 @@ class ViewContainer(Stack):
callback([])
-#Class for the Empty View
+# Class for the Empty View
class Empty(Stack):
@log
def __init__(self, header_bar, player):
diff --git a/gnomemusic/widgets.py b/gnomemusic/widgets.py
index 7435a64..a1dd04e 100644
--- a/gnomemusic/widgets.py
+++ b/gnomemusic/widgets.py
@@ -33,7 +33,6 @@
from gi.repository import Gtk, Gd, GLib, GObject, Pango
from gi.repository import GdkPixbuf, Gio
-from gi.repository import Grl
from gi.repository import Tracker
from gettext import gettext as _, ngettext
from gnomemusic.grilo import grilo
@@ -161,7 +160,7 @@ class AlbumWidget(Gtk.EventBox):
item = self.model.get_value(self.iterToClean, 5)
title = AlbumArtCache.get_media_title(item)
self.model.set_value(self.iterToClean, 0, title)
- #Hide now playing icon
+ # Hide now playing icon
self.model.set_value(self.iterToClean, 6, False)
self.player.set_playlist('Album', self.album, self.model, _iter, 5)
self.player.set_playing(True)
@@ -342,7 +341,7 @@ class AlbumWidget(Gtk.EventBox):
@log
def update_model(self, player, playlist, currentIter):
- #self is not our playlist, return
+ # self is not our playlist, return
if (playlist != self.model):
return False
currentSong = playlist.get_value(currentIter, 5)
@@ -422,11 +421,11 @@ class ArtistAlbums(Gtk.VBox):
@log
def update_model(self, player, playlist, currentIter):
- #this is not our playlist, return
+ # this is not our playlist, return
if playlist != self.model:
- #TODO, only clean once, but that can wait util we have clean
- #the code a bit, and until the playlist refactoring.
- #the overhead is acceptable for now
+ # TODO, only clean once, but that can wait util we have clean
+ # the code a bit, and until the playlist refactoring.
+ # the overhead is acceptable for now
self.clean_model()
return False
diff --git a/gnomemusic/window.py b/gnomemusic/window.py
index 8ce7933..aea0b4f 100644
--- a/gnomemusic/window.py
+++ b/gnomemusic/window.py
@@ -199,7 +199,7 @@ class Window(Gtk.ApplicationWindow):
count = cursor.get_integer(0)
if count > 0:
self._switch_to_player_view()
- #To revert to the No Music View when no songs are found
+ # To revert to the No Music View when no songs are found
else:
self._switch_to_empty_view()
@@ -317,7 +317,7 @@ class Window(Gtk.ApplicationWindow):
@log
def _on_notify_mode(self, stack, param):
- #Slide out artist list on switching to artists view
+ # Slide out artist list on switching to artists view
if stack.get_visible_child() == self.views[1] or \
stack.get_visible_child() == self.views[3]:
stack.get_visible_child().stack.set_visible_child_name('dummy')
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]