Function that returns lists now returning null list instead None type
to prevent "TypeError: 'NoneType' object is not interable" in
"for loop"
Signed-off-by: Ragner Magalhaes <agner.magalhaes@openbossa.org>
Acked-by: Ricardo Guimaraes <ricardo.guimaraes@openbossa.org>
git-svn-id: https://garage.maemo.org/svn/carman/branches/carman-0.7-beta2/python-purple@1701
596f6dd7-e928-0410-a184-
9e12fd12cf7e
cdef char *id = NULL
cdef char *name = NULL
cdef char *id = NULL
cdef char *name = NULL
iter = account.purple_account_get_status_types(self._get_structure())
while iter:
c_statustype = <status.PurpleStatusType *> iter.data
iter = account.purple_account_get_status_types(self._get_structure())
while iter:
c_statustype = <status.PurpleStatusType *> iter.data
name = <char *> status.purple_status_type_get_name(c_statustype)
status_types.append((id, name))
iter = iter.next
name = <char *> status.purple_status_type_get_name(c_statustype)
status_types.append((id, name))
iter = iter.next
- return status_types
- else:
- return None
status_types = property(__get_status_types)
status_types = property(__get_status_types)
cdef blist.PurpleBuddy *c_buddy = NULL
cdef char *c_alias = NULL
cdef blist.PurpleBuddy *c_buddy = NULL
cdef char *c_alias = NULL
if self.__exists and \
account.purple_account_is_connected(self._get_structure()):
iter = blist.purple_find_buddies(self._get_structure(), NULL)
if self.__exists and \
account.purple_account_is_connected(self._get_structure()):
iter = blist.purple_find_buddies(self._get_structure(), NULL)
while iter:
c_alias = NULL
c_buddy = <blist.PurpleBuddy *> iter.data
while iter:
c_alias = NULL
c_buddy = <blist.PurpleBuddy *> iter.data
buddies_list.append(new_buddy)
iter = iter.next
buddies_list.append(new_buddy)
iter = iter.next
- return buddies_list
- else:
- return None
def get_buddies(self):
"""
def get_buddies(self):
"""
cdef blist.PurpleBuddy *c_buddy = NULL
cdef char *c_alias = NULL
cdef blist.PurpleBuddy *c_buddy = NULL
cdef char *c_alias = NULL
if self.__exists:
iter = blist.purple_find_buddies(self._get_structure(), NULL)
if self.__exists:
iter = blist.purple_find_buddies(self._get_structure(), NULL)
while iter:
c_alias = NULL
c_buddy = <blist.PurpleBuddy *> iter.data
while iter:
c_alias = NULL
c_buddy = <blist.PurpleBuddy *> iter.data
buddies_list.append(new_buddy)
iter = iter.next
buddies_list.append(new_buddy)
iter = iter.next
- return buddies_list
- else:
- return None
def request_add_buddy(self, buddy_username, buddy_alias):
if buddy_alias:
def request_add_buddy(self, buddy_username, buddy_alias):
if buddy_alias: