[totem] dbusservice: pylintify the code



commit 6a48e159e5eac79c5c44401cee4b8933e0d1ea60
Author: Philip Withnall <philip tecnocode co uk>
Date:   Tue Oct 1 01:22:54 2013 +0100

    dbusservice: pylintify the code
    
    Shut up, pylint.
    
    Helps: https://bugzilla.gnome.org/show_bug.cgi?id=708275

 src/plugins/dbusservice/dbusservice.py |   45 ++++++++++++++++---------------
 1 files changed, 23 insertions(+), 22 deletions(-)
---
diff --git a/src/plugins/dbusservice/dbusservice.py b/src/plugins/dbusservice/dbusservice.py
index e35a895..ec7a547 100644
--- a/src/plugins/dbusservice/dbusservice.py
+++ b/src/plugins/dbusservice/dbusservice.py
@@ -116,7 +116,7 @@ class Root (dbus.service.Object): # pylint: disable-msg=R0923,R0904
 
         return metadata
 
-    def __do_update_metadata (self, totem, artist, # pylint: disable-msg=R0913
+    def __do_update_metadata (self, _, artist, # pylint: disable-msg=R0913
                               title, album, num):
         self.current_metadata = self.null_metadata.copy ()
         if title:
@@ -131,11 +131,11 @@ class Root (dbus.service.Object): # pylint: disable-msg=R0923,R0904
         self.PropertiesChanged ('org.mpris.MediaPlayer2.Player',
             { 'Metadata': self.__calculate_metadata () }, [])
 
-    def __do_notify_playing (self, totem, prop):
+    def __do_notify_playing (self, _, prop): # pylint: disable-msg=W0613
         self.PropertiesChanged ('org.mpris.MediaPlayer2.Player',
             { 'PlaybackStatus': self.__calculate_playback_status () }, [])
 
-    def __do_notify_current_mrl (self, totem, prop):
+    def __do_notify_current_mrl (self, _, prop): # pylint: disable-msg=W0613
         self.PropertiesChanged ('org.mpris.MediaPlayer2.Player', {
             'CanPlay': (self.totem.props.current_mrl != None),
             'CanPause': (self.totem.props.current_mrl != None),
@@ -143,13 +143,13 @@ class Root (dbus.service.Object): # pylint: disable-msg=R0923,R0904
                         self.totem.props.seekable),
         }, [])
 
-    def __do_notify_seekable (self, totem, prop):
+    def __do_notify_seekable (self, _, prop): # pylint: disable-msg=W0613
         self.PropertiesChanged ('org.mpris.MediaPlayer2.Player', {
             'CanSeek': (self.totem.props.current_mrl != None and
                         self.totem.props.seekable),
         }, [])
 
-    def __do_notify_current_time (self, totem, prop):
+    def __do_notify_current_time (self, totem, _):
         # Only notify of seeks if we've skipped more than 3 seconds
         if abs (totem.props.current_time - self.current_position) > 3:
             self.Seeked (totem.props.current_time * 1000)
@@ -160,13 +160,13 @@ class Root (dbus.service.Object): # pylint: disable-msg=R0923,R0904
     @dbus.service.method (dbus_interface = dbus.PROPERTIES_IFACE,
                           in_signature = 'ss', # pylint: disable-msg=C0103
                           out_signature = 'v')
-    def Get (self, interface_name, property_name):
+    def Get (self, interface_name, property_name): # pylint: disable-msg=C0103
         return self.GetAll (interface_name)[property_name]
 
     @dbus.service.method (dbus_interface = dbus.PROPERTIES_IFACE,
                           in_signature = 's', # pylint: disable-msg=C0103
                           out_signature = 'a{sv}')
