Bug 23791

Summary: Connection introspection with GetInterfaces does not work
Product: Telepathy Reporter: Alban Crequy <alban.crequy>
Component: tp-pythonAssignee: Telepathy bugs list <telepathy-bugs>
Status: RESOLVED NOTABUG QA Contact: Telepathy bugs list <telepathy-bugs>
Severity: normal    
Priority: medium CC: pablo
Version: unspecified   
Hardware: Other   
OS: All   
Whiteboard:
i915 platform: i915 features:

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.