[gnome-music] make pep8 happy



commit 3d912d918844ea4103d471200d233768b4d5b7f1
Author: Vadim Rutkovsky <vrutkovs redhat com>
Date:   Mon Apr 14 11:12:56 2014 +0200

    make pep8 happy

 gnomemusic/player.py    |   16 ++++++++--------
 gnomemusic/searchbar.py |    2 +-
 gnomemusic/view.py      |    6 +++---
 gnomemusic/widgets.py   |   13 ++++++-------
 gnomemusic/window.py    |    4 ++--
 5 files changed, 20 insertions(+), 21 deletions(-)
---
diff --git a/gnomemusic/player.py b/gnomemusic/player.py
index ea07c09..e03f5a7 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:
@@ -648,12 +648,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 400301b..4f06e78 100644
--- a/gnomemusic/view.py
+++ b/gnomemusic/view.py
@@ -235,7 +235,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
@@ -245,7 +245,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:
@@ -337,7 +337,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 836fe97..a013025 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]