--- event.c.orig 2005-09-12 03:44:04 UTC +++ event.c @@ -1,47 +1,69 @@ -/* Generated by Pyrex 0.9.3 on Sun Sep 11 23:51:17 2005 */ +/* Generated by Pyrex 0.9.8.5 on Tue Dec 15 11:56:37 2009 */ +#define PY_SSIZE_T_CLEAN #include "Python.h" #include "structmember.h" #ifndef PY_LONG_LONG #define PY_LONG_LONG LONG_LONG #endif +#if PY_VERSION_HEX < 0x02050000 + typedef int Py_ssize_t; + #define PY_SSIZE_T_MAX INT_MAX + #define PY_SSIZE_T_MIN INT_MIN + #define PyInt_FromSsize_t(z) PyInt_FromLong(z) + #define PyInt_AsSsize_t(o) PyInt_AsLong(o) +#endif +#if !defined(WIN32) && !defined(MS_WINDOWS) + #ifndef __stdcall + #define __stdcall + #endif + #ifndef __cdecl + #define __cdecl + #endif +#endif +#ifdef __cplusplus +#define __PYX_EXTERN_C extern "C" +#else +#define __PYX_EXTERN_C extern +#endif +#include #include "event.h" -typedef struct {PyObject **p; char *s;} __Pyx_InternTabEntry; /*proto*/ -typedef struct {PyObject **p; char *s; long n;} __Pyx_StringTabEntry; /*proto*/ -static PyObject *__Pyx_UnpackItem(PyObject *, int); /*proto*/ -static int __Pyx_EndUnpack(PyObject *, int); /*proto*/ -static int __Pyx_PrintItem(PyObject *); /*proto*/ -static int __Pyx_PrintNewline(void); /*proto*/ -static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb); /*proto*/ -static void __Pyx_ReRaise(void); /*proto*/ -static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list); /*proto*/ -static PyObject *__Pyx_GetExcValue(void); /*proto*/ -static int __Pyx_ArgTypeTest(PyObject *obj, PyTypeObject *type, int none_allowed, char *name); /*proto*/ -static int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type); /*proto*/ -static int __Pyx_GetStarArgs(PyObject **args, PyObject **kwds, char *kwd_list[], int nargs, PyObject **args2, PyObject **kwds2); /*proto*/ -static void __Pyx_WriteUnraisable(char *name); /*proto*/ -static void __Pyx_AddTraceback(char *funcname); /*proto*/ -static PyTypeObject *__Pyx_ImportType(char *module_name, char *class_name, long size); /*proto*/ -static int __Pyx_SetVtable(PyObject *dict, void *vtable); /*proto*/ -static int __Pyx_GetVtable(PyObject *dict, void *vtabptr); /*proto*/ -static PyObject *__Pyx_CreateClass(PyObject *bases, PyObject *dict, PyObject *name, char *modname); /*proto*/ -static int __Pyx_InternStrings(__Pyx_InternTabEntry *t); /*proto*/ -static int __Pyx_InitStrings(__Pyx_StringTabEntry *t); /*proto*/ -static PyObject *__Pyx_GetName(PyObject *dict, PyObject *name); /*proto*/ +typedef struct {PyObject **p; int i; char *s; long n;} __Pyx_StringTabEntry; /*proto*/ static PyObject *__pyx_m; static PyObject *__pyx_b; static int __pyx_lineno; static char *__pyx_filename; -staticforward char **__pyx_f; +static char **__pyx_f; static char __pyx_mdoc[] = "event library\n\nThis module provides a mechanism to execute a function when a\nspecific event on a file handle, file descriptor, or signal occurs,\nor after a given time has passed.\n"; +static void __Pyx_WriteUnraisable(char *name); /*proto*/ + +static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb); /*proto*/ + +static PyObject *__Pyx_GetName(PyObject *dict, PyObject *name); /*proto*/ + +static int __Pyx_GetStarArgs(PyObject **args, PyObject **kwds, char *kwd_list[], Py_ssize_t nargs, PyObject **args2, PyObject **kwds2, char rqd_kwds[]); /*proto*/ + +static PyObject *__Pyx_GetItemInt(PyObject *o, Py_ssize_t i); /*proto*/ + +static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb); /*proto*/ + +static int __Pyx_InitStrings(__Pyx_StringTabEntry *t); /*proto*/ + +static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list); /*proto*/ + +static void __Pyx_AddTraceback(char *funcname); /*proto*/ + /* Declarations from event */ -staticforward PyTypeObject __pyx_type_5event_event; + +/* Declarations from implementation of event */ + +typedef void (*__pyx_t_5event_event_handler)(int,short,void *); struct __pyx_obj_5event_event { PyObject_HEAD @@ -54,115 +76,155 @@ struct __pyx_obj_5event_event { struct timeval tv; }; -staticforward PyTypeObject __pyx_type_5event_read; - struct __pyx_obj_5event_read { struct __pyx_obj_5event_event __pyx_base; }; -staticforward PyTypeObject __pyx_type_5event_write; - struct __pyx_obj_5event_write { struct __pyx_obj_5event_event __pyx_base; }; -staticforward PyTypeObject __pyx_type_5event_signal; - struct __pyx_obj_5event_signal { struct __pyx_obj_5event_event __pyx_base; }; -staticforward PyTypeObject __pyx_type_5event_timeout; - struct __pyx_obj_5event_timeout { struct __pyx_obj_5event_event __pyx_base; }; + + + + + static PyTypeObject *__pyx_ptype_5event_event = 0; static PyTypeObject *__pyx_ptype_5event_read = 0; static PyTypeObject *__pyx_ptype_5event_write = 0; static PyTypeObject *__pyx_ptype_5event_signal = 0; static PyTypeObject *__pyx_ptype_5event_timeout = 0; -static PyObject *__pyx_k9; -static short __pyx_k10; -static PyObject *__pyx_k11; -static PyObject *__pyx_k12; -static float __pyx_k13; -static PyObject *__pyx_k14; -static int (__pyx_f_5event___event_sigcb(void)); /*proto*/ -static void (__pyx_f_5event___event_handler(int ,short ,void (*))); /*proto*/ -static void (__pyx_f_5event___simple_event_handler(int ,short ,void (*))); /*proto*/ - -/* Implementation of event */ +static void __pyx_f_5event___event_handler(int,short,void *); /*proto*/ +static void __pyx_f_5event___simple_event_handler(int,short,void *); /*proto*/ -static char (__pyx_k1[]) = "Dug Song "; -static char (__pyx_k2[]) = "Martin Murray "; -static char (__pyx_k3[]) = "Copyright (c) 2004 Dug Song"; -static char (__pyx_k4[]) = "Copyright (c) 2003 Martin Murray"; -static char (__pyx_k6[]) = "http://monkey.org/~dugsong/pyevent/"; -static char (__pyx_k7[]) = "0.3"; +static char __pyx_k1[] = "__callback"; +static char __pyx_k2[] = "__simple_callback"; +static char __pyx_k3[] = "fileno"; +static char __pyx_k4[] = "sys"; +static char __pyx_k5[] = "exc_info"; +static char __pyx_k6[] = "__event_exc"; +static char __pyx_k7[] = "EV_SIGNAL"; +static char __pyx_k8[] = "EV_READ"; +static char __pyx_k9[] = "EV_WRITE"; +static char __pyx_k10[] = "EV_TIMEOUT"; +static char __pyx_k11[] = "pending"; +static char __pyx_k12[] = "delete"; +static char __pyx_k13[] = ""; +static char __pyx_k14[] = "__init__"; +static char __pyx_k15[] = "simple"; +static char __pyx_k16[] = "add"; +static char __pyx_k17[] = "EV_PERSIST"; +static char __pyx_k18[] = "Dug Song "; +static char __pyx_k19[] = "Martin Murray "; +static char __pyx_k20[] = "__author__"; +static char __pyx_k21[] = "Copyright (c) 2004 Dug Song"; +static char __pyx_k22[] = "Copyright (c) 2003 Martin Murray"; +static char __pyx_k23[] = "__copyright__"; +static char __pyx_k24[] = "BSD"; +static char __pyx_k25[] = "__license__"; +static char __pyx_k26[] = "http://monkey.org/~dugsong/pyevent/"; +static char __pyx_k27[] = "__url__"; +static char __pyx_k28[] = "0.3"; +static char __pyx_k29[] = "__version__"; +static char __pyx_k30[] = "init"; +static PyObject *__pyx_n_BSD; +static PyObject *__pyx_n_EV_PERSIST; +static PyObject *__pyx_n_EV_READ; +static PyObject *__pyx_n_EV_SIGNAL; +static PyObject *__pyx_n_EV_TIMEOUT; +static PyObject *__pyx_n_EV_WRITE; static PyObject *__pyx_n___author__; +static PyObject *__pyx_n___callback; static PyObject *__pyx_n___copyright__; +static PyObject *__pyx_n___event_exc; +static PyObject *__pyx_n___init__; static PyObject *__pyx_n___license__; +static PyObject *__pyx_n___simple_callback; static PyObject *__pyx_n___url__; static PyObject *__pyx_n___version__; -static PyObject *__pyx_n_sys; -static PyObject *__pyx_n_EV_TIMEOUT; -static PyObject *__pyx_n_EV_READ; -static PyObject *__pyx_n_EV_WRITE; -static PyObject *__pyx_n_EV_SIGNAL; -static PyObject *__pyx_n_EV_PERSIST; -static PyObject *__pyx_n___event_exc; +static PyObject *__pyx_n_add; +static PyObject *__pyx_n_delete; +static PyObject *__pyx_n_exc_info; +static PyObject *__pyx_n_fileno; static PyObject *__pyx_n_init; -static PyObject *__pyx_n_dispatch; -static PyObject *__pyx_n_loop; -static PyObject *__pyx_n_abort; -static PyObject *__pyx_n_BSD; -static PyObject *__pyx_n_False; +static PyObject *__pyx_n_pending; +static PyObject *__pyx_n_simple; +static PyObject *__pyx_n_sys; -static PyObject *__pyx_k1p; -static PyObject *__pyx_k2p; -static PyObject *__pyx_k3p; -static PyObject *__pyx_k4p; -static PyObject *__pyx_k6p; -static PyObject *__pyx_k7p; +static PyObject *__pyx_k13p; +static PyObject *__pyx_k18p; +static PyObject *__pyx_k19p; +static PyObject *__pyx_k21p; +static PyObject *__pyx_k22p; +static PyObject *__pyx_k26p; +static PyObject *__pyx_k28p; -static int __pyx_f_5event___event_sigcb(void) { - int __pyx_r; +static __Pyx_StringTabEntry __pyx_string_tab[] = { + {&__pyx_n_BSD, 1, __pyx_k24, sizeof(__pyx_k24)}, + {&__pyx_n_EV_PERSIST, 1, __pyx_k17, sizeof(__pyx_k17)}, + {&__pyx_n_EV_READ, 1, __pyx_k8, sizeof(__pyx_k8)}, + {&__pyx_n_EV_SIGNAL, 1, __pyx_k7, sizeof(__pyx_k7)}, + {&__pyx_n_EV_TIMEOUT, 1, __pyx_k10, sizeof(__pyx_k10)}, + {&__pyx_n_EV_WRITE, 1, __pyx_k9, sizeof(__pyx_k9)}, + {&__pyx_n___author__, 1, __pyx_k20, sizeof(__pyx_k20)}, + {&__pyx_n___callback, 1, __pyx_k1, sizeof(__pyx_k1)}, + {&__pyx_n___copyright__, 1, __pyx_k23, sizeof(__pyx_k23)}, + {&__pyx_n___event_exc, 1, __pyx_k6, sizeof(__pyx_k6)}, + {&__pyx_n___init__, 1, __pyx_k14, sizeof(__pyx_k14)}, + {&__pyx_n___license__, 1, __pyx_k25, sizeof(__pyx_k25)}, + {&__pyx_n___simple_callback, 1, __pyx_k2, sizeof(__pyx_k2)}, + {&__pyx_n___url__, 1, __pyx_k27, sizeof(__pyx_k27)}, + {&__pyx_n___version__, 1, __pyx_k29, sizeof(__pyx_k29)}, + {&__pyx_n_add, 1, __pyx_k16, sizeof(__pyx_k16)}, + {&__pyx_n_delete, 1, __pyx_k12, sizeof(__pyx_k12)}, + {&__pyx_n_exc_info, 1, __pyx_k5, sizeof(__pyx_k5)}, + {&__pyx_n_fileno, 1, __pyx_k3, sizeof(__pyx_k3)}, + {&__pyx_n_init, 1, __pyx_k30, sizeof(__pyx_k30)}, + {&__pyx_n_pending, 1, __pyx_k11, sizeof(__pyx_k11)}, + {&__pyx_n_simple, 1, __pyx_k15, sizeof(__pyx_k15)}, + {&__pyx_n_sys, 1, __pyx_k4, sizeof(__pyx_k4)}, + {&__pyx_k13p, 0, __pyx_k13, sizeof(__pyx_k13)}, + {&__pyx_k18p, 0, __pyx_k18, sizeof(__pyx_k18)}, + {&__pyx_k19p, 0, __pyx_k19, sizeof(__pyx_k19)}, + {&__pyx_k21p, 0, __pyx_k21, sizeof(__pyx_k21)}, + {&__pyx_k22p, 0, __pyx_k22, sizeof(__pyx_k22)}, + {&__pyx_k26p, 0, __pyx_k26, sizeof(__pyx_k26)}, + {&__pyx_k28p, 0, __pyx_k28, sizeof(__pyx_k28)}, + {0, 0, 0, 0} +}; - /* "/Users/dugsong/projects/pyevent/event.pyx":66 */ - __pyx_r = (-1); - goto __pyx_L0; +static PyObject *__pyx_d1; +static short __pyx_d2; +static PyObject *__pyx_d3; +static PyObject *__pyx_d4; +static float __pyx_d5; +static PyObject *__pyx_d6; - __pyx_r = 0; - goto __pyx_L0; - __pyx_L1:; - __Pyx_WriteUnraisable("event.__event_sigcb"); - __pyx_L0:; - return __pyx_r; -} -static PyObject *__pyx_n___callback; +/* Implementation of event */ -static void __pyx_f_5event___event_handler(int __pyx_v_fd,short __pyx_v_evtype,void (*__pyx_v_arg)) { +static void __pyx_f_5event___event_handler(int __pyx_v_fd,short __pyx_v_evtype,void *__pyx_v_arg) { PyObject *__pyx_1 = 0; PyObject *__pyx_2 = 0; PyObject *__pyx_3 = 0; - - /* "/Users/dugsong/projects/pyevent/event.pyx":69 */ - __pyx_1 = (PyObject *)__pyx_v_arg; - Py_INCREF(__pyx_1); - __pyx_2 = PyObject_GetAttr(__pyx_1, __pyx_n___callback); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 69; goto __pyx_L1;} + __pyx_1 = PyObject_GetAttr(((PyObject *)__pyx_v_arg), __pyx_n___callback); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 66; goto __pyx_L1;} + __pyx_2 = PyInt_FromLong(__pyx_v_evtype); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 66; goto __pyx_L1;} + __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 66; goto __pyx_L1;} + PyTuple_SET_ITEM(__pyx_3, 0, __pyx_2); + __pyx_2 = 0; + __pyx_2 = PyObject_CallObject(__pyx_1, __pyx_3); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 66; goto __pyx_L1;} Py_DECREF(__pyx_1); __pyx_1 = 0; - __pyx_1 = PyInt_FromLong(__pyx_v_evtype); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 69; goto __pyx_L1;} - __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 69; goto __pyx_L1;} - PyTuple_SET_ITEM(__pyx_3, 0, __pyx_1); - __pyx_1 = 0; - __pyx_1 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 69; goto __pyx_L1;} - Py_DECREF(__pyx_2); __pyx_2 = 0; Py_DECREF(__pyx_3); __pyx_3 = 0; - Py_DECREF(__pyx_1); __pyx_1 = 0; + Py_DECREF(__pyx_2); __pyx_2 = 0; goto __pyx_L0; __pyx_L1:; @@ -173,26 +235,19 @@ static void __pyx_f_5event___event_handl __pyx_L0:; } -static PyObject *__pyx_n___simple_callback; - -static void __pyx_f_5event___simple_event_handler(int __pyx_v_fd,short __pyx_v_evtype,void (*__pyx_v_arg)) { +static void __pyx_f_5event___simple_event_handler(int __pyx_v_fd,short __pyx_v_evtype,void *__pyx_v_arg) { PyObject *__pyx_1 = 0; PyObject *__pyx_2 = 0; PyObject *__pyx_3 = 0; - - /* "/Users/dugsong/projects/pyevent/event.pyx":72 */ - __pyx_1 = (PyObject *)__pyx_v_arg; - Py_INCREF(__pyx_1); - __pyx_2 = PyObject_GetAttr(__pyx_1, __pyx_n___simple_callback); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 72; goto __pyx_L1;} + __pyx_1 = PyObject_GetAttr(((PyObject *)__pyx_v_arg), __pyx_n___simple_callback); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 69; goto __pyx_L1;} + __pyx_2 = PyInt_FromLong(__pyx_v_evtype); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 69; goto __pyx_L1;} + __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 69; goto __pyx_L1;} + PyTuple_SET_ITEM(__pyx_3, 0, __pyx_2); + __pyx_2 = 0; + __pyx_2 = PyObject_CallObject(__pyx_1, __pyx_3); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 69; goto __pyx_L1;} Py_DECREF(__pyx_1); __pyx_1 = 0; - __pyx_1 = PyInt_FromLong(__pyx_v_evtype); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 72; goto __pyx_L1;} - __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 72; goto __pyx_L1;} - PyTuple_SET_ITEM(__pyx_3, 0, __pyx_1); - __pyx_1 = 0; - __pyx_1 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 72; goto __pyx_L1;} - Py_DECREF(__pyx_2); __pyx_2 = 0; Py_DECREF(__pyx_3); __pyx_3 = 0; - Py_DECREF(__pyx_1); __pyx_1 = 0; + Py_DECREF(__pyx_2); __pyx_2 = 0; goto __pyx_L0; __pyx_L1:; @@ -203,10 +258,6 @@ static void __pyx_f_5event___simple_even __pyx_L0:; } -static PyObject *__pyx_n_isinstance; -static PyObject *__pyx_n_int; -static PyObject *__pyx_n_fileno; - static int __pyx_f_5event_5event___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static int __pyx_f_5event_5event___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_callback = 0; @@ -214,18 +265,17 @@ static int __pyx_f_5event_5event___init_ short __pyx_v_evtype; PyObject *__pyx_v_handle = 0; PyObject *__pyx_v_simple = 0; - void ((*__pyx_v_handler)(int ,short ,void (*))); + __pyx_t_5event_event_handler __pyx_v_handler; int __pyx_r; PyObject *__pyx_1 = 0; int __pyx_2; int __pyx_3; PyObject *__pyx_4 = 0; - PyObject *__pyx_5 = 0; static char *__pyx_argnames[] = {"callback","arg","evtype","handle","simple",0}; - __pyx_v_arg = __pyx_k9; - __pyx_v_evtype = __pyx_k10; - __pyx_v_handle = __pyx_k11; - __pyx_v_simple = __pyx_k12; + __pyx_v_arg = __pyx_d1; + __pyx_v_evtype = __pyx_d2; + __pyx_v_handle = __pyx_d3; + __pyx_v_simple = __pyx_d4; if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "O|OhOO", __pyx_argnames, &__pyx_v_callback, &__pyx_v_arg, &__pyx_v_evtype, &__pyx_v_handle, &__pyx_v_simple)) return -1; Py_INCREF(__pyx_v_self); Py_INCREF(__pyx_v_callback); @@ -233,78 +283,57 @@ static int __pyx_f_5event_5event___init_ Py_INCREF(__pyx_v_handle); Py_INCREF(__pyx_v_simple); - /* "/Users/dugsong/projects/pyevent/event.pyx":96 */ + /* "/usr/home/clsung/cvsroot/ports/devel/py-event/work/pyevent-0.3/event.pyx":93 */ Py_INCREF(__pyx_v_callback); Py_DECREF(((struct __pyx_obj_5event_event *)__pyx_v_self)->callback); ((struct __pyx_obj_5event_event *)__pyx_v_self)->callback = __pyx_v_callback; - /* "/Users/dugsong/projects/pyevent/event.pyx":97 */ + /* "/usr/home/clsung/cvsroot/ports/devel/py-event/work/pyevent-0.3/event.pyx":94 */ Py_INCREF(__pyx_v_arg); Py_DECREF(((struct __pyx_obj_5event_event *)__pyx_v_self)->args); ((struct __pyx_obj_5event_event *)__pyx_v_self)->args = __pyx_v_arg; - /* "/Users/dugsong/projects/pyevent/event.pyx":98 */ - __pyx_1 = PyInt_FromLong(__pyx_v_evtype); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 98; goto __pyx_L1;} + /* "/usr/home/clsung/cvsroot/ports/devel/py-event/work/pyevent-0.3/event.pyx":95 */ + __pyx_1 = PyInt_FromLong(__pyx_v_evtype); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 95; goto __pyx_L1;} Py_DECREF(((struct __pyx_obj_5event_event *)__pyx_v_self)->evtype); ((struct __pyx_obj_5event_event *)__pyx_v_self)->evtype = __pyx_1; __pyx_1 = 0; - /* "/Users/dugsong/projects/pyevent/event.pyx":99 */ + /* "/usr/home/clsung/cvsroot/ports/devel/py-event/work/pyevent-0.3/event.pyx":96 */ Py_INCREF(__pyx_v_handle); Py_DECREF(((struct __pyx_obj_5event_event *)__pyx_v_self)->handle); ((struct __pyx_obj_5event_event *)__pyx_v_self)->handle = __pyx_v_handle; - /* "/Users/dugsong/projects/pyevent/event.pyx":100 */ - __pyx_2 = PyObject_IsTrue(__pyx_v_simple); if (__pyx_2 < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 100; goto __pyx_L1;} + /* "/usr/home/clsung/cvsroot/ports/devel/py-event/work/pyevent-0.3/event.pyx":97 */ + __pyx_2 = PyObject_IsTrue(__pyx_v_simple); if (__pyx_2 < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 97; goto __pyx_L1;} if (__pyx_2) { - - /* "/Users/dugsong/projects/pyevent/event.pyx":101 */ __pyx_v_handler = __pyx_f_5event___simple_event_handler; goto __pyx_L2; } /*else*/ { - - /* "/Users/dugsong/projects/pyevent/event.pyx":103 */ __pyx_v_handler = __pyx_f_5event___event_handler; } __pyx_L2:; - /* "/Users/dugsong/projects/pyevent/event.pyx":104 */ + /* "/usr/home/clsung/cvsroot/ports/devel/py-event/work/pyevent-0.3/event.pyx":101 */ __pyx_2 = (__pyx_v_evtype == 0); if (__pyx_2) { - __pyx_3 = PyObject_IsTrue(__pyx_v_handle); if (__pyx_3 < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 104; goto __pyx_L1;} + __pyx_3 = PyObject_IsTrue(__pyx_v_handle); if (__pyx_3 < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 101; goto __pyx_L1;} __pyx_2 = (!__pyx_3); } if (__pyx_2) { - - /* "/Users/dugsong/projects/pyevent/event.pyx":105 */ - evtimer_set((&((struct __pyx_obj_5event_event *)__pyx_v_self)->ev),__pyx_v_handler,((void (*))__pyx_v_self)); + evtimer_set((&((struct __pyx_obj_5event_event *)__pyx_v_self)->ev),__pyx_v_handler,((void *)__pyx_v_self)); goto __pyx_L3; } /*else*/ { - /* "/Users/dugsong/projects/pyevent/event.pyx":107 */ - __pyx_1 = __Pyx_GetName(__pyx_b, __pyx_n_isinstance); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 107; goto __pyx_L1;} - __pyx_4 = __Pyx_GetName(__pyx_b, __pyx_n_int); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 107; goto __pyx_L1;} - __pyx_5 = PyTuple_New(2); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 107; goto __pyx_L1;} - Py_INCREF(__pyx_v_handle); - PyTuple_SET_ITEM(__pyx_5, 0, __pyx_v_handle); - PyTuple_SET_ITEM(__pyx_5, 1, __pyx_4); - __pyx_4 = 0; - __pyx_4 = PyObject_CallObject(__pyx_1, __pyx_5); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 107; goto __pyx_L1;} - Py_DECREF(__pyx_1); __pyx_1 = 0; - Py_DECREF(__pyx_5); __pyx_5 = 0; - __pyx_3 = PyObject_IsTrue(__pyx_4); if (__pyx_3 < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 107; goto __pyx_L1;} - Py_DECREF(__pyx_4); __pyx_4 = 0; + /* "/usr/home/clsung/cvsroot/ports/devel/py-event/work/pyevent-0.3/event.pyx":104 */ + __pyx_3 = PyObject_IsInstance(__pyx_v_handle,((PyObject *)(&PyInt_Type))); if (__pyx_3 == -1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 104; goto __pyx_L1;} __pyx_2 = (!__pyx_3); if (__pyx_2) { - - /* "/Users/dugsong/projects/pyevent/event.pyx":108 */ - __pyx_1 = PyObject_GetAttr(__pyx_v_handle, __pyx_n_fileno); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 108; goto __pyx_L1;} - __pyx_5 = PyTuple_New(0); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 108; goto __pyx_L1;} - __pyx_4 = PyObject_CallObject(__pyx_1, __pyx_5); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 108; goto __pyx_L1;} + __pyx_1 = PyObject_GetAttr(__pyx_v_handle, __pyx_n_fileno); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 105; goto __pyx_L1;} + __pyx_4 = PyObject_CallObject(__pyx_1, 0); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 105; goto __pyx_L1;} Py_DECREF(__pyx_1); __pyx_1 = 0; - Py_DECREF(__pyx_5); __pyx_5 = 0; Py_DECREF(__pyx_v_handle); __pyx_v_handle = __pyx_4; __pyx_4 = 0; @@ -312,9 +341,9 @@ static int __pyx_f_5event_5event___init_ } __pyx_L4:; - /* "/Users/dugsong/projects/pyevent/event.pyx":109 */ - __pyx_3 = PyInt_AsLong(__pyx_v_handle); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 109; goto __pyx_L1;} - event_set((&((struct __pyx_obj_5event_event *)__pyx_v_self)->ev),__pyx_3,__pyx_v_evtype,__pyx_v_handler,((void (*))__pyx_v_self)); + /* "/usr/home/clsung/cvsroot/ports/devel/py-event/work/pyevent-0.3/event.pyx":106 */ + __pyx_3 = PyInt_AsLong(__pyx_v_handle); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 106; goto __pyx_L1;} + event_set((&((struct __pyx_obj_5event_event *)__pyx_v_self)->ev),__pyx_3,__pyx_v_evtype,__pyx_v_handler,((void *)__pyx_v_self)); } __pyx_L3:; @@ -323,7 +352,6 @@ static int __pyx_f_5event_5event___init_ __pyx_L1:; Py_XDECREF(__pyx_1); Py_XDECREF(__pyx_4); - Py_XDECREF(__pyx_5); __Pyx_AddTraceback("event.event.__init__"); __pyx_r = -1; __pyx_L0:; @@ -335,51 +363,41 @@ static int __pyx_f_5event_5event___init_ return __pyx_r; } -static PyObject *__pyx_n_exc_info; - static PyObject *__pyx_f_5event_5event___simple_callback(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static PyObject *__pyx_f_5event_5event___simple_callback(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { short __pyx_v_evtype; - extern int event_gotsig; - extern int ((*event_sigcb)(void)); PyObject *__pyx_r; PyObject *__pyx_1 = 0; PyObject *__pyx_2 = 0; int __pyx_3; PyObject *__pyx_4 = 0; - int __pyx_5; - short __pyx_6; + PyObject *__pyx_5 = 0; + PyObject *__pyx_6 = 0; + int __pyx_7; + short __pyx_8; static char *__pyx_argnames[] = {"evtype",0}; if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "h", __pyx_argnames, &__pyx_v_evtype)) return 0; Py_INCREF(__pyx_v_self); - /* "/Users/dugsong/projects/pyevent/event.pyx":115 */ + /* "/usr/home/clsung/cvsroot/ports/devel/py-event/work/pyevent-0.3/event.pyx":110 */ /*try:*/ { - - /* "/Users/dugsong/projects/pyevent/event.pyx":116 */ - __pyx_1 = PySequence_Tuple(((struct __pyx_obj_5event_event *)__pyx_v_self)->args); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 116; goto __pyx_L2;} - __pyx_2 = PyObject_CallObject(((struct __pyx_obj_5event_event *)__pyx_v_self)->callback, __pyx_1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 116; goto __pyx_L2;} + __pyx_1 = PySequence_Tuple(((struct __pyx_obj_5event_event *)__pyx_v_self)->args); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 111; goto __pyx_L2;} + __pyx_2 = PyObject_CallObject(((struct __pyx_obj_5event_event *)__pyx_v_self)->callback, __pyx_1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 111; goto __pyx_L2;} Py_DECREF(__pyx_1); __pyx_1 = 0; - if (PyObject_Cmp(__pyx_2, Py_None, &__pyx_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 116; goto __pyx_L2;} + if (PyObject_Cmp(__pyx_2, Py_None, &__pyx_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 111; goto __pyx_L2;} __pyx_3 = __pyx_3 != 0; Py_DECREF(__pyx_2); __pyx_2 = 0; if (__pyx_3) { - - /* "/Users/dugsong/projects/pyevent/event.pyx":117 */ __pyx_3 = ((struct __pyx_obj_5event_event *)__pyx_v_self)->tv.tv_sec; if (!__pyx_3) { __pyx_3 = ((struct __pyx_obj_5event_event *)__pyx_v_self)->tv.tv_usec; } if (__pyx_3) { - - /* "/Users/dugsong/projects/pyevent/event.pyx":118 */ event_add((&((struct __pyx_obj_5event_event *)__pyx_v_self)->ev),(&((struct __pyx_obj_5event_event *)__pyx_v_self)->tv)); goto __pyx_L5; } /*else*/ { - - /* "/Users/dugsong/projects/pyevent/event.pyx":120 */ - event_add((&((struct __pyx_obj_5event_event *)__pyx_v_self)->ev),0); + event_add((&((struct __pyx_obj_5event_event *)__pyx_v_self)->ev),NULL); } __pyx_L5:; goto __pyx_L4; @@ -391,73 +409,65 @@ static PyObject *__pyx_f_5event_5event__ Py_XDECREF(__pyx_1); __pyx_1 = 0; Py_XDECREF(__pyx_2); __pyx_2 = 0; - /* "/Users/dugsong/projects/pyevent/event.pyx":121 */ + /* "/usr/home/clsung/cvsroot/ports/devel/py-event/work/pyevent-0.3/event.pyx":116 */ /*except:*/ { __Pyx_AddTraceback("event.__simple_callback"); - __pyx_1 = __Pyx_GetExcValue(); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 121; goto __pyx_L1;} - Py_DECREF(__pyx_1); __pyx_1 = 0; - - /* "/Users/dugsong/projects/pyevent/event.pyx":122 */ - __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n_sys); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 122; goto __pyx_L1;} - __pyx_1 = PyObject_GetAttr(__pyx_2, __pyx_n_exc_info); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 122; goto __pyx_L1;} - Py_DECREF(__pyx_2); __pyx_2 = 0; - __pyx_2 = PyTuple_New(0); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 122; goto __pyx_L1;} - __pyx_4 = PyObject_CallObject(__pyx_1, __pyx_2); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 122; goto __pyx_L1;} + if (__Pyx_GetException(&__pyx_1, &__pyx_2, &__pyx_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 116; goto __pyx_L1;} + __pyx_5 = __Pyx_GetName(__pyx_m, __pyx_n_sys); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 117; goto __pyx_L1;} + __pyx_6 = PyObject_GetAttr(__pyx_5, __pyx_n_exc_info); if (!__pyx_6) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 117; goto __pyx_L1;} + Py_DECREF(__pyx_5); __pyx_5 = 0; + __pyx_5 = PyObject_CallObject(__pyx_6, 0); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 117; goto __pyx_L1;} + Py_DECREF(__pyx_6); __pyx_6 = 0; + if (PyObject_SetAttr(__pyx_m, __pyx_n___event_exc, __pyx_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 117; goto __pyx_L1;} + Py_DECREF(__pyx_5); __pyx_5 = 0; Py_DECREF(__pyx_1); __pyx_1 = 0; Py_DECREF(__pyx_2); __pyx_2 = 0; - if (PyObject_SetAttr(__pyx_m, __pyx_n___event_exc, __pyx_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 122; goto __pyx_L1;} Py_DECREF(__pyx_4); __pyx_4 = 0; - - /* "/Users/dugsong/projects/pyevent/event.pyx":123 */ - event_sigcb = __pyx_f_5event___event_sigcb; - - /* "/Users/dugsong/projects/pyevent/event.pyx":124 */ - event_gotsig = 1; goto __pyx_L3; } __pyx_L3:; - /* "/Users/dugsong/projects/pyevent/event.pyx":126 */ - __pyx_1 = PyInt_FromLong(__pyx_v_evtype); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 126; goto __pyx_L1;} - __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n_EV_SIGNAL); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 126; goto __pyx_L1;} - __pyx_4 = PyNumber_And(__pyx_1, __pyx_2); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 126; goto __pyx_L1;} + /* "/usr/home/clsung/cvsroot/ports/devel/py-event/work/pyevent-0.3/event.pyx":119 */ + __pyx_6 = PyInt_FromLong(__pyx_v_evtype); if (!__pyx_6) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 119; goto __pyx_L1;} + __pyx_5 = __Pyx_GetName(__pyx_m, __pyx_n_EV_SIGNAL); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 119; goto __pyx_L1;} + __pyx_1 = PyNumber_And(__pyx_6, __pyx_5); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 119; goto __pyx_L1;} + Py_DECREF(__pyx_6); __pyx_6 = 0; + Py_DECREF(__pyx_5); __pyx_5 = 0; + __pyx_7 = PyObject_IsTrue(__pyx_1); if (__pyx_7 < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 119; goto __pyx_L1;} Py_DECREF(__pyx_1); __pyx_1 = 0; - Py_DECREF(__pyx_2); __pyx_2 = 0; - __pyx_5 = PyObject_IsTrue(__pyx_4); if (__pyx_5 < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 126; goto __pyx_L1;} - Py_DECREF(__pyx_4); __pyx_4 = 0; - __pyx_3 = (!__pyx_5); + __pyx_3 = (!__pyx_7); if (__pyx_3) { - __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n_EV_READ); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 127; goto __pyx_L1;} - __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n_EV_WRITE); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 127; goto __pyx_L1;} - __pyx_4 = PyNumber_Or(__pyx_1, __pyx_2); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 127; goto __pyx_L1;} - Py_DECREF(__pyx_1); __pyx_1 = 0; + __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n_EV_READ); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 120; goto __pyx_L1;} + __pyx_4 = __Pyx_GetName(__pyx_m, __pyx_n_EV_WRITE); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 120; goto __pyx_L1;} + __pyx_6 = PyNumber_Or(__pyx_2, __pyx_4); if (!__pyx_6) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 120; goto __pyx_L1;} Py_DECREF(__pyx_2); __pyx_2 = 0; - __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n_EV_SIGNAL); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 127; goto __pyx_L1;} - __pyx_2 = PyNumber_Or(__pyx_4, __pyx_1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 127; goto __pyx_L1;} Py_DECREF(__pyx_4); __pyx_4 = 0; + __pyx_5 = __Pyx_GetName(__pyx_m, __pyx_n_EV_SIGNAL); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 120; goto __pyx_L1;} + __pyx_1 = PyNumber_Or(__pyx_6, __pyx_5); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 120; goto __pyx_L1;} + Py_DECREF(__pyx_6); __pyx_6 = 0; + Py_DECREF(__pyx_5); __pyx_5 = 0; + __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n_EV_TIMEOUT); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 120; goto __pyx_L1;} + __pyx_4 = PyNumber_Or(__pyx_1, __pyx_2); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 120; goto __pyx_L1;} Py_DECREF(__pyx_1); __pyx_1 = 0; - __pyx_4 = __Pyx_GetName(__pyx_m, __pyx_n_EV_TIMEOUT); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 127; goto __pyx_L1;} - __pyx_1 = PyNumber_Or(__pyx_2, __pyx_4); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 127; goto __pyx_L1;} Py_DECREF(__pyx_2); __pyx_2 = 0; + __pyx_8 = PyInt_AsLong(__pyx_4); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 120; goto __pyx_L1;} Py_DECREF(__pyx_4); __pyx_4 = 0; - __pyx_6 = PyInt_AsLong(__pyx_1); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 127; goto __pyx_L1;} - Py_DECREF(__pyx_1); __pyx_1 = 0; - __pyx_3 = (!event_pending((&((struct __pyx_obj_5event_event *)__pyx_v_self)->ev),__pyx_6,0)); + __pyx_3 = (!event_pending((&((struct __pyx_obj_5event_event *)__pyx_v_self)->ev),__pyx_8,NULL)); } if (__pyx_3) { - - /* "/Users/dugsong/projects/pyevent/event.pyx":128 */ Py_DECREF(__pyx_v_self); goto __pyx_L6; } __pyx_L6:; - __pyx_r = Py_None; Py_INCREF(__pyx_r); + __pyx_r = Py_None; Py_INCREF(Py_None); goto __pyx_L0; __pyx_L1:; Py_XDECREF(__pyx_1); Py_XDECREF(__pyx_2); Py_XDECREF(__pyx_4); + Py_XDECREF(__pyx_5); + Py_XDECREF(__pyx_6); __Pyx_AddTraceback("event.event.__simple_callback"); __pyx_r = 0; __pyx_L0:; @@ -468,24 +478,22 @@ static PyObject *__pyx_f_5event_5event__ static PyObject *__pyx_f_5event_5event___callback(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static PyObject *__pyx_f_5event_5event___callback(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { short __pyx_v_evtype; - extern int event_gotsig; - extern int ((*event_sigcb)(void)); PyObject *__pyx_r; PyObject *__pyx_1 = 0; PyObject *__pyx_2 = 0; PyObject *__pyx_3 = 0; - short __pyx_4; - int __pyx_5; + PyObject *__pyx_4 = 0; + PyObject *__pyx_5 = 0; + short __pyx_6; + int __pyx_7; static char *__pyx_argnames[] = {"evtype",0}; if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "h", __pyx_argnames, &__pyx_v_evtype)) return 0; Py_INCREF(__pyx_v_self); - /* "/Users/dugsong/projects/pyevent/event.pyx":134 */ + /* "/usr/home/clsung/cvsroot/ports/devel/py-event/work/pyevent-0.3/event.pyx":125 */ /*try:*/ { - - /* "/Users/dugsong/projects/pyevent/event.pyx":135 */ - __pyx_1 = PyInt_FromLong(__pyx_v_evtype); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 135; goto __pyx_L2;} - __pyx_2 = PyTuple_New(4); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 135; goto __pyx_L2;} + __pyx_1 = PyInt_FromLong(__pyx_v_evtype); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 126; goto __pyx_L2;} + __pyx_2 = PyTuple_New(4); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 126; goto __pyx_L2;} Py_INCREF(__pyx_v_self); PyTuple_SET_ITEM(__pyx_2, 0, __pyx_v_self); Py_INCREF(((struct __pyx_obj_5event_event *)__pyx_v_self)->handle); @@ -494,7 +502,7 @@ static PyObject *__pyx_f_5event_5event__ Py_INCREF(((struct __pyx_obj_5event_event *)__pyx_v_self)->args); PyTuple_SET_ITEM(__pyx_2, 3, ((struct __pyx_obj_5event_event *)__pyx_v_self)->args); __pyx_1 = 0; - __pyx_1 = PyObject_CallObject(((struct __pyx_obj_5event_event *)__pyx_v_self)->callback, __pyx_2); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 135; goto __pyx_L2;} + __pyx_1 = PyObject_CallObject(((struct __pyx_obj_5event_event *)__pyx_v_self)->callback, __pyx_2); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 126; goto __pyx_L2;} Py_DECREF(__pyx_2); __pyx_2 = 0; Py_DECREF(__pyx_1); __pyx_1 = 0; } @@ -503,63 +511,55 @@ static PyObject *__pyx_f_5event_5event__ Py_XDECREF(__pyx_2); __pyx_2 = 0; Py_XDECREF(__pyx_1); __pyx_1 = 0; - /* "/Users/dugsong/projects/pyevent/event.pyx":136 */ + /* "/usr/home/clsung/cvsroot/ports/devel/py-event/work/pyevent-0.3/event.pyx":127 */ /*except:*/ { __Pyx_AddTraceback("event.__callback"); - __pyx_2 = __Pyx_GetExcValue(); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 136; goto __pyx_L1;} - Py_DECREF(__pyx_2); __pyx_2 = 0; - - /* "/Users/dugsong/projects/pyevent/event.pyx":137 */ - __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n_sys); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 137; goto __pyx_L1;} - __pyx_2 = PyObject_GetAttr(__pyx_1, __pyx_n_exc_info); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 137; goto __pyx_L1;} - Py_DECREF(__pyx_1); __pyx_1 = 0; - __pyx_1 = PyTuple_New(0); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 137; goto __pyx_L1;} - __pyx_3 = PyObject_CallObject(__pyx_2, __pyx_1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 137; goto __pyx_L1;} + if (__Pyx_GetException(&__pyx_2, &__pyx_1, &__pyx_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 127; goto __pyx_L1;} + __pyx_4 = __Pyx_GetName(__pyx_m, __pyx_n_sys); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 128; goto __pyx_L1;} + __pyx_5 = PyObject_GetAttr(__pyx_4, __pyx_n_exc_info); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 128; goto __pyx_L1;} + Py_DECREF(__pyx_4); __pyx_4 = 0; + __pyx_4 = PyObject_CallObject(__pyx_5, 0); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 128; goto __pyx_L1;} + Py_DECREF(__pyx_5); __pyx_5 = 0; + if (PyObject_SetAttr(__pyx_m, __pyx_n___event_exc, __pyx_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 128; goto __pyx_L1;} + Py_DECREF(__pyx_4); __pyx_4 = 0; Py_DECREF(__pyx_2); __pyx_2 = 0; Py_DECREF(__pyx_1); __pyx_1 = 0; - if (PyObject_SetAttr(__pyx_m, __pyx_n___event_exc, __pyx_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 137; goto __pyx_L1;} Py_DECREF(__pyx_3); __pyx_3 = 0; - - /* "/Users/dugsong/projects/pyevent/event.pyx":138 */ - event_sigcb = __pyx_f_5event___event_sigcb; - - /* "/Users/dugsong/projects/pyevent/event.pyx":139 */ - event_gotsig = 1; goto __pyx_L3; } __pyx_L3:; - /* "/Users/dugsong/projects/pyevent/event.pyx":140 */ - __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n_EV_READ); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 140; goto __pyx_L1;} - __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n_EV_WRITE); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 140; goto __pyx_L1;} - __pyx_3 = PyNumber_Or(__pyx_2, __pyx_1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 140; goto __pyx_L1;} - Py_DECREF(__pyx_2); __pyx_2 = 0; - Py_DECREF(__pyx_1); __pyx_1 = 0; - __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n_EV_SIGNAL); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 140; goto __pyx_L1;} - __pyx_1 = PyNumber_Or(__pyx_3, __pyx_2); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 140; goto __pyx_L1;} - Py_DECREF(__pyx_3); __pyx_3 = 0; + /* "/usr/home/clsung/cvsroot/ports/devel/py-event/work/pyevent-0.3/event.pyx":129 */ + __pyx_5 = __Pyx_GetName(__pyx_m, __pyx_n_EV_READ); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 129; goto __pyx_L1;} + __pyx_4 = __Pyx_GetName(__pyx_m, __pyx_n_EV_WRITE); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 129; goto __pyx_L1;} + __pyx_2 = PyNumber_Or(__pyx_5, __pyx_4); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 129; goto __pyx_L1;} + Py_DECREF(__pyx_5); __pyx_5 = 0; + Py_DECREF(__pyx_4); __pyx_4 = 0; + __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n_EV_SIGNAL); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 129; goto __pyx_L1;} + __pyx_3 = PyNumber_Or(__pyx_2, __pyx_1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 129; goto __pyx_L1;} Py_DECREF(__pyx_2); __pyx_2 = 0; - __pyx_3 = __Pyx_GetName(__pyx_m, __pyx_n_EV_TIMEOUT); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 140; goto __pyx_L1;} - __pyx_2 = PyNumber_Or(__pyx_1, __pyx_3); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 140; goto __pyx_L1;} Py_DECREF(__pyx_1); __pyx_1 = 0; + __pyx_5 = __Pyx_GetName(__pyx_m, __pyx_n_EV_TIMEOUT); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 129; goto __pyx_L1;} + __pyx_4 = PyNumber_Or(__pyx_3, __pyx_5); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 129; goto __pyx_L1;} Py_DECREF(__pyx_3); __pyx_3 = 0; - __pyx_4 = PyInt_AsLong(__pyx_2); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 140; goto __pyx_L1;} - Py_DECREF(__pyx_2); __pyx_2 = 0; - __pyx_5 = (!event_pending((&((struct __pyx_obj_5event_event *)__pyx_v_self)->ev),__pyx_4,0)); - if (__pyx_5) { - - /* "/Users/dugsong/projects/pyevent/event.pyx":141 */ + Py_DECREF(__pyx_5); __pyx_5 = 0; + __pyx_6 = PyInt_AsLong(__pyx_4); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 129; goto __pyx_L1;} + Py_DECREF(__pyx_4); __pyx_4 = 0; + __pyx_7 = (!event_pending((&((struct __pyx_obj_5event_event *)__pyx_v_self)->ev),__pyx_6,NULL)); + if (__pyx_7) { Py_DECREF(__pyx_v_self); goto __pyx_L4; } __pyx_L4:; - __pyx_r = Py_None; Py_INCREF(__pyx_r); + __pyx_r = Py_None; Py_INCREF(Py_None); goto __pyx_L0; __pyx_L1:; Py_XDECREF(__pyx_1); Py_XDECREF(__pyx_2); Py_XDECREF(__pyx_3); + Py_XDECREF(__pyx_4); + Py_XDECREF(__pyx_5); __Pyx_AddTraceback("event.event.__callback"); __pyx_r = 0; __pyx_L0:; @@ -578,64 +578,62 @@ static PyObject *__pyx_f_5event_5event_a short __pyx_4; int __pyx_5; static char *__pyx_argnames[] = {"timeout",0}; - __pyx_v_timeout = __pyx_k13; + __pyx_v_timeout = __pyx_d5; if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "|f", __pyx_argnames, &__pyx_v_timeout)) return 0; Py_INCREF(__pyx_v_self); - /* "/Users/dugsong/projects/pyevent/event.pyx":150 */ - __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n_EV_READ); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 150; goto __pyx_L1;} - __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n_EV_WRITE); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 150; goto __pyx_L1;} - __pyx_3 = PyNumber_Or(__pyx_1, __pyx_2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 150; goto __pyx_L1;} + /* "/usr/home/clsung/cvsroot/ports/devel/py-event/work/pyevent-0.3/event.pyx":139 */ + __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n_EV_READ); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 139; goto __pyx_L1;} + __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n_EV_WRITE); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 139; goto __pyx_L1;} + __pyx_3 = PyNumber_Or(__pyx_1, __pyx_2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 139; goto __pyx_L1;} Py_DECREF(__pyx_1); __pyx_1 = 0; Py_DECREF(__pyx_2); __pyx_2 = 0; - __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n_EV_SIGNAL); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 150; goto __pyx_L1;} - __pyx_2 = PyNumber_Or(__pyx_3, __pyx_1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 150; goto __pyx_L1;} + __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n_EV_SIGNAL); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 139; goto __pyx_L1;} + __pyx_2 = PyNumber_Or(__pyx_3, __pyx_1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 139; goto __pyx_L1;} Py_DECREF(__pyx_3); __pyx_3 = 0; Py_DECREF(__pyx_1); __pyx_1 = 0; - __pyx_3 = __Pyx_GetName(__pyx_m, __pyx_n_EV_TIMEOUT); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 150; goto __pyx_L1;} - __pyx_1 = PyNumber_Or(__pyx_2, __pyx_3); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 150; goto __pyx_L1;} + __pyx_3 = __Pyx_GetName(__pyx_m, __pyx_n_EV_TIMEOUT); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 139; goto __pyx_L1;} + __pyx_1 = PyNumber_Or(__pyx_2, __pyx_3); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 139; goto __pyx_L1;} Py_DECREF(__pyx_2); __pyx_2 = 0; Py_DECREF(__pyx_3); __pyx_3 = 0; - __pyx_4 = PyInt_AsLong(__pyx_1); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 150; goto __pyx_L1;} + __pyx_4 = PyInt_AsLong(__pyx_1); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 139; goto __pyx_L1;} Py_DECREF(__pyx_1); __pyx_1 = 0; - __pyx_5 = (!event_pending((&((struct __pyx_obj_5event_event *)__pyx_v_self)->ev),__pyx_4,0)); + __pyx_5 = (!event_pending((&((struct __pyx_obj_5event_event *)__pyx_v_self)->ev),__pyx_4,NULL)); if (__pyx_5) { - - /* "/Users/dugsong/projects/pyevent/event.pyx":152 */ Py_INCREF(__pyx_v_self); goto __pyx_L2; } __pyx_L2:; - /* "/Users/dugsong/projects/pyevent/event.pyx":153 */ + /* "/usr/home/clsung/cvsroot/ports/devel/py-event/work/pyevent-0.3/event.pyx":142 */ ((struct __pyx_obj_5event_event *)__pyx_v_self)->timeout = __pyx_v_timeout; - /* "/Users/dugsong/projects/pyevent/event.pyx":154 */ + /* "/usr/home/clsung/cvsroot/ports/devel/py-event/work/pyevent-0.3/event.pyx":143 */ __pyx_5 = (__pyx_v_timeout >= 0.0); if (__pyx_5) { - /* "/Users/dugsong/projects/pyevent/event.pyx":155 */ - ((struct __pyx_obj_5event_event *)__pyx_v_self)->tv.tv_sec = ((long )__pyx_v_timeout); + /* "/usr/home/clsung/cvsroot/ports/devel/py-event/work/pyevent-0.3/event.pyx":144 */ + ((struct __pyx_obj_5event_event *)__pyx_v_self)->tv.tv_sec = ((unsigned int)__pyx_v_timeout); - /* "/Users/dugsong/projects/pyevent/event.pyx":156 */ - ((struct __pyx_obj_5event_event *)__pyx_v_self)->tv.tv_usec = ((__pyx_v_timeout - ((float )((struct __pyx_obj_5event_event *)__pyx_v_self)->tv.tv_sec)) * 1000000.0); + /* "/usr/home/clsung/cvsroot/ports/devel/py-event/work/pyevent-0.3/event.pyx":145 */ + ((struct __pyx_obj_5event_event *)__pyx_v_self)->tv.tv_usec = (((long)(__pyx_v_timeout - ((float)((struct __pyx_obj_5event_event *)__pyx_v_self)->tv.tv_sec))) * 1000000); - /* "/Users/dugsong/projects/pyevent/event.pyx":157 */ + /* "/usr/home/clsung/cvsroot/ports/devel/py-event/work/pyevent-0.3/event.pyx":146 */ event_add((&((struct __pyx_obj_5event_event *)__pyx_v_self)->ev),(&((struct __pyx_obj_5event_event *)__pyx_v_self)->tv)); goto __pyx_L3; } /*else*/ { - /* "/Users/dugsong/projects/pyevent/event.pyx":159 */ + /* "/usr/home/clsung/cvsroot/ports/devel/py-event/work/pyevent-0.3/event.pyx":148 */ ((struct __pyx_obj_5event_event *)__pyx_v_self)->tv.tv_sec = 0; ((struct __pyx_obj_5event_event *)__pyx_v_self)->tv.tv_usec = 0; - /* "/Users/dugsong/projects/pyevent/event.pyx":160 */ - event_add((&((struct __pyx_obj_5event_event *)__pyx_v_self)->ev),0); + /* "/usr/home/clsung/cvsroot/ports/devel/py-event/work/pyevent-0.3/event.pyx":149 */ + event_add((&((struct __pyx_obj_5event_event *)__pyx_v_self)->ev),NULL); } __pyx_L3:; - __pyx_r = Py_None; Py_INCREF(__pyx_r); + __pyx_r = Py_None; Py_INCREF(Py_None); goto __pyx_L0; __pyx_L1:; Py_XDECREF(__pyx_1); @@ -659,29 +657,27 @@ static PyObject *__pyx_f_5event_5event_p static char *__pyx_argnames[] = {0}; if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "", __pyx_argnames)) return 0; Py_INCREF(__pyx_v_self); - - /* "/Users/dugsong/projects/pyevent/event.pyx":164 */ - __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n_EV_TIMEOUT); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 164; goto __pyx_L1;} - __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n_EV_SIGNAL); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 164; goto __pyx_L1;} - __pyx_3 = PyNumber_Or(__pyx_1, __pyx_2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 164; goto __pyx_L1;} + __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n_EV_TIMEOUT); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 153; goto __pyx_L1;} + __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n_EV_SIGNAL); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 153; goto __pyx_L1;} + __pyx_3 = PyNumber_Or(__pyx_1, __pyx_2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 153; goto __pyx_L1;} Py_DECREF(__pyx_1); __pyx_1 = 0; Py_DECREF(__pyx_2); __pyx_2 = 0; - __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n_EV_READ); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 164; goto __pyx_L1;} - __pyx_2 = PyNumber_Or(__pyx_3, __pyx_1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 164; goto __pyx_L1;} + __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n_EV_READ); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 153; goto __pyx_L1;} + __pyx_2 = PyNumber_Or(__pyx_3, __pyx_1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 153; goto __pyx_L1;} Py_DECREF(__pyx_3); __pyx_3 = 0; Py_DECREF(__pyx_1); __pyx_1 = 0; - __pyx_3 = __Pyx_GetName(__pyx_m, __pyx_n_EV_WRITE); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 164; goto __pyx_L1;} - __pyx_1 = PyNumber_Or(__pyx_2, __pyx_3); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 164; goto __pyx_L1;} + __pyx_3 = __Pyx_GetName(__pyx_m, __pyx_n_EV_WRITE); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 153; goto __pyx_L1;} + __pyx_1 = PyNumber_Or(__pyx_2, __pyx_3); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 153; goto __pyx_L1;} Py_DECREF(__pyx_2); __pyx_2 = 0; Py_DECREF(__pyx_3); __pyx_3 = 0; - __pyx_4 = PyInt_AsLong(__pyx_1); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 164; goto __pyx_L1;} + __pyx_4 = PyInt_AsLong(__pyx_1); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 153; goto __pyx_L1;} Py_DECREF(__pyx_1); __pyx_1 = 0; - __pyx_2 = PyInt_FromLong(event_pending((&((struct __pyx_obj_5event_event *)__pyx_v_self)->ev),__pyx_4,0)); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 164; goto __pyx_L1;} + __pyx_2 = PyInt_FromLong(event_pending((&((struct __pyx_obj_5event_event *)__pyx_v_self)->ev),__pyx_4,NULL)); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 153; goto __pyx_L1;} __pyx_r = __pyx_2; __pyx_2 = 0; goto __pyx_L0; - __pyx_r = Py_None; Py_INCREF(__pyx_r); + __pyx_r = Py_None; Py_INCREF(Py_None); goto __pyx_L0; __pyx_L1:; Py_XDECREF(__pyx_1); @@ -694,45 +690,37 @@ static PyObject *__pyx_f_5event_5event_p return __pyx_r; } -static PyObject *__pyx_n_pending; - static PyObject *__pyx_f_5event_5event_delete(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_5event_5event_delete[] = "Remove event from the event queue."; static PyObject *__pyx_f_5event_5event_delete(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_r; PyObject *__pyx_1 = 0; PyObject *__pyx_2 = 0; - PyObject *__pyx_3 = 0; - int __pyx_4; + int __pyx_3; static char *__pyx_argnames[] = {0}; if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "", __pyx_argnames)) return 0; Py_INCREF(__pyx_v_self); - - /* "/Users/dugsong/projects/pyevent/event.pyx":168 */ - __pyx_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n_pending); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 168; goto __pyx_L1;} - __pyx_2 = PyTuple_New(0); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 168; goto __pyx_L1;} - __pyx_3 = PyObject_CallObject(__pyx_1, __pyx_2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 168; goto __pyx_L1;} + __pyx_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n_pending); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 157; goto __pyx_L1;} + __pyx_2 = PyObject_CallObject(__pyx_1, 0); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 157; goto __pyx_L1;} Py_DECREF(__pyx_1); __pyx_1 = 0; + __pyx_3 = PyObject_IsTrue(__pyx_2); if (__pyx_3 < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 157; goto __pyx_L1;} Py_DECREF(__pyx_2); __pyx_2 = 0; - __pyx_4 = PyObject_IsTrue(__pyx_3); if (__pyx_4 < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 168; goto __pyx_L1;} - Py_DECREF(__pyx_3); __pyx_3 = 0; - if (__pyx_4) { + if (__pyx_3) { - /* "/Users/dugsong/projects/pyevent/event.pyx":169 */ + /* "/usr/home/clsung/cvsroot/ports/devel/py-event/work/pyevent-0.3/event.pyx":158 */ event_del((&((struct __pyx_obj_5event_event *)__pyx_v_self)->ev)); - /* "/Users/dugsong/projects/pyevent/event.pyx":170 */ + /* "/usr/home/clsung/cvsroot/ports/devel/py-event/work/pyevent-0.3/event.pyx":159 */ Py_DECREF(__pyx_v_self); goto __pyx_L2; } __pyx_L2:; - __pyx_r = Py_None; Py_INCREF(__pyx_r); + __pyx_r = Py_None; Py_INCREF(Py_None); goto __pyx_L0; __pyx_L1:; Py_XDECREF(__pyx_1); Py_XDECREF(__pyx_2); - Py_XDECREF(__pyx_3); __Pyx_AddTraceback("event.event.delete"); __pyx_r = 0; __pyx_L0:; @@ -740,47 +728,33 @@ static PyObject *__pyx_f_5event_5event_d return __pyx_r; } -static PyObject *__pyx_n_delete; - static void __pyx_f_5event_5event___dealloc__(PyObject *__pyx_v_self); /*proto*/ static void __pyx_f_5event_5event___dealloc__(PyObject *__pyx_v_self) { PyObject *__pyx_1 = 0; PyObject *__pyx_2 = 0; - PyObject *__pyx_3 = 0; Py_INCREF(__pyx_v_self); - - /* "/Users/dugsong/projects/pyevent/event.pyx":173 */ - __pyx_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n_delete); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 173; goto __pyx_L1;} - __pyx_2 = PyTuple_New(0); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 173; goto __pyx_L1;} - __pyx_3 = PyObject_CallObject(__pyx_1, __pyx_2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 173; goto __pyx_L1;} + __pyx_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n_delete); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 162; goto __pyx_L1;} + __pyx_2 = PyObject_CallObject(__pyx_1, 0); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 162; goto __pyx_L1;} Py_DECREF(__pyx_1); __pyx_1 = 0; Py_DECREF(__pyx_2); __pyx_2 = 0; - Py_DECREF(__pyx_3); __pyx_3 = 0; goto __pyx_L0; __pyx_L1:; Py_XDECREF(__pyx_1); Py_XDECREF(__pyx_2); - Py_XDECREF(__pyx_3); __Pyx_AddTraceback("event.event.__dealloc__"); __pyx_L0:; Py_DECREF(__pyx_v_self); } -static PyObject *__pyx_k15p; - -static char (__pyx_k15[]) = ""; - static PyObject *__pyx_f_5event_5event___repr__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_f_5event_5event___repr__(PyObject *__pyx_v_self) { PyObject *__pyx_r; PyObject *__pyx_1 = 0; PyObject *__pyx_2 = 0; Py_INCREF(__pyx_v_self); - - /* "/Users/dugsong/projects/pyevent/event.pyx":176 */ - __pyx_1 = PyInt_FromLong(((struct __pyx_obj_5event_event *)__pyx_v_self)->ev.ev_flags); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 177; goto __pyx_L1;} - __pyx_2 = PyTuple_New(4); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 177; goto __pyx_L1;} + __pyx_1 = PyInt_FromLong(((struct __pyx_obj_5event_event *)__pyx_v_self)->ev.ev_flags); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 166; goto __pyx_L1;} + __pyx_2 = PyTuple_New(4); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 166; goto __pyx_L1;} PyTuple_SET_ITEM(__pyx_2, 0, __pyx_1); Py_INCREF(((struct __pyx_obj_5event_event *)__pyx_v_self)->handle); PyTuple_SET_ITEM(__pyx_2, 1, ((struct __pyx_obj_5event_event *)__pyx_v_self)->handle); @@ -789,13 +763,13 @@ static PyObject *__pyx_f_5event_5event__ Py_INCREF(((struct __pyx_obj_5event_event *)__pyx_v_self)->args); PyTuple_SET_ITEM(__pyx_2, 3, ((struct __pyx_obj_5event_event *)__pyx_v_self)->args); __pyx_1 = 0; - __pyx_1 = PyNumber_Remainder(__pyx_k15p, __pyx_2); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 176; goto __pyx_L1;} + __pyx_1 = PyNumber_Remainder(__pyx_k13p, __pyx_2); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 165; goto __pyx_L1;} Py_DECREF(__pyx_2); __pyx_2 = 0; __pyx_r = __pyx_1; __pyx_1 = 0; goto __pyx_L0; - __pyx_r = Py_None; Py_INCREF(__pyx_r); + __pyx_r = Py_None; Py_INCREF(Py_None); goto __pyx_L0; __pyx_L1:; Py_XDECREF(__pyx_1); @@ -807,11 +781,6 @@ static PyObject *__pyx_f_5event_5event__ return __pyx_r; } -static PyObject *__pyx_n___init__; -static PyObject *__pyx_n_simple; -static PyObject *__pyx_n_add; - - static int __pyx_f_5event_4read___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static int __pyx_f_5event_4read___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_handle = 0; @@ -823,7 +792,7 @@ static int __pyx_f_5event_4read___init__ PyObject *__pyx_3 = 0; PyObject *__pyx_4 = 0; static char *__pyx_argnames[] = {"handle","callback",0}; - if (__Pyx_GetStarArgs(&__pyx_args, &__pyx_kwds, __pyx_argnames, 2, &__pyx_v_args, 0) < 0) return -1; + if (__Pyx_GetStarArgs(&__pyx_args, &__pyx_kwds, __pyx_argnames, 2, &__pyx_v_args, 0, 0) < 0) return -1; if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "OO", __pyx_argnames, &__pyx_v_handle, &__pyx_v_callback)) { Py_XDECREF(__pyx_args); Py_XDECREF(__pyx_kwds); @@ -834,11 +803,11 @@ static int __pyx_f_5event_4read___init__ Py_INCREF(__pyx_v_handle); Py_INCREF(__pyx_v_callback); - /* "/Users/dugsong/projects/pyevent/event.pyx":193 */ - __pyx_1 = PyObject_GetAttr(((PyObject*)__pyx_ptype_5event_event), __pyx_n___init__); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 193; goto __pyx_L1;} - __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n_EV_READ); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 193; goto __pyx_L1;} - __pyx_3 = PyTuple_New(5); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 193; goto __pyx_L1;} - Py_INCREF((PyObject *)__pyx_v_self); + /* "/usr/home/clsung/cvsroot/ports/devel/py-event/work/pyevent-0.3/event.pyx":182 */ + __pyx_1 = PyObject_GetAttr(((PyObject *)__pyx_ptype_5event_event), __pyx_n___init__); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 182; goto __pyx_L1;} + __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n_EV_READ); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 182; goto __pyx_L1;} + __pyx_3 = PyTuple_New(5); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 182; goto __pyx_L1;} + Py_INCREF(__pyx_v_self); PyTuple_SET_ITEM(__pyx_3, 0, __pyx_v_self); Py_INCREF(__pyx_v_callback); PyTuple_SET_ITEM(__pyx_3, 1, __pyx_v_callback); @@ -848,28 +817,26 @@ static int __pyx_f_5event_4read___init__ Py_INCREF(__pyx_v_handle); PyTuple_SET_ITEM(__pyx_3, 4, __pyx_v_handle); __pyx_2 = 0; - __pyx_2 = PyDict_New(); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 193; goto __pyx_L1;} - __pyx_4 = PyInt_FromLong(1); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 193; goto __pyx_L1;} - if (PyDict_SetItem(__pyx_2, __pyx_n_simple, __pyx_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 193; goto __pyx_L1;} + __pyx_2 = PyDict_New(); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 182; goto __pyx_L1;} + __pyx_4 = PyInt_FromLong(1); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 182; goto __pyx_L1;} + if (PyDict_SetItem(__pyx_2, __pyx_n_simple, __pyx_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 182; goto __pyx_L1;} Py_DECREF(__pyx_4); __pyx_4 = 0; - __pyx_4 = PyEval_CallObjectWithKeywords(__pyx_1, __pyx_3, __pyx_2); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 193; goto __pyx_L1;} + __pyx_4 = PyEval_CallObjectWithKeywords(__pyx_1, __pyx_3, __pyx_2); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 182; goto __pyx_L1;} Py_DECREF(__pyx_1); __pyx_1 = 0; Py_DECREF(__pyx_3); __pyx_3 = 0; Py_DECREF(__pyx_2); __pyx_2 = 0; Py_DECREF(__pyx_4); __pyx_4 = 0; - /* "/Users/dugsong/projects/pyevent/event.pyx":194 */ + /* "/usr/home/clsung/cvsroot/ports/devel/py-event/work/pyevent-0.3/event.pyx":183 */ Py_INCREF(__pyx_v_args); Py_DECREF(((struct __pyx_obj_5event_read *)__pyx_v_self)->__pyx_base.args); ((struct __pyx_obj_5event_read *)__pyx_v_self)->__pyx_base.args = __pyx_v_args; - /* "/Users/dugsong/projects/pyevent/event.pyx":195 */ - __pyx_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n_add); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 195; goto __pyx_L1;} - __pyx_3 = PyTuple_New(0); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 195; goto __pyx_L1;} - __pyx_2 = PyObject_CallObject(__pyx_1, __pyx_3); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 195; goto __pyx_L1;} + /* "/usr/home/clsung/cvsroot/ports/devel/py-event/work/pyevent-0.3/event.pyx":184 */ + __pyx_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n_add); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 184; goto __pyx_L1;} + __pyx_3 = PyObject_CallObject(__pyx_1, 0); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 184; goto __pyx_L1;} Py_DECREF(__pyx_1); __pyx_1 = 0; Py_DECREF(__pyx_3); __pyx_3 = 0; - Py_DECREF(__pyx_2); __pyx_2 = 0; __pyx_r = 0; goto __pyx_L0; @@ -890,7 +857,6 @@ static int __pyx_f_5event_4read___init__ return __pyx_r; } - static int __pyx_f_5event_5write___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static int __pyx_f_5event_5write___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_handle = 0; @@ -902,7 +868,7 @@ static int __pyx_f_5event_5write___init_ PyObject *__pyx_3 = 0; PyObject *__pyx_4 = 0; static char *__pyx_argnames[] = {"handle","callback",0}; - if (__Pyx_GetStarArgs(&__pyx_args, &__pyx_kwds, __pyx_argnames, 2, &__pyx_v_args, 0) < 0) return -1; + if (__Pyx_GetStarArgs(&__pyx_args, &__pyx_kwds, __pyx_argnames, 2, &__pyx_v_args, 0, 0) < 0) return -1; if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "OO", __pyx_argnames, &__pyx_v_handle, &__pyx_v_callback)) { Py_XDECREF(__pyx_args); Py_XDECREF(__pyx_kwds); @@ -913,11 +879,11 @@ static int __pyx_f_5event_5write___init_ Py_INCREF(__pyx_v_handle); Py_INCREF(__pyx_v_callback); - /* "/Users/dugsong/projects/pyevent/event.pyx":211 */ - __pyx_1 = PyObject_GetAttr(((PyObject*)__pyx_ptype_5event_event), __pyx_n___init__); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 211; goto __pyx_L1;} - __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n_EV_WRITE); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 211; goto __pyx_L1;} - __pyx_3 = PyTuple_New(5); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 211; goto __pyx_L1;} - Py_INCREF((PyObject *)__pyx_v_self); + /* "/usr/home/clsung/cvsroot/ports/devel/py-event/work/pyevent-0.3/event.pyx":200 */ + __pyx_1 = PyObject_GetAttr(((PyObject *)__pyx_ptype_5event_event), __pyx_n___init__); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 200; goto __pyx_L1;} + __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n_EV_WRITE); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 200; goto __pyx_L1;} + __pyx_3 = PyTuple_New(5); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 200; goto __pyx_L1;} + Py_INCREF(__pyx_v_self); PyTuple_SET_ITEM(__pyx_3, 0, __pyx_v_self); Py_INCREF(__pyx_v_callback); PyTuple_SET_ITEM(__pyx_3, 1, __pyx_v_callback); @@ -927,28 +893,26 @@ static int __pyx_f_5event_5write___init_ Py_INCREF(__pyx_v_handle); PyTuple_SET_ITEM(__pyx_3, 4, __pyx_v_handle); __pyx_2 = 0; - __pyx_2 = PyDict_New(); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 211; goto __pyx_L1;} - __pyx_4 = PyInt_FromLong(1); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 211; goto __pyx_L1;} - if (PyDict_SetItem(__pyx_2, __pyx_n_simple, __pyx_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 211; goto __pyx_L1;} + __pyx_2 = PyDict_New(); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 200; goto __pyx_L1;} + __pyx_4 = PyInt_FromLong(1); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 200; goto __pyx_L1;} + if (PyDict_SetItem(__pyx_2, __pyx_n_simple, __pyx_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 200; goto __pyx_L1;} Py_DECREF(__pyx_4); __pyx_4 = 0; - __pyx_4 = PyEval_CallObjectWithKeywords(__pyx_1, __pyx_3, __pyx_2); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 211; goto __pyx_L1;} + __pyx_4 = PyEval_CallObjectWithKeywords(__pyx_1, __pyx_3, __pyx_2); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 200; goto __pyx_L1;} Py_DECREF(__pyx_1); __pyx_1 = 0; Py_DECREF(__pyx_3); __pyx_3 = 0; Py_DECREF(__pyx_2); __pyx_2 = 0; Py_DECREF(__pyx_4); __pyx_4 = 0; - /* "/Users/dugsong/projects/pyevent/event.pyx":212 */ + /* "/usr/home/clsung/cvsroot/ports/devel/py-event/work/pyevent-0.3/event.pyx":201 */ Py_INCREF(__pyx_v_args); Py_DECREF(((struct __pyx_obj_5event_write *)__pyx_v_self)->__pyx_base.args); ((struct __pyx_obj_5event_write *)__pyx_v_self)->__pyx_base.args = __pyx_v_args; - /* "/Users/dugsong/projects/pyevent/event.pyx":213 */ - __pyx_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n_add); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 213; goto __pyx_L1;} - __pyx_3 = PyTuple_New(0); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 213; goto __pyx_L1;} - __pyx_2 = PyObject_CallObject(__pyx_1, __pyx_3); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 213; goto __pyx_L1;} + /* "/usr/home/clsung/cvsroot/ports/devel/py-event/work/pyevent-0.3/event.pyx":202 */ + __pyx_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n_add); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 202; goto __pyx_L1;} + __pyx_3 = PyObject_CallObject(__pyx_1, 0); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 202; goto __pyx_L1;} Py_DECREF(__pyx_1); __pyx_1 = 0; Py_DECREF(__pyx_3); __pyx_3 = 0; - Py_DECREF(__pyx_2); __pyx_2 = 0; __pyx_r = 0; goto __pyx_L0; @@ -969,7 +933,6 @@ static int __pyx_f_5event_5write___init_ return __pyx_r; } - static int __pyx_f_5event_6signal___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static int __pyx_f_5event_6signal___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_sig = 0; @@ -981,7 +944,7 @@ static int __pyx_f_5event_6signal___init PyObject *__pyx_3 = 0; PyObject *__pyx_4 = 0; static char *__pyx_argnames[] = {"sig","callback",0}; - if (__Pyx_GetStarArgs(&__pyx_args, &__pyx_kwds, __pyx_argnames, 2, &__pyx_v_args, 0) < 0) return -1; + if (__Pyx_GetStarArgs(&__pyx_args, &__pyx_kwds, __pyx_argnames, 2, &__pyx_v_args, 0, 0) < 0) return -1; if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "OO", __pyx_argnames, &__pyx_v_sig, &__pyx_v_callback)) { Py_XDECREF(__pyx_args); Py_XDECREF(__pyx_kwds); @@ -992,15 +955,15 @@ static int __pyx_f_5event_6signal___init Py_INCREF(__pyx_v_sig); Py_INCREF(__pyx_v_callback); - /* "/Users/dugsong/projects/pyevent/event.pyx":230 */ - __pyx_1 = PyObject_GetAttr(((PyObject*)__pyx_ptype_5event_event), __pyx_n___init__); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 230; goto __pyx_L1;} - __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n_EV_SIGNAL); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 230; goto __pyx_L1;} - __pyx_3 = __Pyx_GetName(__pyx_m, __pyx_n_EV_PERSIST); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 230; goto __pyx_L1;} - __pyx_4 = PyNumber_Or(__pyx_2, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 230; goto __pyx_L1;} + /* "/usr/home/clsung/cvsroot/ports/devel/py-event/work/pyevent-0.3/event.pyx":219 */ + __pyx_1 = PyObject_GetAttr(((PyObject *)__pyx_ptype_5event_event), __pyx_n___init__); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 219; goto __pyx_L1;} + __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n_EV_SIGNAL); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 219; goto __pyx_L1;} + __pyx_3 = __Pyx_GetName(__pyx_m, __pyx_n_EV_PERSIST); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 219; goto __pyx_L1;} + __pyx_4 = PyNumber_Or(__pyx_2, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 219; goto __pyx_L1;} Py_DECREF(__pyx_2); __pyx_2 = 0; Py_DECREF(__pyx_3); __pyx_3 = 0; - __pyx_2 = PyTuple_New(5); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 230; goto __pyx_L1;} - Py_INCREF((PyObject *)__pyx_v_self); + __pyx_2 = PyTuple_New(5); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 219; goto __pyx_L1;} + Py_INCREF(__pyx_v_self); PyTuple_SET_ITEM(__pyx_2, 0, __pyx_v_self); Py_INCREF(__pyx_v_callback); PyTuple_SET_ITEM(__pyx_2, 1, __pyx_v_callback); @@ -1010,28 +973,26 @@ static int __pyx_f_5event_6signal___init Py_INCREF(__pyx_v_sig); PyTuple_SET_ITEM(__pyx_2, 4, __pyx_v_sig); __pyx_4 = 0; - __pyx_3 = PyDict_New(); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 230; goto __pyx_L1;} - __pyx_4 = PyInt_FromLong(1); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 231; goto __pyx_L1;} - if (PyDict_SetItem(__pyx_3, __pyx_n_simple, __pyx_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 230; goto __pyx_L1;} + __pyx_3 = PyDict_New(); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 219; goto __pyx_L1;} + __pyx_4 = PyInt_FromLong(1); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 220; goto __pyx_L1;} + if (PyDict_SetItem(__pyx_3, __pyx_n_simple, __pyx_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 219; goto __pyx_L1;} Py_DECREF(__pyx_4); __pyx_4 = 0; - __pyx_4 = PyEval_CallObjectWithKeywords(__pyx_1, __pyx_2, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 230; goto __pyx_L1;} + __pyx_4 = PyEval_CallObjectWithKeywords(__pyx_1, __pyx_2, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 219; goto __pyx_L1;} Py_DECREF(__pyx_1); __pyx_1 = 0; Py_DECREF(__pyx_2); __pyx_2 = 0; Py_DECREF(__pyx_3); __pyx_3 = 0; Py_DECREF(__pyx_4); __pyx_4 = 0; - /* "/Users/dugsong/projects/pyevent/event.pyx":232 */ + /* "/usr/home/clsung/cvsroot/ports/devel/py-event/work/pyevent-0.3/event.pyx":221 */ Py_INCREF(__pyx_v_args); Py_DECREF(((struct __pyx_obj_5event_signal *)__pyx_v_self)->__pyx_base.args); ((struct __pyx_obj_5event_signal *)__pyx_v_self)->__pyx_base.args = __pyx_v_args; - /* "/Users/dugsong/projects/pyevent/event.pyx":233 */ - __pyx_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n_add); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 233; goto __pyx_L1;} - __pyx_2 = PyTuple_New(0); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 233; goto __pyx_L1;} - __pyx_3 = PyObject_CallObject(__pyx_1, __pyx_2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 233; goto __pyx_L1;} + /* "/usr/home/clsung/cvsroot/ports/devel/py-event/work/pyevent-0.3/event.pyx":222 */ + __pyx_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n_add); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 222; goto __pyx_L1;} + __pyx_2 = PyObject_CallObject(__pyx_1, 0); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 222; goto __pyx_L1;} Py_DECREF(__pyx_1); __pyx_1 = 0; Py_DECREF(__pyx_2); __pyx_2 = 0; - Py_DECREF(__pyx_3); __pyx_3 = 0; __pyx_r = 0; goto __pyx_L0; @@ -1052,7 +1013,6 @@ static int __pyx_f_5event_6signal___init return __pyx_r; } - static int __pyx_f_5event_7timeout___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static int __pyx_f_5event_7timeout___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_secs = 0; @@ -1064,7 +1024,7 @@ static int __pyx_f_5event_7timeout___ini PyObject *__pyx_3 = 0; PyObject *__pyx_4 = 0; static char *__pyx_argnames[] = {"secs","callback",0}; - if (__Pyx_GetStarArgs(&__pyx_args, &__pyx_kwds, __pyx_argnames, 2, &__pyx_v_args, 0) < 0) return -1; + if (__Pyx_GetStarArgs(&__pyx_args, &__pyx_kwds, __pyx_argnames, 2, &__pyx_v_args, 0, 0) < 0) return -1; if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "OO", __pyx_argnames, &__pyx_v_secs, &__pyx_v_callback)) { Py_XDECREF(__pyx_args); Py_XDECREF(__pyx_kwds); @@ -1075,36 +1035,36 @@ static int __pyx_f_5event_7timeout___ini Py_INCREF(__pyx_v_secs); Py_INCREF(__pyx_v_callback); - /* "/Users/dugsong/projects/pyevent/event.pyx":249 */ - __pyx_1 = PyObject_GetAttr(((PyObject*)__pyx_ptype_5event_event), __pyx_n___init__); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 249; goto __pyx_L1;} - __pyx_2 = PyTuple_New(3); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 249; goto __pyx_L1;} - Py_INCREF((PyObject *)__pyx_v_self); + /* "/usr/home/clsung/cvsroot/ports/devel/py-event/work/pyevent-0.3/event.pyx":238 */ + __pyx_1 = PyObject_GetAttr(((PyObject *)__pyx_ptype_5event_event), __pyx_n___init__); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 238; goto __pyx_L1;} + __pyx_2 = PyTuple_New(3); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 238; goto __pyx_L1;} + Py_INCREF(__pyx_v_self); PyTuple_SET_ITEM(__pyx_2, 0, __pyx_v_self); Py_INCREF(__pyx_v_callback); PyTuple_SET_ITEM(__pyx_2, 1, __pyx_v_callback); Py_INCREF(__pyx_v_args); PyTuple_SET_ITEM(__pyx_2, 2, __pyx_v_args); - __pyx_3 = PyDict_New(); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 249; goto __pyx_L1;} - __pyx_4 = PyInt_FromLong(1); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 249; goto __pyx_L1;} - if (PyDict_SetItem(__pyx_3, __pyx_n_simple, __pyx_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 249; goto __pyx_L1;} + __pyx_3 = PyDict_New(); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 238; goto __pyx_L1;} + __pyx_4 = PyInt_FromLong(1); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 238; goto __pyx_L1;} + if (PyDict_SetItem(__pyx_3, __pyx_n_simple, __pyx_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 238; goto __pyx_L1;} Py_DECREF(__pyx_4); __pyx_4 = 0; - __pyx_4 = PyEval_CallObjectWithKeywords(__pyx_1, __pyx_2, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 249; goto __pyx_L1;} + __pyx_4 = PyEval_CallObjectWithKeywords(__pyx_1, __pyx_2, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 238; goto __pyx_L1;} Py_DECREF(__pyx_1); __pyx_1 = 0; Py_DECREF(__pyx_2); __pyx_2 = 0; Py_DECREF(__pyx_3); __pyx_3 = 0; Py_DECREF(__pyx_4); __pyx_4 = 0; - /* "/Users/dugsong/projects/pyevent/event.pyx":250 */ + /* "/usr/home/clsung/cvsroot/ports/devel/py-event/work/pyevent-0.3/event.pyx":239 */ Py_INCREF(__pyx_v_args); Py_DECREF(((struct __pyx_obj_5event_timeout *)__pyx_v_self)->__pyx_base.args); ((struct __pyx_obj_5event_timeout *)__pyx_v_self)->__pyx_base.args = __pyx_v_args; - /* "/Users/dugsong/projects/pyevent/event.pyx":251 */ - __pyx_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n_add); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 251; goto __pyx_L1;} - __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 251; goto __pyx_L1;} + /* "/usr/home/clsung/cvsroot/ports/devel/py-event/work/pyevent-0.3/event.pyx":240 */ + __pyx_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n_add); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 240; goto __pyx_L1;} + __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 240; goto __pyx_L1;} Py_INCREF(__pyx_v_secs); PyTuple_SET_ITEM(__pyx_2, 0, __pyx_v_secs); - __pyx_3 = PyObject_CallObject(__pyx_1, __pyx_2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 251; goto __pyx_L1;} + __pyx_3 = PyObject_CallObject(__pyx_1, __pyx_2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 240; goto __pyx_L1;} Py_DECREF(__pyx_1); __pyx_1 = 0; Py_DECREF(__pyx_2); __pyx_2 = 0; Py_DECREF(__pyx_3); __pyx_3 = 0; @@ -1134,16 +1094,9 @@ static PyObject *__pyx_f_5event_init(PyO PyObject *__pyx_r; static char *__pyx_argnames[] = {0}; if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "", __pyx_argnames)) return 0; - - /* "/Users/dugsong/projects/pyevent/event.pyx":255 */ event_init(); - __pyx_r = Py_None; Py_INCREF(__pyx_r); - goto __pyx_L0; - __pyx_L1:; - __Pyx_AddTraceback("event.init"); - __pyx_r = 0; - __pyx_L0:; + __pyx_r = Py_None; Py_INCREF(Py_None); return __pyx_r; } @@ -1156,52 +1109,42 @@ static PyObject *__pyx_f_5event_dispatch PyObject *__pyx_3 = 0; PyObject *__pyx_4 = 0; PyObject *__pyx_5 = 0; - PyObject *__pyx_6 = 0; static char *__pyx_argnames[] = {0}; if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "", __pyx_argnames)) return 0; - /* "/Users/dugsong/projects/pyevent/event.pyx":260 */ + /* "/usr/home/clsung/cvsroot/ports/devel/py-event/work/pyevent-0.3/event.pyx":249 */ event_dispatch(); - /* "/Users/dugsong/projects/pyevent/event.pyx":261 */ - __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n___event_exc); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 261; goto __pyx_L1;} - __pyx_2 = PyObject_IsTrue(__pyx_1); if (__pyx_2 < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 261; goto __pyx_L1;} + /* "/usr/home/clsung/cvsroot/ports/devel/py-event/work/pyevent-0.3/event.pyx":250 */ + __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n___event_exc); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 250; goto __pyx_L1;} + __pyx_2 = PyObject_IsTrue(__pyx_1); if (__pyx_2 < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 250; goto __pyx_L1;} Py_DECREF(__pyx_1); __pyx_1 = 0; if (__pyx_2) { - - /* "/Users/dugsong/projects/pyevent/event.pyx":262 */ - __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n___event_exc); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 262; goto __pyx_L1;} - __pyx_3 = PyInt_FromLong(0); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 262; goto __pyx_L1;} - __pyx_4 = PyObject_GetItem(__pyx_1, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 262; goto __pyx_L1;} + __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n___event_exc); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 251; goto __pyx_L1;} + __pyx_3 = __Pyx_GetItemInt(__pyx_1, 0); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 251; goto __pyx_L1;} Py_DECREF(__pyx_1); __pyx_1 = 0; - Py_DECREF(__pyx_3); __pyx_3 = 0; - __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n___event_exc); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 262; goto __pyx_L1;} - __pyx_3 = PyInt_FromLong(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 262; goto __pyx_L1;} - __pyx_5 = PyObject_GetItem(__pyx_1, __pyx_3); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 262; goto __pyx_L1;} + __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n___event_exc); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 251; goto __pyx_L1;} + __pyx_4 = __Pyx_GetItemInt(__pyx_1, 1); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 251; goto __pyx_L1;} Py_DECREF(__pyx_1); __pyx_1 = 0; - Py_DECREF(__pyx_3); __pyx_3 = 0; - __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n___event_exc); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 262; goto __pyx_L1;} - __pyx_3 = PyInt_FromLong(2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 262; goto __pyx_L1;} - __pyx_6 = PyObject_GetItem(__pyx_1, __pyx_3); if (!__pyx_6) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 262; goto __pyx_L1;} + __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n___event_exc); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 251; goto __pyx_L1;} + __pyx_5 = __Pyx_GetItemInt(__pyx_1, 2); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 251; goto __pyx_L1;} Py_DECREF(__pyx_1); __pyx_1 = 0; + __Pyx_Raise(__pyx_3, __pyx_4, __pyx_5); Py_DECREF(__pyx_3); __pyx_3 = 0; - __Pyx_Raise(__pyx_4, __pyx_5, __pyx_6); Py_DECREF(__pyx_4); __pyx_4 = 0; Py_DECREF(__pyx_5); __pyx_5 = 0; - Py_DECREF(__pyx_6); __pyx_6 = 0; - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 262; goto __pyx_L1;} + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 251; goto __pyx_L1;} goto __pyx_L2; } __pyx_L2:; - __pyx_r = Py_None; Py_INCREF(__pyx_r); + __pyx_r = Py_None; Py_INCREF(Py_None); goto __pyx_L0; __pyx_L1:; Py_XDECREF(__pyx_1); Py_XDECREF(__pyx_3); Py_XDECREF(__pyx_4); Py_XDECREF(__pyx_5); - Py_XDECREF(__pyx_6); __Pyx_AddTraceback("event.dispatch"); __pyx_r = 0; __pyx_L0:; @@ -1216,27 +1159,25 @@ static PyObject *__pyx_f_5event_loop(PyO PyObject *__pyx_r; int __pyx_1; static char *__pyx_argnames[] = {"nonblock",0}; - __pyx_v_nonblock = __pyx_k14; + __pyx_v_nonblock = __pyx_d6; if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "|O", __pyx_argnames, &__pyx_v_nonblock)) return 0; Py_INCREF(__pyx_v_nonblock); - /* "/Users/dugsong/projects/pyevent/event.pyx":267 */ + /* "/usr/home/clsung/cvsroot/ports/devel/py-event/work/pyevent-0.3/event.pyx":256 */ __pyx_v_flags = EVLOOP_ONCE; - /* "/Users/dugsong/projects/pyevent/event.pyx":268 */ - __pyx_1 = PyObject_IsTrue(__pyx_v_nonblock); if (__pyx_1 < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 268; goto __pyx_L1;} + /* "/usr/home/clsung/cvsroot/ports/devel/py-event/work/pyevent-0.3/event.pyx":257 */ + __pyx_1 = PyObject_IsTrue(__pyx_v_nonblock); if (__pyx_1 < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 257; goto __pyx_L1;} if (__pyx_1) { - - /* "/Users/dugsong/projects/pyevent/event.pyx":269 */ __pyx_v_flags = (EVLOOP_ONCE | EVLOOP_NONBLOCK); goto __pyx_L2; } __pyx_L2:; - /* "/Users/dugsong/projects/pyevent/event.pyx":270 */ + /* "/usr/home/clsung/cvsroot/ports/devel/py-event/work/pyevent-0.3/event.pyx":259 */ event_loop(__pyx_v_flags); - __pyx_r = Py_None; Py_INCREF(__pyx_r); + __pyx_r = Py_None; Py_INCREF(Py_None); goto __pyx_L0; __pyx_L1:; __Pyx_AddTraceback("event.loop"); @@ -1249,78 +1190,23 @@ static PyObject *__pyx_f_5event_loop(PyO static PyObject *__pyx_f_5event_abort(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_5event_abort[] = "Abort event dispatch loop."; static PyObject *__pyx_f_5event_abort(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { - extern int event_gotsig; - extern int ((*event_sigcb)(void)); PyObject *__pyx_r; static char *__pyx_argnames[] = {0}; if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "", __pyx_argnames)) return 0; - /* "/Users/dugsong/projects/pyevent/event.pyx":276 */ - event_sigcb = __pyx_f_5event___event_sigcb; - - /* "/Users/dugsong/projects/pyevent/event.pyx":277 */ - event_gotsig = 1; - - __pyx_r = Py_None; Py_INCREF(__pyx_r); - goto __pyx_L0; - __pyx_L1:; - __Pyx_AddTraceback("event.abort"); - __pyx_r = 0; - __pyx_L0:; + __pyx_r = Py_None; Py_INCREF(Py_None); return __pyx_r; } -static __Pyx_InternTabEntry __pyx_intern_tab[] = { - {&__pyx_n_BSD, "BSD"}, - {&__pyx_n_EV_PERSIST, "EV_PERSIST"}, - {&__pyx_n_EV_READ, "EV_READ"}, - {&__pyx_n_EV_SIGNAL, "EV_SIGNAL"}, - {&__pyx_n_EV_TIMEOUT, "EV_TIMEOUT"}, - {&__pyx_n_EV_WRITE, "EV_WRITE"}, - {&__pyx_n_False, "False"}, - {&__pyx_n___author__, "__author__"}, - {&__pyx_n___callback, "__callback"}, - {&__pyx_n___copyright__, "__copyright__"}, - {&__pyx_n___event_exc, "__event_exc"}, - {&__pyx_n___init__, "__init__"}, - {&__pyx_n___license__, "__license__"}, - {&__pyx_n___simple_callback, "__simple_callback"}, - {&__pyx_n___url__, "__url__"}, - {&__pyx_n___version__, "__version__"}, - {&__pyx_n_abort, "abort"}, - {&__pyx_n_add, "add"}, - {&__pyx_n_delete, "delete"}, - {&__pyx_n_dispatch, "dispatch"}, - {&__pyx_n_exc_info, "exc_info"}, - {&__pyx_n_fileno, "fileno"}, - {&__pyx_n_init, "init"}, - {&__pyx_n_int, "int"}, - {&__pyx_n_isinstance, "isinstance"}, - {&__pyx_n_loop, "loop"}, - {&__pyx_n_pending, "pending"}, - {&__pyx_n_simple, "simple"}, - {&__pyx_n_sys, "sys"}, - {0, 0} -}; - -static __Pyx_StringTabEntry __pyx_string_tab[] = { - {&__pyx_k1p, __pyx_k1, sizeof(__pyx_k1)}, - {&__pyx_k2p, __pyx_k2, sizeof(__pyx_k2)}, - {&__pyx_k3p, __pyx_k3, sizeof(__pyx_k3)}, - {&__pyx_k4p, __pyx_k4, sizeof(__pyx_k4)}, - {&__pyx_k6p, __pyx_k6, sizeof(__pyx_k6)}, - {&__pyx_k7p, __pyx_k7, sizeof(__pyx_k7)}, - {&__pyx_k15p, __pyx_k15, sizeof(__pyx_k15)}, - {0, 0, 0} -}; - static PyObject *__pyx_tp_new_5event_event(PyTypeObject *t, PyObject *a, PyObject *k) { + struct __pyx_obj_5event_event *p; PyObject *o = (*t->tp_alloc)(t, 0); - struct __pyx_obj_5event_event *p = (struct __pyx_obj_5event_event *)o; - p->handle = Py_None; Py_INCREF(p->handle); - p->evtype = Py_None; Py_INCREF(p->evtype); - p->callback = Py_None; Py_INCREF(p->callback); - p->args = Py_None; Py_INCREF(p->args); + if (!o) return 0; + p = ((struct __pyx_obj_5event_event *)o); + p->handle = Py_None; Py_INCREF(Py_None); + p->evtype = Py_None; Py_INCREF(Py_None); + p->callback = Py_None; Py_INCREF(Py_None); + p->args = Py_None; Py_INCREF(Py_None); return o; } @@ -1362,14 +1248,19 @@ static int __pyx_tp_traverse_5event_even static int __pyx_tp_clear_5event_event(PyObject *o) { struct __pyx_obj_5event_event *p = (struct __pyx_obj_5event_event *)o; - Py_XDECREF(p->handle); - p->handle = Py_None; Py_INCREF(p->handle); - Py_XDECREF(p->evtype); - p->evtype = Py_None; Py_INCREF(p->evtype); - Py_XDECREF(p->callback); - p->callback = Py_None; Py_INCREF(p->callback); - Py_XDECREF(p->args); - p->args = Py_None; Py_INCREF(p->args); + PyObject *t; + t = p->handle; + p->handle = Py_None; Py_INCREF(Py_None); + Py_XDECREF(t); + t = p->evtype; + p->evtype = Py_None; Py_INCREF(Py_None); + Py_XDECREF(t); + t = p->callback; + p->callback = Py_None; Py_INCREF(Py_None); + Py_XDECREF(t); + t = p->args; + p->args = Py_None; Py_INCREF(Py_None); + Py_XDECREF(t); return 0; } @@ -1421,6 +1312,9 @@ static PyNumberMethods __pyx_tp_as_numbe 0, /*nb_true_divide*/ 0, /*nb_inplace_floor_divide*/ 0, /*nb_inplace_true_divide*/ + #if Py_TPFLAGS_DEFAULT & Py_TPFLAGS_HAVE_INDEX + 0, /*nb_index*/ + #endif }; static PySequenceMethods __pyx_tp_as_sequence_event = { @@ -1449,7 +1343,7 @@ static PyBufferProcs __pyx_tp_as_buffer_ 0, /*bf_getcharbuffer*/ }; -statichere PyTypeObject __pyx_type_5event_event = { +PyTypeObject __pyx_type_5event_event = { PyObject_HEAD_INIT(0) 0, /*ob_size*/ "event.event", /*tp_name*/ @@ -1500,28 +1394,14 @@ statichere PyTypeObject __pyx_type_5even static PyObject *__pyx_tp_new_5event_read(PyTypeObject *t, PyObject *a, PyObject *k) { PyObject *o = __pyx_ptype_5event_event->tp_new(t, a, k); - struct __pyx_obj_5event_read *p = (struct __pyx_obj_5event_read *)o; + if (!o) return 0; return o; } static void __pyx_tp_dealloc_5event_read(PyObject *o) { - struct __pyx_obj_5event_read *p = (struct __pyx_obj_5event_read *)o; __pyx_ptype_5event_event->tp_dealloc(o); } -static int __pyx_tp_traverse_5event_read(PyObject *o, visitproc v, void *a) { - int e; - struct __pyx_obj_5event_read *p = (struct __pyx_obj_5event_read *)o; - __pyx_ptype_5event_event->tp_traverse(o, v, a); - return 0; -} - -static int __pyx_tp_clear_5event_read(PyObject *o) { - struct __pyx_obj_5event_read *p = (struct __pyx_obj_5event_read *)o; - __pyx_ptype_5event_event->tp_clear(o); - return 0; -} - static struct PyMethodDef __pyx_methods_5event_read[] = { {0, 0, 0, 0} }; @@ -1565,6 +1445,9 @@ static PyNumberMethods __pyx_tp_as_numbe 0, /*nb_true_divide*/ 0, /*nb_inplace_floor_divide*/ 0, /*nb_inplace_true_divide*/ + #if Py_TPFLAGS_DEFAULT & Py_TPFLAGS_HAVE_INDEX + 0, /*nb_index*/ + #endif }; static PySequenceMethods __pyx_tp_as_sequence_read = { @@ -1593,7 +1476,7 @@ static PyBufferProcs __pyx_tp_as_buffer_ 0, /*bf_getcharbuffer*/ }; -statichere PyTypeObject __pyx_type_5event_read = { +PyTypeObject __pyx_type_5event_read = { PyObject_HEAD_INIT(0) 0, /*ob_size*/ "event.read", /*tp_name*/ @@ -1616,8 +1499,8 @@ statichere PyTypeObject __pyx_type_5even &__pyx_tp_as_buffer_read, /*tp_as_buffer*/ Py_TPFLAGS_DEFAULT|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_BASETYPE, /*tp_flags*/ "read(handle, callback, *args) -> event object\n \n Simplified event interface:\n Create a new read event, and add it to the event queue.\n \n Arguments:\n\n handle -- file handle, descriptor, or socket\n callback -- user callback with (*args) prototype, which can return\n a non-None value to be rescheduled\n *args -- optional callback arguments\n ", /*tp_doc*/ - __pyx_tp_traverse_5event_read, /*tp_traverse*/ - __pyx_tp_clear_5event_read, /*tp_clear*/ + 0, /*tp_traverse*/ + 0, /*tp_clear*/ 0, /*tp_richcompare*/ 0, /*tp_weaklistoffset*/ 0, /*tp_iter*/ @@ -1644,28 +1527,14 @@ statichere PyTypeObject __pyx_type_5even static PyObject *__pyx_tp_new_5event_write(PyTypeObject *t, PyObject *a, PyObject *k) { PyObject *o = __pyx_ptype_5event_event->tp_new(t, a, k); - struct __pyx_obj_5event_write *p = (struct __pyx_obj_5event_write *)o; + if (!o) return 0; return o; } static void __pyx_tp_dealloc_5event_write(PyObject *o) { - struct __pyx_obj_5event_write *p = (struct __pyx_obj_5event_write *)o; __pyx_ptype_5event_event->tp_dealloc(o); } -static int __pyx_tp_traverse_5event_write(PyObject *o, visitproc v, void *a) { - int e; - struct __pyx_obj_5event_write *p = (struct __pyx_obj_5event_write *)o; - __pyx_ptype_5event_event->tp_traverse(o, v, a); - return 0; -} - -static int __pyx_tp_clear_5event_write(PyObject *o) { - struct __pyx_obj_5event_write *p = (struct __pyx_obj_5event_write *)o; - __pyx_ptype_5event_event->tp_clear(o); - return 0; -} - static struct PyMethodDef __pyx_methods_5event_write[] = { {0, 0, 0, 0} }; @@ -1709,6 +1578,9 @@ static PyNumberMethods __pyx_tp_as_numbe 0, /*nb_true_divide*/ 0, /*nb_inplace_floor_divide*/ 0, /*nb_inplace_true_divide*/ + #if Py_TPFLAGS_DEFAULT & Py_TPFLAGS_HAVE_INDEX + 0, /*nb_index*/ + #endif }; static PySequenceMethods __pyx_tp_as_sequence_write = { @@ -1737,7 +1609,7 @@ static PyBufferProcs __pyx_tp_as_buffer_ 0, /*bf_getcharbuffer*/ }; -statichere PyTypeObject __pyx_type_5event_write = { +PyTypeObject __pyx_type_5event_write = { PyObject_HEAD_INIT(0) 0, /*ob_size*/ "event.write", /*tp_name*/ @@ -1760,8 +1632,8 @@ statichere PyTypeObject __pyx_type_5even &__pyx_tp_as_buffer_write, /*tp_as_buffer*/ Py_TPFLAGS_DEFAULT|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_BASETYPE, /*tp_flags*/ "write(handle, callback, *args) -> event object\n\n Simplified event interface:\n Create a new write event, and add it to the event queue.\n \n Arguments:\n\n handle -- file handle, descriptor, or socket\n callback -- user callback with (*args) prototype, which can return\n a non-None value to be rescheduled\n *args -- optional callback arguments\n ", /*tp_doc*/ - __pyx_tp_traverse_5event_write, /*tp_traverse*/ - __pyx_tp_clear_5event_write, /*tp_clear*/ + 0, /*tp_traverse*/ + 0, /*tp_clear*/ 0, /*tp_richcompare*/ 0, /*tp_weaklistoffset*/ 0, /*tp_iter*/ @@ -1788,28 +1660,14 @@ statichere PyTypeObject __pyx_type_5even static PyObject *__pyx_tp_new_5event_signal(PyTypeObject *t, PyObject *a, PyObject *k) { PyObject *o = __pyx_ptype_5event_event->tp_new(t, a, k); - struct __pyx_obj_5event_signal *p = (struct __pyx_obj_5event_signal *)o; + if (!o) return 0; return o; } static void __pyx_tp_dealloc_5event_signal(PyObject *o) { - struct __pyx_obj_5event_signal *p = (struct __pyx_obj_5event_signal *)o; __pyx_ptype_5event_event->tp_dealloc(o); } -static int __pyx_tp_traverse_5event_signal(PyObject *o, visitproc v, void *a) { - int e; - struct __pyx_obj_5event_signal *p = (struct __pyx_obj_5event_signal *)o; - __pyx_ptype_5event_event->tp_traverse(o, v, a); - return 0; -} - -static int __pyx_tp_clear_5event_signal(PyObject *o) { - struct __pyx_obj_5event_signal *p = (struct __pyx_obj_5event_signal *)o; - __pyx_ptype_5event_event->tp_clear(o); - return 0; -} - static struct PyMethodDef __pyx_methods_5event_signal[] = { {0, 0, 0, 0} }; @@ -1853,6 +1711,9 @@ static PyNumberMethods __pyx_tp_as_numbe 0, /*nb_true_divide*/ 0, /*nb_inplace_floor_divide*/ 0, /*nb_inplace_true_divide*/ + #if Py_TPFLAGS_DEFAULT & Py_TPFLAGS_HAVE_INDEX + 0, /*nb_index*/ + #endif }; static PySequenceMethods __pyx_tp_as_sequence_signal = { @@ -1881,7 +1742,7 @@ static PyBufferProcs __pyx_tp_as_buffer_ 0, /*bf_getcharbuffer*/ }; -statichere PyTypeObject __pyx_type_5event_signal = { +PyTypeObject __pyx_type_5event_signal = { PyObject_HEAD_INIT(0) 0, /*ob_size*/ "event.signal", /*tp_name*/ @@ -1904,8 +1765,8 @@ statichere PyTypeObject __pyx_type_5even &__pyx_tp_as_buffer_signal, /*tp_as_buffer*/ Py_TPFLAGS_DEFAULT|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_BASETYPE, /*tp_flags*/ "signal(sig, callback, *args) -> event object\n\n Simplified event interface:\n Create a new signal event, and add it to the event queue.\n XXX - persistent event is added with EV_PERSIST, like signal_set()\n \n Arguments:\n\n sig -- signal number\n callback -- user callback with (*args) prototype, which can return\n a non-None value to be rescheduled\n *args -- optional callback arguments\n ", /*tp_doc*/ - __pyx_tp_traverse_5event_signal, /*tp_traverse*/ - __pyx_tp_clear_5event_signal, /*tp_clear*/ + 0, /*tp_traverse*/ + 0, /*tp_clear*/ 0, /*tp_richcompare*/ 0, /*tp_weaklistoffset*/ 0, /*tp_iter*/ @@ -1932,28 +1793,14 @@ statichere PyTypeObject __pyx_type_5even static PyObject *__pyx_tp_new_5event_timeout(PyTypeObject *t, PyObject *a, PyObject *k) { PyObject *o = __pyx_ptype_5event_event->tp_new(t, a, k); - struct __pyx_obj_5event_timeout *p = (struct __pyx_obj_5event_timeout *)o; + if (!o) return 0; return o; } static void __pyx_tp_dealloc_5event_timeout(PyObject *o) { - struct __pyx_obj_5event_timeout *p = (struct __pyx_obj_5event_timeout *)o; __pyx_ptype_5event_event->tp_dealloc(o); } -static int __pyx_tp_traverse_5event_timeout(PyObject *o, visitproc v, void *a) { - int e; - struct __pyx_obj_5event_timeout *p = (struct __pyx_obj_5event_timeout *)o; - __pyx_ptype_5event_event->tp_traverse(o, v, a); - return 0; -} - -static int __pyx_tp_clear_5event_timeout(PyObject *o) { - struct __pyx_obj_5event_timeout *p = (struct __pyx_obj_5event_timeout *)o; - __pyx_ptype_5event_event->tp_clear(o); - return 0; -} - static struct PyMethodDef __pyx_methods_5event_timeout[] = { {0, 0, 0, 0} }; @@ -1997,6 +1844,9 @@ static PyNumberMethods __pyx_tp_as_numbe 0, /*nb_true_divide*/ 0, /*nb_inplace_floor_divide*/ 0, /*nb_inplace_true_divide*/ + #if Py_TPFLAGS_DEFAULT & Py_TPFLAGS_HAVE_INDEX + 0, /*nb_index*/ + #endif }; static PySequenceMethods __pyx_tp_as_sequence_timeout = { @@ -2025,7 +1875,7 @@ static PyBufferProcs __pyx_tp_as_buffer_ 0, /*bf_getcharbuffer*/ }; -statichere PyTypeObject __pyx_type_5event_timeout = { +PyTypeObject __pyx_type_5event_timeout = { PyObject_HEAD_INIT(0) 0, /*ob_size*/ "event.timeout", /*tp_name*/ @@ -2048,8 +1898,8 @@ statichere PyTypeObject __pyx_type_5even &__pyx_tp_as_buffer_timeout, /*tp_as_buffer*/ Py_TPFLAGS_DEFAULT|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_BASETYPE, /*tp_flags*/ "timeout(secs, callback, *args) -> event object\n\n Simplified event interface:\n Create a new timer event, and add it to the event queue.\n\n Arguments:\n\n secs -- event timeout in seconds\n callback -- user callback with (*args) prototype, which can return\n a non-None value to be rescheduled\n *args -- optional callback arguments\n ", /*tp_doc*/ - __pyx_tp_traverse_5event_timeout, /*tp_traverse*/ - __pyx_tp_clear_5event_timeout, /*tp_clear*/ + 0, /*tp_traverse*/ + 0, /*tp_clear*/ 0, /*tp_richcompare*/ 0, /*tp_weaklistoffset*/ 0, /*tp_iter*/ @@ -2082,155 +1932,199 @@ static struct PyMethodDef __pyx_methods[ {0, 0, 0, 0} }; -DL_EXPORT(void) initevent(void); /*proto*/ -DL_EXPORT(void) initevent(void) { +static void __pyx_init_filenames(void); /*proto*/ + +PyMODINIT_FUNC initevent(void); /*proto*/ +PyMODINIT_FUNC initevent(void) { PyObject *__pyx_1 = 0; PyObject *__pyx_2 = 0; PyObject *__pyx_3 = 0; PyObject *__pyx_4 = 0; - PyObject *__pyx_5 = 0; - PyObject *__pyx_6 = 0; + __pyx_init_filenames(); __pyx_m = Py_InitModule4("event", __pyx_methods, __pyx_mdoc, 0, PYTHON_API_VERSION); if (!__pyx_m) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 11; goto __pyx_L1;}; + Py_INCREF(__pyx_m); __pyx_b = PyImport_AddModule("__builtin__"); if (!__pyx_b) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 11; goto __pyx_L1;}; if (PyObject_SetAttrString(__pyx_m, "__builtins__", __pyx_b) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 11; goto __pyx_L1;}; - if (__Pyx_InternStrings(__pyx_intern_tab) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 11; goto __pyx_L1;}; if (__Pyx_InitStrings(__pyx_string_tab) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 11; goto __pyx_L1;}; __pyx_type_5event_event.tp_free = _PyObject_GC_Del; - if (PyType_Ready(&__pyx_type_5event_event) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 74; goto __pyx_L1;} - if (PyObject_SetAttrString(__pyx_m, "event", (PyObject *)&__pyx_type_5event_event) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 74; goto __pyx_L1;} + if (PyType_Ready(&__pyx_type_5event_event) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 71; goto __pyx_L1;} + if (PyObject_SetAttrString(__pyx_m, "event", (PyObject *)&__pyx_type_5event_event) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 71; goto __pyx_L1;} __pyx_ptype_5event_event = &__pyx_type_5event_event; __pyx_type_5event_read.tp_base = __pyx_ptype_5event_event; - if (PyType_Ready(&__pyx_type_5event_read) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 179; goto __pyx_L1;} - if (PyObject_SetAttrString(__pyx_m, "read", (PyObject *)&__pyx_type_5event_read) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 179; goto __pyx_L1;} + if (PyType_Ready(&__pyx_type_5event_read) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 168; goto __pyx_L1;} + if (PyObject_SetAttrString(__pyx_m, "read", (PyObject *)&__pyx_type_5event_read) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 168; goto __pyx_L1;} __pyx_ptype_5event_read = &__pyx_type_5event_read; __pyx_type_5event_write.tp_base = __pyx_ptype_5event_event; - if (PyType_Ready(&__pyx_type_5event_write) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 197; goto __pyx_L1;} - if (PyObject_SetAttrString(__pyx_m, "write", (PyObject *)&__pyx_type_5event_write) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 197; goto __pyx_L1;} + if (PyType_Ready(&__pyx_type_5event_write) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 186; goto __pyx_L1;} + if (PyObject_SetAttrString(__pyx_m, "write", (PyObject *)&__pyx_type_5event_write) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 186; goto __pyx_L1;} __pyx_ptype_5event_write = &__pyx_type_5event_write; __pyx_type_5event_signal.tp_base = __pyx_ptype_5event_event; - if (PyType_Ready(&__pyx_type_5event_signal) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 215; goto __pyx_L1;} - if (PyObject_SetAttrString(__pyx_m, "signal", (PyObject *)&__pyx_type_5event_signal) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 215; goto __pyx_L1;} + if (PyType_Ready(&__pyx_type_5event_signal) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 204; goto __pyx_L1;} + if (PyObject_SetAttrString(__pyx_m, "signal", (PyObject *)&__pyx_type_5event_signal) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 204; goto __pyx_L1;} __pyx_ptype_5event_signal = &__pyx_type_5event_signal; __pyx_type_5event_timeout.tp_base = __pyx_ptype_5event_event; - if (PyType_Ready(&__pyx_type_5event_timeout) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 235; goto __pyx_L1;} - if (PyObject_SetAttrString(__pyx_m, "timeout", (PyObject *)&__pyx_type_5event_timeout) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 235; goto __pyx_L1;} + if (PyType_Ready(&__pyx_type_5event_timeout) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 224; goto __pyx_L1;} + if (PyObject_SetAttrString(__pyx_m, "timeout", (PyObject *)&__pyx_type_5event_timeout) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 224; goto __pyx_L1;} __pyx_ptype_5event_timeout = &__pyx_type_5event_timeout; - /* "/Users/dugsong/projects/pyevent/event.pyx":18 */ + /* "/usr/home/clsung/cvsroot/ports/devel/py-event/work/pyevent-0.3/event.pyx":18 */ __pyx_1 = PyTuple_New(2); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 18; goto __pyx_L1;} - Py_INCREF(__pyx_k1p); - PyTuple_SET_ITEM(__pyx_1, 0, __pyx_k1p); - Py_INCREF(__pyx_k2p); - PyTuple_SET_ITEM(__pyx_1, 1, __pyx_k2p); + Py_INCREF(__pyx_k18p); + PyTuple_SET_ITEM(__pyx_1, 0, __pyx_k18p); + Py_INCREF(__pyx_k19p); + PyTuple_SET_ITEM(__pyx_1, 1, __pyx_k19p); if (PyObject_SetAttr(__pyx_m, __pyx_n___author__, __pyx_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 18; goto __pyx_L1;} Py_DECREF(__pyx_1); __pyx_1 = 0; - /* "/Users/dugsong/projects/pyevent/event.pyx":20 */ + /* "/usr/home/clsung/cvsroot/ports/devel/py-event/work/pyevent-0.3/event.pyx":20 */ __pyx_1 = PyTuple_New(2); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 20; goto __pyx_L1;} - Py_INCREF(__pyx_k3p); - PyTuple_SET_ITEM(__pyx_1, 0, __pyx_k3p); - Py_INCREF(__pyx_k4p); - PyTuple_SET_ITEM(__pyx_1, 1, __pyx_k4p); + Py_INCREF(__pyx_k21p); + PyTuple_SET_ITEM(__pyx_1, 0, __pyx_k21p); + Py_INCREF(__pyx_k22p); + PyTuple_SET_ITEM(__pyx_1, 1, __pyx_k22p); if (PyObject_SetAttr(__pyx_m, __pyx_n___copyright__, __pyx_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 20; goto __pyx_L1;} Py_DECREF(__pyx_1); __pyx_1 = 0; - /* "/Users/dugsong/projects/pyevent/event.pyx":22 */ + /* "/usr/home/clsung/cvsroot/ports/devel/py-event/work/pyevent-0.3/event.pyx":22 */ if (PyObject_SetAttr(__pyx_m, __pyx_n___license__, __pyx_n_BSD) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 22; goto __pyx_L1;} - /* "/Users/dugsong/projects/pyevent/event.pyx":23 */ - if (PyObject_SetAttr(__pyx_m, __pyx_n___url__, __pyx_k6p) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 23; goto __pyx_L1;} + /* "/usr/home/clsung/cvsroot/ports/devel/py-event/work/pyevent-0.3/event.pyx":23 */ + if (PyObject_SetAttr(__pyx_m, __pyx_n___url__, __pyx_k26p) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 23; goto __pyx_L1;} - /* "/Users/dugsong/projects/pyevent/event.pyx":24 */ - if (PyObject_SetAttr(__pyx_m, __pyx_n___version__, __pyx_k7p) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 24; goto __pyx_L1;} + /* "/usr/home/clsung/cvsroot/ports/devel/py-event/work/pyevent-0.3/event.pyx":24 */ + if (PyObject_SetAttr(__pyx_m, __pyx_n___version__, __pyx_k28p) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 24; goto __pyx_L1;} - /* "/Users/dugsong/projects/pyevent/event.pyx":26 */ + /* "/usr/home/clsung/cvsroot/ports/devel/py-event/work/pyevent-0.3/event.pyx":26 */ __pyx_1 = __Pyx_Import(__pyx_n_sys, 0); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 26; goto __pyx_L1;} if (PyObject_SetAttr(__pyx_m, __pyx_n_sys, __pyx_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 26; goto __pyx_L1;} Py_DECREF(__pyx_1); __pyx_1 = 0; - /* "/Users/dugsong/projects/pyevent/event.pyx":57 */ - __pyx_1 = PyInt_FromLong(1); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 57; goto __pyx_L1;} + /* "/usr/home/clsung/cvsroot/ports/devel/py-event/work/pyevent-0.3/event.pyx":57 */ + __pyx_1 = PyInt_FromLong(0x01); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 57; goto __pyx_L1;} if (PyObject_SetAttr(__pyx_m, __pyx_n_EV_TIMEOUT, __pyx_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 57; goto __pyx_L1;} Py_DECREF(__pyx_1); __pyx_1 = 0; - /* "/Users/dugsong/projects/pyevent/event.pyx":58 */ - __pyx_1 = PyInt_FromLong(2); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 58; goto __pyx_L1;} + /* "/usr/home/clsung/cvsroot/ports/devel/py-event/work/pyevent-0.3/event.pyx":58 */ + __pyx_1 = PyInt_FromLong(0x02); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 58; goto __pyx_L1;} if (PyObject_SetAttr(__pyx_m, __pyx_n_EV_READ, __pyx_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 58; goto __pyx_L1;} Py_DECREF(__pyx_1); __pyx_1 = 0; - /* "/Users/dugsong/projects/pyevent/event.pyx":59 */ - __pyx_1 = PyInt_FromLong(4); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 59; goto __pyx_L1;} + /* "/usr/home/clsung/cvsroot/ports/devel/py-event/work/pyevent-0.3/event.pyx":59 */ + __pyx_1 = PyInt_FromLong(0x04); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 59; goto __pyx_L1;} if (PyObject_SetAttr(__pyx_m, __pyx_n_EV_WRITE, __pyx_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 59; goto __pyx_L1;} Py_DECREF(__pyx_1); __pyx_1 = 0; - /* "/Users/dugsong/projects/pyevent/event.pyx":60 */ - __pyx_1 = PyInt_FromLong(8); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 60; goto __pyx_L1;} + /* "/usr/home/clsung/cvsroot/ports/devel/py-event/work/pyevent-0.3/event.pyx":60 */ + __pyx_1 = PyInt_FromLong(0x08); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 60; goto __pyx_L1;} if (PyObject_SetAttr(__pyx_m, __pyx_n_EV_SIGNAL, __pyx_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 60; goto __pyx_L1;} Py_DECREF(__pyx_1); __pyx_1 = 0; - /* "/Users/dugsong/projects/pyevent/event.pyx":61 */ - __pyx_1 = PyInt_FromLong(16); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 61; goto __pyx_L1;} + /* "/usr/home/clsung/cvsroot/ports/devel/py-event/work/pyevent-0.3/event.pyx":61 */ + __pyx_1 = PyInt_FromLong(0x10); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 61; goto __pyx_L1;} if (PyObject_SetAttr(__pyx_m, __pyx_n_EV_PERSIST, __pyx_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 61; goto __pyx_L1;} Py_DECREF(__pyx_1); __pyx_1 = 0; - /* "/Users/dugsong/projects/pyevent/event.pyx":63 */ + /* "/usr/home/clsung/cvsroot/ports/devel/py-event/work/pyevent-0.3/event.pyx":63 */ if (PyObject_SetAttr(__pyx_m, __pyx_n___event_exc, Py_None) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 63; goto __pyx_L1;} - /* "/Users/dugsong/projects/pyevent/event.pyx":92 */ + /* "/usr/home/clsung/cvsroot/ports/devel/py-event/work/pyevent-0.3/event.pyx":89 */ Py_INCREF(Py_None); - __pyx_k9 = Py_None; - __pyx_k10 = 0; - __pyx_1 = PyInt_FromLong((-1)); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 92; goto __pyx_L1;} - __pyx_k11 = __pyx_1; + __pyx_d1 = Py_None; + __pyx_d2 = 0; + __pyx_1 = PyInt_FromLong((-1)); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 89; goto __pyx_L1;} + __pyx_d3 = __pyx_1; __pyx_1 = 0; - __pyx_2 = PyInt_FromLong(0); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 93; goto __pyx_L1;} - __pyx_k12 = __pyx_2; + __pyx_2 = PyInt_FromLong(0); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 90; goto __pyx_L1;} + __pyx_d4 = __pyx_2; __pyx_2 = 0; - /* "/Users/dugsong/projects/pyevent/event.pyx":143 */ - __pyx_k13 = (-1); + /* "/usr/home/clsung/cvsroot/ports/devel/py-event/work/pyevent-0.3/event.pyx":132 */ + __pyx_d5 = (-1); - /* "/Users/dugsong/projects/pyevent/event.pyx":264 */ - __pyx_3 = __Pyx_GetName(__pyx_b, __pyx_n_False); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 264; goto __pyx_L1;} - __pyx_k14 = __pyx_3; - __pyx_3 = 0; + /* "/usr/home/clsung/cvsroot/ports/devel/py-event/work/pyevent-0.3/event.pyx":253 */ + Py_INCREF(Py_False); + __pyx_d6 = Py_False; - /* "/Users/dugsong/projects/pyevent/event.pyx":280 */ - __pyx_4 = __Pyx_GetName(__pyx_m, __pyx_n_init); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 280; goto __pyx_L1;} - __pyx_5 = PyTuple_New(0); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 280; goto __pyx_L1;} - __pyx_6 = PyObject_CallObject(__pyx_4, __pyx_5); if (!__pyx_6) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 280; goto __pyx_L1;} + /* "/usr/home/clsung/cvsroot/ports/devel/py-event/work/pyevent-0.3/event.pyx":265 */ + __pyx_3 = __Pyx_GetName(__pyx_m, __pyx_n_init); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 265; goto __pyx_L1;} + __pyx_4 = PyObject_CallObject(__pyx_3, 0); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 265; goto __pyx_L1;} + Py_DECREF(__pyx_3); __pyx_3 = 0; Py_DECREF(__pyx_4); __pyx_4 = 0; - Py_DECREF(__pyx_5); __pyx_5 = 0; - Py_DECREF(__pyx_6); __pyx_6 = 0; return; __pyx_L1:; Py_XDECREF(__pyx_1); Py_XDECREF(__pyx_2); Py_XDECREF(__pyx_3); Py_XDECREF(__pyx_4); - Py_XDECREF(__pyx_5); - Py_XDECREF(__pyx_6); __Pyx_AddTraceback("event"); } static char *__pyx_filenames[] = { "event.pyx", }; -statichere char **__pyx_f = __pyx_filenames; /* Runtime support code */ +static void __pyx_init_filenames(void) { + __pyx_f = __pyx_filenames; +} + +static void __Pyx_WriteUnraisable(char *name) { + PyObject *old_exc, *old_val, *old_tb; + PyObject *ctx; + PyErr_Fetch(&old_exc, &old_val, &old_tb); + ctx = PyString_FromString(name); + PyErr_Restore(old_exc, old_val, old_tb); + if (!ctx) + ctx = Py_None; + PyErr_WriteUnraisable(ctx); +} + +static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb) { + PyThreadState *tstate = PyThreadState_Get(); + PyErr_Fetch(type, value, tb); + PyErr_NormalizeException(type, value, tb); + if (PyErr_Occurred()) + goto bad; + Py_INCREF(*type); + Py_INCREF(*value); + Py_INCREF(*tb); + Py_XDECREF(tstate->exc_type); + Py_XDECREF(tstate->exc_value); + Py_XDECREF(tstate->exc_traceback); + tstate->exc_type = *type; + tstate->exc_value = *value; + tstate->exc_traceback = *tb; + return 0; +bad: + Py_XDECREF(*type); + Py_XDECREF(*value); + Py_XDECREF(*tb); + return -1; +} + +static PyObject *__Pyx_GetName(PyObject *dict, PyObject *name) { + PyObject *result; + result = PyObject_GetAttr(dict, name); + if (!result) + PyErr_SetObject(PyExc_NameError, name); + return result; +} + static int __Pyx_GetStarArgs( PyObject **args, PyObject **kwds, char *kwd_list[], - int nargs, + Py_ssize_t nargs, PyObject **args2, - PyObject **kwds2) + PyObject **kwds2, + char rqd_kwds[]) { PyObject *x = 0, *args1 = 0, *kwds1 = 0; + int i; + char **p; if (args2) *args2 = 0; @@ -2241,25 +2135,37 @@ static int __Pyx_GetStarArgs( args1 = PyTuple_GetSlice(*args, 0, nargs); if (!args1) goto bad; - *args2 = PyTuple_GetSlice(*args, nargs, PyTuple_Size(*args)); + *args2 = PyTuple_GetSlice(*args, nargs, PyTuple_GET_SIZE(*args)); if (!*args2) goto bad; } + else if (PyTuple_GET_SIZE(*args) > nargs) { + int m = nargs; + int n = PyTuple_GET_SIZE(*args); + PyErr_Format(PyExc_TypeError, + "function takes at most %d positional arguments (%d given)", + m, n); + goto bad; + } else { args1 = *args; Py_INCREF(args1); } + if (rqd_kwds && !*kwds) + for (i = 0, p = kwd_list; *p; i++, p++) + if (rqd_kwds[i]) + goto missing_kwarg; + if (kwds2) { if (*kwds) { - char **p; kwds1 = PyDict_New(); - if (!kwds) + if (!kwds1) goto bad; *kwds2 = PyDict_Copy(*kwds); if (!*kwds2) goto bad; - for (p = kwd_list; *p; p++) { + for (i = 0, p = kwd_list; *p; i++, p++) { x = PyDict_GetItemString(*kwds, *p); if (x) { if (PyDict_SetItemString(kwds1, *p, x) < 0) @@ -2267,6 +2173,8 @@ static int __Pyx_GetStarArgs( if (PyDict_DelItemString(*kwds2, *p) < 0) goto bad; } + else if (rqd_kwds && rqd_kwds[i]) + goto missing_kwarg; } } else { @@ -2278,101 +2186,43 @@ static int __Pyx_GetStarArgs( else { kwds1 = *kwds; Py_XINCREF(kwds1); + if (rqd_kwds && *kwds) + for (i = 0, p = kwd_list; *p; i++, p++) + if (rqd_kwds[i] && !PyDict_GetItemString(*kwds, *p)) + goto missing_kwarg; } *args = args1; *kwds = kwds1; return 0; +missing_kwarg: + PyErr_Format(PyExc_TypeError, + "required keyword argument '%s' is missing", *p); bad: Py_XDECREF(args1); Py_XDECREF(kwds1); - if (*args2) + if (args2) { Py_XDECREF(*args2); - if (*kwds2) + } + if (kwds2) { Py_XDECREF(*kwds2); + } return -1; } -static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list) { - PyObject *__import__ = 0; - PyObject *empty_list = 0; - PyObject *module = 0; - PyObject *global_dict = 0; - PyObject *empty_dict = 0; - PyObject *list; - __import__ = PyObject_GetAttrString(__pyx_b, "__import__"); - if (!__import__) - goto bad; - if (from_list) - list = from_list; +static PyObject *__Pyx_GetItemInt(PyObject *o, Py_ssize_t i) { + PyTypeObject *t = o->ob_type; + PyObject *r; + if (t->tp_as_sequence && t->tp_as_sequence->sq_item) + r = PySequence_GetItem(o, i); else { - empty_list = PyList_New(0); - if (!empty_list) - goto bad; - list = empty_list; - } - global_dict = PyModule_GetDict(__pyx_m); - if (!global_dict) - goto bad; - empty_dict = PyDict_New(); - if (!empty_dict) - goto bad; - module = PyObject_CallFunction(__import__, "OOOO", - name, global_dict, empty_dict, list); -bad: - Py_XDECREF(empty_list); - Py_XDECREF(__import__); - Py_XDECREF(empty_dict); - return module; -} - -static PyObject *__Pyx_GetName(PyObject *dict, PyObject *name) { - PyObject *result; - result = PyObject_GetAttr(dict, name); - if (!result) - PyErr_SetObject(PyExc_NameError, name); - return result; -} - -static void __Pyx_WriteUnraisable(char *name) { - PyObject *old_exc, *old_val, *old_tb; - PyObject *ctx; - PyErr_Fetch(&old_exc, &old_val, &old_tb); - ctx = PyString_FromString(name); - PyErr_Restore(old_exc, old_val, old_tb); - if (!ctx) - ctx = Py_None; - PyErr_WriteUnraisable(ctx); -} - -static PyObject *__Pyx_GetExcValue(void) { - PyObject *type = 0, *value = 0, *tb = 0; - PyObject *result = 0; - PyThreadState *tstate = PyThreadState_Get(); - PyErr_Fetch(&type, &value, &tb); - PyErr_NormalizeException(&type, &value, &tb); - if (PyErr_Occurred()) - goto bad; - if (!value) { - value = Py_None; - Py_INCREF(value); + PyObject *j = PyInt_FromLong(i); + if (!j) + return 0; + r = PyObject_GetItem(o, j); + Py_DECREF(j); } - Py_XDECREF(tstate->exc_type); - Py_XDECREF(tstate->exc_value); - Py_XDECREF(tstate->exc_traceback); - tstate->exc_type = type; - tstate->exc_value = value; - tstate->exc_traceback = tb; - result = value; - Py_XINCREF(result); - type = 0; - value = 0; - tb = 0; -bad: - Py_XDECREF(type); - Py_XDECREF(value); - Py_XDECREF(tb); - return result; + return r; } static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb) { @@ -2394,39 +2244,40 @@ static void __Pyx_Raise(PyObject *type, value = Py_None; Py_INCREF(value); } - /* Next, repeatedly, replace a tuple exception with its first item */ - while (PyTuple_Check(type) && PyTuple_Size(type) > 0) { - PyObject *tmp = type; - type = PyTuple_GET_ITEM(type, 0); - Py_INCREF(type); - Py_DECREF(tmp); - } - if (PyString_Check(type)) - ; - else if (PyClass_Check(type)) - ; /*PyErr_NormalizeException(&type, &value, &tb);*/ - else if (PyInstance_Check(type)) { + #if PY_VERSION_HEX < 0x02050000 + if (!PyClass_Check(type)) + #else + if (!PyType_Check(type)) + #endif + { /* Raising an instance. The value should be a dummy. */ if (value != Py_None) { PyErr_SetString(PyExc_TypeError, - "instance exception may not have a separate value"); + "instance exception may not have a separate value"); goto raise_error; } - else { - /* Normalize to raise , */ - Py_DECREF(value); - value = type; - type = (PyObject*) ((PyInstanceObject*)type)->in_class; + /* Normalize to raise , */ + Py_DECREF(value); + value = type; + #if PY_VERSION_HEX < 0x02050000 + if (PyInstance_Check(type)) { + type = (PyObject*) ((PyInstanceObject*)type)->in_class; + Py_INCREF(type); + } + else { + PyErr_SetString(PyExc_TypeError, + "raise: exception must be an old-style class or instance"); + goto raise_error; + } + #else + type = (PyObject*) type->ob_type; Py_INCREF(type); - } - } - else { - /* Not something you can raise. You get an exception - anyway, just not what you specified :-) */ - PyErr_Format(PyExc_TypeError, - "exceptions must be strings, classes, or " - "instances, not %s", type->ob_type->tp_name); - goto raise_error; + if (!PyType_IsSubtype((PyTypeObject *)type, (PyTypeObject *)PyExc_BaseException)) { + PyErr_SetString(PyExc_TypeError, + "raise: exception class must be a subclass of BaseException"); + goto raise_error; + } + #endif } PyErr_Restore(type, value, tb); return; @@ -2437,24 +2288,49 @@ raise_error: return; } -static int __Pyx_InternStrings(__Pyx_InternTabEntry *t) { +static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) { while (t->p) { - *t->p = PyString_InternFromString(t->s); + *t->p = PyString_FromStringAndSize(t->s, t->n - 1); if (!*t->p) return -1; + if (t->i) + PyString_InternInPlace(t->p); ++t; } return 0; } -static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) { - while (t->p) { - *t->p = PyString_FromStringAndSize(t->s, t->n - 1); - if (!*t->p) - return -1; - ++t; +static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list) { + PyObject *__import__ = 0; + PyObject *empty_list = 0; + PyObject *module = 0; + PyObject *global_dict = 0; + PyObject *empty_dict = 0; + PyObject *list; + __import__ = PyObject_GetAttrString(__pyx_b, "__import__"); + if (!__import__) + goto bad; + if (from_list) + list = from_list; + else { + empty_list = PyList_New(0); + if (!empty_list) + goto bad; + list = empty_list; } - return 0; + global_dict = PyModule_GetDict(__pyx_m); + if (!global_dict) + goto bad; + empty_dict = PyDict_New(); + if (!empty_dict) + goto bad; + module = PyObject_CallFunction(__import__, "OOOO", + name, global_dict, empty_dict, list); +bad: + Py_XDECREF(empty_list); + Py_XDECREF(__import__); + Py_XDECREF(empty_dict); + return module; } #include "compile.h"