[gnome-music/wip/jfelder/mpris-cleanup: 9/26] mpris: PEP-8 fixes on the DBusInterface class
- From: Jean Felder <jfelder src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-music/wip/jfelder/mpris-cleanup: 9/26] mpris: PEP-8 fixes on the DBusInterface class
- Date: Fri, 14 Jun 2019 07:25:37 +0000 (UTC)
commit 54b8c4cbca4cd9ff91e67d69ea5e36c20f57b88a
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 d76f0b88..fae393d5 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]