2

I'm trying to write a D-Bus service. But I'm confused about the python packages pygobject and dbus-python.

Is it possible to write a D-Bus service with pygobject alone (without using dbus-python)? My understanding was that pygobject provides everything that dbus-python does. Is this correct? Or do I need dbus-python?

I succeeded in calling methods of other programs via D-Bus by just using pygobject. But how do I provide my own interface and own methods as a service in D-Bus? As far as I understand I have to inherit my interface class from Gio.DBusInterfaceSkeleton[1]. But how do I export my own methods?

[1] https://lazka.github.io/pgi-docs/Gio-2.0/classes/DBusInterfaceSkeleton.html

Philip Withnall
  • 5,293
  • 14
  • 28

1 Answers1

0

It's not currently possible to write D-Bus services in pygobject because stable versions of gobject-introspection don't seem to properly detect all of the virtual methods, in particular the get_vtable method. You'll notice that do_get_vtable is missing from the generated API docs. I tried building gobject-introspection 1.59.4, and it is able to extract proper typelib information from glib 2.58.1, so perhaps there is hope for the future.

Philip Withnall
  • 5,293
  • 14
  • 28
Peter S. Housel
  • 2,651
  • 1
  • 22
  • 25