Adding new function protocols_get_all() to Purple class
authorRagner Magalhaes <ragner.magalhaes@openbossa.org>
Tue, 2 Dec 2008 21:12:01 +0000 (21:12 +0000)
committerAnderson Briglia <anderson.briglia@openbossa.org>
Sat, 28 Feb 2009 21:11:18 +0000 (17:11 -0400)
Adding new function protocols_get_all to return a list of protocols

Signed-off-by: Ragner Magalhaes <ragner.magalhaes@indt.org.br>
Acked-by: Bruno Abinader <bruno.abinader@indt.org.br>
Acked-by: Ricardo Guimaraes <ricardo.guimaraes@indt.org.br>

git-svn-id: https://garage.maemo.org/svn/carman/branches/carman-0.7-beta2/python-purple@1422 596f6dd7-e928-0410-a184-9e12fd12cf7e

purple.pyx

index 88c86ad..26a972f 100644 (file)
@@ -336,6 +336,19 @@ cdef class Purple:
 
         return account_list
 
 
         return account_list
 
+    def protocols_get_all(self):
+        cdef glib.GList *iter
+        cdef plugin.PurplePlugin *pp
+
+        iter = plugin.c_purple_plugins_get_protocols()
+        protocol_list = []
+        while iter:
+            pp = <plugin.PurplePlugin*> iter.data
+            if pp.info and pp.info.name:
+                protocol_list.append[Protocol(pp.info.id)]
+            iter = iter.next
+        return protocol_list
+
 include "protocol.pyx"
 #include "plugin.pyx"
 include "proxy.pyx"
 include "protocol.pyx"
 #include "plugin.pyx"
 include "proxy.pyx"