Python / C++ application D-Bus usage issues

Krzysztof Konopko krzysztof.konopko at youview.com
Mon Dec 17 03:15:59 PST 2012


On 17/12/12 01:32, Kip Warner wrote:
> On Sat, 2012-12-15 at 16:05 +0000, Krzysztof Konopko wrote:
>> Hi Kip,
>>
>> Python bindings seem to use org.freedesktop.DBus.Introspectable
>> interface to learn about a DBus service to provide relevant bindings on
>> the run time. If you want your service to interact with Python
>> applications properly, you need to implement
>> org.freedesktop.DBus.Introspectable interface and write an XML
>> specification of your service. IMO this is a good idea anyway as you
>> might want to use some other tools like d-feet.
>>
>> See more here:
>> http://dbus.freedesktop.org/doc/dbus-specification.html#standard-interfaces-introspectable
>>
>> I'm not an expert so in order to answer any detailed questions I'd have
>> to read the relevant documentation which I believe your can also do
>> yourself.
>>
>> HTH,
>> Kris
> 
> Hey Kris. Thanks a lot. I think this might be overkill though, no? All I
> want to do is send simple signals between the C++ and the Python
> application, without complex method invocation, introspection, and such.
> Is this not possible?
> 

Hi Kip,

Indeed, it's an overkill *in your situation*. My remark is useful in
general if you want your service to work nicely with Python applications.

As Thiago & others try to explain, in your specific case when you just
need to send a signal from Python, you don't need that all proxy stuff.
All you need is to be left in your code is:

message = SignalMessage(DBUS_OBJECT_PATH, DBUS_INTERFACE, "Ready")
self._sessionBus.send_message(message)
self._sessionBus.flush()

Simply delete the bit from your Python code that creates the proxy. You
don't even seem to use it anywhere. If you will use it in the future,
then implement Introspectable interface but from what you're saying so
far that's not the plan.

Kris


More information about the dbus mailing list