[Telepathy] A telepathy-python newbie question

Danielle Madeley danielle.madeley at collabora.co.uk
Sun Jan 17 17:40:57 PST 2010


On Sun, 2010-01-17 at 16:00 -0800, Anand CVR wrote:
> Question: Is cm an array or just one ConnectionManager object? The
> syntax cm[CONNECTION_MANAGER] seems to suggest that it is an array.
> But the GetManager() method seems to return just a ConnectionManager
> object.

cm is an object, but since D-Bus objects implement multiple interfaces
we use the dictionary-style, getattr syntax to be able to specify which
D-Bus interface we are making the method call on (this syntax is also
used in Python for dictionary keys, which is a little more synonymous
with what's going on here).

This probably could be explain a little better in the book (it currently
gets one sentence):
http://people.collabora.co.uk/~danni/telepathy-book/sect.basics.language-bindings.html#sect.basics.dbus.language-bindings.python

Basically, whatever interface a method, or signal comes from, you pass
that as the key to the object.

Hope this clears things up.

--d

-- 
Danielle Madeley
Software Developer, Collabora Ltd.                  Melbourne, Australia

www.collabora.co.uk



More information about the telepathy mailing list