Handy To Have Argument Names In The Introspection
Lawrence D'Oliveiro
ldo at geek-central.gen.nz
Tue May 16 00:00:01 UTC 2017
I recently got this working in DBussy:
ravel.session_bus() \
.get_object("org.freedesktop.Notifications", "/org/freedesktop/Notifications") \
.get_interface("org.freedesktop.Notifications") \
.Notify \
(
app_name = "test",
replaces_id = 0,
app_icon = "dialog-information",
summary = "Hello World!",
body = "D-Bus works",
actions = [],
hints = {},
timeout = 5000,
)
It is handy to have the argument names as a hint to what they mean,
rather than simply writing a long list of opaque-looking argument
values. But this depends on the introspection returning such names:
<node>
<interface name="org.freedesktop.Notifications">
...
<method name="Notify">
<annotation value="QVariantMap" name="com.trolltech.QtDBus.QtTypeName.In6"/>
<arg direction="out" type="u"/>
<arg direction="in" type="s" name="app_name"/>
<arg direction="in" type="u" name="replaces_id"/>
<arg direction="in" type="s" name="app_icon"/>
<arg direction="in" type="s" name="summary"/>
<arg direction="in" type="s" name="body"/>
<arg direction="in" type="as" name="actions"/>
<arg direction="in" type="a{sv}" name="hints"/>
<arg direction="in" type="i" name="timeout"/>
</method>
I would recommend to all those writing services for D-Bus, that they
provide this sort of thing.
Wouldn’t it be nice to have a facility for including actual comments
in the introspection explaining what the interfaces and their methods
and signals actually do?
More information about the dbus
mailing list