[gnome-music/wip/jfelder/mpris-cleanup: 14/32] mpris: PEP-8 fixes on the DBusInterface class



commit 595644a8512b8df24c40204eb3f19cdac4c2a115
Author: Jean Felder <jfelder src gnome org>
Date:   Tue Aug 21 21:12:08 2018 +0200

    mpris: PEP-8 fixes on the DBusInterface class

 gnomemusic/mpris.py | 29 ++++++++++++++---------------
 1 file changed, 14 insertions(+), 15 deletions(-)
---
diff --git a/gnomemusic/mpris.py b/gnomemusic/mpris.py
index f52799c4..38ee5055 100644
--- a/gnomemusic/mpris.py
+++ b/gnomemusic/mpris.py
@@ -46,24 +46,21 @@ class DBusInterface:
         for interface in Gio.DBusNodeInfo.new_for_xml(self.__doc__).interfaces:
 
             for method in interface.methods:
-                method_outargs[method.name] = '(' + ''.join([arg.signature for arg in method.out_args]) + ')'
-                method_inargs[method.name] = tuple(arg.signature for arg in method.in_args)
+                method_outargs[method.name] = '(' + ''.join(
+                    [arg.signature for arg in method.out_args]) + ')'
+                method_inargs[method.name] = tuple(
+                    arg.signature for arg in method.in_args)
 
-            con.register_object(object_path=path,
-                                interface_info=interface,
-                                method_call_closure=self.on_method_call)
+            con.register_object(
+                object_path=path, interface_info=interface,
+                method_call_closure=self.on_method_call)
 
         self.method_inargs = method_inargs
         self.method_outargs = method_outargs
 
-    def on_method_call(self,
-                       connection,
-                       sender,
-                       object_path,
-                       interface_name,
-                       method_name,
-                       parameters,
-                       invocation):
+    def on_method_call(
+        self, connection, sender, object_path, interface_name, method_name,
+            parameters, invocation):
 
         args = list(parameters.unpack())
         for i, sig in enumerate(self.method_inargs[method_name]):
@@ -74,8 +71,10 @@ class DBusInterface:
 
         result = getattr(self, method_name)(*args)
 
-        # out_args is atleast (signature1). We therefore always wrap the result
-        # as a tuple. Refer to https://bugzilla.gnome.org/show_bug.cgi?id=765603
+        # out_args is at least (signature1). We therefore always wrap the
+        # result as a tuple.
+        # Reference:
+        # https://bugzilla.gnome.org/show_bug.cgi?id=765603
         result = (result,)
 
         out_args = self.method_outargs[method_name]


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