A few begninner's questions

John (J5) Palmieri johnp at redhat.com
Thu Jun 2 10:25:43 PDT 2005


On Wed, 2005-06-01 at 11:51 +0200, Søren Hansen wrote:
> ons, 01 06 2005 kl. 11:34 +0300, skrev Kalle Vahlman: 
> > > signal interface=org.gnome.evolution.mail.dbus.Signal;
> > > member=MessageReading; sender=:1.31
> > > string:INBOX
> > > 
> > > Now, my first question is this: The sender of ":1.31"... Is that the
> > > expected format of a sender field?
> > Yes, that is an unique identifier for an app connecting to the bus.
> > You don't need to know or care about that, though.
> 
> Well, you see, that's the problem, actually.
> 
> > What's your next question ?-)
> 
> The Python bindings need to be changed. When I use add_signal_receiver,
> I have to specify the sender. Yes, I know I can just set it to None, but
> then it wont match in _signal_func.. When _signal_func receives a
> signal, it generates a string from it:
> "type='signal',interface='com.something.interface',sender=':1.31',path='blah..."

Hehe, yes the old python bindings are busted in this respect.  I just
checked in some changes a week ago where you can specify as little or as
much of these attributes as you want (the ones not specified become wild
cards).  connect_to_signal will do the full attributes thing and
requires that the service you are connecting to be running so it may or
may not be what you need. add_signal_receiver is perfectly sane API to
be using.

> It then uses that string to find a matching function in a dictionary.
> And of course there is no such string, because when I set up my
> listener, I don't know the sender. For all I know, the sender doesn't
> even exist yet. 

There is nothing you can do about this in the old bindings I believe.
You must use the ones from CVS.

> I've only just started learning python a this Monday, so I'm not the one
> who should be refactoring this stuff. :-)

It is all refactored but if there is anything else you want to see in
the bindings let me know.  I am making a push to get all the TODO items
done and then finish off then Python bindings so we can get to 1.0.

-- 
John (J5) Palmieri
Associate Software Engineer
Desktop Group
Red Hat, Inc.
Blog: http://martianrock.com



More information about the dbus mailing list