Bug 23791 - Connection introspection with GetInterfaces does not work
Summary: Connection introspection with GetInterfaces does not work
Status: RESOLVED NOTABUG
Alias: None
Product: Telepathy
Classification: Unclassified
Component: tp-python (show other bugs)
Version: unspecified
Hardware: Other All
: medium normal
Assignee: Telepathy bugs list
QA Contact: Telepathy bugs list
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-09-08 03:18 UTC by Alban Crequy
Modified: 2010-04-16 15:08 UTC (History)
1 user (show)

See Also:
i915 platform:
i915 features:


Attachments

Description Alban Crequy 2009-09-08 03:18:27 UTC
In my Rhythmbox plugin, I use this code:

http://git.collabora.co.uk/?p=user/alban/rhythmbox-plugin-telepathy.git;a=blob;f=rb-tp-export/__init__.py;h=15d93127d5e5ca64bf8597b3c2b646f6e55cff98;hb=HEAD#l138

  conn = Connection(service_name, path, self.bus)

  # FIXME: I don't understand why _valid_interfaces is not correctly
  # updated after GetInterfaces is called in the constructor
  conn._valid_interfaces.add(CONNECTION_INTERFACE_REQUESTS)

  channel = conn.create_channel(...

Modifying "_valid_interfaces" manually should not be needed. I check with dbus-monitor, and GetInterfaces is called successfully and returns the right interfaces (including the "requests" interface). But then _valid_interfaces does not contain it, so create_channel does not work.

As a workaround, I add the requests interface manually, but there is a bug somewhere.
Comment 1 Guillaume Desmottes 2009-09-08 03:22:13 UTC
Are you waiting that the Connection object is ready?
You can do that by passing a ready_handler to the constructor or call conn.call_when_ready().
Comment 2 Jonny Lamb 2010-04-16 15:08:36 UTC
(In reply to comment #1)
> Are you waiting that the Connection object is ready?

He's not.


Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.