Adding function get_all to Plugin class to return a list of all protocols
Signed-off-by: Ragner Magalhaes <ragner.magalhaes@indt.org.br>
git-svn-id: https://garage.maemo.org/svn/carman/branches/carman-0.7-beta2/python-purple@1372
596f6dd7-e928-0410-a184-
9e12fd12cf7e
def get_id(self):
return self.c_plugin.info.id
+ def get_all(self):
+ ''' @return A string list of protocols' (id, name) '''
+ ''' [('prpl-jabber', 'XMPP'), ('foo', 'MSN'), ...] '''
+ cdef glib.GList *iter
+ cdef plugin.PurplePlugin *pp
+
+ protocols = []
+
+ iter = plugin.c_purple_plugins_get_protocols()
+ while iter:
+ pp = <plugin.PurplePlugin*> iter.data
+ if pp.info and pp.info.name:
+ protocols.append((pp.info.id, pp.info.name))
+ iter = iter.next
+
+ return protocols
cdef class Plugins: