guelfey / go.dbus

Native Go bindings for D-Bus
BSD 2-Clause "Simplified" License
124 stars 35 forks source link

The server.go example is not properly introspectable #27

Open ijanos opened 11 years ago

ijanos commented 11 years ago

The Introspect method is only implemented on the /com/github/guelfey/Demo path so

dbus-send --session --print-reply --dest="com.github.guelfey.Demo" /com/github/guelfey/Demo org.freedesktop.DBus.Introspectable.Introspect

Returns the right xml while the following does not:

dbus-send --session --print-reply --dest="com.github.guelfey.Demo" / org.freedesktop.DBus.Introspectable.Introspect

The right output would be this:

<node>
   <node name="com"/>
</node>

calling /com should return the github node and so on.

I think there is no tool in the introspect package to generate these.

guelfey commented 11 years ago

The example is supposed to be just this - a simple, minimalist example. You're right, though, in that there should be something to make this easier for real cases. I'll leave this open as a reminder.

hdonnay commented 11 years ago

could someone describe what the correct solution is?

is it to create the whole path as Nodes under a root Node?

ijanos commented 11 years ago

I did this: https://gist.github.com/ijanos/7099420

Now dbus introspect tools don't throw errors about non-existent objects.

snyh commented 11 years ago

you can check this pull request https://github.com/guelfey/go.dbus/pull/34
It will support d-feet perfectly. And is good at this moment.

this commit will handle this problem https://github.com/snyh/go.dbus/commit/a1afa9625a84767e29ad980adde858e3714e0d1e

rrerolle commented 10 years ago

Hello, based on @snyh's work, I created a pull request that addresses simply the introspection of "sub-paths" of exported objects. You can look it up here: #53, please let me know what you think.

There are other interesting things in @snyh's pull request, such as helpers to automatically generate properties/signals introspection data, the same way the Methods helper does. I think these would be nice things to have, but this is another matter.