diff --git a/jlog.c b/jlog.c index fe9be25..06f02ae 100644 --- a/jlog.c +++ b/jlog.c @@ -1,4 +1,4 @@ -/* Generated by Cython 0.14.1 on Tue Oct 4 07:31:26 2011 */ +/* Generated by Cython 0.15.1 on Fri Mar 2 09:33:04 2012 */ #define PY_SSIZE_T_CLEAN #include "Python.h" @@ -46,7 +46,7 @@ #define PY_SSIZE_T_MIN INT_MIN #define PY_FORMAT_SIZE_T "" #define PyInt_FromSsize_t(z) PyInt_FromLong(z) - #define PyInt_AsSsize_t(o) PyInt_AsLong(o) + #define PyInt_AsSsize_t(o) __Pyx_PyInt_AsInt(o) #define PyNumber_Index(o) PyNumber_Int(o) #define PyIndex_Check(o) PyNumber_Check(o) #define PyErr_WarnEx(category, message, stacklevel) PyErr_Warn(category, message) @@ -159,6 +159,15 @@ #define PyBoolObject PyLongObject #endif +#if PY_VERSION_HEX < 0x03020000 + typedef long Py_hash_t; + #define __Pyx_PyInt_FromHash_t PyInt_FromLong + #define __Pyx_PyInt_AsHash_t PyInt_AsLong +#else + #define __Pyx_PyInt_FromHash_t PyInt_FromSsize_t + #define __Pyx_PyInt_AsHash_t PyInt_AsSsize_t +#endif + #if PY_MAJOR_VERSION >= 3 #define __Pyx_PyNumber_Divide(x,y) PyNumber_TrueDivide(x,y) @@ -209,20 +218,26 @@ #define __Pyx_DOCSTR(n) (n) #endif -#ifdef __cplusplus -#define __PYX_EXTERN_C extern "C" -#else -#define __PYX_EXTERN_C extern +#ifndef __PYX_EXTERN_C + #ifdef __cplusplus + #define __PYX_EXTERN_C extern "C" + #else + #define __PYX_EXTERN_C extern + #endif #endif #if defined(WIN32) || defined(MS_WINDOWS) #define _USE_MATH_DEFINES #endif #include +#define __PYX_HAVE__jlog #define __PYX_HAVE_API__jlog #include "stdio.h" #include "pythread.h" #include "jlog.h" +#ifdef _OPENMP +#include +#endif /* _OPENMP */ #ifdef PYREX_WITHOUT_ASSERTIONS #define CYTHON_WITHOUT_ASSERTIONS @@ -265,6 +280,7 @@ typedef struct {PyObject **p; char *s; const long n; const char* encoding; const #define __Pyx_PyBytes_FromUString(s) PyBytes_FromString((char*)s) #define __Pyx_PyBytes_AsUString(s) ((unsigned char*) PyBytes_AsString(s)) +#define __Pyx_Owned_Py_None(b) (Py_INCREF(Py_None), Py_None) #define __Pyx_PyBool_FromLong(b) ((b) ? (Py_INCREF(Py_True), Py_True) : (Py_INCREF(Py_False), Py_False)) static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject*); static CYTHON_INLINE PyObject* __Pyx_PyNumber_Int(PyObject* x); @@ -277,17 +293,17 @@ static CYTHON_INLINE size_t __Pyx_PyInt_AsSize_t(PyObject*); #ifdef __GNUC__ -/* Test for GCC > 2.95 */ -#if __GNUC__ > 2 || (__GNUC__ == 2 && (__GNUC_MINOR__ > 95)) -#define likely(x) __builtin_expect(!!(x), 1) -#define unlikely(x) __builtin_expect(!!(x), 0) -#else /* __GNUC__ > 2 ... */ -#define likely(x) (x) -#define unlikely(x) (x) -#endif /* __GNUC__ > 2 ... */ + /* Test for GCC > 2.95 */ + #if __GNUC__ > 2 || (__GNUC__ == 2 && (__GNUC_MINOR__ > 95)) + #define likely(x) __builtin_expect(!!(x), 1) + #define unlikely(x) __builtin_expect(!!(x), 0) + #else /* __GNUC__ > 2 ... */ + #define likely(x) (x) + #define unlikely(x) (x) + #endif /* __GNUC__ > 2 ... */ #else /* __GNUC__ */ -#define likely(x) (x) -#define unlikely(x) (x) + #define likely(x) (x) + #define unlikely(x) (x) #endif /* __GNUC__ */ static PyObject *__pyx_m; @@ -306,16 +322,17 @@ static const char *__pyx_f[] = { "complex.pxd", }; -/* Type declarations */ +/*--- Type declarations ---*/ +struct __pyx_obj_4jlog_Writer; +struct __pyx_obj_4jlog_Reader; -/* "jlog.pyx":93 +/* "jlog.pyx":97 * * * cdef class Writer: # <<<<<<<<<<<<<< * * cdef cjlog.jlog_ctx *_ctx */ - struct __pyx_obj_4jlog_Writer { PyObject_HEAD struct __pyx_vtabstruct_4jlog_Writer *__pyx_vtab; @@ -323,6 +340,7 @@ struct __pyx_obj_4jlog_Writer { char *path; }; + /* "jlog.pyx":40 * * @@ -330,7 +348,6 @@ struct __pyx_obj_4jlog_Writer { * * cdef cjlog.jlog_ctx *_ctx */ - struct __pyx_obj_4jlog_Reader { PyObject_HEAD jlog_ctx *_ctx; @@ -340,7 +357,8 @@ struct __pyx_obj_4jlog_Reader { }; -/* "jlog.pyx":93 + +/* "jlog.pyx":97 * * * cdef class Writer: # <<<<<<<<<<<<<< @@ -368,37 +386,31 @@ static struct __pyx_vtabstruct_4jlog_Writer *__pyx_vtabptr_4jlog_Writer; void (*FinishContext)(void**); } __Pyx_RefNannyAPIStruct; static __Pyx_RefNannyAPIStruct *__Pyx_RefNanny = NULL; - static __Pyx_RefNannyAPIStruct * __Pyx_RefNannyImportAPI(const char *modname) { - PyObject *m = NULL, *p = NULL; - void *r = NULL; - m = PyImport_ImportModule((char *)modname); - if (!m) goto end; - p = PyObject_GetAttrString(m, (char *)"RefNannyAPI"); - if (!p) goto end; - r = PyLong_AsVoidPtr(p); - end: - Py_XDECREF(p); - Py_XDECREF(m); - return (__Pyx_RefNannyAPIStruct *)r; - } - #define __Pyx_RefNannySetupContext(name) void *__pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__) + static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname); /*proto*/ + #define __Pyx_RefNannyDeclarations void *__pyx_refnanny = NULL; + #define __Pyx_RefNannySetupContext(name) __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__) #define __Pyx_RefNannyFinishContext() __Pyx_RefNanny->FinishContext(&__pyx_refnanny) - #define __Pyx_INCREF(r) __Pyx_RefNanny->INCREF(__pyx_refnanny, (PyObject *)(r), __LINE__) - #define __Pyx_DECREF(r) __Pyx_RefNanny->DECREF(__pyx_refnanny, (PyObject *)(r), __LINE__) - #define __Pyx_GOTREF(r) __Pyx_RefNanny->GOTREF(__pyx_refnanny, (PyObject *)(r), __LINE__) + #define __Pyx_INCREF(r) __Pyx_RefNanny->INCREF(__pyx_refnanny, (PyObject *)(r), __LINE__) + #define __Pyx_DECREF(r) __Pyx_RefNanny->DECREF(__pyx_refnanny, (PyObject *)(r), __LINE__) + #define __Pyx_GOTREF(r) __Pyx_RefNanny->GOTREF(__pyx_refnanny, (PyObject *)(r), __LINE__) #define __Pyx_GIVEREF(r) __Pyx_RefNanny->GIVEREF(__pyx_refnanny, (PyObject *)(r), __LINE__) - #define __Pyx_XDECREF(r) do { if((r) != NULL) {__Pyx_DECREF(r);} } while(0) + #define __Pyx_XINCREF(r) do { if((r) != NULL) {__Pyx_INCREF(r); }} while(0) + #define __Pyx_XDECREF(r) do { if((r) != NULL) {__Pyx_DECREF(r); }} while(0) + #define __Pyx_XGOTREF(r) do { if((r) != NULL) {__Pyx_GOTREF(r); }} while(0) + #define __Pyx_XGIVEREF(r) do { if((r) != NULL) {__Pyx_GIVEREF(r);}} while(0) #else + #define __Pyx_RefNannyDeclarations #define __Pyx_RefNannySetupContext(name) #define __Pyx_RefNannyFinishContext() #define __Pyx_INCREF(r) Py_INCREF(r) #define __Pyx_DECREF(r) Py_DECREF(r) #define __Pyx_GOTREF(r) #define __Pyx_GIVEREF(r) + #define __Pyx_XINCREF(r) Py_XINCREF(r) #define __Pyx_XDECREF(r) Py_XDECREF(r) + #define __Pyx_XGOTREF(r) + #define __Pyx_XGIVEREF(r) #endif /* CYTHON_REFNANNY */ -#define __Pyx_XGIVEREF(r) do { if((r) != NULL) {__Pyx_GIVEREF(r);} } while(0) -#define __Pyx_XGOTREF(r) do { if((r) != NULL) {__Pyx_GOTREF(r);} } while(0) static PyObject *__Pyx_GetName(PyObject *dict, PyObject *name); /*proto*/ @@ -413,7 +425,7 @@ static int __Pyx_ParseOptionalKeywords(PyObject *kwds, PyObject **argnames[], static CYTHON_INLINE void __Pyx_ErrRestore(PyObject *type, PyObject *value, PyObject *tb); /*proto*/ static CYTHON_INLINE void __Pyx_ErrFetch(PyObject **type, PyObject **value, PyObject **tb); /*proto*/ -static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb); /*proto*/ +static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause); /*proto*/ static PyObject *__Pyx_FindPy2Metaclass(PyObject *bases); /*proto*/ @@ -466,129 +478,130 @@ static CYTHON_INLINE signed long __Pyx_PyInt_AsSignedLong(PyObject *); static CYTHON_INLINE signed PY_LONG_LONG __Pyx_PyInt_AsSignedLongLong(PyObject *); +static int __Pyx_check_binary_version(void); + static int __Pyx_SetVtable(PyObject *dict, void *vtable); /*proto*/ -static PyTypeObject *__Pyx_ImportType(const char *module_name, const char *class_name, long size, int strict); /*proto*/ +static PyTypeObject *__Pyx_ImportType(const char *module_name, const char *class_name, size_t size, int strict); /*proto*/ static PyObject *__Pyx_ImportModule(const char *name); /*proto*/ -static void __Pyx_AddTraceback(const char *funcname); /*proto*/ +static void __Pyx_AddTraceback(const char *funcname, int __pyx_clineno, + int __pyx_lineno, const char *__pyx_filename); /*proto*/ static int __Pyx_InitStrings(__Pyx_StringTabEntry *t); /*proto*/ -/* Module declarations from cpython.version */ -/* Module declarations from cpython.ref */ +/* Module declarations from 'cpython.version' */ -/* Module declarations from cpython.exc */ +/* Module declarations from 'cpython.ref' */ -/* Module declarations from cpython.module */ +/* Module declarations from 'cpython.exc' */ -/* Module declarations from cpython.mem */ +/* Module declarations from 'cpython.module' */ -/* Module declarations from cpython.tuple */ +/* Module declarations from 'cpython.mem' */ -/* Module declarations from cpython.list */ +/* Module declarations from 'cpython.tuple' */ -/* Module declarations from libc.stdio */ +/* Module declarations from 'cpython.list' */ -/* Module declarations from cpython.object */ +/* Module declarations from 'libc.stdio' */ -/* Module declarations from cpython.sequence */ +/* Module declarations from 'cpython.object' */ -/* Module declarations from cpython.mapping */ +/* Module declarations from 'cpython.sequence' */ -/* Module declarations from cpython.iterator */ +/* Module declarations from 'cpython.mapping' */ -/* Module declarations from cpython.type */ +/* Module declarations from 'cpython.iterator' */ -/* Module declarations from cpython.number */ +/* Module declarations from 'cpython.type' */ -/* Module declarations from cpython.int */ +/* Module declarations from 'cpython.number' */ -/* Module declarations from __builtin__ */ +/* Module declarations from 'cpython.int' */ -/* Module declarations from cpython.bool */ +/* Module declarations from '__builtin__' */ +/* Module declarations from 'cpython.bool' */ static PyTypeObject *__pyx_ptype_7cpython_4bool_bool = 0; -/* Module declarations from cpython.long */ -/* Module declarations from cpython.float */ +/* Module declarations from 'cpython.long' */ -/* Module declarations from __builtin__ */ +/* Module declarations from 'cpython.float' */ -/* Module declarations from cpython.complex */ +/* Module declarations from '__builtin__' */ +/* Module declarations from 'cpython.complex' */ static PyTypeObject *__pyx_ptype_7cpython_7complex_complex = 0; -/* Module declarations from cpython.string */ -/* Module declarations from cpython.unicode */ +/* Module declarations from 'cpython.string' */ + +/* Module declarations from 'cpython.unicode' */ -/* Module declarations from cpython.dict */ +/* Module declarations from 'cpython.dict' */ -/* Module declarations from cpython.instance */ +/* Module declarations from 'cpython.instance' */ -/* Module declarations from cpython.function */ +/* Module declarations from 'cpython.function' */ -/* Module declarations from cpython.method */ +/* Module declarations from 'cpython.method' */ -/* Module declarations from cpython.weakref */ +/* Module declarations from 'cpython.weakref' */ -/* Module declarations from cpython.getargs */ +/* Module declarations from 'cpython.getargs' */ -/* Module declarations from cpython.pythread */ +/* Module declarations from 'cpython.pythread' */ -/* Module declarations from cpython.cobject */ +/* Module declarations from 'cpython.pystate' */ -/* Module declarations from cpython.oldbuffer */ +/* Module declarations from 'cpython.cobject' */ -/* Module declarations from cpython.set */ +/* Module declarations from 'cpython.oldbuffer' */ -/* Module declarations from cpython.buffer */ +/* Module declarations from 'cpython.set' */ -/* Module declarations from cpython.bytes */ +/* Module declarations from 'cpython.buffer' */ -/* Module declarations from cpython.pycapsule */ +/* Module declarations from 'cpython.bytes' */ -/* Module declarations from cpython */ +/* Module declarations from 'cpython.pycapsule' */ -/* Module declarations from cjlog */ +/* Module declarations from 'cpython' */ -/* Module declarations from jlog */ +/* Module declarations from 'cjlog' */ +/* Module declarations from 'jlog' */ static PyTypeObject *__pyx_ptype_4jlog_Reader = 0; static PyTypeObject *__pyx_ptype_4jlog_Writer = 0; #define __Pyx_MODULE_NAME "jlog" -static int __pyx_module_is_main_jlog = 0; +int __pyx_module_is_main_jlog = 0; -/* Implementation of jlog */ +/* Implementation of 'jlog' */ static PyObject *__pyx_builtin_Exception; +static PyObject *__pyx_builtin_property; static PyObject *__pyx_builtin_StopIteration; static char __pyx_k__END[] = "END"; -static char __pyx_k__end[] = "end"; static char __pyx_k__msg[] = "msg"; static char __pyx_k__num[] = "num"; -static char __pyx_k___ctx[] = "_ctx"; static char __pyx_k__jlog[] = "jlog"; -static char __pyx_k__mess[] = "mess"; static char __pyx_k__path[] = "path"; static char __pyx_k__self[] = "self"; static char __pyx_k__BEGIN[] = "BEGIN"; -static char __pyx_k__begin[] = "begin"; -static char __pyx_k__empty[] = "empty"; -static char __pyx_k__marker[] = "marker"; static char __pyx_k__reader[] = "reader"; static char __pyx_k____str__[] = "__str__"; static char __pyx_k____init__[] = "__init__"; static char __pyx_k____main__[] = "__main__"; static char __pyx_k____next__[] = "__next__"; static char __pyx_k____test__[] = "__test__"; -static char __pyx_k__mess_len[] = "mess_len"; static char __pyx_k__position[] = "position"; +static char __pyx_k__property[] = "property"; static char __pyx_k__Exception[] = "Exception"; static char __pyx_k__JLogError[] = "JLogError"; static char __pyx_k__subscriber[] = "subscriber"; static char __pyx_k__StopIteration[] = "StopIteration"; static char __pyx_k__add_subscriber[] = "add_subscriber"; +static char __pyx_k__will_checkpoint[] = "will_checkpoint"; static char __pyx_k__remove_subscriber[] = "remove_subscriber"; static PyObject *__pyx_n_s__BEGIN; static PyObject *__pyx_n_s__END; @@ -600,23 +613,18 @@ static PyObject *__pyx_n_s____main__; static PyObject *__pyx_n_s____next__; static PyObject *__pyx_n_s____str__; static PyObject *__pyx_n_s____test__; -static PyObject *__pyx_n_s___ctx; static PyObject *__pyx_n_s__add_subscriber; -static PyObject *__pyx_n_s__begin; -static PyObject *__pyx_n_s__empty; -static PyObject *__pyx_n_s__end; static PyObject *__pyx_n_s__jlog; -static PyObject *__pyx_n_s__marker; -static PyObject *__pyx_n_s__mess; -static PyObject *__pyx_n_s__mess_len; static PyObject *__pyx_n_s__msg; static PyObject *__pyx_n_s__num; static PyObject *__pyx_n_s__path; static PyObject *__pyx_n_s__position; +static PyObject *__pyx_n_s__property; static PyObject *__pyx_n_s__reader; static PyObject *__pyx_n_s__remove_subscriber; static PyObject *__pyx_n_s__self; static PyObject *__pyx_n_s__subscriber; +static PyObject *__pyx_n_s__will_checkpoint; /* "jlog.pyx":32 * class JLogError(Exception): @@ -633,55 +641,62 @@ static PyObject *__pyx_pf_4jlog_9JLogError___init__(PyObject *__pyx_self, PyObje PyObject *__pyx_v_num = 0; PyObject *__pyx_v_msg = 0; PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__self,&__pyx_n_s__num,&__pyx_n_s__msg,0}; __Pyx_RefNannySetupContext("__init__"); __pyx_self = __pyx_self; - if (unlikely(__pyx_kwds)) { - Py_ssize_t kw_args = PyDict_Size(__pyx_kwds); + { PyObject* values[3] = {0,0,0}; - switch (PyTuple_GET_SIZE(__pyx_args)) { - case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); - case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - case 0: break; - default: goto __pyx_L5_argtuple_error; - } - switch (PyTuple_GET_SIZE(__pyx_args)) { - case 0: - values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__self); - if (likely(values[0])) kw_args--; - else goto __pyx_L5_argtuple_error; - case 1: - values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__num); - if (likely(values[1])) kw_args--; - else { - __Pyx_RaiseArgtupleInvalid("__init__", 1, 3, 3, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 32; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 0: + values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__self); + if (likely(values[0])) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__num); + if (likely(values[1])) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("__init__", 1, 3, 3, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 32; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 2: + values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__msg); + if (likely(values[2])) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("__init__", 1, 3, 3, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 32; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } } - case 2: - values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__msg); - if (likely(values[2])) kw_args--; - else { - __Pyx_RaiseArgtupleInvalid("__init__", 1, 3, 3, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 32; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "__init__") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 32; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } - } - if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "__init__") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 32; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } else if (PyTuple_GET_SIZE(__pyx_args) != 3) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[2] = PyTuple_GET_ITEM(__pyx_args, 2); } __pyx_v_self = values[0]; __pyx_v_num = values[1]; __pyx_v_msg = values[2]; - } else if (PyTuple_GET_SIZE(__pyx_args) != 3) { - goto __pyx_L5_argtuple_error; - } else { - __pyx_v_self = PyTuple_GET_ITEM(__pyx_args, 0); - __pyx_v_num = PyTuple_GET_ITEM(__pyx_args, 1); - __pyx_v_msg = PyTuple_GET_ITEM(__pyx_args, 2); } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("__init__", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 32; __pyx_clineno = __LINE__; goto __pyx_L3_error;} __pyx_L3_error:; - __Pyx_AddTraceback("jlog.JLogError.__init__"); + __Pyx_AddTraceback("jlog.JLogError.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; @@ -707,7 +722,7 @@ static PyObject *__pyx_pf_4jlog_9JLogError___init__(PyObject *__pyx_self, PyObje __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; - __Pyx_AddTraceback("jlog.JLogError.__init__"); + __Pyx_AddTraceback("jlog.JLogError.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); @@ -727,9 +742,13 @@ static PyObject *__pyx_pf_4jlog_9JLogError_1__str__(PyObject *__pyx_self, PyObje static PyMethodDef __pyx_mdef_4jlog_9JLogError_1__str__ = {__Pyx_NAMESTR("__str__"), (PyCFunction)__pyx_pf_4jlog_9JLogError_1__str__, METH_O, __Pyx_DOCSTR(0)}; static PyObject *__pyx_pf_4jlog_9JLogError_1__str__(PyObject *__pyx_self, PyObject *__pyx_v_self) { PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__str__"); __pyx_self = __pyx_self; @@ -769,7 +788,7 @@ static PyObject *__pyx_pf_4jlog_9JLogError_1__str__(PyObject *__pyx_self, PyObje __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); - __Pyx_AddTraceback("jlog.JLogError.__str__"); + __Pyx_AddTraceback("jlog.JLogError.__str__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); @@ -790,52 +809,58 @@ static int __pyx_pf_4jlog_6Reader___cinit__(PyObject *__pyx_v_self, PyObject *__ PyObject *__pyx_v_path = 0; PyObject *__pyx_v_reader = 0; int __pyx_r; + __Pyx_RefNannyDeclarations char *__pyx_t_1; - jlog_ctx *__pyx_t_2; + int __pyx_t_2; PyObject *__pyx_t_3 = NULL; - int __pyx_t_4; + PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; - PyObject *__pyx_t_7 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__path,&__pyx_n_s__reader,0}; __Pyx_RefNannySetupContext("__cinit__"); - if (unlikely(__pyx_kwds)) { - Py_ssize_t kw_args = PyDict_Size(__pyx_kwds); + { PyObject* values[2] = {0,0}; - switch (PyTuple_GET_SIZE(__pyx_args)) { - case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - case 0: break; - default: goto __pyx_L5_argtuple_error; - } - switch (PyTuple_GET_SIZE(__pyx_args)) { - case 0: - values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__path); - if (likely(values[0])) kw_args--; - else goto __pyx_L5_argtuple_error; - case 1: - values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__reader); - if (likely(values[1])) kw_args--; - else { - __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 47; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; } - } - if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "__cinit__") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 47; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + kw_args = PyDict_Size(__pyx_kwds); + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 0: + values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__path); + if (likely(values[0])) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__reader); + if (likely(values[1])) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 47; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "__cinit__") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 47; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); } __pyx_v_path = values[0]; __pyx_v_reader = values[1]; - } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { - goto __pyx_L5_argtuple_error; - } else { - __pyx_v_path = PyTuple_GET_ITEM(__pyx_args, 0); - __pyx_v_reader = PyTuple_GET_ITEM(__pyx_args, 1); } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 47; __pyx_clineno = __LINE__; goto __pyx_L3_error;} __pyx_L3_error:; - __Pyx_AddTraceback("jlog.Reader.__cinit__"); + __Pyx_AddTraceback("jlog.Reader.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return -1; __pyx_L4_argument_unpacking_done:; @@ -857,13 +882,9 @@ static int __pyx_pf_4jlog_6Reader___cinit__(PyObject *__pyx_v_self, PyObject *__ * raise JLogError(cjlog.jlog_ctx_err(self._ctx), cjlog.jlog_ctx_err_string(self._ctx)) * self.empty = 1 */ - __pyx_t_2 = ((struct __pyx_obj_4jlog_Reader *)__pyx_v_self)->_ctx; - __pyx_t_3 = __pyx_v_reader; - __Pyx_INCREF(__pyx_t_3); - __pyx_t_1 = PyString_AsString(__pyx_t_3); if (unlikely(__pyx_t_1 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 49; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_4 = (jlog_ctx_open_reader(__pyx_t_2, __pyx_t_1) != 0); - if (__pyx_t_4) { + __pyx_t_1 = PyString_AsString(__pyx_v_reader); if (unlikely(__pyx_t_1 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 49; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = (jlog_ctx_open_reader(((struct __pyx_obj_4jlog_Reader *)__pyx_v_self)->_ctx, __pyx_t_1) != 0); + if (__pyx_t_2) { /* "jlog.pyx":50 * self._ctx = cjlog.jlog_new(path) @@ -874,24 +895,24 @@ static int __pyx_pf_4jlog_6Reader___cinit__(PyObject *__pyx_v_self, PyObject *__ */ __pyx_t_3 = __Pyx_GetName(__pyx_m, __pyx_n_s__JLogError); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 50; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); - __pyx_t_5 = PyInt_FromLong(jlog_ctx_err(((struct __pyx_obj_4jlog_Reader *)__pyx_v_self)->_ctx)); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 50; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_5); - __pyx_t_6 = PyBytes_FromString(jlog_ctx_err_string(((struct __pyx_obj_4jlog_Reader *)__pyx_v_self)->_ctx)); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 50; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PyInt_FromLong(jlog_ctx_err(((struct __pyx_obj_4jlog_Reader *)__pyx_v_self)->_ctx)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 50; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_5 = PyBytes_FromString(jlog_ctx_err_string(((struct __pyx_obj_4jlog_Reader *)__pyx_v_self)->_ctx)); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 50; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(((PyObject *)__pyx_t_5)); + __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 50; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(((PyObject *)__pyx_t_6)); - __pyx_t_7 = PyTuple_New(2); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 50; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_7)); - PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_5); - __Pyx_GIVEREF(__pyx_t_5); - PyTuple_SET_ITEM(__pyx_t_7, 1, ((PyObject *)__pyx_t_6)); - __Pyx_GIVEREF(((PyObject *)__pyx_t_6)); + PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_4); + __Pyx_GIVEREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_6, 1, ((PyObject *)__pyx_t_5)); + __Pyx_GIVEREF(((PyObject *)__pyx_t_5)); + __pyx_t_4 = 0; __pyx_t_5 = 0; - __pyx_t_6 = 0; - __pyx_t_6 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_t_7), NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 50; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_6); + __pyx_t_5 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_t_6), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 50; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __Pyx_DECREF(((PyObject *)__pyx_t_7)); __pyx_t_7 = 0; - __Pyx_Raise(__pyx_t_6, 0, 0); - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_DECREF(((PyObject *)__pyx_t_6)); __pyx_t_6 = 0; + __Pyx_Raise(__pyx_t_5, 0, 0, 0); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; {__pyx_filename = __pyx_f[0]; __pyx_lineno = 50; __pyx_clineno = __LINE__; goto __pyx_L1_error;} goto __pyx_L6; } @@ -910,10 +931,10 @@ static int __pyx_pf_4jlog_6Reader___cinit__(PyObject *__pyx_v_self, PyObject *__ goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); - __Pyx_XDECREF(__pyx_t_7); - __Pyx_AddTraceback("jlog.Reader.__cinit__"); + __Pyx_AddTraceback("jlog.Reader.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_RefNannyFinishContext(); @@ -933,6 +954,7 @@ static Py_ssize_t __pyx_pf_4jlog_6Reader_1__len__(PyObject *__pyx_v_self) { jlog_id __pyx_v_begin; jlog_id __pyx_v_end; Py_ssize_t __pyx_r; + __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__len__"); /* "jlog.pyx":56 @@ -962,6 +984,7 @@ static Py_ssize_t __pyx_pf_4jlog_6Reader_1__len__(PyObject *__pyx_v_self) { static PyObject *__pyx_pf_4jlog_6Reader_2__iter__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pf_4jlog_6Reader_2__iter__(PyObject *__pyx_v_self) { PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__iter__"); /* "jlog.pyx":59 @@ -994,15 +1017,18 @@ static PyObject *__pyx_pf_4jlog_6Reader_2__iter__(PyObject *__pyx_v_self) { static PyObject *__pyx_pf_4jlog_6Reader_3__next__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pf_4jlog_6Reader_3__next__(PyObject *__pyx_v_self) { jlog_message __pyx_v_jlog_msg; - PyObject *__pyx_v_msg; + PyObject *__pyx_v_msg = NULL; PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__next__"); - __pyx_v_msg = Py_None; __Pyx_INCREF(Py_None); /* "jlog.pyx":63 * def __next__(self): @@ -1044,7 +1070,7 @@ static PyObject *__pyx_pf_4jlog_6Reader_3__next__(PyObject *__pyx_v_self) { */ __pyx_t_2 = PyObject_Call(__pyx_builtin_StopIteration, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 67; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; {__pyx_filename = __pyx_f[0]; __pyx_lineno = 67; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } @@ -1082,7 +1108,6 @@ static PyObject *__pyx_pf_4jlog_6Reader_3__next__(PyObject *__pyx_v_self) { */ __pyx_t_2 = PyString_FromStringAndSize(((char *)__pyx_v_jlog_msg.mess), __pyx_v_jlog_msg.mess_len); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 73; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_v_msg); __pyx_v_msg = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L8; @@ -1114,7 +1139,7 @@ static PyObject *__pyx_pf_4jlog_6Reader_3__next__(PyObject *__pyx_v_self) { __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0; - __Pyx_Raise(__pyx_t_4, 0, 0); + __Pyx_Raise(__pyx_t_4, 0, 0, 0); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; {__pyx_filename = __pyx_f[0]; __pyx_lineno = 78; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } @@ -1185,10 +1210,10 @@ static PyObject *__pyx_pf_4jlog_6Reader_3__next__(PyObject *__pyx_v_self) { __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); - __Pyx_AddTraceback("jlog.Reader.__next__"); + __Pyx_AddTraceback("jlog.Reader.__next__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; - __Pyx_DECREF(__pyx_v_msg); + __Pyx_XDECREF(__pyx_v_msg); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; @@ -1204,11 +1229,15 @@ static PyObject *__pyx_pf_4jlog_6Reader_3__next__(PyObject *__pyx_v_self) { static void __pyx_pf_4jlog_6Reader_4__dealloc__(PyObject *__pyx_v_self); /*proto*/ static void __pyx_pf_4jlog_6Reader_4__dealloc__(PyObject *__pyx_v_self) { + __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__dealloc__"); /* "jlog.pyx":87 @@ -1256,7 +1285,7 @@ static void __pyx_pf_4jlog_6Reader_4__dealloc__(PyObject *__pyx_v_self) { __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0; - __Pyx_Raise(__pyx_t_4, 0, 0); + __Pyx_Raise(__pyx_t_4, 0, 0, 0); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; {__pyx_filename = __pyx_f[0]; __pyx_lineno = 89; __pyx_clineno = __LINE__; goto __pyx_L1_error;} goto __pyx_L6; @@ -1268,7 +1297,7 @@ static void __pyx_pf_4jlog_6Reader_4__dealloc__(PyObject *__pyx_v_self) { * raise JLogError(cjlog.jlog_ctx_err(self._ctx), cjlog.jlog_ctx_err_string(self._ctx)) * self._ctx = NULL # <<<<<<<<<<<<<< * - * + * @property */ ((struct __pyx_obj_4jlog_Reader *)__pyx_v_self)->_ctx = NULL; goto __pyx_L5; @@ -1281,12 +1310,56 @@ static void __pyx_pf_4jlog_6Reader_4__dealloc__(PyObject *__pyx_v_self) { __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); - __Pyx_AddTraceback("jlog.Reader.__dealloc__"); + __Pyx_AddTraceback("jlog.Reader.__dealloc__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_L0:; + __Pyx_RefNannyFinishContext(); +} + +/* "jlog.pyx":93 + * + * @property + * def will_checkpoint(self): # <<<<<<<<<<<<<< + * return self.begin.marker > self.end.marker + * + */ + +static PyObject *__pyx_pf_4jlog_6Reader_5will_checkpoint(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static PyObject *__pyx_pf_4jlog_6Reader_5will_checkpoint(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("will_checkpoint"); + + /* "jlog.pyx":94 + * @property + * def will_checkpoint(self): + * return self.begin.marker > self.end.marker # <<<<<<<<<<<<<< + * + * + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __Pyx_PyBool_FromLong((((struct __pyx_obj_4jlog_Reader *)__pyx_v_self)->begin.marker > ((struct __pyx_obj_4jlog_Reader *)__pyx_v_self)->end.marker)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 94; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("jlog.Reader.will_checkpoint", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); + return __pyx_r; } -/* "jlog.pyx":98 +/* "jlog.pyx":102 * cdef char* path * * def __cinit__(self, path): # <<<<<<<<<<<<<< @@ -1298,67 +1371,74 @@ static int __pyx_pf_4jlog_6Writer___cinit__(PyObject *__pyx_v_self, PyObject *__ static int __pyx_pf_4jlog_6Writer___cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_path = 0; int __pyx_r; + __Pyx_RefNannyDeclarations char *__pyx_t_1; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__path,0}; __Pyx_RefNannySetupContext("__cinit__"); - if (unlikely(__pyx_kwds)) { - Py_ssize_t kw_args = PyDict_Size(__pyx_kwds); + { PyObject* values[1] = {0}; - switch (PyTuple_GET_SIZE(__pyx_args)) { - case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - case 0: break; - default: goto __pyx_L5_argtuple_error; - } - switch (PyTuple_GET_SIZE(__pyx_args)) { - case 0: - values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__path); - if (likely(values[0])) kw_args--; - else goto __pyx_L5_argtuple_error; - } - if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "__cinit__") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 98; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 0: + values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__path); + if (likely(values[0])) kw_args--; + else goto __pyx_L5_argtuple_error; + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "__cinit__") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 102; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 1) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); } __pyx_v_path = values[0]; - } else if (PyTuple_GET_SIZE(__pyx_args) != 1) { - goto __pyx_L5_argtuple_error; - } else { - __pyx_v_path = PyTuple_GET_ITEM(__pyx_args, 0); } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 98; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 102; __pyx_clineno = __LINE__; goto __pyx_L3_error;} __pyx_L3_error:; - __Pyx_AddTraceback("jlog.Writer.__cinit__"); + __Pyx_AddTraceback("jlog.Writer.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return -1; __pyx_L4_argument_unpacking_done:; - /* "jlog.pyx":99 + /* "jlog.pyx":103 * * def __cinit__(self, path): * self._ctx = cjlog.jlog_new(path) # <<<<<<<<<<<<<< * self.path = path * */ - __pyx_t_1 = PyBytes_AsString(__pyx_v_path); if (unlikely((!__pyx_t_1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 99; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyBytes_AsString(__pyx_v_path); if (unlikely((!__pyx_t_1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 103; __pyx_clineno = __LINE__; goto __pyx_L1_error;} ((struct __pyx_obj_4jlog_Writer *)__pyx_v_self)->_ctx = jlog_new(__pyx_t_1); - /* "jlog.pyx":100 + /* "jlog.pyx":104 * def __cinit__(self, path): * self._ctx = cjlog.jlog_new(path) * self.path = path # <<<<<<<<<<<<<< * * # Create log */ - __pyx_t_1 = PyBytes_AsString(__pyx_v_path); if (unlikely((!__pyx_t_1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 100; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyBytes_AsString(__pyx_v_path); if (unlikely((!__pyx_t_1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 104; __pyx_clineno = __LINE__; goto __pyx_L1_error;} ((struct __pyx_obj_4jlog_Writer *)__pyx_v_self)->path = __pyx_t_1; - /* "jlog.pyx":103 + /* "jlog.pyx":107 * * # Create log * if cjlog.jlog_ctx_init(self._ctx) != 0: # <<<<<<<<<<<<<< @@ -1368,7 +1448,7 @@ static int __pyx_pf_4jlog_6Writer___cinit__(PyObject *__pyx_v_self, PyObject *__ __pyx_t_2 = (jlog_ctx_init(((struct __pyx_obj_4jlog_Writer *)__pyx_v_self)->_ctx) != 0); if (__pyx_t_2) { - /* "jlog.pyx":104 + /* "jlog.pyx":108 * # Create log * if cjlog.jlog_ctx_init(self._ctx) != 0: * if cjlog.jlog_ctx_err(self._ctx) != 6: # <<<<<<<<<<<<<< @@ -1378,20 +1458,20 @@ static int __pyx_pf_4jlog_6Writer___cinit__(PyObject *__pyx_v_self, PyObject *__ __pyx_t_2 = (jlog_ctx_err(((struct __pyx_obj_4jlog_Writer *)__pyx_v_self)->_ctx) != 6); if (__pyx_t_2) { - /* "jlog.pyx":105 + /* "jlog.pyx":109 * if cjlog.jlog_ctx_init(self._ctx) != 0: * if cjlog.jlog_ctx_err(self._ctx) != 6: * raise JLogError(cjlog.jlog_ctx_err(self._ctx), cjlog.jlog_ctx_err_string(self._ctx)) # <<<<<<<<<<<<<< * if cjlog.jlog_ctx_close(self._ctx) != 0: * raise JLogError(cjlog.jlog_ctx_err(self._ctx), cjlog.jlog_ctx_err_string(self._ctx)) */ - __pyx_t_3 = __Pyx_GetName(__pyx_m, __pyx_n_s__JLogError); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 105; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = __Pyx_GetName(__pyx_m, __pyx_n_s__JLogError); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 109; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = PyInt_FromLong(jlog_ctx_err(((struct __pyx_obj_4jlog_Writer *)__pyx_v_self)->_ctx)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 105; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PyInt_FromLong(jlog_ctx_err(((struct __pyx_obj_4jlog_Writer *)__pyx_v_self)->_ctx)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 109; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); - __pyx_t_5 = PyBytes_FromString(jlog_ctx_err_string(((struct __pyx_obj_4jlog_Writer *)__pyx_v_self)->_ctx)); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 105; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = PyBytes_FromString(jlog_ctx_err_string(((struct __pyx_obj_4jlog_Writer *)__pyx_v_self)->_ctx)); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 109; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(((PyObject *)__pyx_t_5)); - __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 105; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 109; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(((PyObject *)__pyx_t_6)); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_4); __Pyx_GIVEREF(__pyx_t_4); @@ -1399,13 +1479,13 @@ static int __pyx_pf_4jlog_6Writer___cinit__(PyObject *__pyx_v_self, PyObject *__ __Pyx_GIVEREF(((PyObject *)__pyx_t_5)); __pyx_t_4 = 0; __pyx_t_5 = 0; - __pyx_t_5 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_t_6), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 105; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_t_6), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 109; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(((PyObject *)__pyx_t_6)); __pyx_t_6 = 0; - __Pyx_Raise(__pyx_t_5, 0, 0); + __Pyx_Raise(__pyx_t_5, 0, 0, 0); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 105; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 109; __pyx_clineno = __LINE__; goto __pyx_L1_error;} goto __pyx_L7; } __pyx_L7:; @@ -1413,7 +1493,7 @@ static int __pyx_pf_4jlog_6Writer___cinit__(PyObject *__pyx_v_self, PyObject *__ } __pyx_L6:; - /* "jlog.pyx":106 + /* "jlog.pyx":110 * if cjlog.jlog_ctx_err(self._ctx) != 6: * raise JLogError(cjlog.jlog_ctx_err(self._ctx), cjlog.jlog_ctx_err_string(self._ctx)) * if cjlog.jlog_ctx_close(self._ctx) != 0: # <<<<<<<<<<<<<< @@ -1423,20 +1503,20 @@ static int __pyx_pf_4jlog_6Writer___cinit__(PyObject *__pyx_v_self, PyObject *__ __pyx_t_2 = (jlog_ctx_close(((struct __pyx_obj_4jlog_Writer *)__pyx_v_self)->_ctx) != 0); if (__pyx_t_2) { - /* "jlog.pyx":107 + /* "jlog.pyx":111 * raise JLogError(cjlog.jlog_ctx_err(self._ctx), cjlog.jlog_ctx_err_string(self._ctx)) * if cjlog.jlog_ctx_close(self._ctx) != 0: * raise JLogError(cjlog.jlog_ctx_err(self._ctx), cjlog.jlog_ctx_err_string(self._ctx)) # <<<<<<<<<<<<<< * * # Open writer */ - __pyx_t_5 = __Pyx_GetName(__pyx_m, __pyx_n_s__JLogError); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 107; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = __Pyx_GetName(__pyx_m, __pyx_n_s__JLogError); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 111; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); - __pyx_t_6 = PyInt_FromLong(jlog_ctx_err(((struct __pyx_obj_4jlog_Writer *)__pyx_v_self)->_ctx)); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 107; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = PyInt_FromLong(jlog_ctx_err(((struct __pyx_obj_4jlog_Writer *)__pyx_v_self)->_ctx)); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 111; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); - __pyx_t_3 = PyBytes_FromString(jlog_ctx_err_string(((struct __pyx_obj_4jlog_Writer *)__pyx_v_self)->_ctx)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 107; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyBytes_FromString(jlog_ctx_err_string(((struct __pyx_obj_4jlog_Writer *)__pyx_v_self)->_ctx)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 111; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(((PyObject *)__pyx_t_3)); - __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 107; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 111; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(((PyObject *)__pyx_t_4)); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_6); __Pyx_GIVEREF(__pyx_t_6); @@ -1444,28 +1524,28 @@ static int __pyx_pf_4jlog_6Writer___cinit__(PyObject *__pyx_v_self, PyObject *__ __Pyx_GIVEREF(((PyObject *)__pyx_t_3)); __pyx_t_6 = 0; __pyx_t_3 = 0; - __pyx_t_3 = PyObject_Call(__pyx_t_5, ((PyObject *)__pyx_t_4), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 107; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyObject_Call(__pyx_t_5, ((PyObject *)__pyx_t_4), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 111; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0; - __Pyx_Raise(__pyx_t_3, 0, 0); + __Pyx_Raise(__pyx_t_3, 0, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 107; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 111; __pyx_clineno = __LINE__; goto __pyx_L1_error;} goto __pyx_L8; } __pyx_L8:; - /* "jlog.pyx":110 + /* "jlog.pyx":114 * * # Open writer * self._ctx = cjlog.jlog_new(path) # <<<<<<<<<<<<<< * if cjlog.jlog_ctx_open_writer(self._ctx) != 0: * raise JLogError(cjlog.jlog_ctx_err(self._ctx), cjlog.jlog_ctx_err_string(self._ctx)) */ - __pyx_t_1 = PyBytes_AsString(__pyx_v_path); if (unlikely((!__pyx_t_1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 110; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyBytes_AsString(__pyx_v_path); if (unlikely((!__pyx_t_1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 114; __pyx_clineno = __LINE__; goto __pyx_L1_error;} ((struct __pyx_obj_4jlog_Writer *)__pyx_v_self)->_ctx = jlog_new(__pyx_t_1); - /* "jlog.pyx":111 + /* "jlog.pyx":115 * # Open writer * self._ctx = cjlog.jlog_new(path) * if cjlog.jlog_ctx_open_writer(self._ctx) != 0: # <<<<<<<<<<<<<< @@ -1475,20 +1555,20 @@ static int __pyx_pf_4jlog_6Writer___cinit__(PyObject *__pyx_v_self, PyObject *__ __pyx_t_2 = (jlog_ctx_open_writer(((struct __pyx_obj_4jlog_Writer *)__pyx_v_self)->_ctx) != 0); if (__pyx_t_2) { - /* "jlog.pyx":112 + /* "jlog.pyx":116 * self._ctx = cjlog.jlog_new(path) * if cjlog.jlog_ctx_open_writer(self._ctx) != 0: * raise JLogError(cjlog.jlog_ctx_err(self._ctx), cjlog.jlog_ctx_err_string(self._ctx)) # <<<<<<<<<<<<<< * * def write(self, msg): */ - __pyx_t_3 = __Pyx_GetName(__pyx_m, __pyx_n_s__JLogError); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 112; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = __Pyx_GetName(__pyx_m, __pyx_n_s__JLogError); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 116; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = PyInt_FromLong(jlog_ctx_err(((struct __pyx_obj_4jlog_Writer *)__pyx_v_self)->_ctx)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 112; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PyInt_FromLong(jlog_ctx_err(((struct __pyx_obj_4jlog_Writer *)__pyx_v_self)->_ctx)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 116; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); - __pyx_t_5 = PyBytes_FromString(jlog_ctx_err_string(((struct __pyx_obj_4jlog_Writer *)__pyx_v_self)->_ctx)); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 112; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = PyBytes_FromString(jlog_ctx_err_string(((struct __pyx_obj_4jlog_Writer *)__pyx_v_self)->_ctx)); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 116; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(((PyObject *)__pyx_t_5)); - __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 112; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 116; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(((PyObject *)__pyx_t_6)); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_4); __Pyx_GIVEREF(__pyx_t_4); @@ -1496,13 +1576,13 @@ static int __pyx_pf_4jlog_6Writer___cinit__(PyObject *__pyx_v_self, PyObject *__ __Pyx_GIVEREF(((PyObject *)__pyx_t_5)); __pyx_t_4 = 0; __pyx_t_5 = 0; - __pyx_t_5 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_t_6), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 112; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_t_6), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 116; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(((PyObject *)__pyx_t_6)); __pyx_t_6 = 0; - __Pyx_Raise(__pyx_t_5, 0, 0); + __Pyx_Raise(__pyx_t_5, 0, 0, 0); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 112; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 116; __pyx_clineno = __LINE__; goto __pyx_L1_error;} goto __pyx_L9; } __pyx_L9:; @@ -1514,14 +1594,14 @@ static int __pyx_pf_4jlog_6Writer___cinit__(PyObject *__pyx_v_self, PyObject *__ __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); - __Pyx_AddTraceback("jlog.Writer.__cinit__"); + __Pyx_AddTraceback("jlog.Writer.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } -/* "jlog.pyx":114 +/* "jlog.pyx":118 * raise JLogError(cjlog.jlog_ctx_err(self._ctx), cjlog.jlog_ctx_err_string(self._ctx)) * * def write(self, msg): # <<<<<<<<<<<<<< @@ -1534,15 +1614,19 @@ static PyObject *__pyx_pf_4jlog_6Writer_1write(PyObject *__pyx_v_self, PyObject char *__pyx_v_msg_c; Py_ssize_t __pyx_v_msg_len_c; PyObject *__pyx_r = NULL; - PyObject *__pyx_t_1 = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; int __pyx_t_2; - int __pyx_t_3; + PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; __Pyx_RefNannySetupContext("write"); - /* "jlog.pyx":115 + /* "jlog.pyx":119 * * def write(self, msg): * cdef char *msg_c = NULL # <<<<<<<<<<<<<< @@ -1551,7 +1635,7 @@ static PyObject *__pyx_pf_4jlog_6Writer_1write(PyObject *__pyx_v_self, PyObject */ __pyx_v_msg_c = NULL; - /* "jlog.pyx":116 + /* "jlog.pyx":120 * def write(self, msg): * cdef char *msg_c = NULL * cdef Py_ssize_t msg_len_c=0 # <<<<<<<<<<<<<< @@ -1560,42 +1644,39 @@ static PyObject *__pyx_pf_4jlog_6Writer_1write(PyObject *__pyx_v_self, PyObject */ __pyx_v_msg_len_c = 0; - /* "jlog.pyx":117 + /* "jlog.pyx":121 * cdef char *msg_c = NULL * cdef Py_ssize_t msg_len_c=0 * PyString_AsStringAndSize(msg, &msg_c, &msg_len_c) # <<<<<<<<<<<<<< * if cjlog.jlog_ctx_write(self._ctx, msg_c, msg_len_c) != 0: * raise JLogError(cjlog.jlog_ctx_err(self._ctx), cjlog.jlog_ctx_err_string(self._ctx)) */ - __pyx_t_1 = __pyx_v_msg; - __Pyx_INCREF(__pyx_t_1); - __pyx_t_2 = PyString_AsStringAndSize(__pyx_t_1, (&__pyx_v_msg_c), (&__pyx_v_msg_len_c)); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 117; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = PyString_AsStringAndSize(__pyx_v_msg, (&__pyx_v_msg_c), (&__pyx_v_msg_len_c)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 121; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - /* "jlog.pyx":118 + /* "jlog.pyx":122 * cdef Py_ssize_t msg_len_c=0 * PyString_AsStringAndSize(msg, &msg_c, &msg_len_c) * if cjlog.jlog_ctx_write(self._ctx, msg_c, msg_len_c) != 0: # <<<<<<<<<<<<<< * raise JLogError(cjlog.jlog_ctx_err(self._ctx), cjlog.jlog_ctx_err_string(self._ctx)) * */ - __pyx_t_3 = (jlog_ctx_write(((struct __pyx_obj_4jlog_Writer *)__pyx_v_self)->_ctx, ((void *)__pyx_v_msg_c), __pyx_v_msg_len_c) != 0); - if (__pyx_t_3) { + __pyx_t_2 = (jlog_ctx_write(((struct __pyx_obj_4jlog_Writer *)__pyx_v_self)->_ctx, ((void *)__pyx_v_msg_c), __pyx_v_msg_len_c) != 0); + if (__pyx_t_2) { - /* "jlog.pyx":119 + /* "jlog.pyx":123 * PyString_AsStringAndSize(msg, &msg_c, &msg_len_c) * if cjlog.jlog_ctx_write(self._ctx, msg_c, msg_len_c) != 0: * raise JLogError(cjlog.jlog_ctx_err(self._ctx), cjlog.jlog_ctx_err_string(self._ctx)) # <<<<<<<<<<<<<< * * cpdef add_subscriber(self, subscriber, position): */ - __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__JLogError); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 119; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_4 = PyInt_FromLong(jlog_ctx_err(((struct __pyx_obj_4jlog_Writer *)__pyx_v_self)->_ctx)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 119; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = __Pyx_GetName(__pyx_m, __pyx_n_s__JLogError); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 123; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = PyInt_FromLong(jlog_ctx_err(((struct __pyx_obj_4jlog_Writer *)__pyx_v_self)->_ctx)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 123; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); - __pyx_t_5 = PyBytes_FromString(jlog_ctx_err_string(((struct __pyx_obj_4jlog_Writer *)__pyx_v_self)->_ctx)); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 119; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = PyBytes_FromString(jlog_ctx_err_string(((struct __pyx_obj_4jlog_Writer *)__pyx_v_self)->_ctx)); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 123; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(((PyObject *)__pyx_t_5)); - __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 119; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 123; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(((PyObject *)__pyx_t_6)); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_4); __Pyx_GIVEREF(__pyx_t_4); @@ -1603,13 +1684,13 @@ static PyObject *__pyx_pf_4jlog_6Writer_1write(PyObject *__pyx_v_self, PyObject __Pyx_GIVEREF(((PyObject *)__pyx_t_5)); __pyx_t_4 = 0; __pyx_t_5 = 0; - __pyx_t_5 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_6), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 119; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_t_6), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 123; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(((PyObject *)__pyx_t_6)); __pyx_t_6 = 0; - __Pyx_Raise(__pyx_t_5, 0, 0); + __Pyx_Raise(__pyx_t_5, 0, 0, 0); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 119; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 123; __pyx_clineno = __LINE__; goto __pyx_L1_error;} goto __pyx_L5; } __pyx_L5:; @@ -1617,11 +1698,11 @@ static PyObject *__pyx_pf_4jlog_6Writer_1write(PyObject *__pyx_v_self, PyObject __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); - __Pyx_AddTraceback("jlog.Writer.write"); + __Pyx_AddTraceback("jlog.Writer.write", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); @@ -1629,7 +1710,7 @@ static PyObject *__pyx_pf_4jlog_6Writer_1write(PyObject *__pyx_v_self, PyObject return __pyx_r; } -/* "jlog.pyx":121 +/* "jlog.pyx":125 * raise JLogError(cjlog.jlog_ctx_err(self._ctx), cjlog.jlog_ctx_err_string(self._ctx)) * * cpdef add_subscriber(self, subscriber, position): # <<<<<<<<<<<<<< @@ -1638,9 +1719,10 @@ static PyObject *__pyx_pf_4jlog_6Writer_1write(PyObject *__pyx_v_self, PyObject */ static PyObject *__pyx_pf_4jlog_6Writer_2add_subscriber(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ -static PyObject *__pyx_f_4jlog_6Writer_add_subscriber(struct __pyx_obj_4jlog_Writer *__pyx_v_self, PyObject *__pyx_v_subscriber, PyObject *__pyx_v_position, int __pyx_skip_dispatch) { +static PyObject *__pyx_f_4jlog_6Writer_add_subscriber(struct __pyx_obj_4jlog_Writer *__pyx_v_self, PyObject *__pyx_v_subscriber, PyObject *__pyx_v_position, int __pyx_skip_dispatch) { jlog_ctx *__pyx_v_ctx; PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; @@ -1648,16 +1730,19 @@ static PyObject *__pyx_f_4jlog_6Writer_add_subscriber(struct __pyx_obj_4jlog_Wr jlog_position __pyx_t_5; int __pyx_t_6; PyObject *__pyx_t_7 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; __Pyx_RefNannySetupContext("add_subscriber"); /* Check if called by wrapper */ if (unlikely(__pyx_skip_dispatch)) ; /* Check if overriden in Python */ else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) { - __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s__add_subscriber); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 121; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s__add_subscriber); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 125; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (void *)&__pyx_pf_4jlog_6Writer_2add_subscriber)) { __Pyx_XDECREF(__pyx_r); - __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 121; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 125; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(((PyObject *)__pyx_t_2)); __Pyx_INCREF(__pyx_v_subscriber); PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_subscriber); @@ -1665,7 +1750,7 @@ static PyObject *__pyx_f_4jlog_6Writer_add_subscriber(struct __pyx_obj_4jlog_Wr __Pyx_INCREF(__pyx_v_position); PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_v_position); __Pyx_GIVEREF(__pyx_v_position); - __pyx_t_3 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 121; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 125; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0; __pyx_r = __pyx_t_3; @@ -1676,7 +1761,7 @@ static PyObject *__pyx_f_4jlog_6Writer_add_subscriber(struct __pyx_obj_4jlog_Wr __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } - /* "jlog.pyx":123 + /* "jlog.pyx":127 * cpdef add_subscriber(self, subscriber, position): * cdef cjlog.jlog_ctx *ctx * ctx = cjlog.jlog_new(self.path) # <<<<<<<<<<<<<< @@ -1685,35 +1770,32 @@ static PyObject *__pyx_f_4jlog_6Writer_add_subscriber(struct __pyx_obj_4jlog_Wr */ __pyx_v_ctx = jlog_new(__pyx_v_self->path); - /* "jlog.pyx":124 + /* "jlog.pyx":128 * cdef cjlog.jlog_ctx *ctx * ctx = cjlog.jlog_new(self.path) * if cjlog.jlog_ctx_add_subscriber(ctx, PyString_AsString(subscriber), position) != 0: # <<<<<<<<<<<<<< * raise JLogError(cjlog.jlog_ctx_err(ctx), cjlog.jlog_ctx_err_string(ctx)) * if cjlog.jlog_ctx_close(ctx) != 0: */ - __pyx_t_1 = __pyx_v_subscriber; - __Pyx_INCREF(__pyx_t_1); - __pyx_t_4 = PyString_AsString(__pyx_t_1); if (unlikely(__pyx_t_4 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 124; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_5 = ((jlog_position)PyInt_AsLong(__pyx_v_position)); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 124; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PyString_AsString(__pyx_v_subscriber); if (unlikely(__pyx_t_4 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 128; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = ((jlog_position)PyInt_AsLong(__pyx_v_position)); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 128; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_6 = (jlog_ctx_add_subscriber(__pyx_v_ctx, __pyx_t_4, __pyx_t_5) != 0); if (__pyx_t_6) { - /* "jlog.pyx":125 + /* "jlog.pyx":129 * ctx = cjlog.jlog_new(self.path) * if cjlog.jlog_ctx_add_subscriber(ctx, PyString_AsString(subscriber), position) != 0: * raise JLogError(cjlog.jlog_ctx_err(ctx), cjlog.jlog_ctx_err_string(ctx)) # <<<<<<<<<<<<<< * if cjlog.jlog_ctx_close(ctx) != 0: * raise JLogError(cjlog.jlog_ctx_err(ctx), cjlog.jlog_ctx_err_string(ctx)) */ - __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__JLogError); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 125; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__JLogError); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 129; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - __pyx_t_3 = PyInt_FromLong(jlog_ctx_err(__pyx_v_ctx)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 125; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyInt_FromLong(jlog_ctx_err(__pyx_v_ctx)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 129; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); - __pyx_t_2 = PyBytes_FromString(jlog_ctx_err_string(__pyx_v_ctx)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 125; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyBytes_FromString(jlog_ctx_err_string(__pyx_v_ctx)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 129; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(((PyObject *)__pyx_t_2)); - __pyx_t_7 = PyTuple_New(2); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 125; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_7 = PyTuple_New(2); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 129; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(((PyObject *)__pyx_t_7)); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_3); __Pyx_GIVEREF(__pyx_t_3); @@ -1721,18 +1803,18 @@ static PyObject *__pyx_f_4jlog_6Writer_add_subscriber(struct __pyx_obj_4jlog_Wr __Pyx_GIVEREF(((PyObject *)__pyx_t_2)); __pyx_t_3 = 0; __pyx_t_2 = 0; - __pyx_t_2 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_7), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 125; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_7), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 129; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(((PyObject *)__pyx_t_7)); __pyx_t_7 = 0; - __Pyx_Raise(__pyx_t_2, 0, 0); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 125; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 129; __pyx_clineno = __LINE__; goto __pyx_L1_error;} goto __pyx_L3; } __pyx_L3:; - /* "jlog.pyx":126 + /* "jlog.pyx":130 * if cjlog.jlog_ctx_add_subscriber(ctx, PyString_AsString(subscriber), position) != 0: * raise JLogError(cjlog.jlog_ctx_err(ctx), cjlog.jlog_ctx_err_string(ctx)) * if cjlog.jlog_ctx_close(ctx) != 0: # <<<<<<<<<<<<<< @@ -1742,20 +1824,20 @@ static PyObject *__pyx_f_4jlog_6Writer_add_subscriber(struct __pyx_obj_4jlog_Wr __pyx_t_6 = (jlog_ctx_close(__pyx_v_ctx) != 0); if (__pyx_t_6) { - /* "jlog.pyx":127 + /* "jlog.pyx":131 * raise JLogError(cjlog.jlog_ctx_err(ctx), cjlog.jlog_ctx_err_string(ctx)) * if cjlog.jlog_ctx_close(ctx) != 0: * raise JLogError(cjlog.jlog_ctx_err(ctx), cjlog.jlog_ctx_err_string(ctx)) # <<<<<<<<<<<<<< * * cpdef remove_subscriber(self, subscriber): */ - __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__JLogError); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 127; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__JLogError); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 131; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); - __pyx_t_7 = PyInt_FromLong(jlog_ctx_err(__pyx_v_ctx)); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 127; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_7 = PyInt_FromLong(jlog_ctx_err(__pyx_v_ctx)); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 131; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_7); - __pyx_t_1 = PyBytes_FromString(jlog_ctx_err_string(__pyx_v_ctx)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 127; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyBytes_FromString(jlog_ctx_err_string(__pyx_v_ctx)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 131; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(((PyObject *)__pyx_t_1)); - __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 127; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 131; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(((PyObject *)__pyx_t_3)); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_7); __Pyx_GIVEREF(__pyx_t_7); @@ -1763,13 +1845,13 @@ static PyObject *__pyx_f_4jlog_6Writer_add_subscriber(struct __pyx_obj_4jlog_Wr __Pyx_GIVEREF(((PyObject *)__pyx_t_1)); __pyx_t_7 = 0; __pyx_t_1 = 0; - __pyx_t_1 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 127; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 131; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0; - __Pyx_Raise(__pyx_t_1, 0, 0); + __Pyx_Raise(__pyx_t_1, 0, 0, 0); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 127; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 131; __pyx_clineno = __LINE__; goto __pyx_L1_error;} goto __pyx_L4; } __pyx_L4:; @@ -1781,7 +1863,7 @@ static PyObject *__pyx_f_4jlog_6Writer_add_subscriber(struct __pyx_obj_4jlog_Wr __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_7); - __Pyx_AddTraceback("jlog.Writer.add_subscriber"); + __Pyx_AddTraceback("jlog.Writer.add_subscriber", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); @@ -1789,7 +1871,7 @@ static PyObject *__pyx_f_4jlog_6Writer_add_subscriber(struct __pyx_obj_4jlog_Wr return __pyx_r; } -/* "jlog.pyx":121 +/* "jlog.pyx":125 * raise JLogError(cjlog.jlog_ctx_err(self._ctx), cjlog.jlog_ctx_err_string(self._ctx)) * * cpdef add_subscriber(self, subscriber, position): # <<<<<<<<<<<<<< @@ -1802,71 +1884,68 @@ static PyObject *__pyx_pf_4jlog_6Writer_2add_subscriber(PyObject *__pyx_v_self, PyObject *__pyx_v_subscriber = 0; PyObject *__pyx_v_position = 0; PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; - PyObject *__pyx_t_2 = NULL; - PyObject *__pyx_t_3 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__subscriber,&__pyx_n_s__position,0}; __Pyx_RefNannySetupContext("add_subscriber"); - if (unlikely(__pyx_kwds)) { - Py_ssize_t kw_args = PyDict_Size(__pyx_kwds); + { PyObject* values[2] = {0,0}; - switch (PyTuple_GET_SIZE(__pyx_args)) { - case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - case 0: break; - default: goto __pyx_L5_argtuple_error; - } - switch (PyTuple_GET_SIZE(__pyx_args)) { - case 0: - values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__subscriber); - if (likely(values[0])) kw_args--; - else goto __pyx_L5_argtuple_error; - case 1: - values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__position); - if (likely(values[1])) kw_args--; - else { - __Pyx_RaiseArgtupleInvalid("add_subscriber", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 121; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; } - } - if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "add_subscriber") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 121; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + kw_args = PyDict_Size(__pyx_kwds); + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 0: + values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__subscriber); + if (likely(values[0])) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__position); + if (likely(values[1])) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("add_subscriber", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 125; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "add_subscriber") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 125; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); } __pyx_v_subscriber = values[0]; __pyx_v_position = values[1]; - } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { - goto __pyx_L5_argtuple_error; - } else { - __pyx_v_subscriber = PyTuple_GET_ITEM(__pyx_args, 0); - __pyx_v_position = PyTuple_GET_ITEM(__pyx_args, 1); } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("add_subscriber", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 121; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_RaiseArgtupleInvalid("add_subscriber", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 125; __pyx_clineno = __LINE__; goto __pyx_L3_error;} __pyx_L3_error:; - __Pyx_AddTraceback("jlog.Writer.add_subscriber"); + __Pyx_AddTraceback("jlog.Writer.add_subscriber", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __pyx_v_subscriber; - __Pyx_INCREF(__pyx_t_1); - __pyx_t_2 = __pyx_v_position; - __Pyx_INCREF(__pyx_t_2); - __pyx_t_3 = ((struct __pyx_vtabstruct_4jlog_Writer *)((struct __pyx_obj_4jlog_Writer *)__pyx_v_self)->__pyx_vtab)->add_subscriber(((struct __pyx_obj_4jlog_Writer *)__pyx_v_self), __pyx_t_1, __pyx_t_2, 1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 121; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_r = __pyx_t_3; - __pyx_t_3 = 0; + __pyx_t_1 = ((struct __pyx_vtabstruct_4jlog_Writer *)((struct __pyx_obj_4jlog_Writer *)__pyx_v_self)->__pyx_vtab)->add_subscriber(((struct __pyx_obj_4jlog_Writer *)__pyx_v_self), __pyx_v_subscriber, __pyx_v_position, 1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 125; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; goto __pyx_L0; __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); - __Pyx_XDECREF(__pyx_t_2); - __Pyx_XDECREF(__pyx_t_3); - __Pyx_AddTraceback("jlog.Writer.add_subscriber"); + __Pyx_AddTraceback("jlog.Writer.add_subscriber", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); @@ -1874,7 +1953,7 @@ static PyObject *__pyx_pf_4jlog_6Writer_2add_subscriber(PyObject *__pyx_v_self, return __pyx_r; } -/* "jlog.pyx":129 +/* "jlog.pyx":133 * raise JLogError(cjlog.jlog_ctx_err(ctx), cjlog.jlog_ctx_err_string(ctx)) * * cpdef remove_subscriber(self, subscriber): # <<<<<<<<<<<<<< @@ -1883,30 +1962,34 @@ static PyObject *__pyx_pf_4jlog_6Writer_2add_subscriber(PyObject *__pyx_v_self, */ static PyObject *__pyx_pf_4jlog_6Writer_3remove_subscriber(PyObject *__pyx_v_self, PyObject *__pyx_v_subscriber); /*proto*/ -static PyObject *__pyx_f_4jlog_6Writer_remove_subscriber(struct __pyx_obj_4jlog_Writer *__pyx_v_self, PyObject *__pyx_v_subscriber, int __pyx_skip_dispatch) { +static PyObject *__pyx_f_4jlog_6Writer_remove_subscriber(struct __pyx_obj_4jlog_Writer *__pyx_v_self, PyObject *__pyx_v_subscriber, int __pyx_skip_dispatch) { jlog_ctx *__pyx_v_ctx; PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; char *__pyx_t_4; int __pyx_t_5; PyObject *__pyx_t_6 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; __Pyx_RefNannySetupContext("remove_subscriber"); /* Check if called by wrapper */ if (unlikely(__pyx_skip_dispatch)) ; /* Check if overriden in Python */ else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) { - __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s__remove_subscriber); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 129; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s__remove_subscriber); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 133; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (void *)&__pyx_pf_4jlog_6Writer_3remove_subscriber)) { __Pyx_XDECREF(__pyx_r); - __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 129; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 133; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(((PyObject *)__pyx_t_2)); __Pyx_INCREF(__pyx_v_subscriber); PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_subscriber); __Pyx_GIVEREF(__pyx_v_subscriber); - __pyx_t_3 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 129; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 133; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0; __pyx_r = __pyx_t_3; @@ -1917,7 +2000,7 @@ static PyObject *__pyx_f_4jlog_6Writer_remove_subscriber(struct __pyx_obj_4jlog __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } - /* "jlog.pyx":131 + /* "jlog.pyx":135 * cpdef remove_subscriber(self, subscriber): * cdef cjlog.jlog_ctx *ctx * ctx = cjlog.jlog_new(self.path) # <<<<<<<<<<<<<< @@ -1926,34 +2009,31 @@ static PyObject *__pyx_f_4jlog_6Writer_remove_subscriber(struct __pyx_obj_4jlog */ __pyx_v_ctx = jlog_new(__pyx_v_self->path); - /* "jlog.pyx":132 + /* "jlog.pyx":136 * cdef cjlog.jlog_ctx *ctx * ctx = cjlog.jlog_new(self.path) * if cjlog.jlog_ctx_remove_subscriber(ctx, PyString_AsString(subscriber)) != 1: # <<<<<<<<<<<<<< * raise JLogError(cjlog.jlog_ctx_err(ctx), cjlog.jlog_ctx_err_string(ctx)) * if cjlog.jlog_ctx_close(ctx) != 0: */ - __pyx_t_1 = __pyx_v_subscriber; - __Pyx_INCREF(__pyx_t_1); - __pyx_t_4 = PyString_AsString(__pyx_t_1); if (unlikely(__pyx_t_4 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 132; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_4 = PyString_AsString(__pyx_v_subscriber); if (unlikely(__pyx_t_4 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 136; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_5 = (jlog_ctx_remove_subscriber(__pyx_v_ctx, __pyx_t_4) != 1); if (__pyx_t_5) { - /* "jlog.pyx":133 + /* "jlog.pyx":137 * ctx = cjlog.jlog_new(self.path) * if cjlog.jlog_ctx_remove_subscriber(ctx, PyString_AsString(subscriber)) != 1: * raise JLogError(cjlog.jlog_ctx_err(ctx), cjlog.jlog_ctx_err_string(ctx)) # <<<<<<<<<<<<<< * if cjlog.jlog_ctx_close(ctx) != 0: * raise JLogError(cjlog.jlog_ctx_err(ctx), cjlog.jlog_ctx_err_string(ctx)) */ - __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__JLogError); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 133; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__JLogError); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 137; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - __pyx_t_3 = PyInt_FromLong(jlog_ctx_err(__pyx_v_ctx)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 133; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyInt_FromLong(jlog_ctx_err(__pyx_v_ctx)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 137; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); - __pyx_t_2 = PyBytes_FromString(jlog_ctx_err_string(__pyx_v_ctx)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 133; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyBytes_FromString(jlog_ctx_err_string(__pyx_v_ctx)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 137; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(((PyObject *)__pyx_t_2)); - __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 133; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 137; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(((PyObject *)__pyx_t_6)); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_3); __Pyx_GIVEREF(__pyx_t_3); @@ -1961,18 +2041,18 @@ static PyObject *__pyx_f_4jlog_6Writer_remove_subscriber(struct __pyx_obj_4jlog __Pyx_GIVEREF(((PyObject *)__pyx_t_2)); __pyx_t_3 = 0; __pyx_t_2 = 0; - __pyx_t_2 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_6), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 133; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_6), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 137; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(((PyObject *)__pyx_t_6)); __pyx_t_6 = 0; - __Pyx_Raise(__pyx_t_2, 0, 0); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 133; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 137; __pyx_clineno = __LINE__; goto __pyx_L1_error;} goto __pyx_L3; } __pyx_L3:; - /* "jlog.pyx":134 + /* "jlog.pyx":138 * if cjlog.jlog_ctx_remove_subscriber(ctx, PyString_AsString(subscriber)) != 1: * raise JLogError(cjlog.jlog_ctx_err(ctx), cjlog.jlog_ctx_err_string(ctx)) * if cjlog.jlog_ctx_close(ctx) != 0: # <<<<<<<<<<<<<< @@ -1982,20 +2062,20 @@ static PyObject *__pyx_f_4jlog_6Writer_remove_subscriber(struct __pyx_obj_4jlog __pyx_t_5 = (jlog_ctx_close(__pyx_v_ctx) != 0); if (__pyx_t_5) { - /* "jlog.pyx":135 + /* "jlog.pyx":139 * raise JLogError(cjlog.jlog_ctx_err(ctx), cjlog.jlog_ctx_err_string(ctx)) * if cjlog.jlog_ctx_close(ctx) != 0: * raise JLogError(cjlog.jlog_ctx_err(ctx), cjlog.jlog_ctx_err_string(ctx)) # <<<<<<<<<<<<<< * * def __dealloc__(self): */ - __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__JLogError); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 135; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__JLogError); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 139; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); - __pyx_t_6 = PyInt_FromLong(jlog_ctx_err(__pyx_v_ctx)); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 135; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = PyInt_FromLong(jlog_ctx_err(__pyx_v_ctx)); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 139; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); - __pyx_t_1 = PyBytes_FromString(jlog_ctx_err_string(__pyx_v_ctx)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 135; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyBytes_FromString(jlog_ctx_err_string(__pyx_v_ctx)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 139; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(((PyObject *)__pyx_t_1)); - __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 135; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 139; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(((PyObject *)__pyx_t_3)); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_6); __Pyx_GIVEREF(__pyx_t_6); @@ -2003,13 +2083,13 @@ static PyObject *__pyx_f_4jlog_6Writer_remove_subscriber(struct __pyx_obj_4jlog __Pyx_GIVEREF(((PyObject *)__pyx_t_1)); __pyx_t_6 = 0; __pyx_t_1 = 0; - __pyx_t_1 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 135; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 139; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0; - __Pyx_Raise(__pyx_t_1, 0, 0); + __Pyx_Raise(__pyx_t_1, 0, 0, 0); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 135; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 139; __pyx_clineno = __LINE__; goto __pyx_L1_error;} goto __pyx_L4; } __pyx_L4:; @@ -2021,7 +2101,7 @@ static PyObject *__pyx_f_4jlog_6Writer_remove_subscriber(struct __pyx_obj_4jlog __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_6); - __Pyx_AddTraceback("jlog.Writer.remove_subscriber"); + __Pyx_AddTraceback("jlog.Writer.remove_subscriber", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); @@ -2029,7 +2109,7 @@ static PyObject *__pyx_f_4jlog_6Writer_remove_subscriber(struct __pyx_obj_4jlog return __pyx_r; } -/* "jlog.pyx":129 +/* "jlog.pyx":133 * raise JLogError(cjlog.jlog_ctx_err(ctx), cjlog.jlog_ctx_err_string(ctx)) * * cpdef remove_subscriber(self, subscriber): # <<<<<<<<<<<<<< @@ -2040,25 +2120,24 @@ static PyObject *__pyx_f_4jlog_6Writer_remove_subscriber(struct __pyx_obj_4jlog static PyObject *__pyx_pf_4jlog_6Writer_3remove_subscriber(PyObject *__pyx_v_self, PyObject *__pyx_v_subscriber); /*proto*/ static PyObject *__pyx_pf_4jlog_6Writer_3remove_subscriber(PyObject *__pyx_v_self, PyObject *__pyx_v_subscriber) { PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; - PyObject *__pyx_t_2 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; __Pyx_RefNannySetupContext("remove_subscriber"); __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __pyx_v_subscriber; - __Pyx_INCREF(__pyx_t_1); - __pyx_t_2 = ((struct __pyx_vtabstruct_4jlog_Writer *)((struct __pyx_obj_4jlog_Writer *)__pyx_v_self)->__pyx_vtab)->remove_subscriber(((struct __pyx_obj_4jlog_Writer *)__pyx_v_self), __pyx_t_1, 1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 129; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_r = __pyx_t_2; - __pyx_t_2 = 0; + __pyx_t_1 = ((struct __pyx_vtabstruct_4jlog_Writer *)((struct __pyx_obj_4jlog_Writer *)__pyx_v_self)->__pyx_vtab)->remove_subscriber(((struct __pyx_obj_4jlog_Writer *)__pyx_v_self), __pyx_v_subscriber, 1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 133; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; goto __pyx_L0; __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); - __Pyx_XDECREF(__pyx_t_2); - __Pyx_AddTraceback("jlog.Writer.remove_subscriber"); + __Pyx_AddTraceback("jlog.Writer.remove_subscriber", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); @@ -2066,7 +2145,7 @@ static PyObject *__pyx_pf_4jlog_6Writer_3remove_subscriber(PyObject *__pyx_v_sel return __pyx_r; } -/* "jlog.pyx":137 +/* "jlog.pyx":141 * raise JLogError(cjlog.jlog_ctx_err(ctx), cjlog.jlog_ctx_err_string(ctx)) * * def __dealloc__(self): # <<<<<<<<<<<<<< @@ -2076,14 +2155,18 @@ static PyObject *__pyx_pf_4jlog_6Writer_3remove_subscriber(PyObject *__pyx_v_sel static void __pyx_pf_4jlog_6Writer_4__dealloc__(PyObject *__pyx_v_self); /*proto*/ static void __pyx_pf_4jlog_6Writer_4__dealloc__(PyObject *__pyx_v_self) { + __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__dealloc__"); - /* "jlog.pyx":138 + /* "jlog.pyx":142 * * def __dealloc__(self): * if self._ctx is not NULL: # <<<<<<<<<<<<<< @@ -2093,7 +2176,7 @@ static void __pyx_pf_4jlog_6Writer_4__dealloc__(PyObject *__pyx_v_self) { __pyx_t_1 = (((struct __pyx_obj_4jlog_Writer *)__pyx_v_self)->_ctx != NULL); if (__pyx_t_1) { - /* "jlog.pyx":139 + /* "jlog.pyx":143 * def __dealloc__(self): * if self._ctx is not NULL: * if cjlog.jlog_ctx_close(self._ctx) != 0: # <<<<<<<<<<<<<< @@ -2103,19 +2186,19 @@ static void __pyx_pf_4jlog_6Writer_4__dealloc__(PyObject *__pyx_v_self) { __pyx_t_1 = (jlog_ctx_close(((struct __pyx_obj_4jlog_Writer *)__pyx_v_self)->_ctx) != 0); if (__pyx_t_1) { - /* "jlog.pyx":140 + /* "jlog.pyx":144 * if self._ctx is not NULL: * if cjlog.jlog_ctx_close(self._ctx) != 0: * raise JLogError(cjlog.jlog_ctx_err(self._ctx), cjlog.jlog_ctx_err_string(self._ctx)) # <<<<<<<<<<<<<< * self._ctx = NULL */ - __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__JLogError); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 140; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__JLogError); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 144; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = PyInt_FromLong(jlog_ctx_err(((struct __pyx_obj_4jlog_Writer *)__pyx_v_self)->_ctx)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 140; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyInt_FromLong(jlog_ctx_err(((struct __pyx_obj_4jlog_Writer *)__pyx_v_self)->_ctx)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 144; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = PyBytes_FromString(jlog_ctx_err_string(((struct __pyx_obj_4jlog_Writer *)__pyx_v_self)->_ctx)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 140; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PyBytes_FromString(jlog_ctx_err_string(((struct __pyx_obj_4jlog_Writer *)__pyx_v_self)->_ctx)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 144; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(((PyObject *)__pyx_t_4)); - __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 140; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 144; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(((PyObject *)__pyx_t_5)); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_3); __Pyx_GIVEREF(__pyx_t_3); @@ -2123,18 +2206,18 @@ static void __pyx_pf_4jlog_6Writer_4__dealloc__(PyObject *__pyx_v_self) { __Pyx_GIVEREF(((PyObject *)__pyx_t_4)); __pyx_t_3 = 0; __pyx_t_4 = 0; - __pyx_t_4 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_t_5), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 140; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_t_5), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 144; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0; - __Pyx_Raise(__pyx_t_4, 0, 0); + __Pyx_Raise(__pyx_t_4, 0, 0, 0); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 140; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 144; __pyx_clineno = __LINE__; goto __pyx_L1_error;} goto __pyx_L6; } __pyx_L6:; - /* "jlog.pyx":141 + /* "jlog.pyx":145 * if cjlog.jlog_ctx_close(self._ctx) != 0: * raise JLogError(cjlog.jlog_ctx_err(self._ctx), cjlog.jlog_ctx_err_string(self._ctx)) * self._ctx = NULL # <<<<<<<<<<<<<< @@ -2150,7 +2233,7 @@ static void __pyx_pf_4jlog_6Writer_4__dealloc__(PyObject *__pyx_v_self) { __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); - __Pyx_AddTraceback("jlog.Writer.__dealloc__"); + __Pyx_AddTraceback("jlog.Writer.__dealloc__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_L0:; __Pyx_RefNannyFinishContext(); } @@ -2179,6 +2262,7 @@ static void __pyx_tp_dealloc_4jlog_Reader(PyObject *o) { static PyMethodDef __pyx_methods_4jlog_Reader[] = { {__Pyx_NAMESTR("__next__"), (PyCFunction)__pyx_pf_4jlog_6Reader_3__next__, METH_NOARGS|METH_COEXIST, __Pyx_DOCSTR(0)}, + {__Pyx_NAMESTR("will_checkpoint"), (PyCFunction)__pyx_pf_4jlog_6Reader_5will_checkpoint, METH_NOARGS, __Pyx_DOCSTR(0)}, {0, 0, 0, 0} }; @@ -2552,27 +2636,23 @@ static __Pyx_StringTabEntry __pyx_string_tab[] = { {&__pyx_n_s____next__, __pyx_k____next__, sizeof(__pyx_k____next__), 0, 0, 1, 1}, {&__pyx_n_s____str__, __pyx_k____str__, sizeof(__pyx_k____str__), 0, 0, 1, 1}, {&__pyx_n_s____test__, __pyx_k____test__, sizeof(__pyx_k____test__), 0, 0, 1, 1}, - {&__pyx_n_s___ctx, __pyx_k___ctx, sizeof(__pyx_k___ctx), 0, 0, 1, 1}, {&__pyx_n_s__add_subscriber, __pyx_k__add_subscriber, sizeof(__pyx_k__add_subscriber), 0, 0, 1, 1}, - {&__pyx_n_s__begin, __pyx_k__begin, sizeof(__pyx_k__begin), 0, 0, 1, 1}, - {&__pyx_n_s__empty, __pyx_k__empty, sizeof(__pyx_k__empty), 0, 0, 1, 1}, - {&__pyx_n_s__end, __pyx_k__end, sizeof(__pyx_k__end), 0, 0, 1, 1}, {&__pyx_n_s__jlog, __pyx_k__jlog, sizeof(__pyx_k__jlog), 0, 0, 1, 1}, - {&__pyx_n_s__marker, __pyx_k__marker, sizeof(__pyx_k__marker), 0, 0, 1, 1}, - {&__pyx_n_s__mess, __pyx_k__mess, sizeof(__pyx_k__mess), 0, 0, 1, 1}, - {&__pyx_n_s__mess_len, __pyx_k__mess_len, sizeof(__pyx_k__mess_len), 0, 0, 1, 1}, {&__pyx_n_s__msg, __pyx_k__msg, sizeof(__pyx_k__msg), 0, 0, 1, 1}, {&__pyx_n_s__num, __pyx_k__num, sizeof(__pyx_k__num), 0, 0, 1, 1}, {&__pyx_n_s__path, __pyx_k__path, sizeof(__pyx_k__path), 0, 0, 1, 1}, {&__pyx_n_s__position, __pyx_k__position, sizeof(__pyx_k__position), 0, 0, 1, 1}, + {&__pyx_n_s__property, __pyx_k__property, sizeof(__pyx_k__property), 0, 0, 1, 1}, {&__pyx_n_s__reader, __pyx_k__reader, sizeof(__pyx_k__reader), 0, 0, 1, 1}, {&__pyx_n_s__remove_subscriber, __pyx_k__remove_subscriber, sizeof(__pyx_k__remove_subscriber), 0, 0, 1, 1}, {&__pyx_n_s__self, __pyx_k__self, sizeof(__pyx_k__self), 0, 0, 1, 1}, {&__pyx_n_s__subscriber, __pyx_k__subscriber, sizeof(__pyx_k__subscriber), 0, 0, 1, 1}, + {&__pyx_n_s__will_checkpoint, __pyx_k__will_checkpoint, sizeof(__pyx_k__will_checkpoint), 0, 0, 1, 1}, {0, 0, 0, 0, 0, 0, 0} }; static int __Pyx_InitCachedBuiltins(void) { __pyx_builtin_Exception = __Pyx_GetName(__pyx_b, __pyx_n_s__Exception); if (!__pyx_builtin_Exception) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 30; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_builtin_property = __Pyx_GetName(__pyx_b, __pyx_n_s__property); if (!__pyx_builtin_property) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 92; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_builtin_StopIteration = __Pyx_GetName(__pyx_b, __pyx_n_s__StopIteration); if (!__pyx_builtin_StopIteration) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 67; __pyx_clineno = __LINE__; goto __pyx_L1_error;} return 0; __pyx_L1_error:; @@ -2580,6 +2660,7 @@ static int __Pyx_InitCachedBuiltins(void) { } static int __Pyx_InitCachedConstants(void) { + __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__Pyx_InitCachedConstants"); __Pyx_RefNannyFinishContext(); return 0; @@ -2603,8 +2684,8 @@ PyMODINIT_FUNC PyInit_jlog(void) PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; + __Pyx_RefNannyDeclarations #if CYTHON_REFNANNY - void* __pyx_refnanny = NULL; __Pyx_RefNanny = __Pyx_RefNannyImportAPI("refnanny"); if (!__Pyx_RefNanny) { PyErr_Clear(); @@ -2612,8 +2693,9 @@ PyMODINIT_FUNC PyInit_jlog(void) if (!__Pyx_RefNanny) Py_FatalError("failed to import 'refnanny' module"); } - __pyx_refnanny = __Pyx_RefNanny->SetupContext("PyMODINIT_FUNC PyInit_jlog(void)", __LINE__, __FILE__); #endif + __Pyx_RefNannySetupContext("PyMODINIT_FUNC PyInit_jlog(void)"); + if ( __Pyx_check_binary_version() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_empty_tuple = PyTuple_New(0); if (unlikely(!__pyx_empty_tuple)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_empty_bytes = PyBytes_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_bytes)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #ifdef __pyx_binding_PyCFunctionType_USED @@ -2649,6 +2731,7 @@ PyMODINIT_FUNC PyInit_jlog(void) /*--- Constants init code ---*/ if (unlikely(__Pyx_InitCachedConstants() < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /*--- Global init code ---*/ + /*--- Variable export code ---*/ /*--- Function export code ---*/ /*--- Type init code ---*/ if (PyType_Ready(&__pyx_type_4jlog_Reader) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 40; __pyx_clineno = __LINE__; goto __pyx_L1_error;} @@ -2657,13 +2740,14 @@ PyMODINIT_FUNC PyInit_jlog(void) __pyx_vtabptr_4jlog_Writer = &__pyx_vtable_4jlog_Writer; __pyx_vtable_4jlog_Writer.add_subscriber = (PyObject *(*)(struct __pyx_obj_4jlog_Writer *, PyObject *, PyObject *, int __pyx_skip_dispatch))__pyx_f_4jlog_6Writer_add_subscriber; __pyx_vtable_4jlog_Writer.remove_subscriber = (PyObject *(*)(struct __pyx_obj_4jlog_Writer *, PyObject *, int __pyx_skip_dispatch))__pyx_f_4jlog_6Writer_remove_subscriber; - if (PyType_Ready(&__pyx_type_4jlog_Writer) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 93; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - if (__Pyx_SetVtable(__pyx_type_4jlog_Writer.tp_dict, __pyx_vtabptr_4jlog_Writer) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 93; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - if (__Pyx_SetAttrString(__pyx_m, "Writer", (PyObject *)&__pyx_type_4jlog_Writer) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 93; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PyType_Ready(&__pyx_type_4jlog_Writer) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 97; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (__Pyx_SetVtable(__pyx_type_4jlog_Writer.tp_dict, __pyx_vtabptr_4jlog_Writer) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 97; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (__Pyx_SetAttrString(__pyx_m, "Writer", (PyObject *)&__pyx_type_4jlog_Writer) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 97; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_ptype_4jlog_Writer = &__pyx_type_4jlog_Writer; /*--- Type import code ---*/ __pyx_ptype_7cpython_4bool_bool = __Pyx_ImportType(__Pyx_BUILTIN_MODULE_NAME, "bool", sizeof(PyBoolObject), 0); if (unlikely(!__pyx_ptype_7cpython_4bool_bool)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 8; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_ptype_7cpython_7complex_complex = __Pyx_ImportType(__Pyx_BUILTIN_MODULE_NAME, "complex", sizeof(PyComplexObject), 0); if (unlikely(!__pyx_ptype_7cpython_7complex_complex)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 15; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + /*--- Variable import code ---*/ /*--- Function import code ---*/ /*--- Execution code ---*/ @@ -2744,6 +2828,27 @@ PyMODINIT_FUNC PyInit_jlog(void) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0; + /* "jlog.pyx":93 + * + * @property + * def will_checkpoint(self): # <<<<<<<<<<<<<< + * return self.begin.marker > self.end.marker + * + */ + __pyx_t_1 = __Pyx_GetName((PyObject *)__pyx_ptype_4jlog_Reader, __pyx_n_s__will_checkpoint); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 93; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 92; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(((PyObject *)__pyx_t_3)); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1); + __Pyx_GIVEREF(__pyx_t_1); + __pyx_t_1 = 0; + __pyx_t_1 = PyObject_Call(__pyx_builtin_property, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 92; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0; + if (PyDict_SetItem((PyObject *)__pyx_ptype_4jlog_Reader->tp_dict, __pyx_n_s__will_checkpoint, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 93; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + PyType_Modified(__pyx_ptype_4jlog_Reader); + /* "jlog.pyx":1 * # file: jlog.pyx # <<<<<<<<<<<<<< * # encoding: utf-8 @@ -2753,20 +2858,13 @@ PyMODINIT_FUNC PyInit_jlog(void) __Pyx_GOTREF(((PyObject *)__pyx_t_1)); if (PyObject_SetAttr(__pyx_m, __pyx_n_s____test__, ((PyObject *)__pyx_t_1)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0; - - /* "cpython/type.pxd":2 - * - * cdef extern from "Python.h": # <<<<<<<<<<<<<< - * # The C structure of the objects used to describe built-in types. - * - */ goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); if (__pyx_m) { - __Pyx_AddTraceback("init jlog"); + __Pyx_AddTraceback("init jlog", __pyx_clineno, __pyx_lineno, __pyx_filename); Py_DECREF(__pyx_m); __pyx_m = 0; } else if (!PyErr_Occurred()) { PyErr_SetString(PyExc_ImportError, "init jlog"); @@ -2782,11 +2880,34 @@ PyMODINIT_FUNC PyInit_jlog(void) /* Runtime support code */ +#if CYTHON_REFNANNY +static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname) { + PyObject *m = NULL, *p = NULL; + void *r = NULL; + m = PyImport_ImportModule((char *)modname); + if (!m) goto end; + p = PyObject_GetAttrString(m, (char *)"RefNannyAPI"); + if (!p) goto end; + r = PyLong_AsVoidPtr(p); +end: + Py_XDECREF(p); + Py_XDECREF(m); + return (__Pyx_RefNannyAPIStruct *)r; +} +#endif /* CYTHON_REFNANNY */ + static PyObject *__Pyx_GetName(PyObject *dict, PyObject *name) { PyObject *result; result = PyObject_GetAttr(dict, name); - if (!result) - PyErr_SetObject(PyExc_NameError, name); + if (!result) { + if (dict != __pyx_b) { + PyErr_Clear(); + result = PyObject_GetAttr(__pyx_b, name); + } + if (!result) { + PyErr_SetObject(PyExc_NameError, name); + } + } return result; } @@ -2798,7 +2919,7 @@ static void __Pyx_RaiseArgtupleInvalid( Py_ssize_t num_found) { Py_ssize_t num_expected; - const char *number, *more_or_less; + const char *more_or_less; if (num_found < num_min) { num_expected = num_min; @@ -2810,14 +2931,10 @@ static void __Pyx_RaiseArgtupleInvalid( if (exact) { more_or_less = "exactly"; } - number = (num_expected == 1) ? "" : "s"; PyErr_Format(PyExc_TypeError, - #if PY_VERSION_HEX < 0x02050000 - "%s() takes %s %d positional argument%s (%d given)", - #else - "%s() takes %s %zd positional argument%s (%zd given)", - #endif - func_name, more_or_less, num_expected, number, num_found); + "%s() takes %s %"PY_FORMAT_SIZE_T"d positional argument%s (%"PY_FORMAT_SIZE_T"d given)", + func_name, more_or_less, num_expected, + (num_expected == 1) ? "" : "s", num_found); } static void __Pyx_RaiseDoubleKeywordsError( @@ -2940,7 +3057,8 @@ static CYTHON_INLINE void __Pyx_ErrFetch(PyObject **type, PyObject **value, PyOb #if PY_MAJOR_VERSION < 3 -static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb) { +static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause) { + /* cause is unused */ Py_XINCREF(type); Py_XINCREF(value); Py_XINCREF(tb); @@ -3007,7 +3125,7 @@ static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb) { #else /* Python 3+ */ -static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb) { +static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause) { if (tb == Py_None) { tb = 0; } else if (tb && !PyTraceBack_Check(tb)) { @@ -3032,6 +3150,29 @@ static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb) { goto bad; } + if (cause) { + PyObject *fixed_cause; + if (PyExceptionClass_Check(cause)) { + fixed_cause = PyObject_CallObject(cause, NULL); + if (fixed_cause == NULL) + goto bad; + } + else if (PyExceptionInstance_Check(cause)) { + fixed_cause = cause; + Py_INCREF(fixed_cause); + } + else { + PyErr_SetString(PyExc_TypeError, + "exception causes must derive from " + "BaseException"); + goto bad; + } + if (!value) { + value = PyObject_CallObject(type, NULL); + } + PyException_SetCause(value, fixed_cause); + } + PyErr_SetObject(type, value); if (tb) { @@ -3055,7 +3196,7 @@ static PyObject *__Pyx_FindPy2Metaclass(PyObject *bases) { #if PY_MAJOR_VERSION < 3 if (PyTuple_Check(bases) && PyTuple_GET_SIZE(bases) > 0) { PyObject *base = PyTuple_GET_ITEM(bases, 0); - metaclass = PyObject_GetAttrString(base, "__class__"); + metaclass = PyObject_GetAttrString(base, (char *)"__class__"); if (!metaclass) { PyErr_Clear(); metaclass = (PyObject*) Py_TYPE(base); @@ -3097,29 +3238,29 @@ static PyObject *__Pyx_CreateClass(PyObject *bases, PyObject *dict, PyObject *na static PyObject *__pyx_binding_PyCFunctionType_NewEx(PyMethodDef *ml, PyObject *self, PyObject *module) { - __pyx_binding_PyCFunctionType_object *op = PyObject_GC_New(__pyx_binding_PyCFunctionType_object, __pyx_binding_PyCFunctionType); + __pyx_binding_PyCFunctionType_object *op = PyObject_GC_New(__pyx_binding_PyCFunctionType_object, __pyx_binding_PyCFunctionType); if (op == NULL) return NULL; - op->func.m_ml = ml; - Py_XINCREF(self); - op->func.m_self = self; - Py_XINCREF(module); - op->func.m_module = module; - PyObject_GC_Track(op); - return (PyObject *)op; + op->func.m_ml = ml; + Py_XINCREF(self); + op->func.m_self = self; + Py_XINCREF(module); + op->func.m_module = module; + PyObject_GC_Track(op); + return (PyObject *)op; } static void __pyx_binding_PyCFunctionType_dealloc(__pyx_binding_PyCFunctionType_object *m) { - PyObject_GC_UnTrack(m); - Py_XDECREF(m->func.m_self); - Py_XDECREF(m->func.m_module); + PyObject_GC_UnTrack(m); + Py_XDECREF(m->func.m_self); + Py_XDECREF(m->func.m_module); PyObject_GC_Del(m); } static PyObject *__pyx_binding_PyCFunctionType_descr_get(PyObject *func, PyObject *obj, PyObject *type) { - if (obj == Py_None) - obj = NULL; - return PyMethod_New(func, obj, type); + if (obj == Py_None) + obj = NULL; + return PyMethod_New(func, obj, type); } static int __pyx_binding_PyCFunctionType_init(void) { @@ -3346,9 +3487,9 @@ static CYTHON_INLINE unsigned long __Pyx_PyInt_AsUnsignedLong(PyObject* x) { "can't convert negative value to unsigned long"); return (unsigned long)-1; } - return PyLong_AsUnsignedLong(x); + return (unsigned long)PyLong_AsUnsignedLong(x); } else { - return PyLong_AsLong(x); + return (unsigned long)PyLong_AsLong(x); } } else { unsigned long val; @@ -3381,9 +3522,9 @@ static CYTHON_INLINE unsigned PY_LONG_LONG __Pyx_PyInt_AsUnsignedLongLong(PyObje "can't convert negative value to unsigned PY_LONG_LONG"); return (unsigned PY_LONG_LONG)-1; } - return PyLong_AsUnsignedLongLong(x); + return (unsigned PY_LONG_LONG)PyLong_AsUnsignedLongLong(x); } else { - return PyLong_AsLongLong(x); + return (unsigned PY_LONG_LONG)PyLong_AsLongLong(x); } } else { unsigned PY_LONG_LONG val; @@ -3416,9 +3557,9 @@ static CYTHON_INLINE long __Pyx_PyInt_AsLong(PyObject* x) { "can't convert negative value to long"); return (long)-1; } - return PyLong_AsUnsignedLong(x); + return (long)PyLong_AsUnsignedLong(x); } else { - return PyLong_AsLong(x); + return (long)PyLong_AsLong(x); } } else { long val; @@ -3451,9 +3592,9 @@ static CYTHON_INLINE PY_LONG_LONG __Pyx_PyInt_AsLongLong(PyObject* x) { "can't convert negative value to PY_LONG_LONG"); return (PY_LONG_LONG)-1; } - return PyLong_AsUnsignedLongLong(x); + return (PY_LONG_LONG)PyLong_AsUnsignedLongLong(x); } else { - return PyLong_AsLongLong(x); + return (PY_LONG_LONG)PyLong_AsLongLong(x); } } else { PY_LONG_LONG val; @@ -3486,9 +3627,9 @@ static CYTHON_INLINE signed long __Pyx_PyInt_AsSignedLong(PyObject* x) { "can't convert negative value to signed long"); return (signed long)-1; } - return PyLong_AsUnsignedLong(x); + return (signed long)PyLong_AsUnsignedLong(x); } else { - return PyLong_AsLong(x); + return (signed long)PyLong_AsLong(x); } } else { signed long val; @@ -3521,9 +3662,9 @@ static CYTHON_INLINE signed PY_LONG_LONG __Pyx_PyInt_AsSignedLongLong(PyObject* "can't convert negative value to signed PY_LONG_LONG"); return (signed PY_LONG_LONG)-1; } - return PyLong_AsUnsignedLongLong(x); + return (signed PY_LONG_LONG)PyLong_AsUnsignedLongLong(x); } else { - return PyLong_AsLongLong(x); + return (signed PY_LONG_LONG)PyLong_AsLongLong(x); } } else { signed PY_LONG_LONG val; @@ -3535,6 +3676,25 @@ static CYTHON_INLINE signed PY_LONG_LONG __Pyx_PyInt_AsSignedLongLong(PyObject* } } +static int __Pyx_check_binary_version(void) { + char ctversion[4], rtversion[4]; + PyOS_snprintf(ctversion, 4, "%d.%d", PY_MAJOR_VERSION, PY_MINOR_VERSION); + PyOS_snprintf(rtversion, 4, "%s", Py_GetVersion()); + if (ctversion[0] != rtversion[0] || ctversion[2] != rtversion[2]) { + char message[200]; + PyOS_snprintf(message, sizeof(message), + "compiletime version %s of module '%.100s' " + "does not match runtime version %s", + ctversion, __Pyx_MODULE_NAME, rtversion); + #if PY_VERSION_HEX < 0x02050000 + return PyErr_Warn(NULL, message); + #else + return PyErr_WarnEx(NULL, message, 1); + #endif + } + return 0; +} + static int __Pyx_SetVtable(PyObject *dict, void *vtable) { #if PY_VERSION_HEX >= 0x02070000 && !(PY_MAJOR_VERSION==3&&PY_MINOR_VERSION==0) PyObject *ob = PyCapsule_New(vtable, 0, 0); @@ -3555,7 +3715,7 @@ static int __Pyx_SetVtable(PyObject *dict, void *vtable) { #ifndef __PYX_HAVE_RT_ImportType #define __PYX_HAVE_RT_ImportType static PyTypeObject *__Pyx_ImportType(const char *module_name, const char *class_name, - long size, int strict) + size_t size, int strict) { PyObject *py_module = 0; PyObject *result = 0; @@ -3585,17 +3745,17 @@ static PyTypeObject *__Pyx_ImportType(const char *module_name, const char *class module_name, class_name); goto bad; } - if (!strict && ((PyTypeObject *)result)->tp_basicsize > size) { + if (!strict && ((PyTypeObject *)result)->tp_basicsize > (Py_ssize_t)size) { PyOS_snprintf(warning, sizeof(warning), "%s.%s size changed, may indicate binary incompatibility", module_name, class_name); #if PY_VERSION_HEX < 0x02050000 - PyErr_Warn(NULL, warning); + if (PyErr_Warn(NULL, warning) < 0) goto bad; #else - PyErr_WarnEx(NULL, warning, 0); + if (PyErr_WarnEx(NULL, warning, 0) < 0) goto bad; #endif } - else if (((PyTypeObject *)result)->tp_basicsize != size) { + else if (((PyTypeObject *)result)->tp_basicsize != (Py_ssize_t)size) { PyErr_Format(PyExc_ValueError, "%s.%s has the wrong size, try recompiling", module_name, class_name); @@ -3605,7 +3765,7 @@ static PyTypeObject *__Pyx_ImportType(const char *module_name, const char *class bad: Py_XDECREF(py_module); Py_XDECREF(result); - return 0; + return NULL; } #endif @@ -3635,7 +3795,8 @@ static PyObject *__Pyx_ImportModule(const char *name) { #include "frameobject.h" #include "traceback.h" -static void __Pyx_AddTraceback(const char *funcname) { +static void __Pyx_AddTraceback(const char *funcname, int __pyx_clineno, + int __pyx_lineno, const char *__pyx_filename) { PyObject *py_srcfile = 0; PyObject *py_funcname = 0; PyObject *py_globals = 0; diff --git a/jlog.pyx b/jlog.pyx index cdd15c2..976fe51 100644 --- a/jlog.pyx +++ b/jlog.pyx @@ -89,6 +89,10 @@ cdef class Reader: raise JLogError(cjlog.jlog_ctx_err(self._ctx), cjlog.jlog_ctx_err_string(self._ctx)) self._ctx = NULL + @property + def will_checkpoint(self): + return self.begin.marker > self.end.marker + cdef class Writer: