X-Git-Url: http://git.maemo.org/git/?p=python-purple;a=blobdiff_plain;f=account.pyx;h=36902a770745d675e1d14fedcd53a587ffb3fb22;hp=85d12d6cba196cdb46e36b2251f837309829a8fd;hb=14e5eeb47b8ddc28b1d35fa74126e3cf18ace098;hpb=d1da990adf14944c9f203df523bebaba96b1738d diff --git a/account.pyx b/account.pyx index 85d12d6..36902a7 100644 --- a/account.pyx +++ b/account.pyx @@ -228,8 +228,8 @@ cdef class Account: cdef char *id = NULL cdef char *name = NULL + status_types = [] if self.__exists: - status_types = [] iter = account.purple_account_get_status_types(self._get_structure()) while iter: c_statustype = iter.data @@ -237,9 +237,8 @@ cdef class Account: name = status.purple_status_type_get_name(c_statustype) status_types.append((id, name)) iter = iter.next - return status_types - else: - return None + + return status_types status_types = property(__get_status_types) @@ -552,11 +551,11 @@ cdef class Account: cdef blist.PurpleBuddy *c_buddy = NULL cdef char *c_alias = NULL + buddies_list = [] if self.__exists and \ account.purple_account_is_connected(self._get_structure()): iter = blist.purple_find_buddies(self._get_structure(), NULL) - buddies_list = [] while iter: c_alias = NULL c_buddy = iter.data @@ -573,9 +572,8 @@ cdef class Account: buddies_list.append(new_buddy) iter = iter.next - return buddies_list - else: - return None + + return buddies_list def get_buddies(self): """ @@ -585,10 +583,10 @@ cdef class Account: cdef blist.PurpleBuddy *c_buddy = NULL cdef char *c_alias = NULL + buddies_list = [] if self.__exists: iter = blist.purple_find_buddies(self._get_structure(), NULL) - buddies_list = [] while iter: c_alias = NULL c_buddy = iter.data @@ -602,9 +600,8 @@ cdef class Account: buddies_list.append(new_buddy) iter = iter.next - return buddies_list - else: - return None + + return buddies_list def request_add_buddy(self, buddy_username, buddy_alias): if buddy_alias: