Bug 26044 - telpathy-python: Interface generator should allow not to add interface
Summary: telpathy-python: Interface generator should allow not to add interface
Status: RESOLVED NOTABUG
Alias: None
Product: Telepathy
Classification: Unclassified
Component: tp-python (show other bugs)
Version: git master
Hardware: Other All
: medium normal
Assignee: Telepathy bugs list
QA Contact: Telepathy bugs list
URL:
Whiteboard:
Keywords: NEEDINFO
Depends on:
Blocks:
 
Reported: 2010-01-14 08:37 UTC by Nicolas Dufresne
Modified: 2010-10-05 13:25 UTC (History)
2 users (show)

See Also:
i915 platform:
i915 features:


Attachments

Description Nicolas Dufresne 2010-01-14 08:37:05 UTC
The generator should give the option not to automatically add the interface to Connection _interfaces set. This way we could implement feature but enable them when we know that it's supported (right before we reach CONNECTED state). See MailNotification in butterfly for a example use-case.
Comment 1 Jonny Lamb 2010-04-16 15:13:31 UTC
You could just not call ConnectionInterfaceMailNotification.__init__ until you do indeed want the interface to be added? Python is fine with this, unlike other languages. Thoughts?
Comment 2 Nicolas Dufresne 2010-04-19 07:13:10 UTC
I guess it could work. It's just very odd in object oriented language to use a constructor like this.

Also I don't know what will happen with dbus.service.Interface constructor. Other CM do implement interfaces and add/remove the interface name from the list of interfaces contained in Connection object. I thought it was better to avoid doing it differently in Butterfly.
Comment 3 Nicolas Dufresne 2010-10-05 13:00:40 UTC
Please have a look at mail_notification.py line 69. If you do or not feel annoyed by this patch, please comment. If nobody feels annoyed, we will just remove the fixme and close this bug.
Comment 4 Nicolas Dufresne 2010-10-05 13:25:16 UTC
Ok, after *long* discussing with lfrb on IRC, we should just drop the FIXME. The code has no known issue, so why should be care :)


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.