python-dbus-next icon indicating copy to clipboard operation
python-dbus-next copied to clipboard

Consider adding bus.get_interface() shortcut

Open yurac opened this issue 3 years ago • 0 comments

Seems that the following pattern repeats frequently:

  1. Get introspection
  2. Get proxy object
  3. Get interface

Is it possible to have a shortcut for this? Something like:

Class MessageBus:
    async def get_interface(self, name, path, interface):                                                               
        introspection = await self.introspect(name, path)                                                                    
        proxy = bus.get_proxy_object(name, path, introspection)                                                             
        return proxy.get_interface(interface)

Thanks!

yurac avatar Aug 03 '22 10:08 yurac