mirror of
https://git.kernel.org/pub/scm/network/wireless/iwd.git
synced 2024-12-20 10:52:33 +01: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:
parent
4cc067e58e
commit
ab51228b38
@ -120,9 +120,9 @@ class IWDDBusAbstract(AsyncOpAbstract):
|
||||
|
||||
_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
|
||||
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._prop_proxy = dbus.Interface(proxy, DBUS_PROPERTIES)
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user