Patrick Williams | 03514f1 | 2024-04-05 07:04:11 -0500 | [diff] [blame^] | 1 | From 5fe65a35e0e7106347639f0258206fadb451c439 Mon Sep 17 00:00:00 2001 |
| 2 | From: Hiroaki KAWAI <hiroaki.kawai@gmail.com> |
| 3 | Date: Wed, 1 Feb 2017 18:00:33 +0900 |
| 4 | Subject: [PATCH 1/3] make direction attribute conforming to introspect.dtd |
| 5 | |
| 6 | direction attribute defaults to "in" as |
| 7 | in the DTD(*1), direction attribute is defined as following: |
| 8 | |
| 9 | ``` |
| 10 | <!ATTRLIST arg direction (in|out) "in"> |
| 11 | ``` |
| 12 | |
| 13 | *1) http://www.freedesktop.org/standards/dbus/1.0/introspect.dtd |
| 14 | |
| 15 | Adapted from Fedora [https://src.fedoraproject.org/cgit/rpms/python-pydbus.git/] |
| 16 | |
| 17 | Upstream-Status: Inactive-Upstream (Last release 12/18/2016; Last commit 05/6/2018) |
| 18 | |
| 19 | Signed-off-by: Derek Straka <derek@asterius.io> |
| 20 | --- |
| 21 | pydbus/proxy_method.py | 4 ++-- |
| 22 | 1 file changed, 2 insertions(+), 2 deletions(-) |
| 23 | |
| 24 | diff --git a/pydbus/proxy_method.py b/pydbus/proxy_method.py |
| 25 | index 8798edd..3e6e6ee 100644 |
| 26 | --- a/pydbus/proxy_method.py |
| 27 | +++ b/pydbus/proxy_method.py |
| 28 | @@ -33,8 +33,8 @@ class ProxyMethod(object): |
| 29 | self.__name__ = method.attrib["name"] |
| 30 | self.__qualname__ = self._iface_name + "." + self.__name__ |
| 31 | |
| 32 | - self._inargs = [(arg.attrib.get("name", ""), arg.attrib["type"]) for arg in method if arg.tag == "arg" and arg.attrib["direction"] == "in"] |
| 33 | - self._outargs = [arg.attrib["type"] for arg in method if arg.tag == "arg" and arg.attrib["direction"] == "out"] |
| 34 | + self._inargs = [(arg.attrib.get("name", ""), arg.attrib["type"]) for arg in method if arg.tag == "arg" and arg.attrib.get("direction", "in") == "in"] |
| 35 | + self._outargs = [arg.attrib["type"] for arg in method if arg.tag == "arg" and arg.attrib.get("direction", "in") == "out"] |
| 36 | self._sinargs = "(" + "".join(x[1] for x in self._inargs) + ")" |
| 37 | self._soutargs = "(" + "".join(self._outargs) + ")" |
| 38 | |
| 39 | -- |
| 40 | 2.13.5 |