... | ... | @@ -42,16 +42,23 @@ iface.EnumerateDevices() |
|
|
This is how you call the same method using `gdbus`:
|
|
|
|
|
|
``` bash
|
|
|
gdbus call --system --dest org.freedesktop.UPower --object-path /org/freedesktop/UPower --method org.freedesktop.DBus.Introspectable.Introspect
|
|
|
gdbus call --system --dest org.freedesktop.UPower --object-path /org/freedesktop/UPower --method org.freedesktop.UPower.EnumerateDevices
|
|
|
```
|
|
|
|
|
|
You can also introspect with `gdbus` using a method call instead of the `introspect` command:
|
|
|
``` bash
|
|
|
gdbus call --system --dest
|
|
|
gdbus call --system --dest org.freedesktop.UPower --object-path /org/freedesktop/UPower --method org.freedesktop.DBus.Introspectable.Introspect
|
|
|
```
|
|
|
|
|
|
## Using Gio
|
|
|
|
|
|
``` python
|
|
|
from gi.repository import Gio
|
|
|
|
|
|
bus = Gio.bus_get_sync(Gio.BusType.SYSTEM, None)
|
|
|
proxy = Gio.DBusProxy.new_sync(bus, Gio.DBusProxyFlags.NONE, None, 'org.freedesktop.UPower', '/org/freedesktop/UPower', 'org.freedesktop.DBus.Introspectable', None)
|
|
|
res = proxy.call_sync('Introspect', None, Gio.DBusCallFlags.NO_AUTO_START, 500, None)
|
|
|
```
|
|
|
|
|
|
## References
|
|
|
|
... | ... | |