-    def GetAll (self, interface_name):
+    def GetAll (self, interface_name): # pylint: disable-msg=C0103
         if interface_name == 'org.mpris.MediaPlayer2':
             return {
                 'CanQuit': True,
@@ -215,7 +215,8 @@ class Root (dbus.service.Object): # pylint: disable-msg=R0923,R0904
 
     @dbus.service.method (dbus_interface = dbus.PROPERTIES_IFACE,
                           in_signature = 'ssv') # pylint: disable-msg=C0103
-    def Set (self, interface_name, property_name, new_value):
+    def Set (self, interface_name, property_name, # pylint: disable-msg=C0103
+             new_value):
         if interface_name == 'org.mpris.MediaPlayer2':
             raise dbus.exceptions.DBusException (
                 'org.mpris.MediaPlayer2.ReadOnlyProperty',
@@ -245,29 +246,29 @@ class Root (dbus.service.Object): # pylint: disable-msg=R0923,R0904
 
     @dbus.service.signal (dbus_interface = dbus.PROPERTIES_IFACE,
                           signature = 'sa{sv}as') # pylint: disable-msg=C0103
-    def PropertiesChanged (self, interface_name, changed_properties,
-                           invalidated_properties):
+    def PropertiesChanged (self, interface_name,  # pylint: disable-msg=C0103
+                           changed_properties, invalidated_properties):
         pass
 
     # org.mpris.MediaPlayer2 interface
     @dbus.service.method (dbus_interface = 'org.mpris.MediaPlayer2',
                           in_signature = '', # pylint: disable-msg=C0103
                           out_signature = '')
-    def Raise (self):
+    def Raise (self): # pylint: disable-msg=C0103
         main_window = self.totem.get_main_window ()
         main_window.present ()
 
     @dbus.service.method (dbus_interface = 'org.mpris.MediaPlayer2',
                           in_signature = '', # pylint: disable-msg=C0103
                           out_signature = '')
-    def Quit (self):
+    def Quit (self): # pylint: disable-msg=C0103
         self.totem.action_exit ()
 
     # org.mpris.MediaPlayer2.Player interface
     @dbus.service.method (dbus_interface = 'org.mpris.MediaPlayer2.Player',
                           in_signature = '', # pylint: disable-msg=C0103
                           out_signature = '')
-    def Next (self):
+    def Next (self): # pylint: disable-msg=C0103
         if self.totem.is_playing () or self.totem.is_paused ():
             return
 
@@ -276,7 +277,7 @@ class Root (dbus.service.Object): # pylint: disable-msg=R0923,R0904
     @dbus.service.method (dbus_interface = 'org.mpris.MediaPlayer2.Player',
                           in_signature = '', # pylint: disable-msg=C0103
                           out_signature = '')
-    def Previous (self):
+    def Previous (self): # pylint: disable-msg=C0103
         if self.totem.is_playing () or self.totem.is_paused ():
             return
 
@@ -285,25 +286,25 @@ class Root (dbus.service.Object): # pylint: disable-msg=R0923,R0904
     @dbus.service.method (dbus_interface = 'org.mpris.MediaPlayer2.Player',
                           in_signature = '', # pylint: disable-msg=C0103
                           out_signature = '')
-    def Pause (self):
+    def Pause (self): # pylint: disable-msg=C0103
         self.totem.action_pause ()
 
     @dbus.service.method (dbus_interface = 'org.mpris.MediaPlayer2.Player',
                           in_signature = '', # pylint: disable-msg=C0103
                           out_signature = '')
-    def PlayPause (self):
+    def PlayPause (self): # pylint: disable-msg=C0103
         self.totem.action_play_pause ()
 
     @dbus.service.method (dbus_interface = 'org.mpris.MediaPlayer2.Player',
                           in_signature = '', # pylint: disable-msg=C0103
                           out_signature = '')
-    def Stop (self):
+    def Stop (self): # pylint: disable-msg=C0103
         self.totem.action_stop ()
 
     @dbus.service.method (dbus_interface = 'org.mpris.MediaPlayer2.Player',
                           in_signature = '', # pylint: disable-msg=C0103
                           out_signature = '')
-    def Play (self):
+    def Play (self): # pylint: disable-msg=C0103
         # If playing or no track loaded: do nothing,
         # else: start playing.
         if self.totem.is_playing () or self.totem.props.current_mrl == None:
@@ -314,13 +315,13 @@ class Root (dbus.service.Object): # pylint: disable-msg=R0923,R0904
     @dbus.service.method (dbus_interface = 'org.mpris.MediaPlayer2.Player',
                           in_signature = 'x', # pylint: disable-msg=C0103
                           out_signature = '')
-    def Seek (self, offset):
+    def Seek (self, offset): # pylint: disable-msg=C0103
         self.totem.action_seek_relative (offset / 1000, False)
 
     @dbus.service.method (dbus_interface = 'org.mpris.MediaPlayer2.Player',
                           in_signature = 'ox', # pylint: disable-msg=C0103
                           out_signature = '')
-    def SetPosition (self, track_id, position):
+    def SetPosition (self, _, position): # pylint: disable-msg=C0103
         position = position / 1000
 
         # Bail if the position is not in the permitted range
@@ -332,10 +333,10 @@ class Root (dbus.service.Object): # pylint: disable-msg=R0923,R0904
     @dbus.service.method (dbus_interface = 'org.mpris.MediaPlayer2.Player',
                           in_signature = 's', # pylint: disable-msg=C0103
                           out_signature = '')
-    def OpenUri (self, uri):
+    def OpenUri (self, uri): # pylint: disable-msg=C0103
         self.totem.add_to_playlist_and_play (uri)
 
     @dbus.service.signal (dbus_interface = 'org.mpris.MediaPlayer2.Player',
                           signature = 'x') # pylint: disable-msg=C0103
-    def Seeked (self, position):
+    def Seeked (self, position): # pylint: disable-msg=C0103
         pass


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