Replaced all 'dict.has_key(item)' with 'item in dict' expressions.
[python-purple] / notify_cbs.pxd
index d029ef9..bdb8da7 100644 (file)
 
 cimport purple
 
-notify_cbs = {}
-
 cdef extern from *:
     ctypedef char const_char "const char"
     ctypedef int size_t
 
-cdef void *notify_message (notify.PurpleNotifyMsgType type, const_char *title,
-                           const_char *primary, const_char *secondary):
-    debug.c_purple_debug(debug.PURPLE_DEBUG_INFO, "notify", "notify_message\n")
-    try:
-        (<object>notify_cbs["notify_message"])("notify_message")
-    except KeyError:
-        pass
+notify_cbs = {}
+
+cdef void *notify_message(notify.PurpleNotifyMsgType type, \
+        const_char *title, const_char *primary, const_char *secondary):
+    """
+    TODO
+    """
+    debug.purple_debug_info("notify", "%s", "notify-message\n")
+    if "notify-message" in notify_cbs:
+        (<object> notify_cbs["notify-message"])("notify-message: TODO")
 
-cdef void *notify_email (connection.PurpleConnection *gc, const_char *subject,
-                         const_char *_from, const_char *to, const_char *url):
-    debug.c_purple_debug(debug.PURPLE_DEBUG_INFO, "notify", "notify_email\n")
-    try:
-        (<object>notify_cbs["notify_email"])("notify_email")
-    except KeyError:
-        pass
+cdef void *notify_email(connection.PurpleConnection *gc, \
+        const_char *subject, const_char *_from, const_char *to, \
+        const_char *url):
+    """
+    TODO
+    """
+    debug.purple_debug_info("notify", "%s", "notify-email\n")
+    if "notify-email" in notify_cbs:
+        (<object> notify_cbs["notify-email"])("notify-email: TODO")
 
-cdef void *notify_emails (connection.PurpleConnection *gc, size_t count,
-                          glib.gboolean detailed, const_char **subjects,
-                          const_char **froms, const_char **tos,
-                          const_char **urls):
-    debug.c_purple_debug(debug.PURPLE_DEBUG_INFO, "notify", "notify_emails\n")
-    try:
-        (<object>notify_cbs["notify_emails"])("notify_emails")
-    except KeyError:
-        pass
+cdef void *notify_emails(connection.PurpleConnection *gc, size_t count, \
+        glib.gboolean detailed, const_char **subjects, \
+        const_char **froms, const_char **tos, const_char **urls):
+    """
+    TODO
+    """
+    debug.purple_debug_info("notify", "%s", "notify-emails\n")
+    if "notify-emails" in notify_cbs:
+        (<object> notify_cbs["notify-emails"])("notify-emails: TODO")
 
-cdef void *notify_formatted (const_char *title, const_char *primary,
-                             const_char *secondary, const_char *text):
-    debug.c_purple_debug(debug.PURPLE_DEBUG_INFO, "notify", "notify_formatted\n")
-    try:
-        (<object>notify_cbs["notify_formatted"])("notify_formatted")
-    except KeyError:
-        pass
+cdef void *notify_formatted(const_char *title, const_char *primary, \
+        const_char *secondary, const_char *text):
+    """
+    TODO
+    """
+    debug.purple_debug_info("notify", "%s", "notify-formatted\n")
+    if "notify-formatted" in notify_cbs:
+        (<object> notify_cbs["notify-formatted"])("notify-formatted: TODO")
 
-cdef void *notify_searchresults (connection.PurpleConnection *gc,
-                                 const_char *title, const_char *primary,
-                                 const_char *secondary,
-                                 notify.PurpleNotifySearchResults *results,
-                                 glib.gpointer user_data):
-    debug.c_purple_debug(debug.PURPLE_DEBUG_INFO, "notify",
-                         "notify_searchresults\n")
-    try:
-        (<object>notify_cbs["notify_searchresults"])("notify_searchresults")
-    except KeyError:
-        pass
+cdef void *notify_searchresults(connection.PurpleConnection *gc, \
+        const_char *title, const_char *primary, const_char *secondary, \
+        notify.PurpleNotifySearchResults *results, glib.gpointer user_data):
+    """
+    TODO
+    """
+    debug.purple_debug_info("notify", "%s", "notify-searchresults\n")
+    if "notify-searchresults" in notify_cbs:
+        (<object> notify_cbs["notify-searchresults"]) \
+            ("notify-searchresults: TODO")
 
-cdef void notify_searchresults_new_rows (connection.PurpleConnection *gc,
-                            notify.PurpleNotifySearchResults *results,
-                            void *data):
-    debug.c_purple_debug(debug.PURPLE_DEBUG_INFO, "notify",
-                         "notify_searchresults_new_rows\n")
-    try:
-        (<object>notify_cbs["notify_searchresults_new_rows"])("notify_searchresults_new_rows")
-    except KeyError:
-        pass
+cdef void notify_searchresults_new_rows(connection.PurpleConnection *gc, \
+        notify.PurpleNotifySearchResults *results, void *data):
+    """
+    TODO
+    """
+    debug.purple_debug_info("notify", "%s", "notify-searchresults-new-rows\n")
+    if "notify-searchresults-new-rows" in notify_cbs:
+        (<object> notify_cbs["notify-searchresults-new-rows"]) \
+            ("notify-searchresults-new-rows: TODO")
 
-cdef void *notify_userinfo (connection.PurpleConnection *gc, const_char *who,
-                            notify.PurpleNotifyUserInfo *user_info):
-    debug.c_purple_debug(debug.PURPLE_DEBUG_INFO, "notify", "notify_userinfo\n")
-    try:
-        (<object>notify_cbs["notify_userinfo"])("notify_userinfo")
-    except KeyError:
-        pass
+cdef void *notify_userinfo(connection.PurpleConnection *gc, const_char *who, \
+        notify.PurpleNotifyUserInfo *user_info):
+    """
+    TODO
+    """
+    debug.purple_debug_info("notify", "%s", "notify-userinfo\n")
+    if "notify-userinfo" in notify_cbs:
+        (<object> notify_cbs["notify-userinfo"])("notify-userinfo: TODO")
 
-cdef void *notify_uri (const_char *uri):
-    debug.c_purple_debug(debug.PURPLE_DEBUG_INFO, "notify", "notify_uri\n")
-    try:
-        (<object>notify_cbs["notify_uri"])("notify_uri")
-    except KeyError:
-        pass
+cdef void *notify_uri(const_char *uri):
+    """
+    TODO
+    """
+    debug.purple_debug_info("notify", "%s", "notify-uri\n")
+    if "notify-uri" in notify_cbs:
+        (<object> notify_cbs["notify-uri"])("notify-uri: TODO")
 
-cdef void close_notify (notify.PurpleNotifyType type, void *ui_handle):
-    debug.c_purple_debug(debug.PURPLE_DEBUG_INFO, "notify", "close_notify\n")
-    try:
-        (<object>notify_cbs["close_notify"])("close_notify")
-    except KeyError:
-        pass
+cdef void close_notify(notify.PurpleNotifyType type, void *ui_handle):
+    """
+    TODO
+    """
+    debug.purple_debug_info("notify", "%s", "close-notify\n")
+    if "close-notify" in notify_cbs:
+        (<object> notify_cbs["close-notify"])("close-notify: TODO")