Handy To Have Argument Names In The Introspection

Lawrence D'Oliveiro <ldo-kC51rjc0cqs1dNLGKZg6taU/[email protected]>
Newsgroups gmane.comp.freedesktop.dbus
Organization Geek Central
Message-ID <[email protected]>
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?
_______________________________________________
dbus mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dbus
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.