X-Git-Url: http://git.maemo.org/git/?p=python-purple;a=blobdiff_plain;f=blist_cbs.pxd;h=763cf51a160fa72aaff01e75aac297b604f8378c;hp=96268a4dc687db00e7d7adb546169894531a2dcd;hb=8a65818786ccf9442ed68927ddb9922465a424b4;hpb=35a2297f5733c330829b9a33504aed180992c9bb diff --git a/blist_cbs.pxd b/blist_cbs.pxd index 96268a4..763cf51 100644 --- a/blist_cbs.pxd +++ b/blist_cbs.pxd @@ -101,21 +101,21 @@ cdef void new_list (blist.PurpleBuddyList *list): cdef void new_node (blist.PurpleBlistNode *node): debug.c_purple_debug(debug.PURPLE_DEBUG_INFO, "blist", "new_node\n") - if node.type == blist.PURPLE_BLIST_GROUP_NODE: - __group_node_cb(node, blist_cbs["new_node"]) - elif node.type == blist.PURPLE_BLIST_CONTACT_NODE: - __contact_node_cb(node, blist_cbs["new_node"]) - elif node.type == blist.PURPLE_BLIST_BUDDY_NODE: - __buddy_node_cb(node, blist_cbs["new_node"]) - elif node.type == blist.PURPLE_BLIST_CHAT_NODE: - __chat_node_cb(node, blist_cbs["new_node"]) - elif node.type == blist.PURPLE_BLIST_OTHER_NODE: - __other_node_cb(node, blist_cbs["new_node"]) - else: - try: + try: + if node.type == blist.PURPLE_BLIST_GROUP_NODE: + __group_node_cb(node, blist_cbs["new_node"]) + elif node.type == blist.PURPLE_BLIST_CONTACT_NODE: + __contact_node_cb(node, blist_cbs["new_node"]) + elif node.type == blist.PURPLE_BLIST_BUDDY_NODE: + __buddy_node_cb(node, blist_cbs["new_node"]) + elif node.type == blist.PURPLE_BLIST_CHAT_NODE: + __chat_node_cb(node, blist_cbs["new_node"]) + elif node.type == blist.PURPLE_BLIST_OTHER_NODE: + __other_node_cb(node, blist_cbs["new_node"]) + else: (blist_cbs["new_node"])(node.type) - except KeyError: - pass + except KeyError: + pass cdef void show (blist.PurpleBuddyList *list): debug.c_purple_debug(debug.PURPLE_DEBUG_INFO, "blist", "show\n") @@ -127,40 +127,40 @@ cdef void show (blist.PurpleBuddyList *list): cdef void update (blist.PurpleBuddyList *list, blist.PurpleBlistNode *node): debug.c_purple_debug(debug.PURPLE_DEBUG_INFO, "blist", "update\n") - if node.type == blist.PURPLE_BLIST_GROUP_NODE: - __group_node_cb(node, blist_cbs["update"]) - elif node.type == blist.PURPLE_BLIST_CONTACT_NODE: - __contact_node_cb(node, blist_cbs["update"]) - elif node.type == blist.PURPLE_BLIST_BUDDY_NODE: - __buddy_node_cb(node, blist_cbs["update"]) - elif node.type == blist.PURPLE_BLIST_CHAT_NODE: - __chat_node_cb(node, blist_cbs["update"]) - elif node.type == blist.PURPLE_BLIST_OTHER_NODE: - __other_node_cb(node, blist_cbs["update"]) - else: - try: + try: + if node.type == blist.PURPLE_BLIST_GROUP_NODE: + __group_node_cb(node, blist_cbs["update"]) + elif node.type == blist.PURPLE_BLIST_CONTACT_NODE: + __contact_node_cb(node, blist_cbs["update"]) + elif node.type == blist.PURPLE_BLIST_BUDDY_NODE: + __buddy_node_cb(node, blist_cbs["update"]) + elif node.type == blist.PURPLE_BLIST_CHAT_NODE: + __chat_node_cb(node, blist_cbs["update"]) + elif node.type == blist.PURPLE_BLIST_OTHER_NODE: + __other_node_cb(node, blist_cbs["update"]) + else: (blist_cbs["update"])(node.type) - except KeyError: - pass + except KeyError: + pass cdef void remove (blist.PurpleBuddyList *list, blist.PurpleBlistNode *node): debug.c_purple_debug(debug.PURPLE_DEBUG_INFO, "blist", "remove\n") - if node.type == blist.PURPLE_BLIST_GROUP_NODE: - __group_node_cb(node, blist_cbs["remove"]) - elif node.type == blist.PURPLE_BLIST_CONTACT_NODE: - __contact_node_cb(node, blist_cbs["remove"]) - elif node.type == blist.PURPLE_BLIST_BUDDY_NODE: - __buddy_node_cb(node, blist_cbs["remove"]) - elif node.type == blist.PURPLE_BLIST_CHAT_NODE: - __chat_node_cb(node, blist_cbs["remove"]) - elif node.type == blist.PURPLE_BLIST_OTHER_NODE: - __other_node_cb(node, blist_cbs["remove"]) - else: - try: + try: + if node.type == blist.PURPLE_BLIST_GROUP_NODE: + __group_node_cb(node, blist_cbs["remove"]) + elif node.type == blist.PURPLE_BLIST_CONTACT_NODE: + __contact_node_cb(node, blist_cbs["remove"]) + elif node.type == blist.PURPLE_BLIST_BUDDY_NODE: + __buddy_node_cb(node, blist_cbs["remove"]) + elif node.type == blist.PURPLE_BLIST_CHAT_NODE: + __chat_node_cb(node, blist_cbs["remove"]) + elif node.type == blist.PURPLE_BLIST_OTHER_NODE: + __other_node_cb(node, blist_cbs["remove"]) + else: (blist_cbs["remove"])(node.type) - except KeyError: - pass + except KeyError: + pass cdef void destroy (blist.PurpleBuddyList *list): debug.c_purple_debug(debug.PURPLE_DEBUG_INFO, "blist", "destroy\n")