Bug 26044

Summary: telpathy-python: Interface generator should allow not to add interface
Product: Telepathy Reporter: Nicolas Dufresne <nicolas>
Component: tp-pythonAssignee: Telepathy bugs list <telepathy-bugs>
Status: RESOLVED NOTABUG QA Contact: Telepathy bugs list <telepathy-bugs>
Severity: normal    
Priority: medium CC: nicolas, olivier
Version: git masterKeywords: NEEDINFO
Hardware: Other   
OS: All   
Whiteboard:
i915 platform: i915 features:

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.