Add get/set proxyinfo methods to Account class
[python-purple] / account.pyx
index 503a87c..5a9ecf7 100644 (file)
 #  along with this program.  If not, see <http://www.gnu.org/licenses/>.
 #
 
 #  along with this program.  If not, see <http://www.gnu.org/licenses/>.
 #
 
-cimport glib
-
-cimport account
-cimport blist
-cimport savedstatuses
-cimport status
+cimport purple
+cimport proxy
 
 cdef class Account:
     """ Account class """
 
 cdef class Account:
     """ Account class """
@@ -63,3 +59,16 @@ cdef class Account:
                 buddies += [buddy.name]
             iter = iter.next
         return buddies
                 buddies += [buddy.name]
             iter = iter.next
         return buddies
+
+    def get_proxyinfo(self):
+        cdef proxy.PurpleProxyInfo *c_proxyinfo
+        c_proxyinfo = account.c_purple_account_get_proxy_info(self.__account)
+        if c_proxyinfo == NULL:
+            return None
+        cdef ProxyInfo proxyinfo
+        proxyinfo = proxy.ProxyInfo()
+        proxyinfo.c_proxyinfo = c_proxyinfo
+        return proxyinfo
+
+    def set_proxyinfo(self, ProxyInfo proxyinf):
+        account.c_purple_account_set_proxy_info(self.__account, proxyinf.c_proxyinfo)