3
0
mirror of https://git.kernel.org/pub/scm/network/wireless/iwd.git synced 2024-10-04 02:18:49 +02:00

auto-t: allow IWDDBusAbstract to work with any service

This is somewhat of a hack, but the IWDDBusAbstract is a very
convenient abstraction to DBus objects. The only piece that restricts
it to IWD is the hardcoded IWD_SERVICE. Instead we can pass in a
keyword argument which defaults to IWD_SERVICE. That way other modules
(like EAD) can utilize this abstraction with their own service simply
by changing that service argument.
This commit is contained in:
James Prestwood 2020-09-17 14:32:44 -07:00 committed by Denis Kenzior
parent 4cc067e58e
commit ab51228b38

View File

@ -120,9 +120,9 @@ class IWDDBusAbstract(AsyncOpAbstract):
_bus = dbus.SystemBus() _bus = dbus.SystemBus()
def __init__(self, object_path = None, properties = None): def __init__(self, object_path = None, properties = None, service=IWD_SERVICE):
self._object_path = object_path self._object_path = object_path
proxy = self._bus.get_object(IWD_SERVICE, self._object_path) proxy = self._bus.get_object(service, self._object_path)
self._iface = dbus.Interface(proxy, self._iface_name) self._iface = dbus.Interface(proxy, self._iface_name)
self._prop_proxy = dbus.Interface(proxy, DBUS_PROPERTIES) self._prop_proxy = dbus.Interface(proxy, DBUS_PROPERTIES)