19726 lines
838 KiB
C++
19726 lines
838 KiB
C++
/* Generated by Cython 0.19.1 on Sat Jul 6 23:14:34 2013 */
|
|
|
|
#define PY_SSIZE_T_CLEAN
|
|
#ifndef CYTHON_USE_PYLONG_INTERNALS
|
|
#ifdef PYLONG_BITS_IN_DIGIT
|
|
#define CYTHON_USE_PYLONG_INTERNALS 0
|
|
#else
|
|
#include "pyconfig.h"
|
|
#ifdef PYLONG_BITS_IN_DIGIT
|
|
#define CYTHON_USE_PYLONG_INTERNALS 1
|
|
#else
|
|
#define CYTHON_USE_PYLONG_INTERNALS 0
|
|
#endif
|
|
#endif
|
|
#endif
|
|
#include "Python.h"
|
|
#ifndef Py_PYTHON_H
|
|
#error Python headers needed to compile C extensions, please install development version of Python.
|
|
#elif PY_VERSION_HEX < 0x02040000
|
|
#error Cython requires Python 2.4+.
|
|
#else
|
|
#include <stddef.h> /* For offsetof */
|
|
#ifndef offsetof
|
|
#define offsetof(type, member) ( (size_t) & ((type*)0) -> member )
|
|
#endif
|
|
#if !defined(WIN32) && !defined(MS_WINDOWS)
|
|
#ifndef __stdcall
|
|
#define __stdcall
|
|
#endif
|
|
#ifndef __cdecl
|
|
#define __cdecl
|
|
#endif
|
|
#ifndef __fastcall
|
|
#define __fastcall
|
|
#endif
|
|
#endif
|
|
#ifndef DL_IMPORT
|
|
#define DL_IMPORT(t) t
|
|
#endif
|
|
#ifndef DL_EXPORT
|
|
#define DL_EXPORT(t) t
|
|
#endif
|
|
#ifndef PY_LONG_LONG
|
|
#define PY_LONG_LONG LONG_LONG
|
|
#endif
|
|
#ifndef Py_HUGE_VAL
|
|
#define Py_HUGE_VAL HUGE_VAL
|
|
#endif
|
|
#ifdef PYPY_VERSION
|
|
#define CYTHON_COMPILING_IN_PYPY 1
|
|
#define CYTHON_COMPILING_IN_CPYTHON 0
|
|
#else
|
|
#define CYTHON_COMPILING_IN_PYPY 0
|
|
#define CYTHON_COMPILING_IN_CPYTHON 1
|
|
#endif
|
|
#if PY_VERSION_HEX < 0x02050000
|
|
typedef int Py_ssize_t;
|
|
#define PY_SSIZE_T_MAX INT_MAX
|
|
#define PY_SSIZE_T_MIN INT_MIN
|
|
#define PY_FORMAT_SIZE_T ""
|
|
#define CYTHON_FORMAT_SSIZE_T ""
|
|
#define PyInt_FromSsize_t(z) PyInt_FromLong(z)
|
|
#define PyInt_AsSsize_t(o) __Pyx_PyInt_AsInt(o)
|
|
#define PyNumber_Index(o) ((PyNumber_Check(o) && !PyFloat_Check(o)) ? PyNumber_Int(o) : \
|
|
(PyErr_Format(PyExc_TypeError, \
|
|
"expected index value, got %.200s", Py_TYPE(o)->tp_name), \
|
|
(PyObject*)0))
|
|
#define __Pyx_PyIndex_Check(o) (PyNumber_Check(o) && !PyFloat_Check(o) && \
|
|
!PyComplex_Check(o))
|
|
#define PyIndex_Check __Pyx_PyIndex_Check
|
|
#define PyErr_WarnEx(category, message, stacklevel) PyErr_Warn(category, message)
|
|
#define __PYX_BUILD_PY_SSIZE_T "i"
|
|
#else
|
|
#define __PYX_BUILD_PY_SSIZE_T "n"
|
|
#define CYTHON_FORMAT_SSIZE_T "z"
|
|
#define __Pyx_PyIndex_Check PyIndex_Check
|
|
#endif
|
|
#if PY_VERSION_HEX < 0x02060000
|
|
#define Py_REFCNT(ob) (((PyObject*)(ob))->ob_refcnt)
|
|
#define Py_TYPE(ob) (((PyObject*)(ob))->ob_type)
|
|
#define Py_SIZE(ob) (((PyVarObject*)(ob))->ob_size)
|
|
#define PyVarObject_HEAD_INIT(type, size) \
|
|
PyObject_HEAD_INIT(type) size,
|
|
#define PyType_Modified(t)
|
|
typedef struct {
|
|
void *buf;
|
|
PyObject *obj;
|
|
Py_ssize_t len;
|
|
Py_ssize_t itemsize;
|
|
int readonly;
|
|
int ndim;
|
|
char *format;
|
|
Py_ssize_t *shape;
|
|
Py_ssize_t *strides;
|
|
Py_ssize_t *suboffsets;
|
|
void *internal;
|
|
} Py_buffer;
|
|
#define PyBUF_SIMPLE 0
|
|
#define PyBUF_WRITABLE 0x0001
|
|
#define PyBUF_FORMAT 0x0004
|
|
#define PyBUF_ND 0x0008
|
|
#define PyBUF_STRIDES (0x0010 | PyBUF_ND)
|
|
#define PyBUF_C_CONTIGUOUS (0x0020 | PyBUF_STRIDES)
|
|
#define PyBUF_F_CONTIGUOUS (0x0040 | PyBUF_STRIDES)
|
|
#define PyBUF_ANY_CONTIGUOUS (0x0080 | PyBUF_STRIDES)
|
|
#define PyBUF_INDIRECT (0x0100 | PyBUF_STRIDES)
|
|
#define PyBUF_RECORDS (PyBUF_STRIDES | PyBUF_FORMAT | PyBUF_WRITABLE)
|
|
#define PyBUF_FULL (PyBUF_INDIRECT | PyBUF_FORMAT | PyBUF_WRITABLE)
|
|
typedef int (*getbufferproc)(PyObject *, Py_buffer *, int);
|
|
typedef void (*releasebufferproc)(PyObject *, Py_buffer *);
|
|
#endif
|
|
#if PY_MAJOR_VERSION < 3
|
|
#define __Pyx_BUILTIN_MODULE_NAME "__builtin__"
|
|
#define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) \
|
|
PyCode_New(a, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)
|
|
#else
|
|
#define __Pyx_BUILTIN_MODULE_NAME "builtins"
|
|
#define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) \
|
|
PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)
|
|
#endif
|
|
#if PY_MAJOR_VERSION < 3 && PY_MINOR_VERSION < 6
|
|
#define PyUnicode_FromString(s) PyUnicode_Decode(s, strlen(s), "UTF-8", "strict")
|
|
#endif
|
|
#if PY_MAJOR_VERSION >= 3
|
|
#define Py_TPFLAGS_CHECKTYPES 0
|
|
#define Py_TPFLAGS_HAVE_INDEX 0
|
|
#endif
|
|
#if (PY_VERSION_HEX < 0x02060000) || (PY_MAJOR_VERSION >= 3)
|
|
#define Py_TPFLAGS_HAVE_NEWBUFFER 0
|
|
#endif
|
|
#if PY_VERSION_HEX < 0x02060000
|
|
#define Py_TPFLAGS_HAVE_VERSION_TAG 0
|
|
#endif
|
|
#if PY_VERSION_HEX > 0x03030000 && defined(PyUnicode_KIND)
|
|
#define CYTHON_PEP393_ENABLED 1
|
|
#define __Pyx_PyUnicode_READY(op) (likely(PyUnicode_IS_READY(op)) ? \
|
|
0 : _PyUnicode_Ready((PyObject *)(op)))
|
|
#define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_LENGTH(u)
|
|
#define __Pyx_PyUnicode_READ_CHAR(u, i) PyUnicode_READ_CHAR(u, i)
|
|
#define __Pyx_PyUnicode_READ(k, d, i) PyUnicode_READ(k, d, i)
|
|
#else
|
|
#define CYTHON_PEP393_ENABLED 0
|
|
#define __Pyx_PyUnicode_READY(op) (0)
|
|
#define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_SIZE(u)
|
|
#define __Pyx_PyUnicode_READ_CHAR(u, i) ((Py_UCS4)(PyUnicode_AS_UNICODE(u)[i]))
|
|
#define __Pyx_PyUnicode_READ(k, d, i) ((k=k), (Py_UCS4)(((Py_UNICODE*)d)[i]))
|
|
#endif
|
|
#if PY_MAJOR_VERSION >= 3
|
|
#define PyBaseString_Type PyUnicode_Type
|
|
#define PyStringObject PyUnicodeObject
|
|
#define PyString_Type PyUnicode_Type
|
|
#define PyString_Check PyUnicode_Check
|
|
#define PyString_CheckExact PyUnicode_CheckExact
|
|
#endif
|
|
#if PY_VERSION_HEX < 0x02060000
|
|
#define PyBytesObject PyStringObject
|
|
#define PyBytes_Type PyString_Type
|
|
#define PyBytes_Check PyString_Check
|
|
#define PyBytes_CheckExact PyString_CheckExact
|
|
#define PyBytes_FromString PyString_FromString
|
|
#define PyBytes_FromStringAndSize PyString_FromStringAndSize
|
|
#define PyBytes_FromFormat PyString_FromFormat
|
|
#define PyBytes_DecodeEscape PyString_DecodeEscape
|
|
#define PyBytes_AsString PyString_AsString
|
|
#define PyBytes_AsStringAndSize PyString_AsStringAndSize
|
|
#define PyBytes_Size PyString_Size
|
|
#define PyBytes_AS_STRING PyString_AS_STRING
|
|
#define PyBytes_GET_SIZE PyString_GET_SIZE
|
|
#define PyBytes_Repr PyString_Repr
|
|
#define PyBytes_Concat PyString_Concat
|
|
#define PyBytes_ConcatAndDel PyString_ConcatAndDel
|
|
#endif
|
|
#if PY_MAJOR_VERSION >= 3
|
|
#define __Pyx_PyBaseString_Check(obj) PyUnicode_Check(obj)
|
|
#define __Pyx_PyBaseString_CheckExact(obj) PyUnicode_CheckExact(obj)
|
|
#else
|
|
#define __Pyx_PyBaseString_Check(obj) (PyString_CheckExact(obj) || PyUnicode_CheckExact(obj) || \
|
|
PyString_Check(obj) || PyUnicode_Check(obj))
|
|
#define __Pyx_PyBaseString_CheckExact(obj) (Py_TYPE(obj) == &PyBaseString_Type)
|
|
#endif
|
|
#if PY_VERSION_HEX < 0x02060000
|
|
#define PySet_Check(obj) PyObject_TypeCheck(obj, &PySet_Type)
|
|
#define PyFrozenSet_Check(obj) PyObject_TypeCheck(obj, &PyFrozenSet_Type)
|
|
#endif
|
|
#ifndef PySet_CheckExact
|
|
#define PySet_CheckExact(obj) (Py_TYPE(obj) == &PySet_Type)
|
|
#endif
|
|
#define __Pyx_TypeCheck(obj, type) PyObject_TypeCheck(obj, (PyTypeObject *)type)
|
|
#if PY_MAJOR_VERSION >= 3
|
|
#define PyIntObject PyLongObject
|
|
#define PyInt_Type PyLong_Type
|
|
#define PyInt_Check(op) PyLong_Check(op)
|
|
#define PyInt_CheckExact(op) PyLong_CheckExact(op)
|
|
#define PyInt_FromString PyLong_FromString
|
|
#define PyInt_FromUnicode PyLong_FromUnicode
|
|
#define PyInt_FromLong PyLong_FromLong
|
|
#define PyInt_FromSize_t PyLong_FromSize_t
|
|
#define PyInt_FromSsize_t PyLong_FromSsize_t
|
|
#define PyInt_AsLong PyLong_AsLong
|
|
#define PyInt_AS_LONG PyLong_AS_LONG
|
|
#define PyInt_AsSsize_t PyLong_AsSsize_t
|
|
#define PyInt_AsUnsignedLongMask PyLong_AsUnsignedLongMask
|
|
#define PyInt_AsUnsignedLongLongMask PyLong_AsUnsignedLongLongMask
|
|
#endif
|
|
#if PY_MAJOR_VERSION >= 3
|
|
#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) || (PY_VERSION_HEX >= 0x03010300)
|
|
#define __Pyx_PySequence_GetSlice(obj, a, b) PySequence_GetSlice(obj, a, b)
|
|
#define __Pyx_PySequence_SetSlice(obj, a, b, value) PySequence_SetSlice(obj, a, b, value)
|
|
#define __Pyx_PySequence_DelSlice(obj, a, b) PySequence_DelSlice(obj, a, b)
|
|
#else
|
|
#define __Pyx_PySequence_GetSlice(obj, a, b) (unlikely(!(obj)) ? \
|
|
(PyErr_SetString(PyExc_SystemError, "null argument to internal routine"), (PyObject*)0) : \
|
|
(likely((obj)->ob_type->tp_as_mapping) ? (PySequence_GetSlice(obj, a, b)) : \
|
|
(PyErr_Format(PyExc_TypeError, "'%.200s' object is unsliceable", (obj)->ob_type->tp_name), (PyObject*)0)))
|
|
#define __Pyx_PySequence_SetSlice(obj, a, b, value) (unlikely(!(obj)) ? \
|
|
(PyErr_SetString(PyExc_SystemError, "null argument to internal routine"), -1) : \
|
|
(likely((obj)->ob_type->tp_as_mapping) ? (PySequence_SetSlice(obj, a, b, value)) : \
|
|
(PyErr_Format(PyExc_TypeError, "'%.200s' object doesn't support slice assignment", (obj)->ob_type->tp_name), -1)))
|
|
#define __Pyx_PySequence_DelSlice(obj, a, b) (unlikely(!(obj)) ? \
|
|
(PyErr_SetString(PyExc_SystemError, "null argument to internal routine"), -1) : \
|
|
(likely((obj)->ob_type->tp_as_mapping) ? (PySequence_DelSlice(obj, a, b)) : \
|
|
(PyErr_Format(PyExc_TypeError, "'%.200s' object doesn't support slice deletion", (obj)->ob_type->tp_name), -1)))
|
|
#endif
|
|
#if PY_MAJOR_VERSION >= 3
|
|
#define PyMethod_New(func, self, klass) ((self) ? PyMethod_New(func, self) : PyInstanceMethod_New(func))
|
|
#endif
|
|
#if PY_VERSION_HEX < 0x02050000
|
|
#define __Pyx_GetAttrString(o,n) PyObject_GetAttrString((o),((char *)(n)))
|
|
#define __Pyx_SetAttrString(o,n,a) PyObject_SetAttrString((o),((char *)(n)),(a))
|
|
#define __Pyx_DelAttrString(o,n) PyObject_DelAttrString((o),((char *)(n)))
|
|
#else
|
|
#define __Pyx_GetAttrString(o,n) PyObject_GetAttrString((o),(n))
|
|
#define __Pyx_SetAttrString(o,n,a) PyObject_SetAttrString((o),(n),(a))
|
|
#define __Pyx_DelAttrString(o,n) PyObject_DelAttrString((o),(n))
|
|
#endif
|
|
#if PY_VERSION_HEX < 0x02050000
|
|
#define __Pyx_NAMESTR(n) ((char *)(n))
|
|
#define __Pyx_DOCSTR(n) ((char *)(n))
|
|
#else
|
|
#define __Pyx_NAMESTR(n) (n)
|
|
#define __Pyx_DOCSTR(n) (n)
|
|
#endif
|
|
#ifndef CYTHON_INLINE
|
|
#if defined(__GNUC__)
|
|
#define CYTHON_INLINE __inline__
|
|
#elif defined(_MSC_VER)
|
|
#define CYTHON_INLINE __inline
|
|
#elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
|
|
#define CYTHON_INLINE inline
|
|
#else
|
|
#define CYTHON_INLINE
|
|
#endif
|
|
#endif
|
|
#ifndef CYTHON_RESTRICT
|
|
#if defined(__GNUC__)
|
|
#define CYTHON_RESTRICT __restrict__
|
|
#elif defined(_MSC_VER)
|
|
#define CYTHON_RESTRICT __restrict
|
|
#elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
|
|
#define CYTHON_RESTRICT restrict
|
|
#else
|
|
#define CYTHON_RESTRICT
|
|
#endif
|
|
#endif
|
|
#ifdef NAN
|
|
#define __PYX_NAN() ((float) NAN)
|
|
#else
|
|
static CYTHON_INLINE float __PYX_NAN() {
|
|
/* Initialize NaN. The sign is irrelevant, an exponent with all bits 1 and
|
|
a nonzero mantissa means NaN. If the first bit in the mantissa is 1, it is
|
|
a quiet NaN. */
|
|
float value;
|
|
memset(&value, 0xFF, sizeof(value));
|
|
return value;
|
|
}
|
|
#endif
|
|
|
|
|
|
#if PY_MAJOR_VERSION >= 3
|
|
#define __Pyx_PyNumber_Divide(x,y) PyNumber_TrueDivide(x,y)
|
|
#define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceTrueDivide(x,y)
|
|
#else
|
|
#define __Pyx_PyNumber_Divide(x,y) PyNumber_Divide(x,y)
|
|
#define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceDivide(x,y)
|
|
#endif
|
|
|
|
#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 <math.h>
|
|
#define __PYX_HAVE__capnp
|
|
#define __PYX_HAVE_API__capnp
|
|
#include "stdint.h"
|
|
#include "capnp/dynamic.h"
|
|
#include "capnp/schema.h"
|
|
#include "capnp/blob.h"
|
|
#include "capnp/message.h"
|
|
#include "capnp/schema.capnp.h"
|
|
#include "capnp/serialize.h"
|
|
#include "capnp/serialize-packed.h"
|
|
#include "capnp/common.h"
|
|
#include "kj/common.h"
|
|
#include "ios"
|
|
#include "new"
|
|
#include "stdexcept"
|
|
#include "typeinfo"
|
|
#include "capnp/schema-loader.h"
|
|
#include "fixMaybe.h"
|
|
#include "capnp/list.h"
|
|
#ifdef _OPENMP
|
|
#include <omp.h>
|
|
#endif /* _OPENMP */
|
|
|
|
#ifdef PYREX_WITHOUT_ASSERTIONS
|
|
#define CYTHON_WITHOUT_ASSERTIONS
|
|
#endif
|
|
|
|
#ifndef CYTHON_UNUSED
|
|
# if defined(__GNUC__)
|
|
# if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4))
|
|
# define CYTHON_UNUSED __attribute__ ((__unused__))
|
|
# else
|
|
# define CYTHON_UNUSED
|
|
# endif
|
|
# elif defined(__ICC) || (defined(__INTEL_COMPILER) && !defined(_MSC_VER))
|
|
# define CYTHON_UNUSED __attribute__ ((__unused__))
|
|
# else
|
|
# define CYTHON_UNUSED
|
|
# endif
|
|
#endif
|
|
typedef struct {PyObject **p; char *s; const Py_ssize_t n; const char* encoding;
|
|
const char is_unicode; const char is_str; const char intern; } __Pyx_StringTabEntry; /*proto*/
|
|
|
|
#define __PYX_DEFAULT_STRING_ENCODING_IS_ASCII 0
|
|
#define __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT 0
|
|
#define __PYX_DEFAULT_STRING_ENCODING ""
|
|
#define __Pyx_PyObject_FromString __Pyx_PyBytes_FromString
|
|
#define __Pyx_PyObject_FromStringAndSize __Pyx_PyBytes_FromStringAndSize
|
|
static CYTHON_INLINE char* __Pyx_PyObject_AsString(PyObject*);
|
|
static CYTHON_INLINE char* __Pyx_PyObject_AsStringAndSize(PyObject*, Py_ssize_t* length);
|
|
#define __Pyx_PyBytes_FromString PyBytes_FromString
|
|
#define __Pyx_PyBytes_FromStringAndSize PyBytes_FromStringAndSize
|
|
static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(char*);
|
|
#if PY_MAJOR_VERSION < 3
|
|
#define __Pyx_PyStr_FromString __Pyx_PyBytes_FromString
|
|
#define __Pyx_PyStr_FromStringAndSize __Pyx_PyBytes_FromStringAndSize
|
|
#else
|
|
#define __Pyx_PyStr_FromString __Pyx_PyUnicode_FromString
|
|
#define __Pyx_PyStr_FromStringAndSize __Pyx_PyUnicode_FromStringAndSize
|
|
#endif
|
|
#define __Pyx_PyObject_AsUString(s) ((unsigned char*) __Pyx_PyObject_AsString(s))
|
|
#define __Pyx_PyObject_FromUString(s) __Pyx_PyObject_FromString((char*)s)
|
|
#define __Pyx_PyBytes_FromUString(s) __Pyx_PyBytes_FromString((char*)s)
|
|
#define __Pyx_PyStr_FromUString(s) __Pyx_PyStr_FromString((char*)s)
|
|
#define __Pyx_PyUnicode_FromUString(s) __Pyx_PyUnicode_FromString((char*)s)
|
|
#if PY_MAJOR_VERSION < 3
|
|
static CYTHON_INLINE size_t __Pyx_Py_UNICODE_strlen(const Py_UNICODE *u)
|
|
{
|
|
const Py_UNICODE *u_end = u;
|
|
while (*u_end++) ;
|
|
return u_end - u - 1;
|
|
}
|
|
#else
|
|
#define __Pyx_Py_UNICODE_strlen Py_UNICODE_strlen
|
|
#endif
|
|
#define __Pyx_PyUnicode_FromUnicode(u) PyUnicode_FromUnicode(u, __Pyx_Py_UNICODE_strlen(u))
|
|
#define __Pyx_PyUnicode_FromUnicodeAndLength PyUnicode_FromUnicode
|
|
#define __Pyx_PyUnicode_AsUnicode PyUnicode_AsUnicode
|
|
#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);
|
|
static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject*);
|
|
static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t);
|
|
static CYTHON_INLINE size_t __Pyx_PyInt_AsSize_t(PyObject*);
|
|
#if CYTHON_COMPILING_IN_CPYTHON
|
|
#define __pyx_PyFloat_AsDouble(x) (PyFloat_CheckExact(x) ? PyFloat_AS_DOUBLE(x) : PyFloat_AsDouble(x))
|
|
#else
|
|
#define __pyx_PyFloat_AsDouble(x) PyFloat_AsDouble(x)
|
|
#endif
|
|
#define __pyx_PyFloat_AsFloat(x) ((float) __pyx_PyFloat_AsDouble(x))
|
|
#if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
|
|
static int __Pyx_sys_getdefaultencoding_not_ascii;
|
|
static int __Pyx_init_sys_getdefaultencoding_params() {
|
|
PyObject* sys = NULL;
|
|
PyObject* default_encoding = NULL;
|
|
PyObject* ascii_chars_u = NULL;
|
|
PyObject* ascii_chars_b = NULL;
|
|
sys = PyImport_ImportModule("sys");
|
|
if (sys == NULL) goto bad;
|
|
default_encoding = PyObject_CallMethod(sys, (char*) (const char*) "getdefaultencoding", NULL);
|
|
if (default_encoding == NULL) goto bad;
|
|
if (strcmp(PyBytes_AsString(default_encoding), "ascii") == 0) {
|
|
__Pyx_sys_getdefaultencoding_not_ascii = 0;
|
|
} else {
|
|
const char* default_encoding_c = PyBytes_AS_STRING(default_encoding);
|
|
char ascii_chars[128];
|
|
int c;
|
|
for (c = 0; c < 128; c++) {
|
|
ascii_chars[c] = c;
|
|
}
|
|
__Pyx_sys_getdefaultencoding_not_ascii = 1;
|
|
ascii_chars_u = PyUnicode_DecodeASCII(ascii_chars, 128, NULL);
|
|
if (ascii_chars_u == NULL) goto bad;
|
|
ascii_chars_b = PyUnicode_AsEncodedString(ascii_chars_u, default_encoding_c, NULL);
|
|
if (ascii_chars_b == NULL || strncmp(ascii_chars, PyBytes_AS_STRING(ascii_chars_b), 128) != 0) {
|
|
PyErr_Format(
|
|
PyExc_ValueError,
|
|
"This module compiled with c_string_encoding=ascii, but default encoding '%s' is not a superset of ascii.",
|
|
default_encoding_c);
|
|
goto bad;
|
|
}
|
|
}
|
|
Py_XDECREF(sys);
|
|
Py_XDECREF(default_encoding);
|
|
Py_XDECREF(ascii_chars_u);
|
|
Py_XDECREF(ascii_chars_b);
|
|
return 0;
|
|
bad:
|
|
Py_XDECREF(sys);
|
|
Py_XDECREF(default_encoding);
|
|
Py_XDECREF(ascii_chars_u);
|
|
Py_XDECREF(ascii_chars_b);
|
|
return -1;
|
|
}
|
|
#endif
|
|
#if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT && PY_MAJOR_VERSION >= 3
|
|
#define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_DecodeUTF8(c_str, size, NULL)
|
|
#else
|
|
#define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_Decode(c_str, size, __PYX_DEFAULT_STRING_ENCODING, NULL)
|
|
#if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT
|
|
static char* __PYX_DEFAULT_STRING_ENCODING;
|
|
static int __Pyx_init_sys_getdefaultencoding_params() {
|
|
PyObject* sys = NULL;
|
|
PyObject* default_encoding = NULL;
|
|
char* default_encoding_c;
|
|
sys = PyImport_ImportModule("sys");
|
|
if (sys == NULL) goto bad;
|
|
default_encoding = PyObject_CallMethod(sys, (char*) (const char*) "getdefaultencoding", NULL);
|
|
if (default_encoding == NULL) goto bad;
|
|
default_encoding_c = PyBytes_AS_STRING(default_encoding);
|
|
__PYX_DEFAULT_STRING_ENCODING = (char*) malloc(strlen(default_encoding_c));
|
|
strcpy(__PYX_DEFAULT_STRING_ENCODING, default_encoding_c);
|
|
Py_DECREF(sys);
|
|
Py_DECREF(default_encoding);
|
|
return 0;
|
|
bad:
|
|
Py_XDECREF(sys);
|
|
Py_XDECREF(default_encoding);
|
|
return -1;
|
|
}
|
|
#endif
|
|
#endif
|
|
|
|
|
|
#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 ... */
|
|
#else /* __GNUC__ */
|
|
#define likely(x) (x)
|
|
#define unlikely(x) (x)
|
|
#endif /* __GNUC__ */
|
|
|
|
static PyObject *__pyx_m;
|
|
static PyObject *__pyx_d;
|
|
static PyObject *__pyx_b;
|
|
static PyObject *__pyx_empty_tuple;
|
|
static PyObject *__pyx_empty_bytes;
|
|
static int __pyx_lineno;
|
|
static int __pyx_clineno = 0;
|
|
static const char * __pyx_cfilenm= __FILE__;
|
|
static const char *__pyx_filename;
|
|
|
|
|
|
static const char *__pyx_f[] = {
|
|
"capnp.pyx",
|
|
"schema.pxd",
|
|
};
|
|
|
|
/* "schema_cpp.pxd":7
|
|
*
|
|
* from libc.stdint cimport *
|
|
* ctypedef unsigned int uint # <<<<<<<<<<<<<<
|
|
* ctypedef uint8_t UInt8
|
|
* ctypedef uint16_t UInt16
|
|
*/
|
|
typedef unsigned int __pyx_t_10schema_cpp_uint;
|
|
|
|
/* "schema_cpp.pxd":8
|
|
* from libc.stdint cimport *
|
|
* ctypedef unsigned int uint
|
|
* ctypedef uint8_t UInt8 # <<<<<<<<<<<<<<
|
|
* ctypedef uint16_t UInt16
|
|
* ctypedef uint32_t UInt32
|
|
*/
|
|
typedef uint8_t __pyx_t_10schema_cpp_UInt8;
|
|
|
|
/* "schema_cpp.pxd":9
|
|
* ctypedef unsigned int uint
|
|
* ctypedef uint8_t UInt8
|
|
* ctypedef uint16_t UInt16 # <<<<<<<<<<<<<<
|
|
* ctypedef uint32_t UInt32
|
|
* ctypedef uint64_t UInt64
|
|
*/
|
|
typedef uint16_t __pyx_t_10schema_cpp_UInt16;
|
|
|
|
/* "schema_cpp.pxd":10
|
|
* ctypedef uint8_t UInt8
|
|
* ctypedef uint16_t UInt16
|
|
* ctypedef uint32_t UInt32 # <<<<<<<<<<<<<<
|
|
* ctypedef uint64_t UInt64
|
|
* ctypedef int8_t Int8
|
|
*/
|
|
typedef uint32_t __pyx_t_10schema_cpp_UInt32;
|
|
|
|
/* "schema_cpp.pxd":11
|
|
* ctypedef uint16_t UInt16
|
|
* ctypedef uint32_t UInt32
|
|
* ctypedef uint64_t UInt64 # <<<<<<<<<<<<<<
|
|
* ctypedef int8_t Int8
|
|
* ctypedef int16_t Int16
|
|
*/
|
|
typedef uint64_t __pyx_t_10schema_cpp_UInt64;
|
|
|
|
/* "schema_cpp.pxd":12
|
|
* ctypedef uint32_t UInt32
|
|
* ctypedef uint64_t UInt64
|
|
* ctypedef int8_t Int8 # <<<<<<<<<<<<<<
|
|
* ctypedef int16_t Int16
|
|
* ctypedef int32_t Int32
|
|
*/
|
|
typedef int8_t __pyx_t_10schema_cpp_Int8;
|
|
|
|
/* "schema_cpp.pxd":13
|
|
* ctypedef uint64_t UInt64
|
|
* ctypedef int8_t Int8
|
|
* ctypedef int16_t Int16 # <<<<<<<<<<<<<<
|
|
* ctypedef int32_t Int32
|
|
* ctypedef int64_t Int64
|
|
*/
|
|
typedef int16_t __pyx_t_10schema_cpp_Int16;
|
|
|
|
/* "schema_cpp.pxd":14
|
|
* ctypedef int8_t Int8
|
|
* ctypedef int16_t Int16
|
|
* ctypedef int32_t Int32 # <<<<<<<<<<<<<<
|
|
* ctypedef int64_t Int64
|
|
*
|
|
*/
|
|
typedef int32_t __pyx_t_10schema_cpp_Int32;
|
|
|
|
/* "schema_cpp.pxd":15
|
|
* ctypedef int16_t Int16
|
|
* ctypedef int32_t Int32
|
|
* ctypedef int64_t Int64 # <<<<<<<<<<<<<<
|
|
*
|
|
* ctypedef char * Object
|
|
*/
|
|
typedef int64_t __pyx_t_10schema_cpp_Int64;
|
|
|
|
/* "schema_cpp.pxd":18
|
|
*
|
|
* ctypedef char * Object
|
|
* ctypedef bint Bool # <<<<<<<<<<<<<<
|
|
* ctypedef float Float32
|
|
* ctypedef double Float64
|
|
*/
|
|
typedef int __pyx_t_10schema_cpp_Bool;
|
|
|
|
/* "schema_cpp.pxd":19
|
|
* ctypedef char * Object
|
|
* ctypedef bint Bool
|
|
* ctypedef float Float32 # <<<<<<<<<<<<<<
|
|
* ctypedef double Float64
|
|
*
|
|
*/
|
|
typedef float __pyx_t_10schema_cpp_Float32;
|
|
|
|
/* "schema_cpp.pxd":20
|
|
* ctypedef bint Bool
|
|
* ctypedef float Float32
|
|
* ctypedef double Float64 # <<<<<<<<<<<<<<
|
|
*
|
|
* cdef extern from "capnp/dynamic.h" namespace " ::capnp":
|
|
*/
|
|
typedef double __pyx_t_10schema_cpp_Float64;
|
|
|
|
/* "capnp_cpp.pxd":8
|
|
*
|
|
* from libc.stdint cimport *
|
|
* ctypedef unsigned int uint # <<<<<<<<<<<<<<
|
|
*
|
|
* cdef extern from "capnp/common.h" namespace " ::capnp":
|
|
*/
|
|
typedef unsigned int __pyx_t_9capnp_cpp_uint;
|
|
|
|
/* "capnp.pyx":16
|
|
* from schema cimport _NodeReader
|
|
* from libc.stdint cimport *
|
|
* ctypedef unsigned int uint # <<<<<<<<<<<<<<
|
|
* ctypedef uint8_t UInt8
|
|
* ctypedef uint16_t UInt16
|
|
*/
|
|
typedef unsigned int __pyx_t_5capnp_uint;
|
|
|
|
/* "capnp.pyx":17
|
|
* from libc.stdint cimport *
|
|
* ctypedef unsigned int uint
|
|
* ctypedef uint8_t UInt8 # <<<<<<<<<<<<<<
|
|
* ctypedef uint16_t UInt16
|
|
* ctypedef uint32_t UInt32
|
|
*/
|
|
typedef uint8_t __pyx_t_5capnp_UInt8;
|
|
|
|
/* "capnp.pyx":18
|
|
* ctypedef unsigned int uint
|
|
* ctypedef uint8_t UInt8
|
|
* ctypedef uint16_t UInt16 # <<<<<<<<<<<<<<
|
|
* ctypedef uint32_t UInt32
|
|
* ctypedef uint64_t UInt64
|
|
*/
|
|
typedef uint16_t __pyx_t_5capnp_UInt16;
|
|
|
|
/* "capnp.pyx":19
|
|
* ctypedef uint8_t UInt8
|
|
* ctypedef uint16_t UInt16
|
|
* ctypedef uint32_t UInt32 # <<<<<<<<<<<<<<
|
|
* ctypedef uint64_t UInt64
|
|
* ctypedef int8_t Int8
|
|
*/
|
|
typedef uint32_t __pyx_t_5capnp_UInt32;
|
|
|
|
/* "capnp.pyx":20
|
|
* ctypedef uint16_t UInt16
|
|
* ctypedef uint32_t UInt32
|
|
* ctypedef uint64_t UInt64 # <<<<<<<<<<<<<<
|
|
* ctypedef int8_t Int8
|
|
* ctypedef int16_t Int16
|
|
*/
|
|
typedef uint64_t __pyx_t_5capnp_UInt64;
|
|
|
|
/* "capnp.pyx":21
|
|
* ctypedef uint32_t UInt32
|
|
* ctypedef uint64_t UInt64
|
|
* ctypedef int8_t Int8 # <<<<<<<<<<<<<<
|
|
* ctypedef int16_t Int16
|
|
* ctypedef int32_t Int32
|
|
*/
|
|
typedef int8_t __pyx_t_5capnp_Int8;
|
|
|
|
/* "capnp.pyx":22
|
|
* ctypedef uint64_t UInt64
|
|
* ctypedef int8_t Int8
|
|
* ctypedef int16_t Int16 # <<<<<<<<<<<<<<
|
|
* ctypedef int32_t Int32
|
|
* ctypedef int64_t Int64
|
|
*/
|
|
typedef int16_t __pyx_t_5capnp_Int16;
|
|
|
|
/* "capnp.pyx":23
|
|
* ctypedef int8_t Int8
|
|
* ctypedef int16_t Int16
|
|
* ctypedef int32_t Int32 # <<<<<<<<<<<<<<
|
|
* ctypedef int64_t Int64
|
|
*
|
|
*/
|
|
typedef int32_t __pyx_t_5capnp_Int32;
|
|
|
|
/* "capnp.pyx":24
|
|
* ctypedef int16_t Int16
|
|
* ctypedef int32_t Int32
|
|
* ctypedef int64_t Int64 # <<<<<<<<<<<<<<
|
|
*
|
|
* ctypedef char * Object
|
|
*/
|
|
typedef int64_t __pyx_t_5capnp_Int64;
|
|
|
|
/* "capnp.pyx":27
|
|
*
|
|
* ctypedef char * Object
|
|
* ctypedef bint Bool # <<<<<<<<<<<<<<
|
|
* ctypedef float Float32
|
|
* ctypedef double Float64
|
|
*/
|
|
typedef int __pyx_t_5capnp_Bool;
|
|
|
|
/* "capnp.pyx":28
|
|
* ctypedef char * Object
|
|
* ctypedef bint Bool
|
|
* ctypedef float Float32 # <<<<<<<<<<<<<<
|
|
* ctypedef double Float64
|
|
*
|
|
*/
|
|
typedef float __pyx_t_5capnp_Float32;
|
|
|
|
/* "capnp.pyx":29
|
|
* ctypedef bint Bool
|
|
* ctypedef float Float32
|
|
* ctypedef double Float64 # <<<<<<<<<<<<<<
|
|
*
|
|
* ctypedef fused valid_values:
|
|
*/
|
|
typedef double __pyx_t_5capnp_Float64;
|
|
|
|
/*--- Type declarations ---*/
|
|
struct __pyx_obj_5capnp__List_Node_Reader;
|
|
struct __pyx_obj_5capnp__DynamicListReader;
|
|
struct __pyx_obj_5capnp_MessageBuilder;
|
|
struct __pyx_obj_6schema__NodeReader;
|
|
struct __pyx_obj_5capnp_MessageReader;
|
|
struct __pyx_obj_5capnp_StreamFdMessageReader;
|
|
struct __pyx_obj_5capnp__DynamicListBuilder;
|
|
struct __pyx_obj_5capnp___pyx_scope_struct_1_genexpr;
|
|
struct __pyx_obj_5capnp__DynamicUnionReader;
|
|
struct __pyx_obj_5capnp_StructSchema;
|
|
struct __pyx_obj_5capnp___pyx_scope_struct___make_enum;
|
|
struct __pyx_obj_5capnp__List_UInt64_Reader;
|
|
struct __pyx_obj_5capnp_PackedFdMessageReader;
|
|
struct __pyx_obj_5capnp__DynamicStructReader;
|
|
struct __pyx_obj_5capnp_Schema;
|
|
struct __pyx_obj_5capnp__DynamicUnionBuilder;
|
|
struct __pyx_obj_5capnp_SchemaLoader;
|
|
struct __pyx_obj_5capnp___pyx_scope_struct_2___getattr__;
|
|
struct __pyx_obj_5capnp_MallocMessageBuilder;
|
|
struct __pyx_obj_5capnp__DynamicValueReader;
|
|
struct __pyx_obj_5capnp__CodeGeneratorRequestReader;
|
|
struct __pyx_obj_5capnp__DynamicStructBuilder;
|
|
|
|
/* "schema_cpp.pxd":17
|
|
* ctypedef int64_t Int64
|
|
*
|
|
* ctypedef char * Object # <<<<<<<<<<<<<<
|
|
* ctypedef bint Bool
|
|
* ctypedef float Float32
|
|
*/
|
|
typedef char *__pyx_t_10schema_cpp_Object;
|
|
struct __pyx_opt_args_5capnp_21_DynamicStructBuilder_init;
|
|
struct __pyx_opt_args_5capnp_20_DynamicUnionBuilder_init;
|
|
|
|
/* "capnp.pyx":26
|
|
* ctypedef int64_t Int64
|
|
*
|
|
* ctypedef char * Object # <<<<<<<<<<<<<<
|
|
* ctypedef bint Bool
|
|
* ctypedef float Float32
|
|
*/
|
|
typedef char *__pyx_t_5capnp_Object;
|
|
|
|
/* "capnp.pyx":323
|
|
* return self.thisptr.has(field)
|
|
*
|
|
* cpdef init(self, field, size=None) except +ValueError: # <<<<<<<<<<<<<<
|
|
* if size is None:
|
|
* return toPythonByValue(self.thisptr.init(field))
|
|
*/
|
|
struct __pyx_opt_args_5capnp_21_DynamicStructBuilder_init {
|
|
int __pyx_n;
|
|
PyObject *size;
|
|
};
|
|
|
|
/* "capnp.pyx":391
|
|
* return fixMaybe(self.thisptr.which()).getProto().getName().cStr()
|
|
*
|
|
* cpdef init(self, field, size=None) except +ValueError: # <<<<<<<<<<<<<<
|
|
* if size is None:
|
|
* return toPythonByValue(self.thisptr.init(field))
|
|
*/
|
|
struct __pyx_opt_args_5capnp_20_DynamicUnionBuilder_init {
|
|
int __pyx_n;
|
|
PyObject *size;
|
|
};
|
|
|
|
/* "capnp.pyx":136
|
|
* return self.thisptr.size()
|
|
*
|
|
* cdef class _List_Node_Reader: # <<<<<<<<<<<<<<
|
|
* cdef List[C_Node].Reader thisptr
|
|
* cdef _init(self, List[C_Node].Reader other):
|
|
*/
|
|
struct __pyx_obj_5capnp__List_Node_Reader {
|
|
PyObject_HEAD
|
|
struct __pyx_vtabstruct_5capnp__List_Node_Reader *__pyx_vtab;
|
|
::capnp::List< ::capnp::schema::Node>::Reader thisptr;
|
|
};
|
|
|
|
|
|
/* "capnp.pyx":70
|
|
* uint size()
|
|
*
|
|
* cdef class _DynamicListReader: # <<<<<<<<<<<<<<
|
|
* cdef C_DynamicList.Reader thisptr
|
|
* cdef _init(self, C_DynamicList.Reader other):
|
|
*/
|
|
struct __pyx_obj_5capnp__DynamicListReader {
|
|
PyObject_HEAD
|
|
struct __pyx_vtabstruct_5capnp__DynamicListReader *__pyx_vtab;
|
|
::capnp::DynamicList::Reader thisptr;
|
|
};
|
|
|
|
|
|
/* "capnp.pyx":445
|
|
* return Schema()._init(self.thisptr.get(id))
|
|
*
|
|
* cdef class MessageBuilder: # <<<<<<<<<<<<<<
|
|
* cdef schema_cpp.MessageBuilder * thisptr
|
|
* def __dealloc__(self):
|
|
*/
|
|
struct __pyx_obj_5capnp_MessageBuilder {
|
|
PyObject_HEAD
|
|
struct __pyx_vtabstruct_5capnp_MessageBuilder *__pyx_vtab;
|
|
::capnp::MessageBuilder *thisptr;
|
|
};
|
|
|
|
|
|
/* "schema.pxd":6
|
|
* # distutils: libraries = capnp
|
|
* from schema_cpp cimport Node as C_Node
|
|
* cdef class _NodeReader: # <<<<<<<<<<<<<<
|
|
* cdef C_Node.Reader thisptr
|
|
* cdef init(self, C_Node.Reader other)
|
|
*/
|
|
struct __pyx_obj_6schema__NodeReader {
|
|
PyObject_HEAD
|
|
struct __pyx_vtabstruct_6schema__NodeReader *__pyx_vtab;
|
|
::capnp::schema::Node::Reader thisptr;
|
|
};
|
|
|
|
|
|
/* "capnp.pyx":468
|
|
* self.thisptr = new schema_cpp.MallocMessageBuilder()
|
|
*
|
|
* cdef class MessageReader: # <<<<<<<<<<<<<<
|
|
* cdef schema_cpp.MessageReader * thisptr
|
|
* def __dealloc__(self):
|
|
*/
|
|
struct __pyx_obj_5capnp_MessageReader {
|
|
PyObject_HEAD
|
|
struct __pyx_vtabstruct_5capnp_MessageReader *__pyx_vtab;
|
|
::capnp::MessageReader *thisptr;
|
|
};
|
|
|
|
|
|
/* "capnp.pyx":486
|
|
* return _DynamicStructReader()._init(self.thisptr.getRootDynamicStruct(s.thisptr))
|
|
*
|
|
* cdef class StreamFdMessageReader(MessageReader): # <<<<<<<<<<<<<<
|
|
* def __cinit__(self, int fd):
|
|
* self.thisptr = new schema_cpp.StreamFdMessageReader(fd)
|
|
*/
|
|
struct __pyx_obj_5capnp_StreamFdMessageReader {
|
|
struct __pyx_obj_5capnp_MessageReader __pyx_base;
|
|
};
|
|
|
|
|
|
/* "capnp.pyx":89
|
|
* return self.thisptr.size()
|
|
*
|
|
* cdef class _DynamicListBuilder: # <<<<<<<<<<<<<<
|
|
* cdef C_DynamicList.Builder thisptr
|
|
* cdef _init(self, C_DynamicList.Builder other):
|
|
*/
|
|
struct __pyx_obj_5capnp__DynamicListBuilder {
|
|
PyObject_HEAD
|
|
struct __pyx_vtabstruct_5capnp__DynamicListBuilder *__pyx_vtab;
|
|
::capnp::DynamicList::Builder thisptr;
|
|
};
|
|
|
|
|
|
/* "capnp.pyx":41
|
|
* def _make_enum(enum_name, *sequential, **named):
|
|
* enums = dict(zip(sequential, range(len(sequential))), **named)
|
|
* reverse = dict((value, key) for key, value in enums.iteritems()) # <<<<<<<<<<<<<<
|
|
* enums['reverse_mapping'] = reverse
|
|
* return type(enum_name, (), enums)
|
|
*/
|
|
struct __pyx_obj_5capnp___pyx_scope_struct_1_genexpr {
|
|
PyObject_HEAD
|
|
struct __pyx_obj_5capnp___pyx_scope_struct___make_enum *__pyx_outer_scope;
|
|
PyObject *__pyx_v_key;
|
|
PyObject *__pyx_v_value;
|
|
PyObject *__pyx_t_0;
|
|
Py_ssize_t __pyx_t_1;
|
|
Py_ssize_t __pyx_t_2;
|
|
int __pyx_t_3;
|
|
};
|
|
|
|
|
|
/* "capnp.pyx":329
|
|
* return toPythonByValue(self.thisptr.init(field, size))
|
|
*
|
|
* cdef class _DynamicUnionReader: # <<<<<<<<<<<<<<
|
|
* cdef C_DynamicUnion.Reader thisptr
|
|
* cdef _init(self, C_DynamicUnion.Reader other):
|
|
*/
|
|
struct __pyx_obj_5capnp__DynamicUnionReader {
|
|
PyObject_HEAD
|
|
struct __pyx_vtabstruct_5capnp__DynamicUnionReader *__pyx_vtab;
|
|
::capnp::DynamicUnion::Reader thisptr;
|
|
};
|
|
|
|
|
|
/* "capnp.pyx":425
|
|
* return _NodeReader().init(self.thisptr.getProto())
|
|
*
|
|
* cdef class StructSchema: # <<<<<<<<<<<<<<
|
|
* cdef C_StructSchema thisptr
|
|
* cdef _init(self, C_StructSchema other):
|
|
*/
|
|
struct __pyx_obj_5capnp_StructSchema {
|
|
PyObject_HEAD
|
|
struct __pyx_vtabstruct_5capnp_StructSchema *__pyx_vtab;
|
|
::capnp::StructSchema thisptr;
|
|
};
|
|
|
|
|
|
/* "capnp.pyx":39
|
|
* cython.p_char
|
|
*
|
|
* def _make_enum(enum_name, *sequential, **named): # <<<<<<<<<<<<<<
|
|
* enums = dict(zip(sequential, range(len(sequential))), **named)
|
|
* reverse = dict((value, key) for key, value in enums.iteritems())
|
|
*/
|
|
struct __pyx_obj_5capnp___pyx_scope_struct___make_enum {
|
|
PyObject_HEAD
|
|
PyObject *__pyx_v_enums;
|
|
};
|
|
|
|
|
|
/* "capnp.pyx":121
|
|
* return self.thisptr.size()
|
|
*
|
|
* cdef class _List_UInt64_Reader: # <<<<<<<<<<<<<<
|
|
* cdef List[UInt64].Reader thisptr
|
|
* cdef _init(self, List[UInt64].Reader other):
|
|
*/
|
|
struct __pyx_obj_5capnp__List_UInt64_Reader {
|
|
PyObject_HEAD
|
|
struct __pyx_vtabstruct_5capnp__List_UInt64_Reader *__pyx_vtab;
|
|
::capnp::List<__pyx_t_5capnp_UInt64>::Reader thisptr;
|
|
};
|
|
|
|
|
|
/* "capnp.pyx":490
|
|
* self.thisptr = new schema_cpp.StreamFdMessageReader(fd)
|
|
*
|
|
* cdef class PackedFdMessageReader(MessageReader): # <<<<<<<<<<<<<<
|
|
* def __cinit__(self, int fd):
|
|
* self.thisptr = new schema_cpp.PackedFdMessageReader(fd)
|
|
*/
|
|
struct __pyx_obj_5capnp_PackedFdMessageReader {
|
|
struct __pyx_obj_5capnp_MessageReader __pyx_base;
|
|
};
|
|
|
|
|
|
/* "capnp.pyx":255
|
|
* raise ValueError("Cannot convert type to Python. Type is unhandled by capnproto library")
|
|
*
|
|
* cdef class _DynamicStructReader: # <<<<<<<<<<<<<<
|
|
* cdef C_DynamicStruct.Reader thisptr
|
|
* cdef _init(self, C_DynamicStruct.Reader other):
|
|
*/
|
|
struct __pyx_obj_5capnp__DynamicStructReader {
|
|
PyObject_HEAD
|
|
struct __pyx_vtabstruct_5capnp__DynamicStructReader *__pyx_vtab;
|
|
::capnp::DynamicStruct::Reader thisptr;
|
|
};
|
|
|
|
|
|
/* "capnp.pyx":410
|
|
* return _List_UInt64_Reader()._init(self.thisptr.getRequestedFiles())
|
|
*
|
|
* cdef class Schema: # <<<<<<<<<<<<<<
|
|
* cdef C_Schema thisptr
|
|
* cdef _init(self, C_Schema other):
|
|
*/
|
|
struct __pyx_obj_5capnp_Schema {
|
|
PyObject_HEAD
|
|
struct __pyx_vtabstruct_5capnp_Schema *__pyx_vtab;
|
|
::capnp::Schema thisptr;
|
|
};
|
|
|
|
|
|
/* "capnp.pyx":344
|
|
* return fixMaybe(self.thisptr.which()).getProto().getName().cStr()
|
|
*
|
|
* cdef class _DynamicUnionBuilder: # <<<<<<<<<<<<<<
|
|
* cdef C_DynamicUnion.Builder thisptr
|
|
* cdef _init(self, C_DynamicUnion.Builder other):
|
|
*/
|
|
struct __pyx_obj_5capnp__DynamicUnionBuilder {
|
|
PyObject_HEAD
|
|
struct __pyx_vtabstruct_5capnp__DynamicUnionBuilder *__pyx_vtab;
|
|
::capnp::DynamicUnion::Builder thisptr;
|
|
};
|
|
|
|
|
|
/* "capnp.pyx":431
|
|
* return self
|
|
*
|
|
* cdef class SchemaLoader: # <<<<<<<<<<<<<<
|
|
* cdef C_SchemaLoader * thisptr
|
|
* def __cinit__(self):
|
|
*/
|
|
struct __pyx_obj_5capnp_SchemaLoader {
|
|
PyObject_HEAD
|
|
struct __pyx_vtabstruct_5capnp_SchemaLoader *__pyx_vtab;
|
|
::capnp::SchemaLoader *thisptr;
|
|
};
|
|
|
|
|
|
/* "capnp.pyx":276
|
|
* return self
|
|
*
|
|
* def __getattr__(self, field): # <<<<<<<<<<<<<<
|
|
* if field.startswith('init'):
|
|
* field_name = field[4].lower() + field[5:]
|
|
*/
|
|
struct __pyx_obj_5capnp___pyx_scope_struct_2___getattr__ {
|
|
PyObject_HEAD
|
|
PyObject *__pyx_v_field_name;
|
|
struct __pyx_obj_5capnp__DynamicStructBuilder *__pyx_v_self;
|
|
};
|
|
|
|
|
|
/* "capnp.pyx":464
|
|
* return _DynamicStructBuilder()._init(self.thisptr.getRootDynamicStruct(s.thisptr))
|
|
*
|
|
* cdef class MallocMessageBuilder(MessageBuilder): # <<<<<<<<<<<<<<
|
|
* def __cinit__(self):
|
|
* self.thisptr = new schema_cpp.MallocMessageBuilder()
|
|
*/
|
|
struct __pyx_obj_5capnp_MallocMessageBuilder {
|
|
struct __pyx_obj_5capnp_MessageBuilder __pyx_base;
|
|
};
|
|
|
|
|
|
/* "capnp.pyx":151
|
|
* return self.thisptr.size()
|
|
*
|
|
* cdef class _DynamicValueReader: # <<<<<<<<<<<<<<
|
|
* cdef C_DynamicValue.Reader thisptr
|
|
* cdef _init(self, C_DynamicValue.Reader other):
|
|
*/
|
|
struct __pyx_obj_5capnp__DynamicValueReader {
|
|
PyObject_HEAD
|
|
struct __pyx_vtabstruct_5capnp__DynamicValueReader *__pyx_vtab;
|
|
::capnp::DynamicValue::Reader thisptr;
|
|
};
|
|
|
|
|
|
/* "capnp.pyx":397
|
|
* return toPythonByValue(self.thisptr.init(field, size))
|
|
*
|
|
* cdef class _CodeGeneratorRequestReader: # <<<<<<<<<<<<<<
|
|
* cdef C_CodeGeneratorRequest.Reader thisptr
|
|
* cdef _init(self, C_CodeGeneratorRequest.Reader other):
|
|
*/
|
|
struct __pyx_obj_5capnp__CodeGeneratorRequestReader {
|
|
PyObject_HEAD
|
|
struct __pyx_vtabstruct_5capnp__CodeGeneratorRequestReader *__pyx_vtab;
|
|
::capnp::schema::CodeGeneratorRequest::Reader thisptr;
|
|
};
|
|
|
|
|
|
/* "capnp.pyx":270
|
|
* return self.thisptr.has(field)
|
|
*
|
|
* cdef class _DynamicStructBuilder: # <<<<<<<<<<<<<<
|
|
* cdef C_DynamicStruct.Builder thisptr
|
|
* cdef _init(self, C_DynamicStruct.Builder other):
|
|
*/
|
|
struct __pyx_obj_5capnp__DynamicStructBuilder {
|
|
PyObject_HEAD
|
|
struct __pyx_vtabstruct_5capnp__DynamicStructBuilder *__pyx_vtab;
|
|
::capnp::DynamicStruct::Builder thisptr;
|
|
};
|
|
|
|
|
|
|
|
/* "capnp.pyx":121
|
|
* return self.thisptr.size()
|
|
*
|
|
* cdef class _List_UInt64_Reader: # <<<<<<<<<<<<<<
|
|
* cdef List[UInt64].Reader thisptr
|
|
* cdef _init(self, List[UInt64].Reader other):
|
|
*/
|
|
|
|
struct __pyx_vtabstruct_5capnp__List_UInt64_Reader {
|
|
PyObject *(*_init)(struct __pyx_obj_5capnp__List_UInt64_Reader *, ::capnp::List<__pyx_t_5capnp_UInt64>::Reader);
|
|
};
|
|
static struct __pyx_vtabstruct_5capnp__List_UInt64_Reader *__pyx_vtabptr_5capnp__List_UInt64_Reader;
|
|
|
|
|
|
/* "capnp.pyx":445
|
|
* return Schema()._init(self.thisptr.get(id))
|
|
*
|
|
* cdef class MessageBuilder: # <<<<<<<<<<<<<<
|
|
* cdef schema_cpp.MessageBuilder * thisptr
|
|
* def __dealloc__(self):
|
|
*/
|
|
|
|
struct __pyx_vtabstruct_5capnp_MessageBuilder {
|
|
PyObject *(*initRoot)(struct __pyx_obj_5capnp_MessageBuilder *, PyObject *, int __pyx_skip_dispatch);
|
|
PyObject *(*getRoot)(struct __pyx_obj_5capnp_MessageBuilder *, PyObject *, int __pyx_skip_dispatch);
|
|
};
|
|
static struct __pyx_vtabstruct_5capnp_MessageBuilder *__pyx_vtabptr_5capnp_MessageBuilder;
|
|
|
|
|
|
/* "capnp.pyx":464
|
|
* return _DynamicStructBuilder()._init(self.thisptr.getRootDynamicStruct(s.thisptr))
|
|
*
|
|
* cdef class MallocMessageBuilder(MessageBuilder): # <<<<<<<<<<<<<<
|
|
* def __cinit__(self):
|
|
* self.thisptr = new schema_cpp.MallocMessageBuilder()
|
|
*/
|
|
|
|
struct __pyx_vtabstruct_5capnp_MallocMessageBuilder {
|
|
struct __pyx_vtabstruct_5capnp_MessageBuilder __pyx_base;
|
|
};
|
|
static struct __pyx_vtabstruct_5capnp_MallocMessageBuilder *__pyx_vtabptr_5capnp_MallocMessageBuilder;
|
|
|
|
|
|
/* "capnp.pyx":151
|
|
* return self.thisptr.size()
|
|
*
|
|
* cdef class _DynamicValueReader: # <<<<<<<<<<<<<<
|
|
* cdef C_DynamicValue.Reader thisptr
|
|
* cdef _init(self, C_DynamicValue.Reader other):
|
|
*/
|
|
|
|
struct __pyx_vtabstruct_5capnp__DynamicValueReader {
|
|
PyObject *(*_init)(struct __pyx_obj_5capnp__DynamicValueReader *, ::capnp::DynamicValue::Reader);
|
|
int (*getType)(struct __pyx_obj_5capnp__DynamicValueReader *, int __pyx_skip_dispatch);
|
|
PyObject *(*toPython)(struct __pyx_obj_5capnp__DynamicValueReader *, int __pyx_skip_dispatch);
|
|
};
|
|
static struct __pyx_vtabstruct_5capnp__DynamicValueReader *__pyx_vtabptr_5capnp__DynamicValueReader;
|
|
|
|
|
|
/* "capnp.pyx":255
|
|
* raise ValueError("Cannot convert type to Python. Type is unhandled by capnproto library")
|
|
*
|
|
* cdef class _DynamicStructReader: # <<<<<<<<<<<<<<
|
|
* cdef C_DynamicStruct.Reader thisptr
|
|
* cdef _init(self, C_DynamicStruct.Reader other):
|
|
*/
|
|
|
|
struct __pyx_vtabstruct_5capnp__DynamicStructReader {
|
|
PyObject *(*_init)(struct __pyx_obj_5capnp__DynamicStructReader *, ::capnp::DynamicStruct::Reader);
|
|
PyObject *(*_get)(struct __pyx_obj_5capnp__DynamicStructReader *, PyObject *, int __pyx_skip_dispatch);
|
|
};
|
|
static struct __pyx_vtabstruct_5capnp__DynamicStructReader *__pyx_vtabptr_5capnp__DynamicStructReader;
|
|
|
|
|
|
/* "capnp.pyx":329
|
|
* return toPythonByValue(self.thisptr.init(field, size))
|
|
*
|
|
* cdef class _DynamicUnionReader: # <<<<<<<<<<<<<<
|
|
* cdef C_DynamicUnion.Reader thisptr
|
|
* cdef _init(self, C_DynamicUnion.Reader other):
|
|
*/
|
|
|
|
struct __pyx_vtabstruct_5capnp__DynamicUnionReader {
|
|
PyObject *(*_init)(struct __pyx_obj_5capnp__DynamicUnionReader *, ::capnp::DynamicUnion::Reader);
|
|
PyObject *(*_get)(struct __pyx_obj_5capnp__DynamicUnionReader *, int __pyx_skip_dispatch);
|
|
PyObject *(*which)(struct __pyx_obj_5capnp__DynamicUnionReader *, int __pyx_skip_dispatch);
|
|
};
|
|
static struct __pyx_vtabstruct_5capnp__DynamicUnionReader *__pyx_vtabptr_5capnp__DynamicUnionReader;
|
|
|
|
|
|
/* "capnp.pyx":397
|
|
* return toPythonByValue(self.thisptr.init(field, size))
|
|
*
|
|
* cdef class _CodeGeneratorRequestReader: # <<<<<<<<<<<<<<
|
|
* cdef C_CodeGeneratorRequest.Reader thisptr
|
|
* cdef _init(self, C_CodeGeneratorRequest.Reader other):
|
|
*/
|
|
|
|
struct __pyx_vtabstruct_5capnp__CodeGeneratorRequestReader {
|
|
PyObject *(*_init)(struct __pyx_obj_5capnp__CodeGeneratorRequestReader *, ::capnp::schema::CodeGeneratorRequest::Reader);
|
|
};
|
|
static struct __pyx_vtabstruct_5capnp__CodeGeneratorRequestReader *__pyx_vtabptr_5capnp__CodeGeneratorRequestReader;
|
|
|
|
|
|
/* "capnp.pyx":410
|
|
* return _List_UInt64_Reader()._init(self.thisptr.getRequestedFiles())
|
|
*
|
|
* cdef class Schema: # <<<<<<<<<<<<<<
|
|
* cdef C_Schema thisptr
|
|
* cdef _init(self, C_Schema other):
|
|
*/
|
|
|
|
struct __pyx_vtabstruct_5capnp_Schema {
|
|
PyObject *(*_init)(struct __pyx_obj_5capnp_Schema *, ::capnp::Schema);
|
|
PyObject *(*asStruct)(struct __pyx_obj_5capnp_Schema *, int __pyx_skip_dispatch);
|
|
PyObject *(*getDependency)(struct __pyx_obj_5capnp_Schema *, PyObject *, int __pyx_skip_dispatch);
|
|
PyObject *(*getProto)(struct __pyx_obj_5capnp_Schema *, int __pyx_skip_dispatch);
|
|
};
|
|
static struct __pyx_vtabstruct_5capnp_Schema *__pyx_vtabptr_5capnp_Schema;
|
|
|
|
|
|
/* "capnp.pyx":425
|
|
* return _NodeReader().init(self.thisptr.getProto())
|
|
*
|
|
* cdef class StructSchema: # <<<<<<<<<<<<<<
|
|
* cdef C_StructSchema thisptr
|
|
* cdef _init(self, C_StructSchema other):
|
|
*/
|
|
|
|
struct __pyx_vtabstruct_5capnp_StructSchema {
|
|
PyObject *(*_init)(struct __pyx_obj_5capnp_StructSchema *, ::capnp::StructSchema);
|
|
};
|
|
static struct __pyx_vtabstruct_5capnp_StructSchema *__pyx_vtabptr_5capnp_StructSchema;
|
|
|
|
|
|
/* "capnp.pyx":70
|
|
* uint size()
|
|
*
|
|
* cdef class _DynamicListReader: # <<<<<<<<<<<<<<
|
|
* cdef C_DynamicList.Reader thisptr
|
|
* cdef _init(self, C_DynamicList.Reader other):
|
|
*/
|
|
|
|
struct __pyx_vtabstruct_5capnp__DynamicListReader {
|
|
PyObject *(*_init)(struct __pyx_obj_5capnp__DynamicListReader *, ::capnp::DynamicList::Reader);
|
|
PyObject *(*_get)(struct __pyx_obj_5capnp__DynamicListReader *, PyObject *, int __pyx_skip_dispatch);
|
|
};
|
|
static struct __pyx_vtabstruct_5capnp__DynamicListReader *__pyx_vtabptr_5capnp__DynamicListReader;
|
|
|
|
|
|
/* "capnp.pyx":89
|
|
* return self.thisptr.size()
|
|
*
|
|
* cdef class _DynamicListBuilder: # <<<<<<<<<<<<<<
|
|
* cdef C_DynamicList.Builder thisptr
|
|
* cdef _init(self, C_DynamicList.Builder other):
|
|
*/
|
|
|
|
struct __pyx_vtabstruct_5capnp__DynamicListBuilder {
|
|
PyObject *(*_init)(struct __pyx_obj_5capnp__DynamicListBuilder *, ::capnp::DynamicList::Builder);
|
|
};
|
|
static struct __pyx_vtabstruct_5capnp__DynamicListBuilder *__pyx_vtabptr_5capnp__DynamicListBuilder;
|
|
|
|
|
|
/* "capnp.pyx":270
|
|
* return self.thisptr.has(field)
|
|
*
|
|
* cdef class _DynamicStructBuilder: # <<<<<<<<<<<<<<
|
|
* cdef C_DynamicStruct.Builder thisptr
|
|
* cdef _init(self, C_DynamicStruct.Builder other):
|
|
*/
|
|
|
|
struct __pyx_vtabstruct_5capnp__DynamicStructBuilder {
|
|
PyObject *(*_init)(struct __pyx_obj_5capnp__DynamicStructBuilder *, ::capnp::DynamicStruct::Builder);
|
|
PyObject *(*_setattrInt)(struct __pyx_obj_5capnp__DynamicStructBuilder *, PyObject *, PyObject *);
|
|
PyObject *(*_setattrDouble)(struct __pyx_obj_5capnp__DynamicStructBuilder *, PyObject *, PyObject *);
|
|
PyObject *(*_setattrBool)(struct __pyx_obj_5capnp__DynamicStructBuilder *, PyObject *, PyObject *);
|
|
PyObject *(*_setattrString)(struct __pyx_obj_5capnp__DynamicStructBuilder *, PyObject *, PyObject *);
|
|
PyObject *(*_setattrVoid)(struct __pyx_obj_5capnp__DynamicStructBuilder *, PyObject *);
|
|
PyObject *(*init)(struct __pyx_obj_5capnp__DynamicStructBuilder *, PyObject *, int __pyx_skip_dispatch, struct __pyx_opt_args_5capnp_21_DynamicStructBuilder_init *__pyx_optional_args);
|
|
};
|
|
static struct __pyx_vtabstruct_5capnp__DynamicStructBuilder *__pyx_vtabptr_5capnp__DynamicStructBuilder;
|
|
|
|
|
|
/* "capnp.pyx":468
|
|
* self.thisptr = new schema_cpp.MallocMessageBuilder()
|
|
*
|
|
* cdef class MessageReader: # <<<<<<<<<<<<<<
|
|
* cdef schema_cpp.MessageReader * thisptr
|
|
* def __dealloc__(self):
|
|
*/
|
|
|
|
struct __pyx_vtabstruct_5capnp_MessageReader {
|
|
PyObject *(*getRootNode)(struct __pyx_obj_5capnp_MessageReader *, int __pyx_skip_dispatch);
|
|
PyObject *(*getRootCodeGeneratorRequest)(struct __pyx_obj_5capnp_MessageReader *, int __pyx_skip_dispatch);
|
|
PyObject *(*getRootDynamicStruct)(struct __pyx_obj_5capnp_MessageReader *, struct __pyx_obj_5capnp_StructSchema *, int __pyx_skip_dispatch);
|
|
PyObject *(*getRoot)(struct __pyx_obj_5capnp_MessageReader *, PyObject *, int __pyx_skip_dispatch);
|
|
};
|
|
static struct __pyx_vtabstruct_5capnp_MessageReader *__pyx_vtabptr_5capnp_MessageReader;
|
|
|
|
|
|
/* "capnp.pyx":486
|
|
* return _DynamicStructReader()._init(self.thisptr.getRootDynamicStruct(s.thisptr))
|
|
*
|
|
* cdef class StreamFdMessageReader(MessageReader): # <<<<<<<<<<<<<<
|
|
* def __cinit__(self, int fd):
|
|
* self.thisptr = new schema_cpp.StreamFdMessageReader(fd)
|
|
*/
|
|
|
|
struct __pyx_vtabstruct_5capnp_StreamFdMessageReader {
|
|
struct __pyx_vtabstruct_5capnp_MessageReader __pyx_base;
|
|
};
|
|
static struct __pyx_vtabstruct_5capnp_StreamFdMessageReader *__pyx_vtabptr_5capnp_StreamFdMessageReader;
|
|
|
|
|
|
/* "capnp.pyx":344
|
|
* return fixMaybe(self.thisptr.which()).getProto().getName().cStr()
|
|
*
|
|
* cdef class _DynamicUnionBuilder: # <<<<<<<<<<<<<<
|
|
* cdef C_DynamicUnion.Builder thisptr
|
|
* cdef _init(self, C_DynamicUnion.Builder other):
|
|
*/
|
|
|
|
struct __pyx_vtabstruct_5capnp__DynamicUnionBuilder {
|
|
PyObject *(*_init)(struct __pyx_obj_5capnp__DynamicUnionBuilder *, ::capnp::DynamicUnion::Builder);
|
|
PyObject *(*_setattrInt)(struct __pyx_obj_5capnp__DynamicUnionBuilder *, PyObject *, PyObject *);
|
|
PyObject *(*_setattrDouble)(struct __pyx_obj_5capnp__DynamicUnionBuilder *, PyObject *, PyObject *);
|
|
PyObject *(*_setattrBool)(struct __pyx_obj_5capnp__DynamicUnionBuilder *, PyObject *, PyObject *);
|
|
PyObject *(*_setattrString)(struct __pyx_obj_5capnp__DynamicUnionBuilder *, PyObject *, PyObject *);
|
|
PyObject *(*_setattrVoid)(struct __pyx_obj_5capnp__DynamicUnionBuilder *, PyObject *);
|
|
PyObject *(*which)(struct __pyx_obj_5capnp__DynamicUnionBuilder *, int __pyx_skip_dispatch);
|
|
PyObject *(*init)(struct __pyx_obj_5capnp__DynamicUnionBuilder *, PyObject *, int __pyx_skip_dispatch, struct __pyx_opt_args_5capnp_20_DynamicUnionBuilder_init *__pyx_optional_args);
|
|
};
|
|
static struct __pyx_vtabstruct_5capnp__DynamicUnionBuilder *__pyx_vtabptr_5capnp__DynamicUnionBuilder;
|
|
|
|
|
|
/* "capnp.pyx":136
|
|
* return self.thisptr.size()
|
|
*
|
|
* cdef class _List_Node_Reader: # <<<<<<<<<<<<<<
|
|
* cdef List[C_Node].Reader thisptr
|
|
* cdef _init(self, List[C_Node].Reader other):
|
|
*/
|
|
|
|
struct __pyx_vtabstruct_5capnp__List_Node_Reader {
|
|
PyObject *(*_init)(struct __pyx_obj_5capnp__List_Node_Reader *, ::capnp::List< ::capnp::schema::Node>::Reader);
|
|
};
|
|
static struct __pyx_vtabstruct_5capnp__List_Node_Reader *__pyx_vtabptr_5capnp__List_Node_Reader;
|
|
|
|
|
|
/* "capnp.pyx":431
|
|
* return self
|
|
*
|
|
* cdef class SchemaLoader: # <<<<<<<<<<<<<<
|
|
* cdef C_SchemaLoader * thisptr
|
|
* def __cinit__(self):
|
|
*/
|
|
|
|
struct __pyx_vtabstruct_5capnp_SchemaLoader {
|
|
PyObject *(*load)(struct __pyx_obj_5capnp_SchemaLoader *, struct __pyx_obj_6schema__NodeReader *, int __pyx_skip_dispatch);
|
|
PyObject *(*get)(struct __pyx_obj_5capnp_SchemaLoader *, PyObject *, int __pyx_skip_dispatch);
|
|
};
|
|
static struct __pyx_vtabstruct_5capnp_SchemaLoader *__pyx_vtabptr_5capnp_SchemaLoader;
|
|
|
|
|
|
/* "capnp.pyx":490
|
|
* self.thisptr = new schema_cpp.StreamFdMessageReader(fd)
|
|
*
|
|
* cdef class PackedFdMessageReader(MessageReader): # <<<<<<<<<<<<<<
|
|
* def __cinit__(self, int fd):
|
|
* self.thisptr = new schema_cpp.PackedFdMessageReader(fd)
|
|
*/
|
|
|
|
struct __pyx_vtabstruct_5capnp_PackedFdMessageReader {
|
|
struct __pyx_vtabstruct_5capnp_MessageReader __pyx_base;
|
|
};
|
|
static struct __pyx_vtabstruct_5capnp_PackedFdMessageReader *__pyx_vtabptr_5capnp_PackedFdMessageReader;
|
|
|
|
|
|
/* "schema.pxd":6
|
|
* # distutils: libraries = capnp
|
|
* from schema_cpp cimport Node as C_Node
|
|
* cdef class _NodeReader: # <<<<<<<<<<<<<<
|
|
* cdef C_Node.Reader thisptr
|
|
* cdef init(self, C_Node.Reader other)
|
|
*/
|
|
|
|
struct __pyx_vtabstruct_6schema__NodeReader {
|
|
PyObject *(*init)(struct __pyx_obj_6schema__NodeReader *, ::capnp::schema::Node::Reader);
|
|
};
|
|
static struct __pyx_vtabstruct_6schema__NodeReader *__pyx_vtabptr_6schema__NodeReader;
|
|
#ifndef CYTHON_REFNANNY
|
|
#define CYTHON_REFNANNY 0
|
|
#endif
|
|
#if CYTHON_REFNANNY
|
|
typedef struct {
|
|
void (*INCREF)(void*, PyObject*, int);
|
|
void (*DECREF)(void*, PyObject*, int);
|
|
void (*GOTREF)(void*, PyObject*, int);
|
|
void (*GIVEREF)(void*, PyObject*, int);
|
|
void* (*SetupContext)(const char*, int, const char*);
|
|
void (*FinishContext)(void**);
|
|
} __Pyx_RefNannyAPIStruct;
|
|
static __Pyx_RefNannyAPIStruct *__Pyx_RefNanny = NULL;
|
|
static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname); /*proto*/
|
|
#define __Pyx_RefNannyDeclarations void *__pyx_refnanny = NULL;
|
|
#ifdef WITH_THREAD
|
|
#define __Pyx_RefNannySetupContext(name, acquire_gil) \
|
|
if (acquire_gil) { \
|
|
PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure(); \
|
|
__pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__); \
|
|
PyGILState_Release(__pyx_gilstate_save); \
|
|
} else { \
|
|
__pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__); \
|
|
}
|
|
#else
|
|
#define __Pyx_RefNannySetupContext(name, acquire_gil) \
|
|
__pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__)
|
|
#endif
|
|
#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_GIVEREF(r) __Pyx_RefNanny->GIVEREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
|
|
#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, acquire_gil)
|
|
#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_CLEAR(r) do { PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);} while(0)
|
|
#define __Pyx_XCLEAR(r) do { if((r) != NULL) {PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);}} while(0)
|
|
|
|
#if CYTHON_COMPILING_IN_CPYTHON
|
|
static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name) {
|
|
PyTypeObject* tp = Py_TYPE(obj);
|
|
if (likely(tp->tp_getattro))
|
|
return tp->tp_getattro(obj, attr_name);
|
|
#if PY_MAJOR_VERSION < 3
|
|
if (likely(tp->tp_getattr))
|
|
return tp->tp_getattr(obj, PyString_AS_STRING(attr_name));
|
|
#endif
|
|
return PyObject_GetAttr(obj, attr_name);
|
|
}
|
|
#else
|
|
#define __Pyx_PyObject_GetAttrStr(o,n) PyObject_GetAttr(o,n)
|
|
#endif
|
|
|
|
static PyObject *__Pyx_GetBuiltinName(PyObject *name); /*proto*/
|
|
|
|
static void __Pyx_RaiseDoubleKeywordsError(const char* func_name, PyObject* kw_name); /*proto*/
|
|
|
|
static int __Pyx_ParseOptionalKeywords(PyObject *kwds, PyObject **argnames[], \
|
|
PyObject *kwds2, PyObject *values[], Py_ssize_t num_pos_args, \
|
|
const char* function_name); /*proto*/
|
|
|
|
static void __Pyx_RaiseArgtupleInvalid(const char* func_name, int exact,
|
|
Py_ssize_t num_min, Py_ssize_t num_max, Py_ssize_t num_found); /*proto*/
|
|
|
|
static CYTHON_INLINE int __Pyx_IterFinish(void); /*proto*/
|
|
|
|
static PyObject* __Pyx_PyObject_CallMethodTuple(PyObject* obj, PyObject* method_name, PyObject* args) {
|
|
PyObject *method, *result = NULL;
|
|
if (unlikely(!args)) return NULL;
|
|
method = __Pyx_PyObject_GetAttrStr(obj, method_name);
|
|
if (unlikely(!method)) goto bad;
|
|
result = PyObject_Call(method, args, NULL);
|
|
Py_DECREF(method);
|
|
bad:
|
|
Py_DECREF(args);
|
|
return result;
|
|
}
|
|
#define __Pyx_PyObject_CallMethod3(obj, name, arg1, arg2, arg3) \
|
|
__Pyx_PyObject_CallMethodTuple(obj, name, PyTuple_Pack(3, arg1, arg2, arg3))
|
|
#define __Pyx_PyObject_CallMethod2(obj, name, arg1, arg2) \
|
|
__Pyx_PyObject_CallMethodTuple(obj, name, PyTuple_Pack(2, arg1, arg2))
|
|
#define __Pyx_PyObject_CallMethod1(obj, name, arg1) \
|
|
__Pyx_PyObject_CallMethodTuple(obj, name, PyTuple_Pack(1, arg1))
|
|
#define __Pyx_PyObject_CallMethod0(obj, name) \
|
|
__Pyx_PyObject_CallMethodTuple(obj, name, (Py_INCREF(__pyx_empty_tuple), __pyx_empty_tuple))
|
|
|
|
static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected);
|
|
|
|
static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index);
|
|
|
|
static CYTHON_INLINE void __Pyx_RaiseNoneNotIterableError(void);
|
|
|
|
static void __Pyx_UnpackTupleError(PyObject *, Py_ssize_t index); /*proto*/
|
|
|
|
static int __Pyx_IternextUnpackEndCheck(PyObject *retval, Py_ssize_t expected); /*proto*/
|
|
|
|
static CYTHON_INLINE int __Pyx_unpack_tuple2(PyObject* tuple, PyObject** value1, PyObject** value2,
|
|
int is_tuple, int has_known_size, int decref_tuple);
|
|
|
|
static CYTHON_INLINE PyObject* __Pyx_dict_iterator(PyObject* dict, int is_dict, PyObject* method_name,
|
|
Py_ssize_t* p_orig_length, int* p_is_dict);
|
|
static CYTHON_INLINE int __Pyx_dict_iter_next(PyObject* dict_or_iter, Py_ssize_t orig_length, Py_ssize_t* ppos,
|
|
PyObject** pkey, PyObject** pvalue, PyObject** pitem, int is_dict);
|
|
|
|
static CYTHON_INLINE void __Pyx_RaiseClosureNameError(const char *varname);
|
|
|
|
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, PyObject *cause); /*proto*/
|
|
|
|
#define __Pyx_GetItemInt(o, i, size, to_py_func, is_list, wraparound, boundscheck) \
|
|
(((size) <= sizeof(Py_ssize_t)) ? \
|
|
__Pyx_GetItemInt_Fast(o, i, is_list, wraparound, boundscheck) : \
|
|
__Pyx_GetItemInt_Generic(o, to_py_func(i)))
|
|
#define __Pyx_GetItemInt_List(o, i, size, to_py_func, is_list, wraparound, boundscheck) \
|
|
(((size) <= sizeof(Py_ssize_t)) ? \
|
|
__Pyx_GetItemInt_List_Fast(o, i, wraparound, boundscheck) : \
|
|
__Pyx_GetItemInt_Generic(o, to_py_func(i)))
|
|
static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i,
|
|
int wraparound, int boundscheck);
|
|
#define __Pyx_GetItemInt_Tuple(o, i, size, to_py_func, is_list, wraparound, boundscheck) \
|
|
(((size) <= sizeof(Py_ssize_t)) ? \
|
|
__Pyx_GetItemInt_Tuple_Fast(o, i, wraparound, boundscheck) : \
|
|
__Pyx_GetItemInt_Generic(o, to_py_func(i)))
|
|
static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i,
|
|
int wraparound, int boundscheck);
|
|
static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j);
|
|
static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i,
|
|
int is_list, int wraparound, int boundscheck);
|
|
|
|
static CYTHON_INLINE int __Pyx_PySequence_Contains(PyObject* item, PyObject* seq, int eq) {
|
|
int result = PySequence_Contains(seq, item);
|
|
return unlikely(result < 0) ? result : (result == (eq == Py_EQ));
|
|
}
|
|
|
|
#define __Pyx_SetItemInt(o, i, v, size, to_py_func, is_list, wraparound, boundscheck) \
|
|
(((size) <= sizeof(Py_ssize_t)) ? \
|
|
__Pyx_SetItemInt_Fast(o, i, v, is_list, wraparound, boundscheck) : \
|
|
__Pyx_SetItemInt_Generic(o, to_py_func(i), v))
|
|
static CYTHON_INLINE int __Pyx_SetItemInt_Generic(PyObject *o, PyObject *j, PyObject *v);
|
|
static CYTHON_INLINE int __Pyx_SetItemInt_Fast(PyObject *o, Py_ssize_t i, PyObject *v,
|
|
int is_list, int wraparound, int boundscheck);
|
|
|
|
#if CYTHON_COMPILING_IN_CPYTHON
|
|
static CYTHON_INLINE int __Pyx_PyList_Append(PyObject* list, PyObject* x) {
|
|
PyListObject* L = (PyListObject*) list;
|
|
Py_ssize_t len = Py_SIZE(list);
|
|
if (likely(L->allocated > len) & likely(len > (L->allocated >> 1))) {
|
|
Py_INCREF(x);
|
|
PyList_SET_ITEM(list, len, x);
|
|
Py_SIZE(list) = len+1;
|
|
return 0;
|
|
}
|
|
return PyList_Append(list, x);
|
|
}
|
|
#else
|
|
#define __Pyx_PyList_Append(L,x) PyList_Append(L,x)
|
|
#endif
|
|
|
|
static void __Pyx_WriteUnraisable(const char *name, int clineno,
|
|
int lineno, const char *filename); /*proto*/
|
|
|
|
static CYTHON_INLINE PyObject *__Pyx_GetModuleGlobalName(PyObject *name); /*proto*/
|
|
|
|
static CYTHON_INLINE PyObject* __Pyx_PyObject_GetSlice(
|
|
PyObject* obj, Py_ssize_t cstart, Py_ssize_t cstop,
|
|
PyObject** py_start, PyObject** py_stop, PyObject** py_slice,
|
|
int has_cstart, int has_cstop, int wraparound);
|
|
|
|
#define __Pyx_CyFunction_USED 1
|
|
#include <structmember.h>
|
|
#define __Pyx_CYFUNCTION_STATICMETHOD 0x01
|
|
#define __Pyx_CYFUNCTION_CLASSMETHOD 0x02
|
|
#define __Pyx_CYFUNCTION_CCLASS 0x04
|
|
#define __Pyx_CyFunction_GetClosure(f) \
|
|
(((__pyx_CyFunctionObject *) (f))->func_closure)
|
|
#define __Pyx_CyFunction_GetClassObj(f) \
|
|
(((__pyx_CyFunctionObject *) (f))->func_classobj)
|
|
#define __Pyx_CyFunction_Defaults(type, f) \
|
|
((type *)(((__pyx_CyFunctionObject *) (f))->defaults))
|
|
#define __Pyx_CyFunction_SetDefaultsGetter(f, g) \
|
|
((__pyx_CyFunctionObject *) (f))->defaults_getter = (g)
|
|
typedef struct {
|
|
PyCFunctionObject func;
|
|
int flags;
|
|
PyObject *func_dict;
|
|
PyObject *func_weakreflist;
|
|
PyObject *func_name;
|
|
PyObject *func_qualname;
|
|
PyObject *func_doc;
|
|
PyObject *func_code;
|
|
PyObject *func_closure;
|
|
PyObject *func_classobj; /* No-args super() class cell */
|
|
void *defaults;
|
|
int defaults_pyobjects;
|
|
PyObject *defaults_tuple; /* Const defaults tuple */
|
|
PyObject *defaults_kwdict; /* Const kwonly defaults dict */
|
|
PyObject *(*defaults_getter)(PyObject *);
|
|
PyObject *func_annotations; /* function annotations dict */
|
|
} __pyx_CyFunctionObject;
|
|
static PyTypeObject *__pyx_CyFunctionType = 0;
|
|
#define __Pyx_CyFunction_NewEx(ml, flags, qualname, self, module, code) \
|
|
__Pyx_CyFunction_New(__pyx_CyFunctionType, ml, flags, qualname, self, module, code)
|
|
static PyObject *__Pyx_CyFunction_New(PyTypeObject *, PyMethodDef *ml,
|
|
int flags, PyObject* qualname,
|
|
PyObject *self, PyObject *module,
|
|
PyObject* code);
|
|
static CYTHON_INLINE void *__Pyx_CyFunction_InitDefaults(PyObject *m,
|
|
size_t size,
|
|
int pyobjects);
|
|
static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsTuple(PyObject *m,
|
|
PyObject *tuple);
|
|
static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsKwDict(PyObject *m,
|
|
PyObject *dict);
|
|
static CYTHON_INLINE void __Pyx_CyFunction_SetAnnotationsDict(PyObject *m,
|
|
PyObject *dict);
|
|
static int __Pyx_CyFunction_init(void);
|
|
|
|
static CYTHON_INLINE int __Pyx_CheckKeywordStrings(PyObject *kwdict, const char* function_name, int kw_allowed); /*proto*/
|
|
|
|
static int __Pyx_ArgTypeTest(PyObject *obj, PyTypeObject *type, int none_allowed,
|
|
const char *name, int exact); /*proto*/
|
|
|
|
static CYTHON_INLINE int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type); /*proto*/
|
|
|
|
#if CYTHON_COMPILING_IN_CPYTHON
|
|
#define __Pyx_PyObject_DelAttrStr(o,n) __Pyx_PyObject_SetAttrStr(o,n,NULL)
|
|
static CYTHON_INLINE int __Pyx_PyObject_SetAttrStr(PyObject* obj, PyObject* attr_name, PyObject* value) {
|
|
PyTypeObject* tp = Py_TYPE(obj);
|
|
if (likely(tp->tp_setattro))
|
|
return tp->tp_setattro(obj, attr_name, value);
|
|
#if PY_MAJOR_VERSION < 3
|
|
if (likely(tp->tp_setattr))
|
|
return tp->tp_setattr(obj, PyString_AS_STRING(attr_name), value);
|
|
#endif
|
|
return PyObject_SetAttr(obj, attr_name, value);
|
|
}
|
|
#else
|
|
#define __Pyx_PyObject_DelAttrStr(o,n) PyObject_DelAttr(o,n)
|
|
#define __Pyx_PyObject_SetAttrStr(o,n,v) PyObject_SetAttr(o,n,v)
|
|
#endif
|
|
|
|
static CYTHON_INLINE void __Pyx_RaiseUnboundLocalError(const char *varname);
|
|
|
|
#include <string.h>
|
|
|
|
static int __Pyx_SetVtable(PyObject *dict, void *vtable); /*proto*/
|
|
|
|
static void* __Pyx_GetVtable(PyObject *dict); /*proto*/
|
|
|
|
typedef struct {
|
|
__pyx_CyFunctionObject func;
|
|
PyObject *__signatures__;
|
|
PyObject *type;
|
|
PyObject *self;
|
|
} __pyx_FusedFunctionObject;
|
|
#define __pyx_FusedFunction_NewEx(ml, flags, qualname, self, module, code) \
|
|
__pyx_FusedFunction_New(__pyx_FusedFunctionType, ml, flags, qualname, self, module, code)
|
|
static PyObject *__pyx_FusedFunction_New(PyTypeObject *type,
|
|
PyMethodDef *ml, int flags,
|
|
PyObject *qualname, PyObject *self, PyObject *module,
|
|
PyObject *code);
|
|
static int __pyx_FusedFunction_clear(__pyx_FusedFunctionObject *self);
|
|
static PyTypeObject *__pyx_FusedFunctionType = NULL;
|
|
static int __pyx_FusedFunction_init(void);
|
|
#define __Pyx_FusedFunction_USED
|
|
|
|
static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name); /*proto*/
|
|
|
|
#include <new>
|
|
|
|
static CYTHON_INLINE void __Pyx_ExceptionSave(PyObject **type, PyObject **value, PyObject **tb); /*proto*/
|
|
static void __Pyx_ExceptionReset(PyObject *type, PyObject *value, PyObject *tb); /*proto*/
|
|
|
|
static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level); /*proto*/
|
|
|
|
static CYTHON_INLINE PyObject *__Pyx_PyInt_to_py_uint64_t(uint64_t);
|
|
|
|
static CYTHON_INLINE PyObject *__Pyx_PyInt_to_py_int64_t(int64_t);
|
|
|
|
#ifndef __Pyx_CppExn2PyErr
|
|
#include <new>
|
|
#include <typeinfo>
|
|
#include <stdexcept>
|
|
#include <ios>
|
|
static void __Pyx_CppExn2PyErr() {
|
|
try {
|
|
if (PyErr_Occurred())
|
|
; // let the latest Python exn pass through and ignore the current one
|
|
else
|
|
throw;
|
|
} catch (const std::bad_alloc& exn) {
|
|
PyErr_SetString(PyExc_MemoryError, exn.what());
|
|
} catch (const std::bad_cast& exn) {
|
|
PyErr_SetString(PyExc_TypeError, exn.what());
|
|
} catch (const std::domain_error& exn) {
|
|
PyErr_SetString(PyExc_ValueError, exn.what());
|
|
} catch (const std::invalid_argument& exn) {
|
|
PyErr_SetString(PyExc_ValueError, exn.what());
|
|
} catch (const std::ios_base::failure& exn) {
|
|
PyErr_SetString(PyExc_IOError, exn.what());
|
|
} catch (const std::out_of_range& exn) {
|
|
PyErr_SetString(PyExc_IndexError, exn.what());
|
|
} catch (const std::overflow_error& exn) {
|
|
PyErr_SetString(PyExc_OverflowError, exn.what());
|
|
} catch (const std::range_error& exn) {
|
|
PyErr_SetString(PyExc_ArithmeticError, exn.what());
|
|
} catch (const std::underflow_error& exn) {
|
|
PyErr_SetString(PyExc_ArithmeticError, exn.what());
|
|
} catch (const std::exception& exn) {
|
|
PyErr_SetString(PyExc_RuntimeError, exn.what());
|
|
}
|
|
catch (...)
|
|
{
|
|
PyErr_SetString(PyExc_RuntimeError, "Unknown exception");
|
|
}
|
|
}
|
|
#endif
|
|
|
|
static CYTHON_INLINE uint64_t __Pyx_PyInt_from_py_uint64_t(PyObject *);
|
|
|
|
static CYTHON_INLINE unsigned char __Pyx_PyInt_AsUnsignedChar(PyObject *);
|
|
|
|
static CYTHON_INLINE unsigned short __Pyx_PyInt_AsUnsignedShort(PyObject *);
|
|
|
|
static CYTHON_INLINE unsigned int __Pyx_PyInt_AsUnsignedInt(PyObject *);
|
|
|
|
static CYTHON_INLINE char __Pyx_PyInt_AsChar(PyObject *);
|
|
|
|
static CYTHON_INLINE short __Pyx_PyInt_AsShort(PyObject *);
|
|
|
|
static CYTHON_INLINE int __Pyx_PyInt_AsInt(PyObject *);
|
|
|
|
static CYTHON_INLINE signed char __Pyx_PyInt_AsSignedChar(PyObject *);
|
|
|
|
static CYTHON_INLINE signed short __Pyx_PyInt_AsSignedShort(PyObject *);
|
|
|
|
static CYTHON_INLINE signed int __Pyx_PyInt_AsSignedInt(PyObject *);
|
|
|
|
static CYTHON_INLINE int __Pyx_PyInt_AsLongDouble(PyObject *);
|
|
|
|
static CYTHON_INLINE unsigned long __Pyx_PyInt_AsUnsignedLong(PyObject *);
|
|
|
|
static CYTHON_INLINE unsigned PY_LONG_LONG __Pyx_PyInt_AsUnsignedLongLong(PyObject *);
|
|
|
|
static CYTHON_INLINE long __Pyx_PyInt_AsLong(PyObject *);
|
|
|
|
static CYTHON_INLINE PY_LONG_LONG __Pyx_PyInt_AsLongLong(PyObject *);
|
|
|
|
static CYTHON_INLINE signed long __Pyx_PyInt_AsSignedLong(PyObject *);
|
|
|
|
static CYTHON_INLINE signed PY_LONG_LONG __Pyx_PyInt_AsSignedLongLong(PyObject *);
|
|
|
|
static CYTHON_INLINE void __Pyx_ExceptionSwap(PyObject **type, PyObject **value, PyObject **tb); /*proto*/
|
|
|
|
#define __Pyx_Generator_USED
|
|
#include <structmember.h>
|
|
#include <frameobject.h>
|
|
typedef PyObject *(*__pyx_generator_body_t)(PyObject *, PyObject *);
|
|
typedef struct {
|
|
PyObject_HEAD
|
|
__pyx_generator_body_t body;
|
|
PyObject *closure;
|
|
PyObject *exc_type;
|
|
PyObject *exc_value;
|
|
PyObject *exc_traceback;
|
|
PyObject *gi_weakreflist;
|
|
PyObject *classobj;
|
|
PyObject *yieldfrom;
|
|
int resume_label;
|
|
char is_running; // using T_BOOL for property below requires char value
|
|
} __pyx_GeneratorObject;
|
|
static __pyx_GeneratorObject *__Pyx_Generator_New(__pyx_generator_body_t body,
|
|
PyObject *closure);
|
|
static int __pyx_Generator_init(void);
|
|
static int __Pyx_Generator_clear(PyObject* self);
|
|
#if 1 || PY_VERSION_HEX < 0x030300B0
|
|
static int __Pyx_PyGen_FetchStopIterationValue(PyObject **pvalue);
|
|
#else
|
|
#define __Pyx_PyGen_FetchStopIterationValue(pvalue) PyGen_FetchStopIterationValue(pvalue)
|
|
#endif
|
|
|
|
static int __Pyx_check_binary_version(void);
|
|
|
|
#if !defined(__Pyx_PyIdentifier_FromString)
|
|
#if PY_MAJOR_VERSION < 3
|
|
#define __Pyx_PyIdentifier_FromString(s) PyString_FromString(s)
|
|
#else
|
|
#define __Pyx_PyIdentifier_FromString(s) PyUnicode_FromString(s)
|
|
#endif
|
|
#endif
|
|
|
|
static PyObject *__Pyx_ImportModule(const char *name); /*proto*/
|
|
|
|
static PyTypeObject *__Pyx_ImportType(const char *module_name, const char *class_name, size_t size, int strict); /*proto*/
|
|
|
|
typedef struct {
|
|
int code_line;
|
|
PyCodeObject* code_object;
|
|
} __Pyx_CodeObjectCacheEntry;
|
|
struct __Pyx_CodeObjectCache {
|
|
int count;
|
|
int max_count;
|
|
__Pyx_CodeObjectCacheEntry* entries;
|
|
};
|
|
static struct __Pyx_CodeObjectCache __pyx_code_cache = {0,0,NULL};
|
|
static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line);
|
|
static PyCodeObject *__pyx_find_code_object(int code_line);
|
|
static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object);
|
|
|
|
static void __Pyx_AddTraceback(const char *funcname, int c_line,
|
|
int py_line, const char *filename); /*proto*/
|
|
|
|
static int __Pyx_InitStrings(__Pyx_StringTabEntry *t); /*proto*/
|
|
|
|
|
|
/* Module declarations from 'cython' */
|
|
|
|
/* Module declarations from 'libc.stdint' */
|
|
|
|
/* Module declarations from 'schema_cpp' */
|
|
|
|
/* Module declarations from 'capnp_cpp' */
|
|
|
|
/* Module declarations from 'schema' */
|
|
static PyTypeObject *__pyx_ptype_6schema__NodeReader = 0;
|
|
|
|
/* Module declarations from 'capnp' */
|
|
static PyTypeObject *__pyx_ptype_5capnp__List_Node_Reader = 0;
|
|
static PyTypeObject *__pyx_ptype_5capnp___pyx_scope_struct_1_genexpr = 0;
|
|
static PyTypeObject *__pyx_ptype_5capnp__DynamicListReader = 0;
|
|
static PyTypeObject *__pyx_ptype_5capnp__DynamicUnionReader = 0;
|
|
static PyTypeObject *__pyx_ptype_5capnp_MessageBuilder = 0;
|
|
static PyTypeObject *__pyx_ptype_5capnp__List_UInt64_Reader = 0;
|
|
static PyTypeObject *__pyx_ptype_5capnp_StructSchema = 0;
|
|
static PyTypeObject *__pyx_ptype_5capnp_MessageReader = 0;
|
|
static PyTypeObject *__pyx_ptype_5capnp_PackedFdMessageReader = 0;
|
|
static PyTypeObject *__pyx_ptype_5capnp__DynamicStructReader = 0;
|
|
static PyTypeObject *__pyx_ptype_5capnp___pyx_scope_struct___make_enum = 0;
|
|
static PyTypeObject *__pyx_ptype_5capnp_StreamFdMessageReader = 0;
|
|
static PyTypeObject *__pyx_ptype_5capnp_MallocMessageBuilder = 0;
|
|
static PyTypeObject *__pyx_ptype_5capnp__DynamicValueReader = 0;
|
|
static PyTypeObject *__pyx_ptype_5capnp_Schema = 0;
|
|
static PyTypeObject *__pyx_ptype_5capnp__CodeGeneratorRequestReader = 0;
|
|
static PyTypeObject *__pyx_ptype_5capnp__DynamicUnionBuilder = 0;
|
|
static PyTypeObject *__pyx_ptype_5capnp__DynamicListBuilder = 0;
|
|
static PyTypeObject *__pyx_ptype_5capnp__DynamicStructBuilder = 0;
|
|
static PyTypeObject *__pyx_ptype_5capnp___pyx_scope_struct_2___getattr__ = 0;
|
|
static PyTypeObject *__pyx_ptype_5capnp_SchemaLoader = 0;
|
|
static int __pyx_f_5capnp_getType( ::capnp::DynamicValue::Builder &); /*proto*/
|
|
static PyObject *__pyx_f_5capnp_toPython( ::capnp::DynamicValue::Builder &); /*proto*/
|
|
static PyObject *__pyx_f_5capnp_toPythonByValue( ::capnp::DynamicValue::Builder); /*proto*/
|
|
#define __Pyx_MODULE_NAME "capnp"
|
|
int __pyx_module_is_main_capnp = 0;
|
|
|
|
/* Implementation of 'capnp' */
|
|
static PyObject *__pyx_builtin_ValueError;
|
|
static PyObject *__pyx_builtin_zip;
|
|
static PyObject *__pyx_builtin_range;
|
|
static PyObject *__pyx_builtin_IndexError;
|
|
static PyObject *__pyx_builtin_TypeError;
|
|
static PyObject *__pyx_builtin_RuntimeError;
|
|
static PyObject *__pyx_pf_5capnp_10_make_enum_genexpr(PyObject *__pyx_self); /* proto */
|
|
static PyObject *__pyx_pf_5capnp__make_enum(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_enum_name, PyObject *__pyx_v_sequential, PyObject *__pyx_v_named); /* proto */
|
|
static PyObject *__pyx_pf_5capnp_18_DynamicListReader__get(struct __pyx_obj_5capnp__DynamicListReader *__pyx_v_self, PyObject *__pyx_v_index); /* proto */
|
|
static PyObject *__pyx_pf_5capnp_18_DynamicListReader_2__getitem__(struct __pyx_obj_5capnp__DynamicListReader *__pyx_v_self, PyObject *__pyx_v_index); /* proto */
|
|
static Py_ssize_t __pyx_pf_5capnp_18_DynamicListReader_4__len__(struct __pyx_obj_5capnp__DynamicListReader *__pyx_v_self); /* proto */
|
|
static PyObject *__pyx_pf_5capnp_19_DynamicListBuilder___getitem__(struct __pyx_obj_5capnp__DynamicListBuilder *__pyx_v_self, PyObject *__pyx_v_index); /* proto */
|
|
static PyObject *__pyx_pf_5capnp_19_DynamicListBuilder_2_setitem(struct __pyx_obj_5capnp__DynamicListBuilder *__pyx_v_signatures, PyObject *__pyx_v_args, PyObject *__pyx_v_kwargs, CYTHON_UNUSED PyObject *__pyx_v_defaults); /* proto */
|
|
static PyObject *__pyx_pf_5capnp_19_DynamicListBuilder_8_setitem(struct __pyx_obj_5capnp__DynamicListBuilder *__pyx_v_self, PyObject *__pyx_v_index, int __pyx_v_value); /* proto */
|
|
static PyObject *__pyx_pf_5capnp_19_DynamicListBuilder_10_setitem(struct __pyx_obj_5capnp__DynamicListBuilder *__pyx_v_self, PyObject *__pyx_v_index, long __pyx_v_value); /* proto */
|
|
static PyObject *__pyx_pf_5capnp_19_DynamicListBuilder_12_setitem(struct __pyx_obj_5capnp__DynamicListBuilder *__pyx_v_self, PyObject *__pyx_v_index, float __pyx_v_value); /* proto */
|
|
static PyObject *__pyx_pf_5capnp_19_DynamicListBuilder_14_setitem(struct __pyx_obj_5capnp__DynamicListBuilder *__pyx_v_self, PyObject *__pyx_v_index, double __pyx_v_value); /* proto */
|
|
static PyObject *__pyx_pf_5capnp_19_DynamicListBuilder_16_setitem(struct __pyx_obj_5capnp__DynamicListBuilder *__pyx_v_self, PyObject *__pyx_v_index, int __pyx_v_value); /* proto */
|
|
static PyObject *__pyx_pf_5capnp_19_DynamicListBuilder_18_setitem(struct __pyx_obj_5capnp__DynamicListBuilder *__pyx_v_self, PyObject *__pyx_v_index, char *__pyx_v_value); /* proto */
|
|
static int __pyx_pf_5capnp_19_DynamicListBuilder_4__setitem__(struct __pyx_obj_5capnp__DynamicListBuilder *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_value); /* proto */
|
|
static Py_ssize_t __pyx_pf_5capnp_19_DynamicListBuilder_6__len__(struct __pyx_obj_5capnp__DynamicListBuilder *__pyx_v_self); /* proto */
|
|
static PyObject *__pyx_pf_5capnp_19_List_UInt64_Reader___getitem__(struct __pyx_obj_5capnp__List_UInt64_Reader *__pyx_v_self, PyObject *__pyx_v_index); /* proto */
|
|
static Py_ssize_t __pyx_pf_5capnp_19_List_UInt64_Reader_2__len__(struct __pyx_obj_5capnp__List_UInt64_Reader *__pyx_v_self); /* proto */
|
|
static PyObject *__pyx_pf_5capnp_17_List_Node_Reader___getitem__(struct __pyx_obj_5capnp__List_Node_Reader *__pyx_v_self, PyObject *__pyx_v_index); /* proto */
|
|
static Py_ssize_t __pyx_pf_5capnp_17_List_Node_Reader_2__len__(struct __pyx_obj_5capnp__List_Node_Reader *__pyx_v_self); /* proto */
|
|
static PyObject *__pyx_pf_5capnp_19_DynamicValueReader_getType(struct __pyx_obj_5capnp__DynamicValueReader *__pyx_v_self); /* proto */
|
|
static PyObject *__pyx_pf_5capnp_19_DynamicValueReader_2toPython(struct __pyx_obj_5capnp__DynamicValueReader *__pyx_v_self); /* proto */
|
|
static PyObject *__pyx_pf_5capnp_20_DynamicStructReader__get(struct __pyx_obj_5capnp__DynamicStructReader *__pyx_v_self, PyObject *__pyx_v_field); /* proto */
|
|
static PyObject *__pyx_pf_5capnp_20_DynamicStructReader_2__getattr__(struct __pyx_obj_5capnp__DynamicStructReader *__pyx_v_self, PyObject *__pyx_v_field); /* proto */
|
|
static PyObject *__pyx_pf_5capnp_20_DynamicStructReader_4_has(struct __pyx_obj_5capnp__DynamicStructReader *__pyx_v_self, PyObject *__pyx_v_field); /* proto */
|
|
static PyObject *__pyx_lambda_funcdef_lambda1(PyObject *__pyx_self, PyObject *__pyx_v_size); /* proto */
|
|
static PyObject *__pyx_pf_5capnp_21_DynamicStructBuilder___getattr__(struct __pyx_obj_5capnp__DynamicStructBuilder *__pyx_v_self, PyObject *__pyx_v_field); /* proto */
|
|
static int __pyx_pf_5capnp_21_DynamicStructBuilder_2__setattr__(struct __pyx_obj_5capnp__DynamicStructBuilder *__pyx_v_self, PyObject *__pyx_v_field, PyObject *__pyx_v_value); /* proto */
|
|
static PyObject *__pyx_pf_5capnp_21_DynamicStructBuilder_4_has(struct __pyx_obj_5capnp__DynamicStructBuilder *__pyx_v_self, PyObject *__pyx_v_field); /* proto */
|
|
static PyObject *__pyx_pf_5capnp_21_DynamicStructBuilder_6init(struct __pyx_obj_5capnp__DynamicStructBuilder *__pyx_v_self, PyObject *__pyx_v_field, PyObject *__pyx_v_size); /* proto */
|
|
static PyObject *__pyx_pf_5capnp_19_DynamicUnionReader__get(struct __pyx_obj_5capnp__DynamicUnionReader *__pyx_v_self); /* proto */
|
|
static PyObject *__pyx_pf_5capnp_19_DynamicUnionReader_2__getattr__(struct __pyx_obj_5capnp__DynamicUnionReader *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_field); /* proto */
|
|
static PyObject *__pyx_pf_5capnp_19_DynamicUnionReader_4which(struct __pyx_obj_5capnp__DynamicUnionReader *__pyx_v_self); /* proto */
|
|
static PyObject *__pyx_pf_5capnp_20_DynamicUnionBuilder___getattr__(struct __pyx_obj_5capnp__DynamicUnionBuilder *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_field); /* proto */
|
|
static int __pyx_pf_5capnp_20_DynamicUnionBuilder_2__setattr__(struct __pyx_obj_5capnp__DynamicUnionBuilder *__pyx_v_self, PyObject *__pyx_v_field, PyObject *__pyx_v_value); /* proto */
|
|
static PyObject *__pyx_pf_5capnp_20_DynamicUnionBuilder_4which(struct __pyx_obj_5capnp__DynamicUnionBuilder *__pyx_v_self); /* proto */
|
|
static PyObject *__pyx_pf_5capnp_20_DynamicUnionBuilder_6init(struct __pyx_obj_5capnp__DynamicUnionBuilder *__pyx_v_self, PyObject *__pyx_v_field, PyObject *__pyx_v_size); /* proto */
|
|
static PyObject *__pyx_pf_5capnp_27_CodeGeneratorRequestReader_5nodes___get__(struct __pyx_obj_5capnp__CodeGeneratorRequestReader *__pyx_v_self); /* proto */
|
|
static PyObject *__pyx_pf_5capnp_27_CodeGeneratorRequestReader_14requestedFiles___get__(struct __pyx_obj_5capnp__CodeGeneratorRequestReader *__pyx_v_self); /* proto */
|
|
static PyObject *__pyx_pf_5capnp_6Schema_asStruct(struct __pyx_obj_5capnp_Schema *__pyx_v_self); /* proto */
|
|
static PyObject *__pyx_pf_5capnp_6Schema_2getDependency(struct __pyx_obj_5capnp_Schema *__pyx_v_self, PyObject *__pyx_v_id); /* proto */
|
|
static PyObject *__pyx_pf_5capnp_6Schema_4getProto(struct __pyx_obj_5capnp_Schema *__pyx_v_self); /* proto */
|
|
static int __pyx_pf_5capnp_12SchemaLoader___cinit__(struct __pyx_obj_5capnp_SchemaLoader *__pyx_v_self); /* proto */
|
|
static void __pyx_pf_5capnp_12SchemaLoader_2__dealloc__(CYTHON_UNUSED struct __pyx_obj_5capnp_SchemaLoader *__pyx_v_self); /* proto */
|
|
static PyObject *__pyx_pf_5capnp_12SchemaLoader_4load(struct __pyx_obj_5capnp_SchemaLoader *__pyx_v_self, struct __pyx_obj_6schema__NodeReader *__pyx_v_node); /* proto */
|
|
static PyObject *__pyx_pf_5capnp_12SchemaLoader_6get(struct __pyx_obj_5capnp_SchemaLoader *__pyx_v_self, PyObject *__pyx_v_id); /* proto */
|
|
static void __pyx_pf_5capnp_14MessageBuilder___dealloc__(CYTHON_UNUSED struct __pyx_obj_5capnp_MessageBuilder *__pyx_v_self); /* proto */
|
|
static PyObject *__pyx_pf_5capnp_14MessageBuilder_2initRoot(struct __pyx_obj_5capnp_MessageBuilder *__pyx_v_self, PyObject *__pyx_v_schema); /* proto */
|
|
static PyObject *__pyx_pf_5capnp_14MessageBuilder_4getRoot(struct __pyx_obj_5capnp_MessageBuilder *__pyx_v_self, PyObject *__pyx_v_schema); /* proto */
|
|
static int __pyx_pf_5capnp_20MallocMessageBuilder___cinit__(struct __pyx_obj_5capnp_MallocMessageBuilder *__pyx_v_self); /* proto */
|
|
static void __pyx_pf_5capnp_13MessageReader___dealloc__(CYTHON_UNUSED struct __pyx_obj_5capnp_MessageReader *__pyx_v_self); /* proto */
|
|
static PyObject *__pyx_pf_5capnp_13MessageReader_2getRootNode(struct __pyx_obj_5capnp_MessageReader *__pyx_v_self); /* proto */
|
|
static PyObject *__pyx_pf_5capnp_13MessageReader_4getRootCodeGeneratorRequest(struct __pyx_obj_5capnp_MessageReader *__pyx_v_self); /* proto */
|
|
static PyObject *__pyx_pf_5capnp_13MessageReader_6getRootDynamicStruct(struct __pyx_obj_5capnp_MessageReader *__pyx_v_self, struct __pyx_obj_5capnp_StructSchema *__pyx_v_schema); /* proto */
|
|
static PyObject *__pyx_pf_5capnp_13MessageReader_8getRoot(struct __pyx_obj_5capnp_MessageReader *__pyx_v_self, PyObject *__pyx_v_schema); /* proto */
|
|
static int __pyx_pf_5capnp_21StreamFdMessageReader___cinit__(struct __pyx_obj_5capnp_StreamFdMessageReader *__pyx_v_self, int __pyx_v_fd); /* proto */
|
|
static int __pyx_pf_5capnp_21PackedFdMessageReader___cinit__(struct __pyx_obj_5capnp_PackedFdMessageReader *__pyx_v_self, int __pyx_v_fd); /* proto */
|
|
static PyObject *__pyx_pf_5capnp_2writeMessageToFd(CYTHON_UNUSED PyObject *__pyx_self, int __pyx_v_fd, struct __pyx_obj_5capnp_MessageBuilder *__pyx_v_m); /* proto */
|
|
static PyObject *__pyx_pf_5capnp_4writePackedMessageToFd(CYTHON_UNUSED PyObject *__pyx_self, int __pyx_v_fd, struct __pyx_obj_5capnp_MessageBuilder *__pyx_v_m); /* proto */
|
|
static PyObject *__pyx_pf_5capnp_6capitalize(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_s); /* proto */
|
|
static PyObject *__pyx_pf_5capnp_8upper_and_under(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_s); /* proto */
|
|
static PyObject *__pyx_pf_5capnp_10_load(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_module, PyObject *__pyx_v_node, PyObject *__pyx_v_loader, PyObject *__pyx_v_name, CYTHON_UNUSED PyObject *__pyx_v_isUnion); /* proto */
|
|
static PyObject *__pyx_pf_5capnp_12load(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_file_name, PyObject *__pyx_v_cat_path); /* proto */
|
|
static PyObject *__pyx_tp_new_5capnp__List_Node_Reader(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
|
|
static PyObject *__pyx_tp_new_5capnp___pyx_scope_struct_1_genexpr(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
|
|
static PyObject *__pyx_tp_new_5capnp__DynamicListReader(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
|
|
static PyObject *__pyx_tp_new_5capnp__DynamicUnionReader(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
|
|
static PyObject *__pyx_tp_new_5capnp_MessageBuilder(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
|
|
static PyObject *__pyx_tp_new_5capnp__List_UInt64_Reader(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
|
|
static PyObject *__pyx_tp_new_5capnp_StructSchema(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
|
|
static PyObject *__pyx_tp_new_5capnp_MessageReader(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
|
|
static PyObject *__pyx_tp_new_5capnp_PackedFdMessageReader(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
|
|
static PyObject *__pyx_tp_new_5capnp__DynamicStructReader(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
|
|
static PyObject *__pyx_tp_new_5capnp___pyx_scope_struct___make_enum(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
|
|
static PyObject *__pyx_tp_new_5capnp_StreamFdMessageReader(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
|
|
static PyObject *__pyx_tp_new_5capnp_MallocMessageBuilder(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
|
|
static PyObject *__pyx_tp_new_5capnp__DynamicValueReader(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
|
|
static PyObject *__pyx_tp_new_5capnp_Schema(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
|
|
static PyObject *__pyx_tp_new_5capnp__CodeGeneratorRequestReader(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
|
|
static PyObject *__pyx_tp_new_5capnp__DynamicUnionBuilder(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
|
|
static PyObject *__pyx_tp_new_5capnp__DynamicListBuilder(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
|
|
static PyObject *__pyx_tp_new_5capnp__DynamicStructBuilder(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
|
|
static PyObject *__pyx_tp_new_5capnp___pyx_scope_struct_2___getattr__(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
|
|
static PyObject *__pyx_tp_new_5capnp_SchemaLoader(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
|
|
static char __pyx_k_1[] = "Out of bounds";
|
|
static char __pyx_k_4[] = "Expected at least %d arguments";
|
|
static char __pyx_k_5[] = "char *";
|
|
static char __pyx_k_6[] = "()";
|
|
static char __pyx_k_8[] = "|";
|
|
static char __pyx_k_10[] = "No matching signature found";
|
|
static char __pyx_k_12[] = "Function call with ambiguous argument types";
|
|
static char __pyx_k_17[] = "Cannot convert type to Python. Type is unknown by capnproto library";
|
|
static char __pyx_k_19[] = "Cannot convert type to Python. Type is unhandled by capnproto library";
|
|
static char __pyx_k_27[] = "_DynamicStructBuilder.__getattr__.<locals>.<lambda>";
|
|
static char __pyx_k_28[] = "Non primitive type";
|
|
static char __pyx_k_31[] = "getRootCodeGeneratorRequest";
|
|
static char __pyx_k_32[] = "getRootDynamicStruct";
|
|
static char __pyx_k_35[] = "";
|
|
static char __pyx_k_37[] = ":";
|
|
static char __pyx_k_39[] = "[:.]";
|
|
static char __pyx_k_40[] = ":Which";
|
|
static char __pyx_k_41[] = "/bin/cat";
|
|
static char __pyx_k_42[] = "-o";
|
|
static char __pyx_k_43[] = "capnpc failed for some reason";
|
|
static char __pyx_k_45[] = "StreamFdMessageReader";
|
|
static char __pyx_k_48[] = "/Users/jason/workspace/capnpc-python-cpp/capnp/capnp.pyx";
|
|
static char __pyx_k_49[] = "DynamicValue.Type";
|
|
static char __pyx_k_53[] = "_DynamicListBuilder._setitem";
|
|
static char __pyx_k_58[] = "writePackedMessageToFd";
|
|
static char __pyx_k___[] = "_";
|
|
static char __pyx_k__m[] = "m";
|
|
static char __pyx_k__p[] = "p";
|
|
static char __pyx_k__s[] = "s";
|
|
static char __pyx_k__fd[] = "fd";
|
|
static char __pyx_k__id[] = "id";
|
|
static char __pyx_k__re[] = "re";
|
|
static char __pyx_k__INT[] = "INT";
|
|
static char __pyx_k__get[] = "get";
|
|
static char __pyx_k__int[] = "int";
|
|
static char __pyx_k__ret[] = "ret";
|
|
static char __pyx_k__zip[] = "zip";
|
|
static char __pyx_k__BOOL[] = "BOOL";
|
|
static char __pyx_k__Body[] = "Body";
|
|
static char __pyx_k__DATA[] = "DATA";
|
|
static char __pyx_k__ENUM[] = "ENUM";
|
|
static char __pyx_k__LIST[] = "LIST";
|
|
static char __pyx_k__Node[] = "Node";
|
|
static char __pyx_k__PIPE[] = "PIPE";
|
|
static char __pyx_k__TEXT[] = "TEXT";
|
|
static char __pyx_k__UINT[] = "UINT";
|
|
static char __pyx_k__VOID[] = "VOID";
|
|
static char __pyx_k___get[] = "_get";
|
|
static char __pyx_k___has[] = "_has";
|
|
static char __pyx_k__args[] = "args";
|
|
static char __pyx_k__bint[] = "bint";
|
|
static char __pyx_k__body[] = "body";
|
|
static char __pyx_k__enum[] = "enum";
|
|
static char __pyx_k__init[] = "init";
|
|
static char __pyx_k__join[] = "join";
|
|
static char __pyx_k__load[] = "load";
|
|
static char __pyx_k__long[] = "long";
|
|
static char __pyx_k__name[] = "name";
|
|
static char __pyx_k__node[] = "node";
|
|
static char __pyx_k__self[] = "self";
|
|
static char __pyx_k__send[] = "send";
|
|
static char __pyx_k__size[] = "size";
|
|
static char __pyx_k__temp[] = "temp";
|
|
static char __pyx_k__wait[] = "wait";
|
|
static char __pyx_k__FLOAT[] = "FLOAT";
|
|
static char __pyx_k__Popen[] = "Popen";
|
|
static char __pyx_k__UNION[] = "UNION";
|
|
static char __pyx_k__Which[] = "Which";
|
|
static char __pyx_k___Type[] = "_Type";
|
|
static char __pyx_k___load[] = "_load";
|
|
static char __pyx_k__capnp[] = "capnp";
|
|
static char __pyx_k__close[] = "close";
|
|
static char __pyx_k__enums[] = "enums";
|
|
static char __pyx_k__field[] = "field";
|
|
static char __pyx_k__float[] = "float";
|
|
static char __pyx_k__index[] = "index";
|
|
static char __pyx_k__lower[] = "lower";
|
|
static char __pyx_k__named[] = "named";
|
|
static char __pyx_k__new_m[] = "new_m";
|
|
static char __pyx_k__nodes[] = "nodes";
|
|
static char __pyx_k__range[] = "range";
|
|
static char __pyx_k__split[] = "split";
|
|
static char __pyx_k__strip[] = "strip";
|
|
static char __pyx_k__throw[] = "throw";
|
|
static char __pyx_k__types[] = "types";
|
|
static char __pyx_k__upper[] = "upper";
|
|
static char __pyx_k__value[] = "value";
|
|
static char __pyx_k__which[] = "which";
|
|
static char __pyx_k__Member[] = "Member";
|
|
static char __pyx_k__OBJECT[] = "OBJECT";
|
|
static char __pyx_k__STRUCT[] = "STRUCT";
|
|
static char __pyx_k__Schema[] = "Schema";
|
|
static char __pyx_k__capnpc[] = "capnpc";
|
|
static char __pyx_k__double[] = "double";
|
|
static char __pyx_k__fileno[] = "fileno";
|
|
static char __pyx_k__kwargs[] = "kwargs";
|
|
static char __pyx_k__letter[] = "letter";
|
|
static char __pyx_k__loader[] = "loader";
|
|
static char __pyx_k__member[] = "member";
|
|
static char __pyx_k__module[] = "module";
|
|
static char __pyx_k__reader[] = "reader";
|
|
static char __pyx_k__schema[] = "schema";
|
|
static char __pyx_k__stdout[] = "stdout";
|
|
static char __pyx_k__struct[] = "struct";
|
|
static char __pyx_k__UNKNOWN[] = "UNKNOWN";
|
|
static char __pyx_k___loader[] = "_loader";
|
|
static char __pyx_k__genexpr[] = "genexpr";
|
|
static char __pyx_k__getRoot[] = "getRoot";
|
|
static char __pyx_k__getType[] = "getType";
|
|
static char __pyx_k__isUnion[] = "isUnion";
|
|
static char __pyx_k__isupper[] = "isupper";
|
|
static char __pyx_k__members[] = "members";
|
|
static char __pyx_k__replace[] = "replace";
|
|
static char __pyx_k__request[] = "request";
|
|
static char __pyx_k__retcode[] = "retcode";
|
|
static char __pyx_k__reverse[] = "reverse";
|
|
static char __pyx_k____dict__[] = "__dict__";
|
|
static char __pyx_k____main__[] = "__main__";
|
|
static char __pyx_k____name__[] = "__name__";
|
|
static char __pyx_k____test__[] = "__test__";
|
|
static char __pyx_k___setitem[] = "_setitem";
|
|
static char __pyx_k__asStruct[] = "asStruct";
|
|
static char __pyx_k__cat_path[] = "cat_path";
|
|
static char __pyx_k__defaults[] = "defaults";
|
|
static char __pyx_k__enumNode[] = "enumNode";
|
|
static char __pyx_k__getProto[] = "getProto";
|
|
static char __pyx_k__initRoot[] = "initRoot";
|
|
static char __pyx_k__sub_name[] = "sub_name";
|
|
static char __pyx_k__toPython[] = "toPython";
|
|
static char __pyx_k__INTERFACE[] = "INTERFACE";
|
|
static char __pyx_k__TypeError[] = "TypeError";
|
|
static char __pyx_k__enum_name[] = "enum_name";
|
|
static char __pyx_k__file_name[] = "file_name";
|
|
static char __pyx_k__iteritems[] = "iteritems";
|
|
static char __pyx_k__IndexError[] = "IndexError";
|
|
static char __pyx_k__ModuleType[] = "ModuleType";
|
|
static char __pyx_k__StructNode[] = "StructNode";
|
|
static char __pyx_k__ValueError[] = "ValueError";
|
|
static char __pyx_k____import__[] = "__import__";
|
|
static char __pyx_k___make_enum[] = "_make_enum";
|
|
static char __pyx_k__capitalize[] = "capitalize";
|
|
static char __pyx_k__enumerants[] = "enumerants";
|
|
static char __pyx_k__nestedNode[] = "nestedNode";
|
|
static char __pyx_k__sequential[] = "sequential";
|
|
static char __pyx_k__startswith[] = "startswith";
|
|
static char __pyx_k__structNode[] = "structNode";
|
|
static char __pyx_k__subprocess[] = "subprocess";
|
|
static char __pyx_k__TYPE_UNKOWN[] = "TYPE_UNKOWN";
|
|
static char __pyx_k__displayName[] = "displayName";
|
|
static char __pyx_k__getRootNode[] = "getRootNode";
|
|
static char __pyx_k__nestedNodes[] = "nestedNodes";
|
|
static char __pyx_k__unionMember[] = "unionMember";
|
|
static char __pyx_k__RuntimeError[] = "RuntimeError";
|
|
static char __pyx_k___root_module[] = "_root_module";
|
|
static char __pyx_k__local_module[] = "local_module";
|
|
static char __pyx_k__getDependency[] = "getDependency";
|
|
static char __pyx_k____pyx_vtable__[] = "__pyx_vtable__";
|
|
static char __pyx_k___parent_module[] = "_parent_module";
|
|
static char __pyx_k__reverse_mapping[] = "reverse_mapping";
|
|
static char __pyx_k__upper_and_under[] = "upper_and_under";
|
|
static char __pyx_k__writeMessageToFd[] = "writeMessageToFd";
|
|
static PyObject *__pyx_kp_s_1;
|
|
static PyObject *__pyx_kp_s_10;
|
|
static PyObject *__pyx_kp_s_12;
|
|
static PyObject *__pyx_kp_s_17;
|
|
static PyObject *__pyx_kp_s_19;
|
|
static PyObject *__pyx_n_s_27;
|
|
static PyObject *__pyx_kp_s_28;
|
|
static PyObject *__pyx_n_s_31;
|
|
static PyObject *__pyx_n_s_32;
|
|
static PyObject *__pyx_kp_s_35;
|
|
static PyObject *__pyx_kp_s_37;
|
|
static PyObject *__pyx_kp_s_39;
|
|
static PyObject *__pyx_kp_s_4;
|
|
static PyObject *__pyx_kp_s_40;
|
|
static PyObject *__pyx_kp_s_41;
|
|
static PyObject *__pyx_kp_s_42;
|
|
static PyObject *__pyx_kp_s_43;
|
|
static PyObject *__pyx_n_s_45;
|
|
static PyObject *__pyx_kp_s_48;
|
|
static PyObject *__pyx_kp_s_49;
|
|
static PyObject *__pyx_kp_s_5;
|
|
static PyObject *__pyx_n_s_53;
|
|
static PyObject *__pyx_n_s_58;
|
|
static PyObject *__pyx_kp_s_6;
|
|
static PyObject *__pyx_kp_s_8;
|
|
static PyObject *__pyx_n_s__BOOL;
|
|
static PyObject *__pyx_n_s__Body;
|
|
static PyObject *__pyx_n_s__DATA;
|
|
static PyObject *__pyx_n_s__ENUM;
|
|
static PyObject *__pyx_n_s__FLOAT;
|
|
static PyObject *__pyx_n_s__INT;
|
|
static PyObject *__pyx_n_s__INTERFACE;
|
|
static PyObject *__pyx_n_s__IndexError;
|
|
static PyObject *__pyx_n_s__LIST;
|
|
static PyObject *__pyx_n_s__Member;
|
|
static PyObject *__pyx_n_s__ModuleType;
|
|
static PyObject *__pyx_n_s__Node;
|
|
static PyObject *__pyx_n_s__OBJECT;
|
|
static PyObject *__pyx_n_s__PIPE;
|
|
static PyObject *__pyx_n_s__Popen;
|
|
static PyObject *__pyx_n_s__RuntimeError;
|
|
static PyObject *__pyx_n_s__STRUCT;
|
|
static PyObject *__pyx_n_s__Schema;
|
|
static PyObject *__pyx_n_s__StructNode;
|
|
static PyObject *__pyx_n_s__TEXT;
|
|
static PyObject *__pyx_n_s__TYPE_UNKOWN;
|
|
static PyObject *__pyx_n_s__TypeError;
|
|
static PyObject *__pyx_n_s__UINT;
|
|
static PyObject *__pyx_n_s__UNION;
|
|
static PyObject *__pyx_n_s__UNKNOWN;
|
|
static PyObject *__pyx_n_s__VOID;
|
|
static PyObject *__pyx_n_s__ValueError;
|
|
static PyObject *__pyx_n_s__Which;
|
|
static PyObject *__pyx_n_s___;
|
|
static PyObject *__pyx_n_s___Type;
|
|
static PyObject *__pyx_n_s____dict__;
|
|
static PyObject *__pyx_n_s____import__;
|
|
static PyObject *__pyx_n_s____main__;
|
|
static PyObject *__pyx_n_s____name__;
|
|
static PyObject *__pyx_n_s____pyx_vtable__;
|
|
static PyObject *__pyx_n_s____test__;
|
|
static PyObject *__pyx_n_s___get;
|
|
static PyObject *__pyx_n_s___has;
|
|
static PyObject *__pyx_n_s___load;
|
|
static PyObject *__pyx_n_s___loader;
|
|
static PyObject *__pyx_n_s___make_enum;
|
|
static PyObject *__pyx_n_s___parent_module;
|
|
static PyObject *__pyx_n_s___root_module;
|
|
static PyObject *__pyx_n_s___setitem;
|
|
static PyObject *__pyx_n_s__args;
|
|
static PyObject *__pyx_n_s__asStruct;
|
|
static PyObject *__pyx_n_s__bint;
|
|
static PyObject *__pyx_n_s__body;
|
|
static PyObject *__pyx_n_s__capitalize;
|
|
static PyObject *__pyx_n_s__capnp;
|
|
static PyObject *__pyx_n_s__capnpc;
|
|
static PyObject *__pyx_n_s__cat_path;
|
|
static PyObject *__pyx_n_s__close;
|
|
static PyObject *__pyx_n_s__defaults;
|
|
static PyObject *__pyx_n_s__displayName;
|
|
static PyObject *__pyx_n_s__double;
|
|
static PyObject *__pyx_n_s__enum;
|
|
static PyObject *__pyx_n_s__enumNode;
|
|
static PyObject *__pyx_n_s__enum_name;
|
|
static PyObject *__pyx_n_s__enumerants;
|
|
static PyObject *__pyx_n_s__enums;
|
|
static PyObject *__pyx_n_s__fd;
|
|
static PyObject *__pyx_n_s__field;
|
|
static PyObject *__pyx_n_s__file_name;
|
|
static PyObject *__pyx_n_s__fileno;
|
|
static PyObject *__pyx_n_s__float;
|
|
static PyObject *__pyx_n_s__genexpr;
|
|
static PyObject *__pyx_n_s__get;
|
|
static PyObject *__pyx_n_s__getDependency;
|
|
static PyObject *__pyx_n_s__getProto;
|
|
static PyObject *__pyx_n_s__getRoot;
|
|
static PyObject *__pyx_n_s__getRootNode;
|
|
static PyObject *__pyx_n_s__getType;
|
|
static PyObject *__pyx_n_s__id;
|
|
static PyObject *__pyx_n_s__index;
|
|
static PyObject *__pyx_n_s__init;
|
|
static PyObject *__pyx_n_s__initRoot;
|
|
static PyObject *__pyx_n_s__int;
|
|
static PyObject *__pyx_n_s__isUnion;
|
|
static PyObject *__pyx_n_s__isupper;
|
|
static PyObject *__pyx_n_s__iteritems;
|
|
static PyObject *__pyx_n_s__join;
|
|
static PyObject *__pyx_n_s__kwargs;
|
|
static PyObject *__pyx_n_s__letter;
|
|
static PyObject *__pyx_n_s__load;
|
|
static PyObject *__pyx_n_s__loader;
|
|
static PyObject *__pyx_n_s__local_module;
|
|
static PyObject *__pyx_n_s__long;
|
|
static PyObject *__pyx_n_s__lower;
|
|
static PyObject *__pyx_n_s__m;
|
|
static PyObject *__pyx_n_s__member;
|
|
static PyObject *__pyx_n_s__members;
|
|
static PyObject *__pyx_n_s__module;
|
|
static PyObject *__pyx_n_s__name;
|
|
static PyObject *__pyx_n_s__named;
|
|
static PyObject *__pyx_n_s__nestedNode;
|
|
static PyObject *__pyx_n_s__nestedNodes;
|
|
static PyObject *__pyx_n_s__new_m;
|
|
static PyObject *__pyx_n_s__node;
|
|
static PyObject *__pyx_n_s__nodes;
|
|
static PyObject *__pyx_n_s__p;
|
|
static PyObject *__pyx_n_s__range;
|
|
static PyObject *__pyx_n_s__re;
|
|
static PyObject *__pyx_n_s__reader;
|
|
static PyObject *__pyx_n_s__replace;
|
|
static PyObject *__pyx_n_s__request;
|
|
static PyObject *__pyx_n_s__ret;
|
|
static PyObject *__pyx_n_s__retcode;
|
|
static PyObject *__pyx_n_s__reverse;
|
|
static PyObject *__pyx_n_s__reverse_mapping;
|
|
static PyObject *__pyx_n_s__s;
|
|
static PyObject *__pyx_n_s__schema;
|
|
static PyObject *__pyx_n_s__self;
|
|
static PyObject *__pyx_n_s__send;
|
|
static PyObject *__pyx_n_s__sequential;
|
|
static PyObject *__pyx_n_s__size;
|
|
static PyObject *__pyx_n_s__split;
|
|
static PyObject *__pyx_n_s__startswith;
|
|
static PyObject *__pyx_n_s__stdout;
|
|
static PyObject *__pyx_n_s__strip;
|
|
static PyObject *__pyx_n_s__struct;
|
|
static PyObject *__pyx_n_s__structNode;
|
|
static PyObject *__pyx_n_s__sub_name;
|
|
static PyObject *__pyx_n_s__subprocess;
|
|
static PyObject *__pyx_n_s__temp;
|
|
static PyObject *__pyx_n_s__throw;
|
|
static PyObject *__pyx_n_s__toPython;
|
|
static PyObject *__pyx_n_s__types;
|
|
static PyObject *__pyx_n_s__unionMember;
|
|
static PyObject *__pyx_n_s__upper;
|
|
static PyObject *__pyx_n_s__upper_and_under;
|
|
static PyObject *__pyx_n_s__value;
|
|
static PyObject *__pyx_n_s__wait;
|
|
static PyObject *__pyx_n_s__which;
|
|
static PyObject *__pyx_n_s__writeMessageToFd;
|
|
static PyObject *__pyx_n_s__zip;
|
|
static PyObject *__pyx_int_0;
|
|
static PyObject *__pyx_int_1;
|
|
static PyObject *__pyx_int_5;
|
|
static PyObject *__pyx_k_36;
|
|
static PyObject *__pyx_k_tuple_2;
|
|
static PyObject *__pyx_k_tuple_3;
|
|
static PyObject *__pyx_k_tuple_7;
|
|
static PyObject *__pyx_k_tuple_9;
|
|
static PyObject *__pyx_k_slice_26;
|
|
static PyObject *__pyx_k_slice_33;
|
|
static PyObject *__pyx_k_slice_34;
|
|
static PyObject *__pyx_k_slice_38;
|
|
static PyObject *__pyx_k_tuple_11;
|
|
static PyObject *__pyx_k_tuple_13;
|
|
static PyObject *__pyx_k_tuple_14;
|
|
static PyObject *__pyx_k_tuple_15;
|
|
static PyObject *__pyx_k_tuple_16;
|
|
static PyObject *__pyx_k_tuple_18;
|
|
static PyObject *__pyx_k_tuple_20;
|
|
static PyObject *__pyx_k_tuple_21;
|
|
static PyObject *__pyx_k_tuple_22;
|
|
static PyObject *__pyx_k_tuple_23;
|
|
static PyObject *__pyx_k_tuple_24;
|
|
static PyObject *__pyx_k_tuple_25;
|
|
static PyObject *__pyx_k_tuple_29;
|
|
static PyObject *__pyx_k_tuple_30;
|
|
static PyObject *__pyx_k_tuple_44;
|
|
static PyObject *__pyx_k_tuple_46;
|
|
static PyObject *__pyx_k_tuple_50;
|
|
static PyObject *__pyx_k_tuple_51;
|
|
static PyObject *__pyx_k_tuple_54;
|
|
static PyObject *__pyx_k_tuple_56;
|
|
static PyObject *__pyx_k_tuple_59;
|
|
static PyObject *__pyx_k_tuple_61;
|
|
static PyObject *__pyx_k_tuple_63;
|
|
static PyObject *__pyx_k_tuple_65;
|
|
static PyObject *__pyx_k_codeobj_47;
|
|
static PyObject *__pyx_k_codeobj_52;
|
|
static PyObject *__pyx_k_codeobj_55;
|
|
static PyObject *__pyx_k_codeobj_57;
|
|
static PyObject *__pyx_k_codeobj_60;
|
|
static PyObject *__pyx_k_codeobj_62;
|
|
static PyObject *__pyx_k_codeobj_64;
|
|
static PyObject *__pyx_k_codeobj_66;
|
|
|
|
/* Python wrapper */
|
|
static PyObject *__pyx_pw_5capnp_1_make_enum(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
|
|
static PyMethodDef __pyx_mdef_5capnp_1_make_enum = {__Pyx_NAMESTR("_make_enum"), (PyCFunction)__pyx_pw_5capnp_1_make_enum, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)};
|
|
static PyObject *__pyx_pw_5capnp_1_make_enum(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
|
|
PyObject *__pyx_v_enum_name = 0;
|
|
PyObject *__pyx_v_sequential = 0;
|
|
PyObject *__pyx_v_named = 0;
|
|
int __pyx_lineno = 0;
|
|
const char *__pyx_filename = NULL;
|
|
int __pyx_clineno = 0;
|
|
PyObject *__pyx_r = 0;
|
|
__Pyx_RefNannyDeclarations
|
|
__Pyx_RefNannySetupContext("_make_enum (wrapper)", 0);
|
|
__pyx_v_named = PyDict_New(); if (unlikely(!__pyx_v_named)) return NULL;
|
|
__Pyx_GOTREF(__pyx_v_named);
|
|
if (PyTuple_GET_SIZE(__pyx_args) > 1) {
|
|
__pyx_v_sequential = PyTuple_GetSlice(__pyx_args, 1, PyTuple_GET_SIZE(__pyx_args));
|
|
if (unlikely(!__pyx_v_sequential)) {
|
|
__Pyx_DECREF(__pyx_v_named); __pyx_v_named = 0;
|
|
__Pyx_RefNannyFinishContext();
|
|
return NULL;
|
|
}
|
|
__Pyx_GOTREF(__pyx_v_sequential);
|
|
} else {
|
|
__pyx_v_sequential = __pyx_empty_tuple; __Pyx_INCREF(__pyx_empty_tuple);
|
|
}
|
|
{
|
|
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__enum_name,0};
|
|
PyObject* values[1] = {0};
|
|
if (unlikely(__pyx_kwds)) {
|
|
Py_ssize_t kw_args;
|
|
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
|
|
switch (pos_args) {
|
|
default:
|
|
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
|
|
case 0: break;
|
|
}
|
|
kw_args = PyDict_Size(__pyx_kwds);
|
|
switch (pos_args) {
|
|
case 0:
|
|
if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__enum_name)) != 0)) kw_args--;
|
|
else goto __pyx_L5_argtuple_error;
|
|
}
|
|
if (unlikely(kw_args > 0)) {
|
|
const Py_ssize_t used_pos_args = (pos_args < 1) ? pos_args : 1;
|
|
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, __pyx_v_named, values, used_pos_args, "_make_enum") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 39; __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_enum_name = values[0];
|
|
}
|
|
goto __pyx_L4_argument_unpacking_done;
|
|
__pyx_L5_argtuple_error:;
|
|
__Pyx_RaiseArgtupleInvalid("_make_enum", 0, 1, 1, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 39; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
|
|
__pyx_L3_error:;
|
|
__Pyx_DECREF(__pyx_v_sequential); __pyx_v_sequential = 0;
|
|
__Pyx_DECREF(__pyx_v_named); __pyx_v_named = 0;
|
|
__Pyx_AddTraceback("capnp._make_enum", __pyx_clineno, __pyx_lineno, __pyx_filename);
|
|
__Pyx_RefNannyFinishContext();
|
|
return NULL;
|
|
__pyx_L4_argument_unpacking_done:;
|
|
__pyx_r = __pyx_pf_5capnp__make_enum(__pyx_self, __pyx_v_enum_name, __pyx_v_sequential, __pyx_v_named);
|
|
__Pyx_XDECREF(__pyx_v_sequential);
|
|
__Pyx_XDECREF(__pyx_v_named);
|
|
__Pyx_RefNannyFinishContext();
|
|
return __pyx_r;
|
|
}
|
|
static PyObject *__pyx_gb_5capnp_10_make_enum_2generator(__pyx_GeneratorObject *__pyx_generator, PyObject *__pyx_sent_value); /* proto */
|
|
|
|
/* "capnp.pyx":41
|
|
* def _make_enum(enum_name, *sequential, **named):
|
|
* enums = dict(zip(sequential, range(len(sequential))), **named)
|
|
* reverse = dict((value, key) for key, value in enums.iteritems()) # <<<<<<<<<<<<<<
|
|
* enums['reverse_mapping'] = reverse
|
|
* return type(enum_name, (), enums)
|
|
*/
|
|
|
|
static PyObject *__pyx_pf_5capnp_10_make_enum_genexpr(PyObject *__pyx_self) {
|
|
struct __pyx_obj_5capnp___pyx_scope_struct_1_genexpr *__pyx_cur_scope;
|
|
PyObject *__pyx_r = NULL;
|
|
__Pyx_RefNannyDeclarations
|
|
int __pyx_lineno = 0;
|
|
const char *__pyx_filename = NULL;
|
|
int __pyx_clineno = 0;
|
|
__Pyx_RefNannySetupContext("genexpr", 0);
|
|
__pyx_cur_scope = (struct __pyx_obj_5capnp___pyx_scope_struct_1_genexpr *)__pyx_tp_new_5capnp___pyx_scope_struct_1_genexpr(__pyx_ptype_5capnp___pyx_scope_struct_1_genexpr, __pyx_empty_tuple, NULL);
|
|
if (unlikely(!__pyx_cur_scope)) {
|
|
__Pyx_RefNannyFinishContext();
|
|
return NULL;
|
|
}
|
|
__Pyx_GOTREF(__pyx_cur_scope);
|
|
__pyx_cur_scope->__pyx_outer_scope = (struct __pyx_obj_5capnp___pyx_scope_struct___make_enum *) __pyx_self;
|
|
__Pyx_INCREF(((PyObject *)__pyx_cur_scope->__pyx_outer_scope));
|
|
__Pyx_GIVEREF(__pyx_cur_scope->__pyx_outer_scope);
|
|
{
|
|
__pyx_GeneratorObject *gen = __Pyx_Generator_New((__pyx_generator_body_t) __pyx_gb_5capnp_10_make_enum_2generator, (PyObject *) __pyx_cur_scope); if (unlikely(!gen)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 41; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
|
|
__Pyx_DECREF(__pyx_cur_scope);
|
|
__Pyx_RefNannyFinishContext();
|
|
return (PyObject *) gen;
|
|
}
|
|
|
|
__pyx_r = Py_None; __Pyx_INCREF(Py_None);
|
|
goto __pyx_L0;
|
|
__pyx_L1_error:;
|
|
__Pyx_AddTraceback("capnp._make_enum.genexpr", __pyx_clineno, __pyx_lineno, __pyx_filename);
|
|
__pyx_r = NULL;
|
|
__pyx_L0:;
|
|
__Pyx_DECREF(((PyObject *)__pyx_cur_scope));
|
|
__Pyx_XGIVEREF(__pyx_r);
|
|
__Pyx_RefNannyFinishContext();
|
|
return __pyx_r;
|
|
}
|
|
|
|
static PyObject *__pyx_gb_5capnp_10_make_enum_2generator(__pyx_GeneratorObject *__pyx_generator, PyObject *__pyx_sent_value) /* generator body */
|
|
{
|
|
struct __pyx_obj_5capnp___pyx_scope_struct_1_genexpr *__pyx_cur_scope = ((struct __pyx_obj_5capnp___pyx_scope_struct_1_genexpr *)__pyx_generator->closure);
|
|
PyObject *__pyx_r = NULL;
|
|
PyObject *__pyx_t_1 = NULL;
|
|
Py_ssize_t __pyx_t_2;
|
|
Py_ssize_t __pyx_t_3;
|
|
int __pyx_t_4;
|
|
PyObject *__pyx_t_5 = NULL;
|
|
PyObject *__pyx_t_6 = NULL;
|
|
int __pyx_t_7;
|
|
int __pyx_lineno = 0;
|
|
const char *__pyx_filename = NULL;
|
|
int __pyx_clineno = 0;
|
|
__Pyx_RefNannyDeclarations
|
|
__Pyx_RefNannySetupContext("None", 0);
|
|
switch (__pyx_generator->resume_label) {
|
|
case 0: goto __pyx_L3_first_run;
|
|
case 1: goto __pyx_L6_resume_from_yield;
|
|
default: /* CPython raises the right error here */
|
|
__Pyx_RefNannyFinishContext();
|
|
return NULL;
|
|
}
|
|
__pyx_L3_first_run:;
|
|
if (unlikely(!__pyx_sent_value)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 41; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
|
|
__pyx_t_2 = 0;
|
|
if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_v_enums)) { __Pyx_RaiseClosureNameError("enums"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 41; __pyx_clineno = __LINE__; goto __pyx_L1_error;} }
|
|
if (unlikely(((PyObject *)__pyx_cur_scope->__pyx_outer_scope->__pyx_v_enums) == Py_None)) {
|
|
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "iteritems");
|
|
{__pyx_filename = __pyx_f[0]; __pyx_lineno = 41; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
|
|
}
|
|
__pyx_t_5 = __Pyx_dict_iterator(((PyObject *)__pyx_cur_scope->__pyx_outer_scope->__pyx_v_enums), 1, ((PyObject *)__pyx_n_s__iteritems), (&__pyx_t_3), (&__pyx_t_4)); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 41; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
|
|
__Pyx_GOTREF(__pyx_t_5);
|
|
__Pyx_XDECREF(__pyx_t_1);
|
|
__pyx_t_1 = __pyx_t_5;
|
|
__pyx_t_5 = 0;
|
|
while (1) {
|
|
__pyx_t_7 = __Pyx_dict_iter_next(__pyx_t_1, __pyx_t_3, &__pyx_t_2, &__pyx_t_5, &__pyx_t_6, NULL, __pyx_t_4);
|
|
if (unlikely(__pyx_t_7 == 0)) break;
|
|
if (unlikely(__pyx_t_7 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 41; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
|
|
__Pyx_GOTREF(__pyx_t_5);
|
|
__Pyx_GOTREF(__pyx_t_6);
|
|
__Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_key);
|
|
__Pyx_XDECREF(__pyx_cur_scope->__pyx_v_key);
|
|
__Pyx_GIVEREF(__pyx_t_5);
|
|
__pyx_cur_scope->__pyx_v_key = __pyx_t_5;
|
|
__pyx_t_5 = 0;
|
|
__Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_value);
|
|
__Pyx_XDECREF(__pyx_cur_scope->__pyx_v_value);
|
|
__Pyx_GIVEREF(__pyx_t_6);
|
|
__pyx_cur_scope->__pyx_v_value = __pyx_t_6;
|
|
__pyx_t_6 = 0;
|
|
__pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 41; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
|
|
__Pyx_GOTREF(__pyx_t_6);
|
|
__Pyx_INCREF(__pyx_cur_scope->__pyx_v_value);
|
|
PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_cur_scope->__pyx_v_value);
|
|
__Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_value);
|
|
__Pyx_INCREF(__pyx_cur_scope->__pyx_v_key);
|
|
PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_cur_scope->__pyx_v_key);
|
|
__Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_key);
|
|
__pyx_r = ((PyObject *)__pyx_t_6);
|
|
__pyx_t_6 = 0;
|
|
__Pyx_XGIVEREF(__pyx_t_1);
|
|
__pyx_cur_scope->__pyx_t_0 = __pyx_t_1;
|
|
__pyx_cur_scope->__pyx_t_1 = __pyx_t_2;
|
|
__pyx_cur_scope->__pyx_t_2 = __pyx_t_3;
|
|
__pyx_cur_scope->__pyx_t_3 = __pyx_t_4;
|
|
__Pyx_XGIVEREF(__pyx_r);
|
|
__Pyx_RefNannyFinishContext();
|
|
/* return from generator, yielding value */
|
|
__pyx_generator->resume_label = 1;
|
|
return __pyx_r;
|
|
__pyx_L6_resume_from_yield:;
|
|
__pyx_t_1 = __pyx_cur_scope->__pyx_t_0;
|
|
__pyx_cur_scope->__pyx_t_0 = 0;
|
|
__Pyx_XGOTREF(__pyx_t_1);
|
|
__pyx_t_2 = __pyx_cur_scope->__pyx_t_1;
|
|
__pyx_t_3 = __pyx_cur_scope->__pyx_t_2;
|
|
__pyx_t_4 = __pyx_cur_scope->__pyx_t_3;
|
|
if (unlikely(!__pyx_sent_value)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 41; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
|
|
}
|
|
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
|
|
PyErr_SetNone(PyExc_StopIteration);
|
|
goto __pyx_L0;
|
|
__pyx_L1_error:;
|
|
__Pyx_XDECREF(__pyx_t_1);
|
|
__Pyx_XDECREF(__pyx_t_5);
|
|
__Pyx_XDECREF(__pyx_t_6);
|
|
__Pyx_AddTraceback("genexpr", __pyx_clineno, __pyx_lineno, __pyx_filename);
|
|
__pyx_L0:;
|
|
__Pyx_XDECREF(__pyx_r);
|
|
__pyx_generator->resume_label = -1;
|
|
__Pyx_Generator_clear((PyObject*)__pyx_generator);
|
|
__Pyx_RefNannyFinishContext();
|
|
return NULL;
|
|
}
|
|
|
|
/* "capnp.pyx":39
|
|
* cython.p_char
|
|
*
|
|
* def _make_enum(enum_name, *sequential, **named): # <<<<<<<<<<<<<<
|
|
* enums = dict(zip(sequential, range(len(sequential))), **named)
|
|
* reverse = dict((value, key) for key, value in enums.iteritems())
|
|
*/
|
|
|
|
static PyObject *__pyx_pf_5capnp__make_enum(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_enum_name, PyObject *__pyx_v_sequential, PyObject *__pyx_v_named) {
|
|
struct __pyx_obj_5capnp___pyx_scope_struct___make_enum *__pyx_cur_scope;
|
|
PyObject *__pyx_v_reverse = NULL;
|
|
PyObject *__pyx_r = NULL;
|
|
__Pyx_RefNannyDeclarations
|
|
Py_ssize_t __pyx_t_1;
|
|
PyObject *__pyx_t_2 = NULL;
|
|
PyObject *__pyx_t_3 = NULL;
|
|
PyObject *__pyx_t_4 = NULL;
|
|
int __pyx_lineno = 0;
|
|
const char *__pyx_filename = NULL;
|
|
int __pyx_clineno = 0;
|
|
__Pyx_RefNannySetupContext("_make_enum", 0);
|
|
__pyx_cur_scope = (struct __pyx_obj_5capnp___pyx_scope_struct___make_enum *)__pyx_tp_new_5capnp___pyx_scope_struct___make_enum(__pyx_ptype_5capnp___pyx_scope_struct___make_enum, __pyx_empty_tuple, NULL);
|
|
if (unlikely(!__pyx_cur_scope)) {
|
|
__Pyx_RefNannyFinishContext();
|
|
return NULL;
|
|
}
|
|
__Pyx_GOTREF(__pyx_cur_scope);
|
|
|
|
/* "capnp.pyx":40
|
|
*
|
|
* def _make_enum(enum_name, *sequential, **named):
|
|
* enums = dict(zip(sequential, range(len(sequential))), **named) # <<<<<<<<<<<<<<
|
|
* reverse = dict((value, key) for key, value in enums.iteritems())
|
|
* enums['reverse_mapping'] = reverse
|
|
*/
|
|
__pyx_t_1 = PyTuple_GET_SIZE(((PyObject *)__pyx_v_sequential)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 40; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
|
|
__pyx_t_2 = PyInt_FromSsize_t(__pyx_t_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 40; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
|
|
__Pyx_GOTREF(__pyx_t_2);
|
|
__pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 40; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
|
|
__Pyx_GOTREF(__pyx_t_3);
|
|
PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2);
|
|
__Pyx_GIVEREF(__pyx_t_2);
|
|
__pyx_t_2 = 0;
|
|
__pyx_t_2 = PyObject_Call(__pyx_builtin_range, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 40; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
|
|
__Pyx_GOTREF(__pyx_t_2);
|
|
__Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
|
|
__pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 40; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
|
|
__Pyx_GOTREF(__pyx_t_3);
|
|
__Pyx_INCREF(((PyObject *)__pyx_v_sequential));
|
|
PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_v_sequential));
|
|
__Pyx_GIVEREF(((PyObject *)__pyx_v_sequential));
|
|
PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_2);
|
|
__Pyx_GIVEREF(__pyx_t_2);
|
|
__pyx_t_2 = 0;
|
|
__pyx_t_2 = PyObject_Call(__pyx_builtin_zip, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 40; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
|
|
__Pyx_GOTREF(__pyx_t_2);
|
|
__Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
|
|
__pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 40; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
|
|
__Pyx_GOTREF(__pyx_t_3);
|
|
PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2);
|
|
__Pyx_GIVEREF(__pyx_t_2);
|
|
__pyx_t_2 = 0;
|
|
__pyx_t_2 = ((PyObject *)__pyx_v_named);
|
|
__Pyx_INCREF(__pyx_t_2);
|
|
__pyx_t_4 = PyObject_Call(((PyObject *)((PyObject*)(&PyDict_Type))), ((PyObject *)__pyx_t_3), ((PyObject *)__pyx_t_2)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 40; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
|
|
__Pyx_GOTREF(__pyx_t_4);
|
|
__Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
|
|
__Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
|
|
if (!(likely(PyDict_CheckExact(__pyx_t_4))||((__pyx_t_4) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected dict, got %.200s", Py_TYPE(__pyx_t_4)->tp_name), 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 40; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
|
|
__Pyx_GIVEREF(__pyx_t_4);
|
|
__pyx_cur_scope->__pyx_v_enums = ((PyObject*)__pyx_t_4);
|
|
__pyx_t_4 = 0;
|
|
|
|
/* "capnp.pyx":41
|
|
* def _make_enum(enum_name, *sequential, **named):
|
|
* enums = dict(zip(sequential, range(len(sequential))), **named)
|
|
* reverse = dict((value, key) for key, value in enums.iteritems()) # <<<<<<<<<<<<<<
|
|
* enums['reverse_mapping'] = reverse
|
|
* return type(enum_name, (), enums)
|
|
*/
|
|
__pyx_t_4 = __pyx_pf_5capnp_10_make_enum_genexpr(((PyObject*)__pyx_cur_scope)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 41; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
|
|
__Pyx_GOTREF(__pyx_t_4);
|
|
__pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 41; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
|
|
__Pyx_GOTREF(__pyx_t_2);
|
|
PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_4);
|
|
__Pyx_GIVEREF(__pyx_t_4);
|
|
__pyx_t_4 = 0;
|
|
__pyx_t_4 = PyObject_Call(((PyObject *)((PyObject*)(&PyDict_Type))), ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 41; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
|
|
__Pyx_GOTREF(__pyx_t_4);
|
|
__Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
|
|
__pyx_v_reverse = ((PyObject*)__pyx_t_4);
|
|
__pyx_t_4 = 0;
|
|
|
|
/* "capnp.pyx":42
|
|
* enums = dict(zip(sequential, range(len(sequential))), **named)
|
|
* reverse = dict((value, key) for key, value in enums.iteritems())
|
|
* enums['reverse_mapping'] = reverse # <<<<<<<<<<<<<<
|
|
* return type(enum_name, (), enums)
|
|
*
|
|
*/
|
|
if (unlikely(((PyObject *)__pyx_cur_scope->__pyx_v_enums) == Py_None)) {
|
|
PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
|
|
{__pyx_filename = __pyx_f[0]; __pyx_lineno = 42; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
|
|
}
|
|
if (PyDict_SetItem(((PyObject *)__pyx_cur_scope->__pyx_v_enums), ((PyObject *)__pyx_n_s__reverse_mapping), ((PyObject *)__pyx_v_reverse)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 42; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
|
|
|
|
/* "capnp.pyx":43
|
|
* reverse = dict((value, key) for key, value in enums.iteritems())
|
|
* enums['reverse_mapping'] = reverse
|
|
* return type(enum_name, (), enums) # <<<<<<<<<<<<<<
|
|
*
|
|
* _Type = _make_enum('DynamicValue.Type',
|
|
*/
|
|
__Pyx_XDECREF(__pyx_r);
|
|
__pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 43; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
|
|
__Pyx_GOTREF(__pyx_t_4);
|
|
__Pyx_INCREF(__pyx_v_enum_name);
|
|
PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_enum_name);
|
|
__Pyx_GIVEREF(__pyx_v_enum_name);
|
|
__Pyx_INCREF(((PyObject *)__pyx_empty_tuple));
|
|
PyTuple_SET_ITEM(__pyx_t_4, 1, ((PyObject *)__pyx_empty_tuple));
|
|
__Pyx_GIVEREF(((PyObject *)__pyx_empty_tuple));
|
|
__Pyx_INCREF(((PyObject *)__pyx_cur_scope->__pyx_v_enums));
|
|
PyTuple_SET_ITEM(__pyx_t_4, 2, ((PyObject *)__pyx_cur_scope->__pyx_v_enums));
|
|
__Pyx_GIVEREF(((PyObject *)__pyx_cur_scope->__pyx_v_enums));
|
|
__pyx_t_2 = PyObject_Call(((PyObject *)((PyObject*)(&PyType_Type))), ((PyObject *)__pyx_t_4), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 43; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
|
|
__Pyx_GOTREF(__pyx_t_2);
|
|
__Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
|
|
__pyx_r = __pyx_t_2;
|
|
__pyx_t_2 = 0;
|
|
goto __pyx_L0;
|
|
|
|
__pyx_r = Py_None; __Pyx_INCREF(Py_None);
|
|
goto __pyx_L0;
|
|
__pyx_L1_error:;
|
|
__Pyx_XDECREF(__pyx_t_2);
|
|
__Pyx_XDECREF(__pyx_t_3);
|
|
__Pyx_XDECREF(__pyx_t_4);
|
|
__Pyx_AddTraceback("capnp._make_enum", __pyx_clineno, __pyx_lineno, __pyx_filename);
|
|
__pyx_r = NULL;
|
|
__pyx_L0:;
|
|
__Pyx_XDECREF(__pyx_v_reverse);
|
|
__Pyx_DECREF(((PyObject *)__pyx_cur_scope));
|
|
__Pyx_XGIVEREF(__pyx_r);
|
|
__Pyx_RefNannyFinishContext();
|
|
return __pyx_r;
|
|
}
|
|
|
|
/* "capnp.pyx":72
|
|
* cdef class _DynamicListReader:
|
|
* cdef C_DynamicList.Reader thisptr
|
|
* cdef _init(self, C_DynamicList.Reader other): # <<<<<<<<<<<<<<
|
|
* self.thisptr = other
|
|
* return self
|
|
*/
|
|
|
|
static PyObject *__pyx_f_5capnp_18_DynamicListReader__init(struct __pyx_obj_5capnp__DynamicListReader *__pyx_v_self, ::capnp::DynamicList::Reader __pyx_v_other) {
|
|
PyObject *__pyx_r = NULL;
|
|
__Pyx_RefNannyDeclarations
|
|
__Pyx_RefNannySetupContext("_init", 0);
|
|
|
|
/* "capnp.pyx":73
|
|
* cdef C_DynamicList.Reader thisptr
|
|
* cdef _init(self, C_DynamicList.Reader other):
|
|
* self.thisptr = other # <<<<<<<<<<<<<<
|
|
* return self
|
|
*
|
|
*/
|
|
__pyx_v_self->thisptr = __pyx_v_other;
|
|
|
|
/* "capnp.pyx":74
|
|
* cdef _init(self, C_DynamicList.Reader other):
|
|
* self.thisptr = other
|
|
* return self # <<<<<<<<<<<<<<
|
|
*
|
|
* cpdef _get(self, index):
|
|
*/
|
|
__Pyx_XDECREF(__pyx_r);
|
|
__Pyx_INCREF(((PyObject *)__pyx_v_self));
|
|
__pyx_r = ((PyObject *)__pyx_v_self);
|
|
goto __pyx_L0;
|
|
|
|
__pyx_r = Py_None; __Pyx_INCREF(Py_None);
|
|
__pyx_L0:;
|
|
__Pyx_XGIVEREF(__pyx_r);
|
|
__Pyx_RefNannyFinishContext();
|
|
return __pyx_r;
|
|
}
|
|
|
|
/* "capnp.pyx":76
|
|
* return self
|
|
*
|
|
* cpdef _get(self, index): # <<<<<<<<<<<<<<
|
|
* size = self.thisptr.size()
|
|
* if index >= size:
|
|
*/
|
|
|
|
static PyObject *__pyx_pw_5capnp_18_DynamicListReader_1_get(PyObject *__pyx_v_self, PyObject *__pyx_v_index); /*proto*/
|
|
static PyObject *__pyx_f_5capnp_18_DynamicListReader__get(struct __pyx_obj_5capnp__DynamicListReader *__pyx_v_self, PyObject *__pyx_v_index, int __pyx_skip_dispatch) {
|
|
PyObject *__pyx_v_size = NULL;
|
|
PyObject *__pyx_r = NULL;
|
|
__Pyx_RefNannyDeclarations
|
|
PyObject *__pyx_t_1 = NULL;
|
|
PyObject *__pyx_t_2 = NULL;
|
|
PyObject *__pyx_t_3 = NULL;
|
|
int __pyx_t_4;
|
|
__pyx_t_9capnp_cpp_uint __pyx_t_5;
|
|
int __pyx_lineno = 0;
|
|
const char *__pyx_filename = NULL;
|
|
int __pyx_clineno = 0;
|
|
__Pyx_RefNannySetupContext("_get", 0);
|
|
__Pyx_INCREF(__pyx_v_index);
|
|
/* Check if called by wrapper */
|
|
if (unlikely(__pyx_skip_dispatch)) ;
|
|
/* Check if overridden in Python */
|
|
else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
|
|
__pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s___get); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 76; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
|
|
__Pyx_GOTREF(__pyx_t_1);
|
|
if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_5capnp_18_DynamicListReader_1_get)) {
|
|
__Pyx_XDECREF(__pyx_r);
|
|
__pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 76; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
|
|
__Pyx_GOTREF(__pyx_t_2);
|
|
__Pyx_INCREF(__pyx_v_index);
|
|
PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_index);
|
|
__Pyx_GIVEREF(__pyx_v_index);
|
|
__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 = 76; __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;
|
|
__pyx_t_3 = 0;
|
|
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
|
|
goto __pyx_L0;
|
|
}
|
|
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
|
|
}
|
|
|
|
/* "capnp.pyx":77
|
|
*
|
|
* cpdef _get(self, index):
|
|
* size = self.thisptr.size() # <<<<<<<<<<<<<<
|
|
* if index >= size:
|
|
* raise IndexError('Out of bounds')
|
|
*/
|
|
__pyx_t_1 = PyLong_FromUnsignedLong(__pyx_v_self->thisptr.size()); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 77; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
|
|
__Pyx_GOTREF(__pyx_t_1);
|
|
__pyx_v_size = __pyx_t_1;
|
|
__pyx_t_1 = 0;
|
|
|
|
/* "capnp.pyx":78
|
|
* cpdef _get(self, index):
|
|
* size = self.thisptr.size()
|
|
* if index >= size: # <<<<<<<<<<<<<<
|
|
* raise IndexError('Out of bounds')
|
|
* index = index % size
|
|
*/
|
|
__pyx_t_1 = PyObject_RichCompare(__pyx_v_index, __pyx_v_size, Py_GE); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 78; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
|
|
__pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 78; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
|
|
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
|
|
if (__pyx_t_4) {
|
|
|
|
/* "capnp.pyx":79
|
|
* size = self.thisptr.size()
|
|
* if index >= size:
|
|
* raise IndexError('Out of bounds') # <<<<<<<<<<<<<<
|
|
* index = index % size
|
|
* return _DynamicValueReader()._init(self.thisptr[index])
|
|
*/
|
|
__pyx_t_1 = PyObject_Call(__pyx_builtin_IndexError, ((PyObject *)__pyx_k_tuple_2), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 79; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
|
|
__Pyx_GOTREF(__pyx_t_1);
|
|
__Pyx_Raise(__pyx_t_1, 0, 0, 0);
|
|
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
|
|
{__pyx_filename = __pyx_f[0]; __pyx_lineno = 79; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
|
|
goto __pyx_L3;
|
|
}
|
|
__pyx_L3:;
|
|
|
|
/* "capnp.pyx":80
|
|
* if index >= size:
|
|
* raise IndexError('Out of bounds')
|
|
* index = index % size # <<<<<<<<<<<<<<
|
|
* return _DynamicValueReader()._init(self.thisptr[index])
|
|
*
|
|
*/
|
|
__pyx_t_1 = PyNumber_Remainder(__pyx_v_index, __pyx_v_size); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 80; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
|
|
__Pyx_GOTREF(__pyx_t_1);
|
|
__Pyx_DECREF(__pyx_v_index);
|
|
__pyx_v_index = __pyx_t_1;
|
|
__pyx_t_1 = 0;
|
|
|
|
/* "capnp.pyx":81
|
|
* raise IndexError('Out of bounds')
|
|
* index = index % size
|
|
* return _DynamicValueReader()._init(self.thisptr[index]) # <<<<<<<<<<<<<<
|
|
*
|
|
* def __getitem__(self, index):
|
|
*/
|
|
__Pyx_XDECREF(__pyx_r);
|
|
__pyx_t_1 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_5capnp__DynamicValueReader)), ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 81; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
|
|
__Pyx_GOTREF(__pyx_t_1);
|
|
__pyx_t_5 = __Pyx_PyInt_AsUnsignedInt(__pyx_v_index); if (unlikely((__pyx_t_5 == (unsigned int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 81; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
|
|
__pyx_t_3 = ((struct __pyx_vtabstruct_5capnp__DynamicValueReader *)((struct __pyx_obj_5capnp__DynamicValueReader *)__pyx_t_1)->__pyx_vtab)->_init(((struct __pyx_obj_5capnp__DynamicValueReader *)__pyx_t_1), (( ::capnp::DynamicValue::Reader)(__pyx_v_self->thisptr[__pyx_t_5]))); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 81; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
|
|
__Pyx_GOTREF(__pyx_t_3);
|
|
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
|
|
__pyx_r = __pyx_t_3;
|
|
__pyx_t_3 = 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("capnp._DynamicListReader._get", __pyx_clineno, __pyx_lineno, __pyx_filename);
|
|
__pyx_r = 0;
|
|
__pyx_L0:;
|
|
__Pyx_XDECREF(__pyx_v_size);
|
|
__Pyx_XDECREF(__pyx_v_index);
|
|
__Pyx_XGIVEREF(__pyx_r);
|
|
__Pyx_RefNannyFinishContext();
|
|
return __pyx_r;
|
|
}
|
|
|
|
/* Python wrapper */
|
|
static PyObject *__pyx_pw_5capnp_18_DynamicListReader_1_get(PyObject *__pyx_v_self, PyObject *__pyx_v_index); /*proto*/
|
|
static PyObject *__pyx_pw_5capnp_18_DynamicListReader_1_get(PyObject *__pyx_v_self, PyObject *__pyx_v_index) {
|
|
PyObject *__pyx_r = 0;
|
|
__Pyx_RefNannyDeclarations
|
|
__Pyx_RefNannySetupContext("_get (wrapper)", 0);
|
|
__pyx_r = __pyx_pf_5capnp_18_DynamicListReader__get(((struct __pyx_obj_5capnp__DynamicListReader *)__pyx_v_self), ((PyObject *)__pyx_v_index));
|
|
__Pyx_RefNannyFinishContext();
|
|
return __pyx_r;
|
|
}
|
|
|
|
/* "capnp.pyx":76
|
|
* return self
|
|
*
|
|
* cpdef _get(self, index): # <<<<<<<<<<<<<<
|
|
* size = self.thisptr.size()
|
|
* if index >= size:
|
|
*/
|
|
|
|
static PyObject *__pyx_pf_5capnp_18_DynamicListReader__get(struct __pyx_obj_5capnp__DynamicListReader *__pyx_v_self, PyObject *__pyx_v_index) {
|
|
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("_get", 0);
|
|
__Pyx_XDECREF(__pyx_r);
|
|
__pyx_t_1 = ((struct __pyx_vtabstruct_5capnp__DynamicListReader *)__pyx_v_self->__pyx_vtab)->_get(__pyx_v_self, __pyx_v_index, 1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 76; __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("capnp._DynamicListReader._get", __pyx_clineno, __pyx_lineno, __pyx_filename);
|
|
__pyx_r = NULL;
|
|
__pyx_L0:;
|
|
__Pyx_XGIVEREF(__pyx_r);
|
|
__Pyx_RefNannyFinishContext();
|
|
return __pyx_r;
|
|
}
|
|
|
|
/* Python wrapper */
|
|
static PyObject *__pyx_pw_5capnp_18_DynamicListReader_3__getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_index); /*proto*/
|
|
static PyObject *__pyx_pw_5capnp_18_DynamicListReader_3__getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_index) {
|
|
PyObject *__pyx_r = 0;
|
|
__Pyx_RefNannyDeclarations
|
|
__Pyx_RefNannySetupContext("__getitem__ (wrapper)", 0);
|
|
__pyx_r = __pyx_pf_5capnp_18_DynamicListReader_2__getitem__(((struct __pyx_obj_5capnp__DynamicListReader *)__pyx_v_self), ((PyObject *)__pyx_v_index));
|
|
__Pyx_RefNannyFinishContext();
|
|
return __pyx_r;
|
|
}
|
|
|
|
/* "capnp.pyx":83
|
|
* return _DynamicValueReader()._init(self.thisptr[index])
|
|
*
|
|
* def __getitem__(self, index): # <<<<<<<<<<<<<<
|
|
* return self._get(index).toPython()
|
|
*
|
|
*/
|
|
|
|
static PyObject *__pyx_pf_5capnp_18_DynamicListReader_2__getitem__(struct __pyx_obj_5capnp__DynamicListReader *__pyx_v_self, PyObject *__pyx_v_index) {
|
|
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("__getitem__", 0);
|
|
|
|
/* "capnp.pyx":84
|
|
*
|
|
* def __getitem__(self, index):
|
|
* return self._get(index).toPython() # <<<<<<<<<<<<<<
|
|
*
|
|
* def __len__(self):
|
|
*/
|
|
__Pyx_XDECREF(__pyx_r);
|
|
__pyx_t_1 = ((struct __pyx_vtabstruct_5capnp__DynamicListReader *)__pyx_v_self->__pyx_vtab)->_get(__pyx_v_self, __pyx_v_index, 0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 84; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
|
|
__Pyx_GOTREF(__pyx_t_1);
|
|
__pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s__toPython); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 84; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
|
|
__Pyx_GOTREF(__pyx_t_2);
|
|
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
|
|
__pyx_t_1 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 84; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
|
|
__Pyx_GOTREF(__pyx_t_1);
|
|
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
|
|
__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("capnp._DynamicListReader.__getitem__", __pyx_clineno, __pyx_lineno, __pyx_filename);
|
|
__pyx_r = NULL;
|
|
__pyx_L0:;
|
|
__Pyx_XGIVEREF(__pyx_r);
|
|
__Pyx_RefNannyFinishContext();
|
|
return __pyx_r;
|
|
}
|
|
|
|
/* Python wrapper */
|
|
static Py_ssize_t __pyx_pw_5capnp_18_DynamicListReader_5__len__(PyObject *__pyx_v_self); /*proto*/
|
|
static Py_ssize_t __pyx_pw_5capnp_18_DynamicListReader_5__len__(PyObject *__pyx_v_self) {
|
|
Py_ssize_t __pyx_r;
|
|
__Pyx_RefNannyDeclarations
|
|
__Pyx_RefNannySetupContext("__len__ (wrapper)", 0);
|
|
__pyx_r = __pyx_pf_5capnp_18_DynamicListReader_4__len__(((struct __pyx_obj_5capnp__DynamicListReader *)__pyx_v_self));
|
|
__Pyx_RefNannyFinishContext();
|
|
return __pyx_r;
|
|
}
|
|
|
|
/* "capnp.pyx":86
|
|
* return self._get(index).toPython()
|
|
*
|
|
* def __len__(self): # <<<<<<<<<<<<<<
|
|
* return self.thisptr.size()
|
|
*
|
|
*/
|
|
|
|
static Py_ssize_t __pyx_pf_5capnp_18_DynamicListReader_4__len__(struct __pyx_obj_5capnp__DynamicListReader *__pyx_v_self) {
|
|
Py_ssize_t __pyx_r;
|
|
__Pyx_RefNannyDeclarations
|
|
__Pyx_RefNannySetupContext("__len__", 0);
|
|
|
|
/* "capnp.pyx":87
|
|
*
|
|
* def __len__(self):
|
|
* return self.thisptr.size() # <<<<<<<<<<<<<<
|
|
*
|
|
* cdef class _DynamicListBuilder:
|
|
*/
|
|
__pyx_r = __pyx_v_self->thisptr.size();
|
|
goto __pyx_L0;
|
|
|
|
__pyx_r = 0;
|
|
__pyx_L0:;
|
|
__Pyx_RefNannyFinishContext();
|
|
return __pyx_r;
|
|
}
|
|
|
|
/* "capnp.pyx":91
|
|
* cdef class _DynamicListBuilder:
|
|
* cdef C_DynamicList.Builder thisptr
|
|
* cdef _init(self, C_DynamicList.Builder other): # <<<<<<<<<<<<<<
|
|
* self.thisptr = other
|
|
* return self
|
|
*/
|
|
|
|
static PyObject *__pyx_f_5capnp_19_DynamicListBuilder__init(struct __pyx_obj_5capnp__DynamicListBuilder *__pyx_v_self, ::capnp::DynamicList::Builder __pyx_v_other) {
|
|
PyObject *__pyx_r = NULL;
|
|
__Pyx_RefNannyDeclarations
|
|
__Pyx_RefNannySetupContext("_init", 0);
|
|
|
|
/* "capnp.pyx":92
|
|
* cdef C_DynamicList.Builder thisptr
|
|
* cdef _init(self, C_DynamicList.Builder other):
|
|
* self.thisptr = other # <<<<<<<<<<<<<<
|
|
* return self
|
|
*
|
|
*/
|
|
__pyx_v_self->thisptr = __pyx_v_other;
|
|
|
|
/* "capnp.pyx":93
|
|
* cdef _init(self, C_DynamicList.Builder other):
|
|
* self.thisptr = other
|
|
* return self # <<<<<<<<<<<<<<
|
|
*
|
|
* #def _init(self, size):
|
|
*/
|
|
__Pyx_XDECREF(__pyx_r);
|
|
__Pyx_INCREF(((PyObject *)__pyx_v_self));
|
|
__pyx_r = ((PyObject *)__pyx_v_self);
|
|
goto __pyx_L0;
|
|
|
|
__pyx_r = Py_None; __Pyx_INCREF(Py_None);
|
|
__pyx_L0:;
|
|
__Pyx_XGIVEREF(__pyx_r);
|
|
__Pyx_RefNannyFinishContext();
|
|
return __pyx_r;
|
|
}
|
|
|
|
/* Python wrapper */
|
|
static PyObject *__pyx_pw_5capnp_19_DynamicListBuilder_1__getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_index); /*proto*/
|
|
static PyObject *__pyx_pw_5capnp_19_DynamicListBuilder_1__getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_index) {
|
|
PyObject *__pyx_r = 0;
|
|
__Pyx_RefNannyDeclarations
|
|
__Pyx_RefNannySetupContext("__getitem__ (wrapper)", 0);
|
|
__pyx_r = __pyx_pf_5capnp_19_DynamicListBuilder___getitem__(((struct __pyx_obj_5capnp__DynamicListBuilder *)__pyx_v_self), ((PyObject *)__pyx_v_index));
|
|
__Pyx_RefNannyFinishContext();
|
|
return __pyx_r;
|
|
}
|
|
|
|
/* "capnp.pyx":99
|
|
* # return self
|
|
*
|
|
* def __getitem__(self, index): # <<<<<<<<<<<<<<
|
|
* size = self.thisptr.size()
|
|
* if index >= size:
|
|
*/
|
|
|
|
static PyObject *__pyx_pf_5capnp_19_DynamicListBuilder___getitem__(struct __pyx_obj_5capnp__DynamicListBuilder *__pyx_v_self, PyObject *__pyx_v_index) {
|
|
PyObject *__pyx_v_size = NULL;
|
|
::capnp::DynamicValue::Builder __pyx_v_temp;
|
|
PyObject *__pyx_r = NULL;
|
|
__Pyx_RefNannyDeclarations
|
|
PyObject *__pyx_t_1 = NULL;
|
|
int __pyx_t_2;
|
|
__pyx_t_9capnp_cpp_uint __pyx_t_3;
|
|
int __pyx_lineno = 0;
|
|
const char *__pyx_filename = NULL;
|
|
int __pyx_clineno = 0;
|
|
__Pyx_RefNannySetupContext("__getitem__", 0);
|
|
__Pyx_INCREF(__pyx_v_index);
|
|
|
|
/* "capnp.pyx":100
|
|
*
|
|
* def __getitem__(self, index):
|
|
* size = self.thisptr.size() # <<<<<<<<<<<<<<
|
|
* if index >= size:
|
|
* raise IndexError('Out of bounds')
|
|
*/
|
|
__pyx_t_1 = PyLong_FromUnsignedLong(__pyx_v_self->thisptr.size()); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 100; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
|
|
__Pyx_GOTREF(__pyx_t_1);
|
|
__pyx_v_size = __pyx_t_1;
|
|
__pyx_t_1 = 0;
|
|
|
|
/* "capnp.pyx":101
|
|
* def __getitem__(self, index):
|
|
* size = self.thisptr.size()
|
|
* if index >= size: # <<<<<<<<<<<<<<
|
|
* raise IndexError('Out of bounds')
|
|
* index = index % size
|
|
*/
|
|
__pyx_t_1 = PyObject_RichCompare(__pyx_v_index, __pyx_v_size, Py_GE); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 101; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
|
|
__pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 101; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
|
|
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
|
|
if (__pyx_t_2) {
|
|
|
|
/* "capnp.pyx":102
|
|
* size = self.thisptr.size()
|
|
* if index >= size:
|
|
* raise IndexError('Out of bounds') # <<<<<<<<<<<<<<
|
|
* index = index % size
|
|
* temp = self.thisptr[index]
|
|
*/
|
|
__pyx_t_1 = PyObject_Call(__pyx_builtin_IndexError, ((PyObject *)__pyx_k_tuple_3), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 102; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
|
|
__Pyx_GOTREF(__pyx_t_1);
|
|
__Pyx_Raise(__pyx_t_1, 0, 0, 0);
|
|
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
|
|
{__pyx_filename = __pyx_f[0]; __pyx_lineno = 102; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
|
|
goto __pyx_L3;
|
|
}
|
|
__pyx_L3:;
|
|
|
|
/* "capnp.pyx":103
|
|
* if index >= size:
|
|
* raise IndexError('Out of bounds')
|
|
* index = index % size # <<<<<<<<<<<<<<
|
|
* temp = self.thisptr[index]
|
|
* return toPython(temp)
|
|
*/
|
|
__pyx_t_1 = PyNumber_Remainder(__pyx_v_index, __pyx_v_size); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 103; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
|
|
__Pyx_GOTREF(__pyx_t_1);
|
|
__Pyx_DECREF(__pyx_v_index);
|
|
__pyx_v_index = __pyx_t_1;
|
|
__pyx_t_1 = 0;
|
|
|
|
/* "capnp.pyx":104
|
|
* raise IndexError('Out of bounds')
|
|
* index = index % size
|
|
* temp = self.thisptr[index] # <<<<<<<<<<<<<<
|
|
* return toPython(temp)
|
|
*
|
|
*/
|
|
__pyx_t_3 = __Pyx_PyInt_AsUnsignedInt(__pyx_v_index); if (unlikely((__pyx_t_3 == (unsigned int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 104; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
|
|
__pyx_v_temp = (__pyx_v_self->thisptr[__pyx_t_3]);
|
|
|
|
/* "capnp.pyx":105
|
|
* index = index % size
|
|
* temp = self.thisptr[index]
|
|
* return toPython(temp) # <<<<<<<<<<<<<<
|
|
*
|
|
* def _setitem(self, index, valid_values value):
|
|
*/
|
|
__Pyx_XDECREF(__pyx_r);
|
|
__pyx_t_1 = __pyx_f_5capnp_toPython((( ::capnp::DynamicValue::Builder &)__pyx_v_temp)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 105; __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("capnp._DynamicListBuilder.__getitem__", __pyx_clineno, __pyx_lineno, __pyx_filename);
|
|
__pyx_r = NULL;
|
|
__pyx_L0:;
|
|
__Pyx_XDECREF(__pyx_v_size);
|
|
__Pyx_XDECREF(__pyx_v_index);
|
|
__Pyx_XGIVEREF(__pyx_r);
|
|
__Pyx_RefNannyFinishContext();
|
|
return __pyx_r;
|
|
}
|
|
|
|
/* "capnp.pyx":107
|
|
* return toPython(temp)
|
|
*
|
|
* def _setitem(self, index, valid_values value): # <<<<<<<<<<<<<<
|
|
* cdef C_DynamicValue.Reader temp = C_DynamicValue.Reader(value)
|
|
* self.thisptr.set(index, temp)
|
|
*/
|
|
|
|
/* Python wrapper */
|
|
static PyObject *__pyx_pw_5capnp_19_DynamicListBuilder_3_setitem(PyObject *__pyx_v_signatures, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
|
|
static PyMethodDef __pyx_mdef_5capnp_19_DynamicListBuilder_3_setitem = {__Pyx_NAMESTR("_setitem"), (PyCFunction)__pyx_pw_5capnp_19_DynamicListBuilder_3_setitem, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)};
|
|
static PyObject *__pyx_pw_5capnp_19_DynamicListBuilder_3_setitem(PyObject *__pyx_v_signatures, PyObject *__pyx_args, PyObject *__pyx_kwds) {
|
|
PyObject *__pyx_v_args = 0;
|
|
PyObject *__pyx_v_kwargs = 0;
|
|
CYTHON_UNUSED PyObject *__pyx_v_defaults = 0;
|
|
int __pyx_lineno = 0;
|
|
const char *__pyx_filename = NULL;
|
|
int __pyx_clineno = 0;
|
|
PyObject *__pyx_r = 0;
|
|
__Pyx_RefNannyDeclarations
|
|
__Pyx_RefNannySetupContext("__pyx_fused_cpdef (wrapper)", 0);
|
|
{
|
|
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__args,&__pyx_n_s__kwargs,&__pyx_n_s__defaults,0};
|
|
PyObject* values[3] = {0,0,0};
|
|
if (unlikely(__pyx_kwds)) {
|
|
Py_ssize_t kw_args;
|
|
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
|
|
switch (pos_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 (pos_args) {
|
|
case 0:
|
|
if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__args)) != 0)) kw_args--;
|
|
else goto __pyx_L5_argtuple_error;
|
|
case 1:
|
|
if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__kwargs)) != 0)) kw_args--;
|
|
else {
|
|
__Pyx_RaiseArgtupleInvalid("__pyx_fused_cpdef", 1, 3, 3, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 107; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
|
|
}
|
|
case 2:
|
|
if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__defaults)) != 0)) kw_args--;
|
|
else {
|
|
__Pyx_RaiseArgtupleInvalid("__pyx_fused_cpdef", 1, 3, 3, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 107; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
|
|
}
|
|
}
|
|
if (unlikely(kw_args > 0)) {
|
|
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__pyx_fused_cpdef") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 107; __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_args = values[0];
|
|
__pyx_v_kwargs = values[1];
|
|
__pyx_v_defaults = values[2];
|
|
}
|
|
goto __pyx_L4_argument_unpacking_done;
|
|
__pyx_L5_argtuple_error:;
|
|
__Pyx_RaiseArgtupleInvalid("__pyx_fused_cpdef", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 107; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
|
|
__pyx_L3_error:;
|
|
__Pyx_AddTraceback("capnp._DynamicListBuilder.__pyx_fused_cpdef", __pyx_clineno, __pyx_lineno, __pyx_filename);
|
|
__Pyx_RefNannyFinishContext();
|
|
return NULL;
|
|
__pyx_L4_argument_unpacking_done:;
|
|
__pyx_r = __pyx_pf_5capnp_19_DynamicListBuilder_2_setitem(((struct __pyx_obj_5capnp__DynamicListBuilder *)__pyx_v_signatures), __pyx_v_args, __pyx_v_kwargs, __pyx_v_defaults);
|
|
__Pyx_RefNannyFinishContext();
|
|
return __pyx_r;
|
|
}
|
|
|
|
static PyObject *__pyx_pf_5capnp_19_DynamicListBuilder_2_setitem(struct __pyx_obj_5capnp__DynamicListBuilder *__pyx_v_signatures, PyObject *__pyx_v_args, PyObject *__pyx_v_kwargs, CYTHON_UNUSED PyObject *__pyx_v_defaults) {
|
|
PyObject *__pyx_v_dest_sig = NULL;
|
|
PyObject *__pyx_v_arg = NULL;
|
|
PyObject *__pyx_v_candidates = NULL;
|
|
PyObject *__pyx_v_sig = NULL;
|
|
int __pyx_v_match_found;
|
|
PyObject *__pyx_v_src_type = NULL;
|
|
PyObject *__pyx_v_dst_type = NULL;
|
|
PyObject *__pyx_r = NULL;
|
|
__Pyx_RefNannyDeclarations
|
|
PyObject *__pyx_t_1 = NULL;
|
|
int __pyx_t_2;
|
|
int __pyx_t_3;
|
|
Py_ssize_t __pyx_t_4;
|
|
PyObject *__pyx_t_5 = NULL;
|
|
int __pyx_t_6;
|
|
PyObject *(*__pyx_t_7)(PyObject *);
|
|
PyObject *__pyx_t_8 = NULL;
|
|
Py_ssize_t __pyx_t_9;
|
|
PyObject *(*__pyx_t_10)(PyObject *);
|
|
PyObject *__pyx_t_11 = NULL;
|
|
PyObject *__pyx_t_12 = NULL;
|
|
PyObject *__pyx_t_13 = NULL;
|
|
PyObject *(*__pyx_t_14)(PyObject *);
|
|
int __pyx_t_15;
|
|
int __pyx_lineno = 0;
|
|
const char *__pyx_filename = NULL;
|
|
int __pyx_clineno = 0;
|
|
__Pyx_RefNannySetupContext("_setitem", 0);
|
|
__Pyx_INCREF(__pyx_v_kwargs);
|
|
__pyx_t_1 = PyList_New(3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 107; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
|
|
__Pyx_GOTREF(__pyx_t_1);
|
|
__Pyx_INCREF(Py_None);
|
|
PyList_SET_ITEM(__pyx_t_1, 0, Py_None);
|
|
__Pyx_GIVEREF(Py_None);
|
|
__Pyx_INCREF(Py_None);
|
|
PyList_SET_ITEM(__pyx_t_1, 1, Py_None);
|
|
__Pyx_GIVEREF(Py_None);
|
|
__Pyx_INCREF(Py_None);
|
|
PyList_SET_ITEM(__pyx_t_1, 2, Py_None);
|
|
__Pyx_GIVEREF(Py_None);
|
|
__pyx_v_dest_sig = ((PyObject*)__pyx_t_1);
|
|
__pyx_t_1 = 0;
|
|
__pyx_t_2 = (__pyx_v_kwargs == Py_None);
|
|
__pyx_t_3 = (__pyx_t_2 != 0);
|
|
if (__pyx_t_3) {
|
|
__pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 107; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
|
|
__Pyx_GOTREF(((PyObject *)__pyx_t_1));
|
|
__Pyx_DECREF(__pyx_v_kwargs);
|
|
__pyx_v_kwargs = ((PyObject *)__pyx_t_1);
|
|
__pyx_t_1 = 0;
|
|
goto __pyx_L3;
|
|
}
|
|
__pyx_L3:;
|
|
__pyx_t_4 = PyObject_Length(__pyx_v_args); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 107; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
|
|
__pyx_t_3 = ((2 < __pyx_t_4) != 0);
|
|
if (__pyx_t_3) {
|
|
__pyx_t_1 = __Pyx_GetItemInt(__pyx_v_args, 2, sizeof(long), PyInt_FromLong, 0, 0, 1); if (!__pyx_t_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 107; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
|
|
__Pyx_GOTREF(__pyx_t_1);
|
|
__pyx_v_arg = __pyx_t_1;
|
|
__pyx_t_1 = 0;
|
|
goto __pyx_L4;
|
|
}
|
|
__pyx_t_3 = (__Pyx_PySequence_Contains(((PyObject *)__pyx_n_s__value), __pyx_v_kwargs, Py_EQ)); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 107; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
|
|
__pyx_t_2 = (__pyx_t_3 != 0);
|
|
if (__pyx_t_2) {
|
|
__pyx_t_1 = PyObject_GetItem(__pyx_v_kwargs, ((PyObject *)__pyx_n_s__value)); if (!__pyx_t_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 107; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
|
|
__Pyx_GOTREF(__pyx_t_1);
|
|
__pyx_v_arg = __pyx_t_1;
|
|
__pyx_t_1 = 0;
|
|
goto __pyx_L4;
|
|
}
|
|
/*else*/ {
|
|
__pyx_t_4 = PyObject_Length(__pyx_v_args); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 107; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
|
|
__pyx_t_1 = PyInt_FromSsize_t(__pyx_t_4); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 107; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
|
|
__Pyx_GOTREF(__pyx_t_1);
|
|
__pyx_t_5 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_4), __pyx_t_1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 107; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
|
|
__Pyx_GOTREF(((PyObject *)__pyx_t_5));
|
|
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
|
|
__pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 107; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
|
|
__Pyx_GOTREF(__pyx_t_1);
|
|
PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_t_5));
|
|
__Pyx_GIVEREF(((PyObject *)__pyx_t_5));
|
|
__pyx_t_5 = 0;
|
|
__pyx_t_5 = PyObject_Call(__pyx_builtin_TypeError, ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 107; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
|
|
__Pyx_GOTREF(__pyx_t_5);
|
|
__Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 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 = 107; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
|
|
}
|
|
__pyx_L4:;
|
|
__pyx_t_2 = PyFloat_Check(__pyx_v_arg);
|
|
__pyx_t_3 = (__pyx_t_2 != 0);
|
|
if (__pyx_t_3) {
|
|
if (__Pyx_SetItemInt(((PyObject *)__pyx_v_dest_sig), 0, ((PyObject *)__pyx_n_s__double), sizeof(long), PyInt_FromLong, 1, 0, 1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 107; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
|
|
goto __pyx_L5;
|
|
}
|
|
__Pyx_INCREF(__pyx_v_arg);
|
|
__pyx_t_5 = __pyx_v_arg;
|
|
__pyx_t_3 = PyInt_Check(__pyx_t_5);
|
|
if (!__pyx_t_3) {
|
|
__pyx_t_2 = PyLong_Check(__pyx_t_5);
|
|
__pyx_t_6 = __pyx_t_2;
|
|
} else {
|
|
__pyx_t_6 = __pyx_t_3;
|
|
}
|
|
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
|
|
__pyx_t_3 = (__pyx_t_6 != 0);
|
|
if (__pyx_t_3) {
|
|
if (__Pyx_SetItemInt(((PyObject *)__pyx_v_dest_sig), 0, ((PyObject *)__pyx_n_s__long), sizeof(long), PyInt_FromLong, 1, 0, 1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 107; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
|
|
goto __pyx_L5;
|
|
}
|
|
__pyx_t_5 = ((PyObject*)&PyBool_Type);
|
|
__Pyx_INCREF(__pyx_t_5);
|
|
__pyx_t_3 = PyObject_IsInstance(__pyx_v_arg, __pyx_t_5); if (unlikely(__pyx_t_3 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 107; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
|
|
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
|
|
__pyx_t_6 = (__pyx_t_3 != 0);
|
|
if (__pyx_t_6) {
|
|
if (__Pyx_SetItemInt(((PyObject *)__pyx_v_dest_sig), 0, ((PyObject *)__pyx_n_s__bint), sizeof(long), PyInt_FromLong, 1, 0, 1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 107; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
|
|
goto __pyx_L5;
|
|
}
|
|
__pyx_t_6 = PyBytes_Check(__pyx_v_arg);
|
|
__pyx_t_3 = (__pyx_t_6 != 0);
|
|
if (__pyx_t_3) {
|
|
if (__Pyx_SetItemInt(((PyObject *)__pyx_v_dest_sig), 0, ((PyObject *)__pyx_kp_s_5), sizeof(long), PyInt_FromLong, 1, 0, 1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 107; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
|
|
goto __pyx_L5;
|
|
}
|
|
/*else*/ {
|
|
if (__Pyx_SetItemInt(((PyObject *)__pyx_v_dest_sig), 0, Py_None, sizeof(long), PyInt_FromLong, 1, 0, 1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 107; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
|
|
}
|
|
__pyx_L5:;
|
|
__pyx_t_5 = PyList_New(0); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 107; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
|
|
__Pyx_GOTREF(__pyx_t_5);
|
|
__pyx_v_candidates = ((PyObject*)__pyx_t_5);
|
|
__pyx_t_5 = 0;
|
|
if (PyList_CheckExact(((PyObject *)__pyx_v_signatures)) || PyTuple_CheckExact(((PyObject *)__pyx_v_signatures))) {
|
|
__pyx_t_5 = ((PyObject *)__pyx_v_signatures); __Pyx_INCREF(__pyx_t_5); __pyx_t_4 = 0;
|
|
__pyx_t_7 = NULL;
|
|
} else {
|
|
__pyx_t_4 = -1; __pyx_t_5 = PyObject_GetIter(((PyObject *)__pyx_v_signatures)); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 107; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
|
|
__Pyx_GOTREF(__pyx_t_5);
|
|
__pyx_t_7 = Py_TYPE(__pyx_t_5)->tp_iternext;
|
|
}
|
|
for (;;) {
|
|
if (!__pyx_t_7 && PyList_CheckExact(__pyx_t_5)) {
|
|
if (__pyx_t_4 >= PyList_GET_SIZE(__pyx_t_5)) break;
|
|
#if CYTHON_COMPILING_IN_CPYTHON
|
|
__pyx_t_1 = PyList_GET_ITEM(__pyx_t_5, __pyx_t_4); __Pyx_INCREF(__pyx_t_1); __pyx_t_4++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 107; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
|
|
#else
|
|
__pyx_t_1 = PySequence_ITEM(__pyx_t_5, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 107; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
|
|
#endif
|
|
} else if (!__pyx_t_7 && PyTuple_CheckExact(__pyx_t_5)) {
|
|
if (__pyx_t_4 >= PyTuple_GET_SIZE(__pyx_t_5)) break;
|
|
#if CYTHON_COMPILING_IN_CPYTHON
|
|
__pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_5, __pyx_t_4); __Pyx_INCREF(__pyx_t_1); __pyx_t_4++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 107; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
|
|
#else
|
|
__pyx_t_1 = PySequence_ITEM(__pyx_t_5, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 107; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
|
|
#endif
|
|
} else {
|
|
__pyx_t_1 = __pyx_t_7(__pyx_t_5);
|
|
if (unlikely(!__pyx_t_1)) {
|
|
if (PyErr_Occurred()) {
|
|
if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) PyErr_Clear();
|
|
else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 107; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
|
|
}
|
|
break;
|
|
}
|
|
__Pyx_GOTREF(__pyx_t_1);
|
|
}
|
|
__Pyx_XDECREF(__pyx_v_sig);
|
|
__pyx_v_sig = __pyx_t_1;
|
|
__pyx_t_1 = 0;
|
|
__pyx_v_match_found = 0;
|
|
__pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_sig, __pyx_n_s__strip); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 107; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
|
|
__Pyx_GOTREF(__pyx_t_1);
|
|
__pyx_t_8 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_k_tuple_7), NULL); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 107; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
|
|
__Pyx_GOTREF(__pyx_t_8);
|
|
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
|
|
__pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s__split); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 107; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
|
|
__Pyx_GOTREF(__pyx_t_1);
|
|
__Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
|
|
__pyx_t_8 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_k_tuple_9), NULL); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 107; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
|
|
__Pyx_GOTREF(__pyx_t_8);
|
|
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
|
|
__pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 107; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
|
|
__Pyx_GOTREF(__pyx_t_1);
|
|
PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_8);
|
|
__Pyx_GIVEREF(__pyx_t_8);
|
|
__Pyx_INCREF(((PyObject *)__pyx_v_dest_sig));
|
|
PyTuple_SET_ITEM(__pyx_t_1, 1, ((PyObject *)__pyx_v_dest_sig));
|
|
__Pyx_GIVEREF(((PyObject *)__pyx_v_dest_sig));
|
|
__pyx_t_8 = 0;
|
|
__pyx_t_8 = PyObject_Call(__pyx_builtin_zip, ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 107; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
|
|
__Pyx_GOTREF(__pyx_t_8);
|
|
__Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
|
|
if (PyList_CheckExact(__pyx_t_8) || PyTuple_CheckExact(__pyx_t_8)) {
|
|
__pyx_t_1 = __pyx_t_8; __Pyx_INCREF(__pyx_t_1); __pyx_t_9 = 0;
|
|
__pyx_t_10 = NULL;
|
|
} else {
|
|
__pyx_t_9 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_t_8); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 107; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
|
|
__Pyx_GOTREF(__pyx_t_1);
|
|
__pyx_t_10 = Py_TYPE(__pyx_t_1)->tp_iternext;
|
|
}
|
|
__Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
|
|
for (;;) {
|
|
if (!__pyx_t_10 && PyList_CheckExact(__pyx_t_1)) {
|
|
if (__pyx_t_9 >= PyList_GET_SIZE(__pyx_t_1)) break;
|
|
#if CYTHON_COMPILING_IN_CPYTHON
|
|
__pyx_t_8 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_9); __Pyx_INCREF(__pyx_t_8); __pyx_t_9++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 107; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
|
|
#else
|
|
__pyx_t_8 = PySequence_ITEM(__pyx_t_1, __pyx_t_9); __pyx_t_9++; if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 107; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
|
|
#endif
|
|
} else if (!__pyx_t_10 && PyTuple_CheckExact(__pyx_t_1)) {
|
|
if (__pyx_t_9 >= PyTuple_GET_SIZE(__pyx_t_1)) break;
|
|
#if CYTHON_COMPILING_IN_CPYTHON
|
|
__pyx_t_8 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_9); __Pyx_INCREF(__pyx_t_8); __pyx_t_9++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 107; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
|
|
#else
|
|
__pyx_t_8 = PySequence_ITEM(__pyx_t_1, __pyx_t_9); __pyx_t_9++; if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 107; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
|
|
#endif
|
|
} else {
|
|
__pyx_t_8 = __pyx_t_10(__pyx_t_1);
|
|
if (unlikely(!__pyx_t_8)) {
|
|
if (PyErr_Occurred()) {
|
|
if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) PyErr_Clear();
|
|
else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 107; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
|
|
}
|
|
break;
|
|
}
|
|
__Pyx_GOTREF(__pyx_t_8);
|
|
}
|
|
if ((likely(PyTuple_CheckExact(__pyx_t_8))) || (PyList_CheckExact(__pyx_t_8))) {
|
|
PyObject* sequence = __pyx_t_8;
|
|
#if CYTHON_COMPILING_IN_CPYTHON
|
|
Py_ssize_t size = Py_SIZE(sequence);
|
|
#else
|
|
Py_ssize_t size = PySequence_Size(sequence);
|
|
#endif
|
|
if (unlikely(size != 2)) {
|
|
if (size > 2) __Pyx_RaiseTooManyValuesError(2);
|
|
else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
|
|
{__pyx_filename = __pyx_f[0]; __pyx_lineno = 107; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
|
|
}
|
|
#if CYTHON_COMPILING_IN_CPYTHON
|
|
if (likely(PyTuple_CheckExact(sequence))) {
|
|
__pyx_t_11 = PyTuple_GET_ITEM(sequence, 0);
|
|
__pyx_t_12 = PyTuple_GET_ITEM(sequence, 1);
|
|
} else {
|
|
__pyx_t_11 = PyList_GET_ITEM(sequence, 0);
|
|
__pyx_t_12 = PyList_GET_ITEM(sequence, 1);
|
|
}
|
|
__Pyx_INCREF(__pyx_t_11);
|
|
__Pyx_INCREF(__pyx_t_12);
|
|
#else
|
|
__pyx_t_11 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 107; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
|
|
__Pyx_GOTREF(__pyx_t_11);
|
|
__pyx_t_12 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 107; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
|
|
__Pyx_GOTREF(__pyx_t_12);
|
|
#endif
|
|
__Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
|
|
} else
|
|
{
|
|
Py_ssize_t index = -1;
|
|
__pyx_t_13 = PyObject_GetIter(__pyx_t_8); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 107; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
|
|
__Pyx_GOTREF(__pyx_t_13);
|
|
__Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
|
|
__pyx_t_14 = Py_TYPE(__pyx_t_13)->tp_iternext;
|
|
index = 0; __pyx_t_11 = __pyx_t_14(__pyx_t_13); if (unlikely(!__pyx_t_11)) goto __pyx_L10_unpacking_failed;
|
|
__Pyx_GOTREF(__pyx_t_11);
|
|
index = 1; __pyx_t_12 = __pyx_t_14(__pyx_t_13); if (unlikely(!__pyx_t_12)) goto __pyx_L10_unpacking_failed;
|
|
__Pyx_GOTREF(__pyx_t_12);
|
|
if (__Pyx_IternextUnpackEndCheck(__pyx_t_14(__pyx_t_13), 2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 107; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
|
|
__pyx_t_14 = NULL;
|
|
__Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
|
|
goto __pyx_L11_unpacking_done;
|
|
__pyx_L10_unpacking_failed:;
|
|
__Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
|
|
__pyx_t_14 = NULL;
|
|
if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
|
|
{__pyx_filename = __pyx_f[0]; __pyx_lineno = 107; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
|
|
__pyx_L11_unpacking_done:;
|
|
}
|
|
__Pyx_XDECREF(__pyx_v_src_type);
|
|
__pyx_v_src_type = __pyx_t_11;
|
|
__pyx_t_11 = 0;
|
|
__Pyx_XDECREF(__pyx_v_dst_type);
|
|
__pyx_v_dst_type = __pyx_t_12;
|
|
__pyx_t_12 = 0;
|
|
__pyx_t_3 = (__pyx_v_dst_type != Py_None);
|
|
__pyx_t_6 = (__pyx_t_3 != 0);
|
|
if (__pyx_t_6) {
|
|
__pyx_t_8 = PyObject_RichCompare(__pyx_v_src_type, __pyx_v_dst_type, Py_EQ); __Pyx_XGOTREF(__pyx_t_8); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 107; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
|
|
__pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_8); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 107; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
|
|
__Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
|
|
if (__pyx_t_6) {
|
|
__pyx_v_match_found = 1;
|
|
goto __pyx_L13;
|
|
}
|
|
/*else*/ {
|
|
__pyx_v_match_found = 0;
|
|
goto __pyx_L9_break;
|
|
}
|
|
__pyx_L13:;
|
|
goto __pyx_L12;
|
|
}
|
|
__pyx_L12:;
|
|
}
|
|
__pyx_L9_break:;
|
|
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
|
|
__pyx_t_6 = (__pyx_v_match_found != 0);
|
|
if (__pyx_t_6) {
|
|
__pyx_t_15 = __Pyx_PyList_Append(__pyx_v_candidates, __pyx_v_sig); if (unlikely(__pyx_t_15 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 107; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
|
|
goto __pyx_L14;
|
|
}
|
|
__pyx_L14:;
|
|
}
|
|
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
|
|
__pyx_t_6 = (((PyObject *)__pyx_v_candidates) != Py_None) && (PyList_GET_SIZE(((PyObject *)__pyx_v_candidates)) != 0);
|
|
__pyx_t_3 = ((!__pyx_t_6) != 0);
|
|
if (__pyx_t_3) {
|
|
__pyx_t_5 = PyObject_Call(__pyx_builtin_TypeError, ((PyObject *)__pyx_k_tuple_11), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 107; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
|
|
__Pyx_GOTREF(__pyx_t_5);
|
|
__Pyx_Raise(__pyx_t_5, 0, 0, 0);
|
|
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
|
|
{__pyx_filename = __pyx_f[0]; __pyx_lineno = 107; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
|
|
goto __pyx_L15;
|
|
}
|
|
__pyx_t_4 = PyList_GET_SIZE(((PyObject *)__pyx_v_candidates)); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 107; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
|
|
__pyx_t_3 = ((__pyx_t_4 > 1) != 0);
|
|
if (__pyx_t_3) {
|
|
__pyx_t_5 = PyObject_Call(__pyx_builtin_TypeError, ((PyObject *)__pyx_k_tuple_13), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 107; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
|
|
__Pyx_GOTREF(__pyx_t_5);
|
|
__Pyx_Raise(__pyx_t_5, 0, 0, 0);
|
|
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
|
|
{__pyx_filename = __pyx_f[0]; __pyx_lineno = 107; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
|
|
goto __pyx_L15;
|
|
}
|
|
/*else*/ {
|
|
__Pyx_XDECREF(__pyx_r);
|
|
__pyx_t_5 = __Pyx_GetItemInt_List(((PyObject *)__pyx_v_candidates), 0, sizeof(long), PyInt_FromLong, 1, 0, 1); if (!__pyx_t_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 107; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
|
|
__Pyx_GOTREF(__pyx_t_5);
|
|
__pyx_t_1 = PyObject_GetItem(((PyObject *)__pyx_v_signatures), __pyx_t_5); if (!__pyx_t_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 107; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
|
|
__Pyx_GOTREF(__pyx_t_1);
|
|
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
|
|
__pyx_r = __pyx_t_1;
|
|
__pyx_t_1 = 0;
|
|
goto __pyx_L0;
|
|
}
|
|
__pyx_L15:;
|
|
|
|
__pyx_r = Py_None; __Pyx_INCREF(Py_None);
|
|
goto __pyx_L0;
|
|
__pyx_L1_error:;
|
|
__Pyx_XDECREF(__pyx_t_1);
|
|
__Pyx_XDECREF(__pyx_t_5);
|
|
__Pyx_XDECREF(__pyx_t_8);
|
|
__Pyx_XDECREF(__pyx_t_11);
|
|
__Pyx_XDECREF(__pyx_t_12);
|
|
__Pyx_XDECREF(__pyx_t_13);
|
|
__Pyx_AddTraceback("capnp._DynamicListBuilder.__pyx_fused_cpdef", __pyx_clineno, __pyx_lineno, __pyx_filename);
|
|
__pyx_r = NULL;
|
|
__pyx_L0:;
|
|
__Pyx_XDECREF(__pyx_v_dest_sig);
|
|
__Pyx_XDECREF(__pyx_v_arg);
|
|
__Pyx_XDECREF(__pyx_v_candidates);
|
|
__Pyx_XDECREF(__pyx_v_sig);
|
|
__Pyx_XDECREF(__pyx_v_src_type);
|
|
__Pyx_XDECREF(__pyx_v_dst_type);
|
|
__Pyx_XDECREF(__pyx_v_kwargs);
|
|
__Pyx_XGIVEREF(__pyx_r);
|
|
__Pyx_RefNannyFinishContext();
|
|
return __pyx_r;
|
|
}
|
|
|
|
/* Python wrapper */
|
|
static PyObject *__pyx_fuse_0__pyx_pw_5capnp_19_DynamicListBuilder_9_setitem(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
|
|
static PyMethodDef __pyx_fuse_0__pyx_mdef_5capnp_19_DynamicListBuilder_9_setitem = {__Pyx_NAMESTR("__pyx_fuse_0_setitem"), (PyCFunction)__pyx_fuse_0__pyx_pw_5capnp_19_DynamicListBuilder_9_setitem, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)};
|
|
static PyObject *__pyx_fuse_0__pyx_pw_5capnp_19_DynamicListBuilder_9_setitem(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
|
|
PyObject *__pyx_v_index = 0;
|
|
int __pyx_v_value;
|
|
int __pyx_lineno = 0;
|
|
const char *__pyx_filename = NULL;
|
|
int __pyx_clineno = 0;
|
|
PyObject *__pyx_r = 0;
|
|
__Pyx_RefNannyDeclarations
|
|
__Pyx_RefNannySetupContext("_setitem (wrapper)", 0);
|
|
{
|
|
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__index,&__pyx_n_s__value,0};
|
|
PyObject* values[2] = {0,0};
|
|
if (unlikely(__pyx_kwds)) {
|
|
Py_ssize_t kw_args;
|
|
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
|
|
switch (pos_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;
|
|
}
|
|
kw_args = PyDict_Size(__pyx_kwds);
|
|
switch (pos_args) {
|
|
case 0:
|
|
if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__index)) != 0)) kw_args--;
|
|
else goto __pyx_L5_argtuple_error;
|
|
case 1:
|
|
if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__value)) != 0)) kw_args--;
|
|
else {
|
|
__Pyx_RaiseArgtupleInvalid("_setitem", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 107; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
|
|
}
|
|
}
|
|
if (unlikely(kw_args > 0)) {
|
|
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_setitem") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 107; __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_index = values[0];
|
|
__pyx_v_value = __Pyx_PyInt_AsInt(values[1]); if (unlikely((__pyx_v_value == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 107; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
|
|
}
|
|
goto __pyx_L4_argument_unpacking_done;
|
|
__pyx_L5_argtuple_error:;
|
|
__Pyx_RaiseArgtupleInvalid("_setitem", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 107; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
|
|
__pyx_L3_error:;
|
|
__Pyx_AddTraceback("capnp._DynamicListBuilder._setitem", __pyx_clineno, __pyx_lineno, __pyx_filename);
|
|
__Pyx_RefNannyFinishContext();
|
|
return NULL;
|
|
__pyx_L4_argument_unpacking_done:;
|
|
__pyx_r = __pyx_pf_5capnp_19_DynamicListBuilder_8_setitem(((struct __pyx_obj_5capnp__DynamicListBuilder *)__pyx_v_self), __pyx_v_index, __pyx_v_value);
|
|
__Pyx_RefNannyFinishContext();
|
|
return __pyx_r;
|
|
}
|
|
|
|
static PyObject *__pyx_pf_5capnp_19_DynamicListBuilder_8_setitem(struct __pyx_obj_5capnp__DynamicListBuilder *__pyx_v_self, PyObject *__pyx_v_index, int __pyx_v_value) {
|
|
::capnp::DynamicValue::Reader __pyx_v_temp;
|
|
PyObject *__pyx_r = NULL;
|
|
__Pyx_RefNannyDeclarations
|
|
__pyx_t_9capnp_cpp_uint __pyx_t_1;
|
|
int __pyx_lineno = 0;
|
|
const char *__pyx_filename = NULL;
|
|
int __pyx_clineno = 0;
|
|
__Pyx_RefNannySetupContext("__pyx_fuse_0_setitem", 0);
|
|
|
|
/* "capnp.pyx":108
|
|
*
|
|
* def _setitem(self, index, valid_values value):
|
|
* cdef C_DynamicValue.Reader temp = C_DynamicValue.Reader(value) # <<<<<<<<<<<<<<
|
|
* self.thisptr.set(index, temp)
|
|
*
|
|
*/
|
|
__pyx_v_temp = ::capnp::DynamicValue::Reader(__pyx_v_value);
|
|
|
|
/* "capnp.pyx":109
|
|
* def _setitem(self, index, valid_values value):
|
|
* cdef C_DynamicValue.Reader temp = C_DynamicValue.Reader(value)
|
|
* self.thisptr.set(index, temp) # <<<<<<<<<<<<<<
|
|
*
|
|
* def __setitem__(self, index, value):
|
|
*/
|
|
__pyx_t_1 = __Pyx_PyInt_AsUnsignedInt(__pyx_v_index); if (unlikely((__pyx_t_1 == (unsigned int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 109; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
|
|
__pyx_v_self->thisptr.set(__pyx_t_1, (( ::capnp::DynamicValue::Reader &)__pyx_v_temp));
|
|
|
|
__pyx_r = Py_None; __Pyx_INCREF(Py_None);
|
|
goto __pyx_L0;
|
|
__pyx_L1_error:;
|
|
__Pyx_AddTraceback("capnp._DynamicListBuilder._setitem", __pyx_clineno, __pyx_lineno, __pyx_filename);
|
|
__pyx_r = NULL;
|
|
__pyx_L0:;
|
|
__Pyx_XGIVEREF(__pyx_r);
|
|
__Pyx_RefNannyFinishContext();
|
|
return __pyx_r;
|
|
}
|
|
|
|
/* "capnp.pyx":107
|
|
* return toPython(temp)
|
|
*
|
|
* def _setitem(self, index, valid_values value): # <<<<<<<<<<<<<<
|
|
* cdef C_DynamicValue.Reader temp = C_DynamicValue.Reader(value)
|
|
* self.thisptr.set(index, temp)
|
|
*/
|
|
|
|
/* Python wrapper */
|
|
static PyObject *__pyx_fuse_1__pyx_pw_5capnp_19_DynamicListBuilder_11_setitem(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
|
|
static PyMethodDef __pyx_fuse_1__pyx_mdef_5capnp_19_DynamicListBuilder_11_setitem = {__Pyx_NAMESTR("__pyx_fuse_1_setitem"), (PyCFunction)__pyx_fuse_1__pyx_pw_5capnp_19_DynamicListBuilder_11_setitem, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)};
|
|
static PyObject *__pyx_fuse_1__pyx_pw_5capnp_19_DynamicListBuilder_11_setitem(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
|
|
PyObject *__pyx_v_index = 0;
|
|
long __pyx_v_value;
|
|
int __pyx_lineno = 0;
|
|
const char *__pyx_filename = NULL;
|
|
int __pyx_clineno = 0;
|
|
PyObject *__pyx_r = 0;
|
|
__Pyx_RefNannyDeclarations
|
|
__Pyx_RefNannySetupContext("_setitem (wrapper)", 0);
|
|
{
|
|
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__index,&__pyx_n_s__value,0};
|
|
PyObject* values[2] = {0,0};
|
|
if (unlikely(__pyx_kwds)) {
|
|
Py_ssize_t kw_args;
|
|
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
|
|
switch (pos_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;
|
|
}
|
|
kw_args = PyDict_Size(__pyx_kwds);
|
|
switch (pos_args) {
|
|
case 0:
|
|
if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__index)) != 0)) kw_args--;
|
|
else goto __pyx_L5_argtuple_error;
|
|
case 1:
|
|
if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__value)) != 0)) kw_args--;
|
|
else {
|
|
__Pyx_RaiseArgtupleInvalid("_setitem", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 107; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
|
|
}
|
|
}
|
|
if (unlikely(kw_args > 0)) {
|
|
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_setitem") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 107; __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_index = values[0];
|
|
__pyx_v_value = __Pyx_PyInt_AsLong(values[1]); if (unlikely((__pyx_v_value == (long)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 107; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
|
|
}
|
|
goto __pyx_L4_argument_unpacking_done;
|
|
__pyx_L5_argtuple_error:;
|
|
__Pyx_RaiseArgtupleInvalid("_setitem", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 107; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
|
|
__pyx_L3_error:;
|
|
__Pyx_AddTraceback("capnp._DynamicListBuilder._setitem", __pyx_clineno, __pyx_lineno, __pyx_filename);
|
|
__Pyx_RefNannyFinishContext();
|
|
return NULL;
|
|
__pyx_L4_argument_unpacking_done:;
|
|
__pyx_r = __pyx_pf_5capnp_19_DynamicListBuilder_10_setitem(((struct __pyx_obj_5capnp__DynamicListBuilder *)__pyx_v_self), __pyx_v_index, __pyx_v_value);
|
|
__Pyx_RefNannyFinishContext();
|
|
return __pyx_r;
|
|
}
|
|
|
|
static PyObject *__pyx_pf_5capnp_19_DynamicListBuilder_10_setitem(struct __pyx_obj_5capnp__DynamicListBuilder *__pyx_v_self, PyObject *__pyx_v_index, long __pyx_v_value) {
|
|
::capnp::DynamicValue::Reader __pyx_v_temp;
|
|
PyObject *__pyx_r = NULL;
|
|
__Pyx_RefNannyDeclarations
|
|
__pyx_t_9capnp_cpp_uint __pyx_t_1;
|
|
int __pyx_lineno = 0;
|
|
const char *__pyx_filename = NULL;
|
|
int __pyx_clineno = 0;
|
|
__Pyx_RefNannySetupContext("__pyx_fuse_1_setitem", 0);
|
|
|
|
/* "capnp.pyx":108
|
|
*
|
|
* def _setitem(self, index, valid_values value):
|
|
* cdef C_DynamicValue.Reader temp = C_DynamicValue.Reader(value) # <<<<<<<<<<<<<<
|
|
* self.thisptr.set(index, temp)
|
|
*
|
|
*/
|
|
__pyx_v_temp = ::capnp::DynamicValue::Reader(__pyx_v_value);
|
|
|
|
/* "capnp.pyx":109
|
|
* def _setitem(self, index, valid_values value):
|
|
* cdef C_DynamicValue.Reader temp = C_DynamicValue.Reader(value)
|
|
* self.thisptr.set(index, temp) # <<<<<<<<<<<<<<
|
|
*
|
|
* def __setitem__(self, index, value):
|
|
*/
|
|
__pyx_t_1 = __Pyx_PyInt_AsUnsignedInt(__pyx_v_index); if (unlikely((__pyx_t_1 == (unsigned int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 109; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
|
|
__pyx_v_self->thisptr.set(__pyx_t_1, (( ::capnp::DynamicValue::Reader &)__pyx_v_temp));
|
|
|
|
__pyx_r = Py_None; __Pyx_INCREF(Py_None);
|
|
goto __pyx_L0;
|
|
__pyx_L1_error:;
|
|
__Pyx_AddTraceback("capnp._DynamicListBuilder._setitem", __pyx_clineno, __pyx_lineno, __pyx_filename);
|
|
__pyx_r = NULL;
|
|
__pyx_L0:;
|
|
__Pyx_XGIVEREF(__pyx_r);
|
|
__Pyx_RefNannyFinishContext();
|
|
return __pyx_r;
|
|
}
|
|
|
|
/* "capnp.pyx":107
|
|
* return toPython(temp)
|
|
*
|
|
* def _setitem(self, index, valid_values value): # <<<<<<<<<<<<<<
|
|
* cdef C_DynamicValue.Reader temp = C_DynamicValue.Reader(value)
|
|
* self.thisptr.set(index, temp)
|
|
*/
|
|
|
|
/* Python wrapper */
|
|
static PyObject *__pyx_fuse_2__pyx_pw_5capnp_19_DynamicListBuilder_13_setitem(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
|
|
static PyMethodDef __pyx_fuse_2__pyx_mdef_5capnp_19_DynamicListBuilder_13_setitem = {__Pyx_NAMESTR("__pyx_fuse_2_setitem"), (PyCFunction)__pyx_fuse_2__pyx_pw_5capnp_19_DynamicListBuilder_13_setitem, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)};
|
|
static PyObject *__pyx_fuse_2__pyx_pw_5capnp_19_DynamicListBuilder_13_setitem(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
|
|
PyObject *__pyx_v_index = 0;
|
|
float __pyx_v_value;
|
|
int __pyx_lineno = 0;
|
|
const char *__pyx_filename = NULL;
|
|
int __pyx_clineno = 0;
|
|
PyObject *__pyx_r = 0;
|
|
__Pyx_RefNannyDeclarations
|
|
__Pyx_RefNannySetupContext("_setitem (wrapper)", 0);
|
|
{
|
|
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__index,&__pyx_n_s__value,0};
|
|
PyObject* values[2] = {0,0};
|
|
if (unlikely(__pyx_kwds)) {
|
|
Py_ssize_t kw_args;
|
|
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
|
|
switch (pos_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;
|
|
}
|
|
kw_args = PyDict_Size(__pyx_kwds);
|
|
switch (pos_args) {
|
|
case 0:
|
|
if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__index)) != 0)) kw_args--;
|
|
else goto __pyx_L5_argtuple_error;
|
|
case 1:
|
|
if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__value)) != 0)) kw_args--;
|
|
else {
|
|
__Pyx_RaiseArgtupleInvalid("_setitem", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 107; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
|
|
}
|
|
}
|
|
if (unlikely(kw_args > 0)) {
|
|
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_setitem") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 107; __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_index = values[0];
|
|
__pyx_v_value = __pyx_PyFloat_AsFloat(values[1]); if (unlikely((__pyx_v_value == (float)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 107; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
|
|
}
|
|
goto __pyx_L4_argument_unpacking_done;
|
|
__pyx_L5_argtuple_error:;
|
|
__Pyx_RaiseArgtupleInvalid("_setitem", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 107; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
|
|
__pyx_L3_error:;
|
|
__Pyx_AddTraceback("capnp._DynamicListBuilder._setitem", __pyx_clineno, __pyx_lineno, __pyx_filename);
|
|
__Pyx_RefNannyFinishContext();
|
|
return NULL;
|
|
__pyx_L4_argument_unpacking_done:;
|
|
__pyx_r = __pyx_pf_5capnp_19_DynamicListBuilder_12_setitem(((struct __pyx_obj_5capnp__DynamicListBuilder *)__pyx_v_self), __pyx_v_index, __pyx_v_value);
|
|
__Pyx_RefNannyFinishContext();
|
|
return __pyx_r;
|
|
}
|
|
|
|
static PyObject *__pyx_pf_5capnp_19_DynamicListBuilder_12_setitem(struct __pyx_obj_5capnp__DynamicListBuilder *__pyx_v_self, PyObject *__pyx_v_index, float __pyx_v_value) {
|
|
::capnp::DynamicValue::Reader __pyx_v_temp;
|
|
PyObject *__pyx_r = NULL;
|
|
__Pyx_RefNannyDeclarations
|
|
__pyx_t_9capnp_cpp_uint __pyx_t_1;
|
|
int __pyx_lineno = 0;
|
|
const char *__pyx_filename = NULL;
|
|
int __pyx_clineno = 0;
|
|
__Pyx_RefNannySetupContext("__pyx_fuse_2_setitem", 0);
|
|
|
|
/* "capnp.pyx":108
|
|
*
|
|
* def _setitem(self, index, valid_values value):
|
|
* cdef C_DynamicValue.Reader temp = C_DynamicValue.Reader(value) # <<<<<<<<<<<<<<
|
|
* self.thisptr.set(index, temp)
|
|
*
|
|
*/
|
|
__pyx_v_temp = ::capnp::DynamicValue::Reader(__pyx_v_value);
|
|
|
|
/* "capnp.pyx":109
|
|
* def _setitem(self, index, valid_values value):
|
|
* cdef C_DynamicValue.Reader temp = C_DynamicValue.Reader(value)
|
|
* self.thisptr.set(index, temp) # <<<<<<<<<<<<<<
|
|
*
|
|
* def __setitem__(self, index, value):
|
|
*/
|
|
__pyx_t_1 = __Pyx_PyInt_AsUnsignedInt(__pyx_v_index); if (unlikely((__pyx_t_1 == (unsigned int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 109; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
|
|
__pyx_v_self->thisptr.set(__pyx_t_1, (( ::capnp::DynamicValue::Reader &)__pyx_v_temp));
|
|
|
|
__pyx_r = Py_None; __Pyx_INCREF(Py_None);
|
|
goto __pyx_L0;
|
|
__pyx_L1_error:;
|
|
__Pyx_AddTraceback("capnp._DynamicListBuilder._setitem", __pyx_clineno, __pyx_lineno, __pyx_filename);
|
|
__pyx_r = NULL;
|
|
__pyx_L0:;
|
|
__Pyx_XGIVEREF(__pyx_r);
|
|
__Pyx_RefNannyFinishContext();
|
|
return __pyx_r;
|
|
}
|
|
|
|
/* "capnp.pyx":107
|
|
* return toPython(temp)
|
|
*
|
|
* def _setitem(self, index, valid_values value): # <<<<<<<<<<<<<<
|
|
* cdef C_DynamicValue.Reader temp = C_DynamicValue.Reader(value)
|
|
* self.thisptr.set(index, temp)
|
|
*/
|
|
|
|
/* Python wrapper */
|
|
static PyObject *__pyx_fuse_3__pyx_pw_5capnp_19_DynamicListBuilder_15_setitem(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
|
|
static PyMethodDef __pyx_fuse_3__pyx_mdef_5capnp_19_DynamicListBuilder_15_setitem = {__Pyx_NAMESTR("__pyx_fuse_3_setitem"), (PyCFunction)__pyx_fuse_3__pyx_pw_5capnp_19_DynamicListBuilder_15_setitem, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)};
|
|
static PyObject *__pyx_fuse_3__pyx_pw_5capnp_19_DynamicListBuilder_15_setitem(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
|
|
PyObject *__pyx_v_index = 0;
|
|
double __pyx_v_value;
|
|
int __pyx_lineno = 0;
|
|
const char *__pyx_filename = NULL;
|
|
int __pyx_clineno = 0;
|
|
PyObject *__pyx_r = 0;
|
|
__Pyx_RefNannyDeclarations
|
|
__Pyx_RefNannySetupContext("_setitem (wrapper)", 0);
|
|
{
|
|
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__index,&__pyx_n_s__value,0};
|
|
PyObject* values[2] = {0,0};
|
|
if (unlikely(__pyx_kwds)) {
|
|
Py_ssize_t kw_args;
|
|
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
|
|
switch (pos_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;
|
|
}
|
|
kw_args = PyDict_Size(__pyx_kwds);
|
|
switch (pos_args) {
|
|
case 0:
|
|
if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__index)) != 0)) kw_args--;
|
|
else goto __pyx_L5_argtuple_error;
|
|
case 1:
|
|
if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__value)) != 0)) kw_args--;
|
|
else {
|
|
__Pyx_RaiseArgtupleInvalid("_setitem", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 107; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
|
|
}
|
|
}
|
|
if (unlikely(kw_args > 0)) {
|
|
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_setitem") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 107; __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_index = values[0];
|
|
__pyx_v_value = __pyx_PyFloat_AsDouble(values[1]); if (unlikely((__pyx_v_value == (double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 107; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
|
|
}
|
|
goto __pyx_L4_argument_unpacking_done;
|
|
__pyx_L5_argtuple_error:;
|
|
__Pyx_RaiseArgtupleInvalid("_setitem", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 107; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
|
|
__pyx_L3_error:;
|
|
__Pyx_AddTraceback("capnp._DynamicListBuilder._setitem", __pyx_clineno, __pyx_lineno, __pyx_filename);
|
|
__Pyx_RefNannyFinishContext();
|
|
return NULL;
|
|
__pyx_L4_argument_unpacking_done:;
|
|
__pyx_r = __pyx_pf_5capnp_19_DynamicListBuilder_14_setitem(((struct __pyx_obj_5capnp__DynamicListBuilder *)__pyx_v_self), __pyx_v_index, __pyx_v_value);
|
|
__Pyx_RefNannyFinishContext();
|
|
return __pyx_r;
|
|
}
|
|
|
|
static PyObject *__pyx_pf_5capnp_19_DynamicListBuilder_14_setitem(struct __pyx_obj_5capnp__DynamicListBuilder *__pyx_v_self, PyObject *__pyx_v_index, double __pyx_v_value) {
|
|
::capnp::DynamicValue::Reader __pyx_v_temp;
|
|
PyObject *__pyx_r = NULL;
|
|
__Pyx_RefNannyDeclarations
|
|
__pyx_t_9capnp_cpp_uint __pyx_t_1;
|
|
int __pyx_lineno = 0;
|
|
const char *__pyx_filename = NULL;
|
|
int __pyx_clineno = 0;
|
|
__Pyx_RefNannySetupContext("__pyx_fuse_3_setitem", 0);
|
|
|
|
/* "capnp.pyx":108
|
|
*
|
|
* def _setitem(self, index, valid_values value):
|
|
* cdef C_DynamicValue.Reader temp = C_DynamicValue.Reader(value) # <<<<<<<<<<<<<<
|
|
* self.thisptr.set(index, temp)
|
|
*
|
|
*/
|
|
__pyx_v_temp = ::capnp::DynamicValue::Reader(__pyx_v_value);
|
|
|
|
/* "capnp.pyx":109
|
|
* def _setitem(self, index, valid_values value):
|
|
* cdef C_DynamicValue.Reader temp = C_DynamicValue.Reader(value)
|
|
* self.thisptr.set(index, temp) # <<<<<<<<<<<<<<
|
|
*
|
|
* def __setitem__(self, index, value):
|
|
*/
|
|
__pyx_t_1 = __Pyx_PyInt_AsUnsignedInt(__pyx_v_index); if (unlikely((__pyx_t_1 == (unsigned int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 109; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
|
|
__pyx_v_self->thisptr.set(__pyx_t_1, (( ::capnp::DynamicValue::Reader &)__pyx_v_temp));
|
|
|
|
__pyx_r = Py_None; __Pyx_INCREF(Py_None);
|
|
goto __pyx_L0;
|
|
__pyx_L1_error:;
|
|
__Pyx_AddTraceback("capnp._DynamicListBuilder._setitem", __pyx_clineno, __pyx_lineno, __pyx_filename);
|
|
__pyx_r = NULL;
|
|
__pyx_L0:;
|
|
__Pyx_XGIVEREF(__pyx_r);
|
|
__Pyx_RefNannyFinishContext();
|
|
return __pyx_r;
|
|
}
|
|
|
|
/* "capnp.pyx":107
|
|
* return toPython(temp)
|
|
*
|
|
* def _setitem(self, index, valid_values value): # <<<<<<<<<<<<<<
|
|
* cdef C_DynamicValue.Reader temp = C_DynamicValue.Reader(value)
|
|
* self.thisptr.set(index, temp)
|
|
*/
|
|
|
|
/* Python wrapper */
|
|
static PyObject *__pyx_fuse_4__pyx_pw_5capnp_19_DynamicListBuilder_17_setitem(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
|
|
static PyMethodDef __pyx_fuse_4__pyx_mdef_5capnp_19_DynamicListBuilder_17_setitem = {__Pyx_NAMESTR("__pyx_fuse_4_setitem"), (PyCFunction)__pyx_fuse_4__pyx_pw_5capnp_19_DynamicListBuilder_17_setitem, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)};
|
|
static PyObject *__pyx_fuse_4__pyx_pw_5capnp_19_DynamicListBuilder_17_setitem(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
|
|
PyObject *__pyx_v_index = 0;
|
|
int __pyx_v_value;
|
|
int __pyx_lineno = 0;
|
|
const char *__pyx_filename = NULL;
|
|
int __pyx_clineno = 0;
|
|
PyObject *__pyx_r = 0;
|
|
__Pyx_RefNannyDeclarations
|
|
__Pyx_RefNannySetupContext("_setitem (wrapper)", 0);
|
|
{
|
|
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__index,&__pyx_n_s__value,0};
|
|
PyObject* values[2] = {0,0};
|
|
if (unlikely(__pyx_kwds)) {
|
|
Py_ssize_t kw_args;
|
|
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
|
|
switch (pos_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;
|
|
}
|
|
kw_args = PyDict_Size(__pyx_kwds);
|
|
switch (pos_args) {
|
|
case 0:
|
|
if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__index)) != 0)) kw_args--;
|
|
else goto __pyx_L5_argtuple_error;
|
|
case 1:
|
|
if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__value)) != 0)) kw_args--;
|
|
else {
|
|
__Pyx_RaiseArgtupleInvalid("_setitem", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 107; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
|
|
}
|
|
}
|
|
if (unlikely(kw_args > 0)) {
|
|
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_setitem") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 107; __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_index = values[0];
|
|
__pyx_v_value = __Pyx_PyObject_IsTrue(values[1]); if (unlikely((__pyx_v_value == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 107; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
|
|
}
|
|
goto __pyx_L4_argument_unpacking_done;
|
|
__pyx_L5_argtuple_error:;
|
|
__Pyx_RaiseArgtupleInvalid("_setitem", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 107; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
|
|
__pyx_L3_error:;
|
|
__Pyx_AddTraceback("capnp._DynamicListBuilder._setitem", __pyx_clineno, __pyx_lineno, __pyx_filename);
|
|
__Pyx_RefNannyFinishContext();
|
|
return NULL;
|
|
__pyx_L4_argument_unpacking_done:;
|
|
__pyx_r = __pyx_pf_5capnp_19_DynamicListBuilder_16_setitem(((struct __pyx_obj_5capnp__DynamicListBuilder *)__pyx_v_self), __pyx_v_index, __pyx_v_value);
|
|
__Pyx_RefNannyFinishContext();
|
|
return __pyx_r;
|
|
}
|
|
|
|
static PyObject *__pyx_pf_5capnp_19_DynamicListBuilder_16_setitem(struct __pyx_obj_5capnp__DynamicListBuilder *__pyx_v_self, PyObject *__pyx_v_index, int __pyx_v_value) {
|
|
::capnp::DynamicValue::Reader __pyx_v_temp;
|
|
PyObject *__pyx_r = NULL;
|
|
__Pyx_RefNannyDeclarations
|
|
__pyx_t_9capnp_cpp_uint __pyx_t_1;
|
|
int __pyx_lineno = 0;
|
|
const char *__pyx_filename = NULL;
|
|
int __pyx_clineno = 0;
|
|
__Pyx_RefNannySetupContext("__pyx_fuse_4_setitem", 0);
|
|
|
|
/* "capnp.pyx":108
|
|
*
|
|
* def _setitem(self, index, valid_values value):
|
|
* cdef C_DynamicValue.Reader temp = C_DynamicValue.Reader(value) # <<<<<<<<<<<<<<
|
|
* self.thisptr.set(index, temp)
|
|
*
|
|
*/
|
|
__pyx_v_temp = ::capnp::DynamicValue::Reader(__pyx_v_value);
|
|
|
|
/* "capnp.pyx":109
|
|
* def _setitem(self, index, valid_values value):
|
|
* cdef C_DynamicValue.Reader temp = C_DynamicValue.Reader(value)
|
|
* self.thisptr.set(index, temp) # <<<<<<<<<<<<<<
|
|
*
|
|
* def __setitem__(self, index, value):
|
|
*/
|
|
__pyx_t_1 = __Pyx_PyInt_AsUnsignedInt(__pyx_v_index); if (unlikely((__pyx_t_1 == (unsigned int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 109; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
|
|
__pyx_v_self->thisptr.set(__pyx_t_1, (( ::capnp::DynamicValue::Reader &)__pyx_v_temp));
|
|
|
|
__pyx_r = Py_None; __Pyx_INCREF(Py_None);
|
|
goto __pyx_L0;
|
|
__pyx_L1_error:;
|
|
__Pyx_AddTraceback("capnp._DynamicListBuilder._setitem", __pyx_clineno, __pyx_lineno, __pyx_filename);
|
|
__pyx_r = NULL;
|
|
__pyx_L0:;
|
|
__Pyx_XGIVEREF(__pyx_r);
|
|
__Pyx_RefNannyFinishContext();
|
|
return __pyx_r;
|
|
}
|
|
|
|
/* "capnp.pyx":107
|
|
* return toPython(temp)
|
|
*
|
|
* def _setitem(self, index, valid_values value): # <<<<<<<<<<<<<<
|
|
* cdef C_DynamicValue.Reader temp = C_DynamicValue.Reader(value)
|
|
* self.thisptr.set(index, temp)
|
|
*/
|
|
|
|
/* Python wrapper */
|
|
static PyObject *__pyx_fuse_5__pyx_pw_5capnp_19_DynamicListBuilder_19_setitem(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
|
|
static PyMethodDef __pyx_fuse_5__pyx_mdef_5capnp_19_DynamicListBuilder_19_setitem = {__Pyx_NAMESTR("__pyx_fuse_5_setitem"), (PyCFunction)__pyx_fuse_5__pyx_pw_5capnp_19_DynamicListBuilder_19_setitem, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)};
|
|
static PyObject *__pyx_fuse_5__pyx_pw_5capnp_19_DynamicListBuilder_19_setitem(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
|
|
PyObject *__pyx_v_index = 0;
|
|
char *__pyx_v_value;
|
|
int __pyx_lineno = 0;
|
|
const char *__pyx_filename = NULL;
|
|
int __pyx_clineno = 0;
|
|
PyObject *__pyx_r = 0;
|
|
__Pyx_RefNannyDeclarations
|
|
__Pyx_RefNannySetupContext("_setitem (wrapper)", 0);
|
|
{
|
|
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__index,&__pyx_n_s__value,0};
|
|
PyObject* values[2] = {0,0};
|
|
if (unlikely(__pyx_kwds)) {
|
|
Py_ssize_t kw_args;
|
|
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
|
|
switch (pos_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;
|
|
}
|
|
kw_args = PyDict_Size(__pyx_kwds);
|
|
switch (pos_args) {
|
|
case 0:
|
|
if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__index)) != 0)) kw_args--;
|
|
else goto __pyx_L5_argtuple_error;
|
|
case 1:
|
|
if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__value)) != 0)) kw_args--;
|
|
else {
|
|
__Pyx_RaiseArgtupleInvalid("_setitem", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 107; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
|
|
}
|
|
}
|
|
if (unlikely(kw_args > 0)) {
|
|
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_setitem") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 107; __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_index = values[0];
|
|
__pyx_v_value = __Pyx_PyObject_AsString(values[1]); if (unlikely((!__pyx_v_value) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 107; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
|
|
}
|
|
goto __pyx_L4_argument_unpacking_done;
|
|
__pyx_L5_argtuple_error:;
|
|
__Pyx_RaiseArgtupleInvalid("_setitem", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 107; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
|
|
__pyx_L3_error:;
|
|
__Pyx_AddTraceback("capnp._DynamicListBuilder._setitem", __pyx_clineno, __pyx_lineno, __pyx_filename);
|
|
__Pyx_RefNannyFinishContext();
|
|
return NULL;
|
|
__pyx_L4_argument_unpacking_done:;
|
|
__pyx_r = __pyx_pf_5capnp_19_DynamicListBuilder_18_setitem(((struct __pyx_obj_5capnp__DynamicListBuilder *)__pyx_v_self), __pyx_v_index, __pyx_v_value);
|
|
__Pyx_RefNannyFinishContext();
|
|
return __pyx_r;
|
|
}
|
|
|
|
static PyObject *__pyx_pf_5capnp_19_DynamicListBuilder_18_setitem(struct __pyx_obj_5capnp__DynamicListBuilder *__pyx_v_self, PyObject *__pyx_v_index, char *__pyx_v_value) {
|
|
::capnp::DynamicValue::Reader __pyx_v_temp;
|
|
PyObject *__pyx_r = NULL;
|
|
__Pyx_RefNannyDeclarations
|
|
__pyx_t_9capnp_cpp_uint __pyx_t_1;
|
|
int __pyx_lineno = 0;
|
|
const char *__pyx_filename = NULL;
|
|
int __pyx_clineno = 0;
|
|
__Pyx_RefNannySetupContext("__pyx_fuse_5_setitem", 0);
|
|
|
|
/* "capnp.pyx":108
|
|
*
|
|
* def _setitem(self, index, valid_values value):
|
|
* cdef C_DynamicValue.Reader temp = C_DynamicValue.Reader(value) # <<<<<<<<<<<<<<
|
|
* self.thisptr.set(index, temp)
|
|
*
|
|
*/
|
|
__pyx_v_temp = ::capnp::DynamicValue::Reader(__pyx_v_value);
|
|
|
|
/* "capnp.pyx":109
|
|
* def _setitem(self, index, valid_values value):
|
|
* cdef C_DynamicValue.Reader temp = C_DynamicValue.Reader(value)
|
|
* self.thisptr.set(index, temp) # <<<<<<<<<<<<<<
|
|
*
|
|
* def __setitem__(self, index, value):
|
|
*/
|
|
__pyx_t_1 = __Pyx_PyInt_AsUnsignedInt(__pyx_v_index); if (unlikely((__pyx_t_1 == (unsigned int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 109; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
|
|
__pyx_v_self->thisptr.set(__pyx_t_1, (( ::capnp::DynamicValue::Reader &)__pyx_v_temp));
|
|
|
|
__pyx_r = Py_None; __Pyx_INCREF(Py_None);
|
|
goto __pyx_L0;
|
|
__pyx_L1_error:;
|
|
__Pyx_AddTraceback("capnp._DynamicListBuilder._setitem", __pyx_clineno, __pyx_lineno, __pyx_filename);
|
|
__pyx_r = NULL;
|
|
__pyx_L0:;
|
|
__Pyx_XGIVEREF(__pyx_r);
|
|
__Pyx_RefNannyFinishContext();
|
|
return __pyx_r;
|
|
}
|
|
|
|
/* Python wrapper */
|
|
static int __pyx_pw_5capnp_19_DynamicListBuilder_5__setitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_value); /*proto*/
|
|
static int __pyx_pw_5capnp_19_DynamicListBuilder_5__setitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_value) {
|
|
int __pyx_r;
|
|
__Pyx_RefNannyDeclarations
|
|
__Pyx_RefNannySetupContext("__setitem__ (wrapper)", 0);
|
|
__pyx_r = __pyx_pf_5capnp_19_DynamicListBuilder_4__setitem__(((struct __pyx_obj_5capnp__DynamicListBuilder *)__pyx_v_self), ((PyObject *)__pyx_v_index), ((PyObject *)__pyx_v_value));
|
|
__Pyx_RefNannyFinishContext();
|
|
return __pyx_r;
|
|
}
|
|
|
|
/* "capnp.pyx":111
|
|
* self.thisptr.set(index, temp)
|
|
*
|
|
* def __setitem__(self, index, value): # <<<<<<<<<<<<<<
|
|
* size = self.thisptr.size()
|
|
* if index >= size:
|
|
*/
|
|
|
|
static int __pyx_pf_5capnp_19_DynamicListBuilder_4__setitem__(struct __pyx_obj_5capnp__DynamicListBuilder *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_value) {
|
|
PyObject *__pyx_v_size = NULL;
|
|
int __pyx_r;
|
|
__Pyx_RefNannyDeclarations
|
|
PyObject *__pyx_t_1 = NULL;
|
|
int __pyx_t_2;
|
|
PyObject *__pyx_t_3 = NULL;
|
|
PyObject *__pyx_t_4 = NULL;
|
|
int __pyx_lineno = 0;
|
|
const char *__pyx_filename = NULL;
|
|
int __pyx_clineno = 0;
|
|
__Pyx_RefNannySetupContext("__setitem__", 0);
|
|
__Pyx_INCREF(__pyx_v_index);
|
|
|
|
/* "capnp.pyx":112
|
|
*
|
|
* def __setitem__(self, index, value):
|
|
* size = self.thisptr.size() # <<<<<<<<<<<<<<
|
|
* if index >= size:
|
|
* raise IndexError('Out of bounds')
|
|
*/
|
|
__pyx_t_1 = PyLong_FromUnsignedLong(__pyx_v_self->thisptr.size()); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 112; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
|
|
__Pyx_GOTREF(__pyx_t_1);
|
|
__pyx_v_size = __pyx_t_1;
|
|
__pyx_t_1 = 0;
|
|
|
|
/* "capnp.pyx":113
|
|
* def __setitem__(self, index, value):
|
|
* size = self.thisptr.size()
|
|
* if index >= size: # <<<<<<<<<<<<<<
|
|
* raise IndexError('Out of bounds')
|
|
* index = index % size
|
|
*/
|
|
__pyx_t_1 = PyObject_RichCompare(__pyx_v_index, __pyx_v_size, Py_GE); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 113; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
|
|
__pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 113; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
|
|
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
|
|
if (__pyx_t_2) {
|
|
|
|
/* "capnp.pyx":114
|
|
* size = self.thisptr.size()
|
|
* if index >= size:
|
|
* raise IndexError('Out of bounds') # <<<<<<<<<<<<<<
|
|
* index = index % size
|
|
* self._setitem(index, value)
|
|
*/
|
|
__pyx_t_1 = PyObject_Call(__pyx_builtin_IndexError, ((PyObject *)__pyx_k_tuple_14), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 114; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
|
|
__Pyx_GOTREF(__pyx_t_1);
|
|
__Pyx_Raise(__pyx_t_1, 0, 0, 0);
|
|
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
|
|
{__pyx_filename = __pyx_f[0]; __pyx_lineno = 114; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
|
|
goto __pyx_L3;
|
|
}
|
|
__pyx_L3:;
|
|
|
|
/* "capnp.pyx":115
|
|
* if index >= size:
|
|
* raise IndexError('Out of bounds')
|
|
* index = index % size # <<<<<<<<<<<<<<
|
|
* self._setitem(index, value)
|
|
*
|
|
*/
|
|
__pyx_t_1 = PyNumber_Remainder(__pyx_v_index, __pyx_v_size); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 115; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
|
|
__Pyx_GOTREF(__pyx_t_1);
|
|
__Pyx_DECREF(__pyx_v_index);
|
|
__pyx_v_index = __pyx_t_1;
|
|
__pyx_t_1 = 0;
|
|
|
|
/* "capnp.pyx":116
|
|
* raise IndexError('Out of bounds')
|
|
* index = index % size
|
|
* self._setitem(index, value) # <<<<<<<<<<<<<<
|
|
*
|
|
* def __len__(self):
|
|
*/
|
|
__pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s___setitem); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 116; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
|
|
__Pyx_GOTREF(__pyx_t_1);
|
|
__pyx_t_3 = PyTuple_New(2); 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_INCREF(__pyx_v_index);
|
|
PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_index);
|
|
__Pyx_GIVEREF(__pyx_v_index);
|
|
__Pyx_INCREF(__pyx_v_value);
|
|
PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_v_value);
|
|
__Pyx_GIVEREF(__pyx_v_value);
|
|
__pyx_t_4 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_3), NULL); 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_DECREF(__pyx_t_1); __pyx_t_1 = 0;
|
|
__Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
|
|
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
|
|
|
|
__pyx_r = 0;
|
|
goto __pyx_L0;
|
|
__pyx_L1_error:;
|
|
__Pyx_XDECREF(__pyx_t_1);
|
|
__Pyx_XDECREF(__pyx_t_3);
|
|
__Pyx_XDECREF(__pyx_t_4);
|
|
__Pyx_AddTraceback("capnp._DynamicListBuilder.__setitem__", __pyx_clineno, __pyx_lineno, __pyx_filename);
|
|
__pyx_r = -1;
|
|
__pyx_L0:;
|
|
__Pyx_XDECREF(__pyx_v_size);
|
|
__Pyx_XDECREF(__pyx_v_index);
|
|
__Pyx_RefNannyFinishContext();
|
|
return __pyx_r;
|
|
}
|
|
|
|
/* Python wrapper */
|
|
static Py_ssize_t __pyx_pw_5capnp_19_DynamicListBuilder_7__len__(PyObject *__pyx_v_self); /*proto*/
|
|
static Py_ssize_t __pyx_pw_5capnp_19_DynamicListBuilder_7__len__(PyObject *__pyx_v_self) {
|
|
Py_ssize_t __pyx_r;
|
|
__Pyx_RefNannyDeclarations
|
|
__Pyx_RefNannySetupContext("__len__ (wrapper)", 0);
|
|
__pyx_r = __pyx_pf_5capnp_19_DynamicListBuilder_6__len__(((struct __pyx_obj_5capnp__DynamicListBuilder *)__pyx_v_self));
|
|
__Pyx_RefNannyFinishContext();
|
|
return __pyx_r;
|
|
}
|
|
|
|
/* "capnp.pyx":118
|
|
* self._setitem(index, value)
|
|
*
|
|
* def __len__(self): # <<<<<<<<<<<<<<
|
|
* return self.thisptr.size()
|
|
*
|
|
*/
|
|
|
|
static Py_ssize_t __pyx_pf_5capnp_19_DynamicListBuilder_6__len__(struct __pyx_obj_5capnp__DynamicListBuilder *__pyx_v_self) {
|
|
Py_ssize_t __pyx_r;
|
|
__Pyx_RefNannyDeclarations
|
|
__Pyx_RefNannySetupContext("__len__", 0);
|
|
|
|
/* "capnp.pyx":119
|
|
*
|
|
* def __len__(self):
|
|
* return self.thisptr.size() # <<<<<<<<<<<<<<
|
|
*
|
|
* cdef class _List_UInt64_Reader:
|
|
*/
|
|
__pyx_r = __pyx_v_self->thisptr.size();
|
|
goto __pyx_L0;
|
|
|
|
__pyx_r = 0;
|
|
__pyx_L0:;
|
|
__Pyx_RefNannyFinishContext();
|
|
return __pyx_r;
|
|
}
|
|
|
|
/* "capnp.pyx":123
|
|
* cdef class _List_UInt64_Reader:
|
|
* cdef List[UInt64].Reader thisptr
|
|
* cdef _init(self, List[UInt64].Reader other): # <<<<<<<<<<<<<<
|
|
* self.thisptr = other
|
|
* return self
|
|
*/
|
|
|
|
static PyObject *__pyx_f_5capnp_19_List_UInt64_Reader__init(struct __pyx_obj_5capnp__List_UInt64_Reader *__pyx_v_self, ::capnp::List<__pyx_t_5capnp_UInt64>::Reader __pyx_v_other) {
|
|
PyObject *__pyx_r = NULL;
|
|
__Pyx_RefNannyDeclarations
|
|
__Pyx_RefNannySetupContext("_init", 0);
|
|
|
|
/* "capnp.pyx":124
|
|
* cdef List[UInt64].Reader thisptr
|
|
* cdef _init(self, List[UInt64].Reader other):
|
|
* self.thisptr = other # <<<<<<<<<<<<<<
|
|
* return self
|
|
* def __getitem__(self, index):
|
|
*/
|
|
__pyx_v_self->thisptr = __pyx_v_other;
|
|
|
|
/* "capnp.pyx":125
|
|
* cdef _init(self, List[UInt64].Reader other):
|
|
* self.thisptr = other
|
|
* return self # <<<<<<<<<<<<<<
|
|
* def __getitem__(self, index):
|
|
* size = self.thisptr.size()
|
|
*/
|
|
__Pyx_XDECREF(__pyx_r);
|
|
__Pyx_INCREF(((PyObject *)__pyx_v_self));
|
|
__pyx_r = ((PyObject *)__pyx_v_self);
|
|
goto __pyx_L0;
|
|
|
|
__pyx_r = Py_None; __Pyx_INCREF(Py_None);
|
|
__pyx_L0:;
|
|
__Pyx_XGIVEREF(__pyx_r);
|
|
__Pyx_RefNannyFinishContext();
|
|
return __pyx_r;
|
|
}
|
|
|
|
/* Python wrapper */
|
|
static PyObject *__pyx_pw_5capnp_19_List_UInt64_Reader_1__getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_index); /*proto*/
|
|
static PyObject *__pyx_pw_5capnp_19_List_UInt64_Reader_1__getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_index) {
|
|
PyObject *__pyx_r = 0;
|
|
__Pyx_RefNannyDeclarations
|
|
__Pyx_RefNannySetupContext("__getitem__ (wrapper)", 0);
|
|
__pyx_r = __pyx_pf_5capnp_19_List_UInt64_Reader___getitem__(((struct __pyx_obj_5capnp__List_UInt64_Reader *)__pyx_v_self), ((PyObject *)__pyx_v_index));
|
|
__Pyx_RefNannyFinishContext();
|
|
return __pyx_r;
|
|
}
|
|
|
|
/* "capnp.pyx":126
|
|
* self.thisptr = other
|
|
* return self
|
|
* def __getitem__(self, index): # <<<<<<<<<<<<<<
|
|
* size = self.thisptr.size()
|
|
* if index >= size:
|
|
*/
|
|
|
|
static PyObject *__pyx_pf_5capnp_19_List_UInt64_Reader___getitem__(struct __pyx_obj_5capnp__List_UInt64_Reader *__pyx_v_self, PyObject *__pyx_v_index) {
|
|
PyObject *__pyx_v_size = NULL;
|
|
PyObject *__pyx_r = NULL;
|
|
__Pyx_RefNannyDeclarations
|
|
PyObject *__pyx_t_1 = NULL;
|
|
int __pyx_t_2;
|
|
unsigned int __pyx_t_3;
|
|
int __pyx_lineno = 0;
|
|
const char *__pyx_filename = NULL;
|
|
int __pyx_clineno = 0;
|
|
__Pyx_RefNannySetupContext("__getitem__", 0);
|
|
__Pyx_INCREF(__pyx_v_index);
|
|
|
|
/* "capnp.pyx":127
|
|
* return self
|
|
* def __getitem__(self, index):
|
|
* size = self.thisptr.size() # <<<<<<<<<<<<<<
|
|
* if index >= size:
|
|
* raise IndexError('Out of bounds')
|
|
*/
|
|
__pyx_t_1 = PyLong_FromUnsignedLong(__pyx_v_self->thisptr.size()); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 127; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
|
|
__Pyx_GOTREF(__pyx_t_1);
|
|
__pyx_v_size = __pyx_t_1;
|
|
__pyx_t_1 = 0;
|
|
|
|
/* "capnp.pyx":128
|
|
* def __getitem__(self, index):
|
|
* size = self.thisptr.size()
|
|
* if index >= size: # <<<<<<<<<<<<<<
|
|
* raise IndexError('Out of bounds')
|
|
* index = index % size
|
|
*/
|
|
__pyx_t_1 = PyObject_RichCompare(__pyx_v_index, __pyx_v_size, Py_GE); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 128; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
|
|
__pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 128; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
|
|
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
|
|
if (__pyx_t_2) {
|
|
|
|
/* "capnp.pyx":129
|
|
* size = self.thisptr.size()
|
|
* if index >= size:
|
|
* raise IndexError('Out of bounds') # <<<<<<<<<<<<<<
|
|
* index = index % size
|
|
* return self.thisptr[index]
|
|
*/
|
|
__pyx_t_1 = PyObject_Call(__pyx_builtin_IndexError, ((PyObject *)__pyx_k_tuple_15), NULL); 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_Raise(__pyx_t_1, 0, 0, 0);
|
|
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
|
|
{__pyx_filename = __pyx_f[0]; __pyx_lineno = 129; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
|
|
goto __pyx_L3;
|
|
}
|
|
__pyx_L3:;
|
|
|
|
/* "capnp.pyx":130
|
|
* if index >= size:
|
|
* raise IndexError('Out of bounds')
|
|
* index = index % size # <<<<<<<<<<<<<<
|
|
* return self.thisptr[index]
|
|
*
|
|
*/
|
|
__pyx_t_1 = PyNumber_Remainder(__pyx_v_index, __pyx_v_size); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 130; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
|
|
__Pyx_GOTREF(__pyx_t_1);
|
|
__Pyx_DECREF(__pyx_v_index);
|
|
__pyx_v_index = __pyx_t_1;
|
|
__pyx_t_1 = 0;
|
|
|
|
/* "capnp.pyx":131
|
|
* raise IndexError('Out of bounds')
|
|
* index = index % size
|
|
* return self.thisptr[index] # <<<<<<<<<<<<<<
|
|
*
|
|
* def __len__(self):
|
|
*/
|
|
__Pyx_XDECREF(__pyx_r);
|
|
__pyx_t_3 = __Pyx_PyInt_AsUnsignedInt(__pyx_v_index); if (unlikely((__pyx_t_3 == (unsigned int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 131; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
|
|
__pyx_t_1 = __Pyx_PyInt_to_py_uint64_t((__pyx_v_self->thisptr[__pyx_t_3])); 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_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("capnp._List_UInt64_Reader.__getitem__", __pyx_clineno, __pyx_lineno, __pyx_filename);
|
|
__pyx_r = NULL;
|
|
__pyx_L0:;
|
|
__Pyx_XDECREF(__pyx_v_size);
|
|
__Pyx_XDECREF(__pyx_v_index);
|
|
__Pyx_XGIVEREF(__pyx_r);
|
|
__Pyx_RefNannyFinishContext();
|
|
return __pyx_r;
|
|
}
|
|
|
|
/* Python wrapper */
|
|
static Py_ssize_t __pyx_pw_5capnp_19_List_UInt64_Reader_3__len__(PyObject *__pyx_v_self); /*proto*/
|
|
static Py_ssize_t __pyx_pw_5capnp_19_List_UInt64_Reader_3__len__(PyObject *__pyx_v_self) {
|
|
Py_ssize_t __pyx_r;
|
|
__Pyx_RefNannyDeclarations
|
|
__Pyx_RefNannySetupContext("__len__ (wrapper)", 0);
|
|
__pyx_r = __pyx_pf_5capnp_19_List_UInt64_Reader_2__len__(((struct __pyx_obj_5capnp__List_UInt64_Reader *)__pyx_v_self));
|
|
__Pyx_RefNannyFinishContext();
|
|
return __pyx_r;
|
|
}
|
|
|
|
/* "capnp.pyx":133
|
|
* return self.thisptr[index]
|
|
*
|
|
* def __len__(self): # <<<<<<<<<<<<<<
|
|
* return self.thisptr.size()
|
|
*
|
|
*/
|
|
|
|
static Py_ssize_t __pyx_pf_5capnp_19_List_UInt64_Reader_2__len__(struct __pyx_obj_5capnp__List_UInt64_Reader *__pyx_v_self) {
|
|
Py_ssize_t __pyx_r;
|
|
__Pyx_RefNannyDeclarations
|
|
__Pyx_RefNannySetupContext("__len__", 0);
|
|
|
|
/* "capnp.pyx":134
|
|
*
|
|
* def __len__(self):
|
|
* return self.thisptr.size() # <<<<<<<<<<<<<<
|
|
*
|
|
* cdef class _List_Node_Reader:
|
|
*/
|
|
__pyx_r = __pyx_v_self->thisptr.size();
|
|
goto __pyx_L0;
|
|
|
|
__pyx_r = 0;
|
|
__pyx_L0:;
|
|
__Pyx_RefNannyFinishContext();
|
|
return __pyx_r;
|
|
}
|
|
|
|
/* "capnp.pyx":138
|
|
* cdef class _List_Node_Reader:
|
|
* cdef List[C_Node].Reader thisptr
|
|
* cdef _init(self, List[C_Node].Reader other): # <<<<<<<<<<<<<<
|
|
* self.thisptr = other
|
|
* return self
|
|
*/
|
|
|
|
static PyObject *__pyx_f_5capnp_17_List_Node_Reader__init(struct __pyx_obj_5capnp__List_Node_Reader *__pyx_v_self, ::capnp::List< ::capnp::schema::Node>::Reader __pyx_v_other) {
|
|
PyObject *__pyx_r = NULL;
|
|
__Pyx_RefNannyDeclarations
|
|
__Pyx_RefNannySetupContext("_init", 0);
|
|
|
|
/* "capnp.pyx":139
|
|
* cdef List[C_Node].Reader thisptr
|
|
* cdef _init(self, List[C_Node].Reader other):
|
|
* self.thisptr = other # <<<<<<<<<<<<<<
|
|
* return self
|
|
* def __getitem__(self, index):
|
|
*/
|
|
__pyx_v_self->thisptr = __pyx_v_other;
|
|
|
|
/* "capnp.pyx":140
|
|
* cdef _init(self, List[C_Node].Reader other):
|
|
* self.thisptr = other
|
|
* return self # <<<<<<<<<<<<<<
|
|
* def __getitem__(self, index):
|
|
* size = self.thisptr.size()
|
|
*/
|
|
__Pyx_XDECREF(__pyx_r);
|
|
__Pyx_INCREF(((PyObject *)__pyx_v_self));
|
|
__pyx_r = ((PyObject *)__pyx_v_self);
|
|
goto __pyx_L0;
|
|
|
|
__pyx_r = Py_None; __Pyx_INCREF(Py_None);
|
|
__pyx_L0:;
|
|
__Pyx_XGIVEREF(__pyx_r);
|
|
__Pyx_RefNannyFinishContext();
|
|
return __pyx_r;
|
|
}
|
|
|
|
/* Python wrapper */
|
|
static PyObject *__pyx_pw_5capnp_17_List_Node_Reader_1__getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_index); /*proto*/
|
|
static PyObject *__pyx_pw_5capnp_17_List_Node_Reader_1__getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_index) {
|
|
PyObject *__pyx_r = 0;
|
|
__Pyx_RefNannyDeclarations
|
|
__Pyx_RefNannySetupContext("__getitem__ (wrapper)", 0);
|
|
__pyx_r = __pyx_pf_5capnp_17_List_Node_Reader___getitem__(((struct __pyx_obj_5capnp__List_Node_Reader *)__pyx_v_self), ((PyObject *)__pyx_v_index));
|
|
__Pyx_RefNannyFinishContext();
|
|
return __pyx_r;
|
|
}
|
|
|
|
/* "capnp.pyx":141
|
|
* self.thisptr = other
|
|
* return self
|
|
* def __getitem__(self, index): # <<<<<<<<<<<<<<
|
|
* size = self.thisptr.size()
|
|
* if index >= size:
|
|
*/
|
|
|
|
static PyObject *__pyx_pf_5capnp_17_List_Node_Reader___getitem__(struct __pyx_obj_5capnp__List_Node_Reader *__pyx_v_self, PyObject *__pyx_v_index) {
|
|
PyObject *__pyx_v_size = NULL;
|
|
PyObject *__pyx_r = NULL;
|
|
__Pyx_RefNannyDeclarations
|
|
PyObject *__pyx_t_1 = NULL;
|
|
int __pyx_t_2;
|
|
unsigned int __pyx_t_3;
|
|
PyObject *__pyx_t_4 = NULL;
|
|
int __pyx_lineno = 0;
|
|
const char *__pyx_filename = NULL;
|
|
int __pyx_clineno = 0;
|
|
__Pyx_RefNannySetupContext("__getitem__", 0);
|
|
__Pyx_INCREF(__pyx_v_index);
|
|
|
|
/* "capnp.pyx":142
|
|
* return self
|
|
* def __getitem__(self, index):
|
|
* size = self.thisptr.size() # <<<<<<<<<<<<<<
|
|
* if index >= size:
|
|
* raise IndexError('Out of bounds')
|
|
*/
|
|
__pyx_t_1 = PyLong_FromUnsignedLong(__pyx_v_self->thisptr.size()); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 142; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
|
|
__Pyx_GOTREF(__pyx_t_1);
|
|
__pyx_v_size = __pyx_t_1;
|
|
__pyx_t_1 = 0;
|
|
|
|
/* "capnp.pyx":143
|
|
* def __getitem__(self, index):
|
|
* size = self.thisptr.size()
|
|
* if index >= size: # <<<<<<<<<<<<<<
|
|
* raise IndexError('Out of bounds')
|
|
* index = index % size
|
|
*/
|
|
__pyx_t_1 = PyObject_RichCompare(__pyx_v_index, __pyx_v_size, Py_GE); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 143; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
|
|
__pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 143; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
|
|
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
|
|
if (__pyx_t_2) {
|
|
|
|
/* "capnp.pyx":144
|
|
* size = self.thisptr.size()
|
|
* if index >= size:
|
|
* raise IndexError('Out of bounds') # <<<<<<<<<<<<<<
|
|
* index = index % size
|
|
* return _NodeReader().init(<C_Node.Reader>self.thisptr[index])
|
|
*/
|
|
__pyx_t_1 = PyObject_Call(__pyx_builtin_IndexError, ((PyObject *)__pyx_k_tuple_16), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 144; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
|
|
__Pyx_GOTREF(__pyx_t_1);
|
|
__Pyx_Raise(__pyx_t_1, 0, 0, 0);
|
|
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
|
|
{__pyx_filename = __pyx_f[0]; __pyx_lineno = 144; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
|
|
goto __pyx_L3;
|
|
}
|
|
__pyx_L3:;
|
|
|
|
/* "capnp.pyx":145
|
|
* if index >= size:
|
|
* raise IndexError('Out of bounds')
|
|
* index = index % size # <<<<<<<<<<<<<<
|
|
* return _NodeReader().init(<C_Node.Reader>self.thisptr[index])
|
|
*
|
|
*/
|
|
__pyx_t_1 = PyNumber_Remainder(__pyx_v_index, __pyx_v_size); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 145; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
|
|
__Pyx_GOTREF(__pyx_t_1);
|
|
__Pyx_DECREF(__pyx_v_index);
|
|
__pyx_v_index = __pyx_t_1;
|
|
__pyx_t_1 = 0;
|
|
|
|
/* "capnp.pyx":146
|
|
* raise IndexError('Out of bounds')
|
|
* index = index % size
|
|
* return _NodeReader().init(<C_Node.Reader>self.thisptr[index]) # <<<<<<<<<<<<<<
|
|
*
|
|
* def __len__(self):
|
|
*/
|
|
__Pyx_XDECREF(__pyx_r);
|
|
__pyx_t_1 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_6schema__NodeReader)), ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 146; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
|
|
__Pyx_GOTREF(__pyx_t_1);
|
|
__pyx_t_3 = __Pyx_PyInt_AsUnsignedInt(__pyx_v_index); if (unlikely((__pyx_t_3 == (unsigned int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 146; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
|
|
__pyx_t_4 = ((struct __pyx_vtabstruct_6schema__NodeReader *)((struct __pyx_obj_6schema__NodeReader *)__pyx_t_1)->__pyx_vtab)->init(((struct __pyx_obj_6schema__NodeReader *)__pyx_t_1), (( ::capnp::schema::Node::Reader)(__pyx_v_self->thisptr[__pyx_t_3]))); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 146; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
|
|
__Pyx_GOTREF(__pyx_t_4);
|
|
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
|
|
__pyx_r = __pyx_t_4;
|
|
__pyx_t_4 = 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_4);
|
|
__Pyx_AddTraceback("capnp._List_Node_Reader.__getitem__", __pyx_clineno, __pyx_lineno, __pyx_filename);
|
|
__pyx_r = NULL;
|
|
__pyx_L0:;
|
|
__Pyx_XDECREF(__pyx_v_size);
|
|
__Pyx_XDECREF(__pyx_v_index);
|
|
__Pyx_XGIVEREF(__pyx_r);
|
|
__Pyx_RefNannyFinishContext();
|
|
return __pyx_r;
|
|
}
|
|
|
|
/* Python wrapper */
|
|
static Py_ssize_t __pyx_pw_5capnp_17_List_Node_Reader_3__len__(PyObject *__pyx_v_self); /*proto*/
|
|
static Py_ssize_t __pyx_pw_5capnp_17_List_Node_Reader_3__len__(PyObject *__pyx_v_self) {
|
|
Py_ssize_t __pyx_r;
|
|
__Pyx_RefNannyDeclarations
|
|
__Pyx_RefNannySetupContext("__len__ (wrapper)", 0);
|
|
__pyx_r = __pyx_pf_5capnp_17_List_Node_Reader_2__len__(((struct __pyx_obj_5capnp__List_Node_Reader *)__pyx_v_self));
|
|
__Pyx_RefNannyFinishContext();
|
|
return __pyx_r;
|
|
}
|
|
|
|
/* "capnp.pyx":148
|
|
* return _NodeReader().init(<C_Node.Reader>self.thisptr[index])
|
|
*
|
|
* def __len__(self): # <<<<<<<<<<<<<<
|
|
* return self.thisptr.size()
|
|
*
|
|
*/
|
|
|
|
static Py_ssize_t __pyx_pf_5capnp_17_List_Node_Reader_2__len__(struct __pyx_obj_5capnp__List_Node_Reader *__pyx_v_self) {
|
|
Py_ssize_t __pyx_r;
|
|
__Pyx_RefNannyDeclarations
|
|
__Pyx_RefNannySetupContext("__len__", 0);
|
|
|
|
/* "capnp.pyx":149
|
|
*
|
|
* def __len__(self):
|
|
* return self.thisptr.size() # <<<<<<<<<<<<<<
|
|
*
|
|
* cdef class _DynamicValueReader:
|
|
*/
|
|
__pyx_r = __pyx_v_self->thisptr.size();
|
|
goto __pyx_L0;
|
|
|
|
__pyx_r = 0;
|
|
__pyx_L0:;
|
|
__Pyx_RefNannyFinishContext();
|
|
return __pyx_r;
|
|
}
|
|
|
|
/* "capnp.pyx":153
|
|
* cdef class _DynamicValueReader:
|
|
* cdef C_DynamicValue.Reader thisptr
|
|
* cdef _init(self, C_DynamicValue.Reader other): # <<<<<<<<<<<<<<
|
|
* self.thisptr = other
|
|
* return self
|
|
*/
|
|
|
|
static PyObject *__pyx_f_5capnp_19_DynamicValueReader__init(struct __pyx_obj_5capnp__DynamicValueReader *__pyx_v_self, ::capnp::DynamicValue::Reader __pyx_v_other) {
|
|
PyObject *__pyx_r = NULL;
|
|
__Pyx_RefNannyDeclarations
|
|
__Pyx_RefNannySetupContext("_init", 0);
|
|
|
|
/* "capnp.pyx":154
|
|
* cdef C_DynamicValue.Reader thisptr
|
|
* cdef _init(self, C_DynamicValue.Reader other):
|
|
* self.thisptr = other # <<<<<<<<<<<<<<
|
|
* return self
|
|
*
|
|
*/
|
|
__pyx_v_self->thisptr = __pyx_v_other;
|
|
|
|
/* "capnp.pyx":155
|
|
* cdef _init(self, C_DynamicValue.Reader other):
|
|
* self.thisptr = other
|
|
* return self # <<<<<<<<<<<<<<
|
|
*
|
|
* cpdef int getType(self):
|
|
*/
|
|
__Pyx_XDECREF(__pyx_r);
|
|
__Pyx_INCREF(((PyObject *)__pyx_v_self));
|
|
__pyx_r = ((PyObject *)__pyx_v_self);
|
|
goto __pyx_L0;
|
|
|
|
__pyx_r = Py_None; __Pyx_INCREF(Py_None);
|
|
__pyx_L0:;
|
|
__Pyx_XGIVEREF(__pyx_r);
|
|
__Pyx_RefNannyFinishContext();
|
|
return __pyx_r;
|
|
}
|
|
|
|
/* "capnp.pyx":157
|
|
* return self
|
|
*
|
|
* cpdef int getType(self): # <<<<<<<<<<<<<<
|
|
* return self.thisptr.getType()
|
|
*
|
|
*/
|
|
|
|
static PyObject *__pyx_pw_5capnp_19_DynamicValueReader_1getType(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
|
|
static int __pyx_f_5capnp_19_DynamicValueReader_getType(struct __pyx_obj_5capnp__DynamicValueReader *__pyx_v_self, int __pyx_skip_dispatch) {
|
|
int __pyx_r;
|
|
__Pyx_RefNannyDeclarations
|
|
PyObject *__pyx_t_1 = NULL;
|
|
PyObject *__pyx_t_2 = NULL;
|
|
int __pyx_t_3;
|
|
int __pyx_lineno = 0;
|
|
const char *__pyx_filename = NULL;
|
|
int __pyx_clineno = 0;
|
|
__Pyx_RefNannySetupContext("getType", 0);
|
|
/* Check if called by wrapper */
|
|
if (unlikely(__pyx_skip_dispatch)) ;
|
|
/* Check if overridden in Python */
|
|
else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
|
|
__pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s__getType); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 157; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
|
|
__Pyx_GOTREF(__pyx_t_1);
|
|
if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_5capnp_19_DynamicValueReader_1getType)) {
|
|
__pyx_t_2 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 157; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
|
|
__Pyx_GOTREF(__pyx_t_2);
|
|
__pyx_t_3 = __Pyx_PyInt_AsInt(__pyx_t_2); if (unlikely((__pyx_t_3 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 157; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
|
|
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
|
|
__pyx_r = __pyx_t_3;
|
|
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
|
|
goto __pyx_L0;
|
|
}
|
|
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
|
|
}
|
|
|
|
/* "capnp.pyx":158
|
|
*
|
|
* cpdef int getType(self):
|
|
* return self.thisptr.getType() # <<<<<<<<<<<<<<
|
|
*
|
|
* cpdef toPython(self):
|
|
*/
|
|
__pyx_r = __pyx_v_self->thisptr.getType();
|
|
goto __pyx_L0;
|
|
|
|
__pyx_r = 0;
|
|
goto __pyx_L0;
|
|
__pyx_L1_error:;
|
|
__Pyx_XDECREF(__pyx_t_1);
|
|
__Pyx_XDECREF(__pyx_t_2);
|
|
__Pyx_WriteUnraisable("capnp._DynamicValueReader.getType", __pyx_clineno, __pyx_lineno, __pyx_filename);
|
|
__pyx_r = 0;
|
|
__pyx_L0:;
|
|
__Pyx_RefNannyFinishContext();
|
|
return __pyx_r;
|
|
}
|
|
|
|
/* Python wrapper */
|
|
static PyObject *__pyx_pw_5capnp_19_DynamicValueReader_1getType(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
|
|
static PyObject *__pyx_pw_5capnp_19_DynamicValueReader_1getType(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
|
|
PyObject *__pyx_r = 0;
|
|
__Pyx_RefNannyDeclarations
|
|
__Pyx_RefNannySetupContext("getType (wrapper)", 0);
|
|
__pyx_r = __pyx_pf_5capnp_19_DynamicValueReader_getType(((struct __pyx_obj_5capnp__DynamicValueReader *)__pyx_v_self));
|
|
__Pyx_RefNannyFinishContext();
|
|
return __pyx_r;
|
|
}
|
|
|
|
/* "capnp.pyx":157
|
|
* return self
|
|
*
|
|
* cpdef int getType(self): # <<<<<<<<<<<<<<
|
|
* return self.thisptr.getType()
|
|
*
|
|
*/
|
|
|
|
static PyObject *__pyx_pf_5capnp_19_DynamicValueReader_getType(struct __pyx_obj_5capnp__DynamicValueReader *__pyx_v_self) {
|
|
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("getType", 0);
|
|
__Pyx_XDECREF(__pyx_r);
|
|
__pyx_t_1 = PyInt_FromLong(((struct __pyx_vtabstruct_5capnp__DynamicValueReader *)__pyx_v_self->__pyx_vtab)->getType(__pyx_v_self, 1)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 157; __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("capnp._DynamicValueReader.getType", __pyx_clineno, __pyx_lineno, __pyx_filename);
|
|
__pyx_r = NULL;
|
|
__pyx_L0:;
|
|
__Pyx_XGIVEREF(__pyx_r);
|
|
__Pyx_RefNannyFinishContext();
|
|
return __pyx_r;
|
|
}
|
|
|
|
/* "capnp.pyx":160
|
|
* return self.thisptr.getType()
|
|
*
|
|
* cpdef toPython(self): # <<<<<<<<<<<<<<
|
|
* cdef int type = self.getType()
|
|
* if type == capnp.TYPE_BOOL:
|
|
*/
|
|
|
|
static PyObject *__pyx_pw_5capnp_19_DynamicValueReader_3toPython(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
|
|
static PyObject *__pyx_f_5capnp_19_DynamicValueReader_toPython(struct __pyx_obj_5capnp__DynamicValueReader *__pyx_v_self, int __pyx_skip_dispatch) {
|
|
int __pyx_v_type;
|
|
::capnp::Data::Reader __pyx_v_temp;
|
|
PyObject *__pyx_r = NULL;
|
|
__Pyx_RefNannyDeclarations
|
|
PyObject *__pyx_t_1 = NULL;
|
|
PyObject *__pyx_t_2 = NULL;
|
|
int __pyx_t_3;
|
|
::capnp::EnumSchema::Enumerant __pyx_t_4;
|
|
PyObject *__pyx_t_5 = NULL;
|
|
int __pyx_lineno = 0;
|
|
const char *__pyx_filename = NULL;
|
|
int __pyx_clineno = 0;
|
|
__Pyx_RefNannySetupContext("toPython", 0);
|
|
/* Check if called by wrapper */
|
|
if (unlikely(__pyx_skip_dispatch)) ;
|
|
/* Check if overridden in Python */
|
|
else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
|
|
__pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s__toPython); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 160; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
|
|
__Pyx_GOTREF(__pyx_t_1);
|
|
if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_5capnp_19_DynamicValueReader_3toPython)) {
|
|
__Pyx_XDECREF(__pyx_r);
|
|
__pyx_t_2 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 160; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
|
|
__Pyx_GOTREF(__pyx_t_2);
|
|
__pyx_r = __pyx_t_2;
|
|
__pyx_t_2 = 0;
|
|
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
|
|
goto __pyx_L0;
|
|
}
|
|
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
|
|
}
|
|
|
|
/* "capnp.pyx":161
|
|
*
|
|
* cpdef toPython(self):
|
|
* cdef int type = self.getType() # <<<<<<<<<<<<<<
|
|
* if type == capnp.TYPE_BOOL:
|
|
* return self.thisptr.asBool()
|
|
*/
|
|
__pyx_v_type = ((struct __pyx_vtabstruct_5capnp__DynamicValueReader *)__pyx_v_self->__pyx_vtab)->getType(__pyx_v_self, 0);
|
|
|
|
/* "capnp.pyx":162
|
|
* cpdef toPython(self):
|
|
* cdef int type = self.getType()
|
|
* if type == capnp.TYPE_BOOL: # <<<<<<<<<<<<<<
|
|
* return self.thisptr.asBool()
|
|
* elif type == capnp.TYPE_INT:
|
|
*/
|
|
__pyx_t_3 = ((__pyx_v_type == ::capnp::DynamicValue::BOOL) != 0);
|
|
if (__pyx_t_3) {
|
|
|
|
/* "capnp.pyx":163
|
|
* cdef int type = self.getType()
|
|
* if type == capnp.TYPE_BOOL:
|
|
* return self.thisptr.asBool() # <<<<<<<<<<<<<<
|
|
* elif type == capnp.TYPE_INT:
|
|
* return self.thisptr.asInt()
|
|
*/
|
|
__Pyx_XDECREF(__pyx_r);
|
|
__pyx_t_1 = __Pyx_PyBool_FromLong(__pyx_v_self->thisptr.as<bool>()); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 163; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
|
|
__Pyx_GOTREF(__pyx_t_1);
|
|
__pyx_r = __pyx_t_1;
|
|
__pyx_t_1 = 0;
|
|
goto __pyx_L0;
|
|
goto __pyx_L3;
|
|
}
|
|
|
|
/* "capnp.pyx":164
|
|
* if type == capnp.TYPE_BOOL:
|
|
* return self.thisptr.asBool()
|
|
* elif type == capnp.TYPE_INT: # <<<<<<<<<<<<<<
|
|
* return self.thisptr.asInt()
|
|
* elif type == capnp.TYPE_UINT:
|
|
*/
|
|
__pyx_t_3 = ((__pyx_v_type == ::capnp::DynamicValue::INT) != 0);
|
|
if (__pyx_t_3) {
|
|
|
|
/* "capnp.pyx":165
|
|
* return self.thisptr.asBool()
|
|
* elif type == capnp.TYPE_INT:
|
|
* return self.thisptr.asInt() # <<<<<<<<<<<<<<
|
|
* elif type == capnp.TYPE_UINT:
|
|
* return self.thisptr.asUint()
|
|
*/
|
|
__Pyx_XDECREF(__pyx_r);
|
|
__pyx_t_1 = __Pyx_PyInt_to_py_int64_t(__pyx_v_self->thisptr.as<int64_t>()); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 165; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
|
|
__Pyx_GOTREF(__pyx_t_1);
|
|
__pyx_r = __pyx_t_1;
|
|
__pyx_t_1 = 0;
|
|
goto __pyx_L0;
|
|
goto __pyx_L3;
|
|
}
|
|
|
|
/* "capnp.pyx":166
|
|
* elif type == capnp.TYPE_INT:
|
|
* return self.thisptr.asInt()
|
|
* elif type == capnp.TYPE_UINT: # <<<<<<<<<<<<<<
|
|
* return self.thisptr.asUint()
|
|
* elif type == capnp.TYPE_FLOAT:
|
|
*/
|
|
__pyx_t_3 = ((__pyx_v_type == ::capnp::DynamicValue::UINT) != 0);
|
|
if (__pyx_t_3) {
|
|
|
|
/* "capnp.pyx":167
|
|
* return self.thisptr.asInt()
|
|
* elif type == capnp.TYPE_UINT:
|
|
* return self.thisptr.asUint() # <<<<<<<<<<<<<<
|
|
* elif type == capnp.TYPE_FLOAT:
|
|
* return self.thisptr.asDouble()
|
|
*/
|
|
__Pyx_XDECREF(__pyx_r);
|
|
__pyx_t_1 = __Pyx_PyInt_to_py_uint64_t(__pyx_v_self->thisptr.as<uint64_t>()); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 167; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
|
|
__Pyx_GOTREF(__pyx_t_1);
|
|
__pyx_r = __pyx_t_1;
|
|
__pyx_t_1 = 0;
|
|
goto __pyx_L0;
|
|
goto __pyx_L3;
|
|
}
|
|
|
|
/* "capnp.pyx":168
|
|
* elif type == capnp.TYPE_UINT:
|
|
* return self.thisptr.asUint()
|
|
* elif type == capnp.TYPE_FLOAT: # <<<<<<<<<<<<<<
|
|
* return self.thisptr.asDouble()
|
|
* elif type == capnp.TYPE_TEXT:
|
|
*/
|
|
__pyx_t_3 = ((__pyx_v_type == ::capnp::DynamicValue::FLOAT) != 0);
|
|
if (__pyx_t_3) {
|
|
|
|
/* "capnp.pyx":169
|
|
* return self.thisptr.asUint()
|
|
* elif type == capnp.TYPE_FLOAT:
|
|
* return self.thisptr.asDouble() # <<<<<<<<<<<<<<
|
|
* elif type == capnp.TYPE_TEXT:
|
|
* return self.thisptr.asText()[:]
|
|
*/
|
|
__Pyx_XDECREF(__pyx_r);
|
|
__pyx_t_1 = PyFloat_FromDouble(__pyx_v_self->thisptr.as<double>()); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 169; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
|
|
__Pyx_GOTREF(__pyx_t_1);
|
|
__pyx_r = __pyx_t_1;
|
|
__pyx_t_1 = 0;
|
|
goto __pyx_L0;
|
|
goto __pyx_L3;
|
|
}
|
|
|
|
/* "capnp.pyx":170
|
|
* elif type == capnp.TYPE_FLOAT:
|
|
* return self.thisptr.asDouble()
|
|
* elif type == capnp.TYPE_TEXT: # <<<<<<<<<<<<<<
|
|
* return self.thisptr.asText()[:]
|
|
* elif type == capnp.TYPE_DATA:
|
|
*/
|
|
__pyx_t_3 = ((__pyx_v_type == ::capnp::DynamicValue::TEXT) != 0);
|
|
if (__pyx_t_3) {
|
|
|
|
/* "capnp.pyx":171
|
|
* return self.thisptr.asDouble()
|
|
* elif type == capnp.TYPE_TEXT:
|
|
* return self.thisptr.asText()[:] # <<<<<<<<<<<<<<
|
|
* elif type == capnp.TYPE_DATA:
|
|
* temp = self.thisptr.asData()
|
|
*/
|
|
__Pyx_XDECREF(__pyx_r);
|
|
__pyx_t_1 = __Pyx_PyBytes_FromString(__pyx_v_self->thisptr.as< ::capnp::Text>().cStr() + 0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 171; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
|
|
__Pyx_GOTREF(((PyObject *)__pyx_t_1));
|
|
__pyx_r = ((PyObject *)__pyx_t_1);
|
|
__pyx_t_1 = 0;
|
|
goto __pyx_L0;
|
|
goto __pyx_L3;
|
|
}
|
|
|
|
/* "capnp.pyx":172
|
|
* elif type == capnp.TYPE_TEXT:
|
|
* return self.thisptr.asText()[:]
|
|
* elif type == capnp.TYPE_DATA: # <<<<<<<<<<<<<<
|
|
* temp = self.thisptr.asData()
|
|
* return (<char*>temp.begin())[:temp.size()]
|
|
*/
|
|
__pyx_t_3 = ((__pyx_v_type == ::capnp::DynamicValue::DATA) != 0);
|
|
if (__pyx_t_3) {
|
|
|
|
/* "capnp.pyx":173
|
|
* return self.thisptr.asText()[:]
|
|
* elif type == capnp.TYPE_DATA:
|
|
* temp = self.thisptr.asData() # <<<<<<<<<<<<<<
|
|
* return (<char*>temp.begin())[:temp.size()]
|
|
* elif type == capnp.TYPE_LIST:
|
|
*/
|
|
__pyx_v_temp = __pyx_v_self->thisptr.as< ::capnp::Data>();
|
|
|
|
/* "capnp.pyx":174
|
|
* elif type == capnp.TYPE_DATA:
|
|
* temp = self.thisptr.asData()
|
|
* return (<char*>temp.begin())[:temp.size()] # <<<<<<<<<<<<<<
|
|
* elif type == capnp.TYPE_LIST:
|
|
* return list(_DynamicListReader()._init(self.thisptr.asList()))
|
|
*/
|
|
__Pyx_XDECREF(__pyx_r);
|
|
__pyx_t_1 = __Pyx_PyBytes_FromStringAndSize(((char *)__pyx_v_temp.begin()) + 0, __pyx_v_temp.size() - 0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 174; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
|
|
__Pyx_GOTREF(((PyObject *)__pyx_t_1));
|
|
__pyx_r = ((PyObject *)__pyx_t_1);
|
|
__pyx_t_1 = 0;
|
|
goto __pyx_L0;
|
|
goto __pyx_L3;
|
|
}
|
|
|
|
/* "capnp.pyx":175
|
|
* temp = self.thisptr.asData()
|
|
* return (<char*>temp.begin())[:temp.size()]
|
|
* elif type == capnp.TYPE_LIST: # <<<<<<<<<<<<<<
|
|
* return list(_DynamicListReader()._init(self.thisptr.asList()))
|
|
* elif type == capnp.TYPE_STRUCT:
|
|
*/
|
|
__pyx_t_3 = ((__pyx_v_type == ::capnp::DynamicValue::LIST) != 0);
|
|
if (__pyx_t_3) {
|
|
|
|
/* "capnp.pyx":176
|
|
* return (<char*>temp.begin())[:temp.size()]
|
|
* elif type == capnp.TYPE_LIST:
|
|
* return list(_DynamicListReader()._init(self.thisptr.asList())) # <<<<<<<<<<<<<<
|
|
* elif type == capnp.TYPE_STRUCT:
|
|
* return _DynamicStructReader()._init(self.thisptr.asStruct())
|
|
*/
|
|
__Pyx_XDECREF(__pyx_r);
|
|
__pyx_t_1 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_5capnp__DynamicListReader)), ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 176; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
|
|
__Pyx_GOTREF(__pyx_t_1);
|
|
__pyx_t_2 = ((struct __pyx_vtabstruct_5capnp__DynamicListReader *)((struct __pyx_obj_5capnp__DynamicListReader *)__pyx_t_1)->__pyx_vtab)->_init(((struct __pyx_obj_5capnp__DynamicListReader *)__pyx_t_1), __pyx_v_self->thisptr.as< ::capnp::DynamicList>()); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 176; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
|
|
__Pyx_GOTREF(__pyx_t_2);
|
|
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
|
|
__pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 176; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
|
|
__Pyx_GOTREF(__pyx_t_1);
|
|
PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_2);
|
|
__Pyx_GIVEREF(__pyx_t_2);
|
|
__pyx_t_2 = 0;
|
|
__pyx_t_2 = PyObject_Call(((PyObject *)((PyObject*)(&PyList_Type))), ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 176; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
|
|
__Pyx_GOTREF(__pyx_t_2);
|
|
__Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
|
|
__pyx_r = __pyx_t_2;
|
|
__pyx_t_2 = 0;
|
|
goto __pyx_L0;
|
|
goto __pyx_L3;
|
|
}
|
|
|
|
/* "capnp.pyx":177
|
|
* elif type == capnp.TYPE_LIST:
|
|
* return list(_DynamicListReader()._init(self.thisptr.asList()))
|
|
* elif type == capnp.TYPE_STRUCT: # <<<<<<<<<<<<<<
|
|
* return _DynamicStructReader()._init(self.thisptr.asStruct())
|
|
* elif type == capnp.TYPE_UNION:
|
|
*/
|
|
__pyx_t_3 = ((__pyx_v_type == ::capnp::DynamicValue::STRUCT) != 0);
|
|
if (__pyx_t_3) {
|
|
|
|
/* "capnp.pyx":178
|
|
* return list(_DynamicListReader()._init(self.thisptr.asList()))
|
|
* elif type == capnp.TYPE_STRUCT:
|
|
* return _DynamicStructReader()._init(self.thisptr.asStruct()) # <<<<<<<<<<<<<<
|
|
* elif type == capnp.TYPE_UNION:
|
|
* return _DynamicUnionReader()._init(self.thisptr.asUnion())
|
|
*/
|
|
__Pyx_XDECREF(__pyx_r);
|
|
__pyx_t_2 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_5capnp__DynamicStructReader)), ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 178; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
|
|
__Pyx_GOTREF(__pyx_t_2);
|
|
__pyx_t_1 = ((struct __pyx_vtabstruct_5capnp__DynamicStructReader *)((struct __pyx_obj_5capnp__DynamicStructReader *)__pyx_t_2)->__pyx_vtab)->_init(((struct __pyx_obj_5capnp__DynamicStructReader *)__pyx_t_2), __pyx_v_self->thisptr.as< ::capnp::DynamicStruct>()); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 178; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
|
|
__Pyx_GOTREF(__pyx_t_1);
|
|
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
|
|
__pyx_r = __pyx_t_1;
|
|
__pyx_t_1 = 0;
|
|
goto __pyx_L0;
|
|
goto __pyx_L3;
|
|
}
|
|
|
|
/* "capnp.pyx":179
|
|
* elif type == capnp.TYPE_STRUCT:
|
|
* return _DynamicStructReader()._init(self.thisptr.asStruct())
|
|
* elif type == capnp.TYPE_UNION: # <<<<<<<<<<<<<<
|
|
* return _DynamicUnionReader()._init(self.thisptr.asUnion())
|
|
* elif type == capnp.TYPE_ENUM:
|
|
*/
|
|
__pyx_t_3 = ((__pyx_v_type == ::capnp::DynamicValue::UNION) != 0);
|
|
if (__pyx_t_3) {
|
|
|
|
/* "capnp.pyx":180
|
|
* return _DynamicStructReader()._init(self.thisptr.asStruct())
|
|
* elif type == capnp.TYPE_UNION:
|
|
* return _DynamicUnionReader()._init(self.thisptr.asUnion()) # <<<<<<<<<<<<<<
|
|
* elif type == capnp.TYPE_ENUM:
|
|
* return fixMaybe(self.thisptr.asEnum().getEnumerant()).getProto().getName().cStr()
|
|
*/
|
|
__Pyx_XDECREF(__pyx_r);
|
|
__pyx_t_1 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_5capnp__DynamicUnionReader)), ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 180; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
|
|
__Pyx_GOTREF(__pyx_t_1);
|
|
__pyx_t_2 = ((struct __pyx_vtabstruct_5capnp__DynamicUnionReader *)((struct __pyx_obj_5capnp__DynamicUnionReader *)__pyx_t_1)->__pyx_vtab)->_init(((struct __pyx_obj_5capnp__DynamicUnionReader *)__pyx_t_1), __pyx_v_self->thisptr.as< ::capnp::DynamicUnion>()); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 180; __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;
|
|
goto __pyx_L0;
|
|
goto __pyx_L3;
|
|
}
|
|
|
|
/* "capnp.pyx":181
|
|
* elif type == capnp.TYPE_UNION:
|
|
* return _DynamicUnionReader()._init(self.thisptr.asUnion())
|
|
* elif type == capnp.TYPE_ENUM: # <<<<<<<<<<<<<<
|
|
* return fixMaybe(self.thisptr.asEnum().getEnumerant()).getProto().getName().cStr()
|
|
* elif type == capnp.TYPE_VOID:
|
|
*/
|
|
__pyx_t_3 = ((__pyx_v_type == ::capnp::DynamicValue::ENUM) != 0);
|
|
if (__pyx_t_3) {
|
|
|
|
/* "capnp.pyx":182
|
|
* return _DynamicUnionReader()._init(self.thisptr.asUnion())
|
|
* elif type == capnp.TYPE_ENUM:
|
|
* return fixMaybe(self.thisptr.asEnum().getEnumerant()).getProto().getName().cStr() # <<<<<<<<<<<<<<
|
|
* elif type == capnp.TYPE_VOID:
|
|
* return None
|
|
*/
|
|
__Pyx_XDECREF(__pyx_r);
|
|
try {
|
|
__pyx_t_4 = fixMaybe(__pyx_v_self->thisptr.as< ::capnp::DynamicEnum>().getEnumerant());
|
|
} catch(...) {
|
|
__Pyx_CppExn2PyErr();
|
|
{__pyx_filename = __pyx_f[0]; __pyx_lineno = 182; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
|
|
}
|
|
__pyx_t_2 = __Pyx_PyBytes_FromString(__pyx_t_4.getProto().getName().cStr()); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 182; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
|
|
__Pyx_GOTREF(((PyObject *)__pyx_t_2));
|
|
__pyx_r = ((PyObject *)__pyx_t_2);
|
|
__pyx_t_2 = 0;
|
|
goto __pyx_L0;
|
|
goto __pyx_L3;
|
|
}
|
|
|
|
/* "capnp.pyx":183
|
|
* elif type == capnp.TYPE_ENUM:
|
|
* return fixMaybe(self.thisptr.asEnum().getEnumerant()).getProto().getName().cStr()
|
|
* elif type == capnp.TYPE_VOID: # <<<<<<<<<<<<<<
|
|
* return None
|
|
* elif type == capnp.TYPE_UNKOWN:
|
|
*/
|
|
__pyx_t_3 = ((__pyx_v_type == ::capnp::DynamicValue::VOID) != 0);
|
|
if (__pyx_t_3) {
|
|
|
|
/* "capnp.pyx":184
|
|
* return fixMaybe(self.thisptr.asEnum().getEnumerant()).getProto().getName().cStr()
|
|
* elif type == capnp.TYPE_VOID:
|
|
* return None # <<<<<<<<<<<<<<
|
|
* elif type == capnp.TYPE_UNKOWN:
|
|
* raise ValueError("Cannot convert type to Python. Type is unknown by capnproto library")
|
|
*/
|
|
__Pyx_XDECREF(__pyx_r);
|
|
__Pyx_INCREF(Py_None);
|
|
__pyx_r = Py_None;
|
|
goto __pyx_L0;
|
|
goto __pyx_L3;
|
|
}
|
|
|
|
/* "capnp.pyx":185
|
|
* elif type == capnp.TYPE_VOID:
|
|
* return None
|
|
* elif type == capnp.TYPE_UNKOWN: # <<<<<<<<<<<<<<
|
|
* raise ValueError("Cannot convert type to Python. Type is unknown by capnproto library")
|
|
* else:
|
|
*/
|
|
__pyx_t_2 = PyInt_FromLong(__pyx_v_type); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 185; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
|
|
__Pyx_GOTREF(__pyx_t_2);
|
|
__pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s__capnp); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 185; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
|
|
__Pyx_GOTREF(__pyx_t_1);
|
|
__pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s__TYPE_UNKOWN); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 185; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
|
|
__Pyx_GOTREF(__pyx_t_5);
|
|
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
|
|
__pyx_t_1 = PyObject_RichCompare(__pyx_t_2, __pyx_t_5, Py_EQ); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 185; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
|
|
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
|
|
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
|
|
__pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 185; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
|
|
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
|
|
if (__pyx_t_3) {
|
|
|
|
/* "capnp.pyx":186
|
|
* return None
|
|
* elif type == capnp.TYPE_UNKOWN:
|
|
* raise ValueError("Cannot convert type to Python. Type is unknown by capnproto library") # <<<<<<<<<<<<<<
|
|
* else:
|
|
* raise ValueError("Cannot convert type to Python. Type is unhandled by capnproto library")
|
|
*/
|
|
__pyx_t_1 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_k_tuple_18), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 186; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
|
|
__Pyx_GOTREF(__pyx_t_1);
|
|
__Pyx_Raise(__pyx_t_1, 0, 0, 0);
|
|
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
|
|
{__pyx_filename = __pyx_f[0]; __pyx_lineno = 186; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
|
|
goto __pyx_L3;
|
|
}
|
|
/*else*/ {
|
|
|
|
/* "capnp.pyx":188
|
|
* raise ValueError("Cannot convert type to Python. Type is unknown by capnproto library")
|
|
* else:
|
|
* raise ValueError("Cannot convert type to Python. Type is unhandled by capnproto library") # <<<<<<<<<<<<<<
|
|
*
|
|
*
|
|
*/
|
|
__pyx_t_1 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_k_tuple_20), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 188; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
|
|
__Pyx_GOTREF(__pyx_t_1);
|
|
__Pyx_Raise(__pyx_t_1, 0, 0, 0);
|
|
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
|
|
{__pyx_filename = __pyx_f[0]; __pyx_lineno = 188; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
|
|
}
|
|
__pyx_L3:;
|
|
|
|
__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_5);
|
|
__Pyx_AddTraceback("capnp._DynamicValueReader.toPython", __pyx_clineno, __pyx_lineno, __pyx_filename);
|
|
__pyx_r = 0;
|
|
__pyx_L0:;
|
|
__Pyx_XGIVEREF(__pyx_r);
|
|
__Pyx_RefNannyFinishContext();
|
|
return __pyx_r;
|
|
}
|
|
|
|
/* Python wrapper */
|
|
static PyObject *__pyx_pw_5capnp_19_DynamicValueReader_3toPython(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
|
|
static PyObject *__pyx_pw_5capnp_19_DynamicValueReader_3toPython(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
|
|
PyObject *__pyx_r = 0;
|
|
__Pyx_RefNannyDeclarations
|
|
__Pyx_RefNannySetupContext("toPython (wrapper)", 0);
|
|
__pyx_r = __pyx_pf_5capnp_19_DynamicValueReader_2toPython(((struct __pyx_obj_5capnp__DynamicValueReader *)__pyx_v_self));
|
|
__Pyx_RefNannyFinishContext();
|
|
return __pyx_r;
|
|
}
|
|
|
|
/* "capnp.pyx":160
|
|
* return self.thisptr.getType()
|
|
*
|
|
* cpdef toPython(self): # <<<<<<<<<<<<<<
|
|
* cdef int type = self.getType()
|
|
* if type == capnp.TYPE_BOOL:
|
|
*/
|
|
|
|
static PyObject *__pyx_pf_5capnp_19_DynamicValueReader_2toPython(struct __pyx_obj_5capnp__DynamicValueReader *__pyx_v_self) {
|
|
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("toPython", 0);
|
|
__Pyx_XDECREF(__pyx_r);
|
|
__pyx_t_1 = ((struct __pyx_vtabstruct_5capnp__DynamicValueReader *)__pyx_v_self->__pyx_vtab)->toPython(__pyx_v_self, 1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 160; __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("capnp._DynamicValueReader.toPython", __pyx_clineno, __pyx_lineno, __pyx_filename);
|
|
__pyx_r = NULL;
|
|
__pyx_L0:;
|
|
__Pyx_XGIVEREF(__pyx_r);
|
|
__Pyx_RefNannyFinishContext();
|
|
return __pyx_r;
|
|
}
|
|
|
|
/* "capnp.pyx":191
|
|
*
|
|
*
|
|
* cdef int getType(C_DynamicValue.Builder & self): # <<<<<<<<<<<<<<
|
|
* return self.getType()
|
|
*
|
|
*/
|
|
|
|
static int __pyx_f_5capnp_getType( ::capnp::DynamicValue::Builder &__pyx_v_self) {
|
|
int __pyx_r;
|
|
__Pyx_RefNannyDeclarations
|
|
__Pyx_RefNannySetupContext("getType", 0);
|
|
|
|
/* "capnp.pyx":192
|
|
*
|
|
* cdef int getType(C_DynamicValue.Builder & self):
|
|
* return self.getType() # <<<<<<<<<<<<<<
|
|
*
|
|
* cdef toPython(C_DynamicValue.Builder & self):
|
|
*/
|
|
__pyx_r = __pyx_v_self.getType();
|
|
goto __pyx_L0;
|
|
|
|
__pyx_r = 0;
|
|
__pyx_L0:;
|
|
__Pyx_RefNannyFinishContext();
|
|
return __pyx_r;
|
|
}
|
|
|
|
/* "capnp.pyx":194
|
|
* return self.getType()
|
|
*
|
|
* cdef toPython(C_DynamicValue.Builder & self): # <<<<<<<<<<<<<<
|
|
* cdef int type = getType(self)
|
|
* if type == capnp.TYPE_BOOL:
|
|
*/
|
|
|
|
static PyObject *__pyx_f_5capnp_toPython( ::capnp::DynamicValue::Builder &__pyx_v_self) {
|
|
int __pyx_v_type;
|
|
::capnp::Data::Builder __pyx_v_temp;
|
|
PyObject *__pyx_r = NULL;
|
|
__Pyx_RefNannyDeclarations
|
|
int __pyx_t_1;
|
|
PyObject *__pyx_t_2 = NULL;
|
|
PyObject *__pyx_t_3 = NULL;
|
|
::capnp::EnumSchema::Enumerant __pyx_t_4;
|
|
PyObject *__pyx_t_5 = NULL;
|
|
int __pyx_lineno = 0;
|
|
const char *__pyx_filename = NULL;
|
|
int __pyx_clineno = 0;
|
|
__Pyx_RefNannySetupContext("toPython", 0);
|
|
|
|
/* "capnp.pyx":195
|
|
*
|
|
* cdef toPython(C_DynamicValue.Builder & self):
|
|
* cdef int type = getType(self) # <<<<<<<<<<<<<<
|
|
* if type == capnp.TYPE_BOOL:
|
|
* return self.asBool()
|
|
*/
|
|
__pyx_v_type = __pyx_f_5capnp_getType(__pyx_v_self);
|
|
|
|
/* "capnp.pyx":196
|
|
* cdef toPython(C_DynamicValue.Builder & self):
|
|
* cdef int type = getType(self)
|
|
* if type == capnp.TYPE_BOOL: # <<<<<<<<<<<<<<
|
|
* return self.asBool()
|
|
* elif type == capnp.TYPE_INT:
|
|
*/
|
|
__pyx_t_1 = ((__pyx_v_type == ::capnp::DynamicValue::BOOL) != 0);
|
|
if (__pyx_t_1) {
|
|
|
|
/* "capnp.pyx":197
|
|
* cdef int type = getType(self)
|
|
* if type == capnp.TYPE_BOOL:
|
|
* return self.asBool() # <<<<<<<<<<<<<<
|
|
* elif type == capnp.TYPE_INT:
|
|
* return self.asInt()
|
|
*/
|
|
__Pyx_XDECREF(__pyx_r);
|
|
__pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_v_self.as<bool>()); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 197; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
|
|
__Pyx_GOTREF(__pyx_t_2);
|
|
__pyx_r = __pyx_t_2;
|
|
__pyx_t_2 = 0;
|
|
goto __pyx_L0;
|
|
goto __pyx_L3;
|
|
}
|
|
|
|
/* "capnp.pyx":198
|
|
* if type == capnp.TYPE_BOOL:
|
|
* return self.asBool()
|
|
* elif type == capnp.TYPE_INT: # <<<<<<<<<<<<<<
|
|
* return self.asInt()
|
|
* elif type == capnp.TYPE_UINT:
|
|
*/
|
|
__pyx_t_1 = ((__pyx_v_type == ::capnp::DynamicValue::INT) != 0);
|
|
if (__pyx_t_1) {
|
|
|
|
/* "capnp.pyx":199
|
|
* return self.asBool()
|
|
* elif type == capnp.TYPE_INT:
|
|
* return self.asInt() # <<<<<<<<<<<<<<
|
|
* elif type == capnp.TYPE_UINT:
|
|
* return self.asUint()
|
|
*/
|
|
__Pyx_XDECREF(__pyx_r);
|
|
__pyx_t_2 = __Pyx_PyInt_to_py_int64_t(__pyx_v_self.as<int64_t>()); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 199; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
|
|
__Pyx_GOTREF(__pyx_t_2);
|
|
__pyx_r = __pyx_t_2;
|
|
__pyx_t_2 = 0;
|
|
goto __pyx_L0;
|
|
goto __pyx_L3;
|
|
}
|
|
|
|
/* "capnp.pyx":200
|
|
* elif type == capnp.TYPE_INT:
|
|
* return self.asInt()
|
|
* elif type == capnp.TYPE_UINT: # <<<<<<<<<<<<<<
|
|
* return self.asUint()
|
|
* elif type == capnp.TYPE_FLOAT:
|
|
*/
|
|
__pyx_t_1 = ((__pyx_v_type == ::capnp::DynamicValue::UINT) != 0);
|
|
if (__pyx_t_1) {
|
|
|
|
/* "capnp.pyx":201
|
|
* return self.asInt()
|
|
* elif type == capnp.TYPE_UINT:
|
|
* return self.asUint() # <<<<<<<<<<<<<<
|
|
* elif type == capnp.TYPE_FLOAT:
|
|
* return self.asDouble()
|
|
*/
|
|
__Pyx_XDECREF(__pyx_r);
|
|
__pyx_t_2 = __Pyx_PyInt_to_py_uint64_t(__pyx_v_self.as<uint64_t>()); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 201; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
|
|
__Pyx_GOTREF(__pyx_t_2);
|
|
__pyx_r = __pyx_t_2;
|
|
__pyx_t_2 = 0;
|
|
goto __pyx_L0;
|
|
goto __pyx_L3;
|
|
}
|
|
|
|
/* "capnp.pyx":202
|
|
* elif type == capnp.TYPE_UINT:
|
|
* return self.asUint()
|
|
* elif type == capnp.TYPE_FLOAT: # <<<<<<<<<<<<<<
|
|
* return self.asDouble()
|
|
* elif type == capnp.TYPE_TEXT:
|
|
*/
|
|
__pyx_t_1 = ((__pyx_v_type == ::capnp::DynamicValue::FLOAT) != 0);
|
|
if (__pyx_t_1) {
|
|
|
|
/* "capnp.pyx":203
|
|
* return self.asUint()
|
|
* elif type == capnp.TYPE_FLOAT:
|
|
* return self.asDouble() # <<<<<<<<<<<<<<
|
|
* elif type == capnp.TYPE_TEXT:
|
|
* return self.asText()[:]
|
|
*/
|
|
__Pyx_XDECREF(__pyx_r);
|
|
__pyx_t_2 = PyFloat_FromDouble(__pyx_v_self.as<double>()); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 203; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
|
|
__Pyx_GOTREF(__pyx_t_2);
|
|
__pyx_r = __pyx_t_2;
|
|
__pyx_t_2 = 0;
|
|
goto __pyx_L0;
|
|
goto __pyx_L3;
|
|
}
|
|
|
|
/* "capnp.pyx":204
|
|
* elif type == capnp.TYPE_FLOAT:
|
|
* return self.asDouble()
|
|
* elif type == capnp.TYPE_TEXT: # <<<<<<<<<<<<<<
|
|
* return self.asText()[:]
|
|
* elif type == capnp.TYPE_DATA:
|
|
*/
|
|
__pyx_t_1 = ((__pyx_v_type == ::capnp::DynamicValue::TEXT) != 0);
|
|
if (__pyx_t_1) {
|
|
|
|
/* "capnp.pyx":205
|
|
* return self.asDouble()
|
|
* elif type == capnp.TYPE_TEXT:
|
|
* return self.asText()[:] # <<<<<<<<<<<<<<
|
|
* elif type == capnp.TYPE_DATA:
|
|
* temp = self.asData()
|
|
*/
|
|
__Pyx_XDECREF(__pyx_r);
|
|
__pyx_t_2 = __Pyx_PyBytes_FromString(__pyx_v_self.as< ::capnp::Text>().cStr() + 0); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 205; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
|
|
__Pyx_GOTREF(((PyObject *)__pyx_t_2));
|
|
__pyx_r = ((PyObject *)__pyx_t_2);
|
|
__pyx_t_2 = 0;
|
|
goto __pyx_L0;
|
|
goto __pyx_L3;
|
|
}
|
|
|
|
/* "capnp.pyx":206
|
|
* elif type == capnp.TYPE_TEXT:
|
|
* return self.asText()[:]
|
|
* elif type == capnp.TYPE_DATA: # <<<<<<<<<<<<<<
|
|
* temp = self.asData()
|
|
* return (<char*>temp.begin())[:temp.size()]
|
|
*/
|
|
__pyx_t_1 = ((__pyx_v_type == ::capnp::DynamicValue::DATA) != 0);
|
|
if (__pyx_t_1) {
|
|
|
|
/* "capnp.pyx":207
|
|
* return self.asText()[:]
|
|
* elif type == capnp.TYPE_DATA:
|
|
* temp = self.asData() # <<<<<<<<<<<<<<
|
|
* return (<char*>temp.begin())[:temp.size()]
|
|
* elif type == capnp.TYPE_LIST:
|
|
*/
|
|
__pyx_v_temp = __pyx_v_self.as< ::capnp::Data>();
|
|
|
|
/* "capnp.pyx":208
|
|
* elif type == capnp.TYPE_DATA:
|
|
* temp = self.asData()
|
|
* return (<char*>temp.begin())[:temp.size()] # <<<<<<<<<<<<<<
|
|
* elif type == capnp.TYPE_LIST:
|
|
* return list(_DynamicListBuilder()._init(self.asList()))
|
|
*/
|
|
__Pyx_XDECREF(__pyx_r);
|
|
__pyx_t_2 = __Pyx_PyBytes_FromStringAndSize(((char *)__pyx_v_temp.begin()) + 0, __pyx_v_temp.size() - 0); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 208; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
|
|
__Pyx_GOTREF(((PyObject *)__pyx_t_2));
|
|
__pyx_r = ((PyObject *)__pyx_t_2);
|
|
__pyx_t_2 = 0;
|
|
goto __pyx_L0;
|
|
goto __pyx_L3;
|
|
}
|
|
|
|
/* "capnp.pyx":209
|
|
* temp = self.asData()
|
|
* return (<char*>temp.begin())[:temp.size()]
|
|
* elif type == capnp.TYPE_LIST: # <<<<<<<<<<<<<<
|
|
* return list(_DynamicListBuilder()._init(self.asList()))
|
|
* elif type == capnp.TYPE_STRUCT:
|
|
*/
|
|
__pyx_t_1 = ((__pyx_v_type == ::capnp::DynamicValue::LIST) != 0);
|
|
if (__pyx_t_1) {
|
|
|
|
/* "capnp.pyx":210
|
|
* return (<char*>temp.begin())[:temp.size()]
|
|
* elif type == capnp.TYPE_LIST:
|
|
* return list(_DynamicListBuilder()._init(self.asList())) # <<<<<<<<<<<<<<
|
|
* elif type == capnp.TYPE_STRUCT:
|
|
* return _DynamicStructBuilder()._init(self.asStruct())
|
|
*/
|
|
__Pyx_XDECREF(__pyx_r);
|
|
__pyx_t_2 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_5capnp__DynamicListBuilder)), ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 210; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
|
|
__Pyx_GOTREF(__pyx_t_2);
|
|
__pyx_t_3 = ((struct __pyx_vtabstruct_5capnp__DynamicListBuilder *)((struct __pyx_obj_5capnp__DynamicListBuilder *)__pyx_t_2)->__pyx_vtab)->_init(((struct __pyx_obj_5capnp__DynamicListBuilder *)__pyx_t_2), __pyx_v_self.as< ::capnp::DynamicList>()); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 210; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
|
|
__Pyx_GOTREF(__pyx_t_3);
|
|
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
|
|
__pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 210; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
|
|
__Pyx_GOTREF(__pyx_t_2);
|
|
PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_3);
|
|
__Pyx_GIVEREF(__pyx_t_3);
|
|
__pyx_t_3 = 0;
|
|
__pyx_t_3 = PyObject_Call(((PyObject *)((PyObject*)(&PyList_Type))), ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 210; __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;
|
|
__pyx_t_3 = 0;
|
|
goto __pyx_L0;
|
|
goto __pyx_L3;
|
|
}
|
|
|
|
/* "capnp.pyx":211
|
|
* elif type == capnp.TYPE_LIST:
|
|
* return list(_DynamicListBuilder()._init(self.asList()))
|
|
* elif type == capnp.TYPE_STRUCT: # <<<<<<<<<<<<<<
|
|
* return _DynamicStructBuilder()._init(self.asStruct())
|
|
* elif type == capnp.TYPE_UNION:
|
|
*/
|
|
__pyx_t_1 = ((__pyx_v_type == ::capnp::DynamicValue::STRUCT) != 0);
|
|
if (__pyx_t_1) {
|
|
|
|
/* "capnp.pyx":212
|
|
* return list(_DynamicListBuilder()._init(self.asList()))
|
|
* elif type == capnp.TYPE_STRUCT:
|
|
* return _DynamicStructBuilder()._init(self.asStruct()) # <<<<<<<<<<<<<<
|
|
* elif type == capnp.TYPE_UNION:
|
|
* return _DynamicUnionBuilder()._init(self.asUnion())
|
|
*/
|
|
__Pyx_XDECREF(__pyx_r);
|
|
__pyx_t_3 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_5capnp__DynamicStructBuilder)), ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 212; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
|
|
__Pyx_GOTREF(__pyx_t_3);
|
|
__pyx_t_2 = ((struct __pyx_vtabstruct_5capnp__DynamicStructBuilder *)((struct __pyx_obj_5capnp__DynamicStructBuilder *)__pyx_t_3)->__pyx_vtab)->_init(((struct __pyx_obj_5capnp__DynamicStructBuilder *)__pyx_t_3), __pyx_v_self.as< ::capnp::DynamicStruct>()); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 212; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
|
|
__Pyx_GOTREF(__pyx_t_2);
|
|
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
|
|
__pyx_r = __pyx_t_2;
|
|
__pyx_t_2 = 0;
|
|
goto __pyx_L0;
|
|
goto __pyx_L3;
|
|
}
|
|
|
|
/* "capnp.pyx":213
|
|
* elif type == capnp.TYPE_STRUCT:
|
|
* return _DynamicStructBuilder()._init(self.asStruct())
|
|
* elif type == capnp.TYPE_UNION: # <<<<<<<<<<<<<<
|
|
* return _DynamicUnionBuilder()._init(self.asUnion())
|
|
* elif type == capnp.TYPE_ENUM:
|
|
*/
|
|
__pyx_t_1 = ((__pyx_v_type == ::capnp::DynamicValue::UNION) != 0);
|
|
if (__pyx_t_1) {
|
|
|
|
/* "capnp.pyx":214
|
|
* return _DynamicStructBuilder()._init(self.asStruct())
|
|
* elif type == capnp.TYPE_UNION:
|
|
* return _DynamicUnionBuilder()._init(self.asUnion()) # <<<<<<<<<<<<<<
|
|
* elif type == capnp.TYPE_ENUM:
|
|
* return fixMaybe(self.asEnum().getEnumerant()).getProto().getName().cStr()
|
|
*/
|
|
__Pyx_XDECREF(__pyx_r);
|
|
__pyx_t_2 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_5capnp__DynamicUnionBuilder)), ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 214; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
|
|
__Pyx_GOTREF(__pyx_t_2);
|
|
__pyx_t_3 = ((struct __pyx_vtabstruct_5capnp__DynamicUnionBuilder *)((struct __pyx_obj_5capnp__DynamicUnionBuilder *)__pyx_t_2)->__pyx_vtab)->_init(((struct __pyx_obj_5capnp__DynamicUnionBuilder *)__pyx_t_2), __pyx_v_self.as< ::capnp::DynamicUnion>()); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 214; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
|
|
__Pyx_GOTREF(__pyx_t_3);
|
|
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
|
|
__pyx_r = __pyx_t_3;
|
|
__pyx_t_3 = 0;
|
|
goto __pyx_L0;
|
|
goto __pyx_L3;
|
|
}
|
|
|
|
/* "capnp.pyx":215
|
|
* elif type == capnp.TYPE_UNION:
|
|
* return _DynamicUnionBuilder()._init(self.asUnion())
|
|
* elif type == capnp.TYPE_ENUM: # <<<<<<<<<<<<<<
|
|
* return fixMaybe(self.asEnum().getEnumerant()).getProto().getName().cStr()
|
|
* elif type == capnp.TYPE_VOID:
|
|
*/
|
|
__pyx_t_1 = ((__pyx_v_type == ::capnp::DynamicValue::ENUM) != 0);
|
|
if (__pyx_t_1) {
|
|
|
|
/* "capnp.pyx":216
|
|
* return _DynamicUnionBuilder()._init(self.asUnion())
|
|
* elif type == capnp.TYPE_ENUM:
|
|
* return fixMaybe(self.asEnum().getEnumerant()).getProto().getName().cStr() # <<<<<<<<<<<<<<
|
|
* elif type == capnp.TYPE_VOID:
|
|
* return None
|
|
*/
|
|
__Pyx_XDECREF(__pyx_r);
|
|
try {
|
|
__pyx_t_4 = fixMaybe(__pyx_v_self.as< ::capnp::DynamicEnum>().getEnumerant());
|
|
} catch(...) {
|
|
__Pyx_CppExn2PyErr();
|
|
{__pyx_filename = __pyx_f[0]; __pyx_lineno = 216; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
|
|
}
|
|
__pyx_t_3 = __Pyx_PyBytes_FromString(__pyx_t_4.getProto().getName().cStr()); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 216; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
|
|
__Pyx_GOTREF(((PyObject *)__pyx_t_3));
|
|
__pyx_r = ((PyObject *)__pyx_t_3);
|
|
__pyx_t_3 = 0;
|
|
goto __pyx_L0;
|
|
goto __pyx_L3;
|
|
}
|
|
|
|
/* "capnp.pyx":217
|
|
* elif type == capnp.TYPE_ENUM:
|
|
* return fixMaybe(self.asEnum().getEnumerant()).getProto().getName().cStr()
|
|
* elif type == capnp.TYPE_VOID: # <<<<<<<<<<<<<<
|
|
* return None
|
|
* elif type == capnp.TYPE_UNKOWN:
|
|
*/
|
|
__pyx_t_1 = ((__pyx_v_type == ::capnp::DynamicValue::VOID) != 0);
|
|
if (__pyx_t_1) {
|
|
|
|
/* "capnp.pyx":218
|
|
* return fixMaybe(self.asEnum().getEnumerant()).getProto().getName().cStr()
|
|
* elif type == capnp.TYPE_VOID:
|
|
* return None # <<<<<<<<<<<<<<
|
|
* elif type == capnp.TYPE_UNKOWN:
|
|
* raise ValueError("Cannot convert type to Python. Type is unknown by capnproto library")
|
|
*/
|
|
__Pyx_XDECREF(__pyx_r);
|
|
__Pyx_INCREF(Py_None);
|
|
__pyx_r = Py_None;
|
|
goto __pyx_L0;
|
|
goto __pyx_L3;
|
|
}
|
|
|
|
/* "capnp.pyx":219
|
|
* elif type == capnp.TYPE_VOID:
|
|
* return None
|
|
* elif type == capnp.TYPE_UNKOWN: # <<<<<<<<<<<<<<
|
|
* raise ValueError("Cannot convert type to Python. Type is unknown by capnproto library")
|
|
* else:
|
|
*/
|
|
__pyx_t_3 = PyInt_FromLong(__pyx_v_type); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 219; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
|
|
__Pyx_GOTREF(__pyx_t_3);
|
|
__pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s__capnp); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 219; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
|
|
__Pyx_GOTREF(__pyx_t_2);
|
|
__pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s__TYPE_UNKOWN); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 219; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
|
|
__Pyx_GOTREF(__pyx_t_5);
|
|
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
|
|
__pyx_t_2 = PyObject_RichCompare(__pyx_t_3, __pyx_t_5, Py_EQ); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 219; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
|
|
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
|
|
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
|
|
__pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 219; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
|
|
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
|
|
if (__pyx_t_1) {
|
|
|
|
/* "capnp.pyx":220
|
|
* return None
|
|
* elif type == capnp.TYPE_UNKOWN:
|
|
* raise ValueError("Cannot convert type to Python. Type is unknown by capnproto library") # <<<<<<<<<<<<<<
|
|
* else:
|
|
* raise ValueError("Cannot convert type to Python. Type is unhandled by capnproto library")
|
|
*/
|
|
__pyx_t_2 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_k_tuple_21), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 220; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
|
|
__Pyx_GOTREF(__pyx_t_2);
|
|
__Pyx_Raise(__pyx_t_2, 0, 0, 0);
|
|
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
|
|
{__pyx_filename = __pyx_f[0]; __pyx_lineno = 220; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
|
|
goto __pyx_L3;
|
|
}
|
|
/*else*/ {
|
|
|
|
/* "capnp.pyx":222
|
|
* raise ValueError("Cannot convert type to Python. Type is unknown by capnproto library")
|
|
* else:
|
|
* raise ValueError("Cannot convert type to Python. Type is unhandled by capnproto library") # <<<<<<<<<<<<<<
|
|
*
|
|
*
|
|
*/
|
|
__pyx_t_2 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_k_tuple_22), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 222; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
|
|
__Pyx_GOTREF(__pyx_t_2);
|
|
__Pyx_Raise(__pyx_t_2, 0, 0, 0);
|
|
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
|
|
{__pyx_filename = __pyx_f[0]; __pyx_lineno = 222; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
|
|
}
|
|
__pyx_L3:;
|
|
|
|
__pyx_r = Py_None; __Pyx_INCREF(Py_None);
|
|
goto __pyx_L0;
|
|
__pyx_L1_error:;
|
|
__Pyx_XDECREF(__pyx_t_2);
|
|
__Pyx_XDECREF(__pyx_t_3);
|
|
__Pyx_XDECREF(__pyx_t_5);
|
|
__Pyx_AddTraceback("capnp.toPython", __pyx_clineno, __pyx_lineno, __pyx_filename);
|
|
__pyx_r = 0;
|
|
__pyx_L0:;
|
|
__Pyx_XGIVEREF(__pyx_r);
|
|
__Pyx_RefNannyFinishContext();
|
|
return __pyx_r;
|
|
}
|
|
|
|
/* "capnp.pyx":225
|
|
*
|
|
*
|
|
* cdef toPythonByValue(C_DynamicValue.Builder self): # <<<<<<<<<<<<<<
|
|
* cdef int type = self.getType()
|
|
* if type == capnp.TYPE_BOOL:
|
|
*/
|
|
|
|
static PyObject *__pyx_f_5capnp_toPythonByValue( ::capnp::DynamicValue::Builder __pyx_v_self) {
|
|
int __pyx_v_type;
|
|
::capnp::Data::Builder __pyx_v_temp;
|
|
PyObject *__pyx_r = NULL;
|
|
__Pyx_RefNannyDeclarations
|
|
int __pyx_t_1;
|
|
PyObject *__pyx_t_2 = NULL;
|
|
PyObject *__pyx_t_3 = NULL;
|
|
::capnp::EnumSchema::Enumerant __pyx_t_4;
|
|
PyObject *__pyx_t_5 = NULL;
|
|
int __pyx_lineno = 0;
|
|
const char *__pyx_filename = NULL;
|
|
int __pyx_clineno = 0;
|
|
__Pyx_RefNannySetupContext("toPythonByValue", 0);
|
|
|
|
/* "capnp.pyx":226
|
|
*
|
|
* cdef toPythonByValue(C_DynamicValue.Builder self):
|
|
* cdef int type = self.getType() # <<<<<<<<<<<<<<
|
|
* if type == capnp.TYPE_BOOL:
|
|
* return self.asBool()
|
|
*/
|
|
__pyx_v_type = __pyx_v_self.getType();
|
|
|
|
/* "capnp.pyx":227
|
|
* cdef toPythonByValue(C_DynamicValue.Builder self):
|
|
* cdef int type = self.getType()
|
|
* if type == capnp.TYPE_BOOL: # <<<<<<<<<<<<<<
|
|
* return self.asBool()
|
|
* elif type == capnp.TYPE_INT:
|
|
*/
|
|
__pyx_t_1 = ((__pyx_v_type == ::capnp::DynamicValue::BOOL) != 0);
|
|
if (__pyx_t_1) {
|
|
|
|
/* "capnp.pyx":228
|
|
* cdef int type = self.getType()
|
|
* if type == capnp.TYPE_BOOL:
|
|
* return self.asBool() # <<<<<<<<<<<<<<
|
|
* elif type == capnp.TYPE_INT:
|
|
* return self.asInt()
|
|
*/
|
|
__Pyx_XDECREF(__pyx_r);
|
|
__pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_v_self.as<bool>()); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 228; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
|
|
__Pyx_GOTREF(__pyx_t_2);
|
|
__pyx_r = __pyx_t_2;
|
|
__pyx_t_2 = 0;
|
|
goto __pyx_L0;
|
|
goto __pyx_L3;
|
|
}
|
|
|
|
/* "capnp.pyx":229
|
|
* if type == capnp.TYPE_BOOL:
|
|
* return self.asBool()
|
|
* elif type == capnp.TYPE_INT: # <<<<<<<<<<<<<<
|
|
* return self.asInt()
|
|
* elif type == capnp.TYPE_UINT:
|
|
*/
|
|
__pyx_t_1 = ((__pyx_v_type == ::capnp::DynamicValue::INT) != 0);
|
|
if (__pyx_t_1) {
|
|
|
|
/* "capnp.pyx":230
|
|
* return self.asBool()
|
|
* elif type == capnp.TYPE_INT:
|
|
* return self.asInt() # <<<<<<<<<<<<<<
|
|
* elif type == capnp.TYPE_UINT:
|
|
* return self.asUint()
|
|
*/
|
|
__Pyx_XDECREF(__pyx_r);
|
|
__pyx_t_2 = __Pyx_PyInt_to_py_int64_t(__pyx_v_self.as<int64_t>()); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 230; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
|
|
__Pyx_GOTREF(__pyx_t_2);
|
|
__pyx_r = __pyx_t_2;
|
|
__pyx_t_2 = 0;
|
|
goto __pyx_L0;
|
|
goto __pyx_L3;
|
|
}
|
|
|
|
/* "capnp.pyx":231
|
|
* elif type == capnp.TYPE_INT:
|
|
* return self.asInt()
|
|
* elif type == capnp.TYPE_UINT: # <<<<<<<<<<<<<<
|
|
* return self.asUint()
|
|
* elif type == capnp.TYPE_FLOAT:
|
|
*/
|
|
__pyx_t_1 = ((__pyx_v_type == ::capnp::DynamicValue::UINT) != 0);
|
|
if (__pyx_t_1) {
|
|
|
|
/* "capnp.pyx":232
|
|
* return self.asInt()
|
|
* elif type == capnp.TYPE_UINT:
|
|
* return self.asUint() # <<<<<<<<<<<<<<
|
|
* elif type == capnp.TYPE_FLOAT:
|
|
* return self.asDouble()
|
|
*/
|
|
__Pyx_XDECREF(__pyx_r);
|
|
__pyx_t_2 = __Pyx_PyInt_to_py_uint64_t(__pyx_v_self.as<uint64_t>()); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 232; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
|
|
__Pyx_GOTREF(__pyx_t_2);
|
|
__pyx_r = __pyx_t_2;
|
|
__pyx_t_2 = 0;
|
|
goto __pyx_L0;
|
|
goto __pyx_L3;
|
|
}
|
|
|
|
/* "capnp.pyx":233
|
|
* elif type == capnp.TYPE_UINT:
|
|
* return self.asUint()
|
|
* elif type == capnp.TYPE_FLOAT: # <<<<<<<<<<<<<<
|
|
* return self.asDouble()
|
|
* elif type == capnp.TYPE_TEXT:
|
|
*/
|
|
__pyx_t_1 = ((__pyx_v_type == ::capnp::DynamicValue::FLOAT) != 0);
|
|
if (__pyx_t_1) {
|
|
|
|
/* "capnp.pyx":234
|
|
* return self.asUint()
|
|
* elif type == capnp.TYPE_FLOAT:
|
|
* return self.asDouble() # <<<<<<<<<<<<<<
|
|
* elif type == capnp.TYPE_TEXT:
|
|
* return self.asText()[:]
|
|
*/
|
|
__Pyx_XDECREF(__pyx_r);
|
|
__pyx_t_2 = PyFloat_FromDouble(__pyx_v_self.as<double>()); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 234; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
|
|
__Pyx_GOTREF(__pyx_t_2);
|
|
__pyx_r = __pyx_t_2;
|
|
__pyx_t_2 = 0;
|
|
goto __pyx_L0;
|
|
goto __pyx_L3;
|
|
}
|
|
|
|
/* "capnp.pyx":235
|
|
* elif type == capnp.TYPE_FLOAT:
|
|
* return self.asDouble()
|
|
* elif type == capnp.TYPE_TEXT: # <<<<<<<<<<<<<<
|
|
* return self.asText()[:]
|
|
* elif type == capnp.TYPE_DATA:
|
|
*/
|
|
__pyx_t_1 = ((__pyx_v_type == ::capnp::DynamicValue::TEXT) != 0);
|
|
if (__pyx_t_1) {
|
|
|
|
/* "capnp.pyx":236
|
|
* return self.asDouble()
|
|
* elif type == capnp.TYPE_TEXT:
|
|
* return self.asText()[:] # <<<<<<<<<<<<<<
|
|
* elif type == capnp.TYPE_DATA:
|
|
* temp = self.asData()
|
|
*/
|
|
__Pyx_XDECREF(__pyx_r);
|
|
__pyx_t_2 = __Pyx_PyBytes_FromString(__pyx_v_self.as< ::capnp::Text>().cStr() + 0); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 236; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
|
|
__Pyx_GOTREF(((PyObject *)__pyx_t_2));
|
|
__pyx_r = ((PyObject *)__pyx_t_2);
|
|
__pyx_t_2 = 0;
|
|
goto __pyx_L0;
|
|
goto __pyx_L3;
|
|
}
|
|
|
|
/* "capnp.pyx":237
|
|
* elif type == capnp.TYPE_TEXT:
|
|
* return self.asText()[:]
|
|
* elif type == capnp.TYPE_DATA: # <<<<<<<<<<<<<<
|
|
* temp = self.asData()
|
|
* return (<char*>temp.begin())[:temp.size()]
|
|
*/
|
|
__pyx_t_1 = ((__pyx_v_type == ::capnp::DynamicValue::DATA) != 0);
|
|
if (__pyx_t_1) {
|
|
|
|
/* "capnp.pyx":238
|
|
* return self.asText()[:]
|
|
* elif type == capnp.TYPE_DATA:
|
|
* temp = self.asData() # <<<<<<<<<<<<<<
|
|
* return (<char*>temp.begin())[:temp.size()]
|
|
* elif type == capnp.TYPE_LIST:
|
|
*/
|
|
__pyx_v_temp = __pyx_v_self.as< ::capnp::Data>();
|
|
|
|
/* "capnp.pyx":239
|
|
* elif type == capnp.TYPE_DATA:
|
|
* temp = self.asData()
|
|
* return (<char*>temp.begin())[:temp.size()] # <<<<<<<<<<<<<<
|
|
* elif type == capnp.TYPE_LIST:
|
|
* return list(_DynamicListBuilder()._init(self.asList()))
|
|
*/
|
|
__Pyx_XDECREF(__pyx_r);
|
|
__pyx_t_2 = __Pyx_PyBytes_FromStringAndSize(((char *)__pyx_v_temp.begin()) + 0, __pyx_v_temp.size() - 0); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 239; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
|
|
__Pyx_GOTREF(((PyObject *)__pyx_t_2));
|
|
__pyx_r = ((PyObject *)__pyx_t_2);
|
|
__pyx_t_2 = 0;
|
|
goto __pyx_L0;
|
|
goto __pyx_L3;
|
|
}
|
|
|
|
/* "capnp.pyx":240
|
|
* temp = self.asData()
|
|
* return (<char*>temp.begin())[:temp.size()]
|
|
* elif type == capnp.TYPE_LIST: # <<<<<<<<<<<<<<
|
|
* return list(_DynamicListBuilder()._init(self.asList()))
|
|
* elif type == capnp.TYPE_STRUCT:
|
|
*/
|
|
__pyx_t_1 = ((__pyx_v_type == ::capnp::DynamicValue::LIST) != 0);
|
|
if (__pyx_t_1) {
|
|
|
|
/* "capnp.pyx":241
|
|
* return (<char*>temp.begin())[:temp.size()]
|
|
* elif type == capnp.TYPE_LIST:
|
|
* return list(_DynamicListBuilder()._init(self.asList())) # <<<<<<<<<<<<<<
|
|
* elif type == capnp.TYPE_STRUCT:
|
|
* return _DynamicStructBuilder()._init(self.asStruct())
|
|
*/
|
|
__Pyx_XDECREF(__pyx_r);
|
|
__pyx_t_2 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_5capnp__DynamicListBuilder)), ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 241; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
|
|
__Pyx_GOTREF(__pyx_t_2);
|
|
__pyx_t_3 = ((struct __pyx_vtabstruct_5capnp__DynamicListBuilder *)((struct __pyx_obj_5capnp__DynamicListBuilder *)__pyx_t_2)->__pyx_vtab)->_init(((struct __pyx_obj_5capnp__DynamicListBuilder *)__pyx_t_2), __pyx_v_self.as< ::capnp::DynamicList>()); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 241; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
|
|
__Pyx_GOTREF(__pyx_t_3);
|
|
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
|
|
__pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 241; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
|
|
__Pyx_GOTREF(__pyx_t_2);
|
|
PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_3);
|
|
__Pyx_GIVEREF(__pyx_t_3);
|
|
__pyx_t_3 = 0;
|
|
__pyx_t_3 = PyObject_Call(((PyObject *)((PyObject*)(&PyList_Type))), ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 241; __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;
|
|
__pyx_t_3 = 0;
|
|
goto __pyx_L0;
|
|
goto __pyx_L3;
|
|
}
|
|
|
|
/* "capnp.pyx":242
|
|
* elif type == capnp.TYPE_LIST:
|
|
* return list(_DynamicListBuilder()._init(self.asList()))
|
|
* elif type == capnp.TYPE_STRUCT: # <<<<<<<<<<<<<<
|
|
* return _DynamicStructBuilder()._init(self.asStruct())
|
|
* elif type == capnp.TYPE_UNION:
|
|
*/
|
|
__pyx_t_1 = ((__pyx_v_type == ::capnp::DynamicValue::STRUCT) != 0);
|
|
if (__pyx_t_1) {
|
|
|
|
/* "capnp.pyx":243
|
|
* return list(_DynamicListBuilder()._init(self.asList()))
|
|
* elif type == capnp.TYPE_STRUCT:
|
|
* return _DynamicStructBuilder()._init(self.asStruct()) # <<<<<<<<<<<<<<
|
|
* elif type == capnp.TYPE_UNION:
|
|
* return _DynamicUnionBuilder()._init(self.asUnion())
|
|
*/
|
|
__Pyx_XDECREF(__pyx_r);
|
|
__pyx_t_3 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_5capnp__DynamicStructBuilder)), ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 243; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
|
|
__Pyx_GOTREF(__pyx_t_3);
|
|
__pyx_t_2 = ((struct __pyx_vtabstruct_5capnp__DynamicStructBuilder *)((struct __pyx_obj_5capnp__DynamicStructBuilder *)__pyx_t_3)->__pyx_vtab)->_init(((struct __pyx_obj_5capnp__DynamicStructBuilder *)__pyx_t_3), __pyx_v_self.as< ::capnp::DynamicStruct>()); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 243; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
|
|
__Pyx_GOTREF(__pyx_t_2);
|
|
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
|
|
__pyx_r = __pyx_t_2;
|
|
__pyx_t_2 = 0;
|
|
goto __pyx_L0;
|
|
goto __pyx_L3;
|
|
}
|
|
|
|
/* "capnp.pyx":244
|
|
* elif type == capnp.TYPE_STRUCT:
|
|
* return _DynamicStructBuilder()._init(self.asStruct())
|
|
* elif type == capnp.TYPE_UNION: # <<<<<<<<<<<<<<
|
|
* return _DynamicUnionBuilder()._init(self.asUnion())
|
|
* elif type == capnp.TYPE_ENUM:
|
|
*/
|
|
__pyx_t_1 = ((__pyx_v_type == ::capnp::DynamicValue::UNION) != 0);
|
|
if (__pyx_t_1) {
|
|
|
|
/* "capnp.pyx":245
|
|
* return _DynamicStructBuilder()._init(self.asStruct())
|
|
* elif type == capnp.TYPE_UNION:
|
|
* return _DynamicUnionBuilder()._init(self.asUnion()) # <<<<<<<<<<<<<<
|
|
* elif type == capnp.TYPE_ENUM:
|
|
* return fixMaybe(self.asEnum().getEnumerant()).getProto().getName().cStr()
|
|
*/
|
|
__Pyx_XDECREF(__pyx_r);
|
|
__pyx_t_2 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_5capnp__DynamicUnionBuilder)), ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 245; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
|
|
__Pyx_GOTREF(__pyx_t_2);
|
|
__pyx_t_3 = ((struct __pyx_vtabstruct_5capnp__DynamicUnionBuilder *)((struct __pyx_obj_5capnp__DynamicUnionBuilder *)__pyx_t_2)->__pyx_vtab)->_init(((struct __pyx_obj_5capnp__DynamicUnionBuilder *)__pyx_t_2), __pyx_v_self.as< ::capnp::DynamicUnion>()); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 245; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
|
|
__Pyx_GOTREF(__pyx_t_3);
|
|
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
|
|
__pyx_r = __pyx_t_3;
|
|
__pyx_t_3 = 0;
|
|
goto __pyx_L0;
|
|
goto __pyx_L3;
|
|
}
|
|
|
|
/* "capnp.pyx":246
|
|
* elif type == capnp.TYPE_UNION:
|
|
* return _DynamicUnionBuilder()._init(self.asUnion())
|
|
* elif type == capnp.TYPE_ENUM: # <<<<<<<<<<<<<<
|
|
* return fixMaybe(self.asEnum().getEnumerant()).getProto().getName().cStr()
|
|
* elif type == capnp.TYPE_VOID:
|
|
*/
|
|
__pyx_t_1 = ((__pyx_v_type == ::capnp::DynamicValue::ENUM) != 0);
|
|
if (__pyx_t_1) {
|
|
|
|
/* "capnp.pyx":247
|
|
* return _DynamicUnionBuilder()._init(self.asUnion())
|
|
* elif type == capnp.TYPE_ENUM:
|
|
* return fixMaybe(self.asEnum().getEnumerant()).getProto().getName().cStr() # <<<<<<<<<<<<<<
|
|
* elif type == capnp.TYPE_VOID:
|
|
* return None
|
|
*/
|
|
__Pyx_XDECREF(__pyx_r);
|
|
try {
|
|
__pyx_t_4 = fixMaybe(__pyx_v_self.as< ::capnp::DynamicEnum>().getEnumerant());
|
|
} catch(...) {
|
|
__Pyx_CppExn2PyErr();
|
|
{__pyx_filename = __pyx_f[0]; __pyx_lineno = 247; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
|
|
}
|
|
__pyx_t_3 = __Pyx_PyBytes_FromString(__pyx_t_4.getProto().getName().cStr()); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 247; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
|
|
__Pyx_GOTREF(((PyObject *)__pyx_t_3));
|
|
__pyx_r = ((PyObject *)__pyx_t_3);
|
|
__pyx_t_3 = 0;
|
|
goto __pyx_L0;
|
|
goto __pyx_L3;
|
|
}
|
|
|
|
/* "capnp.pyx":248
|
|
* elif type == capnp.TYPE_ENUM:
|
|
* return fixMaybe(self.asEnum().getEnumerant()).getProto().getName().cStr()
|
|
* elif type == capnp.TYPE_VOID: # <<<<<<<<<<<<<<
|
|
* return None
|
|
* elif type == capnp.TYPE_UNKOWN:
|
|
*/
|
|
__pyx_t_1 = ((__pyx_v_type == ::capnp::DynamicValue::VOID) != 0);
|
|
if (__pyx_t_1) {
|
|
|
|
/* "capnp.pyx":249
|
|
* return fixMaybe(self.asEnum().getEnumerant()).getProto().getName().cStr()
|
|
* elif type == capnp.TYPE_VOID:
|
|
* return None # <<<<<<<<<<<<<<
|
|
* elif type == capnp.TYPE_UNKOWN:
|
|
* raise ValueError("Cannot convert type to Python. Type is unknown by capnproto library")
|
|
*/
|
|
__Pyx_XDECREF(__pyx_r);
|
|
__Pyx_INCREF(Py_None);
|
|
__pyx_r = Py_None;
|
|
goto __pyx_L0;
|
|
goto __pyx_L3;
|
|
}
|
|
|
|
/* "capnp.pyx":250
|
|
* elif type == capnp.TYPE_VOID:
|
|
* return None
|
|
* elif type == capnp.TYPE_UNKOWN: # <<<<<<<<<<<<<<
|
|
* raise ValueError("Cannot convert type to Python. Type is unknown by capnproto library")
|
|
* else:
|
|
*/
|
|
__pyx_t_3 = PyInt_FromLong(__pyx_v_type); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 250; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
|
|
__Pyx_GOTREF(__pyx_t_3);
|
|
__pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s__capnp); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 250; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
|
|
__Pyx_GOTREF(__pyx_t_2);
|
|
__pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s__TYPE_UNKOWN); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 250; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
|
|
__Pyx_GOTREF(__pyx_t_5);
|
|
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
|
|
__pyx_t_2 = PyObject_RichCompare(__pyx_t_3, __pyx_t_5, Py_EQ); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 250; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
|
|
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
|
|
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
|
|
__pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 250; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
|
|
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
|
|
if (__pyx_t_1) {
|
|
|
|
/* "capnp.pyx":251
|
|
* return None
|
|
* elif type == capnp.TYPE_UNKOWN:
|
|
* raise ValueError("Cannot convert type to Python. Type is unknown by capnproto library") # <<<<<<<<<<<<<<
|
|
* else:
|
|
* raise ValueError("Cannot convert type to Python. Type is unhandled by capnproto library")
|
|
*/
|
|
__pyx_t_2 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_k_tuple_23), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 251; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
|
|
__Pyx_GOTREF(__pyx_t_2);
|
|
__Pyx_Raise(__pyx_t_2, 0, 0, 0);
|
|
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
|
|
{__pyx_filename = __pyx_f[0]; __pyx_lineno = 251; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
|
|
goto __pyx_L3;
|
|
}
|
|
/*else*/ {
|
|
|
|
/* "capnp.pyx":253
|
|
* raise ValueError("Cannot convert type to Python. Type is unknown by capnproto library")
|
|
* else:
|
|
* raise ValueError("Cannot convert type to Python. Type is unhandled by capnproto library") # <<<<<<<<<<<<<<
|
|
*
|
|
* cdef class _DynamicStructReader:
|
|
*/
|
|
__pyx_t_2 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_k_tuple_24), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 253; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
|
|
__Pyx_GOTREF(__pyx_t_2);
|
|
__Pyx_Raise(__pyx_t_2, 0, 0, 0);
|
|
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
|
|
{__pyx_filename = __pyx_f[0]; __pyx_lineno = 253; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
|
|
}
|
|
__pyx_L3:;
|
|
|
|
__pyx_r = Py_None; __Pyx_INCREF(Py_None);
|
|
goto __pyx_L0;
|
|
__pyx_L1_error:;
|
|
__Pyx_XDECREF(__pyx_t_2);
|
|
__Pyx_XDECREF(__pyx_t_3);
|
|
__Pyx_XDECREF(__pyx_t_5);
|
|
__Pyx_AddTraceback("capnp.toPythonByValue", __pyx_clineno, __pyx_lineno, __pyx_filename);
|
|
__pyx_r = 0;
|
|
__pyx_L0:;
|
|
__Pyx_XGIVEREF(__pyx_r);
|
|
__Pyx_RefNannyFinishContext();
|
|
return __pyx_r;
|
|
}
|
|
|
|
/* "capnp.pyx":257
|
|
* cdef class _DynamicStructReader:
|
|
* cdef C_DynamicStruct.Reader thisptr
|
|
* cdef _init(self, C_DynamicStruct.Reader other): # <<<<<<<<<<<<<<
|
|
* self.thisptr = other
|
|
* return self
|
|
*/
|
|
|
|
static PyObject *__pyx_f_5capnp_20_DynamicStructReader__init(struct __pyx_obj_5capnp__DynamicStructReader *__pyx_v_self, ::capnp::DynamicStruct::Reader __pyx_v_other) {
|
|
PyObject *__pyx_r = NULL;
|
|
__Pyx_RefNannyDeclarations
|
|
__Pyx_RefNannySetupContext("_init", 0);
|
|
|
|
/* "capnp.pyx":258
|
|
* cdef C_DynamicStruct.Reader thisptr
|
|
* cdef _init(self, C_DynamicStruct.Reader other):
|
|
* self.thisptr = other # <<<<<<<<<<<<<<
|
|
* return self
|
|
*
|
|
*/
|
|
__pyx_v_self->thisptr = __pyx_v_other;
|
|
|
|
/* "capnp.pyx":259
|
|
* cdef _init(self, C_DynamicStruct.Reader other):
|
|
* self.thisptr = other
|
|
* return self # <<<<<<<<<<<<<<
|
|
*
|
|
* cpdef _get(self, field):
|
|
*/
|
|
__Pyx_XDECREF(__pyx_r);
|
|
__Pyx_INCREF(((PyObject *)__pyx_v_self));
|
|
__pyx_r = ((PyObject *)__pyx_v_self);
|
|
goto __pyx_L0;
|
|
|
|
__pyx_r = Py_None; __Pyx_INCREF(Py_None);
|
|
__pyx_L0:;
|
|
__Pyx_XGIVEREF(__pyx_r);
|
|
__Pyx_RefNannyFinishContext();
|
|
return __pyx_r;
|
|
}
|
|
|
|
/* "capnp.pyx":261
|
|
* return self
|
|
*
|
|
* cpdef _get(self, field): # <<<<<<<<<<<<<<
|
|
* return _DynamicValueReader()._init(self.thisptr.get(field))
|
|
*
|
|
*/
|
|
|
|
static PyObject *__pyx_pw_5capnp_20_DynamicStructReader_1_get(PyObject *__pyx_v_self, PyObject *__pyx_v_field); /*proto*/
|
|
static PyObject *__pyx_f_5capnp_20_DynamicStructReader__get(struct __pyx_obj_5capnp__DynamicStructReader *__pyx_v_self, PyObject *__pyx_v_field, int __pyx_skip_dispatch) {
|
|
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;
|
|
::capnp::DynamicValue::Reader __pyx_t_5;
|
|
int __pyx_lineno = 0;
|
|
const char *__pyx_filename = NULL;
|
|
int __pyx_clineno = 0;
|
|
__Pyx_RefNannySetupContext("_get", 0);
|
|
/* Check if called by wrapper */
|
|
if (unlikely(__pyx_skip_dispatch)) ;
|
|
/* Check if overridden in Python */
|
|
else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
|
|
__pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s___get); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 261; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
|
|
__Pyx_GOTREF(__pyx_t_1);
|
|
if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_5capnp_20_DynamicStructReader_1_get)) {
|
|
__Pyx_XDECREF(__pyx_r);
|
|
__pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 261; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
|
|
__Pyx_GOTREF(__pyx_t_2);
|
|
__Pyx_INCREF(__pyx_v_field);
|
|
PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_field);
|
|
__Pyx_GIVEREF(__pyx_v_field);
|
|
__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 = 261; __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;
|
|
__pyx_t_3 = 0;
|
|
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
|
|
goto __pyx_L0;
|
|
}
|
|
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
|
|
}
|
|
|
|
/* "capnp.pyx":262
|
|
*
|
|
* cpdef _get(self, field):
|
|
* return _DynamicValueReader()._init(self.thisptr.get(field)) # <<<<<<<<<<<<<<
|
|
*
|
|
* def __getattr__(self, field):
|
|
*/
|
|
__Pyx_XDECREF(__pyx_r);
|
|
__pyx_t_1 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_5capnp__DynamicValueReader)), ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 262; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
|
|
__Pyx_GOTREF(__pyx_t_1);
|
|
__pyx_t_4 = __Pyx_PyObject_AsString(__pyx_v_field); if (unlikely((!__pyx_t_4) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 262; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
|
|
try {
|
|
__pyx_t_5 = __pyx_v_self->thisptr.get(__pyx_t_4);
|
|
} catch(...) {
|
|
try { throw; } catch(const std::exception& exn) { PyErr_SetString(__pyx_builtin_ValueError, exn.what()); } catch(...) { PyErr_SetNone(__pyx_builtin_ValueError); }
|
|
{__pyx_filename = __pyx_f[0]; __pyx_lineno = 262; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
|
|
}
|
|
__pyx_t_3 = ((struct __pyx_vtabstruct_5capnp__DynamicValueReader *)((struct __pyx_obj_5capnp__DynamicValueReader *)__pyx_t_1)->__pyx_vtab)->_init(((struct __pyx_obj_5capnp__DynamicValueReader *)__pyx_t_1), (( ::capnp::DynamicValue::Reader)__pyx_t_5)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 262; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
|
|
__Pyx_GOTREF(__pyx_t_3);
|
|
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
|
|
__pyx_r = __pyx_t_3;
|
|
__pyx_t_3 = 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("capnp._DynamicStructReader._get", __pyx_clineno, __pyx_lineno, __pyx_filename);
|
|
__pyx_r = 0;
|
|
__pyx_L0:;
|
|
__Pyx_XGIVEREF(__pyx_r);
|
|
__Pyx_RefNannyFinishContext();
|
|
return __pyx_r;
|
|
}
|
|
|
|
/* Python wrapper */
|
|
static PyObject *__pyx_pw_5capnp_20_DynamicStructReader_1_get(PyObject *__pyx_v_self, PyObject *__pyx_v_field); /*proto*/
|
|
static PyObject *__pyx_pw_5capnp_20_DynamicStructReader_1_get(PyObject *__pyx_v_self, PyObject *__pyx_v_field) {
|
|
PyObject *__pyx_r = 0;
|
|
__Pyx_RefNannyDeclarations
|
|
__Pyx_RefNannySetupContext("_get (wrapper)", 0);
|
|
__pyx_r = __pyx_pf_5capnp_20_DynamicStructReader__get(((struct __pyx_obj_5capnp__DynamicStructReader *)__pyx_v_self), ((PyObject *)__pyx_v_field));
|
|
__Pyx_RefNannyFinishContext();
|
|
return __pyx_r;
|
|
}
|
|
|
|
/* "capnp.pyx":261
|
|
* return self
|
|
*
|
|
* cpdef _get(self, field): # <<<<<<<<<<<<<<
|
|
* return _DynamicValueReader()._init(self.thisptr.get(field))
|
|
*
|
|
*/
|
|
|
|
static PyObject *__pyx_pf_5capnp_20_DynamicStructReader__get(struct __pyx_obj_5capnp__DynamicStructReader *__pyx_v_self, PyObject *__pyx_v_field) {
|
|
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("_get", 0);
|
|
__Pyx_XDECREF(__pyx_r);
|
|
__pyx_t_1 = ((struct __pyx_vtabstruct_5capnp__DynamicStructReader *)__pyx_v_self->__pyx_vtab)->_get(__pyx_v_self, __pyx_v_field, 1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 261; __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("capnp._DynamicStructReader._get", __pyx_clineno, __pyx_lineno, __pyx_filename);
|
|
__pyx_r = NULL;
|
|
__pyx_L0:;
|
|
__Pyx_XGIVEREF(__pyx_r);
|
|
__Pyx_RefNannyFinishContext();
|
|
return __pyx_r;
|
|
}
|
|
|
|
/* Python wrapper */
|
|
static PyObject *__pyx_pw_5capnp_20_DynamicStructReader_3__getattr__(PyObject *__pyx_v_self, PyObject *__pyx_v_field); /*proto*/
|
|
static PyObject *__pyx_pw_5capnp_20_DynamicStructReader_3__getattr__(PyObject *__pyx_v_self, PyObject *__pyx_v_field) {
|
|
PyObject *__pyx_r = 0;
|
|
__Pyx_RefNannyDeclarations
|
|
__Pyx_RefNannySetupContext("__getattr__ (wrapper)", 0);
|
|
__pyx_r = __pyx_pf_5capnp_20_DynamicStructReader_2__getattr__(((struct __pyx_obj_5capnp__DynamicStructReader *)__pyx_v_self), ((PyObject *)__pyx_v_field));
|
|
__Pyx_RefNannyFinishContext();
|
|
return __pyx_r;
|
|
}
|
|
|
|
/* "capnp.pyx":264
|
|
* return _DynamicValueReader()._init(self.thisptr.get(field))
|
|
*
|
|
* def __getattr__(self, field): # <<<<<<<<<<<<<<
|
|
* return self._get(field).toPython()
|
|
*
|
|
*/
|
|
|
|
static PyObject *__pyx_pf_5capnp_20_DynamicStructReader_2__getattr__(struct __pyx_obj_5capnp__DynamicStructReader *__pyx_v_self, PyObject *__pyx_v_field) {
|
|
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("__getattr__", 0);
|
|
|
|
/* "capnp.pyx":265
|
|
*
|
|
* def __getattr__(self, field):
|
|
* return self._get(field).toPython() # <<<<<<<<<<<<<<
|
|
*
|
|
* def _has(self, field):
|
|
*/
|
|
__Pyx_XDECREF(__pyx_r);
|
|
__pyx_t_1 = ((struct __pyx_vtabstruct_5capnp__DynamicStructReader *)__pyx_v_self->__pyx_vtab)->_get(__pyx_v_self, __pyx_v_field, 0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 265; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
|
|
__Pyx_GOTREF(__pyx_t_1);
|
|
__pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s__toPython); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 265; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
|
|
__Pyx_GOTREF(__pyx_t_2);
|
|
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
|
|
__pyx_t_1 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 265; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
|
|
__Pyx_GOTREF(__pyx_t_1);
|
|
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
|
|
__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("capnp._DynamicStructReader.__getattr__", __pyx_clineno, __pyx_lineno, __pyx_filename);
|
|
__pyx_r = NULL;
|
|
__pyx_L0:;
|
|
__Pyx_XGIVEREF(__pyx_r);
|
|
__Pyx_RefNannyFinishContext();
|
|
return __pyx_r;
|
|
}
|
|
|
|
/* Python wrapper */
|
|
static PyObject *__pyx_pw_5capnp_20_DynamicStructReader_5_has(PyObject *__pyx_v_self, PyObject *__pyx_v_field); /*proto*/
|
|
static PyObject *__pyx_pw_5capnp_20_DynamicStructReader_5_has(PyObject *__pyx_v_self, PyObject *__pyx_v_field) {
|
|
PyObject *__pyx_r = 0;
|
|
__Pyx_RefNannyDeclarations
|
|
__Pyx_RefNannySetupContext("_has (wrapper)", 0);
|
|
__pyx_r = __pyx_pf_5capnp_20_DynamicStructReader_4_has(((struct __pyx_obj_5capnp__DynamicStructReader *)__pyx_v_self), ((PyObject *)__pyx_v_field));
|
|
__Pyx_RefNannyFinishContext();
|
|
return __pyx_r;
|
|
}
|
|
|
|
/* "capnp.pyx":267
|
|
* return self._get(field).toPython()
|
|
*
|
|
* def _has(self, field): # <<<<<<<<<<<<<<
|
|
* return self.thisptr.has(field)
|
|
*
|
|
*/
|
|
|
|
static PyObject *__pyx_pf_5capnp_20_DynamicStructReader_4_has(struct __pyx_obj_5capnp__DynamicStructReader *__pyx_v_self, PyObject *__pyx_v_field) {
|
|
PyObject *__pyx_r = NULL;
|
|
__Pyx_RefNannyDeclarations
|
|
char *__pyx_t_1;
|
|
int __pyx_t_2;
|
|
PyObject *__pyx_t_3 = NULL;
|
|
int __pyx_lineno = 0;
|
|
const char *__pyx_filename = NULL;
|
|
int __pyx_clineno = 0;
|
|
__Pyx_RefNannySetupContext("_has", 0);
|
|
|
|
/* "capnp.pyx":268
|
|
*
|
|
* def _has(self, field):
|
|
* return self.thisptr.has(field) # <<<<<<<<<<<<<<
|
|
*
|
|
* cdef class _DynamicStructBuilder:
|
|
*/
|
|
__Pyx_XDECREF(__pyx_r);
|
|
__pyx_t_1 = __Pyx_PyObject_AsString(__pyx_v_field); if (unlikely((!__pyx_t_1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 268; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
|
|
try {
|
|
__pyx_t_2 = __pyx_v_self->thisptr.has(__pyx_t_1);
|
|
} catch(...) {
|
|
try { throw; } catch(const std::exception& exn) { PyErr_SetString(__pyx_builtin_ValueError, exn.what()); } catch(...) { PyErr_SetNone(__pyx_builtin_ValueError); }
|
|
{__pyx_filename = __pyx_f[0]; __pyx_lineno = 268; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
|
|
}
|
|
__pyx_t_3 = __Pyx_PyBool_FromLong(__pyx_t_2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 268; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
|
|
__Pyx_GOTREF(__pyx_t_3);
|
|
__pyx_r = __pyx_t_3;
|
|
__pyx_t_3 = 0;
|
|
goto __pyx_L0;
|
|
|
|
__pyx_r = Py_None; __Pyx_INCREF(Py_None);
|
|
goto __pyx_L0;
|
|
__pyx_L1_error:;
|
|
__Pyx_XDECREF(__pyx_t_3);
|
|
__Pyx_AddTraceback("capnp._DynamicStructReader._has", __pyx_clineno, __pyx_lineno, __pyx_filename);
|
|
__pyx_r = NULL;
|
|
__pyx_L0:;
|
|
__Pyx_XGIVEREF(__pyx_r);
|
|
__Pyx_RefNannyFinishContext();
|
|
return __pyx_r;
|
|
}
|
|
|
|
/* "capnp.pyx":272
|
|
* cdef class _DynamicStructBuilder:
|
|
* cdef C_DynamicStruct.Builder thisptr
|
|
* cdef _init(self, C_DynamicStruct.Builder other): # <<<<<<<<<<<<<<
|
|
* self.thisptr = other
|
|
* return self
|
|
*/
|
|
|
|
static PyObject *__pyx_f_5capnp_21_DynamicStructBuilder__init(struct __pyx_obj_5capnp__DynamicStructBuilder *__pyx_v_self, ::capnp::DynamicStruct::Builder __pyx_v_other) {
|
|
PyObject *__pyx_r = NULL;
|
|
__Pyx_RefNannyDeclarations
|
|
__Pyx_RefNannySetupContext("_init", 0);
|
|
|
|
/* "capnp.pyx":273
|
|
* cdef C_DynamicStruct.Builder thisptr
|
|
* cdef _init(self, C_DynamicStruct.Builder other):
|
|
* self.thisptr = other # <<<<<<<<<<<<<<
|
|
* return self
|
|
*
|
|
*/
|
|
__pyx_v_self->thisptr = __pyx_v_other;
|
|
|
|
/* "capnp.pyx":274
|
|
* cdef _init(self, C_DynamicStruct.Builder other):
|
|
* self.thisptr = other
|
|
* return self # <<<<<<<<<<<<<<
|
|
*
|
|
* def __getattr__(self, field):
|
|
*/
|
|
__Pyx_XDECREF(__pyx_r);
|
|
__Pyx_INCREF(((PyObject *)__pyx_v_self));
|
|
__pyx_r = ((PyObject *)__pyx_v_self);
|
|
goto __pyx_L0;
|
|
|
|
__pyx_r = Py_None; __Pyx_INCREF(Py_None);
|
|
__pyx_L0:;
|
|
__Pyx_XGIVEREF(__pyx_r);
|
|
__Pyx_RefNannyFinishContext();
|
|
return __pyx_r;
|
|
}
|
|
|
|
/* Python wrapper */
|
|
static PyObject *__pyx_pw_5capnp_21_DynamicStructBuilder_1__getattr__(PyObject *__pyx_v_self, PyObject *__pyx_v_field); /*proto*/
|
|
static PyObject *__pyx_pw_5capnp_21_DynamicStructBuilder_1__getattr__(PyObject *__pyx_v_self, PyObject *__pyx_v_field) {
|
|
PyObject *__pyx_r = 0;
|
|
__Pyx_RefNannyDeclarations
|
|
__Pyx_RefNannySetupContext("__getattr__ (wrapper)", 0);
|
|
__pyx_r = __pyx_pf_5capnp_21_DynamicStructBuilder___getattr__(((struct __pyx_obj_5capnp__DynamicStructBuilder *)__pyx_v_self), ((PyObject *)__pyx_v_field));
|
|
__Pyx_RefNannyFinishContext();
|
|
return __pyx_r;
|
|
}
|
|
|
|
/* Python wrapper */
|
|
static PyObject *__pyx_pw_5capnp_21_DynamicStructBuilder_11__getattr___lambda1(PyObject *__pyx_self, PyObject *__pyx_v_size); /*proto*/
|
|
static PyMethodDef __pyx_mdef_5capnp_21_DynamicStructBuilder_11__getattr___lambda1 = {__Pyx_NAMESTR("lambda1"), (PyCFunction)__pyx_pw_5capnp_21_DynamicStructBuilder_11__getattr___lambda1, METH_O, __Pyx_DOCSTR(0)};
|
|
static PyObject *__pyx_pw_5capnp_21_DynamicStructBuilder_11__getattr___lambda1(PyObject *__pyx_self, PyObject *__pyx_v_size) {
|
|
PyObject *__pyx_r = 0;
|
|
__Pyx_RefNannyDeclarations
|
|
__Pyx_RefNannySetupContext("lambda1 (wrapper)", 0);
|
|
__pyx_r = __pyx_lambda_funcdef_lambda1(__pyx_self, ((PyObject *)__pyx_v_size));
|
|
__Pyx_RefNannyFinishContext();
|
|
return __pyx_r;
|
|
}
|
|
|
|
/* "capnp.pyx":281
|
|
* try:
|
|
* self._has(field_name) # We don't need to test bool value here, since it will throw an exception if the field is non-existant
|
|
* return lambda size: self.init(field_name, size) # <<<<<<<<<<<<<<
|
|
* except ValueError: pass
|
|
* return toPython(self.thisptr.get(field))
|
|
*/
|
|
|
|
static PyObject *__pyx_lambda_funcdef_lambda1(PyObject *__pyx_self, PyObject *__pyx_v_size) {
|
|
struct __pyx_obj_5capnp___pyx_scope_struct_2___getattr__ *__pyx_cur_scope;
|
|
struct __pyx_obj_5capnp___pyx_scope_struct_2___getattr__ *__pyx_outer_scope;
|
|
PyObject *__pyx_r = NULL;
|
|
__Pyx_RefNannyDeclarations
|
|
PyObject *__pyx_t_1 = NULL;
|
|
PyObject *__pyx_t_2 = NULL;
|
|
struct __pyx_opt_args_5capnp_21_DynamicStructBuilder_init __pyx_t_3;
|
|
int __pyx_lineno = 0;
|
|
const char *__pyx_filename = NULL;
|
|
int __pyx_clineno = 0;
|
|
__Pyx_RefNannySetupContext("lambda1", 0);
|
|
__pyx_outer_scope = (struct __pyx_obj_5capnp___pyx_scope_struct_2___getattr__ *) __Pyx_CyFunction_GetClosure(__pyx_self);
|
|
__pyx_cur_scope = __pyx_outer_scope;
|
|
__Pyx_XDECREF(__pyx_r);
|
|
if (unlikely(!__pyx_cur_scope->__pyx_v_self)) { __Pyx_RaiseClosureNameError("self"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 281; __pyx_clineno = __LINE__; goto __pyx_L1_error;} }
|
|
if (unlikely(!__pyx_cur_scope->__pyx_v_field_name)) { __Pyx_RaiseClosureNameError("field_name"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 281; __pyx_clineno = __LINE__; goto __pyx_L1_error;} }
|
|
__pyx_t_1 = __pyx_cur_scope->__pyx_v_field_name;
|
|
__Pyx_INCREF(__pyx_t_1);
|
|
__pyx_t_3.__pyx_n = 1;
|
|
__pyx_t_3.size = __pyx_v_size;
|
|
try {
|
|
__pyx_t_2 = ((struct __pyx_vtabstruct_5capnp__DynamicStructBuilder *)__pyx_cur_scope->__pyx_v_self->__pyx_vtab)->init(__pyx_cur_scope->__pyx_v_self, __pyx_t_1, 0, &__pyx_t_3);
|
|
} catch(...) {
|
|
try { throw; } catch(const std::exception& exn) { PyErr_SetString(__pyx_builtin_ValueError, exn.what()); } catch(...) { PyErr_SetNone(__pyx_builtin_ValueError); }
|
|
{__pyx_filename = __pyx_f[0]; __pyx_lineno = 281; __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;
|
|
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("capnp._DynamicStructBuilder.__getattr__.lambda1", __pyx_clineno, __pyx_lineno, __pyx_filename);
|
|
__pyx_r = NULL;
|
|
__pyx_L0:;
|
|
__Pyx_XGIVEREF(__pyx_r);
|
|
__Pyx_RefNannyFinishContext();
|
|
return __pyx_r;
|
|
}
|
|
|
|
/* "capnp.pyx":276
|
|
* return self
|
|
*
|
|
* def __getattr__(self, field): # <<<<<<<<<<<<<<
|
|
* if field.startswith('init'):
|
|
* field_name = field[4].lower() + field[5:]
|
|
*/
|
|
|
|
static PyObject *__pyx_pf_5capnp_21_DynamicStructBuilder___getattr__(struct __pyx_obj_5capnp__DynamicStructBuilder *__pyx_v_self, PyObject *__pyx_v_field) {
|
|
struct __pyx_obj_5capnp___pyx_scope_struct_2___getattr__ *__pyx_cur_scope;
|
|
PyObject *__pyx_r = NULL;
|
|
__Pyx_RefNannyDeclarations
|
|
PyObject *__pyx_t_1 = NULL;
|
|
PyObject *__pyx_t_2 = NULL;
|
|
int __pyx_t_3;
|
|
PyObject *__pyx_t_4 = NULL;
|
|
PyObject *__pyx_t_5 = NULL;
|
|
PyObject *__pyx_t_6 = NULL;
|
|
PyObject *__pyx_t_7 = NULL;
|
|
int __pyx_t_8;
|
|
char *__pyx_t_9;
|
|
::capnp::DynamicValue::Builder __pyx_t_10;
|
|
int __pyx_lineno = 0;
|
|
const char *__pyx_filename = NULL;
|
|
int __pyx_clineno = 0;
|
|
__Pyx_RefNannySetupContext("__getattr__", 0);
|
|
__pyx_cur_scope = (struct __pyx_obj_5capnp___pyx_scope_struct_2___getattr__ *)__pyx_tp_new_5capnp___pyx_scope_struct_2___getattr__(__pyx_ptype_5capnp___pyx_scope_struct_2___getattr__, __pyx_empty_tuple, NULL);
|
|
if (unlikely(!__pyx_cur_scope)) {
|
|
__Pyx_RefNannyFinishContext();
|
|
return NULL;
|
|
}
|
|
__Pyx_GOTREF(__pyx_cur_scope);
|
|
__pyx_cur_scope->__pyx_v_self = __pyx_v_self;
|
|
__Pyx_INCREF((PyObject *)__pyx_cur_scope->__pyx_v_self);
|
|
__Pyx_GIVEREF((PyObject *)__pyx_cur_scope->__pyx_v_self);
|
|
|
|
/* "capnp.pyx":277
|
|
*
|
|
* def __getattr__(self, field):
|
|
* if field.startswith('init'): # <<<<<<<<<<<<<<
|
|
* field_name = field[4].lower() + field[5:]
|
|
* try:
|
|
*/
|
|
__pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_field, __pyx_n_s__startswith); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 277; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
|
|
__Pyx_GOTREF(__pyx_t_1);
|
|
__pyx_t_2 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_k_tuple_25), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 277; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
|
|
__Pyx_GOTREF(__pyx_t_2);
|
|
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
|
|
__pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 277; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
|
|
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
|
|
if (__pyx_t_3) {
|
|
|
|
/* "capnp.pyx":278
|
|
* def __getattr__(self, field):
|
|
* if field.startswith('init'):
|
|
* field_name = field[4].lower() + field[5:] # <<<<<<<<<<<<<<
|
|
* try:
|
|
* self._has(field_name) # We don't need to test bool value here, since it will throw an exception if the field is non-existant
|
|
*/
|
|
__pyx_t_2 = __Pyx_GetItemInt(__pyx_v_field, 4, sizeof(long), PyInt_FromLong, 0, 0, 1); if (!__pyx_t_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 278; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
|
|
__Pyx_GOTREF(__pyx_t_2);
|
|
__pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s__lower); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 278; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
|
|
__Pyx_GOTREF(__pyx_t_1);
|
|
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
|
|
__pyx_t_2 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 278; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
|
|
__Pyx_GOTREF(__pyx_t_2);
|
|
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
|
|
__pyx_t_1 = __Pyx_PyObject_GetSlice(__pyx_v_field, 5, 0, NULL, NULL, &__pyx_k_slice_26, 1, 0, 1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 278; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
|
|
__Pyx_GOTREF(__pyx_t_1);
|
|
__pyx_t_4 = PyNumber_Add(__pyx_t_2, __pyx_t_1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 278; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
|
|
__Pyx_GOTREF(__pyx_t_4);
|
|
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
|
|
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
|
|
__Pyx_GIVEREF(__pyx_t_4);
|
|
__pyx_cur_scope->__pyx_v_field_name = __pyx_t_4;
|
|
__pyx_t_4 = 0;
|
|
|
|
/* "capnp.pyx":279
|
|
* if field.startswith('init'):
|
|
* field_name = field[4].lower() + field[5:]
|
|
* try: # <<<<<<<<<<<<<<
|
|
* self._has(field_name) # We don't need to test bool value here, since it will throw an exception if the field is non-existant
|
|
* return lambda size: self.init(field_name, size)
|
|
*/
|
|
{
|
|
__Pyx_ExceptionSave(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7);
|
|
__Pyx_XGOTREF(__pyx_t_5);
|
|
__Pyx_XGOTREF(__pyx_t_6);
|
|
__Pyx_XGOTREF(__pyx_t_7);
|
|
/*try:*/ {
|
|
|
|
/* "capnp.pyx":280
|
|
* field_name = field[4].lower() + field[5:]
|
|
* try:
|
|
* self._has(field_name) # We don't need to test bool value here, since it will throw an exception if the field is non-existant # <<<<<<<<<<<<<<
|
|
* return lambda size: self.init(field_name, size)
|
|
* except ValueError: pass
|
|
*/
|
|
__pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_cur_scope->__pyx_v_self), __pyx_n_s___has); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 280; __pyx_clineno = __LINE__; goto __pyx_L4_error;}
|
|
__Pyx_GOTREF(__pyx_t_4);
|
|
__pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 280; __pyx_clineno = __LINE__; goto __pyx_L4_error;}
|
|
__Pyx_GOTREF(__pyx_t_1);
|
|
__Pyx_INCREF(__pyx_cur_scope->__pyx_v_field_name);
|
|
PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_cur_scope->__pyx_v_field_name);
|
|
__Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_field_name);
|
|
__pyx_t_2 = PyObject_Call(__pyx_t_4, ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 280; __pyx_clineno = __LINE__; goto __pyx_L4_error;}
|
|
__Pyx_GOTREF(__pyx_t_2);
|
|
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
|
|
__Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
|
|
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
|
|
|
|
/* "capnp.pyx":281
|
|
* try:
|
|
* self._has(field_name) # We don't need to test bool value here, since it will throw an exception if the field is non-existant
|
|
* return lambda size: self.init(field_name, size) # <<<<<<<<<<<<<<
|
|
* except ValueError: pass
|
|
* return toPython(self.thisptr.get(field))
|
|
*/
|
|
__Pyx_XDECREF(__pyx_r);
|
|
__pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_5capnp_21_DynamicStructBuilder_11__getattr___lambda1, 0, __pyx_n_s_27, ((PyObject*)__pyx_cur_scope), __pyx_n_s__capnp, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 281; __pyx_clineno = __LINE__; goto __pyx_L4_error;}
|
|
__Pyx_GOTREF(__pyx_t_2);
|
|
__pyx_r = __pyx_t_2;
|
|
__pyx_t_2 = 0;
|
|
goto __pyx_L8_try_return;
|
|
}
|
|
__Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
|
|
__Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
|
|
__Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
|
|
goto __pyx_L11_try_end;
|
|
__pyx_L8_try_return:;
|
|
__Pyx_XGIVEREF(__pyx_t_5);
|
|
__Pyx_XGIVEREF(__pyx_t_6);
|
|
__Pyx_XGIVEREF(__pyx_t_7);
|
|
__Pyx_ExceptionReset(__pyx_t_5, __pyx_t_6, __pyx_t_7);
|
|
goto __pyx_L0;
|
|
__pyx_L4_error:;
|
|
__Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
|
|
__Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
|
|
__Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
|
|
|
|
/* "capnp.pyx":282
|
|
* self._has(field_name) # We don't need to test bool value here, since it will throw an exception if the field is non-existant
|
|
* return lambda size: self.init(field_name, size)
|
|
* except ValueError: pass # <<<<<<<<<<<<<<
|
|
* return toPython(self.thisptr.get(field))
|
|
*
|
|
*/
|
|
__pyx_t_8 = PyErr_ExceptionMatches(__pyx_builtin_ValueError);
|
|
if (__pyx_t_8) {
|
|
PyErr_Restore(0,0,0);
|
|
goto __pyx_L5_exception_handled;
|
|
}
|
|
__Pyx_XGIVEREF(__pyx_t_5);
|
|
__Pyx_XGIVEREF(__pyx_t_6);
|
|
__Pyx_XGIVEREF(__pyx_t_7);
|
|
__Pyx_ExceptionReset(__pyx_t_5, __pyx_t_6, __pyx_t_7);
|
|
goto __pyx_L1_error;
|
|
__pyx_L5_exception_handled:;
|
|
__Pyx_XGIVEREF(__pyx_t_5);
|
|
__Pyx_XGIVEREF(__pyx_t_6);
|
|
__Pyx_XGIVEREF(__pyx_t_7);
|
|
__Pyx_ExceptionReset(__pyx_t_5, __pyx_t_6, __pyx_t_7);
|
|
__pyx_L11_try_end:;
|
|
}
|
|
goto __pyx_L3;
|
|
}
|
|
__pyx_L3:;
|
|
|
|
/* "capnp.pyx":283
|
|
* return lambda size: self.init(field_name, size)
|
|
* except ValueError: pass
|
|
* return toPython(self.thisptr.get(field)) # <<<<<<<<<<<<<<
|
|
*
|
|
* cdef _setattrInt(self, field, value):
|
|
*/
|
|
__Pyx_XDECREF(__pyx_r);
|
|
__pyx_t_9 = __Pyx_PyObject_AsString(__pyx_v_field); if (unlikely((!__pyx_t_9) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 283; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
|
|
try {
|
|
__pyx_t_10 = __pyx_cur_scope->__pyx_v_self->thisptr.get(__pyx_t_9);
|
|
} catch(...) {
|
|
try { throw; } catch(const std::exception& exn) { PyErr_SetString(__pyx_builtin_ValueError, exn.what()); } catch(...) { PyErr_SetNone(__pyx_builtin_ValueError); }
|
|
{__pyx_filename = __pyx_f[0]; __pyx_lineno = 283; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
|
|
}
|
|
__pyx_t_2 = __pyx_f_5capnp_toPython((( ::capnp::DynamicValue::Builder &)__pyx_t_10)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 283; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
|
|
__Pyx_GOTREF(__pyx_t_2);
|
|
__pyx_r = __pyx_t_2;
|
|
__pyx_t_2 = 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_4);
|
|
__Pyx_AddTraceback("capnp._DynamicStructBuilder.__getattr__", __pyx_clineno, __pyx_lineno, __pyx_filename);
|
|
__pyx_r = NULL;
|
|
__pyx_L0:;
|
|
__Pyx_DECREF(((PyObject *)__pyx_cur_scope));
|
|
__Pyx_XGIVEREF(__pyx_r);
|
|
__Pyx_RefNannyFinishContext();
|
|
return __pyx_r;
|
|
}
|
|
|
|
/* "capnp.pyx":285
|
|
* return toPython(self.thisptr.get(field))
|
|
*
|
|
* cdef _setattrInt(self, field, value): # <<<<<<<<<<<<<<
|
|
* cdef C_DynamicValue.Reader temp = C_DynamicValue.Reader(<long long>value)
|
|
* self.thisptr.set(field, temp)
|
|
*/
|
|
|
|
static PyObject *__pyx_f_5capnp_21_DynamicStructBuilder__setattrInt(struct __pyx_obj_5capnp__DynamicStructBuilder *__pyx_v_self, PyObject *__pyx_v_field, PyObject *__pyx_v_value) {
|
|
::capnp::DynamicValue::Reader __pyx_v_temp;
|
|
PyObject *__pyx_r = NULL;
|
|
__Pyx_RefNannyDeclarations
|
|
PY_LONG_LONG __pyx_t_1;
|
|
char *__pyx_t_2;
|
|
int __pyx_lineno = 0;
|
|
const char *__pyx_filename = NULL;
|
|
int __pyx_clineno = 0;
|
|
__Pyx_RefNannySetupContext("_setattrInt", 0);
|
|
|
|
/* "capnp.pyx":286
|
|
*
|
|
* cdef _setattrInt(self, field, value):
|
|
* cdef C_DynamicValue.Reader temp = C_DynamicValue.Reader(<long long>value) # <<<<<<<<<<<<<<
|
|
* self.thisptr.set(field, temp)
|
|
*
|
|
*/
|
|
__pyx_t_1 = __Pyx_PyInt_AsLongLong(__pyx_v_value); if (unlikely((__pyx_t_1 == (PY_LONG_LONG)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 286; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
|
|
__pyx_v_temp = ::capnp::DynamicValue::Reader(((PY_LONG_LONG)__pyx_t_1));
|
|
|
|
/* "capnp.pyx":287
|
|
* cdef _setattrInt(self, field, value):
|
|
* cdef C_DynamicValue.Reader temp = C_DynamicValue.Reader(<long long>value)
|
|
* self.thisptr.set(field, temp) # <<<<<<<<<<<<<<
|
|
*
|
|
* cdef _setattrDouble(self, field, value):
|
|
*/
|
|
__pyx_t_2 = __Pyx_PyObject_AsString(__pyx_v_field); if (unlikely((!__pyx_t_2) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 287; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
|
|
try {
|
|
__pyx_v_self->thisptr.set(__pyx_t_2, (( ::capnp::DynamicValue::Reader &)__pyx_v_temp));
|
|
} catch(...) {
|
|
try { throw; } catch(const std::exception& exn) { PyErr_SetString(__pyx_builtin_ValueError, exn.what()); } catch(...) { PyErr_SetNone(__pyx_builtin_ValueError); }
|
|
{__pyx_filename = __pyx_f[0]; __pyx_lineno = 287; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
|
|
}
|
|
|
|
__pyx_r = Py_None; __Pyx_INCREF(Py_None);
|
|
goto __pyx_L0;
|
|
__pyx_L1_error:;
|
|
__Pyx_AddTraceback("capnp._DynamicStructBuilder._setattrInt", __pyx_clineno, __pyx_lineno, __pyx_filename);
|
|
__pyx_r = 0;
|
|
__pyx_L0:;
|
|
__Pyx_XGIVEREF(__pyx_r);
|
|
__Pyx_RefNannyFinishContext();
|
|
return __pyx_r;
|
|
}
|
|
|
|
/* "capnp.pyx":289
|
|
* self.thisptr.set(field, temp)
|
|
*
|
|
* cdef _setattrDouble(self, field, value): # <<<<<<<<<<<<<<
|
|
* cdef C_DynamicValue.Reader temp = C_DynamicValue.Reader(<double>value)
|
|
* self.thisptr.set(field, temp)
|
|
*/
|
|
|
|
static PyObject *__pyx_f_5capnp_21_DynamicStructBuilder__setattrDouble(struct __pyx_obj_5capnp__DynamicStructBuilder *__pyx_v_self, PyObject *__pyx_v_field, PyObject *__pyx_v_value) {
|
|
::capnp::DynamicValue::Reader __pyx_v_temp;
|
|
PyObject *__pyx_r = NULL;
|
|
__Pyx_RefNannyDeclarations
|
|
double __pyx_t_1;
|
|
char *__pyx_t_2;
|
|
int __pyx_lineno = 0;
|
|
const char *__pyx_filename = NULL;
|
|
int __pyx_clineno = 0;
|
|
__Pyx_RefNannySetupContext("_setattrDouble", 0);
|
|
|
|
/* "capnp.pyx":290
|
|
*
|
|
* cdef _setattrDouble(self, field, value):
|
|
* cdef C_DynamicValue.Reader temp = C_DynamicValue.Reader(<double>value) # <<<<<<<<<<<<<<
|
|
* self.thisptr.set(field, temp)
|
|
*
|
|
*/
|
|
__pyx_t_1 = __pyx_PyFloat_AsDouble(__pyx_v_value); if (unlikely((__pyx_t_1 == (double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 290; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
|
|
__pyx_v_temp = ::capnp::DynamicValue::Reader(((double)__pyx_t_1));
|
|
|
|
/* "capnp.pyx":291
|
|
* cdef _setattrDouble(self, field, value):
|
|
* cdef C_DynamicValue.Reader temp = C_DynamicValue.Reader(<double>value)
|
|
* self.thisptr.set(field, temp) # <<<<<<<<<<<<<<
|
|
*
|
|
* cdef _setattrBool(self, field, value):
|
|
*/
|
|
__pyx_t_2 = __Pyx_PyObject_AsString(__pyx_v_field); if (unlikely((!__pyx_t_2) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 291; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
|
|
try {
|
|
__pyx_v_self->thisptr.set(__pyx_t_2, (( ::capnp::DynamicValue::Reader &)__pyx_v_temp));
|
|
} catch(...) {
|
|
try { throw; } catch(const std::exception& exn) { PyErr_SetString(__pyx_builtin_ValueError, exn.what()); } catch(...) { PyErr_SetNone(__pyx_builtin_ValueError); }
|
|
{__pyx_filename = __pyx_f[0]; __pyx_lineno = 291; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
|
|
}
|
|
|
|
__pyx_r = Py_None; __Pyx_INCREF(Py_None);
|
|
goto __pyx_L0;
|
|
__pyx_L1_error:;
|
|
__Pyx_AddTraceback("capnp._DynamicStructBuilder._setattrDouble", __pyx_clineno, __pyx_lineno, __pyx_filename);
|
|
__pyx_r = 0;
|
|
__pyx_L0:;
|
|
__Pyx_XGIVEREF(__pyx_r);
|
|
__Pyx_RefNannyFinishContext();
|
|
return __pyx_r;
|
|
}
|
|
|
|
/* "capnp.pyx":293
|
|
* self.thisptr.set(field, temp)
|
|
*
|
|
* cdef _setattrBool(self, field, value): # <<<<<<<<<<<<<<
|
|
* cdef C_DynamicValue.Reader temp = C_DynamicValue.Reader(<bint>value)
|
|
* self.thisptr.set(field, temp)
|
|
*/
|
|
|
|
static PyObject *__pyx_f_5capnp_21_DynamicStructBuilder__setattrBool(struct __pyx_obj_5capnp__DynamicStructBuilder *__pyx_v_self, PyObject *__pyx_v_field, PyObject *__pyx_v_value) {
|
|
::capnp::DynamicValue::Reader __pyx_v_temp;
|
|
PyObject *__pyx_r = NULL;
|
|
__Pyx_RefNannyDeclarations
|
|
int __pyx_t_1;
|
|
char *__pyx_t_2;
|
|
int __pyx_lineno = 0;
|
|
const char *__pyx_filename = NULL;
|
|
int __pyx_clineno = 0;
|
|
__Pyx_RefNannySetupContext("_setattrBool", 0);
|
|
|
|
/* "capnp.pyx":294
|
|
*
|
|
* cdef _setattrBool(self, field, value):
|
|
* cdef C_DynamicValue.Reader temp = C_DynamicValue.Reader(<bint>value) # <<<<<<<<<<<<<<
|
|
* self.thisptr.set(field, temp)
|
|
*
|
|
*/
|
|
__pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_value); if (unlikely((__pyx_t_1 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 294; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
|
|
__pyx_v_temp = ::capnp::DynamicValue::Reader(((int)__pyx_t_1));
|
|
|
|
/* "capnp.pyx":295
|
|
* cdef _setattrBool(self, field, value):
|
|
* cdef C_DynamicValue.Reader temp = C_DynamicValue.Reader(<bint>value)
|
|
* self.thisptr.set(field, temp) # <<<<<<<<<<<<<<
|
|
*
|
|
* cdef _setattrString(self, field, value):
|
|
*/
|
|
__pyx_t_2 = __Pyx_PyObject_AsString(__pyx_v_field); if (unlikely((!__pyx_t_2) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 295; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
|
|
try {
|
|
__pyx_v_self->thisptr.set(__pyx_t_2, (( ::capnp::DynamicValue::Reader &)__pyx_v_temp));
|
|
} catch(...) {
|
|
try { throw; } catch(const std::exception& exn) { PyErr_SetString(__pyx_builtin_ValueError, exn.what()); } catch(...) { PyErr_SetNone(__pyx_builtin_ValueError); }
|
|
{__pyx_filename = __pyx_f[0]; __pyx_lineno = 295; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
|
|
}
|
|
|
|
__pyx_r = Py_None; __Pyx_INCREF(Py_None);
|
|
goto __pyx_L0;
|
|
__pyx_L1_error:;
|
|
__Pyx_AddTraceback("capnp._DynamicStructBuilder._setattrBool", __pyx_clineno, __pyx_lineno, __pyx_filename);
|
|
__pyx_r = 0;
|
|
__pyx_L0:;
|
|
__Pyx_XGIVEREF(__pyx_r);
|
|
__Pyx_RefNannyFinishContext();
|
|
return __pyx_r;
|
|
}
|
|
|
|
/* "capnp.pyx":297
|
|
* self.thisptr.set(field, temp)
|
|
*
|
|
* cdef _setattrString(self, field, value): # <<<<<<<<<<<<<<
|
|
* cdef C_DynamicValue.Reader temp = C_DynamicValue.Reader(<char*>value)
|
|
* self.thisptr.set(field, temp)
|
|
*/
|
|
|
|
static PyObject *__pyx_f_5capnp_21_DynamicStructBuilder__setattrString(struct __pyx_obj_5capnp__DynamicStructBuilder *__pyx_v_self, PyObject *__pyx_v_field, PyObject *__pyx_v_value) {
|
|
::capnp::DynamicValue::Reader __pyx_v_temp;
|
|
PyObject *__pyx_r = NULL;
|
|
__Pyx_RefNannyDeclarations
|
|
char *__pyx_t_1;
|
|
int __pyx_lineno = 0;
|
|
const char *__pyx_filename = NULL;
|
|
int __pyx_clineno = 0;
|
|
__Pyx_RefNannySetupContext("_setattrString", 0);
|
|
|
|
/* "capnp.pyx":298
|
|
*
|
|
* cdef _setattrString(self, field, value):
|
|
* cdef C_DynamicValue.Reader temp = C_DynamicValue.Reader(<char*>value) # <<<<<<<<<<<<<<
|
|
* self.thisptr.set(field, temp)
|
|
*
|
|
*/
|
|
__pyx_t_1 = __Pyx_PyObject_AsString(__pyx_v_value); if (unlikely((!__pyx_t_1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 298; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
|
|
__pyx_v_temp = ::capnp::DynamicValue::Reader(((char *)__pyx_t_1));
|
|
|
|
/* "capnp.pyx":299
|
|
* cdef _setattrString(self, field, value):
|
|
* cdef C_DynamicValue.Reader temp = C_DynamicValue.Reader(<char*>value)
|
|
* self.thisptr.set(field, temp) # <<<<<<<<<<<<<<
|
|
*
|
|
* cdef _setattrVoid(self, field):
|
|
*/
|
|
__pyx_t_1 = __Pyx_PyObject_AsString(__pyx_v_field); if (unlikely((!__pyx_t_1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 299; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
|
|
try {
|
|
__pyx_v_self->thisptr.set(__pyx_t_1, (( ::capnp::DynamicValue::Reader &)__pyx_v_temp));
|
|
} catch(...) {
|
|
try { throw; } catch(const std::exception& exn) { PyErr_SetString(__pyx_builtin_ValueError, exn.what()); } catch(...) { PyErr_SetNone(__pyx_builtin_ValueError); }
|
|
{__pyx_filename = __pyx_f[0]; __pyx_lineno = 299; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
|
|
}
|
|
|
|
__pyx_r = Py_None; __Pyx_INCREF(Py_None);
|
|
goto __pyx_L0;
|
|
__pyx_L1_error:;
|
|
__Pyx_AddTraceback("capnp._DynamicStructBuilder._setattrString", __pyx_clineno, __pyx_lineno, __pyx_filename);
|
|
__pyx_r = 0;
|
|
__pyx_L0:;
|
|
__Pyx_XGIVEREF(__pyx_r);
|
|
__Pyx_RefNannyFinishContext();
|
|
return __pyx_r;
|
|
}
|
|
|
|
/* "capnp.pyx":301
|
|
* self.thisptr.set(field, temp)
|
|
*
|
|
* cdef _setattrVoid(self, field): # <<<<<<<<<<<<<<
|
|
* cdef C_DynamicValue.Reader temp = C_DynamicValue.Reader(VOID)
|
|
* self.thisptr.set(field, temp)
|
|
*/
|
|
|
|
static PyObject *__pyx_f_5capnp_21_DynamicStructBuilder__setattrVoid(struct __pyx_obj_5capnp__DynamicStructBuilder *__pyx_v_self, PyObject *__pyx_v_field) {
|
|
::capnp::DynamicValue::Reader __pyx_v_temp;
|
|
PyObject *__pyx_r = NULL;
|
|
__Pyx_RefNannyDeclarations
|
|
char *__pyx_t_1;
|
|
int __pyx_lineno = 0;
|
|
const char *__pyx_filename = NULL;
|
|
int __pyx_clineno = 0;
|
|
__Pyx_RefNannySetupContext("_setattrVoid", 0);
|
|
|
|
/* "capnp.pyx":302
|
|
*
|
|
* cdef _setattrVoid(self, field):
|
|
* cdef C_DynamicValue.Reader temp = C_DynamicValue.Reader(VOID) # <<<<<<<<<<<<<<
|
|
* self.thisptr.set(field, temp)
|
|
*
|
|
*/
|
|
__pyx_v_temp = ::capnp::DynamicValue::Reader( ::capnp::Void::VOID);
|
|
|
|
/* "capnp.pyx":303
|
|
* cdef _setattrVoid(self, field):
|
|
* cdef C_DynamicValue.Reader temp = C_DynamicValue.Reader(VOID)
|
|
* self.thisptr.set(field, temp) # <<<<<<<<<<<<<<
|
|
*
|
|
* def __setattr__(self, field, value):
|
|
*/
|
|
__pyx_t_1 = __Pyx_PyObject_AsString(__pyx_v_field); if (unlikely((!__pyx_t_1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 303; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
|
|
try {
|
|
__pyx_v_self->thisptr.set(__pyx_t_1, (( ::capnp::DynamicValue::Reader &)__pyx_v_temp));
|
|
} catch(...) {
|
|
try { throw; } catch(const std::exception& exn) { PyErr_SetString(__pyx_builtin_ValueError, exn.what()); } catch(...) { PyErr_SetNone(__pyx_builtin_ValueError); }
|
|
{__pyx_filename = __pyx_f[0]; __pyx_lineno = 303; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
|
|
}
|
|
|
|
__pyx_r = Py_None; __Pyx_INCREF(Py_None);
|
|
goto __pyx_L0;
|
|
__pyx_L1_error:;
|
|
__Pyx_AddTraceback("capnp._DynamicStructBuilder._setattrVoid", __pyx_clineno, __pyx_lineno, __pyx_filename);
|
|
__pyx_r = 0;
|
|
__pyx_L0:;
|
|
__Pyx_XGIVEREF(__pyx_r);
|
|
__Pyx_RefNannyFinishContext();
|
|
return __pyx_r;
|
|
}
|
|
|
|
/* Python wrapper */
|
|
static int __pyx_pw_5capnp_21_DynamicStructBuilder_3__setattr__(PyObject *__pyx_v_self, PyObject *__pyx_v_field, PyObject *__pyx_v_value); /*proto*/
|
|
static int __pyx_pw_5capnp_21_DynamicStructBuilder_3__setattr__(PyObject *__pyx_v_self, PyObject *__pyx_v_field, PyObject *__pyx_v_value) {
|
|
int __pyx_r;
|
|
__Pyx_RefNannyDeclarations
|
|
__Pyx_RefNannySetupContext("__setattr__ (wrapper)", 0);
|
|
__pyx_r = __pyx_pf_5capnp_21_DynamicStructBuilder_2__setattr__(((struct __pyx_obj_5capnp__DynamicStructBuilder *)__pyx_v_self), ((PyObject *)__pyx_v_field), ((PyObject *)__pyx_v_value));
|
|
__Pyx_RefNannyFinishContext();
|
|
return __pyx_r;
|
|
}
|
|
|
|
/* "capnp.pyx":305
|
|
* self.thisptr.set(field, temp)
|
|
*
|
|
* def __setattr__(self, field, value): # <<<<<<<<<<<<<<
|
|
* value_type = type(value)
|
|
* if value_type is int:
|
|
*/
|
|
|
|
static int __pyx_pf_5capnp_21_DynamicStructBuilder_2__setattr__(struct __pyx_obj_5capnp__DynamicStructBuilder *__pyx_v_self, PyObject *__pyx_v_field, PyObject *__pyx_v_value) {
|
|
PyObject *__pyx_v_value_type = NULL;
|
|
int __pyx_r;
|
|
__Pyx_RefNannyDeclarations
|
|
int __pyx_t_1;
|
|
int __pyx_t_2;
|
|
PyObject *__pyx_t_3 = NULL;
|
|
int __pyx_lineno = 0;
|
|
const char *__pyx_filename = NULL;
|
|
int __pyx_clineno = 0;
|
|
__Pyx_RefNannySetupContext("__setattr__", 0);
|
|
|
|
/* "capnp.pyx":306
|
|
*
|
|
* def __setattr__(self, field, value):
|
|
* value_type = type(value) # <<<<<<<<<<<<<<
|
|
* if value_type is int:
|
|
* self._setattrInt(field, value)
|
|
*/
|
|
__Pyx_INCREF(((PyObject *)Py_TYPE(__pyx_v_value)));
|
|
__pyx_v_value_type = ((PyObject*)((PyObject *)Py_TYPE(__pyx_v_value)));
|
|
|
|
/* "capnp.pyx":307
|
|
* def __setattr__(self, field, value):
|
|
* value_type = type(value)
|
|
* if value_type is int: # <<<<<<<<<<<<<<
|
|
* self._setattrInt(field, value)
|
|
* elif value_type is float:
|
|
*/
|
|
__pyx_t_1 = (__pyx_v_value_type == ((PyObject*)(&PyInt_Type)));
|
|
__pyx_t_2 = (__pyx_t_1 != 0);
|
|
if (__pyx_t_2) {
|
|
|
|
/* "capnp.pyx":308
|
|
* value_type = type(value)
|
|
* if value_type is int:
|
|
* self._setattrInt(field, value) # <<<<<<<<<<<<<<
|
|
* elif value_type is float:
|
|
* self._setattrDouble(field, value)
|
|
*/
|
|
__pyx_t_3 = ((struct __pyx_vtabstruct_5capnp__DynamicStructBuilder *)__pyx_v_self->__pyx_vtab)->_setattrInt(__pyx_v_self, __pyx_v_field, __pyx_v_value); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 308; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
|
|
__Pyx_GOTREF(__pyx_t_3);
|
|
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
|
|
goto __pyx_L3;
|
|
}
|
|
|
|
/* "capnp.pyx":309
|
|
* if value_type is int:
|
|
* self._setattrInt(field, value)
|
|
* elif value_type is float: # <<<<<<<<<<<<<<
|
|
* self._setattrDouble(field, value)
|
|
* elif value_type is bool:
|
|
*/
|
|
__pyx_t_2 = (__pyx_v_value_type == ((PyObject*)(&PyFloat_Type)));
|
|
__pyx_t_1 = (__pyx_t_2 != 0);
|
|
if (__pyx_t_1) {
|
|
|
|
/* "capnp.pyx":310
|
|
* self._setattrInt(field, value)
|
|
* elif value_type is float:
|
|
* self._setattrDouble(field, value) # <<<<<<<<<<<<<<
|
|
* elif value_type is bool:
|
|
* self._setattrBool(field, value)
|
|
*/
|
|
__pyx_t_3 = ((struct __pyx_vtabstruct_5capnp__DynamicStructBuilder *)__pyx_v_self->__pyx_vtab)->_setattrDouble(__pyx_v_self, __pyx_v_field, __pyx_v_value); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 310; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
|
|
__Pyx_GOTREF(__pyx_t_3);
|
|
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
|
|
goto __pyx_L3;
|
|
}
|
|
|
|
/* "capnp.pyx":311
|
|
* elif value_type is float:
|
|
* self._setattrDouble(field, value)
|
|
* elif value_type is bool: # <<<<<<<<<<<<<<
|
|
* self._setattrBool(field, value)
|
|
* elif value_type is bytes:
|
|
*/
|
|
__pyx_t_1 = (__pyx_v_value_type == ((PyObject*)((PyObject*)&PyBool_Type)));
|
|
__pyx_t_2 = (__pyx_t_1 != 0);
|
|
if (__pyx_t_2) {
|
|
|
|
/* "capnp.pyx":312
|
|
* self._setattrDouble(field, value)
|
|
* elif value_type is bool:
|
|
* self._setattrBool(field, value) # <<<<<<<<<<<<<<
|
|
* elif value_type is bytes:
|
|
* self._setattrString(field, value)
|
|
*/
|
|
__pyx_t_3 = ((struct __pyx_vtabstruct_5capnp__DynamicStructBuilder *)__pyx_v_self->__pyx_vtab)->_setattrBool(__pyx_v_self, __pyx_v_field, __pyx_v_value); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 312; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
|
|
__Pyx_GOTREF(__pyx_t_3);
|
|
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
|
|
goto __pyx_L3;
|
|
}
|
|
|
|
/* "capnp.pyx":313
|
|
* elif value_type is bool:
|
|
* self._setattrBool(field, value)
|
|
* elif value_type is bytes: # <<<<<<<<<<<<<<
|
|
* self._setattrString(field, value)
|
|
* elif value is None:
|
|
*/
|
|
__pyx_t_2 = (__pyx_v_value_type == ((PyObject*)(&PyBytes_Type)));
|
|
__pyx_t_1 = (__pyx_t_2 != 0);
|
|
if (__pyx_t_1) {
|
|
|
|
/* "capnp.pyx":314
|
|
* self._setattrBool(field, value)
|
|
* elif value_type is bytes:
|
|
* self._setattrString(field, value) # <<<<<<<<<<<<<<
|
|
* elif value is None:
|
|
* self._setattrVoid(field)
|
|
*/
|
|
__pyx_t_3 = ((struct __pyx_vtabstruct_5capnp__DynamicStructBuilder *)__pyx_v_self->__pyx_vtab)->_setattrString(__pyx_v_self, __pyx_v_field, __pyx_v_value); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 314; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
|
|
__Pyx_GOTREF(__pyx_t_3);
|
|
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
|
|
goto __pyx_L3;
|
|
}
|
|
|
|
/* "capnp.pyx":315
|
|
* elif value_type is bytes:
|
|
* self._setattrString(field, value)
|
|
* elif value is None: # <<<<<<<<<<<<<<
|
|
* self._setattrVoid(field)
|
|
* else:
|
|
*/
|
|
__pyx_t_1 = (__pyx_v_value == Py_None);
|
|
__pyx_t_2 = (__pyx_t_1 != 0);
|
|
if (__pyx_t_2) {
|
|
|
|
/* "capnp.pyx":316
|
|
* self._setattrString(field, value)
|
|
* elif value is None:
|
|
* self._setattrVoid(field) # <<<<<<<<<<<<<<
|
|
* else:
|
|
* raise ValueError("Non primitive type")
|
|
*/
|
|
__pyx_t_3 = ((struct __pyx_vtabstruct_5capnp__DynamicStructBuilder *)__pyx_v_self->__pyx_vtab)->_setattrVoid(__pyx_v_self, __pyx_v_field); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 316; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
|
|
__Pyx_GOTREF(__pyx_t_3);
|
|
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
|
|
goto __pyx_L3;
|
|
}
|
|
/*else*/ {
|
|
|
|
/* "capnp.pyx":318
|
|
* self._setattrVoid(field)
|
|
* else:
|
|
* raise ValueError("Non primitive type") # <<<<<<<<<<<<<<
|
|
*
|
|
* def _has(self, field):
|
|
*/
|
|
__pyx_t_3 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_k_tuple_29), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 318; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
|
|
__Pyx_GOTREF(__pyx_t_3);
|
|
__Pyx_Raise(__pyx_t_3, 0, 0, 0);
|
|
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
|
|
{__pyx_filename = __pyx_f[0]; __pyx_lineno = 318; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
|
|
}
|
|
__pyx_L3:;
|
|
|
|
__pyx_r = 0;
|
|
goto __pyx_L0;
|
|
__pyx_L1_error:;
|
|
__Pyx_XDECREF(__pyx_t_3);
|
|
__Pyx_AddTraceback("capnp._DynamicStructBuilder.__setattr__", __pyx_clineno, __pyx_lineno, __pyx_filename);
|
|
__pyx_r = -1;
|
|
__pyx_L0:;
|
|
__Pyx_XDECREF(__pyx_v_value_type);
|
|
__Pyx_RefNannyFinishContext();
|
|
return __pyx_r;
|
|
}
|
|
|
|
/* Python wrapper */
|
|
static PyObject *__pyx_pw_5capnp_21_DynamicStructBuilder_5_has(PyObject *__pyx_v_self, PyObject *__pyx_v_field); /*proto*/
|
|
static PyObject *__pyx_pw_5capnp_21_DynamicStructBuilder_5_has(PyObject *__pyx_v_self, PyObject *__pyx_v_field) {
|
|
PyObject *__pyx_r = 0;
|
|
__Pyx_RefNannyDeclarations
|
|
__Pyx_RefNannySetupContext("_has (wrapper)", 0);
|
|
__pyx_r = __pyx_pf_5capnp_21_DynamicStructBuilder_4_has(((struct __pyx_obj_5capnp__DynamicStructBuilder *)__pyx_v_self), ((PyObject *)__pyx_v_field));
|
|
__Pyx_RefNannyFinishContext();
|
|
return __pyx_r;
|
|
}
|
|
|
|
/* "capnp.pyx":320
|
|
* raise ValueError("Non primitive type")
|
|
*
|
|
* def _has(self, field): # <<<<<<<<<<<<<<
|
|
* return self.thisptr.has(field)
|
|
*
|
|
*/
|
|
|
|
static PyObject *__pyx_pf_5capnp_21_DynamicStructBuilder_4_has(struct __pyx_obj_5capnp__DynamicStructBuilder *__pyx_v_self, PyObject *__pyx_v_field) {
|
|
PyObject *__pyx_r = NULL;
|
|
__Pyx_RefNannyDeclarations
|
|
char *__pyx_t_1;
|
|
int __pyx_t_2;
|
|
PyObject *__pyx_t_3 = NULL;
|
|
int __pyx_lineno = 0;
|
|
const char *__pyx_filename = NULL;
|
|
int __pyx_clineno = 0;
|
|
__Pyx_RefNannySetupContext("_has", 0);
|
|
|
|
/* "capnp.pyx":321
|
|
*
|
|
* def _has(self, field):
|
|
* return self.thisptr.has(field) # <<<<<<<<<<<<<<
|
|
*
|
|
* cpdef init(self, field, size=None) except +ValueError:
|
|
*/
|
|
__Pyx_XDECREF(__pyx_r);
|
|
__pyx_t_1 = __Pyx_PyObject_AsString(__pyx_v_field); if (unlikely((!__pyx_t_1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 321; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
|
|
try {
|
|
__pyx_t_2 = __pyx_v_self->thisptr.has(__pyx_t_1);
|
|
} catch(...) {
|
|
try { throw; } catch(const std::exception& exn) { PyErr_SetString(__pyx_builtin_ValueError, exn.what()); } catch(...) { PyErr_SetNone(__pyx_builtin_ValueError); }
|
|
{__pyx_filename = __pyx_f[0]; __pyx_lineno = 321; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
|
|
}
|
|
__pyx_t_3 = __Pyx_PyBool_FromLong(__pyx_t_2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 321; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
|
|
__Pyx_GOTREF(__pyx_t_3);
|
|
__pyx_r = __pyx_t_3;
|
|
__pyx_t_3 = 0;
|
|
goto __pyx_L0;
|
|
|
|
__pyx_r = Py_None; __Pyx_INCREF(Py_None);
|
|
goto __pyx_L0;
|
|
__pyx_L1_error:;
|
|
__Pyx_XDECREF(__pyx_t_3);
|
|
__Pyx_AddTraceback("capnp._DynamicStructBuilder._has", __pyx_clineno, __pyx_lineno, __pyx_filename);
|
|
__pyx_r = NULL;
|
|
__pyx_L0:;
|
|
__Pyx_XGIVEREF(__pyx_r);
|
|
__Pyx_RefNannyFinishContext();
|
|
return __pyx_r;
|
|
}
|
|
|
|
/* "capnp.pyx":323
|
|
* return self.thisptr.has(field)
|
|
*
|
|
* cpdef init(self, field, size=None) except +ValueError: # <<<<<<<<<<<<<<
|
|
* if size is None:
|
|
* return toPythonByValue(self.thisptr.init(field))
|
|
*/
|
|
|
|
static PyObject *__pyx_pw_5capnp_21_DynamicStructBuilder_7init(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
|
|
static PyObject *__pyx_f_5capnp_21_DynamicStructBuilder_init(struct __pyx_obj_5capnp__DynamicStructBuilder *__pyx_v_self, PyObject *__pyx_v_field, int __pyx_skip_dispatch, struct __pyx_opt_args_5capnp_21_DynamicStructBuilder_init *__pyx_optional_args) {
|
|
PyObject *__pyx_v_size = ((PyObject *)Py_None);
|
|
PyObject *__pyx_r = NULL;
|
|
__Pyx_RefNannyDeclarations
|
|
PyObject *__pyx_t_1 = NULL;
|
|
PyObject *__pyx_t_2 = NULL;
|
|
PyObject *__pyx_t_3 = NULL;
|
|
int __pyx_t_4;
|
|
int __pyx_t_5;
|
|
char *__pyx_t_6;
|
|
__pyx_t_9capnp_cpp_uint __pyx_t_7;
|
|
int __pyx_lineno = 0;
|
|
const char *__pyx_filename = NULL;
|
|
int __pyx_clineno = 0;
|
|
__Pyx_RefNannySetupContext("init", 0);
|
|
if (__pyx_optional_args) {
|
|
if (__pyx_optional_args->__pyx_n > 0) {
|
|
__pyx_v_size = __pyx_optional_args->size;
|
|
}
|
|
}
|
|
/* Check if called by wrapper */
|
|
if (unlikely(__pyx_skip_dispatch)) ;
|
|
/* Check if overridden in Python */
|
|
else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
|
|
__pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s__init); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
|
|
__Pyx_GOTREF(__pyx_t_1);
|
|
if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_5capnp_21_DynamicStructBuilder_7init)) {
|
|
__Pyx_XDECREF(__pyx_r);
|
|
__pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
|
|
__Pyx_GOTREF(__pyx_t_2);
|
|
__Pyx_INCREF(__pyx_v_field);
|
|
PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_field);
|
|
__Pyx_GIVEREF(__pyx_v_field);
|
|
__Pyx_INCREF(__pyx_v_size);
|
|
PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_v_size);
|
|
__Pyx_GIVEREF(__pyx_v_size);
|
|
__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 = 323; __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;
|
|
__pyx_t_3 = 0;
|
|
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
|
|
goto __pyx_L0;
|
|
}
|
|
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
|
|
}
|
|
|
|
/* "capnp.pyx":324
|
|
*
|
|
* cpdef init(self, field, size=None) except +ValueError:
|
|
* if size is None: # <<<<<<<<<<<<<<
|
|
* return toPythonByValue(self.thisptr.init(field))
|
|
* else:
|
|
*/
|
|
__pyx_t_4 = (__pyx_v_size == Py_None);
|
|
__pyx_t_5 = (__pyx_t_4 != 0);
|
|
if (__pyx_t_5) {
|
|
|
|
/* "capnp.pyx":325
|
|
* cpdef init(self, field, size=None) except +ValueError:
|
|
* if size is None:
|
|
* return toPythonByValue(self.thisptr.init(field)) # <<<<<<<<<<<<<<
|
|
* else:
|
|
* return toPythonByValue(self.thisptr.init(field, size))
|
|
*/
|
|
__Pyx_XDECREF(__pyx_r);
|
|
__pyx_t_6 = __Pyx_PyObject_AsString(__pyx_v_field); if (unlikely((!__pyx_t_6) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 325; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
|
|
__pyx_t_1 = __pyx_f_5capnp_toPythonByValue((( ::capnp::DynamicValue::Builder)__pyx_v_self->thisptr.init(__pyx_t_6))); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 325; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
|
|
__Pyx_GOTREF(__pyx_t_1);
|
|
__pyx_r = __pyx_t_1;
|
|
__pyx_t_1 = 0;
|
|
goto __pyx_L0;
|
|
goto __pyx_L3;
|
|
}
|
|
/*else*/ {
|
|
|
|
/* "capnp.pyx":327
|
|
* return toPythonByValue(self.thisptr.init(field))
|
|
* else:
|
|
* return toPythonByValue(self.thisptr.init(field, size)) # <<<<<<<<<<<<<<
|
|
*
|
|
* cdef class _DynamicUnionReader:
|
|
*/
|
|
__Pyx_XDECREF(__pyx_r);
|
|
__pyx_t_6 = __Pyx_PyObject_AsString(__pyx_v_field); if (unlikely((!__pyx_t_6) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 327; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
|
|
__pyx_t_7 = __Pyx_PyInt_AsUnsignedInt(__pyx_v_size); if (unlikely((__pyx_t_7 == (unsigned int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 327; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
|
|
__pyx_t_1 = __pyx_f_5capnp_toPythonByValue((( ::capnp::DynamicValue::Builder)__pyx_v_self->thisptr.init(__pyx_t_6, __pyx_t_7))); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 327; __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_L3:;
|
|
|
|
__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("capnp._DynamicStructBuilder.init", __pyx_clineno, __pyx_lineno, __pyx_filename);
|
|
__pyx_r = 0;
|
|
__pyx_L0:;
|
|
__Pyx_XGIVEREF(__pyx_r);
|
|
__Pyx_RefNannyFinishContext();
|
|
return __pyx_r;
|
|
}
|
|
|
|
/* Python wrapper */
|
|
static PyObject *__pyx_pw_5capnp_21_DynamicStructBuilder_7init(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
|
|
static PyObject *__pyx_pw_5capnp_21_DynamicStructBuilder_7init(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
|
|
PyObject *__pyx_v_field = 0;
|
|
PyObject *__pyx_v_size = 0;
|
|
int __pyx_lineno = 0;
|
|
const char *__pyx_filename = NULL;
|
|
int __pyx_clineno = 0;
|
|
PyObject *__pyx_r = 0;
|
|
__Pyx_RefNannyDeclarations
|
|
__Pyx_RefNannySetupContext("init (wrapper)", 0);
|
|
{
|
|
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__field,&__pyx_n_s__size,0};
|
|
PyObject* values[2] = {0,0};
|
|
|
|
/* "capnp.pyx":323
|
|
* return self.thisptr.has(field)
|
|
*
|
|
* cpdef init(self, field, size=None) except +ValueError: # <<<<<<<<<<<<<<
|
|
* if size is None:
|
|
* return toPythonByValue(self.thisptr.init(field))
|
|
*/
|
|
values[1] = ((PyObject *)Py_None);
|
|
if (unlikely(__pyx_kwds)) {
|
|
Py_ssize_t kw_args;
|
|
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
|
|
switch (pos_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;
|
|
}
|
|
kw_args = PyDict_Size(__pyx_kwds);
|
|
switch (pos_args) {
|
|
case 0:
|
|
if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__field)) != 0)) kw_args--;
|
|
else goto __pyx_L5_argtuple_error;
|
|
case 1:
|
|
if (kw_args > 0) {
|
|
PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__size);
|
|
if (value) { values[1] = value; kw_args--; }
|
|
}
|
|
}
|
|
if (unlikely(kw_args > 0)) {
|
|
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "init") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
|
|
}
|
|
} else {
|
|
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);
|
|
break;
|
|
default: goto __pyx_L5_argtuple_error;
|
|
}
|
|
}
|
|
__pyx_v_field = values[0];
|
|
__pyx_v_size = values[1];
|
|
}
|
|
goto __pyx_L4_argument_unpacking_done;
|
|
__pyx_L5_argtuple_error:;
|
|
__Pyx_RaiseArgtupleInvalid("init", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
|
|
__pyx_L3_error:;
|
|
__Pyx_AddTraceback("capnp._DynamicStructBuilder.init", __pyx_clineno, __pyx_lineno, __pyx_filename);
|
|
__Pyx_RefNannyFinishContext();
|
|
return NULL;
|
|
__pyx_L4_argument_unpacking_done:;
|
|
__pyx_r = __pyx_pf_5capnp_21_DynamicStructBuilder_6init(((struct __pyx_obj_5capnp__DynamicStructBuilder *)__pyx_v_self), __pyx_v_field, __pyx_v_size);
|
|
__Pyx_RefNannyFinishContext();
|
|
return __pyx_r;
|
|
}
|
|
|
|
static PyObject *__pyx_pf_5capnp_21_DynamicStructBuilder_6init(struct __pyx_obj_5capnp__DynamicStructBuilder *__pyx_v_self, PyObject *__pyx_v_field, PyObject *__pyx_v_size) {
|
|
PyObject *__pyx_r = NULL;
|
|
__Pyx_RefNannyDeclarations
|
|
PyObject *__pyx_t_1 = NULL;
|
|
struct __pyx_opt_args_5capnp_21_DynamicStructBuilder_init __pyx_t_2;
|
|
int __pyx_lineno = 0;
|
|
const char *__pyx_filename = NULL;
|
|
int __pyx_clineno = 0;
|
|
__Pyx_RefNannySetupContext("init", 0);
|
|
__Pyx_XDECREF(__pyx_r);
|
|
__pyx_t_2.__pyx_n = 1;
|
|
__pyx_t_2.size = __pyx_v_size;
|
|
try {
|
|
__pyx_t_1 = ((struct __pyx_vtabstruct_5capnp__DynamicStructBuilder *)__pyx_v_self->__pyx_vtab)->init(__pyx_v_self, __pyx_v_field, 1, &__pyx_t_2);
|
|
} catch(...) {
|
|
try { throw; } catch(const std::exception& exn) { PyErr_SetString(__pyx_builtin_ValueError, exn.what()); } catch(...) { PyErr_SetNone(__pyx_builtin_ValueError); }
|
|
{__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __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("capnp._DynamicStructBuilder.init", __pyx_clineno, __pyx_lineno, __pyx_filename);
|
|
__pyx_r = NULL;
|
|
__pyx_L0:;
|
|
__Pyx_XGIVEREF(__pyx_r);
|
|
__Pyx_RefNannyFinishContext();
|
|
return __pyx_r;
|
|
}
|
|
|
|
/* "capnp.pyx":331
|
|
* cdef class _DynamicUnionReader:
|
|
* cdef C_DynamicUnion.Reader thisptr
|
|
* cdef _init(self, C_DynamicUnion.Reader other): # <<<<<<<<<<<<<<
|
|
* self.thisptr = other
|
|
* return self
|
|
*/
|
|
|
|
static PyObject *__pyx_f_5capnp_19_DynamicUnionReader__init(struct __pyx_obj_5capnp__DynamicUnionReader *__pyx_v_self, ::capnp::DynamicUnion::Reader __pyx_v_other) {
|
|
PyObject *__pyx_r = NULL;
|
|
__Pyx_RefNannyDeclarations
|
|
__Pyx_RefNannySetupContext("_init", 0);
|
|
|
|
/* "capnp.pyx":332
|
|
* cdef C_DynamicUnion.Reader thisptr
|
|
* cdef _init(self, C_DynamicUnion.Reader other):
|
|
* self.thisptr = other # <<<<<<<<<<<<<<
|
|
* return self
|
|
*
|
|
*/
|
|
__pyx_v_self->thisptr = __pyx_v_other;
|
|
|
|
/* "capnp.pyx":333
|
|
* cdef _init(self, C_DynamicUnion.Reader other):
|
|
* self.thisptr = other
|
|
* return self # <<<<<<<<<<<<<<
|
|
*
|
|
* cpdef _get(self):
|
|
*/
|
|
__Pyx_XDECREF(__pyx_r);
|
|
__Pyx_INCREF(((PyObject *)__pyx_v_self));
|
|
__pyx_r = ((PyObject *)__pyx_v_self);
|
|
goto __pyx_L0;
|
|
|
|
__pyx_r = Py_None; __Pyx_INCREF(Py_None);
|
|
__pyx_L0:;
|
|
__Pyx_XGIVEREF(__pyx_r);
|
|
__Pyx_RefNannyFinishContext();
|
|
return __pyx_r;
|
|
}
|
|
|
|
/* "capnp.pyx":335
|
|
* return self
|
|
*
|
|
* cpdef _get(self): # <<<<<<<<<<<<<<
|
|
* return _DynamicValueReader()._init(self.thisptr.get())
|
|
*
|
|
*/
|
|
|
|
static PyObject *__pyx_pw_5capnp_19_DynamicUnionReader_1_get(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
|
|
static PyObject *__pyx_f_5capnp_19_DynamicUnionReader__get(struct __pyx_obj_5capnp__DynamicUnionReader *__pyx_v_self, int __pyx_skip_dispatch) {
|
|
PyObject *__pyx_r = NULL;
|
|
__Pyx_RefNannyDeclarations
|
|
PyObject *__pyx_t_1 = NULL;
|
|
PyObject *__pyx_t_2 = NULL;
|
|
::capnp::DynamicValue::Reader __pyx_t_3;
|
|
int __pyx_lineno = 0;
|
|
const char *__pyx_filename = NULL;
|
|
int __pyx_clineno = 0;
|
|
__Pyx_RefNannySetupContext("_get", 0);
|
|
/* Check if called by wrapper */
|
|
if (unlikely(__pyx_skip_dispatch)) ;
|
|
/* Check if overridden in Python */
|
|
else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
|
|
__pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s___get); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 335; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
|
|
__Pyx_GOTREF(__pyx_t_1);
|
|
if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_5capnp_19_DynamicUnionReader_1_get)) {
|
|
__Pyx_XDECREF(__pyx_r);
|
|
__pyx_t_2 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 335; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
|
|
__Pyx_GOTREF(__pyx_t_2);
|
|
__pyx_r = __pyx_t_2;
|
|
__pyx_t_2 = 0;
|
|
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
|
|
goto __pyx_L0;
|
|
}
|
|
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
|
|
}
|
|
|
|
/* "capnp.pyx":336
|
|
*
|
|
* cpdef _get(self):
|
|
* return _DynamicValueReader()._init(self.thisptr.get()) # <<<<<<<<<<<<<<
|
|
*
|
|
* def __getattr__(self, field):
|
|
*/
|
|
__Pyx_XDECREF(__pyx_r);
|
|
__pyx_t_1 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_5capnp__DynamicValueReader)), ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 336; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
|
|
__Pyx_GOTREF(__pyx_t_1);
|
|
try {
|
|
__pyx_t_3 = __pyx_v_self->thisptr.get();
|
|
} catch(...) {
|
|
try { throw; } catch(const std::exception& exn) { PyErr_SetString(__pyx_builtin_ValueError, exn.what()); } catch(...) { PyErr_SetNone(__pyx_builtin_ValueError); }
|
|
{__pyx_filename = __pyx_f[0]; __pyx_lineno = 336; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
|
|
}
|
|
__pyx_t_2 = ((struct __pyx_vtabstruct_5capnp__DynamicValueReader *)((struct __pyx_obj_5capnp__DynamicValueReader *)__pyx_t_1)->__pyx_vtab)->_init(((struct __pyx_obj_5capnp__DynamicValueReader *)__pyx_t_1), (( ::capnp::DynamicValue::Reader)__pyx_t_3)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 336; __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;
|
|
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("capnp._DynamicUnionReader._get", __pyx_clineno, __pyx_lineno, __pyx_filename);
|
|
__pyx_r = 0;
|
|
__pyx_L0:;
|
|
__Pyx_XGIVEREF(__pyx_r);
|
|
__Pyx_RefNannyFinishContext();
|
|
return __pyx_r;
|
|
}
|
|
|
|
/* Python wrapper */
|
|
static PyObject *__pyx_pw_5capnp_19_DynamicUnionReader_1_get(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
|
|
static PyObject *__pyx_pw_5capnp_19_DynamicUnionReader_1_get(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
|
|
PyObject *__pyx_r = 0;
|
|
__Pyx_RefNannyDeclarations
|
|
__Pyx_RefNannySetupContext("_get (wrapper)", 0);
|
|
__pyx_r = __pyx_pf_5capnp_19_DynamicUnionReader__get(((struct __pyx_obj_5capnp__DynamicUnionReader *)__pyx_v_self));
|
|
__Pyx_RefNannyFinishContext();
|
|
return __pyx_r;
|
|
}
|
|
|
|
/* "capnp.pyx":335
|
|
* return self
|
|
*
|
|
* cpdef _get(self): # <<<<<<<<<<<<<<
|
|
* return _DynamicValueReader()._init(self.thisptr.get())
|
|
*
|
|
*/
|
|
|
|
static PyObject *__pyx_pf_5capnp_19_DynamicUnionReader__get(struct __pyx_obj_5capnp__DynamicUnionReader *__pyx_v_self) {
|
|
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("_get", 0);
|
|
__Pyx_XDECREF(__pyx_r);
|
|
__pyx_t_1 = ((struct __pyx_vtabstruct_5capnp__DynamicUnionReader *)__pyx_v_self->__pyx_vtab)->_get(__pyx_v_self, 1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 335; __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("capnp._DynamicUnionReader._get", __pyx_clineno, __pyx_lineno, __pyx_filename);
|
|
__pyx_r = NULL;
|
|
__pyx_L0:;
|
|
__Pyx_XGIVEREF(__pyx_r);
|
|
__Pyx_RefNannyFinishContext();
|
|
return __pyx_r;
|
|
}
|
|
|
|
/* Python wrapper */
|
|
static PyObject *__pyx_pw_5capnp_19_DynamicUnionReader_3__getattr__(PyObject *__pyx_v_self, PyObject *__pyx_v_field); /*proto*/
|
|
static PyObject *__pyx_pw_5capnp_19_DynamicUnionReader_3__getattr__(PyObject *__pyx_v_self, PyObject *__pyx_v_field) {
|
|
PyObject *__pyx_r = 0;
|
|
__Pyx_RefNannyDeclarations
|
|
__Pyx_RefNannySetupContext("__getattr__ (wrapper)", 0);
|
|
__pyx_r = __pyx_pf_5capnp_19_DynamicUnionReader_2__getattr__(((struct __pyx_obj_5capnp__DynamicUnionReader *)__pyx_v_self), ((PyObject *)__pyx_v_field));
|
|
__Pyx_RefNannyFinishContext();
|
|
return __pyx_r;
|
|
}
|
|
|
|
/* "capnp.pyx":338
|
|
* return _DynamicValueReader()._init(self.thisptr.get())
|
|
*
|
|
* def __getattr__(self, field): # <<<<<<<<<<<<<<
|
|
* return self._get().toPython() # TODO: check that the field is right?
|
|
*
|
|
*/
|
|
|
|
static PyObject *__pyx_pf_5capnp_19_DynamicUnionReader_2__getattr__(struct __pyx_obj_5capnp__DynamicUnionReader *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_field) {
|
|
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("__getattr__", 0);
|
|
|
|
/* "capnp.pyx":339
|
|
*
|
|
* def __getattr__(self, field):
|
|
* return self._get().toPython() # TODO: check that the field is right? # <<<<<<<<<<<<<<
|
|
*
|
|
* cpdef which(self):
|
|
*/
|
|
__Pyx_XDECREF(__pyx_r);
|
|
__pyx_t_1 = ((struct __pyx_vtabstruct_5capnp__DynamicUnionReader *)__pyx_v_self->__pyx_vtab)->_get(__pyx_v_self, 0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 339; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
|
|
__Pyx_GOTREF(__pyx_t_1);
|
|
__pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s__toPython); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 339; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
|
|
__Pyx_GOTREF(__pyx_t_2);
|
|
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
|
|
__pyx_t_1 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 339; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
|
|
__Pyx_GOTREF(__pyx_t_1);
|
|
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
|
|
__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("capnp._DynamicUnionReader.__getattr__", __pyx_clineno, __pyx_lineno, __pyx_filename);
|
|
__pyx_r = NULL;
|
|
__pyx_L0:;
|
|
__Pyx_XGIVEREF(__pyx_r);
|
|
__Pyx_RefNannyFinishContext();
|
|
return __pyx_r;
|
|
}
|
|
|
|
/* "capnp.pyx":341
|
|
* return self._get().toPython() # TODO: check that the field is right?
|
|
*
|
|
* cpdef which(self): # <<<<<<<<<<<<<<
|
|
* return fixMaybe(self.thisptr.which()).getProto().getName().cStr()
|
|
*
|
|
*/
|
|
|
|
static PyObject *__pyx_pw_5capnp_19_DynamicUnionReader_5which(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
|
|
static PyObject *__pyx_f_5capnp_19_DynamicUnionReader_which(struct __pyx_obj_5capnp__DynamicUnionReader *__pyx_v_self, int __pyx_skip_dispatch) {
|
|
PyObject *__pyx_r = NULL;
|
|
__Pyx_RefNannyDeclarations
|
|
PyObject *__pyx_t_1 = NULL;
|
|
PyObject *__pyx_t_2 = NULL;
|
|
::capnp::StructSchema::Member __pyx_t_3;
|
|
int __pyx_lineno = 0;
|
|
const char *__pyx_filename = NULL;
|
|
int __pyx_clineno = 0;
|
|
__Pyx_RefNannySetupContext("which", 0);
|
|
/* Check if called by wrapper */
|
|
if (unlikely(__pyx_skip_dispatch)) ;
|
|
/* Check if overridden in Python */
|
|
else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
|
|
__pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s__which); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 341; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
|
|
__Pyx_GOTREF(__pyx_t_1);
|
|
if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_5capnp_19_DynamicUnionReader_5which)) {
|
|
__Pyx_XDECREF(__pyx_r);
|
|
__pyx_t_2 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 341; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
|
|
__Pyx_GOTREF(__pyx_t_2);
|
|
__pyx_r = __pyx_t_2;
|
|
__pyx_t_2 = 0;
|
|
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
|
|
goto __pyx_L0;
|
|
}
|
|
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
|
|
}
|
|
|
|
/* "capnp.pyx":342
|
|
*
|
|
* cpdef which(self):
|
|
* return fixMaybe(self.thisptr.which()).getProto().getName().cStr() # <<<<<<<<<<<<<<
|
|
*
|
|
* cdef class _DynamicUnionBuilder:
|
|
*/
|
|
__Pyx_XDECREF(__pyx_r);
|
|
try {
|
|
__pyx_t_3 = fixMaybe(__pyx_v_self->thisptr.which());
|
|
} catch(...) {
|
|
__Pyx_CppExn2PyErr();
|
|
{__pyx_filename = __pyx_f[0]; __pyx_lineno = 342; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
|
|
}
|
|
__pyx_t_1 = __Pyx_PyBytes_FromString(__pyx_t_3.getProto().getName().cStr()); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 342; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
|
|
__Pyx_GOTREF(((PyObject *)__pyx_t_1));
|
|
__pyx_r = ((PyObject *)__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("capnp._DynamicUnionReader.which", __pyx_clineno, __pyx_lineno, __pyx_filename);
|
|
__pyx_r = 0;
|
|
__pyx_L0:;
|
|
__Pyx_XGIVEREF(__pyx_r);
|
|
__Pyx_RefNannyFinishContext();
|
|
return __pyx_r;
|
|
}
|
|
|
|
/* Python wrapper */
|
|
static PyObject *__pyx_pw_5capnp_19_DynamicUnionReader_5which(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
|
|
static PyObject *__pyx_pw_5capnp_19_DynamicUnionReader_5which(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
|
|
PyObject *__pyx_r = 0;
|
|
__Pyx_RefNannyDeclarations
|
|
__Pyx_RefNannySetupContext("which (wrapper)", 0);
|
|
__pyx_r = __pyx_pf_5capnp_19_DynamicUnionReader_4which(((struct __pyx_obj_5capnp__DynamicUnionReader *)__pyx_v_self));
|
|
__Pyx_RefNannyFinishContext();
|
|
return __pyx_r;
|
|
}
|
|
|
|
/* "capnp.pyx":341
|
|
* return self._get().toPython() # TODO: check that the field is right?
|
|
*
|
|
* cpdef which(self): # <<<<<<<<<<<<<<
|
|
* return fixMaybe(self.thisptr.which()).getProto().getName().cStr()
|
|
*
|
|
*/
|
|
|
|
static PyObject *__pyx_pf_5capnp_19_DynamicUnionReader_4which(struct __pyx_obj_5capnp__DynamicUnionReader *__pyx_v_self) {
|
|
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("which", 0);
|
|
__Pyx_XDECREF(__pyx_r);
|
|
__pyx_t_1 = ((struct __pyx_vtabstruct_5capnp__DynamicUnionReader *)__pyx_v_self->__pyx_vtab)->which(__pyx_v_self, 1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 341; __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("capnp._DynamicUnionReader.which", __pyx_clineno, __pyx_lineno, __pyx_filename);
|
|
__pyx_r = NULL;
|
|
__pyx_L0:;
|
|
__Pyx_XGIVEREF(__pyx_r);
|
|
__Pyx_RefNannyFinishContext();
|
|
return __pyx_r;
|
|
}
|
|
|
|
/* "capnp.pyx":346
|
|
* cdef class _DynamicUnionBuilder:
|
|
* cdef C_DynamicUnion.Builder thisptr
|
|
* cdef _init(self, C_DynamicUnion.Builder other): # <<<<<<<<<<<<<<
|
|
* self.thisptr = other
|
|
* return self
|
|
*/
|
|
|
|
static PyObject *__pyx_f_5capnp_20_DynamicUnionBuilder__init(struct __pyx_obj_5capnp__DynamicUnionBuilder *__pyx_v_self, ::capnp::DynamicUnion::Builder __pyx_v_other) {
|
|
PyObject *__pyx_r = NULL;
|
|
__Pyx_RefNannyDeclarations
|
|
__Pyx_RefNannySetupContext("_init", 0);
|
|
|
|
/* "capnp.pyx":347
|
|
* cdef C_DynamicUnion.Builder thisptr
|
|
* cdef _init(self, C_DynamicUnion.Builder other):
|
|
* self.thisptr = other # <<<<<<<<<<<<<<
|
|
* return self
|
|
*
|
|
*/
|
|
__pyx_v_self->thisptr = __pyx_v_other;
|
|
|
|
/* "capnp.pyx":348
|
|
* cdef _init(self, C_DynamicUnion.Builder other):
|
|
* self.thisptr = other
|
|
* return self # <<<<<<<<<<<<<<
|
|
*
|
|
* def __getattr__(self, field):
|
|
*/
|
|
__Pyx_XDECREF(__pyx_r);
|
|
__Pyx_INCREF(((PyObject *)__pyx_v_self));
|
|
__pyx_r = ((PyObject *)__pyx_v_self);
|
|
goto __pyx_L0;
|
|
|
|
__pyx_r = Py_None; __Pyx_INCREF(Py_None);
|
|
__pyx_L0:;
|
|
__Pyx_XGIVEREF(__pyx_r);
|
|
__Pyx_RefNannyFinishContext();
|
|
return __pyx_r;
|
|
}
|
|
|
|
/* Python wrapper */
|
|
static PyObject *__pyx_pw_5capnp_20_DynamicUnionBuilder_1__getattr__(PyObject *__pyx_v_self, PyObject *__pyx_v_field); /*proto*/
|
|
static PyObject *__pyx_pw_5capnp_20_DynamicUnionBuilder_1__getattr__(PyObject *__pyx_v_self, PyObject *__pyx_v_field) {
|
|
PyObject *__pyx_r = 0;
|
|
__Pyx_RefNannyDeclarations
|
|
__Pyx_RefNannySetupContext("__getattr__ (wrapper)", 0);
|
|
__pyx_r = __pyx_pf_5capnp_20_DynamicUnionBuilder___getattr__(((struct __pyx_obj_5capnp__DynamicUnionBuilder *)__pyx_v_self), ((PyObject *)__pyx_v_field));
|
|
__Pyx_RefNannyFinishContext();
|
|
return __pyx_r;
|
|
}
|
|
|
|
/* "capnp.pyx":350
|
|
* return self
|
|
*
|
|
* def __getattr__(self, field): # <<<<<<<<<<<<<<
|
|
* return toPython(self.thisptr.get()) # TODO: check that the field is right?
|
|
*
|
|
*/
|
|
|
|
static PyObject *__pyx_pf_5capnp_20_DynamicUnionBuilder___getattr__(struct __pyx_obj_5capnp__DynamicUnionBuilder *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_field) {
|
|
PyObject *__pyx_r = NULL;
|
|
__Pyx_RefNannyDeclarations
|
|
::capnp::DynamicValue::Builder __pyx_t_1;
|
|
PyObject *__pyx_t_2 = NULL;
|
|
int __pyx_lineno = 0;
|
|
const char *__pyx_filename = NULL;
|
|
int __pyx_clineno = 0;
|
|
__Pyx_RefNannySetupContext("__getattr__", 0);
|
|
|
|
/* "capnp.pyx":351
|
|
*
|
|
* def __getattr__(self, field):
|
|
* return toPython(self.thisptr.get()) # TODO: check that the field is right? # <<<<<<<<<<<<<<
|
|
*
|
|
* cdef _setattrInt(self, field, value):
|
|
*/
|
|
__Pyx_XDECREF(__pyx_r);
|
|
try {
|
|
__pyx_t_1 = __pyx_v_self->thisptr.get();
|
|
} catch(...) {
|
|
try { throw; } catch(const std::exception& exn) { PyErr_SetString(__pyx_builtin_ValueError, exn.what()); } catch(...) { PyErr_SetNone(__pyx_builtin_ValueError); }
|
|
{__pyx_filename = __pyx_f[0]; __pyx_lineno = 351; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
|
|
}
|
|
__pyx_t_2 = __pyx_f_5capnp_toPython((( ::capnp::DynamicValue::Builder &)__pyx_t_1)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 351; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
|
|
__Pyx_GOTREF(__pyx_t_2);
|
|
__pyx_r = __pyx_t_2;
|
|
__pyx_t_2 = 0;
|
|
goto __pyx_L0;
|
|
|
|
__pyx_r = Py_None; __Pyx_INCREF(Py_None);
|
|
goto __pyx_L0;
|
|
__pyx_L1_error:;
|
|
__Pyx_XDECREF(__pyx_t_2);
|
|
__Pyx_AddTraceback("capnp._DynamicUnionBuilder.__getattr__", __pyx_clineno, __pyx_lineno, __pyx_filename);
|
|
__pyx_r = NULL;
|
|
__pyx_L0:;
|
|
__Pyx_XGIVEREF(__pyx_r);
|
|
__Pyx_RefNannyFinishContext();
|
|
return __pyx_r;
|
|
}
|
|
|
|
/* "capnp.pyx":353
|
|
* return toPython(self.thisptr.get()) # TODO: check that the field is right?
|
|
*
|
|
* cdef _setattrInt(self, field, value): # <<<<<<<<<<<<<<
|
|
* cdef C_DynamicValue.Reader temp = C_DynamicValue.Reader(<long long>value)
|
|
* self.thisptr.set(field, temp)
|
|
*/
|
|
|
|
static PyObject *__pyx_f_5capnp_20_DynamicUnionBuilder__setattrInt(struct __pyx_obj_5capnp__DynamicUnionBuilder *__pyx_v_self, PyObject *__pyx_v_field, PyObject *__pyx_v_value) {
|
|
::capnp::DynamicValue::Reader __pyx_v_temp;
|
|
PyObject *__pyx_r = NULL;
|
|
__Pyx_RefNannyDeclarations
|
|
PY_LONG_LONG __pyx_t_1;
|
|
char *__pyx_t_2;
|
|
int __pyx_lineno = 0;
|
|
const char *__pyx_filename = NULL;
|
|
int __pyx_clineno = 0;
|
|
__Pyx_RefNannySetupContext("_setattrInt", 0);
|
|
|
|
/* "capnp.pyx":354
|
|
*
|
|
* cdef _setattrInt(self, field, value):
|
|
* cdef C_DynamicValue.Reader temp = C_DynamicValue.Reader(<long long>value) # <<<<<<<<<<<<<<
|
|
* self.thisptr.set(field, temp)
|
|
*
|
|
*/
|
|
__pyx_t_1 = __Pyx_PyInt_AsLongLong(__pyx_v_value); if (unlikely((__pyx_t_1 == (PY_LONG_LONG)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 354; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
|
|
__pyx_v_temp = ::capnp::DynamicValue::Reader(((PY_LONG_LONG)__pyx_t_1));
|
|
|
|
/* "capnp.pyx":355
|
|
* cdef _setattrInt(self, field, value):
|
|
* cdef C_DynamicValue.Reader temp = C_DynamicValue.Reader(<long long>value)
|
|
* self.thisptr.set(field, temp) # <<<<<<<<<<<<<<
|
|
*
|
|
* cdef _setattrDouble(self, field, value):
|
|
*/
|
|
__pyx_t_2 = __Pyx_PyObject_AsString(__pyx_v_field); if (unlikely((!__pyx_t_2) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 355; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
|
|
try {
|
|
__pyx_v_self->thisptr.set(__pyx_t_2, (( ::capnp::DynamicValue::Reader &)__pyx_v_temp));
|
|
} catch(...) {
|
|
try { throw; } catch(const std::exception& exn) { PyErr_SetString(__pyx_builtin_ValueError, exn.what()); } catch(...) { PyErr_SetNone(__pyx_builtin_ValueError); }
|
|
{__pyx_filename = __pyx_f[0]; __pyx_lineno = 355; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
|
|
}
|
|
|
|
__pyx_r = Py_None; __Pyx_INCREF(Py_None);
|
|
goto __pyx_L0;
|
|
__pyx_L1_error:;
|
|
__Pyx_AddTraceback("capnp._DynamicUnionBuilder._setattrInt", __pyx_clineno, __pyx_lineno, __pyx_filename);
|
|
__pyx_r = 0;
|
|
__pyx_L0:;
|
|
__Pyx_XGIVEREF(__pyx_r);
|
|
__Pyx_RefNannyFinishContext();
|
|
return __pyx_r;
|
|
}
|
|
|
|
/* "capnp.pyx":357
|
|
* self.thisptr.set(field, temp)
|
|
*
|
|
* cdef _setattrDouble(self, field, value): # <<<<<<<<<<<<<<
|
|
* cdef C_DynamicValue.Reader temp = C_DynamicValue.Reader(<double>value)
|
|
* self.thisptr.set(field, temp)
|
|
*/
|
|
|
|
static PyObject *__pyx_f_5capnp_20_DynamicUnionBuilder__setattrDouble(struct __pyx_obj_5capnp__DynamicUnionBuilder *__pyx_v_self, PyObject *__pyx_v_field, PyObject *__pyx_v_value) {
|
|
::capnp::DynamicValue::Reader __pyx_v_temp;
|
|
PyObject *__pyx_r = NULL;
|
|
__Pyx_RefNannyDeclarations
|
|
double __pyx_t_1;
|
|
char *__pyx_t_2;
|
|
int __pyx_lineno = 0;
|
|
const char *__pyx_filename = NULL;
|
|
int __pyx_clineno = 0;
|
|
__Pyx_RefNannySetupContext("_setattrDouble", 0);
|
|
|
|
/* "capnp.pyx":358
|
|
*
|
|
* cdef _setattrDouble(self, field, value):
|
|
* cdef C_DynamicValue.Reader temp = C_DynamicValue.Reader(<double>value) # <<<<<<<<<<<<<<
|
|
* self.thisptr.set(field, temp)
|
|
*
|
|
*/
|
|
__pyx_t_1 = __pyx_PyFloat_AsDouble(__pyx_v_value); if (unlikely((__pyx_t_1 == (double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 358; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
|
|
__pyx_v_temp = ::capnp::DynamicValue::Reader(((double)__pyx_t_1));
|
|
|
|
/* "capnp.pyx":359
|
|
* cdef _setattrDouble(self, field, value):
|
|
* cdef C_DynamicValue.Reader temp = C_DynamicValue.Reader(<double>value)
|
|
* self.thisptr.set(field, temp) # <<<<<<<<<<<<<<
|
|
*
|
|
* cdef _setattrBool(self, field, value):
|
|
*/
|
|
__pyx_t_2 = __Pyx_PyObject_AsString(__pyx_v_field); if (unlikely((!__pyx_t_2) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 359; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
|
|
try {
|
|
__pyx_v_self->thisptr.set(__pyx_t_2, (( ::capnp::DynamicValue::Reader &)__pyx_v_temp));
|
|
} catch(...) {
|
|
try { throw; } catch(const std::exception& exn) { PyErr_SetString(__pyx_builtin_ValueError, exn.what()); } catch(...) { PyErr_SetNone(__pyx_builtin_ValueError); }
|
|
{__pyx_filename = __pyx_f[0]; __pyx_lineno = 359; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
|
|
}
|
|
|
|
__pyx_r = Py_None; __Pyx_INCREF(Py_None);
|
|
goto __pyx_L0;
|
|
__pyx_L1_error:;
|
|
__Pyx_AddTraceback("capnp._DynamicUnionBuilder._setattrDouble", __pyx_clineno, __pyx_lineno, __pyx_filename);
|
|
__pyx_r = 0;
|
|
__pyx_L0:;
|
|
__Pyx_XGIVEREF(__pyx_r);
|
|
__Pyx_RefNannyFinishContext();
|
|
return __pyx_r;
|
|
}
|
|
|
|
/* "capnp.pyx":361
|
|
* self.thisptr.set(field, temp)
|
|
*
|
|
* cdef _setattrBool(self, field, value): # <<<<<<<<<<<<<<
|
|
* cdef C_DynamicValue.Reader temp = C_DynamicValue.Reader(<bint>value)
|
|
* self.thisptr.set(field, temp)
|
|
*/
|
|
|
|
static PyObject *__pyx_f_5capnp_20_DynamicUnionBuilder__setattrBool(struct __pyx_obj_5capnp__DynamicUnionBuilder *__pyx_v_self, PyObject *__pyx_v_field, PyObject *__pyx_v_value) {
|
|
::capnp::DynamicValue::Reader __pyx_v_temp;
|
|
PyObject *__pyx_r = NULL;
|
|
__Pyx_RefNannyDeclarations
|
|
int __pyx_t_1;
|
|
char *__pyx_t_2;
|
|
int __pyx_lineno = 0;
|
|
const char *__pyx_filename = NULL;
|
|
int __pyx_clineno = 0;
|
|
__Pyx_RefNannySetupContext("_setattrBool", 0);
|
|
|
|
/* "capnp.pyx":362
|
|
*
|
|
* cdef _setattrBool(self, field, value):
|
|
* cdef C_DynamicValue.Reader temp = C_DynamicValue.Reader(<bint>value) # <<<<<<<<<<<<<<
|
|
* self.thisptr.set(field, temp)
|
|
*
|
|
*/
|
|
__pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_value); if (unlikely((__pyx_t_1 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 362; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
|
|
__pyx_v_temp = ::capnp::DynamicValue::Reader(((int)__pyx_t_1));
|
|
|
|
/* "capnp.pyx":363
|
|
* cdef _setattrBool(self, field, value):
|
|
* cdef C_DynamicValue.Reader temp = C_DynamicValue.Reader(<bint>value)
|
|
* self.thisptr.set(field, temp) # <<<<<<<<<<<<<<
|
|
*
|
|
* cdef _setattrString(self, field, value):
|
|
*/
|
|
__pyx_t_2 = __Pyx_PyObject_AsString(__pyx_v_field); if (unlikely((!__pyx_t_2) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 363; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
|
|
try {
|
|
__pyx_v_self->thisptr.set(__pyx_t_2, (( ::capnp::DynamicValue::Reader &)__pyx_v_temp));
|
|
} catch(...) {
|
|
try { throw; } catch(const std::exception& exn) { PyErr_SetString(__pyx_builtin_ValueError, exn.what()); } catch(...) { PyErr_SetNone(__pyx_builtin_ValueError); }
|
|
{__pyx_filename = __pyx_f[0]; __pyx_lineno = 363; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
|
|
}
|
|
|
|
__pyx_r = Py_None; __Pyx_INCREF(Py_None);
|
|
goto __pyx_L0;
|
|
__pyx_L1_error:;
|
|
__Pyx_AddTraceback("capnp._DynamicUnionBuilder._setattrBool", __pyx_clineno, __pyx_lineno, __pyx_filename);
|
|
__pyx_r = 0;
|
|
__pyx_L0:;
|
|
__Pyx_XGIVEREF(__pyx_r);
|
|
__Pyx_RefNannyFinishContext();
|
|
return __pyx_r;
|
|
}
|
|
|
|
/* "capnp.pyx":365
|
|
* self.thisptr.set(field, temp)
|
|
*
|
|
* cdef _setattrString(self, field, value): # <<<<<<<<<<<<<<
|
|
* cdef C_DynamicValue.Reader temp = C_DynamicValue.Reader(<char*>value)
|
|
* self.thisptr.set(field, temp)
|
|
*/
|
|
|
|
static PyObject *__pyx_f_5capnp_20_DynamicUnionBuilder__setattrString(struct __pyx_obj_5capnp__DynamicUnionBuilder *__pyx_v_self, PyObject *__pyx_v_field, PyObject *__pyx_v_value) {
|
|
::capnp::DynamicValue::Reader __pyx_v_temp;
|
|
PyObject *__pyx_r = NULL;
|
|
__Pyx_RefNannyDeclarations
|
|
char *__pyx_t_1;
|
|
int __pyx_lineno = 0;
|
|
const char *__pyx_filename = NULL;
|
|
int __pyx_clineno = 0;
|
|
__Pyx_RefNannySetupContext("_setattrString", 0);
|
|
|
|
/* "capnp.pyx":366
|
|
*
|
|
* cdef _setattrString(self, field, value):
|
|
* cdef C_DynamicValue.Reader temp = C_DynamicValue.Reader(<char*>value) # <<<<<<<<<<<<<<
|
|
* self.thisptr.set(field, temp)
|
|
*
|
|
*/
|
|
__pyx_t_1 = __Pyx_PyObject_AsString(__pyx_v_value); if (unlikely((!__pyx_t_1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 366; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
|
|
__pyx_v_temp = ::capnp::DynamicValue::Reader(((char *)__pyx_t_1));
|
|
|
|
/* "capnp.pyx":367
|
|
* cdef _setattrString(self, field, value):
|
|
* cdef C_DynamicValue.Reader temp = C_DynamicValue.Reader(<char*>value)
|
|
* self.thisptr.set(field, temp) # <<<<<<<<<<<<<<
|
|
*
|
|
* cdef _setattrVoid(self, field):
|
|
*/
|
|
__pyx_t_1 = __Pyx_PyObject_AsString(__pyx_v_field); if (unlikely((!__pyx_t_1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 367; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
|
|
try {
|
|
__pyx_v_self->thisptr.set(__pyx_t_1, (( ::capnp::DynamicValue::Reader &)__pyx_v_temp));
|
|
} catch(...) {
|
|
try { throw; } catch(const std::exception& exn) { PyErr_SetString(__pyx_builtin_ValueError, exn.what()); } catch(...) { PyErr_SetNone(__pyx_builtin_ValueError); }
|
|
{__pyx_filename = __pyx_f[0]; __pyx_lineno = 367; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
|
|
}
|
|
|
|
__pyx_r = Py_None; __Pyx_INCREF(Py_None);
|
|
goto __pyx_L0;
|
|
__pyx_L1_error:;
|
|
__Pyx_AddTraceback("capnp._DynamicUnionBuilder._setattrString", __pyx_clineno, __pyx_lineno, __pyx_filename);
|
|
__pyx_r = 0;
|
|
__pyx_L0:;
|
|
__Pyx_XGIVEREF(__pyx_r);
|
|
__Pyx_RefNannyFinishContext();
|
|
return __pyx_r;
|
|
}
|
|
|
|
/* "capnp.pyx":369
|
|
* self.thisptr.set(field, temp)
|
|
*
|
|
* cdef _setattrVoid(self, field): # <<<<<<<<<<<<<<
|
|
* cdef C_DynamicValue.Reader temp = C_DynamicValue.Reader(VOID)
|
|
* self.thisptr.set(field, temp)
|
|
*/
|
|
|
|
static PyObject *__pyx_f_5capnp_20_DynamicUnionBuilder__setattrVoid(struct __pyx_obj_5capnp__DynamicUnionBuilder *__pyx_v_self, PyObject *__pyx_v_field) {
|
|
::capnp::DynamicValue::Reader __pyx_v_temp;
|
|
PyObject *__pyx_r = NULL;
|
|
__Pyx_RefNannyDeclarations
|
|
char *__pyx_t_1;
|
|
int __pyx_lineno = 0;
|
|
const char *__pyx_filename = NULL;
|
|
int __pyx_clineno = 0;
|
|
__Pyx_RefNannySetupContext("_setattrVoid", 0);
|
|
|
|
/* "capnp.pyx":370
|
|
*
|
|
* cdef _setattrVoid(self, field):
|
|
* cdef C_DynamicValue.Reader temp = C_DynamicValue.Reader(VOID) # <<<<<<<<<<<<<<
|
|
* self.thisptr.set(field, temp)
|
|
*
|
|
*/
|
|
__pyx_v_temp = ::capnp::DynamicValue::Reader( ::capnp::Void::VOID);
|
|
|
|
/* "capnp.pyx":371
|
|
* cdef _setattrVoid(self, field):
|
|
* cdef C_DynamicValue.Reader temp = C_DynamicValue.Reader(VOID)
|
|
* self.thisptr.set(field, temp) # <<<<<<<<<<<<<<
|
|
*
|
|
* def __setattr__(self, field, value):
|
|
*/
|
|
__pyx_t_1 = __Pyx_PyObject_AsString(__pyx_v_field); if (unlikely((!__pyx_t_1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 371; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
|
|
try {
|
|
__pyx_v_self->thisptr.set(__pyx_t_1, (( ::capnp::DynamicValue::Reader &)__pyx_v_temp));
|
|
} catch(...) {
|
|
try { throw; } catch(const std::exception& exn) { PyErr_SetString(__pyx_builtin_ValueError, exn.what()); } catch(...) { PyErr_SetNone(__pyx_builtin_ValueError); }
|
|
{__pyx_filename = __pyx_f[0]; __pyx_lineno = 371; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
|
|
}
|
|
|
|
__pyx_r = Py_None; __Pyx_INCREF(Py_None);
|
|
goto __pyx_L0;
|
|
__pyx_L1_error:;
|
|
__Pyx_AddTraceback("capnp._DynamicUnionBuilder._setattrVoid", __pyx_clineno, __pyx_lineno, __pyx_filename);
|
|
__pyx_r = 0;
|
|
__pyx_L0:;
|
|
__Pyx_XGIVEREF(__pyx_r);
|
|
__Pyx_RefNannyFinishContext();
|
|
return __pyx_r;
|
|
}
|
|
|
|
/* Python wrapper */
|
|
static int __pyx_pw_5capnp_20_DynamicUnionBuilder_3__setattr__(PyObject *__pyx_v_self, PyObject *__pyx_v_field, PyObject *__pyx_v_value); /*proto*/
|
|
static int __pyx_pw_5capnp_20_DynamicUnionBuilder_3__setattr__(PyObject *__pyx_v_self, PyObject *__pyx_v_field, PyObject *__pyx_v_value) {
|
|
int __pyx_r;
|
|
__Pyx_RefNannyDeclarations
|
|
__Pyx_RefNannySetupContext("__setattr__ (wrapper)", 0);
|
|
__pyx_r = __pyx_pf_5capnp_20_DynamicUnionBuilder_2__setattr__(((struct __pyx_obj_5capnp__DynamicUnionBuilder *)__pyx_v_self), ((PyObject *)__pyx_v_field), ((PyObject *)__pyx_v_value));
|
|
__Pyx_RefNannyFinishContext();
|
|
return __pyx_r;
|
|
}
|
|
|
|
/* "capnp.pyx":373
|
|
* self.thisptr.set(field, temp)
|
|
*
|
|
* def __setattr__(self, field, value): # <<<<<<<<<<<<<<
|
|
* value_type = type(value)
|
|
* if value_type is int:
|
|
*/
|
|
|
|
static int __pyx_pf_5capnp_20_DynamicUnionBuilder_2__setattr__(struct __pyx_obj_5capnp__DynamicUnionBuilder *__pyx_v_self, PyObject *__pyx_v_field, PyObject *__pyx_v_value) {
|
|
PyObject *__pyx_v_value_type = NULL;
|
|
int __pyx_r;
|
|
__Pyx_RefNannyDeclarations
|
|
int __pyx_t_1;
|
|
int __pyx_t_2;
|
|
PyObject *__pyx_t_3 = NULL;
|
|
int __pyx_lineno = 0;
|
|
const char *__pyx_filename = NULL;
|
|
int __pyx_clineno = 0;
|
|
__Pyx_RefNannySetupContext("__setattr__", 0);
|
|
|
|
/* "capnp.pyx":374
|
|
*
|
|
* def __setattr__(self, field, value):
|
|
* value_type = type(value) # <<<<<<<<<<<<<<
|
|
* if value_type is int:
|
|
* self._setattrInt(field, value)
|
|
*/
|
|
__Pyx_INCREF(((PyObject *)Py_TYPE(__pyx_v_value)));
|
|
__pyx_v_value_type = ((PyObject*)((PyObject *)Py_TYPE(__pyx_v_value)));
|
|
|
|
/* "capnp.pyx":375
|
|
* def __setattr__(self, field, value):
|
|
* value_type = type(value)
|
|
* if value_type is int: # <<<<<<<<<<<<<<
|
|
* self._setattrInt(field, value)
|
|
* elif value_type is float:
|
|
*/
|
|
__pyx_t_1 = (__pyx_v_value_type == ((PyObject*)(&PyInt_Type)));
|
|
__pyx_t_2 = (__pyx_t_1 != 0);
|
|
if (__pyx_t_2) {
|
|
|
|
/* "capnp.pyx":376
|
|
* value_type = type(value)
|
|
* if value_type is int:
|
|
* self._setattrInt(field, value) # <<<<<<<<<<<<<<
|
|
* elif value_type is float:
|
|
* self._setattrDouble(field, value)
|
|
*/
|
|
__pyx_t_3 = ((struct __pyx_vtabstruct_5capnp__DynamicUnionBuilder *)__pyx_v_self->__pyx_vtab)->_setattrInt(__pyx_v_self, __pyx_v_field, __pyx_v_value); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 376; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
|
|
__Pyx_GOTREF(__pyx_t_3);
|
|
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
|
|
goto __pyx_L3;
|
|
}
|
|
|
|
/* "capnp.pyx":377
|
|
* if value_type is int:
|
|
* self._setattrInt(field, value)
|
|
* elif value_type is float: # <<<<<<<<<<<<<<
|
|
* self._setattrDouble(field, value)
|
|
* elif value_type is bool:
|
|
*/
|
|
__pyx_t_2 = (__pyx_v_value_type == ((PyObject*)(&PyFloat_Type)));
|
|
__pyx_t_1 = (__pyx_t_2 != 0);
|
|
if (__pyx_t_1) {
|
|
|
|
/* "capnp.pyx":378
|
|
* self._setattrInt(field, value)
|
|
* elif value_type is float:
|
|
* self._setattrDouble(field, value) # <<<<<<<<<<<<<<
|
|
* elif value_type is bool:
|
|
* self._setattrBool(field, value)
|
|
*/
|
|
__pyx_t_3 = ((struct __pyx_vtabstruct_5capnp__DynamicUnionBuilder *)__pyx_v_self->__pyx_vtab)->_setattrDouble(__pyx_v_self, __pyx_v_field, __pyx_v_value); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 378; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
|
|
__Pyx_GOTREF(__pyx_t_3);
|
|
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
|
|
goto __pyx_L3;
|
|
}
|
|
|
|
/* "capnp.pyx":379
|
|
* elif value_type is float:
|
|
* self._setattrDouble(field, value)
|
|
* elif value_type is bool: # <<<<<<<<<<<<<<
|
|
* self._setattrBool(field, value)
|
|
* elif value_type is bytes:
|
|
*/
|
|
__pyx_t_1 = (__pyx_v_value_type == ((PyObject*)((PyObject*)&PyBool_Type)));
|
|
__pyx_t_2 = (__pyx_t_1 != 0);
|
|
if (__pyx_t_2) {
|
|
|
|
/* "capnp.pyx":380
|
|
* self._setattrDouble(field, value)
|
|
* elif value_type is bool:
|
|
* self._setattrBool(field, value) # <<<<<<<<<<<<<<
|
|
* elif value_type is bytes:
|
|
* self._setattrString(field, value)
|
|
*/
|
|
__pyx_t_3 = ((struct __pyx_vtabstruct_5capnp__DynamicUnionBuilder *)__pyx_v_self->__pyx_vtab)->_setattrBool(__pyx_v_self, __pyx_v_field, __pyx_v_value); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 380; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
|
|
__Pyx_GOTREF(__pyx_t_3);
|
|
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
|
|
goto __pyx_L3;
|
|
}
|
|
|
|
/* "capnp.pyx":381
|
|
* elif value_type is bool:
|
|
* self._setattrBool(field, value)
|
|
* elif value_type is bytes: # <<<<<<<<<<<<<<
|
|
* self._setattrString(field, value)
|
|
* elif value is None:
|
|
*/
|
|
__pyx_t_2 = (__pyx_v_value_type == ((PyObject*)(&PyBytes_Type)));
|
|
__pyx_t_1 = (__pyx_t_2 != 0);
|
|
if (__pyx_t_1) {
|
|
|
|
/* "capnp.pyx":382
|
|
* self._setattrBool(field, value)
|
|
* elif value_type is bytes:
|
|
* self._setattrString(field, value) # <<<<<<<<<<<<<<
|
|
* elif value is None:
|
|
* self._setattrVoid(field)
|
|
*/
|
|
__pyx_t_3 = ((struct __pyx_vtabstruct_5capnp__DynamicUnionBuilder *)__pyx_v_self->__pyx_vtab)->_setattrString(__pyx_v_self, __pyx_v_field, __pyx_v_value); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 382; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
|
|
__Pyx_GOTREF(__pyx_t_3);
|
|
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
|
|
goto __pyx_L3;
|
|
}
|
|
|
|
/* "capnp.pyx":383
|
|
* elif value_type is bytes:
|
|
* self._setattrString(field, value)
|
|
* elif value is None: # <<<<<<<<<<<<<<
|
|
* self._setattrVoid(field)
|
|
* else:
|
|
*/
|
|
__pyx_t_1 = (__pyx_v_value == Py_None);
|
|
__pyx_t_2 = (__pyx_t_1 != 0);
|
|
if (__pyx_t_2) {
|
|
|
|
/* "capnp.pyx":384
|
|
* self._setattrString(field, value)
|
|
* elif value is None:
|
|
* self._setattrVoid(field) # <<<<<<<<<<<<<<
|
|
* else:
|
|
* raise ValueError("Non primitive type")
|
|
*/
|
|
__pyx_t_3 = ((struct __pyx_vtabstruct_5capnp__DynamicUnionBuilder *)__pyx_v_self->__pyx_vtab)->_setattrVoid(__pyx_v_self, __pyx_v_field); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 384; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
|
|
__Pyx_GOTREF(__pyx_t_3);
|
|
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
|
|
goto __pyx_L3;
|
|
}
|
|
/*else*/ {
|
|
|
|
/* "capnp.pyx":386
|
|
* self._setattrVoid(field)
|
|
* else:
|
|
* raise ValueError("Non primitive type") # <<<<<<<<<<<<<<
|
|
*
|
|
* cpdef which(self):
|
|
*/
|
|
__pyx_t_3 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_k_tuple_30), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 386; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
|
|
__Pyx_GOTREF(__pyx_t_3);
|
|
__Pyx_Raise(__pyx_t_3, 0, 0, 0);
|
|
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
|
|
{__pyx_filename = __pyx_f[0]; __pyx_lineno = 386; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
|
|
}
|
|
__pyx_L3:;
|
|
|
|
__pyx_r = 0;
|
|
goto __pyx_L0;
|
|
__pyx_L1_error:;
|
|
__Pyx_XDECREF(__pyx_t_3);
|
|
__Pyx_AddTraceback("capnp._DynamicUnionBuilder.__setattr__", __pyx_clineno, __pyx_lineno, __pyx_filename);
|
|
__pyx_r = -1;
|
|
__pyx_L0:;
|
|
__Pyx_XDECREF(__pyx_v_value_type);
|
|
__Pyx_RefNannyFinishContext();
|
|
return __pyx_r;
|
|
}
|
|
|
|
/* "capnp.pyx":388
|
|
* raise ValueError("Non primitive type")
|
|
*
|
|
* cpdef which(self): # <<<<<<<<<<<<<<
|
|
* return fixMaybe(self.thisptr.which()).getProto().getName().cStr()
|
|
*
|
|
*/
|
|
|
|
static PyObject *__pyx_pw_5capnp_20_DynamicUnionBuilder_5which(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
|
|
static PyObject *__pyx_f_5capnp_20_DynamicUnionBuilder_which(struct __pyx_obj_5capnp__DynamicUnionBuilder *__pyx_v_self, int __pyx_skip_dispatch) {
|
|
PyObject *__pyx_r = NULL;
|
|
__Pyx_RefNannyDeclarations
|
|
PyObject *__pyx_t_1 = NULL;
|
|
PyObject *__pyx_t_2 = NULL;
|
|
::capnp::StructSchema::Member __pyx_t_3;
|
|
int __pyx_lineno = 0;
|
|
const char *__pyx_filename = NULL;
|
|
int __pyx_clineno = 0;
|
|
__Pyx_RefNannySetupContext("which", 0);
|
|
/* Check if called by wrapper */
|
|
if (unlikely(__pyx_skip_dispatch)) ;
|
|
/* Check if overridden in Python */
|
|
else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
|
|
__pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s__which); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 388; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
|
|
__Pyx_GOTREF(__pyx_t_1);
|
|
if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_5capnp_20_DynamicUnionBuilder_5which)) {
|
|
__Pyx_XDECREF(__pyx_r);
|
|
__pyx_t_2 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 388; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
|
|
__Pyx_GOTREF(__pyx_t_2);
|
|
__pyx_r = __pyx_t_2;
|
|
__pyx_t_2 = 0;
|
|
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
|
|
goto __pyx_L0;
|
|
}
|
|
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
|
|
}
|
|
|
|
/* "capnp.pyx":389
|
|
*
|
|
* cpdef which(self):
|
|
* return fixMaybe(self.thisptr.which()).getProto().getName().cStr() # <<<<<<<<<<<<<<
|
|
*
|
|
* cpdef init(self, field, size=None) except +ValueError:
|
|
*/
|
|
__Pyx_XDECREF(__pyx_r);
|
|
try {
|
|
__pyx_t_3 = fixMaybe(__pyx_v_self->thisptr.which());
|
|
} catch(...) {
|
|
__Pyx_CppExn2PyErr();
|
|
{__pyx_filename = __pyx_f[0]; __pyx_lineno = 389; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
|
|
}
|
|
__pyx_t_1 = __Pyx_PyBytes_FromString(__pyx_t_3.getProto().getName().cStr()); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 389; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
|
|
__Pyx_GOTREF(((PyObject *)__pyx_t_1));
|
|
__pyx_r = ((PyObject *)__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("capnp._DynamicUnionBuilder.which", __pyx_clineno, __pyx_lineno, __pyx_filename);
|
|
__pyx_r = 0;
|
|
__pyx_L0:;
|
|
__Pyx_XGIVEREF(__pyx_r);
|
|
__Pyx_RefNannyFinishContext();
|
|
return __pyx_r;
|
|
}
|
|
|
|
/* Python wrapper */
|
|
static PyObject *__pyx_pw_5capnp_20_DynamicUnionBuilder_5which(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
|
|
static PyObject *__pyx_pw_5capnp_20_DynamicUnionBuilder_5which(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
|
|
PyObject *__pyx_r = 0;
|
|
__Pyx_RefNannyDeclarations
|
|
__Pyx_RefNannySetupContext("which (wrapper)", 0);
|
|
__pyx_r = __pyx_pf_5capnp_20_DynamicUnionBuilder_4which(((struct __pyx_obj_5capnp__DynamicUnionBuilder *)__pyx_v_self));
|
|
__Pyx_RefNannyFinishContext();
|
|
return __pyx_r;
|
|
}
|
|
|
|
/* "capnp.pyx":388
|
|
* raise ValueError("Non primitive type")
|
|
*
|
|
* cpdef which(self): # <<<<<<<<<<<<<<
|
|
* return fixMaybe(self.thisptr.which()).getProto().getName().cStr()
|
|
*
|
|
*/
|
|
|
|
static PyObject *__pyx_pf_5capnp_20_DynamicUnionBuilder_4which(struct __pyx_obj_5capnp__DynamicUnionBuilder *__pyx_v_self) {
|
|
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("which", 0);
|
|
__Pyx_XDECREF(__pyx_r);
|
|
__pyx_t_1 = ((struct __pyx_vtabstruct_5capnp__DynamicUnionBuilder *)__pyx_v_self->__pyx_vtab)->which(__pyx_v_self, 1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 388; __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("capnp._DynamicUnionBuilder.which", __pyx_clineno, __pyx_lineno, __pyx_filename);
|
|
__pyx_r = NULL;
|
|
__pyx_L0:;
|
|
__Pyx_XGIVEREF(__pyx_r);
|
|
__Pyx_RefNannyFinishContext();
|
|
return __pyx_r;
|
|
}
|
|
|
|
/* "capnp.pyx":391
|
|
* return fixMaybe(self.thisptr.which()).getProto().getName().cStr()
|
|
*
|
|
* cpdef init(self, field, size=None) except +ValueError: # <<<<<<<<<<<<<<
|
|
* if size is None:
|
|
* return toPythonByValue(self.thisptr.init(field))
|
|
*/
|
|
|
|
static PyObject *__pyx_pw_5capnp_20_DynamicUnionBuilder_7init(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
|
|
static PyObject *__pyx_f_5capnp_20_DynamicUnionBuilder_init(struct __pyx_obj_5capnp__DynamicUnionBuilder *__pyx_v_self, PyObject *__pyx_v_field, int __pyx_skip_dispatch, struct __pyx_opt_args_5capnp_20_DynamicUnionBuilder_init *__pyx_optional_args) {
|
|
PyObject *__pyx_v_size = ((PyObject *)Py_None);
|
|
PyObject *__pyx_r = NULL;
|
|
__Pyx_RefNannyDeclarations
|
|
PyObject *__pyx_t_1 = NULL;
|
|
PyObject *__pyx_t_2 = NULL;
|
|
PyObject *__pyx_t_3 = NULL;
|
|
int __pyx_t_4;
|
|
int __pyx_t_5;
|
|
char *__pyx_t_6;
|
|
__pyx_t_9capnp_cpp_uint __pyx_t_7;
|
|
int __pyx_lineno = 0;
|
|
const char *__pyx_filename = NULL;
|
|
int __pyx_clineno = 0;
|
|
__Pyx_RefNannySetupContext("init", 0);
|
|
if (__pyx_optional_args) {
|
|
if (__pyx_optional_args->__pyx_n > 0) {
|
|
__pyx_v_size = __pyx_optional_args->size;
|
|
}
|
|
}
|
|
/* Check if called by wrapper */
|
|
if (unlikely(__pyx_skip_dispatch)) ;
|
|
/* Check if overridden in Python */
|
|
else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
|
|
__pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s__init); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 391; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
|
|
__Pyx_GOTREF(__pyx_t_1);
|
|
if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_5capnp_20_DynamicUnionBuilder_7init)) {
|
|
__Pyx_XDECREF(__pyx_r);
|
|
__pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 391; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
|
|
__Pyx_GOTREF(__pyx_t_2);
|
|
__Pyx_INCREF(__pyx_v_field);
|
|
PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_field);
|
|
__Pyx_GIVEREF(__pyx_v_field);
|
|
__Pyx_INCREF(__pyx_v_size);
|
|
PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_v_size);
|
|
__Pyx_GIVEREF(__pyx_v_size);
|
|
__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 = 391; __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;
|
|
__pyx_t_3 = 0;
|
|
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
|
|
goto __pyx_L0;
|
|
}
|
|
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
|
|
}
|
|
|
|
/* "capnp.pyx":392
|
|
*
|
|
* cpdef init(self, field, size=None) except +ValueError:
|
|
* if size is None: # <<<<<<<<<<<<<<
|
|
* return toPythonByValue(self.thisptr.init(field))
|
|
* else:
|
|
*/
|
|
__pyx_t_4 = (__pyx_v_size == Py_None);
|
|
__pyx_t_5 = (__pyx_t_4 != 0);
|
|
if (__pyx_t_5) {
|
|
|
|
/* "capnp.pyx":393
|
|
* cpdef init(self, field, size=None) except +ValueError:
|
|
* if size is None:
|
|
* return toPythonByValue(self.thisptr.init(field)) # <<<<<<<<<<<<<<
|
|
* else:
|
|
* return toPythonByValue(self.thisptr.init(field, size))
|
|
*/
|
|
__Pyx_XDECREF(__pyx_r);
|
|
__pyx_t_6 = __Pyx_PyObject_AsString(__pyx_v_field); if (unlikely((!__pyx_t_6) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 393; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
|
|
__pyx_t_1 = __pyx_f_5capnp_toPythonByValue((( ::capnp::DynamicValue::Builder)__pyx_v_self->thisptr.init(__pyx_t_6))); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 393; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
|
|
__Pyx_GOTREF(__pyx_t_1);
|
|
__pyx_r = __pyx_t_1;
|
|
__pyx_t_1 = 0;
|
|
goto __pyx_L0;
|
|
goto __pyx_L3;
|
|
}
|
|
/*else*/ {
|
|
|
|
/* "capnp.pyx":395
|
|
* return toPythonByValue(self.thisptr.init(field))
|
|
* else:
|
|
* return toPythonByValue(self.thisptr.init(field, size)) # <<<<<<<<<<<<<<
|
|
*
|
|
* cdef class _CodeGeneratorRequestReader:
|
|
*/
|
|
__Pyx_XDECREF(__pyx_r);
|
|
__pyx_t_6 = __Pyx_PyObject_AsString(__pyx_v_field); if (unlikely((!__pyx_t_6) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 395; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
|
|
__pyx_t_7 = __Pyx_PyInt_AsUnsignedInt(__pyx_v_size); if (unlikely((__pyx_t_7 == (unsigned int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 395; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
|
|
__pyx_t_1 = __pyx_f_5capnp_toPythonByValue((( ::capnp::DynamicValue::Builder)__pyx_v_self->thisptr.init(__pyx_t_6, __pyx_t_7))); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 395; __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_L3:;
|
|
|
|
__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("capnp._DynamicUnionBuilder.init", __pyx_clineno, __pyx_lineno, __pyx_filename);
|
|
__pyx_r = 0;
|
|
__pyx_L0:;
|
|
__Pyx_XGIVEREF(__pyx_r);
|
|
__Pyx_RefNannyFinishContext();
|
|
return __pyx_r;
|
|
}
|
|
|
|
/* Python wrapper */
|
|
static PyObject *__pyx_pw_5capnp_20_DynamicUnionBuilder_7init(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
|
|
static PyObject *__pyx_pw_5capnp_20_DynamicUnionBuilder_7init(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
|
|
PyObject *__pyx_v_field = 0;
|
|
PyObject *__pyx_v_size = 0;
|
|
int __pyx_lineno = 0;
|
|
const char *__pyx_filename = NULL;
|
|
int __pyx_clineno = 0;
|
|
PyObject *__pyx_r = 0;
|
|
__Pyx_RefNannyDeclarations
|
|
__Pyx_RefNannySetupContext("init (wrapper)", 0);
|
|
{
|
|
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__field,&__pyx_n_s__size,0};
|
|
PyObject* values[2] = {0,0};
|
|
|
|
/* "capnp.pyx":391
|
|
* return fixMaybe(self.thisptr.which()).getProto().getName().cStr()
|
|
*
|
|
* cpdef init(self, field, size=None) except +ValueError: # <<<<<<<<<<<<<<
|
|
* if size is None:
|
|
* return toPythonByValue(self.thisptr.init(field))
|
|
*/
|
|
values[1] = ((PyObject *)Py_None);
|
|
if (unlikely(__pyx_kwds)) {
|
|
Py_ssize_t kw_args;
|
|
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
|
|
switch (pos_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;
|
|
}
|
|
kw_args = PyDict_Size(__pyx_kwds);
|
|
switch (pos_args) {
|
|
case 0:
|
|
if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__field)) != 0)) kw_args--;
|
|
else goto __pyx_L5_argtuple_error;
|
|
case 1:
|
|
if (kw_args > 0) {
|
|
PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__size);
|
|
if (value) { values[1] = value; kw_args--; }
|
|
}
|
|
}
|
|
if (unlikely(kw_args > 0)) {
|
|
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "init") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 391; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
|
|
}
|
|
} else {
|
|
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);
|
|
break;
|
|
default: goto __pyx_L5_argtuple_error;
|
|
}
|
|
}
|
|
__pyx_v_field = values[0];
|
|
__pyx_v_size = values[1];
|
|
}
|
|
goto __pyx_L4_argument_unpacking_done;
|
|
__pyx_L5_argtuple_error:;
|
|
__Pyx_RaiseArgtupleInvalid("init", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 391; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
|
|
__pyx_L3_error:;
|
|
__Pyx_AddTraceback("capnp._DynamicUnionBuilder.init", __pyx_clineno, __pyx_lineno, __pyx_filename);
|
|
__Pyx_RefNannyFinishContext();
|
|
return NULL;
|
|
__pyx_L4_argument_unpacking_done:;
|
|
__pyx_r = __pyx_pf_5capnp_20_DynamicUnionBuilder_6init(((struct __pyx_obj_5capnp__DynamicUnionBuilder *)__pyx_v_self), __pyx_v_field, __pyx_v_size);
|
|
__Pyx_RefNannyFinishContext();
|
|
return __pyx_r;
|
|
}
|
|
|
|
static PyObject *__pyx_pf_5capnp_20_DynamicUnionBuilder_6init(struct __pyx_obj_5capnp__DynamicUnionBuilder *__pyx_v_self, PyObject *__pyx_v_field, PyObject *__pyx_v_size) {
|
|
PyObject *__pyx_r = NULL;
|
|
__Pyx_RefNannyDeclarations
|
|
PyObject *__pyx_t_1 = NULL;
|
|
struct __pyx_opt_args_5capnp_20_DynamicUnionBuilder_init __pyx_t_2;
|
|
int __pyx_lineno = 0;
|
|
const char *__pyx_filename = NULL;
|
|
int __pyx_clineno = 0;
|
|
__Pyx_RefNannySetupContext("init", 0);
|
|
__Pyx_XDECREF(__pyx_r);
|
|
__pyx_t_2.__pyx_n = 1;
|
|
__pyx_t_2.size = __pyx_v_size;
|
|
try {
|
|
__pyx_t_1 = ((struct __pyx_vtabstruct_5capnp__DynamicUnionBuilder *)__pyx_v_self->__pyx_vtab)->init(__pyx_v_self, __pyx_v_field, 1, &__pyx_t_2);
|
|
} catch(...) {
|
|
try { throw; } catch(const std::exception& exn) { PyErr_SetString(__pyx_builtin_ValueError, exn.what()); } catch(...) { PyErr_SetNone(__pyx_builtin_ValueError); }
|
|
{__pyx_filename = __pyx_f[0]; __pyx_lineno = 391; __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("capnp._DynamicUnionBuilder.init", __pyx_clineno, __pyx_lineno, __pyx_filename);
|
|
__pyx_r = NULL;
|
|
__pyx_L0:;
|
|
__Pyx_XGIVEREF(__pyx_r);
|
|
__Pyx_RefNannyFinishContext();
|
|
return __pyx_r;
|
|
}
|
|
|
|
/* "capnp.pyx":399
|
|
* cdef class _CodeGeneratorRequestReader:
|
|
* cdef C_CodeGeneratorRequest.Reader thisptr
|
|
* cdef _init(self, C_CodeGeneratorRequest.Reader other): # <<<<<<<<<<<<<<
|
|
* self.thisptr = other
|
|
* return self
|
|
*/
|
|
|
|
static PyObject *__pyx_f_5capnp_27_CodeGeneratorRequestReader__init(struct __pyx_obj_5capnp__CodeGeneratorRequestReader *__pyx_v_self, ::capnp::schema::CodeGeneratorRequest::Reader __pyx_v_other) {
|
|
PyObject *__pyx_r = NULL;
|
|
__Pyx_RefNannyDeclarations
|
|
__Pyx_RefNannySetupContext("_init", 0);
|
|
|
|
/* "capnp.pyx":400
|
|
* cdef C_CodeGeneratorRequest.Reader thisptr
|
|
* cdef _init(self, C_CodeGeneratorRequest.Reader other):
|
|
* self.thisptr = other # <<<<<<<<<<<<<<
|
|
* return self
|
|
*
|
|
*/
|
|
__pyx_v_self->thisptr = __pyx_v_other;
|
|
|
|
/* "capnp.pyx":401
|
|
* cdef _init(self, C_CodeGeneratorRequest.Reader other):
|
|
* self.thisptr = other
|
|
* return self # <<<<<<<<<<<<<<
|
|
*
|
|
* property nodes:
|
|
*/
|
|
__Pyx_XDECREF(__pyx_r);
|
|
__Pyx_INCREF(((PyObject *)__pyx_v_self));
|
|
__pyx_r = ((PyObject *)__pyx_v_self);
|
|
goto __pyx_L0;
|
|
|
|
__pyx_r = Py_None; __Pyx_INCREF(Py_None);
|
|
__pyx_L0:;
|
|
__Pyx_XGIVEREF(__pyx_r);
|
|
__Pyx_RefNannyFinishContext();
|
|
return __pyx_r;
|
|
}
|
|
|
|
/* Python wrapper */
|
|
static PyObject *__pyx_pw_5capnp_27_CodeGeneratorRequestReader_5nodes_1__get__(PyObject *__pyx_v_self); /*proto*/
|
|
static PyObject *__pyx_pw_5capnp_27_CodeGeneratorRequestReader_5nodes_1__get__(PyObject *__pyx_v_self) {
|
|
PyObject *__pyx_r = 0;
|
|
__Pyx_RefNannyDeclarations
|
|
__Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
|
|
__pyx_r = __pyx_pf_5capnp_27_CodeGeneratorRequestReader_5nodes___get__(((struct __pyx_obj_5capnp__CodeGeneratorRequestReader *)__pyx_v_self));
|
|
__Pyx_RefNannyFinishContext();
|
|
return __pyx_r;
|
|
}
|
|
|
|
/* "capnp.pyx":404
|
|
*
|
|
* property nodes:
|
|
* def __get__(self): # <<<<<<<<<<<<<<
|
|
* return _List_Node_Reader()._init(self.thisptr.getNodes())
|
|
* property requestedFiles:
|
|
*/
|
|
|
|
static PyObject *__pyx_pf_5capnp_27_CodeGeneratorRequestReader_5nodes___get__(struct __pyx_obj_5capnp__CodeGeneratorRequestReader *__pyx_v_self) {
|
|
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("__get__", 0);
|
|
|
|
/* "capnp.pyx":405
|
|
* property nodes:
|
|
* def __get__(self):
|
|
* return _List_Node_Reader()._init(self.thisptr.getNodes()) # <<<<<<<<<<<<<<
|
|
* property requestedFiles:
|
|
* def __get__(self):
|
|
*/
|
|
__Pyx_XDECREF(__pyx_r);
|
|
__pyx_t_1 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_5capnp__List_Node_Reader)), ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 405; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
|
|
__Pyx_GOTREF(__pyx_t_1);
|
|
__pyx_t_2 = ((struct __pyx_vtabstruct_5capnp__List_Node_Reader *)((struct __pyx_obj_5capnp__List_Node_Reader *)__pyx_t_1)->__pyx_vtab)->_init(((struct __pyx_obj_5capnp__List_Node_Reader *)__pyx_t_1), __pyx_v_self->thisptr.getNodes()); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 405; __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;
|
|
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("capnp._CodeGeneratorRequestReader.nodes.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
|
|
__pyx_r = NULL;
|
|
__pyx_L0:;
|
|
__Pyx_XGIVEREF(__pyx_r);
|
|
__Pyx_RefNannyFinishContext();
|
|
return __pyx_r;
|
|
}
|
|
|
|
/* Python wrapper */
|
|
static PyObject *__pyx_pw_5capnp_27_CodeGeneratorRequestReader_14requestedFiles_1__get__(PyObject *__pyx_v_self); /*proto*/
|
|
static PyObject *__pyx_pw_5capnp_27_CodeGeneratorRequestReader_14requestedFiles_1__get__(PyObject *__pyx_v_self) {
|
|
PyObject *__pyx_r = 0;
|
|
__Pyx_RefNannyDeclarations
|
|
__Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
|
|
__pyx_r = __pyx_pf_5capnp_27_CodeGeneratorRequestReader_14requestedFiles___get__(((struct __pyx_obj_5capnp__CodeGeneratorRequestReader *)__pyx_v_self));
|
|
__Pyx_RefNannyFinishContext();
|
|
return __pyx_r;
|
|
}
|
|
|
|
/* "capnp.pyx":407
|
|
* return _List_Node_Reader()._init(self.thisptr.getNodes())
|
|
* property requestedFiles:
|
|
* def __get__(self): # <<<<<<<<<<<<<<
|
|
* return _List_UInt64_Reader()._init(self.thisptr.getRequestedFiles())
|
|
*
|
|
*/
|
|
|
|
static PyObject *__pyx_pf_5capnp_27_CodeGeneratorRequestReader_14requestedFiles___get__(struct __pyx_obj_5capnp__CodeGeneratorRequestReader *__pyx_v_self) {
|
|
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("__get__", 0);
|
|
|
|
/* "capnp.pyx":408
|
|
* property requestedFiles:
|
|
* def __get__(self):
|
|
* return _List_UInt64_Reader()._init(self.thisptr.getRequestedFiles()) # <<<<<<<<<<<<<<
|
|
*
|
|
* cdef class Schema:
|
|
*/
|
|
__Pyx_XDECREF(__pyx_r);
|
|
__pyx_t_1 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_5capnp__List_UInt64_Reader)), ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 408; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
|
|
__Pyx_GOTREF(__pyx_t_1);
|
|
__pyx_t_2 = ((struct __pyx_vtabstruct_5capnp__List_UInt64_Reader *)((struct __pyx_obj_5capnp__List_UInt64_Reader *)__pyx_t_1)->__pyx_vtab)->_init(((struct __pyx_obj_5capnp__List_UInt64_Reader *)__pyx_t_1), __pyx_v_self->thisptr.getRequestedFiles()); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 408; __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;
|
|
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("capnp._CodeGeneratorRequestReader.requestedFiles.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
|
|
__pyx_r = NULL;
|
|
__pyx_L0:;
|
|
__Pyx_XGIVEREF(__pyx_r);
|
|
__Pyx_RefNannyFinishContext();
|
|
return __pyx_r;
|
|
}
|
|
|
|
/* "capnp.pyx":412
|
|
* cdef class Schema:
|
|
* cdef C_Schema thisptr
|
|
* cdef _init(self, C_Schema other): # <<<<<<<<<<<<<<
|
|
* self.thisptr = other
|
|
* return self
|
|
*/
|
|
|
|
static PyObject *__pyx_f_5capnp_6Schema__init(struct __pyx_obj_5capnp_Schema *__pyx_v_self, ::capnp::Schema __pyx_v_other) {
|
|
PyObject *__pyx_r = NULL;
|
|
__Pyx_RefNannyDeclarations
|
|
__Pyx_RefNannySetupContext("_init", 0);
|
|
|
|
/* "capnp.pyx":413
|
|
* cdef C_Schema thisptr
|
|
* cdef _init(self, C_Schema other):
|
|
* self.thisptr = other # <<<<<<<<<<<<<<
|
|
* return self
|
|
*
|
|
*/
|
|
__pyx_v_self->thisptr = __pyx_v_other;
|
|
|
|
/* "capnp.pyx":414
|
|
* cdef _init(self, C_Schema other):
|
|
* self.thisptr = other
|
|
* return self # <<<<<<<<<<<<<<
|
|
*
|
|
* cpdef asStruct(self):
|
|
*/
|
|
__Pyx_XDECREF(__pyx_r);
|
|
__Pyx_INCREF(((PyObject *)__pyx_v_self));
|
|
__pyx_r = ((PyObject *)__pyx_v_self);
|
|
goto __pyx_L0;
|
|
|
|
__pyx_r = Py_None; __Pyx_INCREF(Py_None);
|
|
__pyx_L0:;
|
|
__Pyx_XGIVEREF(__pyx_r);
|
|
__Pyx_RefNannyFinishContext();
|
|
return __pyx_r;
|
|
}
|
|
|
|
/* "capnp.pyx":416
|
|
* return self
|
|
*
|
|
* cpdef asStruct(self): # <<<<<<<<<<<<<<
|
|
* return StructSchema()._init(self.thisptr.asStruct())
|
|
*
|
|
*/
|
|
|
|
static PyObject *__pyx_pw_5capnp_6Schema_1asStruct(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
|
|
static PyObject *__pyx_f_5capnp_6Schema_asStruct(struct __pyx_obj_5capnp_Schema *__pyx_v_self, int __pyx_skip_dispatch) {
|
|
PyObject *__pyx_r = NULL;
|
|
__Pyx_RefNannyDeclarations
|
|
PyObject *__pyx_t_1 = NULL;
|
|
PyObject *__pyx_t_2 = NULL;
|
|
::capnp::StructSchema __pyx_t_3;
|
|
int __pyx_lineno = 0;
|
|
const char *__pyx_filename = NULL;
|
|
int __pyx_clineno = 0;
|
|
__Pyx_RefNannySetupContext("asStruct", 0);
|
|
/* Check if called by wrapper */
|
|
if (unlikely(__pyx_skip_dispatch)) ;
|
|
/* Check if overridden in Python */
|
|
else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
|
|
__pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s__asStruct); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 416; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
|
|
__Pyx_GOTREF(__pyx_t_1);
|
|
if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_5capnp_6Schema_1asStruct)) {
|
|
__Pyx_XDECREF(__pyx_r);
|
|
__pyx_t_2 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 416; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
|
|
__Pyx_GOTREF(__pyx_t_2);
|
|
__pyx_r = __pyx_t_2;
|
|
__pyx_t_2 = 0;
|
|
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
|
|
goto __pyx_L0;
|
|
}
|
|
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
|
|
}
|
|
|
|
/* "capnp.pyx":417
|
|
*
|
|
* cpdef asStruct(self):
|
|
* return StructSchema()._init(self.thisptr.asStruct()) # <<<<<<<<<<<<<<
|
|
*
|
|
* cpdef getDependency(self, id):
|
|
*/
|
|
__Pyx_XDECREF(__pyx_r);
|
|
__pyx_t_1 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_5capnp_StructSchema)), ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 417; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
|
|
__Pyx_GOTREF(__pyx_t_1);
|
|
try {
|
|
__pyx_t_3 = __pyx_v_self->thisptr.asStruct();
|
|
} catch(...) {
|
|
__Pyx_CppExn2PyErr();
|
|
{__pyx_filename = __pyx_f[0]; __pyx_lineno = 417; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
|
|
}
|
|
__pyx_t_2 = ((struct __pyx_vtabstruct_5capnp_StructSchema *)((struct __pyx_obj_5capnp_StructSchema *)__pyx_t_1)->__pyx_vtab)->_init(((struct __pyx_obj_5capnp_StructSchema *)__pyx_t_1), __pyx_t_3); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 417; __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;
|
|
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("capnp.Schema.asStruct", __pyx_clineno, __pyx_lineno, __pyx_filename);
|
|
__pyx_r = 0;
|
|
__pyx_L0:;
|
|
__Pyx_XGIVEREF(__pyx_r);
|
|
__Pyx_RefNannyFinishContext();
|
|
return __pyx_r;
|
|
}
|
|
|
|
/* Python wrapper */
|
|
static PyObject *__pyx_pw_5capnp_6Schema_1asStruct(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
|
|
static PyObject *__pyx_pw_5capnp_6Schema_1asStruct(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
|
|
PyObject *__pyx_r = 0;
|
|
__Pyx_RefNannyDeclarations
|
|
__Pyx_RefNannySetupContext("asStruct (wrapper)", 0);
|
|
__pyx_r = __pyx_pf_5capnp_6Schema_asStruct(((struct __pyx_obj_5capnp_Schema *)__pyx_v_self));
|
|
__Pyx_RefNannyFinishContext();
|
|
return __pyx_r;
|
|
}
|
|
|
|
/* "capnp.pyx":416
|
|
* return self
|
|
*
|
|
* cpdef asStruct(self): # <<<<<<<<<<<<<<
|
|
* return StructSchema()._init(self.thisptr.asStruct())
|
|
*
|
|
*/
|
|
|
|
static PyObject *__pyx_pf_5capnp_6Schema_asStruct(struct __pyx_obj_5capnp_Schema *__pyx_v_self) {
|
|
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("asStruct", 0);
|
|
__Pyx_XDECREF(__pyx_r);
|
|
__pyx_t_1 = ((struct __pyx_vtabstruct_5capnp_Schema *)__pyx_v_self->__pyx_vtab)->asStruct(__pyx_v_self, 1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 416; __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("capnp.Schema.asStruct", __pyx_clineno, __pyx_lineno, __pyx_filename);
|
|
__pyx_r = NULL;
|
|
__pyx_L0:;
|
|
__Pyx_XGIVEREF(__pyx_r);
|
|
__Pyx_RefNannyFinishContext();
|
|
return __pyx_r;
|
|
}
|
|
|
|
/* "capnp.pyx":419
|
|
* return StructSchema()._init(self.thisptr.asStruct())
|
|
*
|
|
* cpdef getDependency(self, id): # <<<<<<<<<<<<<<
|
|
* return Schema()._init(self.thisptr.getDependency(id))
|
|
*
|
|
*/
|
|
|
|
static PyObject *__pyx_pw_5capnp_6Schema_3getDependency(PyObject *__pyx_v_self, PyObject *__pyx_v_id); /*proto*/
|
|
static PyObject *__pyx_f_5capnp_6Schema_getDependency(struct __pyx_obj_5capnp_Schema *__pyx_v_self, PyObject *__pyx_v_id, int __pyx_skip_dispatch) {
|
|
PyObject *__pyx_r = NULL;
|
|
__Pyx_RefNannyDeclarations
|
|
PyObject *__pyx_t_1 = NULL;
|
|
PyObject *__pyx_t_2 = NULL;
|
|
PyObject *__pyx_t_3 = NULL;
|
|
uint64_t __pyx_t_4;
|
|
::capnp::Schema __pyx_t_5;
|
|
int __pyx_lineno = 0;
|
|
const char *__pyx_filename = NULL;
|
|
int __pyx_clineno = 0;
|
|
__Pyx_RefNannySetupContext("getDependency", 0);
|
|
/* Check if called by wrapper */
|
|
if (unlikely(__pyx_skip_dispatch)) ;
|
|
/* Check if overridden in Python */
|
|
else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
|
|
__pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s__getDependency); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 419; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
|
|
__Pyx_GOTREF(__pyx_t_1);
|
|
if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_5capnp_6Schema_3getDependency)) {
|
|
__Pyx_XDECREF(__pyx_r);
|
|
__pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 419; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
|
|
__Pyx_GOTREF(__pyx_t_2);
|
|
__Pyx_INCREF(__pyx_v_id);
|
|
PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_id);
|
|
__Pyx_GIVEREF(__pyx_v_id);
|
|
__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 = 419; __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;
|
|
__pyx_t_3 = 0;
|
|
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
|
|
goto __pyx_L0;
|
|
}
|
|
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
|
|
}
|
|
|
|
/* "capnp.pyx":420
|
|
*
|
|
* cpdef getDependency(self, id):
|
|
* return Schema()._init(self.thisptr.getDependency(id)) # <<<<<<<<<<<<<<
|
|
*
|
|
* cpdef getProto(self):
|
|
*/
|
|
__Pyx_XDECREF(__pyx_r);
|
|
__pyx_t_1 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_5capnp_Schema)), ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 420; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
|
|
__Pyx_GOTREF(__pyx_t_1);
|
|
__pyx_t_4 = __Pyx_PyInt_from_py_uint64_t(__pyx_v_id); if (unlikely((__pyx_t_4 == (uint64_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 420; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
|
|
try {
|
|
__pyx_t_5 = __pyx_v_self->thisptr.getDependency(__pyx_t_4);
|
|
} catch(...) {
|
|
__Pyx_CppExn2PyErr();
|
|
{__pyx_filename = __pyx_f[0]; __pyx_lineno = 420; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
|
|
}
|
|
__pyx_t_3 = ((struct __pyx_vtabstruct_5capnp_Schema *)((struct __pyx_obj_5capnp_Schema *)__pyx_t_1)->__pyx_vtab)->_init(((struct __pyx_obj_5capnp_Schema *)__pyx_t_1), __pyx_t_5); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 420; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
|
|
__Pyx_GOTREF(__pyx_t_3);
|
|
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
|
|
__pyx_r = __pyx_t_3;
|
|
__pyx_t_3 = 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("capnp.Schema.getDependency", __pyx_clineno, __pyx_lineno, __pyx_filename);
|
|
__pyx_r = 0;
|
|
__pyx_L0:;
|
|
__Pyx_XGIVEREF(__pyx_r);
|
|
__Pyx_RefNannyFinishContext();
|
|
return __pyx_r;
|
|
}
|
|
|
|
/* Python wrapper */
|
|
static PyObject *__pyx_pw_5capnp_6Schema_3getDependency(PyObject *__pyx_v_self, PyObject *__pyx_v_id); /*proto*/
|
|
static PyObject *__pyx_pw_5capnp_6Schema_3getDependency(PyObject *__pyx_v_self, PyObject *__pyx_v_id) {
|
|
PyObject *__pyx_r = 0;
|
|
__Pyx_RefNannyDeclarations
|
|
__Pyx_RefNannySetupContext("getDependency (wrapper)", 0);
|
|
__pyx_r = __pyx_pf_5capnp_6Schema_2getDependency(((struct __pyx_obj_5capnp_Schema *)__pyx_v_self), ((PyObject *)__pyx_v_id));
|
|
__Pyx_RefNannyFinishContext();
|
|
return __pyx_r;
|
|
}
|
|
|
|
/* "capnp.pyx":419
|
|
* return StructSchema()._init(self.thisptr.asStruct())
|
|
*
|
|
* cpdef getDependency(self, id): # <<<<<<<<<<<<<<
|
|
* return Schema()._init(self.thisptr.getDependency(id))
|
|
*
|
|
*/
|
|
|
|
static PyObject *__pyx_pf_5capnp_6Schema_2getDependency(struct __pyx_obj_5capnp_Schema *__pyx_v_self, PyObject *__pyx_v_id) {
|
|
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("getDependency", 0);
|
|
__Pyx_XDECREF(__pyx_r);
|
|
__pyx_t_1 = ((struct __pyx_vtabstruct_5capnp_Schema *)__pyx_v_self->__pyx_vtab)->getDependency(__pyx_v_self, __pyx_v_id, 1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 419; __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("capnp.Schema.getDependency", __pyx_clineno, __pyx_lineno, __pyx_filename);
|
|
__pyx_r = NULL;
|
|
__pyx_L0:;
|
|
__Pyx_XGIVEREF(__pyx_r);
|
|
__Pyx_RefNannyFinishContext();
|
|
return __pyx_r;
|
|
}
|
|
|
|
/* "capnp.pyx":422
|
|
* return Schema()._init(self.thisptr.getDependency(id))
|
|
*
|
|
* cpdef getProto(self): # <<<<<<<<<<<<<<
|
|
* return _NodeReader().init(self.thisptr.getProto())
|
|
*
|
|
*/
|
|
|
|
static PyObject *__pyx_pw_5capnp_6Schema_5getProto(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
|
|
static PyObject *__pyx_f_5capnp_6Schema_getProto(struct __pyx_obj_5capnp_Schema *__pyx_v_self, int __pyx_skip_dispatch) {
|
|
PyObject *__pyx_r = NULL;
|
|
__Pyx_RefNannyDeclarations
|
|
PyObject *__pyx_t_1 = NULL;
|
|
PyObject *__pyx_t_2 = NULL;
|
|
::capnp::schema::Node::Reader __pyx_t_3;
|
|
int __pyx_lineno = 0;
|
|
const char *__pyx_filename = NULL;
|
|
int __pyx_clineno = 0;
|
|
__Pyx_RefNannySetupContext("getProto", 0);
|
|
/* Check if called by wrapper */
|
|
if (unlikely(__pyx_skip_dispatch)) ;
|
|
/* Check if overridden in Python */
|
|
else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
|
|
__pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s__getProto); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 422; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
|
|
__Pyx_GOTREF(__pyx_t_1);
|
|
if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_5capnp_6Schema_5getProto)) {
|
|
__Pyx_XDECREF(__pyx_r);
|
|
__pyx_t_2 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 422; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
|
|
__Pyx_GOTREF(__pyx_t_2);
|
|
__pyx_r = __pyx_t_2;
|
|
__pyx_t_2 = 0;
|
|
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
|
|
goto __pyx_L0;
|
|
}
|
|
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
|
|
}
|
|
|
|
/* "capnp.pyx":423
|
|
*
|
|
* cpdef getProto(self):
|
|
* return _NodeReader().init(self.thisptr.getProto()) # <<<<<<<<<<<<<<
|
|
*
|
|
* cdef class StructSchema:
|
|
*/
|
|
__Pyx_XDECREF(__pyx_r);
|
|
__pyx_t_1 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_6schema__NodeReader)), ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 423; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
|
|
__Pyx_GOTREF(__pyx_t_1);
|
|
try {
|
|
__pyx_t_3 = __pyx_v_self->thisptr.getProto();
|
|
} catch(...) {
|
|
__Pyx_CppExn2PyErr();
|
|
{__pyx_filename = __pyx_f[0]; __pyx_lineno = 423; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
|
|
}
|
|
__pyx_t_2 = ((struct __pyx_vtabstruct_6schema__NodeReader *)((struct __pyx_obj_6schema__NodeReader *)__pyx_t_1)->__pyx_vtab)->init(((struct __pyx_obj_6schema__NodeReader *)__pyx_t_1), __pyx_t_3); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 423; __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;
|
|
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("capnp.Schema.getProto", __pyx_clineno, __pyx_lineno, __pyx_filename);
|
|
__pyx_r = 0;
|
|
__pyx_L0:;
|
|
__Pyx_XGIVEREF(__pyx_r);
|
|
__Pyx_RefNannyFinishContext();
|
|
return __pyx_r;
|
|
}
|
|
|
|
/* Python wrapper */
|
|
static PyObject *__pyx_pw_5capnp_6Schema_5getProto(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
|
|
static PyObject *__pyx_pw_5capnp_6Schema_5getProto(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
|
|
PyObject *__pyx_r = 0;
|
|
__Pyx_RefNannyDeclarations
|
|
__Pyx_RefNannySetupContext("getProto (wrapper)", 0);
|
|
__pyx_r = __pyx_pf_5capnp_6Schema_4getProto(((struct __pyx_obj_5capnp_Schema *)__pyx_v_self));
|
|
__Pyx_RefNannyFinishContext();
|
|
return __pyx_r;
|
|
}
|
|
|
|
/* "capnp.pyx":422
|
|
* return Schema()._init(self.thisptr.getDependency(id))
|
|
*
|
|
* cpdef getProto(self): # <<<<<<<<<<<<<<
|
|
* return _NodeReader().init(self.thisptr.getProto())
|
|
*
|
|
*/
|
|
|
|
static PyObject *__pyx_pf_5capnp_6Schema_4getProto(struct __pyx_obj_5capnp_Schema *__pyx_v_self) {
|
|
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("getProto", 0);
|
|
__Pyx_XDECREF(__pyx_r);
|
|
__pyx_t_1 = ((struct __pyx_vtabstruct_5capnp_Schema *)__pyx_v_self->__pyx_vtab)->getProto(__pyx_v_self, 1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 422; __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("capnp.Schema.getProto", __pyx_clineno, __pyx_lineno, __pyx_filename);
|
|
__pyx_r = NULL;
|
|
__pyx_L0:;
|
|
__Pyx_XGIVEREF(__pyx_r);
|
|
__Pyx_RefNannyFinishContext();
|
|
return __pyx_r;
|
|
}
|
|
|
|
/* "capnp.pyx":427
|
|
* cdef class StructSchema:
|
|
* cdef C_StructSchema thisptr
|
|
* cdef _init(self, C_StructSchema other): # <<<<<<<<<<<<<<
|
|
* self.thisptr = other
|
|
* return self
|
|
*/
|
|
|
|
static PyObject *__pyx_f_5capnp_12StructSchema__init(struct __pyx_obj_5capnp_StructSchema *__pyx_v_self, ::capnp::StructSchema __pyx_v_other) {
|
|
PyObject *__pyx_r = NULL;
|
|
__Pyx_RefNannyDeclarations
|
|
__Pyx_RefNannySetupContext("_init", 0);
|
|
|
|
/* "capnp.pyx":428
|
|
* cdef C_StructSchema thisptr
|
|
* cdef _init(self, C_StructSchema other):
|
|
* self.thisptr = other # <<<<<<<<<<<<<<
|
|
* return self
|
|
*
|
|
*/
|
|
__pyx_v_self->thisptr = __pyx_v_other;
|
|
|
|
/* "capnp.pyx":429
|
|
* cdef _init(self, C_StructSchema other):
|
|
* self.thisptr = other
|
|
* return self # <<<<<<<<<<<<<<
|
|
*
|
|
* cdef class SchemaLoader:
|
|
*/
|
|
__Pyx_XDECREF(__pyx_r);
|
|
__Pyx_INCREF(((PyObject *)__pyx_v_self));
|
|
__pyx_r = ((PyObject *)__pyx_v_self);
|
|
goto __pyx_L0;
|
|
|
|
__pyx_r = Py_None; __Pyx_INCREF(Py_None);
|
|
__pyx_L0:;
|
|
__Pyx_XGIVEREF(__pyx_r);
|
|
__Pyx_RefNannyFinishContext();
|
|
return __pyx_r;
|
|
}
|
|
|
|
/* Python wrapper */
|
|
static int __pyx_pw_5capnp_12SchemaLoader_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
|
|
static int __pyx_pw_5capnp_12SchemaLoader_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
|
|
int __pyx_r;
|
|
__Pyx_RefNannyDeclarations
|
|
__Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0);
|
|
if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) {
|
|
__Pyx_RaiseArgtupleInvalid("__cinit__", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return -1;}
|
|
if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__cinit__", 0))) return -1;
|
|
__pyx_r = __pyx_pf_5capnp_12SchemaLoader___cinit__(((struct __pyx_obj_5capnp_SchemaLoader *)__pyx_v_self));
|
|
__Pyx_RefNannyFinishContext();
|
|
return __pyx_r;
|
|
}
|
|
|
|
/* "capnp.pyx":433
|
|
* cdef class SchemaLoader:
|
|
* cdef C_SchemaLoader * thisptr
|
|
* def __cinit__(self): # <<<<<<<<<<<<<<
|
|
* self.thisptr = new C_SchemaLoader()
|
|
*
|
|
*/
|
|
|
|
static int __pyx_pf_5capnp_12SchemaLoader___cinit__(struct __pyx_obj_5capnp_SchemaLoader *__pyx_v_self) {
|
|
int __pyx_r;
|
|
__Pyx_RefNannyDeclarations
|
|
__Pyx_RefNannySetupContext("__cinit__", 0);
|
|
|
|
/* "capnp.pyx":434
|
|
* cdef C_SchemaLoader * thisptr
|
|
* def __cinit__(self):
|
|
* self.thisptr = new C_SchemaLoader() # <<<<<<<<<<<<<<
|
|
*
|
|
* def __dealloc__(self):
|
|
*/
|
|
__pyx_v_self->thisptr = new ::capnp::SchemaLoader();
|
|
|
|
__pyx_r = 0;
|
|
__Pyx_RefNannyFinishContext();
|
|
return __pyx_r;
|
|
}
|
|
|
|
/* Python wrapper */
|
|
static void __pyx_pw_5capnp_12SchemaLoader_3__dealloc__(PyObject *__pyx_v_self); /*proto*/
|
|
static void __pyx_pw_5capnp_12SchemaLoader_3__dealloc__(PyObject *__pyx_v_self) {
|
|
__Pyx_RefNannyDeclarations
|
|
__Pyx_RefNannySetupContext("__dealloc__ (wrapper)", 0);
|
|
__pyx_pf_5capnp_12SchemaLoader_2__dealloc__(((struct __pyx_obj_5capnp_SchemaLoader *)__pyx_v_self));
|
|
__Pyx_RefNannyFinishContext();
|
|
}
|
|
|
|
/* "capnp.pyx":436
|
|
* self.thisptr = new C_SchemaLoader()
|
|
*
|
|
* def __dealloc__(self): # <<<<<<<<<<<<<<
|
|
* del self.thisptr
|
|
*
|
|
*/
|
|
|
|
static void __pyx_pf_5capnp_12SchemaLoader_2__dealloc__(CYTHON_UNUSED struct __pyx_obj_5capnp_SchemaLoader *__pyx_v_self) {
|
|
__Pyx_RefNannyDeclarations
|
|
__Pyx_RefNannySetupContext("__dealloc__", 0);
|
|
|
|
/* "capnp.pyx":437
|
|
*
|
|
* def __dealloc__(self):
|
|
* del self.thisptr # <<<<<<<<<<<<<<
|
|
*
|
|
* cpdef load(self, _NodeReader node):
|
|
*/
|
|
delete __pyx_v_self->thisptr;
|
|
|
|
__Pyx_RefNannyFinishContext();
|
|
}
|
|
|
|
/* "capnp.pyx":439
|
|
* del self.thisptr
|
|
*
|
|
* cpdef load(self, _NodeReader node): # <<<<<<<<<<<<<<
|
|
* return Schema()._init(self.thisptr.load(node.thisptr))
|
|
*
|
|
*/
|
|
|
|
static PyObject *__pyx_pw_5capnp_12SchemaLoader_5load(PyObject *__pyx_v_self, PyObject *__pyx_v_node); /*proto*/
|
|
static PyObject *__pyx_f_5capnp_12SchemaLoader_load(struct __pyx_obj_5capnp_SchemaLoader *__pyx_v_self, struct __pyx_obj_6schema__NodeReader *__pyx_v_node, int __pyx_skip_dispatch) {
|
|
PyObject *__pyx_r = NULL;
|
|
__Pyx_RefNannyDeclarations
|
|
PyObject *__pyx_t_1 = NULL;
|
|
PyObject *__pyx_t_2 = NULL;
|
|
PyObject *__pyx_t_3 = NULL;
|
|
::capnp::Schema __pyx_t_4;
|
|
int __pyx_lineno = 0;
|
|
const char *__pyx_filename = NULL;
|
|
int __pyx_clineno = 0;
|
|
__Pyx_RefNannySetupContext("load", 0);
|
|
/* Check if called by wrapper */
|
|
if (unlikely(__pyx_skip_dispatch)) ;
|
|
/* Check if overridden in Python */
|
|
else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
|
|
__pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s__load); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 439; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
|
|
__Pyx_GOTREF(__pyx_t_1);
|
|
if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_5capnp_12SchemaLoader_5load)) {
|
|
__Pyx_XDECREF(__pyx_r);
|
|
__pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 439; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
|
|
__Pyx_GOTREF(__pyx_t_2);
|
|
__Pyx_INCREF(((PyObject *)__pyx_v_node));
|
|
PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_v_node));
|
|
__Pyx_GIVEREF(((PyObject *)__pyx_v_node));
|
|
__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 = 439; __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;
|
|
__pyx_t_3 = 0;
|
|
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
|
|
goto __pyx_L0;
|
|
}
|
|
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
|
|
}
|
|
|
|
/* "capnp.pyx":440
|
|
*
|
|
* cpdef load(self, _NodeReader node):
|
|
* return Schema()._init(self.thisptr.load(node.thisptr)) # <<<<<<<<<<<<<<
|
|
*
|
|
* cpdef get(self, id):
|
|
*/
|
|
__Pyx_XDECREF(__pyx_r);
|
|
__pyx_t_1 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_5capnp_Schema)), ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 440; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
|
|
__Pyx_GOTREF(__pyx_t_1);
|
|
try {
|
|
__pyx_t_4 = __pyx_v_self->thisptr->load(__pyx_v_node->thisptr);
|
|
} catch(...) {
|
|
__Pyx_CppExn2PyErr();
|
|
{__pyx_filename = __pyx_f[0]; __pyx_lineno = 440; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
|
|
}
|
|
__pyx_t_3 = ((struct __pyx_vtabstruct_5capnp_Schema *)((struct __pyx_obj_5capnp_Schema *)__pyx_t_1)->__pyx_vtab)->_init(((struct __pyx_obj_5capnp_Schema *)__pyx_t_1), __pyx_t_4); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 440; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
|
|
__Pyx_GOTREF(__pyx_t_3);
|
|
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
|
|
__pyx_r = __pyx_t_3;
|
|
__pyx_t_3 = 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("capnp.SchemaLoader.load", __pyx_clineno, __pyx_lineno, __pyx_filename);
|
|
__pyx_r = 0;
|
|
__pyx_L0:;
|
|
__Pyx_XGIVEREF(__pyx_r);
|
|
__Pyx_RefNannyFinishContext();
|
|
return __pyx_r;
|
|
}
|
|
|
|
/* Python wrapper */
|
|
static PyObject *__pyx_pw_5capnp_12SchemaLoader_5load(PyObject *__pyx_v_self, PyObject *__pyx_v_node); /*proto*/
|
|
static PyObject *__pyx_pw_5capnp_12SchemaLoader_5load(PyObject *__pyx_v_self, PyObject *__pyx_v_node) {
|
|
CYTHON_UNUSED int __pyx_lineno = 0;
|
|
CYTHON_UNUSED const char *__pyx_filename = NULL;
|
|
CYTHON_UNUSED int __pyx_clineno = 0;
|
|
PyObject *__pyx_r = 0;
|
|
__Pyx_RefNannyDeclarations
|
|
__Pyx_RefNannySetupContext("load (wrapper)", 0);
|
|
if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_node), __pyx_ptype_6schema__NodeReader, 1, "node", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 439; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
|
|
__pyx_r = __pyx_pf_5capnp_12SchemaLoader_4load(((struct __pyx_obj_5capnp_SchemaLoader *)__pyx_v_self), ((struct __pyx_obj_6schema__NodeReader *)__pyx_v_node));
|
|
goto __pyx_L0;
|
|
__pyx_L1_error:;
|
|
__pyx_r = NULL;
|
|
__pyx_L0:;
|
|
__Pyx_RefNannyFinishContext();
|
|
return __pyx_r;
|
|
}
|
|
|
|
/* "capnp.pyx":439
|
|
* del self.thisptr
|
|
*
|
|
* cpdef load(self, _NodeReader node): # <<<<<<<<<<<<<<
|
|
* return Schema()._init(self.thisptr.load(node.thisptr))
|
|
*
|
|
*/
|
|
|
|
static PyObject *__pyx_pf_5capnp_12SchemaLoader_4load(struct __pyx_obj_5capnp_SchemaLoader *__pyx_v_self, struct __pyx_obj_6schema__NodeReader *__pyx_v_node) {
|
|
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("load", 0);
|
|
__Pyx_XDECREF(__pyx_r);
|
|
__pyx_t_1 = ((struct __pyx_vtabstruct_5capnp_SchemaLoader *)__pyx_v_self->__pyx_vtab)->load(__pyx_v_self, __pyx_v_node, 1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 439; __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("capnp.SchemaLoader.load", __pyx_clineno, __pyx_lineno, __pyx_filename);
|
|
__pyx_r = NULL;
|
|
__pyx_L0:;
|
|
__Pyx_XGIVEREF(__pyx_r);
|
|
__Pyx_RefNannyFinishContext();
|
|
return __pyx_r;
|
|
}
|
|
|
|
/* "capnp.pyx":442
|
|
* return Schema()._init(self.thisptr.load(node.thisptr))
|
|
*
|
|
* cpdef get(self, id): # <<<<<<<<<<<<<<
|
|
* return Schema()._init(self.thisptr.get(id))
|
|
*
|
|
*/
|
|
|
|
static PyObject *__pyx_pw_5capnp_12SchemaLoader_7get(PyObject *__pyx_v_self, PyObject *__pyx_v_id); /*proto*/
|
|
static PyObject *__pyx_f_5capnp_12SchemaLoader_get(struct __pyx_obj_5capnp_SchemaLoader *__pyx_v_self, PyObject *__pyx_v_id, int __pyx_skip_dispatch) {
|
|
PyObject *__pyx_r = NULL;
|
|
__Pyx_RefNannyDeclarations
|
|
PyObject *__pyx_t_1 = NULL;
|
|
PyObject *__pyx_t_2 = NULL;
|
|
PyObject *__pyx_t_3 = NULL;
|
|
uint64_t __pyx_t_4;
|
|
::capnp::Schema __pyx_t_5;
|
|
int __pyx_lineno = 0;
|
|
const char *__pyx_filename = NULL;
|
|
int __pyx_clineno = 0;
|
|
__Pyx_RefNannySetupContext("get", 0);
|
|
/* Check if called by wrapper */
|
|
if (unlikely(__pyx_skip_dispatch)) ;
|
|
/* Check if overridden in Python */
|
|
else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
|
|
__pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s__get); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 442; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
|
|
__Pyx_GOTREF(__pyx_t_1);
|
|
if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_5capnp_12SchemaLoader_7get)) {
|
|
__Pyx_XDECREF(__pyx_r);
|
|
__pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 442; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
|
|
__Pyx_GOTREF(__pyx_t_2);
|
|
__Pyx_INCREF(__pyx_v_id);
|
|
PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_id);
|
|
__Pyx_GIVEREF(__pyx_v_id);
|
|
__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 = 442; __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;
|
|
__pyx_t_3 = 0;
|
|
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
|
|
goto __pyx_L0;
|
|
}
|
|
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
|
|
}
|
|
|
|
/* "capnp.pyx":443
|
|
*
|
|
* cpdef get(self, id):
|
|
* return Schema()._init(self.thisptr.get(id)) # <<<<<<<<<<<<<<
|
|
*
|
|
* cdef class MessageBuilder:
|
|
*/
|
|
__Pyx_XDECREF(__pyx_r);
|
|
__pyx_t_1 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_5capnp_Schema)), ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 443; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
|
|
__Pyx_GOTREF(__pyx_t_1);
|
|
__pyx_t_4 = __Pyx_PyInt_from_py_uint64_t(__pyx_v_id); if (unlikely((__pyx_t_4 == (uint64_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 443; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
|
|
try {
|
|
__pyx_t_5 = __pyx_v_self->thisptr->get(__pyx_t_4);
|
|
} catch(...) {
|
|
__Pyx_CppExn2PyErr();
|
|
{__pyx_filename = __pyx_f[0]; __pyx_lineno = 443; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
|
|
}
|
|
__pyx_t_3 = ((struct __pyx_vtabstruct_5capnp_Schema *)((struct __pyx_obj_5capnp_Schema *)__pyx_t_1)->__pyx_vtab)->_init(((struct __pyx_obj_5capnp_Schema *)__pyx_t_1), __pyx_t_5); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 443; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
|
|
__Pyx_GOTREF(__pyx_t_3);
|
|
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
|
|
__pyx_r = __pyx_t_3;
|
|
__pyx_t_3 = 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("capnp.SchemaLoader.get", __pyx_clineno, __pyx_lineno, __pyx_filename);
|
|
__pyx_r = 0;
|
|
__pyx_L0:;
|
|
__Pyx_XGIVEREF(__pyx_r);
|
|
__Pyx_RefNannyFinishContext();
|
|
return __pyx_r;
|
|
}
|
|
|
|
/* Python wrapper */
|
|
static PyObject *__pyx_pw_5capnp_12SchemaLoader_7get(PyObject *__pyx_v_self, PyObject *__pyx_v_id); /*proto*/
|
|
static PyObject *__pyx_pw_5capnp_12SchemaLoader_7get(PyObject *__pyx_v_self, PyObject *__pyx_v_id) {
|
|
PyObject *__pyx_r = 0;
|
|
__Pyx_RefNannyDeclarations
|
|
__Pyx_RefNannySetupContext("get (wrapper)", 0);
|
|
__pyx_r = __pyx_pf_5capnp_12SchemaLoader_6get(((struct __pyx_obj_5capnp_SchemaLoader *)__pyx_v_self), ((PyObject *)__pyx_v_id));
|
|
__Pyx_RefNannyFinishContext();
|
|
return __pyx_r;
|
|
}
|
|
|
|
/* "capnp.pyx":442
|
|
* return Schema()._init(self.thisptr.load(node.thisptr))
|
|
*
|
|
* cpdef get(self, id): # <<<<<<<<<<<<<<
|
|
* return Schema()._init(self.thisptr.get(id))
|
|
*
|
|
*/
|
|
|
|
static PyObject *__pyx_pf_5capnp_12SchemaLoader_6get(struct __pyx_obj_5capnp_SchemaLoader *__pyx_v_self, PyObject *__pyx_v_id) {
|
|
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("get", 0);
|
|
__Pyx_XDECREF(__pyx_r);
|
|
__pyx_t_1 = ((struct __pyx_vtabstruct_5capnp_SchemaLoader *)__pyx_v_self->__pyx_vtab)->get(__pyx_v_self, __pyx_v_id, 1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 442; __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("capnp.SchemaLoader.get", __pyx_clineno, __pyx_lineno, __pyx_filename);
|
|
__pyx_r = NULL;
|
|
__pyx_L0:;
|
|
__Pyx_XGIVEREF(__pyx_r);
|
|
__Pyx_RefNannyFinishContext();
|
|
return __pyx_r;
|
|
}
|
|
|
|
/* Python wrapper */
|
|
static void __pyx_pw_5capnp_14MessageBuilder_1__dealloc__(PyObject *__pyx_v_self); /*proto*/
|
|
static void __pyx_pw_5capnp_14MessageBuilder_1__dealloc__(PyObject *__pyx_v_self) {
|
|
__Pyx_RefNannyDeclarations
|
|
__Pyx_RefNannySetupContext("__dealloc__ (wrapper)", 0);
|
|
__pyx_pf_5capnp_14MessageBuilder___dealloc__(((struct __pyx_obj_5capnp_MessageBuilder *)__pyx_v_self));
|
|
__Pyx_RefNannyFinishContext();
|
|
}
|
|
|
|
/* "capnp.pyx":447
|
|
* cdef class MessageBuilder:
|
|
* cdef schema_cpp.MessageBuilder * thisptr
|
|
* def __dealloc__(self): # <<<<<<<<<<<<<<
|
|
* del self.thisptr
|
|
* cpdef initRoot(self, schema):
|
|
*/
|
|
|
|
static void __pyx_pf_5capnp_14MessageBuilder___dealloc__(CYTHON_UNUSED struct __pyx_obj_5capnp_MessageBuilder *__pyx_v_self) {
|
|
__Pyx_RefNannyDeclarations
|
|
__Pyx_RefNannySetupContext("__dealloc__", 0);
|
|
|
|
/* "capnp.pyx":448
|
|
* cdef schema_cpp.MessageBuilder * thisptr
|
|
* def __dealloc__(self):
|
|
* del self.thisptr # <<<<<<<<<<<<<<
|
|
* cpdef initRoot(self, schema):
|
|
* cdef StructSchema s
|
|
*/
|
|
delete __pyx_v_self->thisptr;
|
|
|
|
__Pyx_RefNannyFinishContext();
|
|
}
|
|
|
|
/* "capnp.pyx":449
|
|
* def __dealloc__(self):
|
|
* del self.thisptr
|
|
* cpdef initRoot(self, schema): # <<<<<<<<<<<<<<
|
|
* cdef StructSchema s
|
|
* if hasattr(schema, 'Schema'):
|
|
*/
|
|
|
|
static PyObject *__pyx_pw_5capnp_14MessageBuilder_3initRoot(PyObject *__pyx_v_self, PyObject *__pyx_v_schema); /*proto*/
|
|
static PyObject *__pyx_f_5capnp_14MessageBuilder_initRoot(struct __pyx_obj_5capnp_MessageBuilder *__pyx_v_self, PyObject *__pyx_v_schema, int __pyx_skip_dispatch) {
|
|
struct __pyx_obj_5capnp_StructSchema *__pyx_v_s = 0;
|
|
PyObject *__pyx_r = NULL;
|
|
__Pyx_RefNannyDeclarations
|
|
PyObject *__pyx_t_1 = NULL;
|
|
PyObject *__pyx_t_2 = NULL;
|
|
PyObject *__pyx_t_3 = NULL;
|
|
int __pyx_t_4;
|
|
int __pyx_t_5;
|
|
int __pyx_lineno = 0;
|
|
const char *__pyx_filename = NULL;
|
|
int __pyx_clineno = 0;
|
|
__Pyx_RefNannySetupContext("initRoot", 0);
|
|
/* Check if called by wrapper */
|
|
if (unlikely(__pyx_skip_dispatch)) ;
|
|
/* Check if overridden in Python */
|
|
else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
|
|
__pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s__initRoot); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 449; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
|
|
__Pyx_GOTREF(__pyx_t_1);
|
|
if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_5capnp_14MessageBuilder_3initRoot)) {
|
|
__Pyx_XDECREF(__pyx_r);
|
|
__pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 449; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
|
|
__Pyx_GOTREF(__pyx_t_2);
|
|
__Pyx_INCREF(__pyx_v_schema);
|
|
PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_schema);
|
|
__Pyx_GIVEREF(__pyx_v_schema);
|
|
__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 = 449; __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;
|
|
__pyx_t_3 = 0;
|
|
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
|
|
goto __pyx_L0;
|
|
}
|
|
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
|
|
}
|
|
|
|
/* "capnp.pyx":451
|
|
* cpdef initRoot(self, schema):
|
|
* cdef StructSchema s
|
|
* if hasattr(schema, 'Schema'): # <<<<<<<<<<<<<<
|
|
* s = schema.Schema
|
|
* else:
|
|
*/
|
|
__pyx_t_4 = PyObject_HasAttr(__pyx_v_schema, ((PyObject *)__pyx_n_s__Schema)); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 451; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
|
|
__pyx_t_5 = (__pyx_t_4 != 0);
|
|
if (__pyx_t_5) {
|
|
|
|
/* "capnp.pyx":452
|
|
* cdef StructSchema s
|
|
* if hasattr(schema, 'Schema'):
|
|
* s = schema.Schema # <<<<<<<<<<<<<<
|
|
* else:
|
|
* s = schema
|
|
*/
|
|
__pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_schema, __pyx_n_s__Schema); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 452; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
|
|
__Pyx_GOTREF(__pyx_t_1);
|
|
if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5capnp_StructSchema))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 452; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
|
|
__pyx_v_s = ((struct __pyx_obj_5capnp_StructSchema *)__pyx_t_1);
|
|
__pyx_t_1 = 0;
|
|
goto __pyx_L3;
|
|
}
|
|
/*else*/ {
|
|
|
|
/* "capnp.pyx":454
|
|
* s = schema.Schema
|
|
* else:
|
|
* s = schema # <<<<<<<<<<<<<<
|
|
* return _DynamicStructBuilder()._init(self.thisptr.initRootDynamicStruct(s.thisptr))
|
|
* cpdef getRoot(self, schema):
|
|
*/
|
|
if (!(likely(((__pyx_v_schema) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_schema, __pyx_ptype_5capnp_StructSchema))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 454; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
|
|
__Pyx_INCREF(__pyx_v_schema);
|
|
__pyx_v_s = ((struct __pyx_obj_5capnp_StructSchema *)__pyx_v_schema);
|
|
}
|
|
__pyx_L3:;
|
|
|
|
/* "capnp.pyx":455
|
|
* else:
|
|
* s = schema
|
|
* return _DynamicStructBuilder()._init(self.thisptr.initRootDynamicStruct(s.thisptr)) # <<<<<<<<<<<<<<
|
|
* cpdef getRoot(self, schema):
|
|
* cdef StructSchema s
|
|
*/
|
|
__Pyx_XDECREF(__pyx_r);
|
|
__pyx_t_1 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_5capnp__DynamicStructBuilder)), ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 455; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
|
|
__Pyx_GOTREF(__pyx_t_1);
|
|
__pyx_t_3 = ((struct __pyx_vtabstruct_5capnp__DynamicStructBuilder *)((struct __pyx_obj_5capnp__DynamicStructBuilder *)__pyx_t_1)->__pyx_vtab)->_init(((struct __pyx_obj_5capnp__DynamicStructBuilder *)__pyx_t_1), (( ::capnp::DynamicStruct::Builder)__pyx_v_self->thisptr->initRoot< ::capnp::DynamicStruct>((( ::capnp::StructSchema)__pyx_v_s->thisptr)))); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 455; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
|
|
__Pyx_GOTREF(__pyx_t_3);
|
|
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
|
|
__pyx_r = __pyx_t_3;
|
|
__pyx_t_3 = 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("capnp.MessageBuilder.initRoot", __pyx_clineno, __pyx_lineno, __pyx_filename);
|
|
__pyx_r = 0;
|
|
__pyx_L0:;
|
|
__Pyx_XDECREF((PyObject *)__pyx_v_s);
|
|
__Pyx_XGIVEREF(__pyx_r);
|
|
__Pyx_RefNannyFinishContext();
|
|
return __pyx_r;
|
|
}
|
|
|
|
/* Python wrapper */
|
|
static PyObject *__pyx_pw_5capnp_14MessageBuilder_3initRoot(PyObject *__pyx_v_self, PyObject *__pyx_v_schema); /*proto*/
|
|
static PyObject *__pyx_pw_5capnp_14MessageBuilder_3initRoot(PyObject *__pyx_v_self, PyObject *__pyx_v_schema) {
|
|
PyObject *__pyx_r = 0;
|
|
__Pyx_RefNannyDeclarations
|
|
__Pyx_RefNannySetupContext("initRoot (wrapper)", 0);
|
|
__pyx_r = __pyx_pf_5capnp_14MessageBuilder_2initRoot(((struct __pyx_obj_5capnp_MessageBuilder *)__pyx_v_self), ((PyObject *)__pyx_v_schema));
|
|
__Pyx_RefNannyFinishContext();
|
|
return __pyx_r;
|
|
}
|
|
|
|
/* "capnp.pyx":449
|
|
* def __dealloc__(self):
|
|
* del self.thisptr
|
|
* cpdef initRoot(self, schema): # <<<<<<<<<<<<<<
|
|
* cdef StructSchema s
|
|
* if hasattr(schema, 'Schema'):
|
|
*/
|
|
|
|
static PyObject *__pyx_pf_5capnp_14MessageBuilder_2initRoot(struct __pyx_obj_5capnp_MessageBuilder *__pyx_v_self, PyObject *__pyx_v_schema) {
|
|
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("initRoot", 0);
|
|
__Pyx_XDECREF(__pyx_r);
|
|
__pyx_t_1 = ((struct __pyx_vtabstruct_5capnp_MessageBuilder *)__pyx_v_self->__pyx_vtab)->initRoot(__pyx_v_self, __pyx_v_schema, 1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 449; __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("capnp.MessageBuilder.initRoot", __pyx_clineno, __pyx_lineno, __pyx_filename);
|
|
__pyx_r = NULL;
|
|
__pyx_L0:;
|
|
__Pyx_XGIVEREF(__pyx_r);
|
|
__Pyx_RefNannyFinishContext();
|
|
return __pyx_r;
|
|
}
|
|
|
|
/* "capnp.pyx":456
|
|
* s = schema
|
|
* return _DynamicStructBuilder()._init(self.thisptr.initRootDynamicStruct(s.thisptr))
|
|
* cpdef getRoot(self, schema): # <<<<<<<<<<<<<<
|
|
* cdef StructSchema s
|
|
* if hasattr(schema, 'Schema'):
|
|
*/
|
|
|
|
static PyObject *__pyx_pw_5capnp_14MessageBuilder_5getRoot(PyObject *__pyx_v_self, PyObject *__pyx_v_schema); /*proto*/
|
|
static PyObject *__pyx_f_5capnp_14MessageBuilder_getRoot(struct __pyx_obj_5capnp_MessageBuilder *__pyx_v_self, PyObject *__pyx_v_schema, int __pyx_skip_dispatch) {
|
|
struct __pyx_obj_5capnp_StructSchema *__pyx_v_s = 0;
|
|
PyObject *__pyx_r = NULL;
|
|
__Pyx_RefNannyDeclarations
|
|
PyObject *__pyx_t_1 = NULL;
|
|
PyObject *__pyx_t_2 = NULL;
|
|
PyObject *__pyx_t_3 = NULL;
|
|
int __pyx_t_4;
|
|
int __pyx_t_5;
|
|
int __pyx_lineno = 0;
|
|
const char *__pyx_filename = NULL;
|
|
int __pyx_clineno = 0;
|
|
__Pyx_RefNannySetupContext("getRoot", 0);
|
|
/* Check if called by wrapper */
|
|
if (unlikely(__pyx_skip_dispatch)) ;
|
|
/* Check if overridden in Python */
|
|
else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
|
|
__pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s__getRoot); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 456; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
|
|
__Pyx_GOTREF(__pyx_t_1);
|
|
if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_5capnp_14MessageBuilder_5getRoot)) {
|
|
__Pyx_XDECREF(__pyx_r);
|
|
__pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 456; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
|
|
__Pyx_GOTREF(__pyx_t_2);
|
|
__Pyx_INCREF(__pyx_v_schema);
|
|
PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_schema);
|
|
__Pyx_GIVEREF(__pyx_v_schema);
|
|
__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 = 456; __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;
|
|
__pyx_t_3 = 0;
|
|
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
|
|
goto __pyx_L0;
|
|
}
|
|
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
|
|
}
|
|
|
|
/* "capnp.pyx":458
|
|
* cpdef getRoot(self, schema):
|
|
* cdef StructSchema s
|
|
* if hasattr(schema, 'Schema'): # <<<<<<<<<<<<<<
|
|
* s = schema.Schema
|
|
* else:
|
|
*/
|
|
__pyx_t_4 = PyObject_HasAttr(__pyx_v_schema, ((PyObject *)__pyx_n_s__Schema)); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 458; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
|
|
__pyx_t_5 = (__pyx_t_4 != 0);
|
|
if (__pyx_t_5) {
|
|
|
|
/* "capnp.pyx":459
|
|
* cdef StructSchema s
|
|
* if hasattr(schema, 'Schema'):
|
|
* s = schema.Schema # <<<<<<<<<<<<<<
|
|
* else:
|
|
* s = schema
|
|
*/
|
|
__pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_schema, __pyx_n_s__Schema); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 459; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
|
|
__Pyx_GOTREF(__pyx_t_1);
|
|
if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5capnp_StructSchema))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 459; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
|
|
__pyx_v_s = ((struct __pyx_obj_5capnp_StructSchema *)__pyx_t_1);
|
|
__pyx_t_1 = 0;
|
|
goto __pyx_L3;
|
|
}
|
|
/*else*/ {
|
|
|
|
/* "capnp.pyx":461
|
|
* s = schema.Schema
|
|
* else:
|
|
* s = schema # <<<<<<<<<<<<<<
|
|
* return _DynamicStructBuilder()._init(self.thisptr.getRootDynamicStruct(s.thisptr))
|
|
*
|
|
*/
|
|
if (!(likely(((__pyx_v_schema) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_schema, __pyx_ptype_5capnp_StructSchema))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 461; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
|
|
__Pyx_INCREF(__pyx_v_schema);
|
|
__pyx_v_s = ((struct __pyx_obj_5capnp_StructSchema *)__pyx_v_schema);
|
|
}
|
|
__pyx_L3:;
|
|
|
|
/* "capnp.pyx":462
|
|
* else:
|
|
* s = schema
|
|
* return _DynamicStructBuilder()._init(self.thisptr.getRootDynamicStruct(s.thisptr)) # <<<<<<<<<<<<<<
|
|
*
|
|
* cdef class MallocMessageBuilder(MessageBuilder):
|
|
*/
|
|
__Pyx_XDECREF(__pyx_r);
|
|
__pyx_t_1 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_5capnp__DynamicStructBuilder)), ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 462; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
|
|
__Pyx_GOTREF(__pyx_t_1);
|
|
__pyx_t_3 = ((struct __pyx_vtabstruct_5capnp__DynamicStructBuilder *)((struct __pyx_obj_5capnp__DynamicStructBuilder *)__pyx_t_1)->__pyx_vtab)->_init(((struct __pyx_obj_5capnp__DynamicStructBuilder *)__pyx_t_1), (( ::capnp::DynamicStruct::Builder)__pyx_v_self->thisptr->getRoot< ::capnp::DynamicStruct>((( ::capnp::StructSchema)__pyx_v_s->thisptr)))); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 462; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
|
|
__Pyx_GOTREF(__pyx_t_3);
|
|
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
|
|
__pyx_r = __pyx_t_3;
|
|
__pyx_t_3 = 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("capnp.MessageBuilder.getRoot", __pyx_clineno, __pyx_lineno, __pyx_filename);
|
|
__pyx_r = 0;
|
|
__pyx_L0:;
|
|
__Pyx_XDECREF((PyObject *)__pyx_v_s);
|
|
__Pyx_XGIVEREF(__pyx_r);
|
|
__Pyx_RefNannyFinishContext();
|
|
return __pyx_r;
|
|
}
|
|
|
|
/* Python wrapper */
|
|
static PyObject *__pyx_pw_5capnp_14MessageBuilder_5getRoot(PyObject *__pyx_v_self, PyObject *__pyx_v_schema); /*proto*/
|
|
static PyObject *__pyx_pw_5capnp_14MessageBuilder_5getRoot(PyObject *__pyx_v_self, PyObject *__pyx_v_schema) {
|
|
PyObject *__pyx_r = 0;
|
|
__Pyx_RefNannyDeclarations
|
|
__Pyx_RefNannySetupContext("getRoot (wrapper)", 0);
|
|
__pyx_r = __pyx_pf_5capnp_14MessageBuilder_4getRoot(((struct __pyx_obj_5capnp_MessageBuilder *)__pyx_v_self), ((PyObject *)__pyx_v_schema));
|
|
__Pyx_RefNannyFinishContext();
|
|
return __pyx_r;
|
|
}
|
|
|
|
/* "capnp.pyx":456
|
|
* s = schema
|
|
* return _DynamicStructBuilder()._init(self.thisptr.initRootDynamicStruct(s.thisptr))
|
|
* cpdef getRoot(self, schema): # <<<<<<<<<<<<<<
|
|
* cdef StructSchema s
|
|
* if hasattr(schema, 'Schema'):
|
|
*/
|
|
|
|
static PyObject *__pyx_pf_5capnp_14MessageBuilder_4getRoot(struct __pyx_obj_5capnp_MessageBuilder *__pyx_v_self, PyObject *__pyx_v_schema) {
|
|
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("getRoot", 0);
|
|
__Pyx_XDECREF(__pyx_r);
|
|
__pyx_t_1 = ((struct __pyx_vtabstruct_5capnp_MessageBuilder *)__pyx_v_self->__pyx_vtab)->getRoot(__pyx_v_self, __pyx_v_schema, 1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 456; __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("capnp.MessageBuilder.getRoot", __pyx_clineno, __pyx_lineno, __pyx_filename);
|
|
__pyx_r = NULL;
|
|
__pyx_L0:;
|
|
__Pyx_XGIVEREF(__pyx_r);
|
|
__Pyx_RefNannyFinishContext();
|
|
return __pyx_r;
|
|
}
|
|
|
|
/* Python wrapper */
|
|
static int __pyx_pw_5capnp_20MallocMessageBuilder_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
|
|
static int __pyx_pw_5capnp_20MallocMessageBuilder_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
|
|
int __pyx_r;
|
|
__Pyx_RefNannyDeclarations
|
|
__Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0);
|
|
if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) {
|
|
__Pyx_RaiseArgtupleInvalid("__cinit__", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return -1;}
|
|
if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__cinit__", 0))) return -1;
|
|
__pyx_r = __pyx_pf_5capnp_20MallocMessageBuilder___cinit__(((struct __pyx_obj_5capnp_MallocMessageBuilder *)__pyx_v_self));
|
|
__Pyx_RefNannyFinishContext();
|
|
return __pyx_r;
|
|
}
|
|
|
|
/* "capnp.pyx":465
|
|
*
|
|
* cdef class MallocMessageBuilder(MessageBuilder):
|
|
* def __cinit__(self): # <<<<<<<<<<<<<<
|
|
* self.thisptr = new schema_cpp.MallocMessageBuilder()
|
|
*
|
|
*/
|
|
|
|
static int __pyx_pf_5capnp_20MallocMessageBuilder___cinit__(struct __pyx_obj_5capnp_MallocMessageBuilder *__pyx_v_self) {
|
|
int __pyx_r;
|
|
__Pyx_RefNannyDeclarations
|
|
__Pyx_RefNannySetupContext("__cinit__", 0);
|
|
|
|
/* "capnp.pyx":466
|
|
* cdef class MallocMessageBuilder(MessageBuilder):
|
|
* def __cinit__(self):
|
|
* self.thisptr = new schema_cpp.MallocMessageBuilder() # <<<<<<<<<<<<<<
|
|
*
|
|
* cdef class MessageReader:
|
|
*/
|
|
__pyx_v_self->__pyx_base.thisptr = new ::capnp::MallocMessageBuilder();
|
|
|
|
__pyx_r = 0;
|
|
__Pyx_RefNannyFinishContext();
|
|
return __pyx_r;
|
|
}
|
|
|
|
/* Python wrapper */
|
|
static void __pyx_pw_5capnp_13MessageReader_1__dealloc__(PyObject *__pyx_v_self); /*proto*/
|
|
static void __pyx_pw_5capnp_13MessageReader_1__dealloc__(PyObject *__pyx_v_self) {
|
|
__Pyx_RefNannyDeclarations
|
|
__Pyx_RefNannySetupContext("__dealloc__ (wrapper)", 0);
|
|
__pyx_pf_5capnp_13MessageReader___dealloc__(((struct __pyx_obj_5capnp_MessageReader *)__pyx_v_self));
|
|
__Pyx_RefNannyFinishContext();
|
|
}
|
|
|
|
/* "capnp.pyx":470
|
|
* cdef class MessageReader:
|
|
* cdef schema_cpp.MessageReader * thisptr
|
|
* def __dealloc__(self): # <<<<<<<<<<<<<<
|
|
* del self.thisptr
|
|
* cpdef getRootNode(self):
|
|
*/
|
|
|
|
static void __pyx_pf_5capnp_13MessageReader___dealloc__(CYTHON_UNUSED struct __pyx_obj_5capnp_MessageReader *__pyx_v_self) {
|
|
__Pyx_RefNannyDeclarations
|
|
__Pyx_RefNannySetupContext("__dealloc__", 0);
|
|
|
|
/* "capnp.pyx":471
|
|
* cdef schema_cpp.MessageReader * thisptr
|
|
* def __dealloc__(self):
|
|
* del self.thisptr # <<<<<<<<<<<<<<
|
|
* cpdef getRootNode(self):
|
|
* return _NodeReader().init(self.thisptr.getRootNode())
|
|
*/
|
|
delete __pyx_v_self->thisptr;
|
|
|
|
__Pyx_RefNannyFinishContext();
|
|
}
|
|
|
|
/* "capnp.pyx":472
|
|
* def __dealloc__(self):
|
|
* del self.thisptr
|
|
* cpdef getRootNode(self): # <<<<<<<<<<<<<<
|
|
* return _NodeReader().init(self.thisptr.getRootNode())
|
|
* cpdef getRootCodeGeneratorRequest(self):
|
|
*/
|
|
|
|
static PyObject *__pyx_pw_5capnp_13MessageReader_3getRootNode(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
|
|
static PyObject *__pyx_f_5capnp_13MessageReader_getRootNode(struct __pyx_obj_5capnp_MessageReader *__pyx_v_self, int __pyx_skip_dispatch) {
|
|
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("getRootNode", 0);
|
|
/* Check if called by wrapper */
|
|
if (unlikely(__pyx_skip_dispatch)) ;
|
|
/* Check if overridden in Python */
|
|
else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
|
|
__pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s__getRootNode); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 472; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
|
|
__Pyx_GOTREF(__pyx_t_1);
|
|
if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_5capnp_13MessageReader_3getRootNode)) {
|
|
__Pyx_XDECREF(__pyx_r);
|
|
__pyx_t_2 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 472; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
|
|
__Pyx_GOTREF(__pyx_t_2);
|
|
__pyx_r = __pyx_t_2;
|
|
__pyx_t_2 = 0;
|
|
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
|
|
goto __pyx_L0;
|
|
}
|
|
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
|
|
}
|
|
|
|
/* "capnp.pyx":473
|
|
* del self.thisptr
|
|
* cpdef getRootNode(self):
|
|
* return _NodeReader().init(self.thisptr.getRootNode()) # <<<<<<<<<<<<<<
|
|
* cpdef getRootCodeGeneratorRequest(self):
|
|
* return _CodeGeneratorRequestReader()._init(self.thisptr.getRootCodeGeneratorRequest())
|
|
*/
|
|
__Pyx_XDECREF(__pyx_r);
|
|
__pyx_t_1 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_6schema__NodeReader)), ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 473; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
|
|
__Pyx_GOTREF(__pyx_t_1);
|
|
__pyx_t_2 = ((struct __pyx_vtabstruct_6schema__NodeReader *)((struct __pyx_obj_6schema__NodeReader *)__pyx_t_1)->__pyx_vtab)->init(((struct __pyx_obj_6schema__NodeReader *)__pyx_t_1), __pyx_v_self->thisptr->getRoot< ::capnp::schema::Node>()); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 473; __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;
|
|
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("capnp.MessageReader.getRootNode", __pyx_clineno, __pyx_lineno, __pyx_filename);
|
|
__pyx_r = 0;
|
|
__pyx_L0:;
|
|
__Pyx_XGIVEREF(__pyx_r);
|
|
__Pyx_RefNannyFinishContext();
|
|
return __pyx_r;
|
|
}
|
|
|
|
/* Python wrapper */
|
|
static PyObject *__pyx_pw_5capnp_13MessageReader_3getRootNode(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
|
|
static PyObject *__pyx_pw_5capnp_13MessageReader_3getRootNode(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
|
|
PyObject *__pyx_r = 0;
|
|
__Pyx_RefNannyDeclarations
|
|
__Pyx_RefNannySetupContext("getRootNode (wrapper)", 0);
|
|
__pyx_r = __pyx_pf_5capnp_13MessageReader_2getRootNode(((struct __pyx_obj_5capnp_MessageReader *)__pyx_v_self));
|
|
__Pyx_RefNannyFinishContext();
|
|
return __pyx_r;
|
|
}
|
|
|
|
/* "capnp.pyx":472
|
|
* def __dealloc__(self):
|
|
* del self.thisptr
|
|
* cpdef getRootNode(self): # <<<<<<<<<<<<<<
|
|
* return _NodeReader().init(self.thisptr.getRootNode())
|
|
* cpdef getRootCodeGeneratorRequest(self):
|
|
*/
|
|
|
|
static PyObject *__pyx_pf_5capnp_13MessageReader_2getRootNode(struct __pyx_obj_5capnp_MessageReader *__pyx_v_self) {
|
|
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("getRootNode", 0);
|
|
__Pyx_XDECREF(__pyx_r);
|
|
__pyx_t_1 = ((struct __pyx_vtabstruct_5capnp_MessageReader *)__pyx_v_self->__pyx_vtab)->getRootNode(__pyx_v_self, 1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 472; __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("capnp.MessageReader.getRootNode", __pyx_clineno, __pyx_lineno, __pyx_filename);
|
|
__pyx_r = NULL;
|
|
__pyx_L0:;
|
|
__Pyx_XGIVEREF(__pyx_r);
|
|
__Pyx_RefNannyFinishContext();
|
|
return __pyx_r;
|
|
}
|
|
|
|
/* "capnp.pyx":474
|
|
* cpdef getRootNode(self):
|
|
* return _NodeReader().init(self.thisptr.getRootNode())
|
|
* cpdef getRootCodeGeneratorRequest(self): # <<<<<<<<<<<<<<
|
|
* return _CodeGeneratorRequestReader()._init(self.thisptr.getRootCodeGeneratorRequest())
|
|
* cpdef getRootDynamicStruct(self, StructSchema schema):
|
|
*/
|
|
|
|
static PyObject *__pyx_pw_5capnp_13MessageReader_5getRootCodeGeneratorRequest(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
|
|
static PyObject *__pyx_f_5capnp_13MessageReader_getRootCodeGeneratorRequest(struct __pyx_obj_5capnp_MessageReader *__pyx_v_self, int __pyx_skip_dispatch) {
|
|
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("getRootCodeGeneratorRequest", 0);
|
|
/* Check if called by wrapper */
|
|
if (unlikely(__pyx_skip_dispatch)) ;
|
|
/* Check if overridden in Python */
|
|
else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
|
|
__pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_31); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 474; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
|
|
__Pyx_GOTREF(__pyx_t_1);
|
|
if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_5capnp_13MessageReader_5getRootCodeGeneratorRequest)) {
|
|
__Pyx_XDECREF(__pyx_r);
|
|
__pyx_t_2 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 474; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
|
|
__Pyx_GOTREF(__pyx_t_2);
|
|
__pyx_r = __pyx_t_2;
|
|
__pyx_t_2 = 0;
|
|
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
|
|
goto __pyx_L0;
|
|
}
|
|
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
|
|
}
|
|
|
|
/* "capnp.pyx":475
|
|
* return _NodeReader().init(self.thisptr.getRootNode())
|
|
* cpdef getRootCodeGeneratorRequest(self):
|
|
* return _CodeGeneratorRequestReader()._init(self.thisptr.getRootCodeGeneratorRequest()) # <<<<<<<<<<<<<<
|
|
* cpdef getRootDynamicStruct(self, StructSchema schema):
|
|
* return _DynamicStructReader()._init(self.thisptr.getRootDynamicStruct(schema.thisptr))
|
|
*/
|
|
__Pyx_XDECREF(__pyx_r);
|
|
__pyx_t_1 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_5capnp__CodeGeneratorRequestReader)), ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 475; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
|
|
__Pyx_GOTREF(__pyx_t_1);
|
|
__pyx_t_2 = ((struct __pyx_vtabstruct_5capnp__CodeGeneratorRequestReader *)((struct __pyx_obj_5capnp__CodeGeneratorRequestReader *)__pyx_t_1)->__pyx_vtab)->_init(((struct __pyx_obj_5capnp__CodeGeneratorRequestReader *)__pyx_t_1), __pyx_v_self->thisptr->getRoot< ::capnp::schema::CodeGeneratorRequest>()); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 475; __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;
|
|
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("capnp.MessageReader.getRootCodeGeneratorRequest", __pyx_clineno, __pyx_lineno, __pyx_filename);
|
|
__pyx_r = 0;
|
|
__pyx_L0:;
|
|
__Pyx_XGIVEREF(__pyx_r);
|
|
__Pyx_RefNannyFinishContext();
|
|
return __pyx_r;
|
|
}
|
|
|
|
/* Python wrapper */
|
|
static PyObject *__pyx_pw_5capnp_13MessageReader_5getRootCodeGeneratorRequest(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
|
|
static PyObject *__pyx_pw_5capnp_13MessageReader_5getRootCodeGeneratorRequest(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
|
|
PyObject *__pyx_r = 0;
|
|
__Pyx_RefNannyDeclarations
|
|
__Pyx_RefNannySetupContext("getRootCodeGeneratorRequest (wrapper)", 0);
|
|
__pyx_r = __pyx_pf_5capnp_13MessageReader_4getRootCodeGeneratorRequest(((struct __pyx_obj_5capnp_MessageReader *)__pyx_v_self));
|
|
__Pyx_RefNannyFinishContext();
|
|
return __pyx_r;
|
|
}
|
|
|
|
/* "capnp.pyx":474
|
|
* cpdef getRootNode(self):
|
|
* return _NodeReader().init(self.thisptr.getRootNode())
|
|
* cpdef getRootCodeGeneratorRequest(self): # <<<<<<<<<<<<<<
|
|
* return _CodeGeneratorRequestReader()._init(self.thisptr.getRootCodeGeneratorRequest())
|
|
* cpdef getRootDynamicStruct(self, StructSchema schema):
|
|
*/
|
|
|
|
static PyObject *__pyx_pf_5capnp_13MessageReader_4getRootCodeGeneratorRequest(struct __pyx_obj_5capnp_MessageReader *__pyx_v_self) {
|
|
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("getRootCodeGeneratorRequest", 0);
|
|
__Pyx_XDECREF(__pyx_r);
|
|
__pyx_t_1 = ((struct __pyx_vtabstruct_5capnp_MessageReader *)__pyx_v_self->__pyx_vtab)->getRootCodeGeneratorRequest(__pyx_v_self, 1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 474; __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("capnp.MessageReader.getRootCodeGeneratorRequest", __pyx_clineno, __pyx_lineno, __pyx_filename);
|
|
__pyx_r = NULL;
|
|
__pyx_L0:;
|
|
__Pyx_XGIVEREF(__pyx_r);
|
|
__Pyx_RefNannyFinishContext();
|
|
return __pyx_r;
|
|
}
|
|
|
|
/* "capnp.pyx":476
|
|
* cpdef getRootCodeGeneratorRequest(self):
|
|
* return _CodeGeneratorRequestReader()._init(self.thisptr.getRootCodeGeneratorRequest())
|
|
* cpdef getRootDynamicStruct(self, StructSchema schema): # <<<<<<<<<<<<<<
|
|
* return _DynamicStructReader()._init(self.thisptr.getRootDynamicStruct(schema.thisptr))
|
|
* cpdef getRoot(self, schema):
|
|
*/
|
|
|
|
static PyObject *__pyx_pw_5capnp_13MessageReader_7getRootDynamicStruct(PyObject *__pyx_v_self, PyObject *__pyx_v_schema); /*proto*/
|
|
static PyObject *__pyx_f_5capnp_13MessageReader_getRootDynamicStruct(struct __pyx_obj_5capnp_MessageReader *__pyx_v_self, struct __pyx_obj_5capnp_StructSchema *__pyx_v_schema, int __pyx_skip_dispatch) {
|
|
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("getRootDynamicStruct", 0);
|
|
/* Check if called by wrapper */
|
|
if (unlikely(__pyx_skip_dispatch)) ;
|
|
/* Check if overridden in Python */
|
|
else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
|
|
__pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_32); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 476; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
|
|
__Pyx_GOTREF(__pyx_t_1);
|
|
if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_5capnp_13MessageReader_7getRootDynamicStruct)) {
|
|
__Pyx_XDECREF(__pyx_r);
|
|
__pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 476; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
|
|
__Pyx_GOTREF(__pyx_t_2);
|
|
__Pyx_INCREF(((PyObject *)__pyx_v_schema));
|
|
PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_v_schema));
|
|
__Pyx_GIVEREF(((PyObject *)__pyx_v_schema));
|
|
__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 = 476; __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;
|
|
__pyx_t_3 = 0;
|
|
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
|
|
goto __pyx_L0;
|
|
}
|
|
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
|
|
}
|
|
|
|
/* "capnp.pyx":477
|
|
* return _CodeGeneratorRequestReader()._init(self.thisptr.getRootCodeGeneratorRequest())
|
|
* cpdef getRootDynamicStruct(self, StructSchema schema):
|
|
* return _DynamicStructReader()._init(self.thisptr.getRootDynamicStruct(schema.thisptr)) # <<<<<<<<<<<<<<
|
|
* cpdef getRoot(self, schema):
|
|
* cdef StructSchema s
|
|
*/
|
|
__Pyx_XDECREF(__pyx_r);
|
|
__pyx_t_1 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_5capnp__DynamicStructReader)), ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 477; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
|
|
__Pyx_GOTREF(__pyx_t_1);
|
|
__pyx_t_3 = ((struct __pyx_vtabstruct_5capnp__DynamicStructReader *)((struct __pyx_obj_5capnp__DynamicStructReader *)__pyx_t_1)->__pyx_vtab)->_init(((struct __pyx_obj_5capnp__DynamicStructReader *)__pyx_t_1), (( ::capnp::DynamicStruct::Reader)__pyx_v_self->thisptr->getRoot< ::capnp::DynamicStruct>((( ::capnp::StructSchema)__pyx_v_schema->thisptr)))); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 477; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
|
|
__Pyx_GOTREF(__pyx_t_3);
|
|
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
|
|
__pyx_r = __pyx_t_3;
|
|
__pyx_t_3 = 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("capnp.MessageReader.getRootDynamicStruct", __pyx_clineno, __pyx_lineno, __pyx_filename);
|
|
__pyx_r = 0;
|
|
__pyx_L0:;
|
|
__Pyx_XGIVEREF(__pyx_r);
|
|
__Pyx_RefNannyFinishContext();
|
|
return __pyx_r;
|
|
}
|
|
|
|
/* Python wrapper */
|
|
static PyObject *__pyx_pw_5capnp_13MessageReader_7getRootDynamicStruct(PyObject *__pyx_v_self, PyObject *__pyx_v_schema); /*proto*/
|
|
static PyObject *__pyx_pw_5capnp_13MessageReader_7getRootDynamicStruct(PyObject *__pyx_v_self, PyObject *__pyx_v_schema) {
|
|
CYTHON_UNUSED int __pyx_lineno = 0;
|
|
CYTHON_UNUSED const char *__pyx_filename = NULL;
|
|
CYTHON_UNUSED int __pyx_clineno = 0;
|
|
PyObject *__pyx_r = 0;
|
|
__Pyx_RefNannyDeclarations
|
|
__Pyx_RefNannySetupContext("getRootDynamicStruct (wrapper)", 0);
|
|
if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_schema), __pyx_ptype_5capnp_StructSchema, 1, "schema", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 476; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
|
|
__pyx_r = __pyx_pf_5capnp_13MessageReader_6getRootDynamicStruct(((struct __pyx_obj_5capnp_MessageReader *)__pyx_v_self), ((struct __pyx_obj_5capnp_StructSchema *)__pyx_v_schema));
|
|
goto __pyx_L0;
|
|
__pyx_L1_error:;
|
|
__pyx_r = NULL;
|
|
__pyx_L0:;
|
|
__Pyx_RefNannyFinishContext();
|
|
return __pyx_r;
|
|
}
|
|
|
|
/* "capnp.pyx":476
|
|
* cpdef getRootCodeGeneratorRequest(self):
|
|
* return _CodeGeneratorRequestReader()._init(self.thisptr.getRootCodeGeneratorRequest())
|
|
* cpdef getRootDynamicStruct(self, StructSchema schema): # <<<<<<<<<<<<<<
|
|
* return _DynamicStructReader()._init(self.thisptr.getRootDynamicStruct(schema.thisptr))
|
|
* cpdef getRoot(self, schema):
|
|
*/
|
|
|
|
static PyObject *__pyx_pf_5capnp_13MessageReader_6getRootDynamicStruct(struct __pyx_obj_5capnp_MessageReader *__pyx_v_self, struct __pyx_obj_5capnp_StructSchema *__pyx_v_schema) {
|
|
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("getRootDynamicStruct", 0);
|
|
__Pyx_XDECREF(__pyx_r);
|
|
__pyx_t_1 = ((struct __pyx_vtabstruct_5capnp_MessageReader *)__pyx_v_self->__pyx_vtab)->getRootDynamicStruct(__pyx_v_self, __pyx_v_schema, 1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 476; __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("capnp.MessageReader.getRootDynamicStruct", __pyx_clineno, __pyx_lineno, __pyx_filename);
|
|
__pyx_r = NULL;
|
|
__pyx_L0:;
|
|
__Pyx_XGIVEREF(__pyx_r);
|
|
__Pyx_RefNannyFinishContext();
|
|
return __pyx_r;
|
|
}
|
|
|
|
/* "capnp.pyx":478
|
|
* cpdef getRootDynamicStruct(self, StructSchema schema):
|
|
* return _DynamicStructReader()._init(self.thisptr.getRootDynamicStruct(schema.thisptr))
|
|
* cpdef getRoot(self, schema): # <<<<<<<<<<<<<<
|
|
* cdef StructSchema s
|
|
* if hasattr(schema, 'Schema'):
|
|
*/
|
|
|
|
static PyObject *__pyx_pw_5capnp_13MessageReader_9getRoot(PyObject *__pyx_v_self, PyObject *__pyx_v_schema); /*proto*/
|
|
static PyObject *__pyx_f_5capnp_13MessageReader_getRoot(struct __pyx_obj_5capnp_MessageReader *__pyx_v_self, PyObject *__pyx_v_schema, int __pyx_skip_dispatch) {
|
|
struct __pyx_obj_5capnp_StructSchema *__pyx_v_s = 0;
|
|
PyObject *__pyx_r = NULL;
|
|
__Pyx_RefNannyDeclarations
|
|
PyObject *__pyx_t_1 = NULL;
|
|
PyObject *__pyx_t_2 = NULL;
|
|
PyObject *__pyx_t_3 = NULL;
|
|
int __pyx_t_4;
|
|
int __pyx_t_5;
|
|
int __pyx_lineno = 0;
|
|
const char *__pyx_filename = NULL;
|
|
int __pyx_clineno = 0;
|
|
__Pyx_RefNannySetupContext("getRoot", 0);
|
|
/* Check if called by wrapper */
|
|
if (unlikely(__pyx_skip_dispatch)) ;
|
|
/* Check if overridden in Python */
|
|
else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
|
|
__pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s__getRoot); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 478; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
|
|
__Pyx_GOTREF(__pyx_t_1);
|
|
if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_5capnp_13MessageReader_9getRoot)) {
|
|
__Pyx_XDECREF(__pyx_r);
|
|
__pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 478; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
|
|
__Pyx_GOTREF(__pyx_t_2);
|
|
__Pyx_INCREF(__pyx_v_schema);
|
|
PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_schema);
|
|
__Pyx_GIVEREF(__pyx_v_schema);
|
|
__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 = 478; __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;
|
|
__pyx_t_3 = 0;
|
|
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
|
|
goto __pyx_L0;
|
|
}
|
|
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
|
|
}
|
|
|
|
/* "capnp.pyx":480
|
|
* cpdef getRoot(self, schema):
|
|
* cdef StructSchema s
|
|
* if hasattr(schema, 'Schema'): # <<<<<<<<<<<<<<
|
|
* s = schema.Schema
|
|
* else:
|
|
*/
|
|
__pyx_t_4 = PyObject_HasAttr(__pyx_v_schema, ((PyObject *)__pyx_n_s__Schema)); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 480; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
|
|
__pyx_t_5 = (__pyx_t_4 != 0);
|
|
if (__pyx_t_5) {
|
|
|
|
/* "capnp.pyx":481
|
|
* cdef StructSchema s
|
|
* if hasattr(schema, 'Schema'):
|
|
* s = schema.Schema # <<<<<<<<<<<<<<
|
|
* else:
|
|
* s = schema
|
|
*/
|
|
__pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_schema, __pyx_n_s__Schema); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 481; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
|
|
__Pyx_GOTREF(__pyx_t_1);
|
|
if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5capnp_StructSchema))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 481; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
|
|
__pyx_v_s = ((struct __pyx_obj_5capnp_StructSchema *)__pyx_t_1);
|
|
__pyx_t_1 = 0;
|
|
goto __pyx_L3;
|
|
}
|
|
/*else*/ {
|
|
|
|
/* "capnp.pyx":483
|
|
* s = schema.Schema
|
|
* else:
|
|
* s = schema # <<<<<<<<<<<<<<
|
|
* return _DynamicStructReader()._init(self.thisptr.getRootDynamicStruct(s.thisptr))
|
|
*
|
|
*/
|
|
if (!(likely(((__pyx_v_schema) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_schema, __pyx_ptype_5capnp_StructSchema))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 483; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
|
|
__Pyx_INCREF(__pyx_v_schema);
|
|
__pyx_v_s = ((struct __pyx_obj_5capnp_StructSchema *)__pyx_v_schema);
|
|
}
|
|
__pyx_L3:;
|
|
|
|
/* "capnp.pyx":484
|
|
* else:
|
|
* s = schema
|
|
* return _DynamicStructReader()._init(self.thisptr.getRootDynamicStruct(s.thisptr)) # <<<<<<<<<<<<<<
|
|
*
|
|
* cdef class StreamFdMessageReader(MessageReader):
|
|
*/
|
|
__Pyx_XDECREF(__pyx_r);
|
|
__pyx_t_1 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_5capnp__DynamicStructReader)), ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 484; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
|
|
__Pyx_GOTREF(__pyx_t_1);
|
|
__pyx_t_3 = ((struct __pyx_vtabstruct_5capnp__DynamicStructReader *)((struct __pyx_obj_5capnp__DynamicStructReader *)__pyx_t_1)->__pyx_vtab)->_init(((struct __pyx_obj_5capnp__DynamicStructReader *)__pyx_t_1), (( ::capnp::DynamicStruct::Reader)__pyx_v_self->thisptr->getRoot< ::capnp::DynamicStruct>((( ::capnp::StructSchema)__pyx_v_s->thisptr)))); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 484; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
|
|
__Pyx_GOTREF(__pyx_t_3);
|
|
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
|
|
__pyx_r = __pyx_t_3;
|
|
__pyx_t_3 = 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("capnp.MessageReader.getRoot", __pyx_clineno, __pyx_lineno, __pyx_filename);
|
|
__pyx_r = 0;
|
|
__pyx_L0:;
|
|
__Pyx_XDECREF((PyObject *)__pyx_v_s);
|
|
__Pyx_XGIVEREF(__pyx_r);
|
|
__Pyx_RefNannyFinishContext();
|
|
return __pyx_r;
|
|
}
|
|
|
|
/* Python wrapper */
|
|
static PyObject *__pyx_pw_5capnp_13MessageReader_9getRoot(PyObject *__pyx_v_self, PyObject *__pyx_v_schema); /*proto*/
|
|
static PyObject *__pyx_pw_5capnp_13MessageReader_9getRoot(PyObject *__pyx_v_self, PyObject *__pyx_v_schema) {
|
|
PyObject *__pyx_r = 0;
|
|
__Pyx_RefNannyDeclarations
|
|
__Pyx_RefNannySetupContext("getRoot (wrapper)", 0);
|
|
__pyx_r = __pyx_pf_5capnp_13MessageReader_8getRoot(((struct __pyx_obj_5capnp_MessageReader *)__pyx_v_self), ((PyObject *)__pyx_v_schema));
|
|
__Pyx_RefNannyFinishContext();
|
|
return __pyx_r;
|
|
}
|
|
|
|
/* "capnp.pyx":478
|
|
* cpdef getRootDynamicStruct(self, StructSchema schema):
|
|
* return _DynamicStructReader()._init(self.thisptr.getRootDynamicStruct(schema.thisptr))
|
|
* cpdef getRoot(self, schema): # <<<<<<<<<<<<<<
|
|
* cdef StructSchema s
|
|
* if hasattr(schema, 'Schema'):
|
|
*/
|
|
|
|
static PyObject *__pyx_pf_5capnp_13MessageReader_8getRoot(struct __pyx_obj_5capnp_MessageReader *__pyx_v_self, PyObject *__pyx_v_schema) {
|
|
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("getRoot", 0);
|
|
__Pyx_XDECREF(__pyx_r);
|
|
__pyx_t_1 = ((struct __pyx_vtabstruct_5capnp_MessageReader *)__pyx_v_self->__pyx_vtab)->getRoot(__pyx_v_self, __pyx_v_schema, 1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 478; __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("capnp.MessageReader.getRoot", __pyx_clineno, __pyx_lineno, __pyx_filename);
|
|
__pyx_r = NULL;
|
|
__pyx_L0:;
|
|
__Pyx_XGIVEREF(__pyx_r);
|
|
__Pyx_RefNannyFinishContext();
|
|
return __pyx_r;
|
|
}
|
|
|
|
/* Python wrapper */
|
|
static int __pyx_pw_5capnp_21StreamFdMessageReader_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
|
|
static int __pyx_pw_5capnp_21StreamFdMessageReader_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
|
|
int __pyx_v_fd;
|
|
int __pyx_lineno = 0;
|
|
const char *__pyx_filename = NULL;
|
|
int __pyx_clineno = 0;
|
|
int __pyx_r;
|
|
__Pyx_RefNannyDeclarations
|
|
__Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0);
|
|
{
|
|
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__fd,0};
|
|
PyObject* values[1] = {0};
|
|
if (unlikely(__pyx_kwds)) {
|
|
Py_ssize_t kw_args;
|
|
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
|
|
switch (pos_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 (pos_args) {
|
|
case 0:
|
|
if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__fd)) != 0)) kw_args--;
|
|
else goto __pyx_L5_argtuple_error;
|
|
}
|
|
if (unlikely(kw_args > 0)) {
|
|
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__cinit__") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 487; __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_fd = __Pyx_PyInt_AsInt(values[0]); if (unlikely((__pyx_v_fd == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 487; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
|
|
}
|
|
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 = 487; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
|
|
__pyx_L3_error:;
|
|
__Pyx_AddTraceback("capnp.StreamFdMessageReader.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
|
|
__Pyx_RefNannyFinishContext();
|
|
return -1;
|
|
__pyx_L4_argument_unpacking_done:;
|
|
__pyx_r = __pyx_pf_5capnp_21StreamFdMessageReader___cinit__(((struct __pyx_obj_5capnp_StreamFdMessageReader *)__pyx_v_self), __pyx_v_fd);
|
|
__Pyx_RefNannyFinishContext();
|
|
return __pyx_r;
|
|
}
|
|
|
|
/* "capnp.pyx":487
|
|
*
|
|
* cdef class StreamFdMessageReader(MessageReader):
|
|
* def __cinit__(self, int fd): # <<<<<<<<<<<<<<
|
|
* self.thisptr = new schema_cpp.StreamFdMessageReader(fd)
|
|
*
|
|
*/
|
|
|
|
static int __pyx_pf_5capnp_21StreamFdMessageReader___cinit__(struct __pyx_obj_5capnp_StreamFdMessageReader *__pyx_v_self, int __pyx_v_fd) {
|
|
int __pyx_r;
|
|
__Pyx_RefNannyDeclarations
|
|
__Pyx_RefNannySetupContext("__cinit__", 0);
|
|
|
|
/* "capnp.pyx":488
|
|
* cdef class StreamFdMessageReader(MessageReader):
|
|
* def __cinit__(self, int fd):
|
|
* self.thisptr = new schema_cpp.StreamFdMessageReader(fd) # <<<<<<<<<<<<<<
|
|
*
|
|
* cdef class PackedFdMessageReader(MessageReader):
|
|
*/
|
|
__pyx_v_self->__pyx_base.thisptr = new ::capnp::StreamFdMessageReader(__pyx_v_fd);
|
|
|
|
__pyx_r = 0;
|
|
__Pyx_RefNannyFinishContext();
|
|
return __pyx_r;
|
|
}
|
|
|
|
/* Python wrapper */
|
|
static int __pyx_pw_5capnp_21PackedFdMessageReader_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
|
|
static int __pyx_pw_5capnp_21PackedFdMessageReader_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
|
|
int __pyx_v_fd;
|
|
int __pyx_lineno = 0;
|
|
const char *__pyx_filename = NULL;
|
|
int __pyx_clineno = 0;
|
|
int __pyx_r;
|
|
__Pyx_RefNannyDeclarations
|
|
__Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0);
|
|
{
|
|
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__fd,0};
|
|
PyObject* values[1] = {0};
|
|
if (unlikely(__pyx_kwds)) {
|
|
Py_ssize_t kw_args;
|
|
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
|
|
switch (pos_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 (pos_args) {
|
|
case 0:
|
|
if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__fd)) != 0)) kw_args--;
|
|
else goto __pyx_L5_argtuple_error;
|
|
}
|
|
if (unlikely(kw_args > 0)) {
|
|
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__cinit__") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 491; __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_fd = __Pyx_PyInt_AsInt(values[0]); if (unlikely((__pyx_v_fd == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 491; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
|
|
}
|
|
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 = 491; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
|
|
__pyx_L3_error:;
|
|
__Pyx_AddTraceback("capnp.PackedFdMessageReader.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
|
|
__Pyx_RefNannyFinishContext();
|
|
return -1;
|
|
__pyx_L4_argument_unpacking_done:;
|
|
__pyx_r = __pyx_pf_5capnp_21PackedFdMessageReader___cinit__(((struct __pyx_obj_5capnp_PackedFdMessageReader *)__pyx_v_self), __pyx_v_fd);
|
|
__Pyx_RefNannyFinishContext();
|
|
return __pyx_r;
|
|
}
|
|
|
|
/* "capnp.pyx":491
|
|
*
|
|
* cdef class PackedFdMessageReader(MessageReader):
|
|
* def __cinit__(self, int fd): # <<<<<<<<<<<<<<
|
|
* self.thisptr = new schema_cpp.PackedFdMessageReader(fd)
|
|
*
|
|
*/
|
|
|
|
static int __pyx_pf_5capnp_21PackedFdMessageReader___cinit__(struct __pyx_obj_5capnp_PackedFdMessageReader *__pyx_v_self, int __pyx_v_fd) {
|
|
int __pyx_r;
|
|
__Pyx_RefNannyDeclarations
|
|
__Pyx_RefNannySetupContext("__cinit__", 0);
|
|
|
|
/* "capnp.pyx":492
|
|
* cdef class PackedFdMessageReader(MessageReader):
|
|
* def __cinit__(self, int fd):
|
|
* self.thisptr = new schema_cpp.PackedFdMessageReader(fd) # <<<<<<<<<<<<<<
|
|
*
|
|
* def writeMessageToFd(int fd, MessageBuilder m):
|
|
*/
|
|
__pyx_v_self->__pyx_base.thisptr = new ::capnp::PackedFdMessageReader(__pyx_v_fd);
|
|
|
|
__pyx_r = 0;
|
|
__Pyx_RefNannyFinishContext();
|
|
return __pyx_r;
|
|
}
|
|
|
|
/* Python wrapper */
|
|
static PyObject *__pyx_pw_5capnp_3writeMessageToFd(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
|
|
static PyMethodDef __pyx_mdef_5capnp_3writeMessageToFd = {__Pyx_NAMESTR("writeMessageToFd"), (PyCFunction)__pyx_pw_5capnp_3writeMessageToFd, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)};
|
|
static PyObject *__pyx_pw_5capnp_3writeMessageToFd(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
|
|
int __pyx_v_fd;
|
|
struct __pyx_obj_5capnp_MessageBuilder *__pyx_v_m = 0;
|
|
int __pyx_lineno = 0;
|
|
const char *__pyx_filename = NULL;
|
|
int __pyx_clineno = 0;
|
|
PyObject *__pyx_r = 0;
|
|
__Pyx_RefNannyDeclarations
|
|
__Pyx_RefNannySetupContext("writeMessageToFd (wrapper)", 0);
|
|
{
|
|
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__fd,&__pyx_n_s__m,0};
|
|
PyObject* values[2] = {0,0};
|
|
if (unlikely(__pyx_kwds)) {
|
|
Py_ssize_t kw_args;
|
|
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
|
|
switch (pos_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;
|
|
}
|
|
kw_args = PyDict_Size(__pyx_kwds);
|
|
switch (pos_args) {
|
|
case 0:
|
|
if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__fd)) != 0)) kw_args--;
|
|
else goto __pyx_L5_argtuple_error;
|
|
case 1:
|
|
if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__m)) != 0)) kw_args--;
|
|
else {
|
|
__Pyx_RaiseArgtupleInvalid("writeMessageToFd", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 494; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
|
|
}
|
|
}
|
|
if (unlikely(kw_args > 0)) {
|
|
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "writeMessageToFd") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 494; __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_fd = __Pyx_PyInt_AsInt(values[0]); if (unlikely((__pyx_v_fd == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 494; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
|
|
__pyx_v_m = ((struct __pyx_obj_5capnp_MessageBuilder *)values[1]);
|
|
}
|
|
goto __pyx_L4_argument_unpacking_done;
|
|
__pyx_L5_argtuple_error:;
|
|
__Pyx_RaiseArgtupleInvalid("writeMessageToFd", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 494; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
|
|
__pyx_L3_error:;
|
|
__Pyx_AddTraceback("capnp.writeMessageToFd", __pyx_clineno, __pyx_lineno, __pyx_filename);
|
|
__Pyx_RefNannyFinishContext();
|
|
return NULL;
|
|
__pyx_L4_argument_unpacking_done:;
|
|
if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_m), __pyx_ptype_5capnp_MessageBuilder, 1, "m", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 494; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
|
|
__pyx_r = __pyx_pf_5capnp_2writeMessageToFd(__pyx_self, __pyx_v_fd, __pyx_v_m);
|
|
goto __pyx_L0;
|
|
__pyx_L1_error:;
|
|
__pyx_r = NULL;
|
|
__pyx_L0:;
|
|
__Pyx_RefNannyFinishContext();
|
|
return __pyx_r;
|
|
}
|
|
|
|
/* "capnp.pyx":494
|
|
* self.thisptr = new schema_cpp.PackedFdMessageReader(fd)
|
|
*
|
|
* def writeMessageToFd(int fd, MessageBuilder m): # <<<<<<<<<<<<<<
|
|
* schema_cpp.writeMessageToFd(fd, deref(m.thisptr))
|
|
* def writePackedMessageToFd(int fd, MessageBuilder m):
|
|
*/
|
|
|
|
static PyObject *__pyx_pf_5capnp_2writeMessageToFd(CYTHON_UNUSED PyObject *__pyx_self, int __pyx_v_fd, struct __pyx_obj_5capnp_MessageBuilder *__pyx_v_m) {
|
|
PyObject *__pyx_r = NULL;
|
|
__Pyx_RefNannyDeclarations
|
|
__Pyx_RefNannySetupContext("writeMessageToFd", 0);
|
|
|
|
/* "capnp.pyx":495
|
|
*
|
|
* def writeMessageToFd(int fd, MessageBuilder m):
|
|
* schema_cpp.writeMessageToFd(fd, deref(m.thisptr)) # <<<<<<<<<<<<<<
|
|
* def writePackedMessageToFd(int fd, MessageBuilder m):
|
|
* schema_cpp.writePackedMessageToFd(fd, deref(m.thisptr))
|
|
*/
|
|
::capnp::writeMessageToFd(__pyx_v_fd, (*__pyx_v_m->thisptr));
|
|
|
|
__pyx_r = Py_None; __Pyx_INCREF(Py_None);
|
|
__Pyx_XGIVEREF(__pyx_r);
|
|
__Pyx_RefNannyFinishContext();
|
|
return __pyx_r;
|
|
}
|
|
|
|
/* Python wrapper */
|
|
static PyObject *__pyx_pw_5capnp_5writePackedMessageToFd(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
|
|
static PyMethodDef __pyx_mdef_5capnp_5writePackedMessageToFd = {__Pyx_NAMESTR("writePackedMessageToFd"), (PyCFunction)__pyx_pw_5capnp_5writePackedMessageToFd, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)};
|
|
static PyObject *__pyx_pw_5capnp_5writePackedMessageToFd(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
|
|
int __pyx_v_fd;
|
|
struct __pyx_obj_5capnp_MessageBuilder *__pyx_v_m = 0;
|
|
int __pyx_lineno = 0;
|
|
const char *__pyx_filename = NULL;
|
|
int __pyx_clineno = 0;
|
|
PyObject *__pyx_r = 0;
|
|
__Pyx_RefNannyDeclarations
|
|
__Pyx_RefNannySetupContext("writePackedMessageToFd (wrapper)", 0);
|
|
{
|
|
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__fd,&__pyx_n_s__m,0};
|
|
PyObject* values[2] = {0,0};
|
|
if (unlikely(__pyx_kwds)) {
|
|
Py_ssize_t kw_args;
|
|
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
|
|
switch (pos_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;
|
|
}
|
|
kw_args = PyDict_Size(__pyx_kwds);
|
|
switch (pos_args) {
|
|
case 0:
|
|
if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__fd)) != 0)) kw_args--;
|
|
else goto __pyx_L5_argtuple_error;
|
|
case 1:
|
|
if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__m)) != 0)) kw_args--;
|
|
else {
|
|
__Pyx_RaiseArgtupleInvalid("writePackedMessageToFd", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 496; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
|
|
}
|
|
}
|
|
if (unlikely(kw_args > 0)) {
|
|
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "writePackedMessageToFd") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 496; __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_fd = __Pyx_PyInt_AsInt(values[0]); if (unlikely((__pyx_v_fd == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 496; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
|
|
__pyx_v_m = ((struct __pyx_obj_5capnp_MessageBuilder *)values[1]);
|
|
}
|
|
goto __pyx_L4_argument_unpacking_done;
|
|
__pyx_L5_argtuple_error:;
|
|
__Pyx_RaiseArgtupleInvalid("writePackedMessageToFd", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 496; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
|
|
__pyx_L3_error:;
|
|
__Pyx_AddTraceback("capnp.writePackedMessageToFd", __pyx_clineno, __pyx_lineno, __pyx_filename);
|
|
__Pyx_RefNannyFinishContext();
|
|
return NULL;
|
|
__pyx_L4_argument_unpacking_done:;
|
|
if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_m), __pyx_ptype_5capnp_MessageBuilder, 1, "m", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 496; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
|
|
__pyx_r = __pyx_pf_5capnp_4writePackedMessageToFd(__pyx_self, __pyx_v_fd, __pyx_v_m);
|
|
goto __pyx_L0;
|
|
__pyx_L1_error:;
|
|
__pyx_r = NULL;
|
|
__pyx_L0:;
|
|
__Pyx_RefNannyFinishContext();
|
|
return __pyx_r;
|
|
}
|
|
|
|
/* "capnp.pyx":496
|
|
* def writeMessageToFd(int fd, MessageBuilder m):
|
|
* schema_cpp.writeMessageToFd(fd, deref(m.thisptr))
|
|
* def writePackedMessageToFd(int fd, MessageBuilder m): # <<<<<<<<<<<<<<
|
|
* schema_cpp.writePackedMessageToFd(fd, deref(m.thisptr))
|
|
*
|
|
*/
|
|
|
|
static PyObject *__pyx_pf_5capnp_4writePackedMessageToFd(CYTHON_UNUSED PyObject *__pyx_self, int __pyx_v_fd, struct __pyx_obj_5capnp_MessageBuilder *__pyx_v_m) {
|
|
PyObject *__pyx_r = NULL;
|
|
__Pyx_RefNannyDeclarations
|
|
__Pyx_RefNannySetupContext("writePackedMessageToFd", 0);
|
|
|
|
/* "capnp.pyx":497
|
|
* schema_cpp.writeMessageToFd(fd, deref(m.thisptr))
|
|
* def writePackedMessageToFd(int fd, MessageBuilder m):
|
|
* schema_cpp.writePackedMessageToFd(fd, deref(m.thisptr)) # <<<<<<<<<<<<<<
|
|
*
|
|
* def capitalize(s):
|
|
*/
|
|
::capnp::writePackedMessageToFd(__pyx_v_fd, (*__pyx_v_m->thisptr));
|
|
|
|
__pyx_r = Py_None; __Pyx_INCREF(Py_None);
|
|
__Pyx_XGIVEREF(__pyx_r);
|
|
__Pyx_RefNannyFinishContext();
|
|
return __pyx_r;
|
|
}
|
|
|
|
/* Python wrapper */
|
|
static PyObject *__pyx_pw_5capnp_7capitalize(PyObject *__pyx_self, PyObject *__pyx_v_s); /*proto*/
|
|
static PyMethodDef __pyx_mdef_5capnp_7capitalize = {__Pyx_NAMESTR("capitalize"), (PyCFunction)__pyx_pw_5capnp_7capitalize, METH_O, __Pyx_DOCSTR(0)};
|
|
static PyObject *__pyx_pw_5capnp_7capitalize(PyObject *__pyx_self, PyObject *__pyx_v_s) {
|
|
PyObject *__pyx_r = 0;
|
|
__Pyx_RefNannyDeclarations
|
|
__Pyx_RefNannySetupContext("capitalize (wrapper)", 0);
|
|
__pyx_r = __pyx_pf_5capnp_6capitalize(__pyx_self, ((PyObject *)__pyx_v_s));
|
|
__Pyx_RefNannyFinishContext();
|
|
return __pyx_r;
|
|
}
|
|
|
|
/* "capnp.pyx":499
|
|
* schema_cpp.writePackedMessageToFd(fd, deref(m.thisptr))
|
|
*
|
|
* def capitalize(s): # <<<<<<<<<<<<<<
|
|
* if len(s) < 2:
|
|
* return s
|
|
*/
|
|
|
|
static PyObject *__pyx_pf_5capnp_6capitalize(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_s) {
|
|
PyObject *__pyx_r = NULL;
|
|
__Pyx_RefNannyDeclarations
|
|
Py_ssize_t __pyx_t_1;
|
|
int __pyx_t_2;
|
|
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("capitalize", 0);
|
|
|
|
/* "capnp.pyx":500
|
|
*
|
|
* def capitalize(s):
|
|
* if len(s) < 2: # <<<<<<<<<<<<<<
|
|
* return s
|
|
* return s[0].upper() + s[1:]
|
|
*/
|
|
__pyx_t_1 = PyObject_Length(__pyx_v_s); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 500; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
|
|
__pyx_t_2 = ((__pyx_t_1 < 2) != 0);
|
|
if (__pyx_t_2) {
|
|
|
|
/* "capnp.pyx":501
|
|
* def capitalize(s):
|
|
* if len(s) < 2:
|
|
* return s # <<<<<<<<<<<<<<
|
|
* return s[0].upper() + s[1:]
|
|
* def upper_and_under(s):
|
|
*/
|
|
__Pyx_XDECREF(__pyx_r);
|
|
__Pyx_INCREF(__pyx_v_s);
|
|
__pyx_r = __pyx_v_s;
|
|
goto __pyx_L0;
|
|
goto __pyx_L3;
|
|
}
|
|
__pyx_L3:;
|
|
|
|
/* "capnp.pyx":502
|
|
* if len(s) < 2:
|
|
* return s
|
|
* return s[0].upper() + s[1:] # <<<<<<<<<<<<<<
|
|
* def upper_and_under(s):
|
|
* if len(s) < 2:
|
|
*/
|
|
__Pyx_XDECREF(__pyx_r);
|
|
__pyx_t_3 = __Pyx_GetItemInt(__pyx_v_s, 0, sizeof(long), PyInt_FromLong, 0, 0, 1); if (!__pyx_t_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 502; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
|
|
__Pyx_GOTREF(__pyx_t_3);
|
|
__pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s__upper); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 502; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
|
|
__Pyx_GOTREF(__pyx_t_4);
|
|
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
|
|
__pyx_t_3 = PyObject_Call(__pyx_t_4, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 502; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
|
|
__Pyx_GOTREF(__pyx_t_3);
|
|
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
|
|
__pyx_t_4 = __Pyx_PyObject_GetSlice(__pyx_v_s, 1, 0, NULL, NULL, &__pyx_k_slice_33, 1, 0, 1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 502; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
|
|
__Pyx_GOTREF(__pyx_t_4);
|
|
__pyx_t_5 = PyNumber_Add(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 502; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
|
|
__Pyx_GOTREF(__pyx_t_5);
|
|
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
|
|
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
|
|
__pyx_r = __pyx_t_5;
|
|
__pyx_t_5 = 0;
|
|
goto __pyx_L0;
|
|
|
|
__pyx_r = Py_None; __Pyx_INCREF(Py_None);
|
|
goto __pyx_L0;
|
|
__pyx_L1_error:;
|
|
__Pyx_XDECREF(__pyx_t_3);
|
|
__Pyx_XDECREF(__pyx_t_4);
|
|
__Pyx_XDECREF(__pyx_t_5);
|
|
__Pyx_AddTraceback("capnp.capitalize", __pyx_clineno, __pyx_lineno, __pyx_filename);
|
|
__pyx_r = NULL;
|
|
__pyx_L0:;
|
|
__Pyx_XGIVEREF(__pyx_r);
|
|
__Pyx_RefNannyFinishContext();
|
|
return __pyx_r;
|
|
}
|
|
|
|
/* Python wrapper */
|
|
static PyObject *__pyx_pw_5capnp_9upper_and_under(PyObject *__pyx_self, PyObject *__pyx_v_s); /*proto*/
|
|
static PyMethodDef __pyx_mdef_5capnp_9upper_and_under = {__Pyx_NAMESTR("upper_and_under"), (PyCFunction)__pyx_pw_5capnp_9upper_and_under, METH_O, __Pyx_DOCSTR(0)};
|
|
static PyObject *__pyx_pw_5capnp_9upper_and_under(PyObject *__pyx_self, PyObject *__pyx_v_s) {
|
|
PyObject *__pyx_r = 0;
|
|
__Pyx_RefNannyDeclarations
|
|
__Pyx_RefNannySetupContext("upper_and_under (wrapper)", 0);
|
|
__pyx_r = __pyx_pf_5capnp_8upper_and_under(__pyx_self, ((PyObject *)__pyx_v_s));
|
|
__Pyx_RefNannyFinishContext();
|
|
return __pyx_r;
|
|
}
|
|
|
|
/* "capnp.pyx":503
|
|
* return s
|
|
* return s[0].upper() + s[1:]
|
|
* def upper_and_under(s): # <<<<<<<<<<<<<<
|
|
* if len(s) < 2:
|
|
* return s
|
|
*/
|
|
|
|
static PyObject *__pyx_pf_5capnp_8upper_and_under(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_s) {
|
|
PyObject *__pyx_v_ret = NULL;
|
|
PyObject *__pyx_v_letter = NULL;
|
|
PyObject *__pyx_r = NULL;
|
|
__Pyx_RefNannyDeclarations
|
|
Py_ssize_t __pyx_t_1;
|
|
int __pyx_t_2;
|
|
PyObject *__pyx_t_3 = NULL;
|
|
PyObject *__pyx_t_4 = NULL;
|
|
PyObject *(*__pyx_t_5)(PyObject *);
|
|
PyObject *__pyx_t_6 = NULL;
|
|
int __pyx_t_7;
|
|
int __pyx_lineno = 0;
|
|
const char *__pyx_filename = NULL;
|
|
int __pyx_clineno = 0;
|
|
__Pyx_RefNannySetupContext("upper_and_under", 0);
|
|
|
|
/* "capnp.pyx":504
|
|
* return s[0].upper() + s[1:]
|
|
* def upper_and_under(s):
|
|
* if len(s) < 2: # <<<<<<<<<<<<<<
|
|
* return s
|
|
* ret = [s[0]]
|
|
*/
|
|
__pyx_t_1 = PyObject_Length(__pyx_v_s); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 504; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
|
|
__pyx_t_2 = ((__pyx_t_1 < 2) != 0);
|
|
if (__pyx_t_2) {
|
|
|
|
/* "capnp.pyx":505
|
|
* def upper_and_under(s):
|
|
* if len(s) < 2:
|
|
* return s # <<<<<<<<<<<<<<
|
|
* ret = [s[0]]
|
|
* for letter in s[1:]:
|
|
*/
|
|
__Pyx_XDECREF(__pyx_r);
|
|
__Pyx_INCREF(__pyx_v_s);
|
|
__pyx_r = __pyx_v_s;
|
|
goto __pyx_L0;
|
|
goto __pyx_L3;
|
|
}
|
|
__pyx_L3:;
|
|
|
|
/* "capnp.pyx":506
|
|
* if len(s) < 2:
|
|
* return s
|
|
* ret = [s[0]] # <<<<<<<<<<<<<<
|
|
* for letter in s[1:]:
|
|
* if letter.isupper():
|
|
*/
|
|
__pyx_t_3 = __Pyx_GetItemInt(__pyx_v_s, 0, sizeof(long), PyInt_FromLong, 0, 0, 1); if (!__pyx_t_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 506; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
|
|
__Pyx_GOTREF(__pyx_t_3);
|
|
__pyx_t_4 = PyList_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 506; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
|
|
__Pyx_GOTREF(__pyx_t_4);
|
|
PyList_SET_ITEM(__pyx_t_4, 0, __pyx_t_3);
|
|
__Pyx_GIVEREF(__pyx_t_3);
|
|
__pyx_t_3 = 0;
|
|
__pyx_v_ret = ((PyObject*)__pyx_t_4);
|
|
__pyx_t_4 = 0;
|
|
|
|
/* "capnp.pyx":507
|
|
* return s
|
|
* ret = [s[0]]
|
|
* for letter in s[1:]: # <<<<<<<<<<<<<<
|
|
* if letter.isupper():
|
|
* ret.append('_')
|
|
*/
|
|
__pyx_t_4 = __Pyx_PyObject_GetSlice(__pyx_v_s, 1, 0, NULL, NULL, &__pyx_k_slice_34, 1, 0, 1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 507; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
|
|
__Pyx_GOTREF(__pyx_t_4);
|
|
if (PyList_CheckExact(__pyx_t_4) || PyTuple_CheckExact(__pyx_t_4)) {
|
|
__pyx_t_3 = __pyx_t_4; __Pyx_INCREF(__pyx_t_3); __pyx_t_1 = 0;
|
|
__pyx_t_5 = NULL;
|
|
} else {
|
|
__pyx_t_1 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_t_4); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 507; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
|
|
__Pyx_GOTREF(__pyx_t_3);
|
|
__pyx_t_5 = Py_TYPE(__pyx_t_3)->tp_iternext;
|
|
}
|
|
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
|
|
for (;;) {
|
|
if (!__pyx_t_5 && PyList_CheckExact(__pyx_t_3)) {
|
|
if (__pyx_t_1 >= PyList_GET_SIZE(__pyx_t_3)) break;
|
|
#if CYTHON_COMPILING_IN_CPYTHON
|
|
__pyx_t_4 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_1); __Pyx_INCREF(__pyx_t_4); __pyx_t_1++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 507; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
|
|
#else
|
|
__pyx_t_4 = PySequence_ITEM(__pyx_t_3, __pyx_t_1); __pyx_t_1++; if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 507; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
|
|
#endif
|
|
} else if (!__pyx_t_5 && PyTuple_CheckExact(__pyx_t_3)) {
|
|
if (__pyx_t_1 >= PyTuple_GET_SIZE(__pyx_t_3)) break;
|
|
#if CYTHON_COMPILING_IN_CPYTHON
|
|
__pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_1); __Pyx_INCREF(__pyx_t_4); __pyx_t_1++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 507; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
|
|
#else
|
|
__pyx_t_4 = PySequence_ITEM(__pyx_t_3, __pyx_t_1); __pyx_t_1++; if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 507; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
|
|
#endif
|
|
} else {
|
|
__pyx_t_4 = __pyx_t_5(__pyx_t_3);
|
|
if (unlikely(!__pyx_t_4)) {
|
|
if (PyErr_Occurred()) {
|
|
if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) PyErr_Clear();
|
|
else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 507; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
|
|
}
|
|
break;
|
|
}
|
|
__Pyx_GOTREF(__pyx_t_4);
|
|
}
|
|
__Pyx_XDECREF(__pyx_v_letter);
|
|
__pyx_v_letter = __pyx_t_4;
|
|
__pyx_t_4 = 0;
|
|
|
|
/* "capnp.pyx":508
|
|
* ret = [s[0]]
|
|
* for letter in s[1:]:
|
|
* if letter.isupper(): # <<<<<<<<<<<<<<
|
|
* ret.append('_')
|
|
* ret.append(letter)
|
|
*/
|
|
__pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_letter, __pyx_n_s__isupper); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 508; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
|
|
__Pyx_GOTREF(__pyx_t_4);
|
|
__pyx_t_6 = PyObject_Call(__pyx_t_4, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 508; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
|
|
__Pyx_GOTREF(__pyx_t_6);
|
|
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
|
|
__pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 508; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
|
|
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
|
|
if (__pyx_t_2) {
|
|
|
|
/* "capnp.pyx":509
|
|
* for letter in s[1:]:
|
|
* if letter.isupper():
|
|
* ret.append('_') # <<<<<<<<<<<<<<
|
|
* ret.append(letter)
|
|
* return ''.join(ret).upper()
|
|
*/
|
|
__pyx_t_7 = __Pyx_PyList_Append(__pyx_v_ret, ((PyObject *)__pyx_n_s___)); if (unlikely(__pyx_t_7 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 509; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
|
|
goto __pyx_L6;
|
|
}
|
|
__pyx_L6:;
|
|
|
|
/* "capnp.pyx":510
|
|
* if letter.isupper():
|
|
* ret.append('_')
|
|
* ret.append(letter) # <<<<<<<<<<<<<<
|
|
* return ''.join(ret).upper()
|
|
*
|
|
*/
|
|
__pyx_t_7 = __Pyx_PyList_Append(__pyx_v_ret, __pyx_v_letter); if (unlikely(__pyx_t_7 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 510; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
|
|
}
|
|
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
|
|
|
|
/* "capnp.pyx":511
|
|
* ret.append('_')
|
|
* ret.append(letter)
|
|
* return ''.join(ret).upper() # <<<<<<<<<<<<<<
|
|
*
|
|
* from types import ModuleType
|
|
*/
|
|
__Pyx_XDECREF(__pyx_r);
|
|
__pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_kp_s_35), __pyx_n_s__join); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 511; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
|
|
__Pyx_GOTREF(__pyx_t_3);
|
|
__pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 511; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
|
|
__Pyx_GOTREF(__pyx_t_6);
|
|
__Pyx_INCREF(((PyObject *)__pyx_v_ret));
|
|
PyTuple_SET_ITEM(__pyx_t_6, 0, ((PyObject *)__pyx_v_ret));
|
|
__Pyx_GIVEREF(((PyObject *)__pyx_v_ret));
|
|
__pyx_t_4 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_t_6), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 511; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
|
|
__Pyx_GOTREF(__pyx_t_4);
|
|
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
|
|
__Pyx_DECREF(((PyObject *)__pyx_t_6)); __pyx_t_6 = 0;
|
|
__pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s__upper); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 511; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
|
|
__Pyx_GOTREF(__pyx_t_6);
|
|
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
|
|
__pyx_t_4 = PyObject_Call(__pyx_t_6, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 511; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
|
|
__Pyx_GOTREF(__pyx_t_4);
|
|
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
|
|
__pyx_r = __pyx_t_4;
|
|
__pyx_t_4 = 0;
|
|
goto __pyx_L0;
|
|
|
|
__pyx_r = Py_None; __Pyx_INCREF(Py_None);
|
|
goto __pyx_L0;
|
|
__pyx_L1_error:;
|
|
__Pyx_XDECREF(__pyx_t_3);
|
|
__Pyx_XDECREF(__pyx_t_4);
|
|
__Pyx_XDECREF(__pyx_t_6);
|
|
__Pyx_AddTraceback("capnp.upper_and_under", __pyx_clineno, __pyx_lineno, __pyx_filename);
|
|
__pyx_r = NULL;
|
|
__pyx_L0:;
|
|
__Pyx_XDECREF(__pyx_v_ret);
|
|
__Pyx_XDECREF(__pyx_v_letter);
|
|
__Pyx_XGIVEREF(__pyx_r);
|
|
__Pyx_RefNannyFinishContext();
|
|
return __pyx_r;
|
|
}
|
|
|
|
/* Python wrapper */
|
|
static PyObject *__pyx_pw_5capnp_11_load(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
|
|
static PyMethodDef __pyx_mdef_5capnp_11_load = {__Pyx_NAMESTR("_load"), (PyCFunction)__pyx_pw_5capnp_11_load, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)};
|
|
static PyObject *__pyx_pw_5capnp_11_load(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
|
|
PyObject *__pyx_v_module = 0;
|
|
PyObject *__pyx_v_node = 0;
|
|
PyObject *__pyx_v_loader = 0;
|
|
PyObject *__pyx_v_name = 0;
|
|
CYTHON_UNUSED PyObject *__pyx_v_isUnion = 0;
|
|
int __pyx_lineno = 0;
|
|
const char *__pyx_filename = NULL;
|
|
int __pyx_clineno = 0;
|
|
PyObject *__pyx_r = 0;
|
|
__Pyx_RefNannyDeclarations
|
|
__Pyx_RefNannySetupContext("_load (wrapper)", 0);
|
|
{
|
|
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__module,&__pyx_n_s__node,&__pyx_n_s__loader,&__pyx_n_s__name,&__pyx_n_s__isUnion,0};
|
|
PyObject* values[5] = {0,0,0,0,0};
|
|
values[4] = __pyx_k_36;
|
|
if (unlikely(__pyx_kwds)) {
|
|
Py_ssize_t kw_args;
|
|
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
|
|
switch (pos_args) {
|
|
case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
|
|
case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
|
|
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 (pos_args) {
|
|
case 0:
|
|
if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__module)) != 0)) kw_args--;
|
|
else goto __pyx_L5_argtuple_error;
|
|
case 1:
|
|
if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__node)) != 0)) kw_args--;
|
|
else {
|
|
__Pyx_RaiseArgtupleInvalid("_load", 0, 4, 5, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 518; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
|
|
}
|
|
case 2:
|
|
if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__loader)) != 0)) kw_args--;
|
|
else {
|
|
__Pyx_RaiseArgtupleInvalid("_load", 0, 4, 5, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 518; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
|
|
}
|
|
case 3:
|
|
if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__name)) != 0)) kw_args--;
|
|
else {
|
|
__Pyx_RaiseArgtupleInvalid("_load", 0, 4, 5, 3); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 518; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
|
|
}
|
|
case 4:
|
|
if (kw_args > 0) {
|
|
PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__isUnion);
|
|
if (value) { values[4] = value; kw_args--; }
|
|
}
|
|
}
|
|
if (unlikely(kw_args > 0)) {
|
|
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_load") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 518; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
|
|
}
|
|
} else {
|
|
switch (PyTuple_GET_SIZE(__pyx_args)) {
|
|
case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
|
|
case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
|
|
values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
|
|
values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
|
|
values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
|
|
break;
|
|
default: goto __pyx_L5_argtuple_error;
|
|
}
|
|
}
|
|
__pyx_v_module = values[0];
|
|
__pyx_v_node = values[1];
|
|
__pyx_v_loader = values[2];
|
|
__pyx_v_name = values[3];
|
|
__pyx_v_isUnion = values[4];
|
|
}
|
|
goto __pyx_L4_argument_unpacking_done;
|
|
__pyx_L5_argtuple_error:;
|
|
__Pyx_RaiseArgtupleInvalid("_load", 0, 4, 5, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 518; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
|
|
__pyx_L3_error:;
|
|
__Pyx_AddTraceback("capnp._load", __pyx_clineno, __pyx_lineno, __pyx_filename);
|
|
__Pyx_RefNannyFinishContext();
|
|
return NULL;
|
|
__pyx_L4_argument_unpacking_done:;
|
|
__pyx_r = __pyx_pf_5capnp_10_load(__pyx_self, __pyx_v_module, __pyx_v_node, __pyx_v_loader, __pyx_v_name, __pyx_v_isUnion);
|
|
__Pyx_RefNannyFinishContext();
|
|
return __pyx_r;
|
|
}
|
|
|
|
/* "capnp.pyx":518
|
|
* import subprocess
|
|
*
|
|
* def _load(module, node, loader, name, isUnion = False): # <<<<<<<<<<<<<<
|
|
* if name is None or len(name) == 0:
|
|
* return
|
|
*/
|
|
|
|
static PyObject *__pyx_pf_5capnp_10_load(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_module, PyObject *__pyx_v_node, PyObject *__pyx_v_loader, PyObject *__pyx_v_name, CYTHON_UNUSED PyObject *__pyx_v_isUnion) {
|
|
PyObject *__pyx_v_local_module = NULL;
|
|
PyObject *__pyx_v_sub_name = NULL;
|
|
PyObject *__pyx_v_new_m = NULL;
|
|
PyObject *__pyx_v_nestedNode = NULL;
|
|
PyObject *__pyx_v_s = NULL;
|
|
PyObject *__pyx_v_body = NULL;
|
|
PyObject *__pyx_v_which = NULL;
|
|
PyObject *__pyx_v_enum = NULL;
|
|
PyObject *__pyx_v_struct = NULL;
|
|
PyObject *__pyx_v_member = NULL;
|
|
PyObject *__pyx_r = NULL;
|
|
__Pyx_RefNannyDeclarations
|
|
int __pyx_t_1;
|
|
Py_ssize_t __pyx_t_2;
|
|
int __pyx_t_3;
|
|
int __pyx_t_4;
|
|
PyObject *__pyx_t_5 = NULL;
|
|
PyObject *__pyx_t_6 = NULL;
|
|
PyObject *__pyx_t_7 = NULL;
|
|
PyObject *(*__pyx_t_8)(PyObject *);
|
|
PyObject *__pyx_t_9 = NULL;
|
|
PyObject *__pyx_t_10 = NULL;
|
|
PyObject *__pyx_t_11 = NULL;
|
|
PyObject *__pyx_t_12 = NULL;
|
|
PyObject *__pyx_t_13 = NULL;
|
|
Py_ssize_t __pyx_t_14;
|
|
PyObject *(*__pyx_t_15)(PyObject *);
|
|
PyObject *__pyx_t_16 = NULL;
|
|
int __pyx_lineno = 0;
|
|
const char *__pyx_filename = NULL;
|
|
int __pyx_clineno = 0;
|
|
__Pyx_RefNannySetupContext("_load", 0);
|
|
__Pyx_INCREF(__pyx_v_name);
|
|
|
|
/* "capnp.pyx":519
|
|
*
|
|
* def _load(module, node, loader, name, isUnion = False):
|
|
* if name is None or len(name) == 0: # <<<<<<<<<<<<<<
|
|
* return
|
|
* if name[0] == ':':
|
|
*/
|
|
__pyx_t_1 = (__pyx_v_name == Py_None);
|
|
if (!(__pyx_t_1 != 0)) {
|
|
__pyx_t_2 = PyObject_Length(__pyx_v_name); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 519; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
|
|
__pyx_t_3 = ((__pyx_t_2 == 0) != 0);
|
|
__pyx_t_4 = __pyx_t_3;
|
|
} else {
|
|
__pyx_t_4 = (__pyx_t_1 != 0);
|
|
}
|
|
if (__pyx_t_4) {
|
|
|
|
/* "capnp.pyx":520
|
|
* def _load(module, node, loader, name, isUnion = False):
|
|
* if name is None or len(name) == 0:
|
|
* return # <<<<<<<<<<<<<<
|
|
* if name[0] == ':':
|
|
* name = name[1:]
|
|
*/
|
|
__Pyx_XDECREF(__pyx_r);
|
|
__pyx_r = Py_None; __Pyx_INCREF(Py_None);
|
|
goto __pyx_L0;
|
|
goto __pyx_L3;
|
|
}
|
|
__pyx_L3:;
|
|
|
|
/* "capnp.pyx":521
|
|
* if name is None or len(name) == 0:
|
|
* return
|
|
* if name[0] == ':': # <<<<<<<<<<<<<<
|
|
* name = name[1:]
|
|
* local_module = module
|
|
*/
|
|
__pyx_t_5 = __Pyx_GetItemInt(__pyx_v_name, 0, sizeof(long), PyInt_FromLong, 0, 0, 1); if (!__pyx_t_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 521; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
|
|
__Pyx_GOTREF(__pyx_t_5);
|
|
__pyx_t_6 = PyObject_RichCompare(__pyx_t_5, ((PyObject *)__pyx_kp_s_37), Py_EQ); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 521; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
|
|
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
|
|
__pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 521; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
|
|
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
|
|
if (__pyx_t_4) {
|
|
|
|
/* "capnp.pyx":522
|
|
* return
|
|
* if name[0] == ':':
|
|
* name = name[1:] # <<<<<<<<<<<<<<
|
|
* local_module = module
|
|
*
|
|
*/
|
|
__pyx_t_6 = __Pyx_PyObject_GetSlice(__pyx_v_name, 1, 0, NULL, NULL, &__pyx_k_slice_38, 1, 0, 1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 522; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
|
|
__Pyx_GOTREF(__pyx_t_6);
|
|
__Pyx_DECREF(__pyx_v_name);
|
|
__pyx_v_name = __pyx_t_6;
|
|
__pyx_t_6 = 0;
|
|
goto __pyx_L4;
|
|
}
|
|
__pyx_L4:;
|
|
|
|
/* "capnp.pyx":523
|
|
* if name[0] == ':':
|
|
* name = name[1:]
|
|
* local_module = module # <<<<<<<<<<<<<<
|
|
*
|
|
* for sub_name in re.split('[:.]', name):
|
|
*/
|
|
__Pyx_INCREF(__pyx_v_module);
|
|
__pyx_v_local_module = __pyx_v_module;
|
|
|
|
/* "capnp.pyx":525
|
|
* local_module = module
|
|
*
|
|
* for sub_name in re.split('[:.]', name): # <<<<<<<<<<<<<<
|
|
* new_m = local_module.__dict__.get(sub_name, ModuleType(sub_name))
|
|
* new_m._parent_module = local_module
|
|
*/
|
|
__pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s__re); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 525; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
|
|
__Pyx_GOTREF(__pyx_t_6);
|
|
__pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s__split); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 525; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
|
|
__Pyx_GOTREF(__pyx_t_5);
|
|
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
|
|
__pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 525; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
|
|
__Pyx_GOTREF(__pyx_t_6);
|
|
__Pyx_INCREF(((PyObject *)__pyx_kp_s_39));
|
|
PyTuple_SET_ITEM(__pyx_t_6, 0, ((PyObject *)__pyx_kp_s_39));
|
|
__Pyx_GIVEREF(((PyObject *)__pyx_kp_s_39));
|
|
__Pyx_INCREF(__pyx_v_name);
|
|
PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_v_name);
|
|
__Pyx_GIVEREF(__pyx_v_name);
|
|
__pyx_t_7 = PyObject_Call(__pyx_t_5, ((PyObject *)__pyx_t_6), NULL); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 525; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
|
|
__Pyx_GOTREF(__pyx_t_7);
|
|
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
|
|
__Pyx_DECREF(((PyObject *)__pyx_t_6)); __pyx_t_6 = 0;
|
|
if (PyList_CheckExact(__pyx_t_7) || PyTuple_CheckExact(__pyx_t_7)) {
|
|
__pyx_t_6 = __pyx_t_7; __Pyx_INCREF(__pyx_t_6); __pyx_t_2 = 0;
|
|
__pyx_t_8 = NULL;
|
|
} else {
|
|
__pyx_t_2 = -1; __pyx_t_6 = PyObject_GetIter(__pyx_t_7); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 525; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
|
|
__Pyx_GOTREF(__pyx_t_6);
|
|
__pyx_t_8 = Py_TYPE(__pyx_t_6)->tp_iternext;
|
|
}
|
|
__Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
|
|
for (;;) {
|
|
if (!__pyx_t_8 && PyList_CheckExact(__pyx_t_6)) {
|
|
if (__pyx_t_2 >= PyList_GET_SIZE(__pyx_t_6)) break;
|
|
#if CYTHON_COMPILING_IN_CPYTHON
|
|
__pyx_t_7 = PyList_GET_ITEM(__pyx_t_6, __pyx_t_2); __Pyx_INCREF(__pyx_t_7); __pyx_t_2++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 525; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
|
|
#else
|
|
__pyx_t_7 = PySequence_ITEM(__pyx_t_6, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 525; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
|
|
#endif
|
|
} else if (!__pyx_t_8 && PyTuple_CheckExact(__pyx_t_6)) {
|
|
if (__pyx_t_2 >= PyTuple_GET_SIZE(__pyx_t_6)) break;
|
|
#if CYTHON_COMPILING_IN_CPYTHON
|
|
__pyx_t_7 = PyTuple_GET_ITEM(__pyx_t_6, __pyx_t_2); __Pyx_INCREF(__pyx_t_7); __pyx_t_2++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 525; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
|
|
#else
|
|
__pyx_t_7 = PySequence_ITEM(__pyx_t_6, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 525; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
|
|
#endif
|
|
} else {
|
|
__pyx_t_7 = __pyx_t_8(__pyx_t_6);
|
|
if (unlikely(!__pyx_t_7)) {
|
|
if (PyErr_Occurred()) {
|
|
if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) PyErr_Clear();
|
|
else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 525; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
|
|
}
|
|
break;
|
|
}
|
|
__Pyx_GOTREF(__pyx_t_7);
|
|
}
|
|
__Pyx_XDECREF(__pyx_v_sub_name);
|
|
__pyx_v_sub_name = __pyx_t_7;
|
|
__pyx_t_7 = 0;
|
|
|
|
/* "capnp.pyx":526
|
|
*
|
|
* for sub_name in re.split('[:.]', name):
|
|
* new_m = local_module.__dict__.get(sub_name, ModuleType(sub_name)) # <<<<<<<<<<<<<<
|
|
* new_m._parent_module = local_module
|
|
* local_module.__dict__[sub_name] = new_m
|
|
*/
|
|
__pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_local_module, __pyx_n_s____dict__); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 526; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
|
|
__Pyx_GOTREF(__pyx_t_7);
|
|
__pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s__get); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 526; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
|
|
__Pyx_GOTREF(__pyx_t_5);
|
|
__Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
|
|
__pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s__ModuleType); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 526; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
|
|
__Pyx_GOTREF(__pyx_t_7);
|
|
__pyx_t_9 = PyTuple_New(1); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 526; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
|
|
__Pyx_GOTREF(__pyx_t_9);
|
|
__Pyx_INCREF(__pyx_v_sub_name);
|
|
PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_v_sub_name);
|
|
__Pyx_GIVEREF(__pyx_v_sub_name);
|
|
__pyx_t_10 = PyObject_Call(__pyx_t_7, ((PyObject *)__pyx_t_9), NULL); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 526; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
|
|
__Pyx_GOTREF(__pyx_t_10);
|
|
__Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
|
|
__Pyx_DECREF(((PyObject *)__pyx_t_9)); __pyx_t_9 = 0;
|
|
__pyx_t_9 = PyTuple_New(2); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 526; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
|
|
__Pyx_GOTREF(__pyx_t_9);
|
|
__Pyx_INCREF(__pyx_v_sub_name);
|
|
PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_v_sub_name);
|
|
__Pyx_GIVEREF(__pyx_v_sub_name);
|
|
PyTuple_SET_ITEM(__pyx_t_9, 1, __pyx_t_10);
|
|
__Pyx_GIVEREF(__pyx_t_10);
|
|
__pyx_t_10 = 0;
|
|
__pyx_t_10 = PyObject_Call(__pyx_t_5, ((PyObject *)__pyx_t_9), NULL); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 526; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
|
|
__Pyx_GOTREF(__pyx_t_10);
|
|
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
|
|
__Pyx_DECREF(((PyObject *)__pyx_t_9)); __pyx_t_9 = 0;
|
|
__Pyx_XDECREF(__pyx_v_new_m);
|
|
__pyx_v_new_m = __pyx_t_10;
|
|
__pyx_t_10 = 0;
|
|
|
|
/* "capnp.pyx":527
|
|
* for sub_name in re.split('[:.]', name):
|
|
* new_m = local_module.__dict__.get(sub_name, ModuleType(sub_name))
|
|
* new_m._parent_module = local_module # <<<<<<<<<<<<<<
|
|
* local_module.__dict__[sub_name] = new_m
|
|
* local_module = new_m
|
|
*/
|
|
if (__Pyx_PyObject_SetAttrStr(__pyx_v_new_m, __pyx_n_s___parent_module, __pyx_v_local_module) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 527; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
|
|
|
|
/* "capnp.pyx":528
|
|
* new_m = local_module.__dict__.get(sub_name, ModuleType(sub_name))
|
|
* new_m._parent_module = local_module
|
|
* local_module.__dict__[sub_name] = new_m # <<<<<<<<<<<<<<
|
|
* local_module = new_m
|
|
* local_module._root_module = module
|
|
*/
|
|
__pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_v_local_module, __pyx_n_s____dict__); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 528; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
|
|
__Pyx_GOTREF(__pyx_t_10);
|
|
if (PyObject_SetItem(__pyx_t_10, __pyx_v_sub_name, __pyx_v_new_m) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 528; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
|
|
__Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
|
|
|
|
/* "capnp.pyx":529
|
|
* new_m._parent_module = local_module
|
|
* local_module.__dict__[sub_name] = new_m
|
|
* local_module = new_m # <<<<<<<<<<<<<<
|
|
* local_module._root_module = module
|
|
* for nestedNode in node.nestedNodes:
|
|
*/
|
|
__Pyx_INCREF(__pyx_v_new_m);
|
|
__Pyx_DECREF(__pyx_v_local_module);
|
|
__pyx_v_local_module = __pyx_v_new_m;
|
|
}
|
|
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
|
|
|
|
/* "capnp.pyx":530
|
|
* local_module.__dict__[sub_name] = new_m
|
|
* local_module = new_m
|
|
* local_module._root_module = module # <<<<<<<<<<<<<<
|
|
* for nestedNode in node.nestedNodes:
|
|
* s = loader.get(nestedNode.id)
|
|
*/
|
|
if (__Pyx_PyObject_SetAttrStr(__pyx_v_local_module, __pyx_n_s___root_module, __pyx_v_module) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 530; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
|
|
|
|
/* "capnp.pyx":531
|
|
* local_module = new_m
|
|
* local_module._root_module = module
|
|
* for nestedNode in node.nestedNodes: # <<<<<<<<<<<<<<
|
|
* s = loader.get(nestedNode.id)
|
|
* _load(module, s.getProto(), loader, name + ':' + nestedNode.name)
|
|
*/
|
|
__pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_node, __pyx_n_s__nestedNodes); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 531; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
|
|
__Pyx_GOTREF(__pyx_t_6);
|
|
if (PyList_CheckExact(__pyx_t_6) || PyTuple_CheckExact(__pyx_t_6)) {
|
|
__pyx_t_10 = __pyx_t_6; __Pyx_INCREF(__pyx_t_10); __pyx_t_2 = 0;
|
|
__pyx_t_8 = NULL;
|
|
} else {
|
|
__pyx_t_2 = -1; __pyx_t_10 = PyObject_GetIter(__pyx_t_6); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 531; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
|
|
__Pyx_GOTREF(__pyx_t_10);
|
|
__pyx_t_8 = Py_TYPE(__pyx_t_10)->tp_iternext;
|
|
}
|
|
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
|
|
for (;;) {
|
|
if (!__pyx_t_8 && PyList_CheckExact(__pyx_t_10)) {
|
|
if (__pyx_t_2 >= PyList_GET_SIZE(__pyx_t_10)) break;
|
|
#if CYTHON_COMPILING_IN_CPYTHON
|
|
__pyx_t_6 = PyList_GET_ITEM(__pyx_t_10, __pyx_t_2); __Pyx_INCREF(__pyx_t_6); __pyx_t_2++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 531; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
|
|
#else
|
|
__pyx_t_6 = PySequence_ITEM(__pyx_t_10, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 531; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
|
|
#endif
|
|
} else if (!__pyx_t_8 && PyTuple_CheckExact(__pyx_t_10)) {
|
|
if (__pyx_t_2 >= PyTuple_GET_SIZE(__pyx_t_10)) break;
|
|
#if CYTHON_COMPILING_IN_CPYTHON
|
|
__pyx_t_6 = PyTuple_GET_ITEM(__pyx_t_10, __pyx_t_2); __Pyx_INCREF(__pyx_t_6); __pyx_t_2++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 531; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
|
|
#else
|
|
__pyx_t_6 = PySequence_ITEM(__pyx_t_10, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 531; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
|
|
#endif
|
|
} else {
|
|
__pyx_t_6 = __pyx_t_8(__pyx_t_10);
|
|
if (unlikely(!__pyx_t_6)) {
|
|
if (PyErr_Occurred()) {
|
|
if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) PyErr_Clear();
|
|
else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 531; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
|
|
}
|
|
break;
|
|
}
|
|
__Pyx_GOTREF(__pyx_t_6);
|
|
}
|
|
__Pyx_XDECREF(__pyx_v_nestedNode);
|
|
__pyx_v_nestedNode = __pyx_t_6;
|
|
__pyx_t_6 = 0;
|
|
|
|
/* "capnp.pyx":532
|
|
* local_module._root_module = module
|
|
* for nestedNode in node.nestedNodes:
|
|
* s = loader.get(nestedNode.id) # <<<<<<<<<<<<<<
|
|
* _load(module, s.getProto(), loader, name + ':' + nestedNode.name)
|
|
*
|
|
*/
|
|
__pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_loader, __pyx_n_s__get); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 532; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
|
|
__Pyx_GOTREF(__pyx_t_6);
|
|
__pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_nestedNode, __pyx_n_s__id); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 532; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
|
|
__Pyx_GOTREF(__pyx_t_9);
|
|
__pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 532; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
|
|
__Pyx_GOTREF(__pyx_t_5);
|
|
PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_9);
|
|
__Pyx_GIVEREF(__pyx_t_9);
|
|
__pyx_t_9 = 0;
|
|
__pyx_t_9 = PyObject_Call(__pyx_t_6, ((PyObject *)__pyx_t_5), NULL); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 532; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
|
|
__Pyx_GOTREF(__pyx_t_9);
|
|
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
|
|
__Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0;
|
|
__Pyx_XDECREF(__pyx_v_s);
|
|
__pyx_v_s = __pyx_t_9;
|
|
__pyx_t_9 = 0;
|
|
|
|
/* "capnp.pyx":533
|
|
* for nestedNode in node.nestedNodes:
|
|
* s = loader.get(nestedNode.id)
|
|
* _load(module, s.getProto(), loader, name + ':' + nestedNode.name) # <<<<<<<<<<<<<<
|
|
*
|
|
* body = node.body
|
|
*/
|
|
__pyx_t_9 = __Pyx_GetModuleGlobalName(__pyx_n_s___load); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 533; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
|
|
__Pyx_GOTREF(__pyx_t_9);
|
|
__pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_s, __pyx_n_s__getProto); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 533; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
|
|
__Pyx_GOTREF(__pyx_t_5);
|
|
__pyx_t_6 = PyObject_Call(__pyx_t_5, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 533; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
|
|
__Pyx_GOTREF(__pyx_t_6);
|
|
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
|
|
__pyx_t_5 = PyNumber_Add(__pyx_v_name, ((PyObject *)__pyx_kp_s_37)); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 533; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
|
|
__Pyx_GOTREF(__pyx_t_5);
|
|
__pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_nestedNode, __pyx_n_s__name); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 533; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
|
|
__Pyx_GOTREF(__pyx_t_7);
|
|
__pyx_t_11 = PyNumber_Add(__pyx_t_5, __pyx_t_7); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 533; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
|
|
__Pyx_GOTREF(__pyx_t_11);
|
|
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
|
|
__Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
|
|
__pyx_t_7 = PyTuple_New(4); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 533; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
|
|
__Pyx_GOTREF(__pyx_t_7);
|
|
__Pyx_INCREF(__pyx_v_module);
|
|
PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_v_module);
|
|
__Pyx_GIVEREF(__pyx_v_module);
|
|
PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_t_6);
|
|
__Pyx_GIVEREF(__pyx_t_6);
|
|
__Pyx_INCREF(__pyx_v_loader);
|
|
PyTuple_SET_ITEM(__pyx_t_7, 2, __pyx_v_loader);
|
|
__Pyx_GIVEREF(__pyx_v_loader);
|
|
PyTuple_SET_ITEM(__pyx_t_7, 3, __pyx_t_11);
|
|
__Pyx_GIVEREF(__pyx_t_11);
|
|
__pyx_t_6 = 0;
|
|
__pyx_t_11 = 0;
|
|
__pyx_t_11 = PyObject_Call(__pyx_t_9, ((PyObject *)__pyx_t_7), NULL); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 533; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
|
|
__Pyx_GOTREF(__pyx_t_11);
|
|
__Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
|
|
__Pyx_DECREF(((PyObject *)__pyx_t_7)); __pyx_t_7 = 0;
|
|
__Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
|
|
}
|
|
__Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
|
|
|
|
/* "capnp.pyx":535
|
|
* _load(module, s.getProto(), loader, name + ':' + nestedNode.name)
|
|
*
|
|
* body = node.body # <<<<<<<<<<<<<<
|
|
* which = body.which()
|
|
*
|
|
*/
|
|
__pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_v_node, __pyx_n_s__body); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 535; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
|
|
__Pyx_GOTREF(__pyx_t_10);
|
|
__pyx_v_body = __pyx_t_10;
|
|
__pyx_t_10 = 0;
|
|
|
|
/* "capnp.pyx":536
|
|
*
|
|
* body = node.body
|
|
* which = body.which() # <<<<<<<<<<<<<<
|
|
*
|
|
* if which == schema.Node.Body.Which.enumNode:
|
|
*/
|
|
__pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_v_body, __pyx_n_s__which); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 536; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
|
|
__Pyx_GOTREF(__pyx_t_10);
|
|
__pyx_t_11 = PyObject_Call(__pyx_t_10, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 536; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
|
|
__Pyx_GOTREF(__pyx_t_11);
|
|
__Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
|
|
__pyx_v_which = __pyx_t_11;
|
|
__pyx_t_11 = 0;
|
|
|
|
/* "capnp.pyx":538
|
|
* which = body.which()
|
|
*
|
|
* if which == schema.Node.Body.Which.enumNode: # <<<<<<<<<<<<<<
|
|
* enum = body.enumNode
|
|
*
|
|
*/
|
|
__pyx_t_11 = __Pyx_GetModuleGlobalName(__pyx_n_s__schema); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 538; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
|
|
__Pyx_GOTREF(__pyx_t_11);
|
|
__pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_11, __pyx_n_s__Node); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 538; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
|
|
__Pyx_GOTREF(__pyx_t_10);
|
|
__Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
|
|
__pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s__Body); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 538; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
|
|
__Pyx_GOTREF(__pyx_t_11);
|
|
__Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
|
|
__pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_11, __pyx_n_s__Which); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 538; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
|
|
__Pyx_GOTREF(__pyx_t_10);
|
|
__Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
|
|
__pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s__enumNode); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 538; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
|
|
__Pyx_GOTREF(__pyx_t_11);
|
|
__Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
|
|
__pyx_t_10 = PyObject_RichCompare(__pyx_v_which, __pyx_t_11, Py_EQ); __Pyx_XGOTREF(__pyx_t_10); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 538; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
|
|
__Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
|
|
__pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_10); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 538; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
|
|
__Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
|
|
if (__pyx_t_4) {
|
|
|
|
/* "capnp.pyx":539
|
|
*
|
|
* if which == schema.Node.Body.Which.enumNode:
|
|
* enum = body.enumNode # <<<<<<<<<<<<<<
|
|
*
|
|
* local_module._parent_module.__dict__[sub_name] = _make_enum(name, **{upper_and_under(e.name) : e.name for e in enum.enumerants})
|
|
*/
|
|
__pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_v_body, __pyx_n_s__enumNode); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 539; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
|
|
__Pyx_GOTREF(__pyx_t_10);
|
|
__pyx_v_enum = __pyx_t_10;
|
|
__pyx_t_10 = 0;
|
|
|
|
/* "capnp.pyx":541
|
|
* enum = body.enumNode
|
|
*
|
|
* local_module._parent_module.__dict__[sub_name] = _make_enum(name, **{upper_and_under(e.name) : e.name for e in enum.enumerants}) # <<<<<<<<<<<<<<
|
|
* elif which == schema.Node.Body.Which.structNode:
|
|
* struct = body.structNode
|
|
*/
|
|
__pyx_t_10 = __Pyx_GetModuleGlobalName(__pyx_n_s___make_enum); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 541; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
|
|
__Pyx_GOTREF(__pyx_t_10);
|
|
__pyx_t_11 = PyTuple_New(1); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 541; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
|
|
__Pyx_GOTREF(__pyx_t_11);
|
|
__Pyx_INCREF(__pyx_v_name);
|
|
PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_v_name);
|
|
__Pyx_GIVEREF(__pyx_v_name);
|
|
{ /* enter inner scope */
|
|
PyObject *__pyx_7genexpr__pyx_v_e = NULL;
|
|
__pyx_t_9 = PyDict_New(); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 541; __pyx_clineno = __LINE__; goto __pyx_L12_error;}
|
|
__Pyx_GOTREF(__pyx_t_9);
|
|
__pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_enum, __pyx_n_s__enumerants); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 541; __pyx_clineno = __LINE__; goto __pyx_L12_error;}
|
|
__Pyx_GOTREF(__pyx_t_6);
|
|
if (PyList_CheckExact(__pyx_t_6) || PyTuple_CheckExact(__pyx_t_6)) {
|
|
__pyx_t_5 = __pyx_t_6; __Pyx_INCREF(__pyx_t_5); __pyx_t_2 = 0;
|
|
__pyx_t_8 = NULL;
|
|
} else {
|
|
__pyx_t_2 = -1; __pyx_t_5 = PyObject_GetIter(__pyx_t_6); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 541; __pyx_clineno = __LINE__; goto __pyx_L12_error;}
|
|
__Pyx_GOTREF(__pyx_t_5);
|
|
__pyx_t_8 = Py_TYPE(__pyx_t_5)->tp_iternext;
|
|
}
|
|
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
|
|
for (;;) {
|
|
if (!__pyx_t_8 && PyList_CheckExact(__pyx_t_5)) {
|
|
if (__pyx_t_2 >= PyList_GET_SIZE(__pyx_t_5)) break;
|
|
#if CYTHON_COMPILING_IN_CPYTHON
|
|
__pyx_t_6 = PyList_GET_ITEM(__pyx_t_5, __pyx_t_2); __Pyx_INCREF(__pyx_t_6); __pyx_t_2++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 541; __pyx_clineno = __LINE__; goto __pyx_L12_error;}
|
|
#else
|
|
__pyx_t_6 = PySequence_ITEM(__pyx_t_5, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 541; __pyx_clineno = __LINE__; goto __pyx_L12_error;}
|
|
#endif
|
|
} else if (!__pyx_t_8 && PyTuple_CheckExact(__pyx_t_5)) {
|
|
if (__pyx_t_2 >= PyTuple_GET_SIZE(__pyx_t_5)) break;
|
|
#if CYTHON_COMPILING_IN_CPYTHON
|
|
__pyx_t_6 = PyTuple_GET_ITEM(__pyx_t_5, __pyx_t_2); __Pyx_INCREF(__pyx_t_6); __pyx_t_2++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 541; __pyx_clineno = __LINE__; goto __pyx_L12_error;}
|
|
#else
|
|
__pyx_t_6 = PySequence_ITEM(__pyx_t_5, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 541; __pyx_clineno = __LINE__; goto __pyx_L12_error;}
|
|
#endif
|
|
} else {
|
|
__pyx_t_6 = __pyx_t_8(__pyx_t_5);
|
|
if (unlikely(!__pyx_t_6)) {
|
|
if (PyErr_Occurred()) {
|
|
if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) PyErr_Clear();
|
|
else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 541; __pyx_clineno = __LINE__; goto __pyx_L12_error;}
|
|
}
|
|
break;
|
|
}
|
|
__Pyx_GOTREF(__pyx_t_6);
|
|
}
|
|
__Pyx_XDECREF(__pyx_7genexpr__pyx_v_e);
|
|
__pyx_7genexpr__pyx_v_e = __pyx_t_6;
|
|
__pyx_t_6 = 0;
|
|
__pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s__upper_and_under); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 541; __pyx_clineno = __LINE__; goto __pyx_L12_error;}
|
|
__Pyx_GOTREF(__pyx_t_6);
|
|
__pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_7genexpr__pyx_v_e, __pyx_n_s__name); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 541; __pyx_clineno = __LINE__; goto __pyx_L12_error;}
|
|
__Pyx_GOTREF(__pyx_t_12);
|
|
__pyx_t_13 = PyTuple_New(1); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 541; __pyx_clineno = __LINE__; goto __pyx_L12_error;}
|
|
__Pyx_GOTREF(__pyx_t_13);
|
|
PyTuple_SET_ITEM(__pyx_t_13, 0, __pyx_t_12);
|
|
__Pyx_GIVEREF(__pyx_t_12);
|
|
__pyx_t_12 = 0;
|
|
__pyx_t_12 = PyObject_Call(__pyx_t_6, ((PyObject *)__pyx_t_13), NULL); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 541; __pyx_clineno = __LINE__; goto __pyx_L12_error;}
|
|
__Pyx_GOTREF(__pyx_t_12);
|
|
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
|
|
__Pyx_DECREF(((PyObject *)__pyx_t_13)); __pyx_t_13 = 0;
|
|
__pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_7genexpr__pyx_v_e, __pyx_n_s__name); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 541; __pyx_clineno = __LINE__; goto __pyx_L12_error;}
|
|
__Pyx_GOTREF(__pyx_t_13);
|
|
if (unlikely(PyDict_SetItem(__pyx_t_9, (PyObject*)__pyx_t_12, (PyObject*)__pyx_t_13))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 541; __pyx_clineno = __LINE__; goto __pyx_L12_error;}
|
|
__Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
|
|
__Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
|
|
}
|
|
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
|
|
__Pyx_XDECREF(__pyx_7genexpr__pyx_v_e);
|
|
goto __pyx_L15_exit_scope;
|
|
__pyx_L12_error:;
|
|
__Pyx_XDECREF(__pyx_7genexpr__pyx_v_e);
|
|
goto __pyx_L1_error;
|
|
__pyx_L15_exit_scope:;
|
|
} /* exit inner scope */
|
|
__pyx_t_7 = ((PyObject *)__pyx_t_9);
|
|
__Pyx_INCREF(__pyx_t_7);
|
|
__Pyx_DECREF(((PyObject *)__pyx_t_9)); __pyx_t_9 = 0;
|
|
__pyx_t_9 = PyObject_Call(__pyx_t_10, ((PyObject *)__pyx_t_11), ((PyObject *)__pyx_t_7)); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 541; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
|
|
__Pyx_GOTREF(__pyx_t_9);
|
|
__Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
|
|
__Pyx_DECREF(((PyObject *)__pyx_t_11)); __pyx_t_11 = 0;
|
|
__Pyx_DECREF(((PyObject *)__pyx_t_7)); __pyx_t_7 = 0;
|
|
__pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_local_module, __pyx_n_s___parent_module); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 541; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
|
|
__Pyx_GOTREF(__pyx_t_7);
|
|
__pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s____dict__); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 541; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
|
|
__Pyx_GOTREF(__pyx_t_11);
|
|
__Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
|
|
if (unlikely(!__pyx_v_sub_name)) { __Pyx_RaiseUnboundLocalError("sub_name"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 541; __pyx_clineno = __LINE__; goto __pyx_L1_error;} }
|
|
if (PyObject_SetItem(__pyx_t_11, __pyx_v_sub_name, __pyx_t_9) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 541; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
|
|
__Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
|
|
__Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
|
|
goto __pyx_L9;
|
|
}
|
|
|
|
/* "capnp.pyx":542
|
|
*
|
|
* local_module._parent_module.__dict__[sub_name] = _make_enum(name, **{upper_and_under(e.name) : e.name for e in enum.enumerants})
|
|
* elif which == schema.Node.Body.Which.structNode: # <<<<<<<<<<<<<<
|
|
* struct = body.structNode
|
|
*
|
|
*/
|
|
__pyx_t_9 = __Pyx_GetModuleGlobalName(__pyx_n_s__schema); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 542; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
|
|
__Pyx_GOTREF(__pyx_t_9);
|
|
__pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s__Node); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 542; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
|
|
__Pyx_GOTREF(__pyx_t_11);
|
|
__Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
|
|
__pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_11, __pyx_n_s__Body); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 542; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
|
|
__Pyx_GOTREF(__pyx_t_9);
|
|
__Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
|
|
__pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s__Which); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 542; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
|
|
__Pyx_GOTREF(__pyx_t_11);
|
|
__Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
|
|
__pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_11, __pyx_n_s__structNode); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 542; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
|
|
__Pyx_GOTREF(__pyx_t_9);
|
|
__Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
|
|
__pyx_t_11 = PyObject_RichCompare(__pyx_v_which, __pyx_t_9, Py_EQ); __Pyx_XGOTREF(__pyx_t_11); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 542; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
|
|
__Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
|
|
__pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_11); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 542; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
|
|
__Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
|
|
if (__pyx_t_4) {
|
|
|
|
/* "capnp.pyx":543
|
|
* local_module._parent_module.__dict__[sub_name] = _make_enum(name, **{upper_and_under(e.name) : e.name for e in enum.enumerants})
|
|
* elif which == schema.Node.Body.Which.structNode:
|
|
* struct = body.structNode # <<<<<<<<<<<<<<
|
|
*
|
|
* for member in struct.members:
|
|
*/
|
|
__pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_v_body, __pyx_n_s__structNode); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 543; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
|
|
__Pyx_GOTREF(__pyx_t_11);
|
|
__pyx_v_struct = __pyx_t_11;
|
|
__pyx_t_11 = 0;
|
|
|
|
/* "capnp.pyx":545
|
|
* struct = body.structNode
|
|
*
|
|
* for member in struct.members: # <<<<<<<<<<<<<<
|
|
* if member.body.which() == schema.StructNode.Member.Body.Which.unionMember:
|
|
* sub_name = capitalize(member.name)
|
|
*/
|
|
__pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_v_struct, __pyx_n_s__members); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 545; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
|
|
__Pyx_GOTREF(__pyx_t_11);
|
|
if (PyList_CheckExact(__pyx_t_11) || PyTuple_CheckExact(__pyx_t_11)) {
|
|
__pyx_t_9 = __pyx_t_11; __Pyx_INCREF(__pyx_t_9); __pyx_t_2 = 0;
|
|
__pyx_t_8 = NULL;
|
|
} else {
|
|
__pyx_t_2 = -1; __pyx_t_9 = PyObject_GetIter(__pyx_t_11); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 545; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
|
|
__Pyx_GOTREF(__pyx_t_9);
|
|
__pyx_t_8 = Py_TYPE(__pyx_t_9)->tp_iternext;
|
|
}
|
|
__Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
|
|
for (;;) {
|
|
if (!__pyx_t_8 && PyList_CheckExact(__pyx_t_9)) {
|
|
if (__pyx_t_2 >= PyList_GET_SIZE(__pyx_t_9)) break;
|
|
#if CYTHON_COMPILING_IN_CPYTHON
|
|
__pyx_t_11 = PyList_GET_ITEM(__pyx_t_9, __pyx_t_2); __Pyx_INCREF(__pyx_t_11); __pyx_t_2++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 545; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
|
|
#else
|
|
__pyx_t_11 = PySequence_ITEM(__pyx_t_9, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 545; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
|
|
#endif
|
|
} else if (!__pyx_t_8 && PyTuple_CheckExact(__pyx_t_9)) {
|
|
if (__pyx_t_2 >= PyTuple_GET_SIZE(__pyx_t_9)) break;
|
|
#if CYTHON_COMPILING_IN_CPYTHON
|
|
__pyx_t_11 = PyTuple_GET_ITEM(__pyx_t_9, __pyx_t_2); __Pyx_INCREF(__pyx_t_11); __pyx_t_2++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 545; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
|
|
#else
|
|
__pyx_t_11 = PySequence_ITEM(__pyx_t_9, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 545; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
|
|
#endif
|
|
} else {
|
|
__pyx_t_11 = __pyx_t_8(__pyx_t_9);
|
|
if (unlikely(!__pyx_t_11)) {
|
|
if (PyErr_Occurred()) {
|
|
if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) PyErr_Clear();
|
|
else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 545; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
|
|
}
|
|
break;
|
|
}
|
|
__Pyx_GOTREF(__pyx_t_11);
|
|
}
|
|
__Pyx_XDECREF(__pyx_v_member);
|
|
__pyx_v_member = __pyx_t_11;
|
|
__pyx_t_11 = 0;
|
|
|
|
/* "capnp.pyx":546
|
|
*
|
|
* for member in struct.members:
|
|
* if member.body.which() == schema.StructNode.Member.Body.Which.unionMember: # <<<<<<<<<<<<<<
|
|
* sub_name = capitalize(member.name)
|
|
* new_m = local_module.__dict__.get(sub_name, ModuleType(sub_name))
|
|
*/
|
|
__pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_v_member, __pyx_n_s__body); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 546; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
|
|
__Pyx_GOTREF(__pyx_t_11);
|
|
__pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_11, __pyx_n_s__which); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 546; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
|
|
__Pyx_GOTREF(__pyx_t_7);
|
|
__Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
|
|
__pyx_t_11 = PyObject_Call(__pyx_t_7, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 546; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
|
|
__Pyx_GOTREF(__pyx_t_11);
|
|
__Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
|
|
__pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s__schema); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 546; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
|
|
__Pyx_GOTREF(__pyx_t_7);
|
|
__pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s__StructNode); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 546; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
|
|
__Pyx_GOTREF(__pyx_t_10);
|
|
__Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
|
|
__pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s__Member); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 546; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
|
|
__Pyx_GOTREF(__pyx_t_7);
|
|
__Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
|
|
__pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s__Body); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 546; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
|
|
__Pyx_GOTREF(__pyx_t_10);
|
|
__Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
|
|
__pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s__Which); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 546; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
|
|
__Pyx_GOTREF(__pyx_t_7);
|
|
__Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
|
|
__pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s__unionMember); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 546; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
|
|
__Pyx_GOTREF(__pyx_t_10);
|
|
__Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
|
|
__pyx_t_7 = PyObject_RichCompare(__pyx_t_11, __pyx_t_10, Py_EQ); __Pyx_XGOTREF(__pyx_t_7); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 546; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
|
|
__Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
|
|
__Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
|
|
__pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 546; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
|
|
__Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
|
|
if (__pyx_t_4) {
|
|
|
|
/* "capnp.pyx":547
|
|
* for member in struct.members:
|
|
* if member.body.which() == schema.StructNode.Member.Body.Which.unionMember:
|
|
* sub_name = capitalize(member.name) # <<<<<<<<<<<<<<
|
|
* new_m = local_module.__dict__.get(sub_name, ModuleType(sub_name))
|
|
* local_module.__dict__[sub_name] = new_m
|
|
*/
|
|
__pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s__capitalize); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 547; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
|
|
__Pyx_GOTREF(__pyx_t_7);
|
|
__pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_v_member, __pyx_n_s__name); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 547; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
|
|
__Pyx_GOTREF(__pyx_t_10);
|
|
__pyx_t_11 = PyTuple_New(1); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 547; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
|
|
__Pyx_GOTREF(__pyx_t_11);
|
|
PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_10);
|
|
__Pyx_GIVEREF(__pyx_t_10);
|
|
__pyx_t_10 = 0;
|
|
__pyx_t_10 = PyObject_Call(__pyx_t_7, ((PyObject *)__pyx_t_11), NULL); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 547; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
|
|
__Pyx_GOTREF(__pyx_t_10);
|
|
__Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
|
|
__Pyx_DECREF(((PyObject *)__pyx_t_11)); __pyx_t_11 = 0;
|
|
__Pyx_XDECREF(__pyx_v_sub_name);
|
|
__pyx_v_sub_name = __pyx_t_10;
|
|
__pyx_t_10 = 0;
|
|
|
|
/* "capnp.pyx":548
|
|
* if member.body.which() == schema.StructNode.Member.Body.Which.unionMember:
|
|
* sub_name = capitalize(member.name)
|
|
* new_m = local_module.__dict__.get(sub_name, ModuleType(sub_name)) # <<<<<<<<<<<<<<
|
|
* local_module.__dict__[sub_name] = new_m
|
|
*
|
|
*/
|
|
__pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_v_local_module, __pyx_n_s____dict__); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 548; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
|
|
__Pyx_GOTREF(__pyx_t_10);
|
|
__pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s__get); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 548; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
|
|
__Pyx_GOTREF(__pyx_t_11);
|
|
__Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
|
|
__pyx_t_10 = __Pyx_GetModuleGlobalName(__pyx_n_s__ModuleType); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 548; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
|
|
__Pyx_GOTREF(__pyx_t_10);
|
|
__pyx_t_7 = PyTuple_New(1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 548; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
|
|
__Pyx_GOTREF(__pyx_t_7);
|
|
__Pyx_INCREF(__pyx_v_sub_name);
|
|
PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_v_sub_name);
|
|
__Pyx_GIVEREF(__pyx_v_sub_name);
|
|
__pyx_t_5 = PyObject_Call(__pyx_t_10, ((PyObject *)__pyx_t_7), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 548; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
|
|
__Pyx_GOTREF(__pyx_t_5);
|
|
__Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
|
|
__Pyx_DECREF(((PyObject *)__pyx_t_7)); __pyx_t_7 = 0;
|
|
__pyx_t_7 = PyTuple_New(2); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 548; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
|
|
__Pyx_GOTREF(__pyx_t_7);
|
|
__Pyx_INCREF(__pyx_v_sub_name);
|
|
PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_v_sub_name);
|
|
__Pyx_GIVEREF(__pyx_v_sub_name);
|
|
PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_t_5);
|
|
__Pyx_GIVEREF(__pyx_t_5);
|
|
__pyx_t_5 = 0;
|
|
__pyx_t_5 = PyObject_Call(__pyx_t_11, ((PyObject *)__pyx_t_7), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 548; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
|
|
__Pyx_GOTREF(__pyx_t_5);
|
|
__Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
|
|
__Pyx_DECREF(((PyObject *)__pyx_t_7)); __pyx_t_7 = 0;
|
|
__Pyx_XDECREF(__pyx_v_new_m);
|
|
__pyx_v_new_m = __pyx_t_5;
|
|
__pyx_t_5 = 0;
|
|
|
|
/* "capnp.pyx":549
|
|
* sub_name = capitalize(member.name)
|
|
* new_m = local_module.__dict__.get(sub_name, ModuleType(sub_name))
|
|
* local_module.__dict__[sub_name] = new_m # <<<<<<<<<<<<<<
|
|
*
|
|
* new_m.Which = _make_enum(sub_name+':Which', **{upper_and_under(e.name) : e.name for e in member.body.unionMember.members})
|
|
*/
|
|
__pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_local_module, __pyx_n_s____dict__); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 549; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
|
|
__Pyx_GOTREF(__pyx_t_5);
|
|
if (PyObject_SetItem(__pyx_t_5, __pyx_v_sub_name, __pyx_v_new_m) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 549; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
|
|
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
|
|
|
|
/* "capnp.pyx":551
|
|
* local_module.__dict__[sub_name] = new_m
|
|
*
|
|
* new_m.Which = _make_enum(sub_name+':Which', **{upper_and_under(e.name) : e.name for e in member.body.unionMember.members}) # <<<<<<<<<<<<<<
|
|
*
|
|
* return local_module
|
|
*/
|
|
__pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s___make_enum); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 551; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
|
|
__Pyx_GOTREF(__pyx_t_5);
|
|
__pyx_t_7 = PyNumber_Add(__pyx_v_sub_name, ((PyObject *)__pyx_kp_s_40)); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 551; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
|
|
__Pyx_GOTREF(__pyx_t_7);
|
|
__pyx_t_11 = PyTuple_New(1); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 551; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
|
|
__Pyx_GOTREF(__pyx_t_11);
|
|
PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_7);
|
|
__Pyx_GIVEREF(__pyx_t_7);
|
|
__pyx_t_7 = 0;
|
|
{ /* enter inner scope */
|
|
PyObject *__pyx_8genexpr1__pyx_v_e = NULL;
|
|
__pyx_t_10 = PyDict_New(); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 551; __pyx_clineno = __LINE__; goto __pyx_L21_error;}
|
|
__Pyx_GOTREF(__pyx_t_10);
|
|
__pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_v_member, __pyx_n_s__body); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 551; __pyx_clineno = __LINE__; goto __pyx_L21_error;}
|
|
__Pyx_GOTREF(__pyx_t_13);
|
|
__pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_t_13, __pyx_n_s__unionMember); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 551; __pyx_clineno = __LINE__; goto __pyx_L21_error;}
|
|
__Pyx_GOTREF(__pyx_t_12);
|
|
__Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
|
|
__pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_t_12, __pyx_n_s__members); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 551; __pyx_clineno = __LINE__; goto __pyx_L21_error;}
|
|
__Pyx_GOTREF(__pyx_t_13);
|
|
__Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
|
|
if (PyList_CheckExact(__pyx_t_13) || PyTuple_CheckExact(__pyx_t_13)) {
|
|
__pyx_t_12 = __pyx_t_13; __Pyx_INCREF(__pyx_t_12); __pyx_t_14 = 0;
|
|
__pyx_t_15 = NULL;
|
|
} else {
|
|
__pyx_t_14 = -1; __pyx_t_12 = PyObject_GetIter(__pyx_t_13); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 551; __pyx_clineno = __LINE__; goto __pyx_L21_error;}
|
|
__Pyx_GOTREF(__pyx_t_12);
|
|
__pyx_t_15 = Py_TYPE(__pyx_t_12)->tp_iternext;
|
|
}
|
|
__Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
|
|
for (;;) {
|
|
if (!__pyx_t_15 && PyList_CheckExact(__pyx_t_12)) {
|
|
if (__pyx_t_14 >= PyList_GET_SIZE(__pyx_t_12)) break;
|
|
#if CYTHON_COMPILING_IN_CPYTHON
|
|
__pyx_t_13 = PyList_GET_ITEM(__pyx_t_12, __pyx_t_14); __Pyx_INCREF(__pyx_t_13); __pyx_t_14++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 551; __pyx_clineno = __LINE__; goto __pyx_L21_error;}
|
|
#else
|
|
__pyx_t_13 = PySequence_ITEM(__pyx_t_12, __pyx_t_14); __pyx_t_14++; if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 551; __pyx_clineno = __LINE__; goto __pyx_L21_error;}
|
|
#endif
|
|
} else if (!__pyx_t_15 && PyTuple_CheckExact(__pyx_t_12)) {
|
|
if (__pyx_t_14 >= PyTuple_GET_SIZE(__pyx_t_12)) break;
|
|
#if CYTHON_COMPILING_IN_CPYTHON
|
|
__pyx_t_13 = PyTuple_GET_ITEM(__pyx_t_12, __pyx_t_14); __Pyx_INCREF(__pyx_t_13); __pyx_t_14++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 551; __pyx_clineno = __LINE__; goto __pyx_L21_error;}
|
|
#else
|
|
__pyx_t_13 = PySequence_ITEM(__pyx_t_12, __pyx_t_14); __pyx_t_14++; if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 551; __pyx_clineno = __LINE__; goto __pyx_L21_error;}
|
|
#endif
|
|
} else {
|
|
__pyx_t_13 = __pyx_t_15(__pyx_t_12);
|
|
if (unlikely(!__pyx_t_13)) {
|
|
if (PyErr_Occurred()) {
|
|
if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) PyErr_Clear();
|
|
else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 551; __pyx_clineno = __LINE__; goto __pyx_L21_error;}
|
|
}
|
|
break;
|
|
}
|
|
__Pyx_GOTREF(__pyx_t_13);
|
|
}
|
|
__Pyx_XDECREF(__pyx_8genexpr1__pyx_v_e);
|
|
__pyx_8genexpr1__pyx_v_e = __pyx_t_13;
|
|
__pyx_t_13 = 0;
|
|
__pyx_t_13 = __Pyx_GetModuleGlobalName(__pyx_n_s__upper_and_under); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 551; __pyx_clineno = __LINE__; goto __pyx_L21_error;}
|
|
__Pyx_GOTREF(__pyx_t_13);
|
|
__pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_8genexpr1__pyx_v_e, __pyx_n_s__name); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 551; __pyx_clineno = __LINE__; goto __pyx_L21_error;}
|
|
__Pyx_GOTREF(__pyx_t_6);
|
|
__pyx_t_16 = PyTuple_New(1); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 551; __pyx_clineno = __LINE__; goto __pyx_L21_error;}
|
|
__Pyx_GOTREF(__pyx_t_16);
|
|
PyTuple_SET_ITEM(__pyx_t_16, 0, __pyx_t_6);
|
|
__Pyx_GIVEREF(__pyx_t_6);
|
|
__pyx_t_6 = 0;
|
|
__pyx_t_6 = PyObject_Call(__pyx_t_13, ((PyObject *)__pyx_t_16), NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 551; __pyx_clineno = __LINE__; goto __pyx_L21_error;}
|
|
__Pyx_GOTREF(__pyx_t_6);
|
|
__Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
|
|
__Pyx_DECREF(((PyObject *)__pyx_t_16)); __pyx_t_16 = 0;
|
|
__pyx_t_16 = __Pyx_PyObject_GetAttrStr(__pyx_8genexpr1__pyx_v_e, __pyx_n_s__name); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 551; __pyx_clineno = __LINE__; goto __pyx_L21_error;}
|
|
__Pyx_GOTREF(__pyx_t_16);
|
|
if (unlikely(PyDict_SetItem(__pyx_t_10, (PyObject*)__pyx_t_6, (PyObject*)__pyx_t_16))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 551; __pyx_clineno = __LINE__; goto __pyx_L21_error;}
|
|
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
|
|
__Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
|
|
}
|
|
__Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
|
|
__Pyx_XDECREF(__pyx_8genexpr1__pyx_v_e);
|
|
goto __pyx_L24_exit_scope;
|
|
__pyx_L21_error:;
|
|
__Pyx_XDECREF(__pyx_8genexpr1__pyx_v_e);
|
|
goto __pyx_L1_error;
|
|
__pyx_L24_exit_scope:;
|
|
} /* exit inner scope */
|
|
__pyx_t_7 = ((PyObject *)__pyx_t_10);
|
|
__Pyx_INCREF(__pyx_t_7);
|
|
__Pyx_DECREF(((PyObject *)__pyx_t_10)); __pyx_t_10 = 0;
|
|
__pyx_t_10 = PyObject_Call(__pyx_t_5, ((PyObject *)__pyx_t_11), ((PyObject *)__pyx_t_7)); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 551; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
|
|
__Pyx_GOTREF(__pyx_t_10);
|
|
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
|
|
__Pyx_DECREF(((PyObject *)__pyx_t_11)); __pyx_t_11 = 0;
|
|
__Pyx_DECREF(((PyObject *)__pyx_t_7)); __pyx_t_7 = 0;
|
|
if (__Pyx_PyObject_SetAttrStr(__pyx_v_new_m, __pyx_n_s__Which, __pyx_t_10) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 551; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
|
|
__Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
|
|
goto __pyx_L18;
|
|
}
|
|
__pyx_L18:;
|
|
}
|
|
__Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
|
|
goto __pyx_L9;
|
|
}
|
|
__pyx_L9:;
|
|
|
|
/* "capnp.pyx":553
|
|
* new_m.Which = _make_enum(sub_name+':Which', **{upper_and_under(e.name) : e.name for e in member.body.unionMember.members})
|
|
*
|
|
* return local_module # <<<<<<<<<<<<<<
|
|
*
|
|
* def load(file_name, cat_path='/bin/cat'):
|
|
*/
|
|
__Pyx_XDECREF(__pyx_r);
|
|
__Pyx_INCREF(__pyx_v_local_module);
|
|
__pyx_r = __pyx_v_local_module;
|
|
goto __pyx_L0;
|
|
|
|
__pyx_r = Py_None; __Pyx_INCREF(Py_None);
|
|
goto __pyx_L0;
|
|
__pyx_L1_error:;
|
|
__Pyx_XDECREF(__pyx_t_5);
|
|
__Pyx_XDECREF(__pyx_t_6);
|
|
__Pyx_XDECREF(__pyx_t_7);
|
|
__Pyx_XDECREF(__pyx_t_9);
|
|
__Pyx_XDECREF(__pyx_t_10);
|
|
__Pyx_XDECREF(__pyx_t_11);
|
|
__Pyx_XDECREF(__pyx_t_12);
|
|
__Pyx_XDECREF(__pyx_t_13);
|
|
__Pyx_XDECREF(__pyx_t_16);
|
|
__Pyx_AddTraceback("capnp._load", __pyx_clineno, __pyx_lineno, __pyx_filename);
|
|
__pyx_r = NULL;
|
|
__pyx_L0:;
|
|
__Pyx_XDECREF(__pyx_v_local_module);
|
|
__Pyx_XDECREF(__pyx_v_sub_name);
|
|
__Pyx_XDECREF(__pyx_v_new_m);
|
|
__Pyx_XDECREF(__pyx_v_nestedNode);
|
|
__Pyx_XDECREF(__pyx_v_s);
|
|
__Pyx_XDECREF(__pyx_v_body);
|
|
__Pyx_XDECREF(__pyx_v_which);
|
|
__Pyx_XDECREF(__pyx_v_enum);
|
|
__Pyx_XDECREF(__pyx_v_struct);
|
|
__Pyx_XDECREF(__pyx_v_member);
|
|
__Pyx_XDECREF(__pyx_v_name);
|
|
__Pyx_XGIVEREF(__pyx_r);
|
|
__Pyx_RefNannyFinishContext();
|
|
return __pyx_r;
|
|
}
|
|
|
|
/* Python wrapper */
|
|
static PyObject *__pyx_pw_5capnp_13load(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
|
|
static PyMethodDef __pyx_mdef_5capnp_13load = {__Pyx_NAMESTR("load"), (PyCFunction)__pyx_pw_5capnp_13load, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)};
|
|
static PyObject *__pyx_pw_5capnp_13load(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
|
|
PyObject *__pyx_v_file_name = 0;
|
|
PyObject *__pyx_v_cat_path = 0;
|
|
int __pyx_lineno = 0;
|
|
const char *__pyx_filename = NULL;
|
|
int __pyx_clineno = 0;
|
|
PyObject *__pyx_r = 0;
|
|
__Pyx_RefNannyDeclarations
|
|
__Pyx_RefNannySetupContext("load (wrapper)", 0);
|
|
{
|
|
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__file_name,&__pyx_n_s__cat_path,0};
|
|
PyObject* values[2] = {0,0};
|
|
values[1] = ((PyObject *)__pyx_kp_s_41);
|
|
if (unlikely(__pyx_kwds)) {
|
|
Py_ssize_t kw_args;
|
|
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
|
|
switch (pos_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;
|
|
}
|
|
kw_args = PyDict_Size(__pyx_kwds);
|
|
switch (pos_args) {
|
|
case 0:
|
|
if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__file_name)) != 0)) kw_args--;
|
|
else goto __pyx_L5_argtuple_error;
|
|
case 1:
|
|
if (kw_args > 0) {
|
|
PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__cat_path);
|
|
if (value) { values[1] = value; kw_args--; }
|
|
}
|
|
}
|
|
if (unlikely(kw_args > 0)) {
|
|
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "load") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 555; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
|
|
}
|
|
} else {
|
|
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);
|
|
break;
|
|
default: goto __pyx_L5_argtuple_error;
|
|
}
|
|
}
|
|
__pyx_v_file_name = values[0];
|
|
__pyx_v_cat_path = values[1];
|
|
}
|
|
goto __pyx_L4_argument_unpacking_done;
|
|
__pyx_L5_argtuple_error:;
|
|
__Pyx_RaiseArgtupleInvalid("load", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 555; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
|
|
__pyx_L3_error:;
|
|
__Pyx_AddTraceback("capnp.load", __pyx_clineno, __pyx_lineno, __pyx_filename);
|
|
__Pyx_RefNannyFinishContext();
|
|
return NULL;
|
|
__pyx_L4_argument_unpacking_done:;
|
|
__pyx_r = __pyx_pf_5capnp_12load(__pyx_self, __pyx_v_file_name, __pyx_v_cat_path);
|
|
__Pyx_RefNannyFinishContext();
|
|
return __pyx_r;
|
|
}
|
|
|
|
/* "capnp.pyx":555
|
|
* return local_module
|
|
*
|
|
* def load(file_name, cat_path='/bin/cat'): # <<<<<<<<<<<<<<
|
|
* p = subprocess.Popen(['capnpc', '-o'+cat_path, file_name], stdout=subprocess.PIPE)
|
|
* retcode = p.wait()
|
|
*/
|
|
|
|
static PyObject *__pyx_pf_5capnp_12load(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_file_name, PyObject *__pyx_v_cat_path) {
|
|
PyObject *__pyx_v_p = NULL;
|
|
PyObject *__pyx_v_retcode = NULL;
|
|
PyObject *__pyx_v_reader = NULL;
|
|
PyObject *__pyx_v_request = NULL;
|
|
PyObject *__pyx_v_module = NULL;
|
|
struct __pyx_obj_5capnp_SchemaLoader *__pyx_v_loader = NULL;
|
|
PyObject *__pyx_v_node = NULL;
|
|
PyObject *__pyx_v_s = NULL;
|
|
PyObject *__pyx_v_local_module = NULL;
|
|
PyObject *__pyx_r = NULL;
|
|
__Pyx_RefNannyDeclarations
|
|
PyObject *__pyx_t_1 = NULL;
|
|
PyObject *__pyx_t_2 = NULL;
|
|
PyObject *__pyx_t_3 = NULL;
|
|
PyObject *__pyx_t_4 = NULL;
|
|
PyObject *__pyx_t_5 = NULL;
|
|
int __pyx_t_6;
|
|
Py_ssize_t __pyx_t_7;
|
|
PyObject *(*__pyx_t_8)(PyObject *);
|
|
PyObject *__pyx_t_9 = NULL;
|
|
PyObject *__pyx_t_10 = NULL;
|
|
PyObject *__pyx_t_11 = NULL;
|
|
PyObject *__pyx_t_12 = NULL;
|
|
PyObject *__pyx_t_13 = NULL;
|
|
int __pyx_lineno = 0;
|
|
const char *__pyx_filename = NULL;
|
|
int __pyx_clineno = 0;
|
|
__Pyx_RefNannySetupContext("load", 0);
|
|
|
|
/* "capnp.pyx":556
|
|
*
|
|
* def load(file_name, cat_path='/bin/cat'):
|
|
* p = subprocess.Popen(['capnpc', '-o'+cat_path, file_name], stdout=subprocess.PIPE) # <<<<<<<<<<<<<<
|
|
* retcode = p.wait()
|
|
* if retcode != 0:
|
|
*/
|
|
__pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s__subprocess); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 556; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
|
|
__Pyx_GOTREF(__pyx_t_1);
|
|
__pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s__Popen); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 556; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
|
|
__Pyx_GOTREF(__pyx_t_2);
|
|
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
|
|
__pyx_t_1 = PyNumber_Add(((PyObject *)__pyx_kp_s_42), __pyx_v_cat_path); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 556; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
|
|
__Pyx_GOTREF(__pyx_t_1);
|
|
__pyx_t_3 = PyList_New(3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 556; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
|
|
__Pyx_GOTREF(__pyx_t_3);
|
|
__Pyx_INCREF(((PyObject *)__pyx_n_s__capnpc));
|
|
PyList_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_n_s__capnpc));
|
|
__Pyx_GIVEREF(((PyObject *)__pyx_n_s__capnpc));
|
|
PyList_SET_ITEM(__pyx_t_3, 1, __pyx_t_1);
|
|
__Pyx_GIVEREF(__pyx_t_1);
|
|
__Pyx_INCREF(__pyx_v_file_name);
|
|
PyList_SET_ITEM(__pyx_t_3, 2, __pyx_v_file_name);
|
|
__Pyx_GIVEREF(__pyx_v_file_name);
|
|
__pyx_t_1 = 0;
|
|
__pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 556; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
|
|
__Pyx_GOTREF(__pyx_t_1);
|
|
PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_t_3));
|
|
__Pyx_GIVEREF(((PyObject *)__pyx_t_3));
|
|
__pyx_t_3 = 0;
|
|
__pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 556; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
|
|
__Pyx_GOTREF(((PyObject *)__pyx_t_3));
|
|
__pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s__subprocess); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 556; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
|
|
__Pyx_GOTREF(__pyx_t_4);
|
|
__pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s__PIPE); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 556; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
|
|
__Pyx_GOTREF(__pyx_t_5);
|
|
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
|
|
if (PyDict_SetItem(__pyx_t_3, ((PyObject *)__pyx_n_s__stdout), __pyx_t_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 556; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
|
|
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
|
|
__pyx_t_5 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_t_1), ((PyObject *)__pyx_t_3)); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 556; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
|
|
__Pyx_GOTREF(__pyx_t_5);
|
|
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
|
|
__Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
|
|
__Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
|
|
__pyx_v_p = __pyx_t_5;
|
|
__pyx_t_5 = 0;
|
|
|
|
/* "capnp.pyx":557
|
|
* def load(file_name, cat_path='/bin/cat'):
|
|
* p = subprocess.Popen(['capnpc', '-o'+cat_path, file_name], stdout=subprocess.PIPE)
|
|
* retcode = p.wait() # <<<<<<<<<<<<<<
|
|
* if retcode != 0:
|
|
* raise RuntimeError("capnpc failed for some reason")
|
|
*/
|
|
__pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_p, __pyx_n_s__wait); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 557; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
|
|
__Pyx_GOTREF(__pyx_t_5);
|
|
__pyx_t_3 = PyObject_Call(__pyx_t_5, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 557; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
|
|
__Pyx_GOTREF(__pyx_t_3);
|
|
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
|
|
__pyx_v_retcode = __pyx_t_3;
|
|
__pyx_t_3 = 0;
|
|
|
|
/* "capnp.pyx":558
|
|
* p = subprocess.Popen(['capnpc', '-o'+cat_path, file_name], stdout=subprocess.PIPE)
|
|
* retcode = p.wait()
|
|
* if retcode != 0: # <<<<<<<<<<<<<<
|
|
* raise RuntimeError("capnpc failed for some reason")
|
|
*
|
|
*/
|
|
__pyx_t_3 = PyObject_RichCompare(__pyx_v_retcode, __pyx_int_0, Py_NE); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 558; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
|
|
__pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 558; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
|
|
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
|
|
if (__pyx_t_6) {
|
|
|
|
/* "capnp.pyx":559
|
|
* retcode = p.wait()
|
|
* if retcode != 0:
|
|
* raise RuntimeError("capnpc failed for some reason") # <<<<<<<<<<<<<<
|
|
*
|
|
* reader = schema.StreamFdMessageReader(p.stdout.fileno())
|
|
*/
|
|
__pyx_t_3 = PyObject_Call(__pyx_builtin_RuntimeError, ((PyObject *)__pyx_k_tuple_44), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 559; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
|
|
__Pyx_GOTREF(__pyx_t_3);
|
|
__Pyx_Raise(__pyx_t_3, 0, 0, 0);
|
|
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
|
|
{__pyx_filename = __pyx_f[0]; __pyx_lineno = 559; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
|
|
goto __pyx_L3;
|
|
}
|
|
__pyx_L3:;
|
|
|
|
/* "capnp.pyx":561
|
|
* raise RuntimeError("capnpc failed for some reason")
|
|
*
|
|
* reader = schema.StreamFdMessageReader(p.stdout.fileno()) # <<<<<<<<<<<<<<
|
|
* request = reader.getRootCodeGeneratorRequest()
|
|
* module = ModuleType(file_name)
|
|
*/
|
|
__pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s__schema); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 561; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
|
|
__Pyx_GOTREF(__pyx_t_3);
|
|
__pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_45); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 561; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
|
|
__Pyx_GOTREF(__pyx_t_5);
|
|
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
|
|
__pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_p, __pyx_n_s__stdout); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 561; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
|
|
__Pyx_GOTREF(__pyx_t_3);
|
|
__pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s__fileno); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 561; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
|
|
__Pyx_GOTREF(__pyx_t_1);
|
|
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
|
|
__pyx_t_3 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 561; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
|
|
__Pyx_GOTREF(__pyx_t_3);
|
|
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
|
|
__pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 561; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
|
|
__Pyx_GOTREF(__pyx_t_1);
|
|
PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_3);
|
|
__Pyx_GIVEREF(__pyx_t_3);
|
|
__pyx_t_3 = 0;
|
|
__pyx_t_3 = PyObject_Call(__pyx_t_5, ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 561; __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_1)); __pyx_t_1 = 0;
|
|
__pyx_v_reader = __pyx_t_3;
|
|
__pyx_t_3 = 0;
|
|
|
|
/* "capnp.pyx":562
|
|
*
|
|
* reader = schema.StreamFdMessageReader(p.stdout.fileno())
|
|
* request = reader.getRootCodeGeneratorRequest() # <<<<<<<<<<<<<<
|
|
* module = ModuleType(file_name)
|
|
* loader = SchemaLoader()
|
|
*/
|
|
__pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_reader, __pyx_n_s_31); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 562; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
|
|
__Pyx_GOTREF(__pyx_t_3);
|
|
__pyx_t_1 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 562; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
|
|
__Pyx_GOTREF(__pyx_t_1);
|
|
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
|
|
__pyx_v_request = __pyx_t_1;
|
|
__pyx_t_1 = 0;
|
|
|
|
/* "capnp.pyx":563
|
|
* reader = schema.StreamFdMessageReader(p.stdout.fileno())
|
|
* request = reader.getRootCodeGeneratorRequest()
|
|
* module = ModuleType(file_name) # <<<<<<<<<<<<<<
|
|
* loader = SchemaLoader()
|
|
*
|
|
*/
|
|
__pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s__ModuleType); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 563; __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 = 563; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
|
|
__Pyx_GOTREF(__pyx_t_3);
|
|
__Pyx_INCREF(__pyx_v_file_name);
|
|
PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_file_name);
|
|
__Pyx_GIVEREF(__pyx_v_file_name);
|
|
__pyx_t_5 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 563; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
|
|
__Pyx_GOTREF(__pyx_t_5);
|
|
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
|
|
__Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
|
|
__pyx_v_module = __pyx_t_5;
|
|
__pyx_t_5 = 0;
|
|
|
|
/* "capnp.pyx":564
|
|
* request = reader.getRootCodeGeneratorRequest()
|
|
* module = ModuleType(file_name)
|
|
* loader = SchemaLoader() # <<<<<<<<<<<<<<
|
|
*
|
|
* module._loader = loader
|
|
*/
|
|
__pyx_t_5 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_5capnp_SchemaLoader)), ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 564; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
|
|
__Pyx_GOTREF(__pyx_t_5);
|
|
__pyx_v_loader = ((struct __pyx_obj_5capnp_SchemaLoader *)__pyx_t_5);
|
|
__pyx_t_5 = 0;
|
|
|
|
/* "capnp.pyx":566
|
|
* loader = SchemaLoader()
|
|
*
|
|
* module._loader = loader # <<<<<<<<<<<<<<
|
|
*
|
|
* for node in request.nodes:
|
|
*/
|
|
if (__Pyx_PyObject_SetAttrStr(__pyx_v_module, __pyx_n_s___loader, ((PyObject *)__pyx_v_loader)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 566; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
|
|
|
|
/* "capnp.pyx":568
|
|
* module._loader = loader
|
|
*
|
|
* for node in request.nodes: # <<<<<<<<<<<<<<
|
|
* loader.load(node)
|
|
*
|
|
*/
|
|
__pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_request, __pyx_n_s__nodes); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 568; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
|
|
__Pyx_GOTREF(__pyx_t_5);
|
|
if (PyList_CheckExact(__pyx_t_5) || PyTuple_CheckExact(__pyx_t_5)) {
|
|
__pyx_t_3 = __pyx_t_5; __Pyx_INCREF(__pyx_t_3); __pyx_t_7 = 0;
|
|
__pyx_t_8 = NULL;
|
|
} else {
|
|
__pyx_t_7 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_t_5); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 568; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
|
|
__Pyx_GOTREF(__pyx_t_3);
|
|
__pyx_t_8 = Py_TYPE(__pyx_t_3)->tp_iternext;
|
|
}
|
|
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
|
|
for (;;) {
|
|
if (!__pyx_t_8 && PyList_CheckExact(__pyx_t_3)) {
|
|
if (__pyx_t_7 >= PyList_GET_SIZE(__pyx_t_3)) break;
|
|
#if CYTHON_COMPILING_IN_CPYTHON
|
|
__pyx_t_5 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_7); __Pyx_INCREF(__pyx_t_5); __pyx_t_7++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 568; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
|
|
#else
|
|
__pyx_t_5 = PySequence_ITEM(__pyx_t_3, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 568; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
|
|
#endif
|
|
} else if (!__pyx_t_8 && PyTuple_CheckExact(__pyx_t_3)) {
|
|
if (__pyx_t_7 >= PyTuple_GET_SIZE(__pyx_t_3)) break;
|
|
#if CYTHON_COMPILING_IN_CPYTHON
|
|
__pyx_t_5 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_7); __Pyx_INCREF(__pyx_t_5); __pyx_t_7++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 568; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
|
|
#else
|
|
__pyx_t_5 = PySequence_ITEM(__pyx_t_3, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 568; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
|
|
#endif
|
|
} else {
|
|
__pyx_t_5 = __pyx_t_8(__pyx_t_3);
|
|
if (unlikely(!__pyx_t_5)) {
|
|
if (PyErr_Occurred()) {
|
|
if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) PyErr_Clear();
|
|
else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 568; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
|
|
}
|
|
break;
|
|
}
|
|
__Pyx_GOTREF(__pyx_t_5);
|
|
}
|
|
__Pyx_XDECREF(__pyx_v_node);
|
|
__pyx_v_node = __pyx_t_5;
|
|
__pyx_t_5 = 0;
|
|
|
|
/* "capnp.pyx":569
|
|
*
|
|
* for node in request.nodes:
|
|
* loader.load(node) # <<<<<<<<<<<<<<
|
|
*
|
|
* for node in request.nodes:
|
|
*/
|
|
if (!(likely(((__pyx_v_node) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_node, __pyx_ptype_6schema__NodeReader))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 569; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
|
|
__pyx_t_5 = ((struct __pyx_vtabstruct_5capnp_SchemaLoader *)__pyx_v_loader->__pyx_vtab)->load(__pyx_v_loader, ((struct __pyx_obj_6schema__NodeReader *)__pyx_v_node), 0); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 569; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
|
|
__Pyx_GOTREF(__pyx_t_5);
|
|
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
|
|
}
|
|
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
|
|
|
|
/* "capnp.pyx":571
|
|
* loader.load(node)
|
|
*
|
|
* for node in request.nodes: # <<<<<<<<<<<<<<
|
|
* s = loader.load(node)
|
|
* local_module = _load(module, node, loader, name = node.displayName.replace(file_name, '', 1))
|
|
*/
|
|
__pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_request, __pyx_n_s__nodes); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 571; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
|
|
__Pyx_GOTREF(__pyx_t_3);
|
|
if (PyList_CheckExact(__pyx_t_3) || PyTuple_CheckExact(__pyx_t_3)) {
|
|
__pyx_t_5 = __pyx_t_3; __Pyx_INCREF(__pyx_t_5); __pyx_t_7 = 0;
|
|
__pyx_t_8 = NULL;
|
|
} else {
|
|
__pyx_t_7 = -1; __pyx_t_5 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 571; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
|
|
__Pyx_GOTREF(__pyx_t_5);
|
|
__pyx_t_8 = Py_TYPE(__pyx_t_5)->tp_iternext;
|
|
}
|
|
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
|
|
for (;;) {
|
|
if (!__pyx_t_8 && PyList_CheckExact(__pyx_t_5)) {
|
|
if (__pyx_t_7 >= PyList_GET_SIZE(__pyx_t_5)) break;
|
|
#if CYTHON_COMPILING_IN_CPYTHON
|
|
__pyx_t_3 = PyList_GET_ITEM(__pyx_t_5, __pyx_t_7); __Pyx_INCREF(__pyx_t_3); __pyx_t_7++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 571; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
|
|
#else
|
|
__pyx_t_3 = PySequence_ITEM(__pyx_t_5, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 571; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
|
|
#endif
|
|
} else if (!__pyx_t_8 && PyTuple_CheckExact(__pyx_t_5)) {
|
|
if (__pyx_t_7 >= PyTuple_GET_SIZE(__pyx_t_5)) break;
|
|
#if CYTHON_COMPILING_IN_CPYTHON
|
|
__pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_5, __pyx_t_7); __Pyx_INCREF(__pyx_t_3); __pyx_t_7++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 571; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
|
|
#else
|
|
__pyx_t_3 = PySequence_ITEM(__pyx_t_5, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 571; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
|
|
#endif
|
|
} else {
|
|
__pyx_t_3 = __pyx_t_8(__pyx_t_5);
|
|
if (unlikely(!__pyx_t_3)) {
|
|
if (PyErr_Occurred()) {
|
|
if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) PyErr_Clear();
|
|
else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 571; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
|
|
}
|
|
break;
|
|
}
|
|
__Pyx_GOTREF(__pyx_t_3);
|
|
}
|
|
__Pyx_XDECREF(__pyx_v_node);
|
|
__pyx_v_node = __pyx_t_3;
|
|
__pyx_t_3 = 0;
|
|
|
|
/* "capnp.pyx":572
|
|
*
|
|
* for node in request.nodes:
|
|
* s = loader.load(node) # <<<<<<<<<<<<<<
|
|
* local_module = _load(module, node, loader, name = node.displayName.replace(file_name, '', 1))
|
|
* try:
|
|
*/
|
|
if (!(likely(((__pyx_v_node) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_node, __pyx_ptype_6schema__NodeReader))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 572; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
|
|
__pyx_t_3 = ((struct __pyx_vtabstruct_5capnp_SchemaLoader *)__pyx_v_loader->__pyx_vtab)->load(__pyx_v_loader, ((struct __pyx_obj_6schema__NodeReader *)__pyx_v_node), 0); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 572; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
|
|
__Pyx_GOTREF(__pyx_t_3);
|
|
__Pyx_XDECREF(__pyx_v_s);
|
|
__pyx_v_s = __pyx_t_3;
|
|
__pyx_t_3 = 0;
|
|
|
|
/* "capnp.pyx":573
|
|
* for node in request.nodes:
|
|
* s = loader.load(node)
|
|
* local_module = _load(module, node, loader, name = node.displayName.replace(file_name, '', 1)) # <<<<<<<<<<<<<<
|
|
* try:
|
|
* s = s.asStruct()
|
|
*/
|
|
__pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s___load); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 573; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
|
|
__Pyx_GOTREF(__pyx_t_3);
|
|
__pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 573; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
|
|
__Pyx_GOTREF(__pyx_t_1);
|
|
__Pyx_INCREF(__pyx_v_module);
|
|
PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_module);
|
|
__Pyx_GIVEREF(__pyx_v_module);
|
|
__Pyx_INCREF(__pyx_v_node);
|
|
PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_node);
|
|
__Pyx_GIVEREF(__pyx_v_node);
|
|
__Pyx_INCREF(((PyObject *)__pyx_v_loader));
|
|
PyTuple_SET_ITEM(__pyx_t_1, 2, ((PyObject *)__pyx_v_loader));
|
|
__Pyx_GIVEREF(((PyObject *)__pyx_v_loader));
|
|
__pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 573; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
|
|
__Pyx_GOTREF(((PyObject *)__pyx_t_2));
|
|
__pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_node, __pyx_n_s__displayName); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 573; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
|
|
__Pyx_GOTREF(__pyx_t_4);
|
|
__pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s__replace); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 573; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
|
|
__Pyx_GOTREF(__pyx_t_9);
|
|
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
|
|
__pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 573; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
|
|
__Pyx_GOTREF(__pyx_t_4);
|
|
__Pyx_INCREF(__pyx_v_file_name);
|
|
PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_file_name);
|
|
__Pyx_GIVEREF(__pyx_v_file_name);
|
|
__Pyx_INCREF(((PyObject *)__pyx_kp_s_35));
|
|
PyTuple_SET_ITEM(__pyx_t_4, 1, ((PyObject *)__pyx_kp_s_35));
|
|
__Pyx_GIVEREF(((PyObject *)__pyx_kp_s_35));
|
|
__Pyx_INCREF(__pyx_int_1);
|
|
PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_int_1);
|
|
__Pyx_GIVEREF(__pyx_int_1);
|
|
__pyx_t_10 = PyObject_Call(__pyx_t_9, ((PyObject *)__pyx_t_4), NULL); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 573; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
|
|
__Pyx_GOTREF(__pyx_t_10);
|
|
__Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
|
|
__Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
|
|
if (PyDict_SetItem(__pyx_t_2, ((PyObject *)__pyx_n_s__name), __pyx_t_10) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 573; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
|
|
__Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
|
|
__pyx_t_10 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_t_1), ((PyObject *)__pyx_t_2)); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 573; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
|
|
__Pyx_GOTREF(__pyx_t_10);
|
|
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
|
|
__Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
|
|
__Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
|
|
__Pyx_XDECREF(__pyx_v_local_module);
|
|
__pyx_v_local_module = __pyx_t_10;
|
|
__pyx_t_10 = 0;
|
|
|
|
/* "capnp.pyx":574
|
|
* s = loader.load(node)
|
|
* local_module = _load(module, node, loader, name = node.displayName.replace(file_name, '', 1))
|
|
* try: # <<<<<<<<<<<<<<
|
|
* s = s.asStruct()
|
|
* local_module.Schema = s
|
|
*/
|
|
{
|
|
__Pyx_ExceptionSave(&__pyx_t_11, &__pyx_t_12, &__pyx_t_13);
|
|
__Pyx_XGOTREF(__pyx_t_11);
|
|
__Pyx_XGOTREF(__pyx_t_12);
|
|
__Pyx_XGOTREF(__pyx_t_13);
|
|
/*try:*/ {
|
|
|
|
/* "capnp.pyx":575
|
|
* local_module = _load(module, node, loader, name = node.displayName.replace(file_name, '', 1))
|
|
* try:
|
|
* s = s.asStruct() # <<<<<<<<<<<<<<
|
|
* local_module.Schema = s
|
|
* except: pass
|
|
*/
|
|
__pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_v_s, __pyx_n_s__asStruct); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 575; __pyx_clineno = __LINE__; goto __pyx_L8_error;}
|
|
__Pyx_GOTREF(__pyx_t_10);
|
|
__pyx_t_2 = PyObject_Call(__pyx_t_10, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 575; __pyx_clineno = __LINE__; goto __pyx_L8_error;}
|
|
__Pyx_GOTREF(__pyx_t_2);
|
|
__Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
|
|
__Pyx_DECREF(__pyx_v_s);
|
|
__pyx_v_s = __pyx_t_2;
|
|
__pyx_t_2 = 0;
|
|
|
|
/* "capnp.pyx":576
|
|
* try:
|
|
* s = s.asStruct()
|
|
* local_module.Schema = s # <<<<<<<<<<<<<<
|
|
* except: pass
|
|
*
|
|
*/
|
|
if (__Pyx_PyObject_SetAttrStr(__pyx_v_local_module, __pyx_n_s__Schema, __pyx_v_s) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 576; __pyx_clineno = __LINE__; goto __pyx_L8_error;}
|
|
}
|
|
__Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
|
|
__Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
|
|
__Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
|
|
goto __pyx_L15_try_end;
|
|
__pyx_L8_error:;
|
|
__Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
|
|
__Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
|
|
__Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
|
|
__Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
|
|
__Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
|
|
__Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
|
|
|
|
/* "capnp.pyx":577
|
|
* s = s.asStruct()
|
|
* local_module.Schema = s
|
|
* except: pass # <<<<<<<<<<<<<<
|
|
*
|
|
* return module
|
|
*/
|
|
/*except:*/ {
|
|
PyErr_Restore(0,0,0);
|
|
goto __pyx_L9_exception_handled;
|
|
}
|
|
__pyx_L9_exception_handled:;
|
|
__Pyx_XGIVEREF(__pyx_t_11);
|
|
__Pyx_XGIVEREF(__pyx_t_12);
|
|
__Pyx_XGIVEREF(__pyx_t_13);
|
|
__Pyx_ExceptionReset(__pyx_t_11, __pyx_t_12, __pyx_t_13);
|
|
__pyx_L15_try_end:;
|
|
}
|
|
}
|
|
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
|
|
|
|
/* "capnp.pyx":579
|
|
* except: pass
|
|
*
|
|
* return module # <<<<<<<<<<<<<<
|
|
*
|
|
*/
|
|
__Pyx_XDECREF(__pyx_r);
|
|
__Pyx_INCREF(__pyx_v_module);
|
|
__pyx_r = __pyx_v_module;
|
|
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_XDECREF(__pyx_t_4);
|
|
__Pyx_XDECREF(__pyx_t_5);
|
|
__Pyx_XDECREF(__pyx_t_9);
|
|
__Pyx_XDECREF(__pyx_t_10);
|
|
__Pyx_AddTraceback("capnp.load", __pyx_clineno, __pyx_lineno, __pyx_filename);
|
|
__pyx_r = NULL;
|
|
__pyx_L0:;
|
|
__Pyx_XDECREF(__pyx_v_p);
|
|
__Pyx_XDECREF(__pyx_v_retcode);
|
|
__Pyx_XDECREF(__pyx_v_reader);
|
|
__Pyx_XDECREF(__pyx_v_request);
|
|
__Pyx_XDECREF(__pyx_v_module);
|
|
__Pyx_XDECREF((PyObject *)__pyx_v_loader);
|
|
__Pyx_XDECREF(__pyx_v_node);
|
|
__Pyx_XDECREF(__pyx_v_s);
|
|
__Pyx_XDECREF(__pyx_v_local_module);
|
|
__Pyx_XGIVEREF(__pyx_r);
|
|
__Pyx_RefNannyFinishContext();
|
|
return __pyx_r;
|
|
}
|
|
static struct __pyx_vtabstruct_5capnp__List_Node_Reader __pyx_vtable_5capnp__List_Node_Reader;
|
|
|
|
static PyObject *__pyx_tp_new_5capnp__List_Node_Reader(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
|
|
struct __pyx_obj_5capnp__List_Node_Reader *p;
|
|
PyObject *o;
|
|
o = (*t->tp_alloc)(t, 0);
|
|
if (unlikely(!o)) return 0;
|
|
p = ((struct __pyx_obj_5capnp__List_Node_Reader *)o);
|
|
p->__pyx_vtab = __pyx_vtabptr_5capnp__List_Node_Reader;
|
|
new((void*)&(p->thisptr)) ::capnp::List< ::capnp::schema::Node>::Reader();
|
|
return o;
|
|
}
|
|
|
|
static void __pyx_tp_dealloc_5capnp__List_Node_Reader(PyObject *o) {
|
|
struct __pyx_obj_5capnp__List_Node_Reader *p = (struct __pyx_obj_5capnp__List_Node_Reader *)o;
|
|
p->thisptr. ::capnp::List< ::capnp::schema::Node>::Reader::~Reader();
|
|
(*Py_TYPE(o)->tp_free)(o);
|
|
}
|
|
static PyObject *__pyx_sq_item_5capnp__List_Node_Reader(PyObject *o, Py_ssize_t i) {
|
|
PyObject *r;
|
|
PyObject *x = PyInt_FromSsize_t(i); if(!x) return 0;
|
|
r = Py_TYPE(o)->tp_as_mapping->mp_subscript(o, x);
|
|
Py_DECREF(x);
|
|
return r;
|
|
}
|
|
|
|
static PyMethodDef __pyx_methods_5capnp__List_Node_Reader[] = {
|
|
{0, 0, 0, 0}
|
|
};
|
|
|
|
static PySequenceMethods __pyx_tp_as_sequence__List_Node_Reader = {
|
|
__pyx_pw_5capnp_17_List_Node_Reader_3__len__, /*sq_length*/
|
|
0, /*sq_concat*/
|
|
0, /*sq_repeat*/
|
|
__pyx_sq_item_5capnp__List_Node_Reader, /*sq_item*/
|
|
0, /*sq_slice*/
|
|
0, /*sq_ass_item*/
|
|
0, /*sq_ass_slice*/
|
|
0, /*sq_contains*/
|
|
0, /*sq_inplace_concat*/
|
|
0, /*sq_inplace_repeat*/
|
|
};
|
|
|
|
static PyMappingMethods __pyx_tp_as_mapping__List_Node_Reader = {
|
|
__pyx_pw_5capnp_17_List_Node_Reader_3__len__, /*mp_length*/
|
|
__pyx_pw_5capnp_17_List_Node_Reader_1__getitem__, /*mp_subscript*/
|
|
0, /*mp_ass_subscript*/
|
|
};
|
|
|
|
static PyTypeObject __pyx_type_5capnp__List_Node_Reader = {
|
|
PyVarObject_HEAD_INIT(0, 0)
|
|
__Pyx_NAMESTR("capnp._List_Node_Reader"), /*tp_name*/
|
|
sizeof(struct __pyx_obj_5capnp__List_Node_Reader), /*tp_basicsize*/
|
|
0, /*tp_itemsize*/
|
|
__pyx_tp_dealloc_5capnp__List_Node_Reader, /*tp_dealloc*/
|
|
0, /*tp_print*/
|
|
0, /*tp_getattr*/
|
|
0, /*tp_setattr*/
|
|
#if PY_MAJOR_VERSION < 3
|
|
0, /*tp_compare*/
|
|
#else
|
|
0, /*reserved*/
|
|
#endif
|
|
0, /*tp_repr*/
|
|
0, /*tp_as_number*/
|
|
&__pyx_tp_as_sequence__List_Node_Reader, /*tp_as_sequence*/
|
|
&__pyx_tp_as_mapping__List_Node_Reader, /*tp_as_mapping*/
|
|
0, /*tp_hash*/
|
|
0, /*tp_call*/
|
|
0, /*tp_str*/
|
|
0, /*tp_getattro*/
|
|
0, /*tp_setattro*/
|
|
0, /*tp_as_buffer*/
|
|
Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE, /*tp_flags*/
|
|
0, /*tp_doc*/
|
|
0, /*tp_traverse*/
|
|
0, /*tp_clear*/
|
|
0, /*tp_richcompare*/
|
|
0, /*tp_weaklistoffset*/
|
|
0, /*tp_iter*/
|
|
0, /*tp_iternext*/
|
|
__pyx_methods_5capnp__List_Node_Reader, /*tp_methods*/
|
|
0, /*tp_members*/
|
|
0, /*tp_getset*/
|
|
0, /*tp_base*/
|
|
0, /*tp_dict*/
|
|
0, /*tp_descr_get*/
|
|
0, /*tp_descr_set*/
|
|
0, /*tp_dictoffset*/
|
|
0, /*tp_init*/
|
|
0, /*tp_alloc*/
|
|
__pyx_tp_new_5capnp__List_Node_Reader, /*tp_new*/
|
|
0, /*tp_free*/
|
|
0, /*tp_is_gc*/
|
|
0, /*tp_bases*/
|
|
0, /*tp_mro*/
|
|
0, /*tp_cache*/
|
|
0, /*tp_subclasses*/
|
|
0, /*tp_weaklist*/
|
|
0, /*tp_del*/
|
|
#if PY_VERSION_HEX >= 0x02060000
|
|
0, /*tp_version_tag*/
|
|
#endif
|
|
};
|
|
|
|
static struct __pyx_obj_5capnp___pyx_scope_struct_1_genexpr *__pyx_freelist_5capnp___pyx_scope_struct_1_genexpr[8];
|
|
static int __pyx_freecount_5capnp___pyx_scope_struct_1_genexpr = 0;
|
|
|
|
static PyObject *__pyx_tp_new_5capnp___pyx_scope_struct_1_genexpr(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
|
|
struct __pyx_obj_5capnp___pyx_scope_struct_1_genexpr *p;
|
|
PyObject *o;
|
|
if (likely((__pyx_freecount_5capnp___pyx_scope_struct_1_genexpr > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_5capnp___pyx_scope_struct_1_genexpr)))) {
|
|
o = (PyObject*)__pyx_freelist_5capnp___pyx_scope_struct_1_genexpr[--__pyx_freecount_5capnp___pyx_scope_struct_1_genexpr];
|
|
memset(o, 0, sizeof(struct __pyx_obj_5capnp___pyx_scope_struct_1_genexpr));
|
|
PyObject_INIT(o, t);
|
|
PyObject_GC_Track(o);
|
|
} else {
|
|
o = (*t->tp_alloc)(t, 0);
|
|
if (unlikely(!o)) return 0;
|
|
}
|
|
p = ((struct __pyx_obj_5capnp___pyx_scope_struct_1_genexpr *)o);
|
|
p->__pyx_outer_scope = 0;
|
|
p->__pyx_v_key = 0;
|
|
p->__pyx_v_value = 0;
|
|
p->__pyx_t_0 = 0;
|
|
return o;
|
|
}
|
|
|
|
static void __pyx_tp_dealloc_5capnp___pyx_scope_struct_1_genexpr(PyObject *o) {
|
|
struct __pyx_obj_5capnp___pyx_scope_struct_1_genexpr *p = (struct __pyx_obj_5capnp___pyx_scope_struct_1_genexpr *)o;
|
|
PyObject_GC_UnTrack(o);
|
|
Py_CLEAR(p->__pyx_outer_scope);
|
|
Py_CLEAR(p->__pyx_v_key);
|
|
Py_CLEAR(p->__pyx_v_value);
|
|
Py_CLEAR(p->__pyx_t_0);
|
|
if ((__pyx_freecount_5capnp___pyx_scope_struct_1_genexpr < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_5capnp___pyx_scope_struct_1_genexpr))) {
|
|
__pyx_freelist_5capnp___pyx_scope_struct_1_genexpr[__pyx_freecount_5capnp___pyx_scope_struct_1_genexpr++] = ((struct __pyx_obj_5capnp___pyx_scope_struct_1_genexpr *)o);
|
|
} else {
|
|
(*Py_TYPE(o)->tp_free)(o);
|
|
}
|
|
}
|
|
|
|
static int __pyx_tp_traverse_5capnp___pyx_scope_struct_1_genexpr(PyObject *o, visitproc v, void *a) {
|
|
int e;
|
|
struct __pyx_obj_5capnp___pyx_scope_struct_1_genexpr *p = (struct __pyx_obj_5capnp___pyx_scope_struct_1_genexpr *)o;
|
|
if (p->__pyx_outer_scope) {
|
|
e = (*v)(((PyObject*)p->__pyx_outer_scope), a); if (e) return e;
|
|
}
|
|
if (p->__pyx_v_key) {
|
|
e = (*v)(p->__pyx_v_key, a); if (e) return e;
|
|
}
|
|
if (p->__pyx_v_value) {
|
|
e = (*v)(p->__pyx_v_value, a); if (e) return e;
|
|
}
|
|
if (p->__pyx_t_0) {
|
|
e = (*v)(p->__pyx_t_0, a); if (e) return e;
|
|
}
|
|
return 0;
|
|
}
|
|
|
|
static int __pyx_tp_clear_5capnp___pyx_scope_struct_1_genexpr(PyObject *o) {
|
|
struct __pyx_obj_5capnp___pyx_scope_struct_1_genexpr *p = (struct __pyx_obj_5capnp___pyx_scope_struct_1_genexpr *)o;
|
|
PyObject* tmp;
|
|
tmp = ((PyObject*)p->__pyx_outer_scope);
|
|
p->__pyx_outer_scope = ((struct __pyx_obj_5capnp___pyx_scope_struct___make_enum *)Py_None); Py_INCREF(Py_None);
|
|
Py_XDECREF(tmp);
|
|
tmp = ((PyObject*)p->__pyx_v_key);
|
|
p->__pyx_v_key = Py_None; Py_INCREF(Py_None);
|
|
Py_XDECREF(tmp);
|
|
tmp = ((PyObject*)p->__pyx_v_value);
|
|
p->__pyx_v_value = Py_None; Py_INCREF(Py_None);
|
|
Py_XDECREF(tmp);
|
|
tmp = ((PyObject*)p->__pyx_t_0);
|
|
p->__pyx_t_0 = Py_None; Py_INCREF(Py_None);
|
|
Py_XDECREF(tmp);
|
|
return 0;
|
|
}
|
|
|
|
static PyMethodDef __pyx_methods_5capnp___pyx_scope_struct_1_genexpr[] = {
|
|
{0, 0, 0, 0}
|
|
};
|
|
|
|
static PyTypeObject __pyx_type_5capnp___pyx_scope_struct_1_genexpr = {
|
|
PyVarObject_HEAD_INIT(0, 0)
|
|
__Pyx_NAMESTR("capnp.__pyx_scope_struct_1_genexpr"), /*tp_name*/
|
|
sizeof(struct __pyx_obj_5capnp___pyx_scope_struct_1_genexpr), /*tp_basicsize*/
|
|
0, /*tp_itemsize*/
|
|
__pyx_tp_dealloc_5capnp___pyx_scope_struct_1_genexpr, /*tp_dealloc*/
|
|
0, /*tp_print*/
|
|
0, /*tp_getattr*/
|
|
0, /*tp_setattr*/
|
|
#if PY_MAJOR_VERSION < 3
|
|
0, /*tp_compare*/
|
|
#else
|
|
0, /*reserved*/
|
|
#endif
|
|
0, /*tp_repr*/
|
|
0, /*tp_as_number*/
|
|
0, /*tp_as_sequence*/
|
|
0, /*tp_as_mapping*/
|
|
0, /*tp_hash*/
|
|
0, /*tp_call*/
|
|
0, /*tp_str*/
|
|
0, /*tp_getattro*/
|
|
0, /*tp_setattro*/
|
|
0, /*tp_as_buffer*/
|
|
Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
|
|
0, /*tp_doc*/
|
|
__pyx_tp_traverse_5capnp___pyx_scope_struct_1_genexpr, /*tp_traverse*/
|
|
__pyx_tp_clear_5capnp___pyx_scope_struct_1_genexpr, /*tp_clear*/
|
|
0, /*tp_richcompare*/
|
|
0, /*tp_weaklistoffset*/
|
|
0, /*tp_iter*/
|
|
0, /*tp_iternext*/
|
|
__pyx_methods_5capnp___pyx_scope_struct_1_genexpr, /*tp_methods*/
|
|
0, /*tp_members*/
|
|
0, /*tp_getset*/
|
|
0, /*tp_base*/
|
|
0, /*tp_dict*/
|
|
0, /*tp_descr_get*/
|
|
0, /*tp_descr_set*/
|
|
0, /*tp_dictoffset*/
|
|
0, /*tp_init*/
|
|
0, /*tp_alloc*/
|
|
__pyx_tp_new_5capnp___pyx_scope_struct_1_genexpr, /*tp_new*/
|
|
0, /*tp_free*/
|
|
0, /*tp_is_gc*/
|
|
0, /*tp_bases*/
|
|
0, /*tp_mro*/
|
|
0, /*tp_cache*/
|
|
0, /*tp_subclasses*/
|
|
0, /*tp_weaklist*/
|
|
0, /*tp_del*/
|
|
#if PY_VERSION_HEX >= 0x02060000
|
|
0, /*tp_version_tag*/
|
|
#endif
|
|
};
|
|
static struct __pyx_vtabstruct_5capnp__DynamicListReader __pyx_vtable_5capnp__DynamicListReader;
|
|
|
|
static PyObject *__pyx_tp_new_5capnp__DynamicListReader(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
|
|
struct __pyx_obj_5capnp__DynamicListReader *p;
|
|
PyObject *o;
|
|
o = (*t->tp_alloc)(t, 0);
|
|
if (unlikely(!o)) return 0;
|
|
p = ((struct __pyx_obj_5capnp__DynamicListReader *)o);
|
|
p->__pyx_vtab = __pyx_vtabptr_5capnp__DynamicListReader;
|
|
new((void*)&(p->thisptr)) ::capnp::DynamicList::Reader();
|
|
return o;
|
|
}
|
|
|
|
static void __pyx_tp_dealloc_5capnp__DynamicListReader(PyObject *o) {
|
|
struct __pyx_obj_5capnp__DynamicListReader *p = (struct __pyx_obj_5capnp__DynamicListReader *)o;
|
|
p->thisptr. ::capnp::DynamicList::Reader::~Reader();
|
|
(*Py_TYPE(o)->tp_free)(o);
|
|
}
|
|
static PyObject *__pyx_sq_item_5capnp__DynamicListReader(PyObject *o, Py_ssize_t i) {
|
|
PyObject *r;
|
|
PyObject *x = PyInt_FromSsize_t(i); if(!x) return 0;
|
|
r = Py_TYPE(o)->tp_as_mapping->mp_subscript(o, x);
|
|
Py_DECREF(x);
|
|
return r;
|
|
}
|
|
|
|
static PyMethodDef __pyx_methods_5capnp__DynamicListReader[] = {
|
|
{__Pyx_NAMESTR("_get"), (PyCFunction)__pyx_pw_5capnp_18_DynamicListReader_1_get, METH_O, __Pyx_DOCSTR(0)},
|
|
{0, 0, 0, 0}
|
|
};
|
|
|
|
static PySequenceMethods __pyx_tp_as_sequence__DynamicListReader = {
|
|
__pyx_pw_5capnp_18_DynamicListReader_5__len__, /*sq_length*/
|
|
0, /*sq_concat*/
|
|
0, /*sq_repeat*/
|
|
__pyx_sq_item_5capnp__DynamicListReader, /*sq_item*/
|
|
0, /*sq_slice*/
|
|
0, /*sq_ass_item*/
|
|
0, /*sq_ass_slice*/
|
|
0, /*sq_contains*/
|
|
0, /*sq_inplace_concat*/
|
|
0, /*sq_inplace_repeat*/
|
|
};
|
|
|
|
static PyMappingMethods __pyx_tp_as_mapping__DynamicListReader = {
|
|
__pyx_pw_5capnp_18_DynamicListReader_5__len__, /*mp_length*/
|
|
__pyx_pw_5capnp_18_DynamicListReader_3__getitem__, /*mp_subscript*/
|
|
0, /*mp_ass_subscript*/
|
|
};
|
|
|
|
static PyTypeObject __pyx_type_5capnp__DynamicListReader = {
|
|
PyVarObject_HEAD_INIT(0, 0)
|
|
__Pyx_NAMESTR("capnp._DynamicListReader"), /*tp_name*/
|
|
sizeof(struct __pyx_obj_5capnp__DynamicListReader), /*tp_basicsize*/
|
|
0, /*tp_itemsize*/
|
|
__pyx_tp_dealloc_5capnp__DynamicListReader, /*tp_dealloc*/
|
|
0, /*tp_print*/
|
|
0, /*tp_getattr*/
|
|
0, /*tp_setattr*/
|
|
#if PY_MAJOR_VERSION < 3
|
|
0, /*tp_compare*/
|
|
#else
|
|
0, /*reserved*/
|
|
#endif
|
|
0, /*tp_repr*/
|
|
0, /*tp_as_number*/
|
|
&__pyx_tp_as_sequence__DynamicListReader, /*tp_as_sequence*/
|
|
&__pyx_tp_as_mapping__DynamicListReader, /*tp_as_mapping*/
|
|
0, /*tp_hash*/
|
|
0, /*tp_call*/
|
|
0, /*tp_str*/
|
|
0, /*tp_getattro*/
|
|
0, /*tp_setattro*/
|
|
0, /*tp_as_buffer*/
|
|
Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE, /*tp_flags*/
|
|
0, /*tp_doc*/
|
|
0, /*tp_traverse*/
|
|
0, /*tp_clear*/
|
|
0, /*tp_richcompare*/
|
|
0, /*tp_weaklistoffset*/
|
|
0, /*tp_iter*/
|
|
0, /*tp_iternext*/
|
|
__pyx_methods_5capnp__DynamicListReader, /*tp_methods*/
|
|
0, /*tp_members*/
|
|
0, /*tp_getset*/
|
|
0, /*tp_base*/
|
|
0, /*tp_dict*/
|
|
0, /*tp_descr_get*/
|
|
0, /*tp_descr_set*/
|
|
0, /*tp_dictoffset*/
|
|
0, /*tp_init*/
|
|
0, /*tp_alloc*/
|
|
__pyx_tp_new_5capnp__DynamicListReader, /*tp_new*/
|
|
0, /*tp_free*/
|
|
0, /*tp_is_gc*/
|
|
0, /*tp_bases*/
|
|
0, /*tp_mro*/
|
|
0, /*tp_cache*/
|
|
0, /*tp_subclasses*/
|
|
0, /*tp_weaklist*/
|
|
0, /*tp_del*/
|
|
#if PY_VERSION_HEX >= 0x02060000
|
|
0, /*tp_version_tag*/
|
|
#endif
|
|
};
|
|
static struct __pyx_vtabstruct_5capnp__DynamicUnionReader __pyx_vtable_5capnp__DynamicUnionReader;
|
|
|
|
static PyObject *__pyx_tp_new_5capnp__DynamicUnionReader(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
|
|
struct __pyx_obj_5capnp__DynamicUnionReader *p;
|
|
PyObject *o;
|
|
o = (*t->tp_alloc)(t, 0);
|
|
if (unlikely(!o)) return 0;
|
|
p = ((struct __pyx_obj_5capnp__DynamicUnionReader *)o);
|
|
p->__pyx_vtab = __pyx_vtabptr_5capnp__DynamicUnionReader;
|
|
new((void*)&(p->thisptr)) ::capnp::DynamicUnion::Reader();
|
|
return o;
|
|
}
|
|
|
|
static void __pyx_tp_dealloc_5capnp__DynamicUnionReader(PyObject *o) {
|
|
struct __pyx_obj_5capnp__DynamicUnionReader *p = (struct __pyx_obj_5capnp__DynamicUnionReader *)o;
|
|
p->thisptr. ::capnp::DynamicUnion::Reader::~Reader();
|
|
(*Py_TYPE(o)->tp_free)(o);
|
|
}
|
|
|
|
static PyObject *__pyx_tp_getattro_5capnp__DynamicUnionReader(PyObject *o, PyObject *n) {
|
|
PyObject *v = PyObject_GenericGetAttr(o, n);
|
|
if (!v && PyErr_ExceptionMatches(PyExc_AttributeError)) {
|
|
PyErr_Clear();
|
|
v = __pyx_pw_5capnp_19_DynamicUnionReader_3__getattr__(o, n);
|
|
}
|
|
return v;
|
|
}
|
|
|
|
static PyMethodDef __pyx_methods_5capnp__DynamicUnionReader[] = {
|
|
{__Pyx_NAMESTR("_get"), (PyCFunction)__pyx_pw_5capnp_19_DynamicUnionReader_1_get, METH_NOARGS, __Pyx_DOCSTR(0)},
|
|
{__Pyx_NAMESTR("__getattr__"), (PyCFunction)__pyx_pw_5capnp_19_DynamicUnionReader_3__getattr__, METH_O|METH_COEXIST, __Pyx_DOCSTR(0)},
|
|
{__Pyx_NAMESTR("which"), (PyCFunction)__pyx_pw_5capnp_19_DynamicUnionReader_5which, METH_NOARGS, __Pyx_DOCSTR(0)},
|
|
{0, 0, 0, 0}
|
|
};
|
|
|
|
static PyTypeObject __pyx_type_5capnp__DynamicUnionReader = {
|
|
PyVarObject_HEAD_INIT(0, 0)
|
|
__Pyx_NAMESTR("capnp._DynamicUnionReader"), /*tp_name*/
|
|
sizeof(struct __pyx_obj_5capnp__DynamicUnionReader), /*tp_basicsize*/
|
|
0, /*tp_itemsize*/
|
|
__pyx_tp_dealloc_5capnp__DynamicUnionReader, /*tp_dealloc*/
|
|
0, /*tp_print*/
|
|
0, /*tp_getattr*/
|
|
0, /*tp_setattr*/
|
|
#if PY_MAJOR_VERSION < 3
|
|
0, /*tp_compare*/
|
|
#else
|
|
0, /*reserved*/
|
|
#endif
|
|
0, /*tp_repr*/
|
|
0, /*tp_as_number*/
|
|
0, /*tp_as_sequence*/
|
|
0, /*tp_as_mapping*/
|
|
0, /*tp_hash*/
|
|
0, /*tp_call*/
|
|
0, /*tp_str*/
|
|
__pyx_tp_getattro_5capnp__DynamicUnionReader, /*tp_getattro*/
|
|
0, /*tp_setattro*/
|
|
0, /*tp_as_buffer*/
|
|
Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE, /*tp_flags*/
|
|
0, /*tp_doc*/
|
|
0, /*tp_traverse*/
|
|
0, /*tp_clear*/
|
|
0, /*tp_richcompare*/
|
|
0, /*tp_weaklistoffset*/
|
|
0, /*tp_iter*/
|
|
0, /*tp_iternext*/
|
|
__pyx_methods_5capnp__DynamicUnionReader, /*tp_methods*/
|
|
0, /*tp_members*/
|
|
0, /*tp_getset*/
|
|
0, /*tp_base*/
|
|
0, /*tp_dict*/
|
|
0, /*tp_descr_get*/
|
|
0, /*tp_descr_set*/
|
|
0, /*tp_dictoffset*/
|
|
0, /*tp_init*/
|
|
0, /*tp_alloc*/
|
|
__pyx_tp_new_5capnp__DynamicUnionReader, /*tp_new*/
|
|
0, /*tp_free*/
|
|
0, /*tp_is_gc*/
|
|
0, /*tp_bases*/
|
|
0, /*tp_mro*/
|
|
0, /*tp_cache*/
|
|
0, /*tp_subclasses*/
|
|
0, /*tp_weaklist*/
|
|
0, /*tp_del*/
|
|
#if PY_VERSION_HEX >= 0x02060000
|
|
0, /*tp_version_tag*/
|
|
#endif
|
|
};
|
|
static struct __pyx_vtabstruct_5capnp_MessageBuilder __pyx_vtable_5capnp_MessageBuilder;
|
|
|
|
static PyObject *__pyx_tp_new_5capnp_MessageBuilder(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
|
|
struct __pyx_obj_5capnp_MessageBuilder *p;
|
|
PyObject *o;
|
|
o = (*t->tp_alloc)(t, 0);
|
|
if (unlikely(!o)) return 0;
|
|
p = ((struct __pyx_obj_5capnp_MessageBuilder *)o);
|
|
p->__pyx_vtab = __pyx_vtabptr_5capnp_MessageBuilder;
|
|
return o;
|
|
}
|
|
|
|
static void __pyx_tp_dealloc_5capnp_MessageBuilder(PyObject *o) {
|
|
{
|
|
PyObject *etype, *eval, *etb;
|
|
PyErr_Fetch(&etype, &eval, &etb);
|
|
++Py_REFCNT(o);
|
|
__pyx_pw_5capnp_14MessageBuilder_1__dealloc__(o);
|
|
if (PyErr_Occurred()) PyErr_WriteUnraisable(o);
|
|
--Py_REFCNT(o);
|
|
PyErr_Restore(etype, eval, etb);
|
|
}
|
|
(*Py_TYPE(o)->tp_free)(o);
|
|
}
|
|
|
|
static PyMethodDef __pyx_methods_5capnp_MessageBuilder[] = {
|
|
{__Pyx_NAMESTR("initRoot"), (PyCFunction)__pyx_pw_5capnp_14MessageBuilder_3initRoot, METH_O, __Pyx_DOCSTR(0)},
|
|
{__Pyx_NAMESTR("getRoot"), (PyCFunction)__pyx_pw_5capnp_14MessageBuilder_5getRoot, METH_O, __Pyx_DOCSTR(0)},
|
|
{0, 0, 0, 0}
|
|
};
|
|
|
|
static PyTypeObject __pyx_type_5capnp_MessageBuilder = {
|
|
PyVarObject_HEAD_INIT(0, 0)
|
|
__Pyx_NAMESTR("capnp.MessageBuilder"), /*tp_name*/
|
|
sizeof(struct __pyx_obj_5capnp_MessageBuilder), /*tp_basicsize*/
|
|
0, /*tp_itemsize*/
|
|
__pyx_tp_dealloc_5capnp_MessageBuilder, /*tp_dealloc*/
|
|
0, /*tp_print*/
|
|
0, /*tp_getattr*/
|
|
0, /*tp_setattr*/
|
|
#if PY_MAJOR_VERSION < 3
|
|
0, /*tp_compare*/
|
|
#else
|
|
0, /*reserved*/
|
|
#endif
|
|
0, /*tp_repr*/
|
|
0, /*tp_as_number*/
|
|
0, /*tp_as_sequence*/
|
|
0, /*tp_as_mapping*/
|
|
0, /*tp_hash*/
|
|
0, /*tp_call*/
|
|
0, /*tp_str*/
|
|
0, /*tp_getattro*/
|
|
0, /*tp_setattro*/
|
|
0, /*tp_as_buffer*/
|
|
Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE, /*tp_flags*/
|
|
0, /*tp_doc*/
|
|
0, /*tp_traverse*/
|
|
0, /*tp_clear*/
|
|
0, /*tp_richcompare*/
|
|
0, /*tp_weaklistoffset*/
|
|
0, /*tp_iter*/
|
|
0, /*tp_iternext*/
|
|
__pyx_methods_5capnp_MessageBuilder, /*tp_methods*/
|
|
0, /*tp_members*/
|
|
0, /*tp_getset*/
|
|
0, /*tp_base*/
|
|
0, /*tp_dict*/
|
|
0, /*tp_descr_get*/
|
|
0, /*tp_descr_set*/
|
|
0, /*tp_dictoffset*/
|
|
0, /*tp_init*/
|
|
0, /*tp_alloc*/
|
|
__pyx_tp_new_5capnp_MessageBuilder, /*tp_new*/
|
|
0, /*tp_free*/
|
|
0, /*tp_is_gc*/
|
|
0, /*tp_bases*/
|
|
0, /*tp_mro*/
|
|
0, /*tp_cache*/
|
|
0, /*tp_subclasses*/
|
|
0, /*tp_weaklist*/
|
|
0, /*tp_del*/
|
|
#if PY_VERSION_HEX >= 0x02060000
|
|
0, /*tp_version_tag*/
|
|
#endif
|
|
};
|
|
static struct __pyx_vtabstruct_5capnp__List_UInt64_Reader __pyx_vtable_5capnp__List_UInt64_Reader;
|
|
|
|
static PyObject *__pyx_tp_new_5capnp__List_UInt64_Reader(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
|
|
struct __pyx_obj_5capnp__List_UInt64_Reader *p;
|
|
PyObject *o;
|
|
o = (*t->tp_alloc)(t, 0);
|
|
if (unlikely(!o)) return 0;
|
|
p = ((struct __pyx_obj_5capnp__List_UInt64_Reader *)o);
|
|
p->__pyx_vtab = __pyx_vtabptr_5capnp__List_UInt64_Reader;
|
|
new((void*)&(p->thisptr)) ::capnp::List<__pyx_t_5capnp_UInt64>::Reader();
|
|
return o;
|
|
}
|
|
|
|
static void __pyx_tp_dealloc_5capnp__List_UInt64_Reader(PyObject *o) {
|
|
struct __pyx_obj_5capnp__List_UInt64_Reader *p = (struct __pyx_obj_5capnp__List_UInt64_Reader *)o;
|
|
p->thisptr. ::capnp::List<__pyx_t_5capnp_UInt64>::Reader::~Reader();
|
|
(*Py_TYPE(o)->tp_free)(o);
|
|
}
|
|
static PyObject *__pyx_sq_item_5capnp__List_UInt64_Reader(PyObject *o, Py_ssize_t i) {
|
|
PyObject *r;
|
|
PyObject *x = PyInt_FromSsize_t(i); if(!x) return 0;
|
|
r = Py_TYPE(o)->tp_as_mapping->mp_subscript(o, x);
|
|
Py_DECREF(x);
|
|
return r;
|
|
}
|
|
|
|
static PyMethodDef __pyx_methods_5capnp__List_UInt64_Reader[] = {
|
|
{0, 0, 0, 0}
|
|
};
|
|
|
|
static PySequenceMethods __pyx_tp_as_sequence__List_UInt64_Reader = {
|
|
__pyx_pw_5capnp_19_List_UInt64_Reader_3__len__, /*sq_length*/
|
|
0, /*sq_concat*/
|
|
0, /*sq_repeat*/
|
|
__pyx_sq_item_5capnp__List_UInt64_Reader, /*sq_item*/
|
|
0, /*sq_slice*/
|
|
0, /*sq_ass_item*/
|
|
0, /*sq_ass_slice*/
|
|
0, /*sq_contains*/
|
|
0, /*sq_inplace_concat*/
|
|
0, /*sq_inplace_repeat*/
|
|
};
|
|
|
|
static PyMappingMethods __pyx_tp_as_mapping__List_UInt64_Reader = {
|
|
__pyx_pw_5capnp_19_List_UInt64_Reader_3__len__, /*mp_length*/
|
|
__pyx_pw_5capnp_19_List_UInt64_Reader_1__getitem__, /*mp_subscript*/
|
|
0, /*mp_ass_subscript*/
|
|
};
|
|
|
|
static PyTypeObject __pyx_type_5capnp__List_UInt64_Reader = {
|
|
PyVarObject_HEAD_INIT(0, 0)
|
|
__Pyx_NAMESTR("capnp._List_UInt64_Reader"), /*tp_name*/
|
|
sizeof(struct __pyx_obj_5capnp__List_UInt64_Reader), /*tp_basicsize*/
|
|
0, /*tp_itemsize*/
|
|
__pyx_tp_dealloc_5capnp__List_UInt64_Reader, /*tp_dealloc*/
|
|
0, /*tp_print*/
|
|
0, /*tp_getattr*/
|
|
0, /*tp_setattr*/
|
|
#if PY_MAJOR_VERSION < 3
|
|
0, /*tp_compare*/
|
|
#else
|
|
0, /*reserved*/
|
|
#endif
|
|
0, /*tp_repr*/
|
|
0, /*tp_as_number*/
|
|
&__pyx_tp_as_sequence__List_UInt64_Reader, /*tp_as_sequence*/
|
|
&__pyx_tp_as_mapping__List_UInt64_Reader, /*tp_as_mapping*/
|
|
0, /*tp_hash*/
|
|
0, /*tp_call*/
|
|
0, /*tp_str*/
|
|
0, /*tp_getattro*/
|
|
0, /*tp_setattro*/
|
|
0, /*tp_as_buffer*/
|
|
Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE, /*tp_flags*/
|
|
0, /*tp_doc*/
|
|
0, /*tp_traverse*/
|
|
0, /*tp_clear*/
|
|
0, /*tp_richcompare*/
|
|
0, /*tp_weaklistoffset*/
|
|
0, /*tp_iter*/
|
|
0, /*tp_iternext*/
|
|
__pyx_methods_5capnp__List_UInt64_Reader, /*tp_methods*/
|
|
0, /*tp_members*/
|
|
0, /*tp_getset*/
|
|
0, /*tp_base*/
|
|
0, /*tp_dict*/
|
|
0, /*tp_descr_get*/
|
|
0, /*tp_descr_set*/
|
|
0, /*tp_dictoffset*/
|
|
0, /*tp_init*/
|
|
0, /*tp_alloc*/
|
|
__pyx_tp_new_5capnp__List_UInt64_Reader, /*tp_new*/
|
|
0, /*tp_free*/
|
|
0, /*tp_is_gc*/
|
|
0, /*tp_bases*/
|
|
0, /*tp_mro*/
|
|
0, /*tp_cache*/
|
|
0, /*tp_subclasses*/
|
|
0, /*tp_weaklist*/
|
|
0, /*tp_del*/
|
|
#if PY_VERSION_HEX >= 0x02060000
|
|
0, /*tp_version_tag*/
|
|
#endif
|
|
};
|
|
static struct __pyx_vtabstruct_5capnp_StructSchema __pyx_vtable_5capnp_StructSchema;
|
|
|
|
static PyObject *__pyx_tp_new_5capnp_StructSchema(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
|
|
struct __pyx_obj_5capnp_StructSchema *p;
|
|
PyObject *o;
|
|
o = (*t->tp_alloc)(t, 0);
|
|
if (unlikely(!o)) return 0;
|
|
p = ((struct __pyx_obj_5capnp_StructSchema *)o);
|
|
p->__pyx_vtab = __pyx_vtabptr_5capnp_StructSchema;
|
|
new((void*)&(p->thisptr)) ::capnp::StructSchema();
|
|
return o;
|
|
}
|
|
|
|
static void __pyx_tp_dealloc_5capnp_StructSchema(PyObject *o) {
|
|
struct __pyx_obj_5capnp_StructSchema *p = (struct __pyx_obj_5capnp_StructSchema *)o;
|
|
p->thisptr. ::capnp::StructSchema::~StructSchema();
|
|
(*Py_TYPE(o)->tp_free)(o);
|
|
}
|
|
|
|
static PyMethodDef __pyx_methods_5capnp_StructSchema[] = {
|
|
{0, 0, 0, 0}
|
|
};
|
|
|
|
static PyTypeObject __pyx_type_5capnp_StructSchema = {
|
|
PyVarObject_HEAD_INIT(0, 0)
|
|
__Pyx_NAMESTR("capnp.StructSchema"), /*tp_name*/
|
|
sizeof(struct __pyx_obj_5capnp_StructSchema), /*tp_basicsize*/
|
|
0, /*tp_itemsize*/
|
|
__pyx_tp_dealloc_5capnp_StructSchema, /*tp_dealloc*/
|
|
0, /*tp_print*/
|
|
0, /*tp_getattr*/
|
|
0, /*tp_setattr*/
|
|
#if PY_MAJOR_VERSION < 3
|
|
0, /*tp_compare*/
|
|
#else
|
|
0, /*reserved*/
|
|
#endif
|
|
0, /*tp_repr*/
|
|
0, /*tp_as_number*/
|
|
0, /*tp_as_sequence*/
|
|
0, /*tp_as_mapping*/
|
|
0, /*tp_hash*/
|
|
0, /*tp_call*/
|
|
0, /*tp_str*/
|
|
0, /*tp_getattro*/
|
|
0, /*tp_setattro*/
|
|
0, /*tp_as_buffer*/
|
|
Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE, /*tp_flags*/
|
|
0, /*tp_doc*/
|
|
0, /*tp_traverse*/
|
|
0, /*tp_clear*/
|
|
0, /*tp_richcompare*/
|
|
0, /*tp_weaklistoffset*/
|
|
0, /*tp_iter*/
|
|
0, /*tp_iternext*/
|
|
__pyx_methods_5capnp_StructSchema, /*tp_methods*/
|
|
0, /*tp_members*/
|
|
0, /*tp_getset*/
|
|
0, /*tp_base*/
|
|
0, /*tp_dict*/
|
|
0, /*tp_descr_get*/
|
|
0, /*tp_descr_set*/
|
|
0, /*tp_dictoffset*/
|
|
0, /*tp_init*/
|
|
0, /*tp_alloc*/
|
|
__pyx_tp_new_5capnp_StructSchema, /*tp_new*/
|
|
0, /*tp_free*/
|
|
0, /*tp_is_gc*/
|
|
0, /*tp_bases*/
|
|
0, /*tp_mro*/
|
|
0, /*tp_cache*/
|
|
0, /*tp_subclasses*/
|
|
0, /*tp_weaklist*/
|
|
0, /*tp_del*/
|
|
#if PY_VERSION_HEX >= 0x02060000
|
|
0, /*tp_version_tag*/
|
|
#endif
|
|
};
|
|
static struct __pyx_vtabstruct_5capnp_MessageReader __pyx_vtable_5capnp_MessageReader;
|
|
|
|
static PyObject *__pyx_tp_new_5capnp_MessageReader(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
|
|
struct __pyx_obj_5capnp_MessageReader *p;
|
|
PyObject *o;
|
|
o = (*t->tp_alloc)(t, 0);
|
|
if (unlikely(!o)) return 0;
|
|
p = ((struct __pyx_obj_5capnp_MessageReader *)o);
|
|
p->__pyx_vtab = __pyx_vtabptr_5capnp_MessageReader;
|
|
return o;
|
|
}
|
|
|
|
static void __pyx_tp_dealloc_5capnp_MessageReader(PyObject *o) {
|
|
{
|
|
PyObject *etype, *eval, *etb;
|
|
PyErr_Fetch(&etype, &eval, &etb);
|
|
++Py_REFCNT(o);
|
|
__pyx_pw_5capnp_13MessageReader_1__dealloc__(o);
|
|
if (PyErr_Occurred()) PyErr_WriteUnraisable(o);
|
|
--Py_REFCNT(o);
|
|
PyErr_Restore(etype, eval, etb);
|
|
}
|
|
(*Py_TYPE(o)->tp_free)(o);
|
|
}
|
|
|
|
static PyMethodDef __pyx_methods_5capnp_MessageReader[] = {
|
|
{__Pyx_NAMESTR("getRootNode"), (PyCFunction)__pyx_pw_5capnp_13MessageReader_3getRootNode, METH_NOARGS, __Pyx_DOCSTR(0)},
|
|
{__Pyx_NAMESTR("getRootCodeGeneratorRequest"), (PyCFunction)__pyx_pw_5capnp_13MessageReader_5getRootCodeGeneratorRequest, METH_NOARGS, __Pyx_DOCSTR(0)},
|
|
{__Pyx_NAMESTR("getRootDynamicStruct"), (PyCFunction)__pyx_pw_5capnp_13MessageReader_7getRootDynamicStruct, METH_O, __Pyx_DOCSTR(0)},
|
|
{__Pyx_NAMESTR("getRoot"), (PyCFunction)__pyx_pw_5capnp_13MessageReader_9getRoot, METH_O, __Pyx_DOCSTR(0)},
|
|
{0, 0, 0, 0}
|
|
};
|
|
|
|
static PyTypeObject __pyx_type_5capnp_MessageReader = {
|
|
PyVarObject_HEAD_INIT(0, 0)
|
|
__Pyx_NAMESTR("capnp.MessageReader"), /*tp_name*/
|
|
sizeof(struct __pyx_obj_5capnp_MessageReader), /*tp_basicsize*/
|
|
0, /*tp_itemsize*/
|
|
__pyx_tp_dealloc_5capnp_MessageReader, /*tp_dealloc*/
|
|
0, /*tp_print*/
|
|
0, /*tp_getattr*/
|
|
0, /*tp_setattr*/
|
|
#if PY_MAJOR_VERSION < 3
|
|
0, /*tp_compare*/
|
|
#else
|
|
0, /*reserved*/
|
|
#endif
|
|
0, /*tp_repr*/
|
|
0, /*tp_as_number*/
|
|
0, /*tp_as_sequence*/
|
|
0, /*tp_as_mapping*/
|
|
0, /*tp_hash*/
|
|
0, /*tp_call*/
|
|
0, /*tp_str*/
|
|
0, /*tp_getattro*/
|
|
0, /*tp_setattro*/
|
|
0, /*tp_as_buffer*/
|
|
Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE, /*tp_flags*/
|
|
0, /*tp_doc*/
|
|
0, /*tp_traverse*/
|
|
0, /*tp_clear*/
|
|
0, /*tp_richcompare*/
|
|
0, /*tp_weaklistoffset*/
|
|
0, /*tp_iter*/
|
|
0, /*tp_iternext*/
|
|
__pyx_methods_5capnp_MessageReader, /*tp_methods*/
|
|
0, /*tp_members*/
|
|
0, /*tp_getset*/
|
|
0, /*tp_base*/
|
|
0, /*tp_dict*/
|
|
0, /*tp_descr_get*/
|
|
0, /*tp_descr_set*/
|
|
0, /*tp_dictoffset*/
|
|
0, /*tp_init*/
|
|
0, /*tp_alloc*/
|
|
__pyx_tp_new_5capnp_MessageReader, /*tp_new*/
|
|
0, /*tp_free*/
|
|
0, /*tp_is_gc*/
|
|
0, /*tp_bases*/
|
|
0, /*tp_mro*/
|
|
0, /*tp_cache*/
|
|
0, /*tp_subclasses*/
|
|
0, /*tp_weaklist*/
|
|
0, /*tp_del*/
|
|
#if PY_VERSION_HEX >= 0x02060000
|
|
0, /*tp_version_tag*/
|
|
#endif
|
|
};
|
|
static struct __pyx_vtabstruct_5capnp_PackedFdMessageReader __pyx_vtable_5capnp_PackedFdMessageReader;
|
|
|
|
static PyObject *__pyx_tp_new_5capnp_PackedFdMessageReader(PyTypeObject *t, PyObject *a, PyObject *k) {
|
|
struct __pyx_obj_5capnp_PackedFdMessageReader *p;
|
|
PyObject *o = __pyx_tp_new_5capnp_MessageReader(t, a, k);
|
|
if (unlikely(!o)) return 0;
|
|
p = ((struct __pyx_obj_5capnp_PackedFdMessageReader *)o);
|
|
p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_5capnp_MessageReader*)__pyx_vtabptr_5capnp_PackedFdMessageReader;
|
|
if (unlikely(__pyx_pw_5capnp_21PackedFdMessageReader_1__cinit__(o, a, k) < 0)) {
|
|
Py_DECREF(o); o = 0;
|
|
}
|
|
return o;
|
|
}
|
|
|
|
static PyMethodDef __pyx_methods_5capnp_PackedFdMessageReader[] = {
|
|
{0, 0, 0, 0}
|
|
};
|
|
|
|
static PyTypeObject __pyx_type_5capnp_PackedFdMessageReader = {
|
|
PyVarObject_HEAD_INIT(0, 0)
|
|
__Pyx_NAMESTR("capnp.PackedFdMessageReader"), /*tp_name*/
|
|
sizeof(struct __pyx_obj_5capnp_PackedFdMessageReader), /*tp_basicsize*/
|
|
0, /*tp_itemsize*/
|
|
__pyx_tp_dealloc_5capnp_MessageReader, /*tp_dealloc*/
|
|
0, /*tp_print*/
|
|
0, /*tp_getattr*/
|
|
0, /*tp_setattr*/
|
|
#if PY_MAJOR_VERSION < 3
|
|
0, /*tp_compare*/
|
|
#else
|
|
0, /*reserved*/
|
|
#endif
|
|
0, /*tp_repr*/
|
|
0, /*tp_as_number*/
|
|
0, /*tp_as_sequence*/
|
|
0, /*tp_as_mapping*/
|
|
0, /*tp_hash*/
|
|
0, /*tp_call*/
|
|
0, /*tp_str*/
|
|
0, /*tp_getattro*/
|
|
0, /*tp_setattro*/
|
|
0, /*tp_as_buffer*/
|
|
Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE, /*tp_flags*/
|
|
0, /*tp_doc*/
|
|
0, /*tp_traverse*/
|
|
0, /*tp_clear*/
|
|
0, /*tp_richcompare*/
|
|
0, /*tp_weaklistoffset*/
|
|
0, /*tp_iter*/
|
|
0, /*tp_iternext*/
|
|
__pyx_methods_5capnp_PackedFdMessageReader, /*tp_methods*/
|
|
0, /*tp_members*/
|
|
0, /*tp_getset*/
|
|
0, /*tp_base*/
|
|
0, /*tp_dict*/
|
|
0, /*tp_descr_get*/
|
|
0, /*tp_descr_set*/
|
|
0, /*tp_dictoffset*/
|
|
0, /*tp_init*/
|
|
0, /*tp_alloc*/
|
|
__pyx_tp_new_5capnp_PackedFdMessageReader, /*tp_new*/
|
|
0, /*tp_free*/
|
|
0, /*tp_is_gc*/
|
|
0, /*tp_bases*/
|
|
0, /*tp_mro*/
|
|
0, /*tp_cache*/
|
|
0, /*tp_subclasses*/
|
|
0, /*tp_weaklist*/
|
|
0, /*tp_del*/
|
|
#if PY_VERSION_HEX >= 0x02060000
|
|
0, /*tp_version_tag*/
|
|
#endif
|
|
};
|
|
static struct __pyx_vtabstruct_5capnp__DynamicStructReader __pyx_vtable_5capnp__DynamicStructReader;
|
|
|
|
static PyObject *__pyx_tp_new_5capnp__DynamicStructReader(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
|
|
struct __pyx_obj_5capnp__DynamicStructReader *p;
|
|
PyObject *o;
|
|
o = (*t->tp_alloc)(t, 0);
|
|
if (unlikely(!o)) return 0;
|
|
p = ((struct __pyx_obj_5capnp__DynamicStructReader *)o);
|
|
p->__pyx_vtab = __pyx_vtabptr_5capnp__DynamicStructReader;
|
|
new((void*)&(p->thisptr)) ::capnp::DynamicStruct::Reader();
|
|
return o;
|
|
}
|
|
|
|
static void __pyx_tp_dealloc_5capnp__DynamicStructReader(PyObject *o) {
|
|
struct __pyx_obj_5capnp__DynamicStructReader *p = (struct __pyx_obj_5capnp__DynamicStructReader *)o;
|
|
p->thisptr. ::capnp::DynamicStruct::Reader::~Reader();
|
|
(*Py_TYPE(o)->tp_free)(o);
|
|
}
|
|
|
|
static PyObject *__pyx_tp_getattro_5capnp__DynamicStructReader(PyObject *o, PyObject *n) {
|
|
PyObject *v = PyObject_GenericGetAttr(o, n);
|
|
if (!v && PyErr_ExceptionMatches(PyExc_AttributeError)) {
|
|
PyErr_Clear();
|
|
v = __pyx_pw_5capnp_20_DynamicStructReader_3__getattr__(o, n);
|
|
}
|
|
return v;
|
|
}
|
|
|
|
static PyMethodDef __pyx_methods_5capnp__DynamicStructReader[] = {
|
|
{__Pyx_NAMESTR("_get"), (PyCFunction)__pyx_pw_5capnp_20_DynamicStructReader_1_get, METH_O, __Pyx_DOCSTR(0)},
|
|
{__Pyx_NAMESTR("__getattr__"), (PyCFunction)__pyx_pw_5capnp_20_DynamicStructReader_3__getattr__, METH_O|METH_COEXIST, __Pyx_DOCSTR(0)},
|
|
{__Pyx_NAMESTR("_has"), (PyCFunction)__pyx_pw_5capnp_20_DynamicStructReader_5_has, METH_O, __Pyx_DOCSTR(0)},
|
|
{0, 0, 0, 0}
|
|
};
|
|
|
|
static PyTypeObject __pyx_type_5capnp__DynamicStructReader = {
|
|
PyVarObject_HEAD_INIT(0, 0)
|
|
__Pyx_NAMESTR("capnp._DynamicStructReader"), /*tp_name*/
|
|
sizeof(struct __pyx_obj_5capnp__DynamicStructReader), /*tp_basicsize*/
|
|
0, /*tp_itemsize*/
|
|
__pyx_tp_dealloc_5capnp__DynamicStructReader, /*tp_dealloc*/
|
|
0, /*tp_print*/
|
|
0, /*tp_getattr*/
|
|
0, /*tp_setattr*/
|
|
#if PY_MAJOR_VERSION < 3
|
|
0, /*tp_compare*/
|
|
#else
|
|
0, /*reserved*/
|
|
#endif
|
|
0, /*tp_repr*/
|
|
0, /*tp_as_number*/
|
|
0, /*tp_as_sequence*/
|
|
0, /*tp_as_mapping*/
|
|
0, /*tp_hash*/
|
|
0, /*tp_call*/
|
|
0, /*tp_str*/
|
|
__pyx_tp_getattro_5capnp__DynamicStructReader, /*tp_getattro*/
|
|
0, /*tp_setattro*/
|
|
0, /*tp_as_buffer*/
|
|
Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE, /*tp_flags*/
|
|
0, /*tp_doc*/
|
|
0, /*tp_traverse*/
|
|
0, /*tp_clear*/
|
|
0, /*tp_richcompare*/
|
|
0, /*tp_weaklistoffset*/
|
|
0, /*tp_iter*/
|
|
0, /*tp_iternext*/
|
|
__pyx_methods_5capnp__DynamicStructReader, /*tp_methods*/
|
|
0, /*tp_members*/
|
|
0, /*tp_getset*/
|
|
0, /*tp_base*/
|
|
0, /*tp_dict*/
|
|
0, /*tp_descr_get*/
|
|
0, /*tp_descr_set*/
|
|
0, /*tp_dictoffset*/
|
|
0, /*tp_init*/
|
|
0, /*tp_alloc*/
|
|
__pyx_tp_new_5capnp__DynamicStructReader, /*tp_new*/
|
|
0, /*tp_free*/
|
|
0, /*tp_is_gc*/
|
|
0, /*tp_bases*/
|
|
0, /*tp_mro*/
|
|
0, /*tp_cache*/
|
|
0, /*tp_subclasses*/
|
|
0, /*tp_weaklist*/
|
|
0, /*tp_del*/
|
|
#if PY_VERSION_HEX >= 0x02060000
|
|
0, /*tp_version_tag*/
|
|
#endif
|
|
};
|
|
|
|
static struct __pyx_obj_5capnp___pyx_scope_struct___make_enum *__pyx_freelist_5capnp___pyx_scope_struct___make_enum[8];
|
|
static int __pyx_freecount_5capnp___pyx_scope_struct___make_enum = 0;
|
|
|
|
static PyObject *__pyx_tp_new_5capnp___pyx_scope_struct___make_enum(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
|
|
struct __pyx_obj_5capnp___pyx_scope_struct___make_enum *p;
|
|
PyObject *o;
|
|
if (likely((__pyx_freecount_5capnp___pyx_scope_struct___make_enum > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_5capnp___pyx_scope_struct___make_enum)))) {
|
|
o = (PyObject*)__pyx_freelist_5capnp___pyx_scope_struct___make_enum[--__pyx_freecount_5capnp___pyx_scope_struct___make_enum];
|
|
memset(o, 0, sizeof(struct __pyx_obj_5capnp___pyx_scope_struct___make_enum));
|
|
PyObject_INIT(o, t);
|
|
PyObject_GC_Track(o);
|
|
} else {
|
|
o = (*t->tp_alloc)(t, 0);
|
|
if (unlikely(!o)) return 0;
|
|
}
|
|
p = ((struct __pyx_obj_5capnp___pyx_scope_struct___make_enum *)o);
|
|
p->__pyx_v_enums = 0;
|
|
return o;
|
|
}
|
|
|
|
static void __pyx_tp_dealloc_5capnp___pyx_scope_struct___make_enum(PyObject *o) {
|
|
struct __pyx_obj_5capnp___pyx_scope_struct___make_enum *p = (struct __pyx_obj_5capnp___pyx_scope_struct___make_enum *)o;
|
|
PyObject_GC_UnTrack(o);
|
|
Py_CLEAR(p->__pyx_v_enums);
|
|
if ((__pyx_freecount_5capnp___pyx_scope_struct___make_enum < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_5capnp___pyx_scope_struct___make_enum))) {
|
|
__pyx_freelist_5capnp___pyx_scope_struct___make_enum[__pyx_freecount_5capnp___pyx_scope_struct___make_enum++] = ((struct __pyx_obj_5capnp___pyx_scope_struct___make_enum *)o);
|
|
} else {
|
|
(*Py_TYPE(o)->tp_free)(o);
|
|
}
|
|
}
|
|
|
|
static int __pyx_tp_traverse_5capnp___pyx_scope_struct___make_enum(PyObject *o, visitproc v, void *a) {
|
|
int e;
|
|
struct __pyx_obj_5capnp___pyx_scope_struct___make_enum *p = (struct __pyx_obj_5capnp___pyx_scope_struct___make_enum *)o;
|
|
if (p->__pyx_v_enums) {
|
|
e = (*v)(p->__pyx_v_enums, a); if (e) return e;
|
|
}
|
|
return 0;
|
|
}
|
|
|
|
static int __pyx_tp_clear_5capnp___pyx_scope_struct___make_enum(PyObject *o) {
|
|
struct __pyx_obj_5capnp___pyx_scope_struct___make_enum *p = (struct __pyx_obj_5capnp___pyx_scope_struct___make_enum *)o;
|
|
PyObject* tmp;
|
|
tmp = ((PyObject*)p->__pyx_v_enums);
|
|
p->__pyx_v_enums = ((PyObject*)Py_None); Py_INCREF(Py_None);
|
|
Py_XDECREF(tmp);
|
|
return 0;
|
|
}
|
|
|
|
static PyMethodDef __pyx_methods_5capnp___pyx_scope_struct___make_enum[] = {
|
|
{0, 0, 0, 0}
|
|
};
|
|
|
|
static PyTypeObject __pyx_type_5capnp___pyx_scope_struct___make_enum = {
|
|
PyVarObject_HEAD_INIT(0, 0)
|
|
__Pyx_NAMESTR("capnp.__pyx_scope_struct___make_enum"), /*tp_name*/
|
|
sizeof(struct __pyx_obj_5capnp___pyx_scope_struct___make_enum), /*tp_basicsize*/
|
|
0, /*tp_itemsize*/
|
|
__pyx_tp_dealloc_5capnp___pyx_scope_struct___make_enum, /*tp_dealloc*/
|
|
0, /*tp_print*/
|
|
0, /*tp_getattr*/
|
|
0, /*tp_setattr*/
|
|
#if PY_MAJOR_VERSION < 3
|
|
0, /*tp_compare*/
|
|
#else
|
|
0, /*reserved*/
|
|
#endif
|
|
0, /*tp_repr*/
|
|
0, /*tp_as_number*/
|
|
0, /*tp_as_sequence*/
|
|
0, /*tp_as_mapping*/
|
|
0, /*tp_hash*/
|
|
0, /*tp_call*/
|
|
0, /*tp_str*/
|
|
0, /*tp_getattro*/
|
|
0, /*tp_setattro*/
|
|
0, /*tp_as_buffer*/
|
|
Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
|
|
0, /*tp_doc*/
|
|
__pyx_tp_traverse_5capnp___pyx_scope_struct___make_enum, /*tp_traverse*/
|
|
__pyx_tp_clear_5capnp___pyx_scope_struct___make_enum, /*tp_clear*/
|
|
0, /*tp_richcompare*/
|
|
0, /*tp_weaklistoffset*/
|
|
0, /*tp_iter*/
|
|
0, /*tp_iternext*/
|
|
__pyx_methods_5capnp___pyx_scope_struct___make_enum, /*tp_methods*/
|
|
0, /*tp_members*/
|
|
0, /*tp_getset*/
|
|
0, /*tp_base*/
|
|
0, /*tp_dict*/
|
|
0, /*tp_descr_get*/
|
|
0, /*tp_descr_set*/
|
|
0, /*tp_dictoffset*/
|
|
0, /*tp_init*/
|
|
0, /*tp_alloc*/
|
|
__pyx_tp_new_5capnp___pyx_scope_struct___make_enum, /*tp_new*/
|
|
0, /*tp_free*/
|
|
0, /*tp_is_gc*/
|
|
0, /*tp_bases*/
|
|
0, /*tp_mro*/
|
|
0, /*tp_cache*/
|
|
0, /*tp_subclasses*/
|
|
0, /*tp_weaklist*/
|
|
0, /*tp_del*/
|
|
#if PY_VERSION_HEX >= 0x02060000
|
|
0, /*tp_version_tag*/
|
|
#endif
|
|
};
|
|
static struct __pyx_vtabstruct_5capnp_StreamFdMessageReader __pyx_vtable_5capnp_StreamFdMessageReader;
|
|
|
|
static PyObject *__pyx_tp_new_5capnp_StreamFdMessageReader(PyTypeObject *t, PyObject *a, PyObject *k) {
|
|
struct __pyx_obj_5capnp_StreamFdMessageReader *p;
|
|
PyObject *o = __pyx_tp_new_5capnp_MessageReader(t, a, k);
|
|
if (unlikely(!o)) return 0;
|
|
p = ((struct __pyx_obj_5capnp_StreamFdMessageReader *)o);
|
|
p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_5capnp_MessageReader*)__pyx_vtabptr_5capnp_StreamFdMessageReader;
|
|
if (unlikely(__pyx_pw_5capnp_21StreamFdMessageReader_1__cinit__(o, a, k) < 0)) {
|
|
Py_DECREF(o); o = 0;
|
|
}
|
|
return o;
|
|
}
|
|
|
|
static PyMethodDef __pyx_methods_5capnp_StreamFdMessageReader[] = {
|
|
{0, 0, 0, 0}
|
|
};
|
|
|
|
static PyTypeObject __pyx_type_5capnp_StreamFdMessageReader = {
|
|
PyVarObject_HEAD_INIT(0, 0)
|
|
__Pyx_NAMESTR("capnp.StreamFdMessageReader"), /*tp_name*/
|
|
sizeof(struct __pyx_obj_5capnp_StreamFdMessageReader), /*tp_basicsize*/
|
|
0, /*tp_itemsize*/
|
|
__pyx_tp_dealloc_5capnp_MessageReader, /*tp_dealloc*/
|
|
0, /*tp_print*/
|
|
0, /*tp_getattr*/
|
|
0, /*tp_setattr*/
|
|
#if PY_MAJOR_VERSION < 3
|
|
0, /*tp_compare*/
|
|
#else
|
|
0, /*reserved*/
|
|
#endif
|
|
0, /*tp_repr*/
|
|
0, /*tp_as_number*/
|
|
0, /*tp_as_sequence*/
|
|
0, /*tp_as_mapping*/
|
|
0, /*tp_hash*/
|
|
0, /*tp_call*/
|
|
0, /*tp_str*/
|
|
0, /*tp_getattro*/
|
|
0, /*tp_setattro*/
|
|
0, /*tp_as_buffer*/
|
|
Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE, /*tp_flags*/
|
|
0, /*tp_doc*/
|
|
0, /*tp_traverse*/
|
|
0, /*tp_clear*/
|
|
0, /*tp_richcompare*/
|
|
0, /*tp_weaklistoffset*/
|
|
0, /*tp_iter*/
|
|
0, /*tp_iternext*/
|
|
__pyx_methods_5capnp_StreamFdMessageReader, /*tp_methods*/
|
|
0, /*tp_members*/
|
|
0, /*tp_getset*/
|
|
0, /*tp_base*/
|
|
0, /*tp_dict*/
|
|
0, /*tp_descr_get*/
|
|
0, /*tp_descr_set*/
|
|
0, /*tp_dictoffset*/
|
|
0, /*tp_init*/
|
|
0, /*tp_alloc*/
|
|
__pyx_tp_new_5capnp_StreamFdMessageReader, /*tp_new*/
|
|
0, /*tp_free*/
|
|
0, /*tp_is_gc*/
|
|
0, /*tp_bases*/
|
|
0, /*tp_mro*/
|
|
0, /*tp_cache*/
|
|
0, /*tp_subclasses*/
|
|
0, /*tp_weaklist*/
|
|
0, /*tp_del*/
|
|
#if PY_VERSION_HEX >= 0x02060000
|
|
0, /*tp_version_tag*/
|
|
#endif
|
|
};
|
|
static struct __pyx_vtabstruct_5capnp_MallocMessageBuilder __pyx_vtable_5capnp_MallocMessageBuilder;
|
|
|
|
static PyObject *__pyx_tp_new_5capnp_MallocMessageBuilder(PyTypeObject *t, PyObject *a, PyObject *k) {
|
|
struct __pyx_obj_5capnp_MallocMessageBuilder *p;
|
|
PyObject *o = __pyx_tp_new_5capnp_MessageBuilder(t, a, k);
|
|
if (unlikely(!o)) return 0;
|
|
p = ((struct __pyx_obj_5capnp_MallocMessageBuilder *)o);
|
|
p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_5capnp_MessageBuilder*)__pyx_vtabptr_5capnp_MallocMessageBuilder;
|
|
if (unlikely(__pyx_pw_5capnp_20MallocMessageBuilder_1__cinit__(o, __pyx_empty_tuple, NULL) < 0)) {
|
|
Py_DECREF(o); o = 0;
|
|
}
|
|
return o;
|
|
}
|
|
|
|
static PyMethodDef __pyx_methods_5capnp_MallocMessageBuilder[] = {
|
|
{0, 0, 0, 0}
|
|
};
|
|
|
|
static PyTypeObject __pyx_type_5capnp_MallocMessageBuilder = {
|
|
PyVarObject_HEAD_INIT(0, 0)
|
|
__Pyx_NAMESTR("capnp.MallocMessageBuilder"), /*tp_name*/
|
|
sizeof(struct __pyx_obj_5capnp_MallocMessageBuilder), /*tp_basicsize*/
|
|
0, /*tp_itemsize*/
|
|
__pyx_tp_dealloc_5capnp_MessageBuilder, /*tp_dealloc*/
|
|
0, /*tp_print*/
|
|
0, /*tp_getattr*/
|
|
0, /*tp_setattr*/
|
|
#if PY_MAJOR_VERSION < 3
|
|
0, /*tp_compare*/
|
|
#else
|
|
0, /*reserved*/
|
|
#endif
|
|
0, /*tp_repr*/
|
|
0, /*tp_as_number*/
|
|
0, /*tp_as_sequence*/
|
|
0, /*tp_as_mapping*/
|
|
0, /*tp_hash*/
|
|
0, /*tp_call*/
|
|
0, /*tp_str*/
|
|
0, /*tp_getattro*/
|
|
0, /*tp_setattro*/
|
|
0, /*tp_as_buffer*/
|
|
Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE, /*tp_flags*/
|
|
0, /*tp_doc*/
|
|
0, /*tp_traverse*/
|
|
0, /*tp_clear*/
|
|
0, /*tp_richcompare*/
|
|
0, /*tp_weaklistoffset*/
|
|
0, /*tp_iter*/
|
|
0, /*tp_iternext*/
|
|
__pyx_methods_5capnp_MallocMessageBuilder, /*tp_methods*/
|
|
0, /*tp_members*/
|
|
0, /*tp_getset*/
|
|
0, /*tp_base*/
|
|
0, /*tp_dict*/
|
|
0, /*tp_descr_get*/
|
|
0, /*tp_descr_set*/
|
|
0, /*tp_dictoffset*/
|
|
0, /*tp_init*/
|
|
0, /*tp_alloc*/
|
|
__pyx_tp_new_5capnp_MallocMessageBuilder, /*tp_new*/
|
|
0, /*tp_free*/
|
|
0, /*tp_is_gc*/
|
|
0, /*tp_bases*/
|
|
0, /*tp_mro*/
|
|
0, /*tp_cache*/
|
|
0, /*tp_subclasses*/
|
|
0, /*tp_weaklist*/
|
|
0, /*tp_del*/
|
|
#if PY_VERSION_HEX >= 0x02060000
|
|
0, /*tp_version_tag*/
|
|
#endif
|
|
};
|
|
static struct __pyx_vtabstruct_5capnp__DynamicValueReader __pyx_vtable_5capnp__DynamicValueReader;
|
|
|
|
static PyObject *__pyx_tp_new_5capnp__DynamicValueReader(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
|
|
struct __pyx_obj_5capnp__DynamicValueReader *p;
|
|
PyObject *o;
|
|
o = (*t->tp_alloc)(t, 0);
|
|
if (unlikely(!o)) return 0;
|
|
p = ((struct __pyx_obj_5capnp__DynamicValueReader *)o);
|
|
p->__pyx_vtab = __pyx_vtabptr_5capnp__DynamicValueReader;
|
|
new((void*)&(p->thisptr)) ::capnp::DynamicValue::Reader();
|
|
return o;
|
|
}
|
|
|
|
static void __pyx_tp_dealloc_5capnp__DynamicValueReader(PyObject *o) {
|
|
struct __pyx_obj_5capnp__DynamicValueReader *p = (struct __pyx_obj_5capnp__DynamicValueReader *)o;
|
|
p->thisptr. ::capnp::DynamicValue::Reader::~Reader();
|
|
(*Py_TYPE(o)->tp_free)(o);
|
|
}
|
|
|
|
static PyMethodDef __pyx_methods_5capnp__DynamicValueReader[] = {
|
|
{__Pyx_NAMESTR("getType"), (PyCFunction)__pyx_pw_5capnp_19_DynamicValueReader_1getType, METH_NOARGS, __Pyx_DOCSTR(0)},
|
|
{__Pyx_NAMESTR("toPython"), (PyCFunction)__pyx_pw_5capnp_19_DynamicValueReader_3toPython, METH_NOARGS, __Pyx_DOCSTR(0)},
|
|
{0, 0, 0, 0}
|
|
};
|
|
|
|
static PyTypeObject __pyx_type_5capnp__DynamicValueReader = {
|
|
PyVarObject_HEAD_INIT(0, 0)
|
|
__Pyx_NAMESTR("capnp._DynamicValueReader"), /*tp_name*/
|
|
sizeof(struct __pyx_obj_5capnp__DynamicValueReader), /*tp_basicsize*/
|
|
0, /*tp_itemsize*/
|
|
__pyx_tp_dealloc_5capnp__DynamicValueReader, /*tp_dealloc*/
|
|
0, /*tp_print*/
|
|
0, /*tp_getattr*/
|
|
0, /*tp_setattr*/
|
|
#if PY_MAJOR_VERSION < 3
|
|
0, /*tp_compare*/
|
|
#else
|
|
0, /*reserved*/
|
|
#endif
|
|
0, /*tp_repr*/
|
|
0, /*tp_as_number*/
|
|
0, /*tp_as_sequence*/
|
|
0, /*tp_as_mapping*/
|
|
0, /*tp_hash*/
|
|
0, /*tp_call*/
|
|
0, /*tp_str*/
|
|
0, /*tp_getattro*/
|
|
0, /*tp_setattro*/
|
|
0, /*tp_as_buffer*/
|
|
Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE, /*tp_flags*/
|
|
0, /*tp_doc*/
|
|
0, /*tp_traverse*/
|
|
0, /*tp_clear*/
|
|
0, /*tp_richcompare*/
|
|
0, /*tp_weaklistoffset*/
|
|
0, /*tp_iter*/
|
|
0, /*tp_iternext*/
|
|
__pyx_methods_5capnp__DynamicValueReader, /*tp_methods*/
|
|
0, /*tp_members*/
|
|
0, /*tp_getset*/
|
|
0, /*tp_base*/
|
|
0, /*tp_dict*/
|
|
0, /*tp_descr_get*/
|
|
0, /*tp_descr_set*/
|
|
0, /*tp_dictoffset*/
|
|
0, /*tp_init*/
|
|
0, /*tp_alloc*/
|
|
__pyx_tp_new_5capnp__DynamicValueReader, /*tp_new*/
|
|
0, /*tp_free*/
|
|
0, /*tp_is_gc*/
|
|
0, /*tp_bases*/
|
|
0, /*tp_mro*/
|
|
0, /*tp_cache*/
|
|
0, /*tp_subclasses*/
|
|
0, /*tp_weaklist*/
|
|
0, /*tp_del*/
|
|
#if PY_VERSION_HEX >= 0x02060000
|
|
0, /*tp_version_tag*/
|
|
#endif
|
|
};
|
|
static struct __pyx_vtabstruct_5capnp_Schema __pyx_vtable_5capnp_Schema;
|
|
|
|
static PyObject *__pyx_tp_new_5capnp_Schema(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
|
|
struct __pyx_obj_5capnp_Schema *p;
|
|
PyObject *o;
|
|
o = (*t->tp_alloc)(t, 0);
|
|
if (unlikely(!o)) return 0;
|
|
p = ((struct __pyx_obj_5capnp_Schema *)o);
|
|
p->__pyx_vtab = __pyx_vtabptr_5capnp_Schema;
|
|
new((void*)&(p->thisptr)) ::capnp::Schema();
|
|
return o;
|
|
}
|
|
|
|
static void __pyx_tp_dealloc_5capnp_Schema(PyObject *o) {
|
|
struct __pyx_obj_5capnp_Schema *p = (struct __pyx_obj_5capnp_Schema *)o;
|
|
p->thisptr. ::capnp::Schema::~Schema();
|
|
(*Py_TYPE(o)->tp_free)(o);
|
|
}
|
|
|
|
static PyMethodDef __pyx_methods_5capnp_Schema[] = {
|
|
{__Pyx_NAMESTR("asStruct"), (PyCFunction)__pyx_pw_5capnp_6Schema_1asStruct, METH_NOARGS, __Pyx_DOCSTR(0)},
|
|
{__Pyx_NAMESTR("getDependency"), (PyCFunction)__pyx_pw_5capnp_6Schema_3getDependency, METH_O, __Pyx_DOCSTR(0)},
|
|
{__Pyx_NAMESTR("getProto"), (PyCFunction)__pyx_pw_5capnp_6Schema_5getProto, METH_NOARGS, __Pyx_DOCSTR(0)},
|
|
{0, 0, 0, 0}
|
|
};
|
|
|
|
static PyTypeObject __pyx_type_5capnp_Schema = {
|
|
PyVarObject_HEAD_INIT(0, 0)
|
|
__Pyx_NAMESTR("capnp.Schema"), /*tp_name*/
|
|
sizeof(struct __pyx_obj_5capnp_Schema), /*tp_basicsize*/
|
|
0, /*tp_itemsize*/
|
|
__pyx_tp_dealloc_5capnp_Schema, /*tp_dealloc*/
|
|
0, /*tp_print*/
|
|
0, /*tp_getattr*/
|
|
0, /*tp_setattr*/
|
|
#if PY_MAJOR_VERSION < 3
|
|
0, /*tp_compare*/
|
|
#else
|
|
0, /*reserved*/
|
|
#endif
|
|
0, /*tp_repr*/
|
|
0, /*tp_as_number*/
|
|
0, /*tp_as_sequence*/
|
|
0, /*tp_as_mapping*/
|
|
0, /*tp_hash*/
|
|
0, /*tp_call*/
|
|
0, /*tp_str*/
|
|
0, /*tp_getattro*/
|
|
0, /*tp_setattro*/
|
|
0, /*tp_as_buffer*/
|
|
Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE, /*tp_flags*/
|
|
0, /*tp_doc*/
|
|
0, /*tp_traverse*/
|
|
0, /*tp_clear*/
|
|
0, /*tp_richcompare*/
|
|
0, /*tp_weaklistoffset*/
|
|
0, /*tp_iter*/
|
|
0, /*tp_iternext*/
|
|
__pyx_methods_5capnp_Schema, /*tp_methods*/
|
|
0, /*tp_members*/
|
|
0, /*tp_getset*/
|
|
0, /*tp_base*/
|
|
0, /*tp_dict*/
|
|
0, /*tp_descr_get*/
|
|
0, /*tp_descr_set*/
|
|
0, /*tp_dictoffset*/
|
|
0, /*tp_init*/
|
|
0, /*tp_alloc*/
|
|
__pyx_tp_new_5capnp_Schema, /*tp_new*/
|
|
0, /*tp_free*/
|
|
0, /*tp_is_gc*/
|
|
0, /*tp_bases*/
|
|
0, /*tp_mro*/
|
|
0, /*tp_cache*/
|
|
0, /*tp_subclasses*/
|
|
0, /*tp_weaklist*/
|
|
0, /*tp_del*/
|
|
#if PY_VERSION_HEX >= 0x02060000
|
|
0, /*tp_version_tag*/
|
|
#endif
|
|
};
|
|
static struct __pyx_vtabstruct_5capnp__CodeGeneratorRequestReader __pyx_vtable_5capnp__CodeGeneratorRequestReader;
|
|
|
|
static PyObject *__pyx_tp_new_5capnp__CodeGeneratorRequestReader(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
|
|
struct __pyx_obj_5capnp__CodeGeneratorRequestReader *p;
|
|
PyObject *o;
|
|
o = (*t->tp_alloc)(t, 0);
|
|
if (unlikely(!o)) return 0;
|
|
p = ((struct __pyx_obj_5capnp__CodeGeneratorRequestReader *)o);
|
|
p->__pyx_vtab = __pyx_vtabptr_5capnp__CodeGeneratorRequestReader;
|
|
new((void*)&(p->thisptr)) ::capnp::schema::CodeGeneratorRequest::Reader();
|
|
return o;
|
|
}
|
|
|
|
static void __pyx_tp_dealloc_5capnp__CodeGeneratorRequestReader(PyObject *o) {
|
|
struct __pyx_obj_5capnp__CodeGeneratorRequestReader *p = (struct __pyx_obj_5capnp__CodeGeneratorRequestReader *)o;
|
|
p->thisptr. ::capnp::schema::CodeGeneratorRequest::Reader::~Reader();
|
|
(*Py_TYPE(o)->tp_free)(o);
|
|
}
|
|
|
|
static PyObject *__pyx_getprop_5capnp_27_CodeGeneratorRequestReader_nodes(PyObject *o, CYTHON_UNUSED void *x) {
|
|
return __pyx_pw_5capnp_27_CodeGeneratorRequestReader_5nodes_1__get__(o);
|
|
}
|
|
|
|
static PyObject *__pyx_getprop_5capnp_27_CodeGeneratorRequestReader_requestedFiles(PyObject *o, CYTHON_UNUSED void *x) {
|
|
return __pyx_pw_5capnp_27_CodeGeneratorRequestReader_14requestedFiles_1__get__(o);
|
|
}
|
|
|
|
static PyMethodDef __pyx_methods_5capnp__CodeGeneratorRequestReader[] = {
|
|
{0, 0, 0, 0}
|
|
};
|
|
|
|
static struct PyGetSetDef __pyx_getsets_5capnp__CodeGeneratorRequestReader[] = {
|
|
{(char *)"nodes", __pyx_getprop_5capnp_27_CodeGeneratorRequestReader_nodes, 0, 0, 0},
|
|
{(char *)"requestedFiles", __pyx_getprop_5capnp_27_CodeGeneratorRequestReader_requestedFiles, 0, 0, 0},
|
|
{0, 0, 0, 0, 0}
|
|
};
|
|
|
|
static PyTypeObject __pyx_type_5capnp__CodeGeneratorRequestReader = {
|
|
PyVarObject_HEAD_INIT(0, 0)
|
|
__Pyx_NAMESTR("capnp._CodeGeneratorRequestReader"), /*tp_name*/
|
|
sizeof(struct __pyx_obj_5capnp__CodeGeneratorRequestReader), /*tp_basicsize*/
|
|
0, /*tp_itemsize*/
|
|
__pyx_tp_dealloc_5capnp__CodeGeneratorRequestReader, /*tp_dealloc*/
|
|
0, /*tp_print*/
|
|
0, /*tp_getattr*/
|
|
0, /*tp_setattr*/
|
|
#if PY_MAJOR_VERSION < 3
|
|
0, /*tp_compare*/
|
|
#else
|
|
0, /*reserved*/
|
|
#endif
|
|
0, /*tp_repr*/
|
|
0, /*tp_as_number*/
|
|
0, /*tp_as_sequence*/
|
|
0, /*tp_as_mapping*/
|
|
0, /*tp_hash*/
|
|
0, /*tp_call*/
|
|
0, /*tp_str*/
|
|
0, /*tp_getattro*/
|
|
0, /*tp_setattro*/
|
|
0, /*tp_as_buffer*/
|
|
Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE, /*tp_flags*/
|
|
0, /*tp_doc*/
|
|
0, /*tp_traverse*/
|
|
0, /*tp_clear*/
|
|
0, /*tp_richcompare*/
|
|
0, /*tp_weaklistoffset*/
|
|
0, /*tp_iter*/
|
|
0, /*tp_iternext*/
|
|
__pyx_methods_5capnp__CodeGeneratorRequestReader, /*tp_methods*/
|
|
0, /*tp_members*/
|
|
__pyx_getsets_5capnp__CodeGeneratorRequestReader, /*tp_getset*/
|
|
0, /*tp_base*/
|
|
0, /*tp_dict*/
|
|
0, /*tp_descr_get*/
|
|
0, /*tp_descr_set*/
|
|
0, /*tp_dictoffset*/
|
|
0, /*tp_init*/
|
|
0, /*tp_alloc*/
|
|
__pyx_tp_new_5capnp__CodeGeneratorRequestReader, /*tp_new*/
|
|
0, /*tp_free*/
|
|
0, /*tp_is_gc*/
|
|
0, /*tp_bases*/
|
|
0, /*tp_mro*/
|
|
0, /*tp_cache*/
|
|
0, /*tp_subclasses*/
|
|
0, /*tp_weaklist*/
|
|
0, /*tp_del*/
|
|
#if PY_VERSION_HEX >= 0x02060000
|
|
0, /*tp_version_tag*/
|
|
#endif
|
|
};
|
|
static struct __pyx_vtabstruct_5capnp__DynamicUnionBuilder __pyx_vtable_5capnp__DynamicUnionBuilder;
|
|
|
|
static PyObject *__pyx_tp_new_5capnp__DynamicUnionBuilder(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
|
|
struct __pyx_obj_5capnp__DynamicUnionBuilder *p;
|
|
PyObject *o;
|
|
o = (*t->tp_alloc)(t, 0);
|
|
if (unlikely(!o)) return 0;
|
|
p = ((struct __pyx_obj_5capnp__DynamicUnionBuilder *)o);
|
|
p->__pyx_vtab = __pyx_vtabptr_5capnp__DynamicUnionBuilder;
|
|
new((void*)&(p->thisptr)) ::capnp::DynamicUnion::Builder();
|
|
return o;
|
|
}
|
|
|
|
static void __pyx_tp_dealloc_5capnp__DynamicUnionBuilder(PyObject *o) {
|
|
struct __pyx_obj_5capnp__DynamicUnionBuilder *p = (struct __pyx_obj_5capnp__DynamicUnionBuilder *)o;
|
|
p->thisptr. ::capnp::DynamicUnion::Builder::~Builder();
|
|
(*Py_TYPE(o)->tp_free)(o);
|
|
}
|
|
|
|
static PyObject *__pyx_tp_getattro_5capnp__DynamicUnionBuilder(PyObject *o, PyObject *n) {
|
|
PyObject *v = PyObject_GenericGetAttr(o, n);
|
|
if (!v && PyErr_ExceptionMatches(PyExc_AttributeError)) {
|
|
PyErr_Clear();
|
|
v = __pyx_pw_5capnp_20_DynamicUnionBuilder_1__getattr__(o, n);
|
|
}
|
|
return v;
|
|
}
|
|
|
|
static int __pyx_tp_setattro_5capnp__DynamicUnionBuilder(PyObject *o, PyObject *n, PyObject *v) {
|
|
if (v) {
|
|
return __pyx_pw_5capnp_20_DynamicUnionBuilder_3__setattr__(o, n, v);
|
|
}
|
|
else {
|
|
return PyObject_GenericSetAttr(o, n, 0);
|
|
}
|
|
}
|
|
|
|
static PyMethodDef __pyx_methods_5capnp__DynamicUnionBuilder[] = {
|
|
{__Pyx_NAMESTR("__getattr__"), (PyCFunction)__pyx_pw_5capnp_20_DynamicUnionBuilder_1__getattr__, METH_O|METH_COEXIST, __Pyx_DOCSTR(0)},
|
|
{__Pyx_NAMESTR("which"), (PyCFunction)__pyx_pw_5capnp_20_DynamicUnionBuilder_5which, METH_NOARGS, __Pyx_DOCSTR(0)},
|
|
{__Pyx_NAMESTR("init"), (PyCFunction)__pyx_pw_5capnp_20_DynamicUnionBuilder_7init, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)},
|
|
{0, 0, 0, 0}
|
|
};
|
|
|
|
static PyTypeObject __pyx_type_5capnp__DynamicUnionBuilder = {
|
|
PyVarObject_HEAD_INIT(0, 0)
|
|
__Pyx_NAMESTR("capnp._DynamicUnionBuilder"), /*tp_name*/
|
|
sizeof(struct __pyx_obj_5capnp__DynamicUnionBuilder), /*tp_basicsize*/
|
|
0, /*tp_itemsize*/
|
|
__pyx_tp_dealloc_5capnp__DynamicUnionBuilder, /*tp_dealloc*/
|
|
0, /*tp_print*/
|
|
0, /*tp_getattr*/
|
|
0, /*tp_setattr*/
|
|
#if PY_MAJOR_VERSION < 3
|
|
0, /*tp_compare*/
|
|
#else
|
|
0, /*reserved*/
|
|
#endif
|
|
0, /*tp_repr*/
|
|
0, /*tp_as_number*/
|
|
0, /*tp_as_sequence*/
|
|
0, /*tp_as_mapping*/
|
|
0, /*tp_hash*/
|
|
0, /*tp_call*/
|
|
0, /*tp_str*/
|
|
__pyx_tp_getattro_5capnp__DynamicUnionBuilder, /*tp_getattro*/
|
|
__pyx_tp_setattro_5capnp__DynamicUnionBuilder, /*tp_setattro*/
|
|
0, /*tp_as_buffer*/
|
|
Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE, /*tp_flags*/
|
|
0, /*tp_doc*/
|
|
0, /*tp_traverse*/
|
|
0, /*tp_clear*/
|
|
0, /*tp_richcompare*/
|
|
0, /*tp_weaklistoffset*/
|
|
0, /*tp_iter*/
|
|
0, /*tp_iternext*/
|
|
__pyx_methods_5capnp__DynamicUnionBuilder, /*tp_methods*/
|
|
0, /*tp_members*/
|
|
0, /*tp_getset*/
|
|
0, /*tp_base*/
|
|
0, /*tp_dict*/
|
|
0, /*tp_descr_get*/
|
|
0, /*tp_descr_set*/
|
|
0, /*tp_dictoffset*/
|
|
0, /*tp_init*/
|
|
0, /*tp_alloc*/
|
|
__pyx_tp_new_5capnp__DynamicUnionBuilder, /*tp_new*/
|
|
0, /*tp_free*/
|
|
0, /*tp_is_gc*/
|
|
0, /*tp_bases*/
|
|
0, /*tp_mro*/
|
|
0, /*tp_cache*/
|
|
0, /*tp_subclasses*/
|
|
0, /*tp_weaklist*/
|
|
0, /*tp_del*/
|
|
#if PY_VERSION_HEX >= 0x02060000
|
|
0, /*tp_version_tag*/
|
|
#endif
|
|
};
|
|
static struct __pyx_vtabstruct_5capnp__DynamicListBuilder __pyx_vtable_5capnp__DynamicListBuilder;
|
|
|
|
static PyObject *__pyx_tp_new_5capnp__DynamicListBuilder(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
|
|
struct __pyx_obj_5capnp__DynamicListBuilder *p;
|
|
PyObject *o;
|
|
o = (*t->tp_alloc)(t, 0);
|
|
if (unlikely(!o)) return 0;
|
|
p = ((struct __pyx_obj_5capnp__DynamicListBuilder *)o);
|
|
p->__pyx_vtab = __pyx_vtabptr_5capnp__DynamicListBuilder;
|
|
new((void*)&(p->thisptr)) ::capnp::DynamicList::Builder();
|
|
return o;
|
|
}
|
|
|
|
static void __pyx_tp_dealloc_5capnp__DynamicListBuilder(PyObject *o) {
|
|
struct __pyx_obj_5capnp__DynamicListBuilder *p = (struct __pyx_obj_5capnp__DynamicListBuilder *)o;
|
|
p->thisptr. ::capnp::DynamicList::Builder::~Builder();
|
|
(*Py_TYPE(o)->tp_free)(o);
|
|
}
|
|
static PyObject *__pyx_sq_item_5capnp__DynamicListBuilder(PyObject *o, Py_ssize_t i) {
|
|
PyObject *r;
|
|
PyObject *x = PyInt_FromSsize_t(i); if(!x) return 0;
|
|
r = Py_TYPE(o)->tp_as_mapping->mp_subscript(o, x);
|
|
Py_DECREF(x);
|
|
return r;
|
|
}
|
|
|
|
static int __pyx_mp_ass_subscript_5capnp__DynamicListBuilder(PyObject *o, PyObject *i, PyObject *v) {
|
|
if (v) {
|
|
return __pyx_pw_5capnp_19_DynamicListBuilder_5__setitem__(o, i, v);
|
|
}
|
|
else {
|
|
PyErr_Format(PyExc_NotImplementedError,
|
|
"Subscript deletion not supported by %s", Py_TYPE(o)->tp_name);
|
|
return -1;
|
|
}
|
|
}
|
|
|
|
static PyMethodDef __pyx_methods_5capnp__DynamicListBuilder[] = {
|
|
{__Pyx_NAMESTR("__pyx_fuse_0_setitem"), (PyCFunction)__pyx_fuse_0__pyx_pw_5capnp_19_DynamicListBuilder_9_setitem, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)},
|
|
{__Pyx_NAMESTR("__pyx_fuse_1_setitem"), (PyCFunction)__pyx_fuse_1__pyx_pw_5capnp_19_DynamicListBuilder_11_setitem, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)},
|
|
{__Pyx_NAMESTR("__pyx_fuse_2_setitem"), (PyCFunction)__pyx_fuse_2__pyx_pw_5capnp_19_DynamicListBuilder_13_setitem, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)},
|
|
{__Pyx_NAMESTR("__pyx_fuse_3_setitem"), (PyCFunction)__pyx_fuse_3__pyx_pw_5capnp_19_DynamicListBuilder_15_setitem, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)},
|
|
{__Pyx_NAMESTR("__pyx_fuse_4_setitem"), (PyCFunction)__pyx_fuse_4__pyx_pw_5capnp_19_DynamicListBuilder_17_setitem, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)},
|
|
{__Pyx_NAMESTR("__pyx_fuse_5_setitem"), (PyCFunction)__pyx_fuse_5__pyx_pw_5capnp_19_DynamicListBuilder_19_setitem, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)},
|
|
{0, 0, 0, 0}
|
|
};
|
|
|
|
static PySequenceMethods __pyx_tp_as_sequence__DynamicListBuilder = {
|
|
__pyx_pw_5capnp_19_DynamicListBuilder_7__len__, /*sq_length*/
|
|
0, /*sq_concat*/
|
|
0, /*sq_repeat*/
|
|
__pyx_sq_item_5capnp__DynamicListBuilder, /*sq_item*/
|
|
0, /*sq_slice*/
|
|
0, /*sq_ass_item*/
|
|
0, /*sq_ass_slice*/
|
|
0, /*sq_contains*/
|
|
0, /*sq_inplace_concat*/
|
|
0, /*sq_inplace_repeat*/
|
|
};
|
|
|
|
static PyMappingMethods __pyx_tp_as_mapping__DynamicListBuilder = {
|
|
__pyx_pw_5capnp_19_DynamicListBuilder_7__len__, /*mp_length*/
|
|
__pyx_pw_5capnp_19_DynamicListBuilder_1__getitem__, /*mp_subscript*/
|
|
__pyx_mp_ass_subscript_5capnp__DynamicListBuilder, /*mp_ass_subscript*/
|
|
};
|
|
|
|
static PyTypeObject __pyx_type_5capnp__DynamicListBuilder = {
|
|
PyVarObject_HEAD_INIT(0, 0)
|
|
__Pyx_NAMESTR("capnp._DynamicListBuilder"), /*tp_name*/
|
|
sizeof(struct __pyx_obj_5capnp__DynamicListBuilder), /*tp_basicsize*/
|
|
0, /*tp_itemsize*/
|
|
__pyx_tp_dealloc_5capnp__DynamicListBuilder, /*tp_dealloc*/
|
|
0, /*tp_print*/
|
|
0, /*tp_getattr*/
|
|
0, /*tp_setattr*/
|
|
#if PY_MAJOR_VERSION < 3
|
|
0, /*tp_compare*/
|
|
#else
|
|
0, /*reserved*/
|
|
#endif
|
|
0, /*tp_repr*/
|
|
0, /*tp_as_number*/
|
|
&__pyx_tp_as_sequence__DynamicListBuilder, /*tp_as_sequence*/
|
|
&__pyx_tp_as_mapping__DynamicListBuilder, /*tp_as_mapping*/
|
|
0, /*tp_hash*/
|
|
0, /*tp_call*/
|
|
0, /*tp_str*/
|
|
0, /*tp_getattro*/
|
|
0, /*tp_setattro*/
|
|
0, /*tp_as_buffer*/
|
|
Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE, /*tp_flags*/
|
|
0, /*tp_doc*/
|
|
0, /*tp_traverse*/
|
|
0, /*tp_clear*/
|
|
0, /*tp_richcompare*/
|
|
0, /*tp_weaklistoffset*/
|
|
0, /*tp_iter*/
|
|
0, /*tp_iternext*/
|
|
__pyx_methods_5capnp__DynamicListBuilder, /*tp_methods*/
|
|
0, /*tp_members*/
|
|
0, /*tp_getset*/
|
|
0, /*tp_base*/
|
|
0, /*tp_dict*/
|
|
0, /*tp_descr_get*/
|
|
0, /*tp_descr_set*/
|
|
0, /*tp_dictoffset*/
|
|
0, /*tp_init*/
|
|
0, /*tp_alloc*/
|
|
__pyx_tp_new_5capnp__DynamicListBuilder, /*tp_new*/
|
|
0, /*tp_free*/
|
|
0, /*tp_is_gc*/
|
|
0, /*tp_bases*/
|
|
0, /*tp_mro*/
|
|
0, /*tp_cache*/
|
|
0, /*tp_subclasses*/
|
|
0, /*tp_weaklist*/
|
|
0, /*tp_del*/
|
|
#if PY_VERSION_HEX >= 0x02060000
|
|
0, /*tp_version_tag*/
|
|
#endif
|
|
};
|
|
static struct __pyx_vtabstruct_5capnp__DynamicStructBuilder __pyx_vtable_5capnp__DynamicStructBuilder;
|
|
|
|
static PyObject *__pyx_tp_new_5capnp__DynamicStructBuilder(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
|
|
struct __pyx_obj_5capnp__DynamicStructBuilder *p;
|
|
PyObject *o;
|
|
o = (*t->tp_alloc)(t, 0);
|
|
if (unlikely(!o)) return 0;
|
|
p = ((struct __pyx_obj_5capnp__DynamicStructBuilder *)o);
|
|
p->__pyx_vtab = __pyx_vtabptr_5capnp__DynamicStructBuilder;
|
|
new((void*)&(p->thisptr)) ::capnp::DynamicStruct::Builder();
|
|
return o;
|
|
}
|
|
|
|
static void __pyx_tp_dealloc_5capnp__DynamicStructBuilder(PyObject *o) {
|
|
struct __pyx_obj_5capnp__DynamicStructBuilder *p = (struct __pyx_obj_5capnp__DynamicStructBuilder *)o;
|
|
p->thisptr. ::capnp::DynamicStruct::Builder::~Builder();
|
|
(*Py_TYPE(o)->tp_free)(o);
|
|
}
|
|
|
|
static PyObject *__pyx_tp_getattro_5capnp__DynamicStructBuilder(PyObject *o, PyObject *n) {
|
|
PyObject *v = PyObject_GenericGetAttr(o, n);
|
|
if (!v && PyErr_ExceptionMatches(PyExc_AttributeError)) {
|
|
PyErr_Clear();
|
|
v = __pyx_pw_5capnp_21_DynamicStructBuilder_1__getattr__(o, n);
|
|
}
|
|
return v;
|
|
}
|
|
|
|
static int __pyx_tp_setattro_5capnp__DynamicStructBuilder(PyObject *o, PyObject *n, PyObject *v) {
|
|
if (v) {
|
|
return __pyx_pw_5capnp_21_DynamicStructBuilder_3__setattr__(o, n, v);
|
|
}
|
|
else {
|
|
return PyObject_GenericSetAttr(o, n, 0);
|
|
}
|
|
}
|
|
|
|
static PyMethodDef __pyx_methods_5capnp__DynamicStructBuilder[] = {
|
|
{__Pyx_NAMESTR("__getattr__"), (PyCFunction)__pyx_pw_5capnp_21_DynamicStructBuilder_1__getattr__, METH_O|METH_COEXIST, __Pyx_DOCSTR(0)},
|
|
{__Pyx_NAMESTR("_has"), (PyCFunction)__pyx_pw_5capnp_21_DynamicStructBuilder_5_has, METH_O, __Pyx_DOCSTR(0)},
|
|
{__Pyx_NAMESTR("init"), (PyCFunction)__pyx_pw_5capnp_21_DynamicStructBuilder_7init, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)},
|
|
{0, 0, 0, 0}
|
|
};
|
|
|
|
static PyTypeObject __pyx_type_5capnp__DynamicStructBuilder = {
|
|
PyVarObject_HEAD_INIT(0, 0)
|
|
__Pyx_NAMESTR("capnp._DynamicStructBuilder"), /*tp_name*/
|
|
sizeof(struct __pyx_obj_5capnp__DynamicStructBuilder), /*tp_basicsize*/
|
|
0, /*tp_itemsize*/
|
|
__pyx_tp_dealloc_5capnp__DynamicStructBuilder, /*tp_dealloc*/
|
|
0, /*tp_print*/
|
|
0, /*tp_getattr*/
|
|
0, /*tp_setattr*/
|
|
#if PY_MAJOR_VERSION < 3
|
|
0, /*tp_compare*/
|
|
#else
|
|
0, /*reserved*/
|
|
#endif
|
|
0, /*tp_repr*/
|
|
0, /*tp_as_number*/
|
|
0, /*tp_as_sequence*/
|
|
0, /*tp_as_mapping*/
|
|
0, /*tp_hash*/
|
|
0, /*tp_call*/
|
|
0, /*tp_str*/
|
|
__pyx_tp_getattro_5capnp__DynamicStructBuilder, /*tp_getattro*/
|
|
__pyx_tp_setattro_5capnp__DynamicStructBuilder, /*tp_setattro*/
|
|
0, /*tp_as_buffer*/
|
|
Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE, /*tp_flags*/
|
|
0, /*tp_doc*/
|
|
0, /*tp_traverse*/
|
|
0, /*tp_clear*/
|
|
0, /*tp_richcompare*/
|
|
0, /*tp_weaklistoffset*/
|
|
0, /*tp_iter*/
|
|
0, /*tp_iternext*/
|
|
__pyx_methods_5capnp__DynamicStructBuilder, /*tp_methods*/
|
|
0, /*tp_members*/
|
|
0, /*tp_getset*/
|
|
0, /*tp_base*/
|
|
0, /*tp_dict*/
|
|
0, /*tp_descr_get*/
|
|
0, /*tp_descr_set*/
|
|
0, /*tp_dictoffset*/
|
|
0, /*tp_init*/
|
|
0, /*tp_alloc*/
|
|
__pyx_tp_new_5capnp__DynamicStructBuilder, /*tp_new*/
|
|
0, /*tp_free*/
|
|
0, /*tp_is_gc*/
|
|
0, /*tp_bases*/
|
|
0, /*tp_mro*/
|
|
0, /*tp_cache*/
|
|
0, /*tp_subclasses*/
|
|
0, /*tp_weaklist*/
|
|
0, /*tp_del*/
|
|
#if PY_VERSION_HEX >= 0x02060000
|
|
0, /*tp_version_tag*/
|
|
#endif
|
|
};
|
|
|
|
static struct __pyx_obj_5capnp___pyx_scope_struct_2___getattr__ *__pyx_freelist_5capnp___pyx_scope_struct_2___getattr__[8];
|
|
static int __pyx_freecount_5capnp___pyx_scope_struct_2___getattr__ = 0;
|
|
|
|
static PyObject *__pyx_tp_new_5capnp___pyx_scope_struct_2___getattr__(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
|
|
struct __pyx_obj_5capnp___pyx_scope_struct_2___getattr__ *p;
|
|
PyObject *o;
|
|
if (likely((__pyx_freecount_5capnp___pyx_scope_struct_2___getattr__ > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_5capnp___pyx_scope_struct_2___getattr__)))) {
|
|
o = (PyObject*)__pyx_freelist_5capnp___pyx_scope_struct_2___getattr__[--__pyx_freecount_5capnp___pyx_scope_struct_2___getattr__];
|
|
memset(o, 0, sizeof(struct __pyx_obj_5capnp___pyx_scope_struct_2___getattr__));
|
|
PyObject_INIT(o, t);
|
|
PyObject_GC_Track(o);
|
|
} else {
|
|
o = (*t->tp_alloc)(t, 0);
|
|
if (unlikely(!o)) return 0;
|
|
}
|
|
p = ((struct __pyx_obj_5capnp___pyx_scope_struct_2___getattr__ *)o);
|
|
p->__pyx_v_field_name = 0;
|
|
p->__pyx_v_self = 0;
|
|
return o;
|
|
}
|
|
|
|
static void __pyx_tp_dealloc_5capnp___pyx_scope_struct_2___getattr__(PyObject *o) {
|
|
struct __pyx_obj_5capnp___pyx_scope_struct_2___getattr__ *p = (struct __pyx_obj_5capnp___pyx_scope_struct_2___getattr__ *)o;
|
|
PyObject_GC_UnTrack(o);
|
|
Py_CLEAR(p->__pyx_v_field_name);
|
|
Py_CLEAR(p->__pyx_v_self);
|
|
if ((__pyx_freecount_5capnp___pyx_scope_struct_2___getattr__ < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_5capnp___pyx_scope_struct_2___getattr__))) {
|
|
__pyx_freelist_5capnp___pyx_scope_struct_2___getattr__[__pyx_freecount_5capnp___pyx_scope_struct_2___getattr__++] = ((struct __pyx_obj_5capnp___pyx_scope_struct_2___getattr__ *)o);
|
|
} else {
|
|
(*Py_TYPE(o)->tp_free)(o);
|
|
}
|
|
}
|
|
|
|
static int __pyx_tp_traverse_5capnp___pyx_scope_struct_2___getattr__(PyObject *o, visitproc v, void *a) {
|
|
int e;
|
|
struct __pyx_obj_5capnp___pyx_scope_struct_2___getattr__ *p = (struct __pyx_obj_5capnp___pyx_scope_struct_2___getattr__ *)o;
|
|
if (p->__pyx_v_field_name) {
|
|
e = (*v)(p->__pyx_v_field_name, a); if (e) return e;
|
|
}
|
|
if (p->__pyx_v_self) {
|
|
e = (*v)(((PyObject*)p->__pyx_v_self), a); if (e) return e;
|
|
}
|
|
return 0;
|
|
}
|
|
|
|
static int __pyx_tp_clear_5capnp___pyx_scope_struct_2___getattr__(PyObject *o) {
|
|
struct __pyx_obj_5capnp___pyx_scope_struct_2___getattr__ *p = (struct __pyx_obj_5capnp___pyx_scope_struct_2___getattr__ *)o;
|
|
PyObject* tmp;
|
|
tmp = ((PyObject*)p->__pyx_v_field_name);
|
|
p->__pyx_v_field_name = Py_None; Py_INCREF(Py_None);
|
|
Py_XDECREF(tmp);
|
|
tmp = ((PyObject*)p->__pyx_v_self);
|
|
p->__pyx_v_self = ((struct __pyx_obj_5capnp__DynamicStructBuilder *)Py_None); Py_INCREF(Py_None);
|
|
Py_XDECREF(tmp);
|
|
return 0;
|
|
}
|
|
|
|
static PyMethodDef __pyx_methods_5capnp___pyx_scope_struct_2___getattr__[] = {
|
|
{0, 0, 0, 0}
|
|
};
|
|
|
|
static PyTypeObject __pyx_type_5capnp___pyx_scope_struct_2___getattr__ = {
|
|
PyVarObject_HEAD_INIT(0, 0)
|
|
__Pyx_NAMESTR("capnp.__pyx_scope_struct_2___getattr__"), /*tp_name*/
|
|
sizeof(struct __pyx_obj_5capnp___pyx_scope_struct_2___getattr__), /*tp_basicsize*/
|
|
0, /*tp_itemsize*/
|
|
__pyx_tp_dealloc_5capnp___pyx_scope_struct_2___getattr__, /*tp_dealloc*/
|
|
0, /*tp_print*/
|
|
0, /*tp_getattr*/
|
|
0, /*tp_setattr*/
|
|
#if PY_MAJOR_VERSION < 3
|
|
0, /*tp_compare*/
|
|
#else
|
|
0, /*reserved*/
|
|
#endif
|
|
0, /*tp_repr*/
|
|
0, /*tp_as_number*/
|
|
0, /*tp_as_sequence*/
|
|
0, /*tp_as_mapping*/
|
|
0, /*tp_hash*/
|
|
0, /*tp_call*/
|
|
0, /*tp_str*/
|
|
0, /*tp_getattro*/
|
|
0, /*tp_setattro*/
|
|
0, /*tp_as_buffer*/
|
|
Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
|
|
0, /*tp_doc*/
|
|
__pyx_tp_traverse_5capnp___pyx_scope_struct_2___getattr__, /*tp_traverse*/
|
|
__pyx_tp_clear_5capnp___pyx_scope_struct_2___getattr__, /*tp_clear*/
|
|
0, /*tp_richcompare*/
|
|
0, /*tp_weaklistoffset*/
|
|
0, /*tp_iter*/
|
|
0, /*tp_iternext*/
|
|
__pyx_methods_5capnp___pyx_scope_struct_2___getattr__, /*tp_methods*/
|
|
0, /*tp_members*/
|
|
0, /*tp_getset*/
|
|
0, /*tp_base*/
|
|
0, /*tp_dict*/
|
|
0, /*tp_descr_get*/
|
|
0, /*tp_descr_set*/
|
|
0, /*tp_dictoffset*/
|
|
0, /*tp_init*/
|
|
0, /*tp_alloc*/
|
|
__pyx_tp_new_5capnp___pyx_scope_struct_2___getattr__, /*tp_new*/
|
|
0, /*tp_free*/
|
|
0, /*tp_is_gc*/
|
|
0, /*tp_bases*/
|
|
0, /*tp_mro*/
|
|
0, /*tp_cache*/
|
|
0, /*tp_subclasses*/
|
|
0, /*tp_weaklist*/
|
|
0, /*tp_del*/
|
|
#if PY_VERSION_HEX >= 0x02060000
|
|
0, /*tp_version_tag*/
|
|
#endif
|
|
};
|
|
static struct __pyx_vtabstruct_5capnp_SchemaLoader __pyx_vtable_5capnp_SchemaLoader;
|
|
|
|
static PyObject *__pyx_tp_new_5capnp_SchemaLoader(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
|
|
struct __pyx_obj_5capnp_SchemaLoader *p;
|
|
PyObject *o;
|
|
o = (*t->tp_alloc)(t, 0);
|
|
if (unlikely(!o)) return 0;
|
|
p = ((struct __pyx_obj_5capnp_SchemaLoader *)o);
|
|
p->__pyx_vtab = __pyx_vtabptr_5capnp_SchemaLoader;
|
|
if (unlikely(__pyx_pw_5capnp_12SchemaLoader_1__cinit__(o, __pyx_empty_tuple, NULL) < 0)) {
|
|
Py_DECREF(o); o = 0;
|
|
}
|
|
return o;
|
|
}
|
|
|
|
static void __pyx_tp_dealloc_5capnp_SchemaLoader(PyObject *o) {
|
|
{
|
|
PyObject *etype, *eval, *etb;
|
|
PyErr_Fetch(&etype, &eval, &etb);
|
|
++Py_REFCNT(o);
|
|
__pyx_pw_5capnp_12SchemaLoader_3__dealloc__(o);
|
|
if (PyErr_Occurred()) PyErr_WriteUnraisable(o);
|
|
--Py_REFCNT(o);
|
|
PyErr_Restore(etype, eval, etb);
|
|
}
|
|
(*Py_TYPE(o)->tp_free)(o);
|
|
}
|
|
|
|
static PyMethodDef __pyx_methods_5capnp_SchemaLoader[] = {
|
|
{__Pyx_NAMESTR("load"), (PyCFunction)__pyx_pw_5capnp_12SchemaLoader_5load, METH_O, __Pyx_DOCSTR(0)},
|
|
{__Pyx_NAMESTR("get"), (PyCFunction)__pyx_pw_5capnp_12SchemaLoader_7get, METH_O, __Pyx_DOCSTR(0)},
|
|
{0, 0, 0, 0}
|
|
};
|
|
|
|
static PyTypeObject __pyx_type_5capnp_SchemaLoader = {
|
|
PyVarObject_HEAD_INIT(0, 0)
|
|
__Pyx_NAMESTR("capnp.SchemaLoader"), /*tp_name*/
|
|
sizeof(struct __pyx_obj_5capnp_SchemaLoader), /*tp_basicsize*/
|
|
0, /*tp_itemsize*/
|
|
__pyx_tp_dealloc_5capnp_SchemaLoader, /*tp_dealloc*/
|
|
0, /*tp_print*/
|
|
0, /*tp_getattr*/
|
|
0, /*tp_setattr*/
|
|
#if PY_MAJOR_VERSION < 3
|
|
0, /*tp_compare*/
|
|
#else
|
|
0, /*reserved*/
|
|
#endif
|
|
0, /*tp_repr*/
|
|
0, /*tp_as_number*/
|
|
0, /*tp_as_sequence*/
|
|
0, /*tp_as_mapping*/
|
|
0, /*tp_hash*/
|
|
0, /*tp_call*/
|
|
0, /*tp_str*/
|
|
0, /*tp_getattro*/
|
|
0, /*tp_setattro*/
|
|
0, /*tp_as_buffer*/
|
|
Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE, /*tp_flags*/
|
|
0, /*tp_doc*/
|
|
0, /*tp_traverse*/
|
|
0, /*tp_clear*/
|
|
0, /*tp_richcompare*/
|
|
0, /*tp_weaklistoffset*/
|
|
0, /*tp_iter*/
|
|
0, /*tp_iternext*/
|
|
__pyx_methods_5capnp_SchemaLoader, /*tp_methods*/
|
|
0, /*tp_members*/
|
|
0, /*tp_getset*/
|
|
0, /*tp_base*/
|
|
0, /*tp_dict*/
|
|
0, /*tp_descr_get*/
|
|
0, /*tp_descr_set*/
|
|
0, /*tp_dictoffset*/
|
|
0, /*tp_init*/
|
|
0, /*tp_alloc*/
|
|
__pyx_tp_new_5capnp_SchemaLoader, /*tp_new*/
|
|
0, /*tp_free*/
|
|
0, /*tp_is_gc*/
|
|
0, /*tp_bases*/
|
|
0, /*tp_mro*/
|
|
0, /*tp_cache*/
|
|
0, /*tp_subclasses*/
|
|
0, /*tp_weaklist*/
|
|
0, /*tp_del*/
|
|
#if PY_VERSION_HEX >= 0x02060000
|
|
0, /*tp_version_tag*/
|
|
#endif
|
|
};
|
|
|
|
static PyMethodDef __pyx_methods[] = {
|
|
{0, 0, 0, 0}
|
|
};
|
|
|
|
#if PY_MAJOR_VERSION >= 3
|
|
static struct PyModuleDef __pyx_moduledef = {
|
|
#if PY_VERSION_HEX < 0x03020000
|
|
{ PyObject_HEAD_INIT(NULL) NULL, 0, NULL },
|
|
#else
|
|
PyModuleDef_HEAD_INIT,
|
|
#endif
|
|
__Pyx_NAMESTR("capnp"),
|
|
0, /* m_doc */
|
|
-1, /* m_size */
|
|
__pyx_methods /* m_methods */,
|
|
NULL, /* m_reload */
|
|
NULL, /* m_traverse */
|
|
NULL, /* m_clear */
|
|
NULL /* m_free */
|
|
};
|
|
#endif
|
|
|
|
static __Pyx_StringTabEntry __pyx_string_tab[] = {
|
|
{&__pyx_kp_s_1, __pyx_k_1, sizeof(__pyx_k_1), 0, 0, 1, 0},
|
|
{&__pyx_kp_s_10, __pyx_k_10, sizeof(__pyx_k_10), 0, 0, 1, 0},
|
|
{&__pyx_kp_s_12, __pyx_k_12, sizeof(__pyx_k_12), 0, 0, 1, 0},
|
|
{&__pyx_kp_s_17, __pyx_k_17, sizeof(__pyx_k_17), 0, 0, 1, 0},
|
|
{&__pyx_kp_s_19, __pyx_k_19, sizeof(__pyx_k_19), 0, 0, 1, 0},
|
|
{&__pyx_n_s_27, __pyx_k_27, sizeof(__pyx_k_27), 0, 0, 1, 1},
|
|
{&__pyx_kp_s_28, __pyx_k_28, sizeof(__pyx_k_28), 0, 0, 1, 0},
|
|
{&__pyx_n_s_31, __pyx_k_31, sizeof(__pyx_k_31), 0, 0, 1, 1},
|
|
{&__pyx_n_s_32, __pyx_k_32, sizeof(__pyx_k_32), 0, 0, 1, 1},
|
|
{&__pyx_kp_s_35, __pyx_k_35, sizeof(__pyx_k_35), 0, 0, 1, 0},
|
|
{&__pyx_kp_s_37, __pyx_k_37, sizeof(__pyx_k_37), 0, 0, 1, 0},
|
|
{&__pyx_kp_s_39, __pyx_k_39, sizeof(__pyx_k_39), 0, 0, 1, 0},
|
|
{&__pyx_kp_s_4, __pyx_k_4, sizeof(__pyx_k_4), 0, 0, 1, 0},
|
|
{&__pyx_kp_s_40, __pyx_k_40, sizeof(__pyx_k_40), 0, 0, 1, 0},
|
|
{&__pyx_kp_s_41, __pyx_k_41, sizeof(__pyx_k_41), 0, 0, 1, 0},
|
|
{&__pyx_kp_s_42, __pyx_k_42, sizeof(__pyx_k_42), 0, 0, 1, 0},
|
|
{&__pyx_kp_s_43, __pyx_k_43, sizeof(__pyx_k_43), 0, 0, 1, 0},
|
|
{&__pyx_n_s_45, __pyx_k_45, sizeof(__pyx_k_45), 0, 0, 1, 1},
|
|
{&__pyx_kp_s_48, __pyx_k_48, sizeof(__pyx_k_48), 0, 0, 1, 0},
|
|
{&__pyx_kp_s_49, __pyx_k_49, sizeof(__pyx_k_49), 0, 0, 1, 0},
|
|
{&__pyx_kp_s_5, __pyx_k_5, sizeof(__pyx_k_5), 0, 0, 1, 0},
|
|
{&__pyx_n_s_53, __pyx_k_53, sizeof(__pyx_k_53), 0, 0, 1, 1},
|
|
{&__pyx_n_s_58, __pyx_k_58, sizeof(__pyx_k_58), 0, 0, 1, 1},
|
|
{&__pyx_kp_s_6, __pyx_k_6, sizeof(__pyx_k_6), 0, 0, 1, 0},
|
|
{&__pyx_kp_s_8, __pyx_k_8, sizeof(__pyx_k_8), 0, 0, 1, 0},
|
|
{&__pyx_n_s__BOOL, __pyx_k__BOOL, sizeof(__pyx_k__BOOL), 0, 0, 1, 1},
|
|
{&__pyx_n_s__Body, __pyx_k__Body, sizeof(__pyx_k__Body), 0, 0, 1, 1},
|
|
{&__pyx_n_s__DATA, __pyx_k__DATA, sizeof(__pyx_k__DATA), 0, 0, 1, 1},
|
|
{&__pyx_n_s__ENUM, __pyx_k__ENUM, sizeof(__pyx_k__ENUM), 0, 0, 1, 1},
|
|
{&__pyx_n_s__FLOAT, __pyx_k__FLOAT, sizeof(__pyx_k__FLOAT), 0, 0, 1, 1},
|
|
{&__pyx_n_s__INT, __pyx_k__INT, sizeof(__pyx_k__INT), 0, 0, 1, 1},
|
|
{&__pyx_n_s__INTERFACE, __pyx_k__INTERFACE, sizeof(__pyx_k__INTERFACE), 0, 0, 1, 1},
|
|
{&__pyx_n_s__IndexError, __pyx_k__IndexError, sizeof(__pyx_k__IndexError), 0, 0, 1, 1},
|
|
{&__pyx_n_s__LIST, __pyx_k__LIST, sizeof(__pyx_k__LIST), 0, 0, 1, 1},
|
|
{&__pyx_n_s__Member, __pyx_k__Member, sizeof(__pyx_k__Member), 0, 0, 1, 1},
|
|
{&__pyx_n_s__ModuleType, __pyx_k__ModuleType, sizeof(__pyx_k__ModuleType), 0, 0, 1, 1},
|
|
{&__pyx_n_s__Node, __pyx_k__Node, sizeof(__pyx_k__Node), 0, 0, 1, 1},
|
|
{&__pyx_n_s__OBJECT, __pyx_k__OBJECT, sizeof(__pyx_k__OBJECT), 0, 0, 1, 1},
|
|
{&__pyx_n_s__PIPE, __pyx_k__PIPE, sizeof(__pyx_k__PIPE), 0, 0, 1, 1},
|
|
{&__pyx_n_s__Popen, __pyx_k__Popen, sizeof(__pyx_k__Popen), 0, 0, 1, 1},
|
|
{&__pyx_n_s__RuntimeError, __pyx_k__RuntimeError, sizeof(__pyx_k__RuntimeError), 0, 0, 1, 1},
|
|
{&__pyx_n_s__STRUCT, __pyx_k__STRUCT, sizeof(__pyx_k__STRUCT), 0, 0, 1, 1},
|
|
{&__pyx_n_s__Schema, __pyx_k__Schema, sizeof(__pyx_k__Schema), 0, 0, 1, 1},
|
|
{&__pyx_n_s__StructNode, __pyx_k__StructNode, sizeof(__pyx_k__StructNode), 0, 0, 1, 1},
|
|
{&__pyx_n_s__TEXT, __pyx_k__TEXT, sizeof(__pyx_k__TEXT), 0, 0, 1, 1},
|
|
{&__pyx_n_s__TYPE_UNKOWN, __pyx_k__TYPE_UNKOWN, sizeof(__pyx_k__TYPE_UNKOWN), 0, 0, 1, 1},
|
|
{&__pyx_n_s__TypeError, __pyx_k__TypeError, sizeof(__pyx_k__TypeError), 0, 0, 1, 1},
|
|
{&__pyx_n_s__UINT, __pyx_k__UINT, sizeof(__pyx_k__UINT), 0, 0, 1, 1},
|
|
{&__pyx_n_s__UNION, __pyx_k__UNION, sizeof(__pyx_k__UNION), 0, 0, 1, 1},
|
|
{&__pyx_n_s__UNKNOWN, __pyx_k__UNKNOWN, sizeof(__pyx_k__UNKNOWN), 0, 0, 1, 1},
|
|
{&__pyx_n_s__VOID, __pyx_k__VOID, sizeof(__pyx_k__VOID), 0, 0, 1, 1},
|
|
{&__pyx_n_s__ValueError, __pyx_k__ValueError, sizeof(__pyx_k__ValueError), 0, 0, 1, 1},
|
|
{&__pyx_n_s__Which, __pyx_k__Which, sizeof(__pyx_k__Which), 0, 0, 1, 1},
|
|
{&__pyx_n_s___, __pyx_k___, sizeof(__pyx_k___), 0, 0, 1, 1},
|
|
{&__pyx_n_s___Type, __pyx_k___Type, sizeof(__pyx_k___Type), 0, 0, 1, 1},
|
|
{&__pyx_n_s____dict__, __pyx_k____dict__, sizeof(__pyx_k____dict__), 0, 0, 1, 1},
|
|
{&__pyx_n_s____import__, __pyx_k____import__, sizeof(__pyx_k____import__), 0, 0, 1, 1},
|
|
{&__pyx_n_s____main__, __pyx_k____main__, sizeof(__pyx_k____main__), 0, 0, 1, 1},
|
|
{&__pyx_n_s____name__, __pyx_k____name__, sizeof(__pyx_k____name__), 0, 0, 1, 1},
|
|
{&__pyx_n_s____pyx_vtable__, __pyx_k____pyx_vtable__, sizeof(__pyx_k____pyx_vtable__), 0, 0, 1, 1},
|
|
{&__pyx_n_s____test__, __pyx_k____test__, sizeof(__pyx_k____test__), 0, 0, 1, 1},
|
|
{&__pyx_n_s___get, __pyx_k___get, sizeof(__pyx_k___get), 0, 0, 1, 1},
|
|
{&__pyx_n_s___has, __pyx_k___has, sizeof(__pyx_k___has), 0, 0, 1, 1},
|
|
{&__pyx_n_s___load, __pyx_k___load, sizeof(__pyx_k___load), 0, 0, 1, 1},
|
|
{&__pyx_n_s___loader, __pyx_k___loader, sizeof(__pyx_k___loader), 0, 0, 1, 1},
|
|
{&__pyx_n_s___make_enum, __pyx_k___make_enum, sizeof(__pyx_k___make_enum), 0, 0, 1, 1},
|
|
{&__pyx_n_s___parent_module, __pyx_k___parent_module, sizeof(__pyx_k___parent_module), 0, 0, 1, 1},
|
|
{&__pyx_n_s___root_module, __pyx_k___root_module, sizeof(__pyx_k___root_module), 0, 0, 1, 1},
|
|
{&__pyx_n_s___setitem, __pyx_k___setitem, sizeof(__pyx_k___setitem), 0, 0, 1, 1},
|
|
{&__pyx_n_s__args, __pyx_k__args, sizeof(__pyx_k__args), 0, 0, 1, 1},
|
|
{&__pyx_n_s__asStruct, __pyx_k__asStruct, sizeof(__pyx_k__asStruct), 0, 0, 1, 1},
|
|
{&__pyx_n_s__bint, __pyx_k__bint, sizeof(__pyx_k__bint), 0, 0, 1, 1},
|
|
{&__pyx_n_s__body, __pyx_k__body, sizeof(__pyx_k__body), 0, 0, 1, 1},
|
|
{&__pyx_n_s__capitalize, __pyx_k__capitalize, sizeof(__pyx_k__capitalize), 0, 0, 1, 1},
|
|
{&__pyx_n_s__capnp, __pyx_k__capnp, sizeof(__pyx_k__capnp), 0, 0, 1, 1},
|
|
{&__pyx_n_s__capnpc, __pyx_k__capnpc, sizeof(__pyx_k__capnpc), 0, 0, 1, 1},
|
|
{&__pyx_n_s__cat_path, __pyx_k__cat_path, sizeof(__pyx_k__cat_path), 0, 0, 1, 1},
|
|
{&__pyx_n_s__close, __pyx_k__close, sizeof(__pyx_k__close), 0, 0, 1, 1},
|
|
{&__pyx_n_s__defaults, __pyx_k__defaults, sizeof(__pyx_k__defaults), 0, 0, 1, 1},
|
|
{&__pyx_n_s__displayName, __pyx_k__displayName, sizeof(__pyx_k__displayName), 0, 0, 1, 1},
|
|
{&__pyx_n_s__double, __pyx_k__double, sizeof(__pyx_k__double), 0, 0, 1, 1},
|
|
{&__pyx_n_s__enum, __pyx_k__enum, sizeof(__pyx_k__enum), 0, 0, 1, 1},
|
|
{&__pyx_n_s__enumNode, __pyx_k__enumNode, sizeof(__pyx_k__enumNode), 0, 0, 1, 1},
|
|
{&__pyx_n_s__enum_name, __pyx_k__enum_name, sizeof(__pyx_k__enum_name), 0, 0, 1, 1},
|
|
{&__pyx_n_s__enumerants, __pyx_k__enumerants, sizeof(__pyx_k__enumerants), 0, 0, 1, 1},
|
|
{&__pyx_n_s__enums, __pyx_k__enums, sizeof(__pyx_k__enums), 0, 0, 1, 1},
|
|
{&__pyx_n_s__fd, __pyx_k__fd, sizeof(__pyx_k__fd), 0, 0, 1, 1},
|
|
{&__pyx_n_s__field, __pyx_k__field, sizeof(__pyx_k__field), 0, 0, 1, 1},
|
|
{&__pyx_n_s__file_name, __pyx_k__file_name, sizeof(__pyx_k__file_name), 0, 0, 1, 1},
|
|
{&__pyx_n_s__fileno, __pyx_k__fileno, sizeof(__pyx_k__fileno), 0, 0, 1, 1},
|
|
{&__pyx_n_s__float, __pyx_k__float, sizeof(__pyx_k__float), 0, 0, 1, 1},
|
|
{&__pyx_n_s__genexpr, __pyx_k__genexpr, sizeof(__pyx_k__genexpr), 0, 0, 1, 1},
|
|
{&__pyx_n_s__get, __pyx_k__get, sizeof(__pyx_k__get), 0, 0, 1, 1},
|
|
{&__pyx_n_s__getDependency, __pyx_k__getDependency, sizeof(__pyx_k__getDependency), 0, 0, 1, 1},
|
|
{&__pyx_n_s__getProto, __pyx_k__getProto, sizeof(__pyx_k__getProto), 0, 0, 1, 1},
|
|
{&__pyx_n_s__getRoot, __pyx_k__getRoot, sizeof(__pyx_k__getRoot), 0, 0, 1, 1},
|
|
{&__pyx_n_s__getRootNode, __pyx_k__getRootNode, sizeof(__pyx_k__getRootNode), 0, 0, 1, 1},
|
|
{&__pyx_n_s__getType, __pyx_k__getType, sizeof(__pyx_k__getType), 0, 0, 1, 1},
|
|
{&__pyx_n_s__id, __pyx_k__id, sizeof(__pyx_k__id), 0, 0, 1, 1},
|
|
{&__pyx_n_s__index, __pyx_k__index, sizeof(__pyx_k__index), 0, 0, 1, 1},
|
|
{&__pyx_n_s__init, __pyx_k__init, sizeof(__pyx_k__init), 0, 0, 1, 1},
|
|
{&__pyx_n_s__initRoot, __pyx_k__initRoot, sizeof(__pyx_k__initRoot), 0, 0, 1, 1},
|
|
{&__pyx_n_s__int, __pyx_k__int, sizeof(__pyx_k__int), 0, 0, 1, 1},
|
|
{&__pyx_n_s__isUnion, __pyx_k__isUnion, sizeof(__pyx_k__isUnion), 0, 0, 1, 1},
|
|
{&__pyx_n_s__isupper, __pyx_k__isupper, sizeof(__pyx_k__isupper), 0, 0, 1, 1},
|
|
{&__pyx_n_s__iteritems, __pyx_k__iteritems, sizeof(__pyx_k__iteritems), 0, 0, 1, 1},
|
|
{&__pyx_n_s__join, __pyx_k__join, sizeof(__pyx_k__join), 0, 0, 1, 1},
|
|
{&__pyx_n_s__kwargs, __pyx_k__kwargs, sizeof(__pyx_k__kwargs), 0, 0, 1, 1},
|
|
{&__pyx_n_s__letter, __pyx_k__letter, sizeof(__pyx_k__letter), 0, 0, 1, 1},
|
|
{&__pyx_n_s__load, __pyx_k__load, sizeof(__pyx_k__load), 0, 0, 1, 1},
|
|
{&__pyx_n_s__loader, __pyx_k__loader, sizeof(__pyx_k__loader), 0, 0, 1, 1},
|
|
{&__pyx_n_s__local_module, __pyx_k__local_module, sizeof(__pyx_k__local_module), 0, 0, 1, 1},
|
|
{&__pyx_n_s__long, __pyx_k__long, sizeof(__pyx_k__long), 0, 0, 1, 1},
|
|
{&__pyx_n_s__lower, __pyx_k__lower, sizeof(__pyx_k__lower), 0, 0, 1, 1},
|
|
{&__pyx_n_s__m, __pyx_k__m, sizeof(__pyx_k__m), 0, 0, 1, 1},
|
|
{&__pyx_n_s__member, __pyx_k__member, sizeof(__pyx_k__member), 0, 0, 1, 1},
|
|
{&__pyx_n_s__members, __pyx_k__members, sizeof(__pyx_k__members), 0, 0, 1, 1},
|
|
{&__pyx_n_s__module, __pyx_k__module, sizeof(__pyx_k__module), 0, 0, 1, 1},
|
|
{&__pyx_n_s__name, __pyx_k__name, sizeof(__pyx_k__name), 0, 0, 1, 1},
|
|
{&__pyx_n_s__named, __pyx_k__named, sizeof(__pyx_k__named), 0, 0, 1, 1},
|
|
{&__pyx_n_s__nestedNode, __pyx_k__nestedNode, sizeof(__pyx_k__nestedNode), 0, 0, 1, 1},
|
|
{&__pyx_n_s__nestedNodes, __pyx_k__nestedNodes, sizeof(__pyx_k__nestedNodes), 0, 0, 1, 1},
|
|
{&__pyx_n_s__new_m, __pyx_k__new_m, sizeof(__pyx_k__new_m), 0, 0, 1, 1},
|
|
{&__pyx_n_s__node, __pyx_k__node, sizeof(__pyx_k__node), 0, 0, 1, 1},
|
|
{&__pyx_n_s__nodes, __pyx_k__nodes, sizeof(__pyx_k__nodes), 0, 0, 1, 1},
|
|
{&__pyx_n_s__p, __pyx_k__p, sizeof(__pyx_k__p), 0, 0, 1, 1},
|
|
{&__pyx_n_s__range, __pyx_k__range, sizeof(__pyx_k__range), 0, 0, 1, 1},
|
|
{&__pyx_n_s__re, __pyx_k__re, sizeof(__pyx_k__re), 0, 0, 1, 1},
|
|
{&__pyx_n_s__reader, __pyx_k__reader, sizeof(__pyx_k__reader), 0, 0, 1, 1},
|
|
{&__pyx_n_s__replace, __pyx_k__replace, sizeof(__pyx_k__replace), 0, 0, 1, 1},
|
|
{&__pyx_n_s__request, __pyx_k__request, sizeof(__pyx_k__request), 0, 0, 1, 1},
|
|
{&__pyx_n_s__ret, __pyx_k__ret, sizeof(__pyx_k__ret), 0, 0, 1, 1},
|
|
{&__pyx_n_s__retcode, __pyx_k__retcode, sizeof(__pyx_k__retcode), 0, 0, 1, 1},
|
|
{&__pyx_n_s__reverse, __pyx_k__reverse, sizeof(__pyx_k__reverse), 0, 0, 1, 1},
|
|
{&__pyx_n_s__reverse_mapping, __pyx_k__reverse_mapping, sizeof(__pyx_k__reverse_mapping), 0, 0, 1, 1},
|
|
{&__pyx_n_s__s, __pyx_k__s, sizeof(__pyx_k__s), 0, 0, 1, 1},
|
|
{&__pyx_n_s__schema, __pyx_k__schema, sizeof(__pyx_k__schema), 0, 0, 1, 1},
|
|
{&__pyx_n_s__self, __pyx_k__self, sizeof(__pyx_k__self), 0, 0, 1, 1},
|
|
{&__pyx_n_s__send, __pyx_k__send, sizeof(__pyx_k__send), 0, 0, 1, 1},
|
|
{&__pyx_n_s__sequential, __pyx_k__sequential, sizeof(__pyx_k__sequential), 0, 0, 1, 1},
|
|
{&__pyx_n_s__size, __pyx_k__size, sizeof(__pyx_k__size), 0, 0, 1, 1},
|
|
{&__pyx_n_s__split, __pyx_k__split, sizeof(__pyx_k__split), 0, 0, 1, 1},
|
|
{&__pyx_n_s__startswith, __pyx_k__startswith, sizeof(__pyx_k__startswith), 0, 0, 1, 1},
|
|
{&__pyx_n_s__stdout, __pyx_k__stdout, sizeof(__pyx_k__stdout), 0, 0, 1, 1},
|
|
{&__pyx_n_s__strip, __pyx_k__strip, sizeof(__pyx_k__strip), 0, 0, 1, 1},
|
|
{&__pyx_n_s__struct, __pyx_k__struct, sizeof(__pyx_k__struct), 0, 0, 1, 1},
|
|
{&__pyx_n_s__structNode, __pyx_k__structNode, sizeof(__pyx_k__structNode), 0, 0, 1, 1},
|
|
{&__pyx_n_s__sub_name, __pyx_k__sub_name, sizeof(__pyx_k__sub_name), 0, 0, 1, 1},
|
|
{&__pyx_n_s__subprocess, __pyx_k__subprocess, sizeof(__pyx_k__subprocess), 0, 0, 1, 1},
|
|
{&__pyx_n_s__temp, __pyx_k__temp, sizeof(__pyx_k__temp), 0, 0, 1, 1},
|
|
{&__pyx_n_s__throw, __pyx_k__throw, sizeof(__pyx_k__throw), 0, 0, 1, 1},
|
|
{&__pyx_n_s__toPython, __pyx_k__toPython, sizeof(__pyx_k__toPython), 0, 0, 1, 1},
|
|
{&__pyx_n_s__types, __pyx_k__types, sizeof(__pyx_k__types), 0, 0, 1, 1},
|
|
{&__pyx_n_s__unionMember, __pyx_k__unionMember, sizeof(__pyx_k__unionMember), 0, 0, 1, 1},
|
|
{&__pyx_n_s__upper, __pyx_k__upper, sizeof(__pyx_k__upper), 0, 0, 1, 1},
|
|
{&__pyx_n_s__upper_and_under, __pyx_k__upper_and_under, sizeof(__pyx_k__upper_and_under), 0, 0, 1, 1},
|
|
{&__pyx_n_s__value, __pyx_k__value, sizeof(__pyx_k__value), 0, 0, 1, 1},
|
|
{&__pyx_n_s__wait, __pyx_k__wait, sizeof(__pyx_k__wait), 0, 0, 1, 1},
|
|
{&__pyx_n_s__which, __pyx_k__which, sizeof(__pyx_k__which), 0, 0, 1, 1},
|
|
{&__pyx_n_s__writeMessageToFd, __pyx_k__writeMessageToFd, sizeof(__pyx_k__writeMessageToFd), 0, 0, 1, 1},
|
|
{&__pyx_n_s__zip, __pyx_k__zip, sizeof(__pyx_k__zip), 0, 0, 1, 1},
|
|
{0, 0, 0, 0, 0, 0, 0}
|
|
};
|
|
static int __Pyx_InitCachedBuiltins(void) {
|
|
__pyx_builtin_ValueError = __Pyx_GetBuiltinName(__pyx_n_s__ValueError); if (!__pyx_builtin_ValueError) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 64; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
|
|
__pyx_builtin_zip = __Pyx_GetBuiltinName(__pyx_n_s__zip); if (!__pyx_builtin_zip) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 40; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
|
|
__pyx_builtin_range = __Pyx_GetBuiltinName(__pyx_n_s__range); if (!__pyx_builtin_range) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 40; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
|
|
__pyx_builtin_IndexError = __Pyx_GetBuiltinName(__pyx_n_s__IndexError); if (!__pyx_builtin_IndexError) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 79; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
|
|
__pyx_builtin_TypeError = __Pyx_GetBuiltinName(__pyx_n_s__TypeError); if (!__pyx_builtin_TypeError) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 107; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
|
|
__pyx_builtin_RuntimeError = __Pyx_GetBuiltinName(__pyx_n_s__RuntimeError); if (!__pyx_builtin_RuntimeError) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 559; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
|
|
return 0;
|
|
__pyx_L1_error:;
|
|
return -1;
|
|
}
|
|
|
|
static int __Pyx_InitCachedConstants(void) {
|
|
__Pyx_RefNannyDeclarations
|
|
__Pyx_RefNannySetupContext("__Pyx_InitCachedConstants", 0);
|
|
|
|
/* "capnp.pyx":79
|
|
* size = self.thisptr.size()
|
|
* if index >= size:
|
|
* raise IndexError('Out of bounds') # <<<<<<<<<<<<<<
|
|
* index = index % size
|
|
* return _DynamicValueReader()._init(self.thisptr[index])
|
|
*/
|
|
__pyx_k_tuple_2 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_1)); if (unlikely(!__pyx_k_tuple_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 79; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
|
|
__Pyx_GOTREF(__pyx_k_tuple_2);
|
|
__Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_2));
|
|
|
|
/* "capnp.pyx":102
|
|
* size = self.thisptr.size()
|
|
* if index >= size:
|
|
* raise IndexError('Out of bounds') # <<<<<<<<<<<<<<
|
|
* index = index % size
|
|
* temp = self.thisptr[index]
|
|
*/
|
|
__pyx_k_tuple_3 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_1)); if (unlikely(!__pyx_k_tuple_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 102; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
|
|
__Pyx_GOTREF(__pyx_k_tuple_3);
|
|
__Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_3));
|
|
|
|
/* "capnp.pyx":107
|
|
* return toPython(temp)
|
|
*
|
|
* def _setitem(self, index, valid_values value): # <<<<<<<<<<<<<<
|
|
* cdef C_DynamicValue.Reader temp = C_DynamicValue.Reader(value)
|
|
* self.thisptr.set(index, temp)
|
|
*/
|
|
__pyx_k_tuple_7 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_6)); if (unlikely(!__pyx_k_tuple_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 107; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
|
|
__Pyx_GOTREF(__pyx_k_tuple_7);
|
|
__Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_7));
|
|
__pyx_k_tuple_9 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_8)); if (unlikely(!__pyx_k_tuple_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 107; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
|
|
__Pyx_GOTREF(__pyx_k_tuple_9);
|
|
__Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_9));
|
|
__pyx_k_tuple_11 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_10)); if (unlikely(!__pyx_k_tuple_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 107; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
|
|
__Pyx_GOTREF(__pyx_k_tuple_11);
|
|
__Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_11));
|
|
__pyx_k_tuple_13 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_12)); if (unlikely(!__pyx_k_tuple_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 107; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
|
|
__Pyx_GOTREF(__pyx_k_tuple_13);
|
|
__Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_13));
|
|
|
|
/* "capnp.pyx":114
|
|
* size = self.thisptr.size()
|
|
* if index >= size:
|
|
* raise IndexError('Out of bounds') # <<<<<<<<<<<<<<
|
|
* index = index % size
|
|
* self._setitem(index, value)
|
|
*/
|
|
__pyx_k_tuple_14 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_1)); if (unlikely(!__pyx_k_tuple_14)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 114; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
|
|
__Pyx_GOTREF(__pyx_k_tuple_14);
|
|
__Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_14));
|
|
|
|
/* "capnp.pyx":129
|
|
* size = self.thisptr.size()
|
|
* if index >= size:
|
|
* raise IndexError('Out of bounds') # <<<<<<<<<<<<<<
|
|
* index = index % size
|
|
* return self.thisptr[index]
|
|
*/
|
|
__pyx_k_tuple_15 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_1)); if (unlikely(!__pyx_k_tuple_15)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 129; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
|
|
__Pyx_GOTREF(__pyx_k_tuple_15);
|
|
__Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_15));
|
|
|
|
/* "capnp.pyx":144
|
|
* size = self.thisptr.size()
|
|
* if index >= size:
|
|
* raise IndexError('Out of bounds') # <<<<<<<<<<<<<<
|
|
* index = index % size
|
|
* return _NodeReader().init(<C_Node.Reader>self.thisptr[index])
|
|
*/
|
|
__pyx_k_tuple_16 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_1)); if (unlikely(!__pyx_k_tuple_16)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 144; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
|
|
__Pyx_GOTREF(__pyx_k_tuple_16);
|
|
__Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_16));
|
|
|
|
/* "capnp.pyx":186
|
|
* return None
|
|
* elif type == capnp.TYPE_UNKOWN:
|
|
* raise ValueError("Cannot convert type to Python. Type is unknown by capnproto library") # <<<<<<<<<<<<<<
|
|
* else:
|
|
* raise ValueError("Cannot convert type to Python. Type is unhandled by capnproto library")
|
|
*/
|
|
__pyx_k_tuple_18 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_17)); if (unlikely(!__pyx_k_tuple_18)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 186; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
|
|
__Pyx_GOTREF(__pyx_k_tuple_18);
|
|
__Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_18));
|
|
|
|
/* "capnp.pyx":188
|
|
* raise ValueError("Cannot convert type to Python. Type is unknown by capnproto library")
|
|
* else:
|
|
* raise ValueError("Cannot convert type to Python. Type is unhandled by capnproto library") # <<<<<<<<<<<<<<
|
|
*
|
|
*
|
|
*/
|
|
__pyx_k_tuple_20 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_19)); if (unlikely(!__pyx_k_tuple_20)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 188; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
|
|
__Pyx_GOTREF(__pyx_k_tuple_20);
|
|
__Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_20));
|
|
|
|
/* "capnp.pyx":220
|
|
* return None
|
|
* elif type == capnp.TYPE_UNKOWN:
|
|
* raise ValueError("Cannot convert type to Python. Type is unknown by capnproto library") # <<<<<<<<<<<<<<
|
|
* else:
|
|
* raise ValueError("Cannot convert type to Python. Type is unhandled by capnproto library")
|
|
*/
|
|
__pyx_k_tuple_21 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_17)); if (unlikely(!__pyx_k_tuple_21)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 220; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
|
|
__Pyx_GOTREF(__pyx_k_tuple_21);
|
|
__Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_21));
|
|
|
|
/* "capnp.pyx":222
|
|
* raise ValueError("Cannot convert type to Python. Type is unknown by capnproto library")
|
|
* else:
|
|
* raise ValueError("Cannot convert type to Python. Type is unhandled by capnproto library") # <<<<<<<<<<<<<<
|
|
*
|
|
*
|
|
*/
|
|
__pyx_k_tuple_22 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_19)); if (unlikely(!__pyx_k_tuple_22)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 222; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
|
|
__Pyx_GOTREF(__pyx_k_tuple_22);
|
|
__Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_22));
|
|
|
|
/* "capnp.pyx":251
|
|
* return None
|
|
* elif type == capnp.TYPE_UNKOWN:
|
|
* raise ValueError("Cannot convert type to Python. Type is unknown by capnproto library") # <<<<<<<<<<<<<<
|
|
* else:
|
|
* raise ValueError("Cannot convert type to Python. Type is unhandled by capnproto library")
|
|
*/
|
|
__pyx_k_tuple_23 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_17)); if (unlikely(!__pyx_k_tuple_23)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 251; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
|
|
__Pyx_GOTREF(__pyx_k_tuple_23);
|
|
__Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_23));
|
|
|
|
/* "capnp.pyx":253
|
|
* raise ValueError("Cannot convert type to Python. Type is unknown by capnproto library")
|
|
* else:
|
|
* raise ValueError("Cannot convert type to Python. Type is unhandled by capnproto library") # <<<<<<<<<<<<<<
|
|
*
|
|
* cdef class _DynamicStructReader:
|
|
*/
|
|
__pyx_k_tuple_24 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_19)); if (unlikely(!__pyx_k_tuple_24)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 253; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
|
|
__Pyx_GOTREF(__pyx_k_tuple_24);
|
|
__Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_24));
|
|
|
|
/* "capnp.pyx":277
|
|
*
|
|
* def __getattr__(self, field):
|
|
* if field.startswith('init'): # <<<<<<<<<<<<<<
|
|
* field_name = field[4].lower() + field[5:]
|
|
* try:
|
|
*/
|
|
__pyx_k_tuple_25 = PyTuple_Pack(1, ((PyObject *)__pyx_n_s__init)); if (unlikely(!__pyx_k_tuple_25)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 277; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
|
|
__Pyx_GOTREF(__pyx_k_tuple_25);
|
|
__Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_25));
|
|
|
|
/* "capnp.pyx":278
|
|
* def __getattr__(self, field):
|
|
* if field.startswith('init'):
|
|
* field_name = field[4].lower() + field[5:] # <<<<<<<<<<<<<<
|
|
* try:
|
|
* self._has(field_name) # We don't need to test bool value here, since it will throw an exception if the field is non-existant
|
|
*/
|
|
__pyx_k_slice_26 = PySlice_New(__pyx_int_5, Py_None, Py_None); if (unlikely(!__pyx_k_slice_26)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 278; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
|
|
__Pyx_GOTREF(__pyx_k_slice_26);
|
|
__Pyx_GIVEREF(__pyx_k_slice_26);
|
|
|
|
/* "capnp.pyx":318
|
|
* self._setattrVoid(field)
|
|
* else:
|
|
* raise ValueError("Non primitive type") # <<<<<<<<<<<<<<
|
|
*
|
|
* def _has(self, field):
|
|
*/
|
|
__pyx_k_tuple_29 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_28)); if (unlikely(!__pyx_k_tuple_29)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 318; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
|
|
__Pyx_GOTREF(__pyx_k_tuple_29);
|
|
__Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_29));
|
|
|
|
/* "capnp.pyx":386
|
|
* self._setattrVoid(field)
|
|
* else:
|
|
* raise ValueError("Non primitive type") # <<<<<<<<<<<<<<
|
|
*
|
|
* cpdef which(self):
|
|
*/
|
|
__pyx_k_tuple_30 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_28)); if (unlikely(!__pyx_k_tuple_30)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 386; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
|
|
__Pyx_GOTREF(__pyx_k_tuple_30);
|
|
__Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_30));
|
|
|
|
/* "capnp.pyx":502
|
|
* if len(s) < 2:
|
|
* return s
|
|
* return s[0].upper() + s[1:] # <<<<<<<<<<<<<<
|
|
* def upper_and_under(s):
|
|
* if len(s) < 2:
|
|
*/
|
|
__pyx_k_slice_33 = PySlice_New(__pyx_int_1, Py_None, Py_None); if (unlikely(!__pyx_k_slice_33)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 502; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
|
|
__Pyx_GOTREF(__pyx_k_slice_33);
|
|
__Pyx_GIVEREF(__pyx_k_slice_33);
|
|
|
|
/* "capnp.pyx":507
|
|
* return s
|
|
* ret = [s[0]]
|
|
* for letter in s[1:]: # <<<<<<<<<<<<<<
|
|
* if letter.isupper():
|
|
* ret.append('_')
|
|
*/
|
|
__pyx_k_slice_34 = PySlice_New(__pyx_int_1, Py_None, Py_None); if (unlikely(!__pyx_k_slice_34)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 507; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
|
|
__Pyx_GOTREF(__pyx_k_slice_34);
|
|
__Pyx_GIVEREF(__pyx_k_slice_34);
|
|
|
|
/* "capnp.pyx":522
|
|
* return
|
|
* if name[0] == ':':
|
|
* name = name[1:] # <<<<<<<<<<<<<<
|
|
* local_module = module
|
|
*
|
|
*/
|
|
__pyx_k_slice_38 = PySlice_New(__pyx_int_1, Py_None, Py_None); if (unlikely(!__pyx_k_slice_38)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 522; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
|
|
__Pyx_GOTREF(__pyx_k_slice_38);
|
|
__Pyx_GIVEREF(__pyx_k_slice_38);
|
|
|
|
/* "capnp.pyx":559
|
|
* retcode = p.wait()
|
|
* if retcode != 0:
|
|
* raise RuntimeError("capnpc failed for some reason") # <<<<<<<<<<<<<<
|
|
*
|
|
* reader = schema.StreamFdMessageReader(p.stdout.fileno())
|
|
*/
|
|
__pyx_k_tuple_44 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_43)); if (unlikely(!__pyx_k_tuple_44)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 559; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
|
|
__Pyx_GOTREF(__pyx_k_tuple_44);
|
|
__Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_44));
|
|
|
|
/* "capnp.pyx":39
|
|
* cython.p_char
|
|
*
|
|
* def _make_enum(enum_name, *sequential, **named): # <<<<<<<<<<<<<<
|
|
* enums = dict(zip(sequential, range(len(sequential))), **named)
|
|
* reverse = dict((value, key) for key, value in enums.iteritems())
|
|
*/
|
|
__pyx_k_tuple_46 = PyTuple_Pack(9, ((PyObject *)__pyx_n_s__enum_name), ((PyObject *)__pyx_n_s__sequential), ((PyObject *)__pyx_n_s__named), ((PyObject *)__pyx_n_s__sequential), ((PyObject *)__pyx_n_s__named), ((PyObject *)__pyx_n_s__enums), ((PyObject *)__pyx_n_s__reverse), ((PyObject *)__pyx_n_s__genexpr), ((PyObject *)__pyx_n_s__genexpr)); if (unlikely(!__pyx_k_tuple_46)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 39; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
|
|
__Pyx_GOTREF(__pyx_k_tuple_46);
|
|
__Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_46));
|
|
__pyx_k_codeobj_47 = (PyObject*)__Pyx_PyCode_New(1, 0, 9, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_k_tuple_46, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_48, __pyx_n_s___make_enum, 39, __pyx_empty_bytes); if (unlikely(!__pyx_k_codeobj_47)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 39; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
|
|
|
|
/* "capnp.pyx":45
|
|
* return type(enum_name, (), enums)
|
|
*
|
|
* _Type = _make_enum('DynamicValue.Type', # <<<<<<<<<<<<<<
|
|
* UNKNOWN = capnp.TYPE_UNKNOWN,
|
|
* VOID = capnp.TYPE_VOID,
|
|
*/
|
|
__pyx_k_tuple_50 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_49)); if (unlikely(!__pyx_k_tuple_50)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 45; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
|
|
__Pyx_GOTREF(__pyx_k_tuple_50);
|
|
__Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_50));
|
|
|
|
/* "capnp.pyx":107
|
|
* return toPython(temp)
|
|
*
|
|
* def _setitem(self, index, valid_values value): # <<<<<<<<<<<<<<
|
|
* cdef C_DynamicValue.Reader temp = C_DynamicValue.Reader(value)
|
|
* self.thisptr.set(index, temp)
|
|
*/
|
|
__pyx_k_tuple_51 = PyTuple_Pack(4, ((PyObject *)__pyx_n_s__self), ((PyObject *)__pyx_n_s__index), ((PyObject *)__pyx_n_s__value), ((PyObject *)__pyx_n_s__temp)); if (unlikely(!__pyx_k_tuple_51)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 107; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
|
|
__Pyx_GOTREF(__pyx_k_tuple_51);
|
|
__Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_51));
|
|
__pyx_k_codeobj_52 = (PyObject*)__Pyx_PyCode_New(3, 0, 4, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_k_tuple_51, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_48, __pyx_n_s___setitem, 107, __pyx_empty_bytes); if (unlikely(!__pyx_k_codeobj_52)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 107; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
|
|
|
|
/* "capnp.pyx":494
|
|
* self.thisptr = new schema_cpp.PackedFdMessageReader(fd)
|
|
*
|
|
* def writeMessageToFd(int fd, MessageBuilder m): # <<<<<<<<<<<<<<
|
|
* schema_cpp.writeMessageToFd(fd, deref(m.thisptr))
|
|
* def writePackedMessageToFd(int fd, MessageBuilder m):
|
|
*/
|
|
__pyx_k_tuple_54 = PyTuple_Pack(2, ((PyObject *)__pyx_n_s__fd), ((PyObject *)__pyx_n_s__m)); if (unlikely(!__pyx_k_tuple_54)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 494; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
|
|
__Pyx_GOTREF(__pyx_k_tuple_54);
|
|
__Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_54));
|
|
__pyx_k_codeobj_55 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_k_tuple_54, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_48, __pyx_n_s__writeMessageToFd, 494, __pyx_empty_bytes); if (unlikely(!__pyx_k_codeobj_55)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 494; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
|
|
|
|
/* "capnp.pyx":496
|
|
* def writeMessageToFd(int fd, MessageBuilder m):
|
|
* schema_cpp.writeMessageToFd(fd, deref(m.thisptr))
|
|
* def writePackedMessageToFd(int fd, MessageBuilder m): # <<<<<<<<<<<<<<
|
|
* schema_cpp.writePackedMessageToFd(fd, deref(m.thisptr))
|
|
*
|
|
*/
|
|
__pyx_k_tuple_56 = PyTuple_Pack(2, ((PyObject *)__pyx_n_s__fd), ((PyObject *)__pyx_n_s__m)); if (unlikely(!__pyx_k_tuple_56)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 496; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
|
|
__Pyx_GOTREF(__pyx_k_tuple_56);
|
|
__Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_56));
|
|
__pyx_k_codeobj_57 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_k_tuple_56, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_48, __pyx_n_s_58, 496, __pyx_empty_bytes); if (unlikely(!__pyx_k_codeobj_57)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 496; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
|
|
|
|
/* "capnp.pyx":499
|
|
* schema_cpp.writePackedMessageToFd(fd, deref(m.thisptr))
|
|
*
|
|
* def capitalize(s): # <<<<<<<<<<<<<<
|
|
* if len(s) < 2:
|
|
* return s
|
|
*/
|
|
__pyx_k_tuple_59 = PyTuple_Pack(1, ((PyObject *)__pyx_n_s__s)); if (unlikely(!__pyx_k_tuple_59)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 499; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
|
|
__Pyx_GOTREF(__pyx_k_tuple_59);
|
|
__Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_59));
|
|
__pyx_k_codeobj_60 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_k_tuple_59, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_48, __pyx_n_s__capitalize, 499, __pyx_empty_bytes); if (unlikely(!__pyx_k_codeobj_60)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 499; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
|
|
|
|
/* "capnp.pyx":503
|
|
* return s
|
|
* return s[0].upper() + s[1:]
|
|
* def upper_and_under(s): # <<<<<<<<<<<<<<
|
|
* if len(s) < 2:
|
|
* return s
|
|
*/
|
|
__pyx_k_tuple_61 = PyTuple_Pack(3, ((PyObject *)__pyx_n_s__s), ((PyObject *)__pyx_n_s__ret), ((PyObject *)__pyx_n_s__letter)); if (unlikely(!__pyx_k_tuple_61)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 503; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
|
|
__Pyx_GOTREF(__pyx_k_tuple_61);
|
|
__Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_61));
|
|
__pyx_k_codeobj_62 = (PyObject*)__Pyx_PyCode_New(1, 0, 3, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_k_tuple_61, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_48, __pyx_n_s__upper_and_under, 503, __pyx_empty_bytes); if (unlikely(!__pyx_k_codeobj_62)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 503; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
|
|
|
|
/* "capnp.pyx":518
|
|
* import subprocess
|
|
*
|
|
* def _load(module, node, loader, name, isUnion = False): # <<<<<<<<<<<<<<
|
|
* if name is None or len(name) == 0:
|
|
* return
|
|
*/
|
|
__pyx_k_tuple_63 = PyTuple_Pack(15, ((PyObject *)__pyx_n_s__module), ((PyObject *)__pyx_n_s__node), ((PyObject *)__pyx_n_s__loader), ((PyObject *)__pyx_n_s__name), ((PyObject *)__pyx_n_s__isUnion), ((PyObject *)__pyx_n_s__local_module), ((PyObject *)__pyx_n_s__sub_name), ((PyObject *)__pyx_n_s__new_m), ((PyObject *)__pyx_n_s__nestedNode), ((PyObject *)__pyx_n_s__s), ((PyObject *)__pyx_n_s__body), ((PyObject *)__pyx_n_s__which), ((PyObject *)__pyx_n_s__enum), ((PyObject *)__pyx_n_s__struct), ((PyObject *)__pyx_n_s__member)); if (unlikely(!__pyx_k_tuple_63)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 518; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
|
|
__Pyx_GOTREF(__pyx_k_tuple_63);
|
|
__Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_63));
|
|
__pyx_k_codeobj_64 = (PyObject*)__Pyx_PyCode_New(5, 0, 15, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_k_tuple_63, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_48, __pyx_n_s___load, 518, __pyx_empty_bytes); if (unlikely(!__pyx_k_codeobj_64)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 518; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
|
|
|
|
/* "capnp.pyx":555
|
|
* return local_module
|
|
*
|
|
* def load(file_name, cat_path='/bin/cat'): # <<<<<<<<<<<<<<
|
|
* p = subprocess.Popen(['capnpc', '-o'+cat_path, file_name], stdout=subprocess.PIPE)
|
|
* retcode = p.wait()
|
|
*/
|
|
__pyx_k_tuple_65 = PyTuple_Pack(11, ((PyObject *)__pyx_n_s__file_name), ((PyObject *)__pyx_n_s__cat_path), ((PyObject *)__pyx_n_s__p), ((PyObject *)__pyx_n_s__retcode), ((PyObject *)__pyx_n_s__reader), ((PyObject *)__pyx_n_s__request), ((PyObject *)__pyx_n_s__module), ((PyObject *)__pyx_n_s__loader), ((PyObject *)__pyx_n_s__node), ((PyObject *)__pyx_n_s__s), ((PyObject *)__pyx_n_s__local_module)); if (unlikely(!__pyx_k_tuple_65)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 555; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
|
|
__Pyx_GOTREF(__pyx_k_tuple_65);
|
|
__Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_65));
|
|
__pyx_k_codeobj_66 = (PyObject*)__Pyx_PyCode_New(2, 0, 11, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_k_tuple_65, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_48, __pyx_n_s__load, 555, __pyx_empty_bytes); if (unlikely(!__pyx_k_codeobj_66)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 555; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
|
|
__Pyx_RefNannyFinishContext();
|
|
return 0;
|
|
__pyx_L1_error:;
|
|
__Pyx_RefNannyFinishContext();
|
|
return -1;
|
|
}
|
|
|
|
static int __Pyx_InitGlobals(void) {
|
|
if (__Pyx_InitStrings(__pyx_string_tab) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
|
|
__pyx_int_0 = PyInt_FromLong(0); if (unlikely(!__pyx_int_0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
|
|
__pyx_int_1 = PyInt_FromLong(1); if (unlikely(!__pyx_int_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
|
|
__pyx_int_5 = PyInt_FromLong(5); if (unlikely(!__pyx_int_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
|
|
return 0;
|
|
__pyx_L1_error:;
|
|
return -1;
|
|
}
|
|
|
|
#if PY_MAJOR_VERSION < 3
|
|
PyMODINIT_FUNC initcapnp(void); /*proto*/
|
|
PyMODINIT_FUNC initcapnp(void)
|
|
#else
|
|
PyMODINIT_FUNC PyInit_capnp(void); /*proto*/
|
|
PyMODINIT_FUNC PyInit_capnp(void)
|
|
#endif
|
|
{
|
|
PyObject *__pyx_t_1 = NULL;
|
|
PyObject *__pyx_t_2 = NULL;
|
|
PyObject *__pyx_t_3 = NULL;
|
|
PyObject *__pyx_t_4 = NULL;
|
|
int __pyx_lineno = 0;
|
|
const char *__pyx_filename = NULL;
|
|
int __pyx_clineno = 0;
|
|
__Pyx_RefNannyDeclarations
|
|
#if CYTHON_REFNANNY
|
|
__Pyx_RefNanny = __Pyx_RefNannyImportAPI("refnanny");
|
|
if (!__Pyx_RefNanny) {
|
|
PyErr_Clear();
|
|
__Pyx_RefNanny = __Pyx_RefNannyImportAPI("Cython.Runtime.refnanny");
|
|
if (!__Pyx_RefNanny)
|
|
Py_FatalError("failed to import 'refnanny' module");
|
|
}
|
|
#endif
|
|
__Pyx_RefNannySetupContext("PyMODINIT_FUNC PyInit_capnp(void)", 0);
|
|
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_CyFunction_USED
|
|
if (__Pyx_CyFunction_init() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
|
|
#endif
|
|
#ifdef __Pyx_FusedFunction_USED
|
|
if (__pyx_FusedFunction_init() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
|
|
#endif
|
|
#ifdef __Pyx_Generator_USED
|
|
if (__pyx_Generator_init() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
|
|
#endif
|
|
/*--- Library function declarations ---*/
|
|
/*--- Threads initialization code ---*/
|
|
#if defined(__PYX_FORCE_INIT_THREADS) && __PYX_FORCE_INIT_THREADS
|
|
#ifdef WITH_THREAD /* Python build with threading support? */
|
|
PyEval_InitThreads();
|
|
#endif
|
|
#endif
|
|
/*--- Module creation code ---*/
|
|
#if PY_MAJOR_VERSION < 3
|
|
__pyx_m = Py_InitModule4(__Pyx_NAMESTR("capnp"), __pyx_methods, 0, 0, PYTHON_API_VERSION); Py_XINCREF(__pyx_m);
|
|
#else
|
|
__pyx_m = PyModule_Create(&__pyx_moduledef);
|
|
#endif
|
|
if (unlikely(!__pyx_m)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
|
|
__pyx_d = PyModule_GetDict(__pyx_m); if (unlikely(!__pyx_d)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
|
|
Py_INCREF(__pyx_d);
|
|
#if PY_MAJOR_VERSION >= 3
|
|
{
|
|
PyObject *modules = PyImport_GetModuleDict(); if (unlikely(!modules)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
|
|
if (!PyDict_GetItemString(modules, "capnp")) {
|
|
if (unlikely(PyDict_SetItemString(modules, "capnp", __pyx_m) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
|
|
}
|
|
}
|
|
#endif
|
|
__pyx_b = PyImport_AddModule(__Pyx_NAMESTR(__Pyx_BUILTIN_MODULE_NAME)); if (unlikely(!__pyx_b)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
|
|
#if CYTHON_COMPILING_IN_PYPY
|
|
Py_INCREF(__pyx_b);
|
|
#endif
|
|
if (__Pyx_SetAttrString(__pyx_m, "__builtins__", __pyx_b) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
|
|
/*--- Initialize various global constants etc. ---*/
|
|
if (unlikely(__Pyx_InitGlobals() < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
|
|
#if PY_MAJOR_VERSION < 3 && (__PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT)
|
|
if (__Pyx_init_sys_getdefaultencoding_params() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
|
|
#endif
|
|
if (__pyx_module_is_main_capnp) {
|
|
if (__Pyx_SetAttrString(__pyx_m, "__name__", __pyx_n_s____main__) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
|
|
}
|
|
/*--- Builtin init code ---*/
|
|
if (unlikely(__Pyx_InitCachedBuiltins() < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
|
|
/*--- 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 ---*/
|
|
__pyx_vtabptr_5capnp__List_Node_Reader = &__pyx_vtable_5capnp__List_Node_Reader;
|
|
__pyx_vtable_5capnp__List_Node_Reader._init = (PyObject *(*)(struct __pyx_obj_5capnp__List_Node_Reader *, ::capnp::List< ::capnp::schema::Node>::Reader))__pyx_f_5capnp_17_List_Node_Reader__init;
|
|
if (PyType_Ready(&__pyx_type_5capnp__List_Node_Reader) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 136; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
|
|
if (__Pyx_SetVtable(__pyx_type_5capnp__List_Node_Reader.tp_dict, __pyx_vtabptr_5capnp__List_Node_Reader) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 136; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
|
|
if (__Pyx_SetAttrString(__pyx_m, "_List_Node_Reader", (PyObject *)&__pyx_type_5capnp__List_Node_Reader) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 136; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
|
|
__pyx_ptype_5capnp__List_Node_Reader = &__pyx_type_5capnp__List_Node_Reader;
|
|
if (PyType_Ready(&__pyx_type_5capnp___pyx_scope_struct_1_genexpr) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 41; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
|
|
__pyx_ptype_5capnp___pyx_scope_struct_1_genexpr = &__pyx_type_5capnp___pyx_scope_struct_1_genexpr;
|
|
__pyx_vtabptr_5capnp__DynamicListReader = &__pyx_vtable_5capnp__DynamicListReader;
|
|
__pyx_vtable_5capnp__DynamicListReader._init = (PyObject *(*)(struct __pyx_obj_5capnp__DynamicListReader *, ::capnp::DynamicList::Reader))__pyx_f_5capnp_18_DynamicListReader__init;
|
|
__pyx_vtable_5capnp__DynamicListReader._get = (PyObject *(*)(struct __pyx_obj_5capnp__DynamicListReader *, PyObject *, int __pyx_skip_dispatch))__pyx_f_5capnp_18_DynamicListReader__get;
|
|
if (PyType_Ready(&__pyx_type_5capnp__DynamicListReader) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 70; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
|
|
if (__Pyx_SetVtable(__pyx_type_5capnp__DynamicListReader.tp_dict, __pyx_vtabptr_5capnp__DynamicListReader) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 70; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
|
|
if (__Pyx_SetAttrString(__pyx_m, "_DynamicListReader", (PyObject *)&__pyx_type_5capnp__DynamicListReader) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 70; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
|
|
__pyx_ptype_5capnp__DynamicListReader = &__pyx_type_5capnp__DynamicListReader;
|
|
__pyx_vtabptr_5capnp__DynamicUnionReader = &__pyx_vtable_5capnp__DynamicUnionReader;
|
|
__pyx_vtable_5capnp__DynamicUnionReader._init = (PyObject *(*)(struct __pyx_obj_5capnp__DynamicUnionReader *, ::capnp::DynamicUnion::Reader))__pyx_f_5capnp_19_DynamicUnionReader__init;
|
|
__pyx_vtable_5capnp__DynamicUnionReader._get = (PyObject *(*)(struct __pyx_obj_5capnp__DynamicUnionReader *, int __pyx_skip_dispatch))__pyx_f_5capnp_19_DynamicUnionReader__get;
|
|
__pyx_vtable_5capnp__DynamicUnionReader.which = (PyObject *(*)(struct __pyx_obj_5capnp__DynamicUnionReader *, int __pyx_skip_dispatch))__pyx_f_5capnp_19_DynamicUnionReader_which;
|
|
if (PyType_Ready(&__pyx_type_5capnp__DynamicUnionReader) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 329; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
|
|
if (__Pyx_SetVtable(__pyx_type_5capnp__DynamicUnionReader.tp_dict, __pyx_vtabptr_5capnp__DynamicUnionReader) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 329; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
|
|
if (__Pyx_SetAttrString(__pyx_m, "_DynamicUnionReader", (PyObject *)&__pyx_type_5capnp__DynamicUnionReader) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 329; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
|
|
__pyx_ptype_5capnp__DynamicUnionReader = &__pyx_type_5capnp__DynamicUnionReader;
|
|
__pyx_vtabptr_5capnp_MessageBuilder = &__pyx_vtable_5capnp_MessageBuilder;
|
|
__pyx_vtable_5capnp_MessageBuilder.initRoot = (PyObject *(*)(struct __pyx_obj_5capnp_MessageBuilder *, PyObject *, int __pyx_skip_dispatch))__pyx_f_5capnp_14MessageBuilder_initRoot;
|
|
__pyx_vtable_5capnp_MessageBuilder.getRoot = (PyObject *(*)(struct __pyx_obj_5capnp_MessageBuilder *, PyObject *, int __pyx_skip_dispatch))__pyx_f_5capnp_14MessageBuilder_getRoot;
|
|
if (PyType_Ready(&__pyx_type_5capnp_MessageBuilder) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 445; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
|
|
if (__Pyx_SetVtable(__pyx_type_5capnp_MessageBuilder.tp_dict, __pyx_vtabptr_5capnp_MessageBuilder) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 445; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
|
|
if (__Pyx_SetAttrString(__pyx_m, "MessageBuilder", (PyObject *)&__pyx_type_5capnp_MessageBuilder) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 445; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
|
|
__pyx_ptype_5capnp_MessageBuilder = &__pyx_type_5capnp_MessageBuilder;
|
|
__pyx_vtabptr_5capnp__List_UInt64_Reader = &__pyx_vtable_5capnp__List_UInt64_Reader;
|
|
__pyx_vtable_5capnp__List_UInt64_Reader._init = (PyObject *(*)(struct __pyx_obj_5capnp__List_UInt64_Reader *, ::capnp::List<__pyx_t_5capnp_UInt64>::Reader))__pyx_f_5capnp_19_List_UInt64_Reader__init;
|
|
if (PyType_Ready(&__pyx_type_5capnp__List_UInt64_Reader) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 121; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
|
|
if (__Pyx_SetVtable(__pyx_type_5capnp__List_UInt64_Reader.tp_dict, __pyx_vtabptr_5capnp__List_UInt64_Reader) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 121; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
|
|
if (__Pyx_SetAttrString(__pyx_m, "_List_UInt64_Reader", (PyObject *)&__pyx_type_5capnp__List_UInt64_Reader) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 121; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
|
|
__pyx_ptype_5capnp__List_UInt64_Reader = &__pyx_type_5capnp__List_UInt64_Reader;
|
|
__pyx_vtabptr_5capnp_StructSchema = &__pyx_vtable_5capnp_StructSchema;
|
|
__pyx_vtable_5capnp_StructSchema._init = (PyObject *(*)(struct __pyx_obj_5capnp_StructSchema *, ::capnp::StructSchema))__pyx_f_5capnp_12StructSchema__init;
|
|
if (PyType_Ready(&__pyx_type_5capnp_StructSchema) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 425; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
|
|
if (__Pyx_SetVtable(__pyx_type_5capnp_StructSchema.tp_dict, __pyx_vtabptr_5capnp_StructSchema) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 425; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
|
|
if (__Pyx_SetAttrString(__pyx_m, "StructSchema", (PyObject *)&__pyx_type_5capnp_StructSchema) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 425; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
|
|
__pyx_ptype_5capnp_StructSchema = &__pyx_type_5capnp_StructSchema;
|
|
__pyx_vtabptr_5capnp_MessageReader = &__pyx_vtable_5capnp_MessageReader;
|
|
__pyx_vtable_5capnp_MessageReader.getRootNode = (PyObject *(*)(struct __pyx_obj_5capnp_MessageReader *, int __pyx_skip_dispatch))__pyx_f_5capnp_13MessageReader_getRootNode;
|
|
__pyx_vtable_5capnp_MessageReader.getRootCodeGeneratorRequest = (PyObject *(*)(struct __pyx_obj_5capnp_MessageReader *, int __pyx_skip_dispatch))__pyx_f_5capnp_13MessageReader_getRootCodeGeneratorRequest;
|
|
__pyx_vtable_5capnp_MessageReader.getRootDynamicStruct = (PyObject *(*)(struct __pyx_obj_5capnp_MessageReader *, struct __pyx_obj_5capnp_StructSchema *, int __pyx_skip_dispatch))__pyx_f_5capnp_13MessageReader_getRootDynamicStruct;
|
|
__pyx_vtable_5capnp_MessageReader.getRoot = (PyObject *(*)(struct __pyx_obj_5capnp_MessageReader *, PyObject *, int __pyx_skip_dispatch))__pyx_f_5capnp_13MessageReader_getRoot;
|
|
if (PyType_Ready(&__pyx_type_5capnp_MessageReader) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 468; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
|
|
if (__Pyx_SetVtable(__pyx_type_5capnp_MessageReader.tp_dict, __pyx_vtabptr_5capnp_MessageReader) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 468; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
|
|
if (__Pyx_SetAttrString(__pyx_m, "MessageReader", (PyObject *)&__pyx_type_5capnp_MessageReader) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 468; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
|
|
__pyx_ptype_5capnp_MessageReader = &__pyx_type_5capnp_MessageReader;
|
|
__pyx_vtabptr_5capnp_PackedFdMessageReader = &__pyx_vtable_5capnp_PackedFdMessageReader;
|
|
__pyx_vtable_5capnp_PackedFdMessageReader.__pyx_base = *__pyx_vtabptr_5capnp_MessageReader;
|
|
__pyx_type_5capnp_PackedFdMessageReader.tp_base = __pyx_ptype_5capnp_MessageReader;
|
|
if (PyType_Ready(&__pyx_type_5capnp_PackedFdMessageReader) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 490; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
|
|
if (__Pyx_SetVtable(__pyx_type_5capnp_PackedFdMessageReader.tp_dict, __pyx_vtabptr_5capnp_PackedFdMessageReader) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 490; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
|
|
if (__Pyx_SetAttrString(__pyx_m, "PackedFdMessageReader", (PyObject *)&__pyx_type_5capnp_PackedFdMessageReader) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 490; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
|
|
__pyx_ptype_5capnp_PackedFdMessageReader = &__pyx_type_5capnp_PackedFdMessageReader;
|
|
__pyx_vtabptr_5capnp__DynamicStructReader = &__pyx_vtable_5capnp__DynamicStructReader;
|
|
__pyx_vtable_5capnp__DynamicStructReader._init = (PyObject *(*)(struct __pyx_obj_5capnp__DynamicStructReader *, ::capnp::DynamicStruct::Reader))__pyx_f_5capnp_20_DynamicStructReader__init;
|
|
__pyx_vtable_5capnp__DynamicStructReader._get = (PyObject *(*)(struct __pyx_obj_5capnp__DynamicStructReader *, PyObject *, int __pyx_skip_dispatch))__pyx_f_5capnp_20_DynamicStructReader__get;
|
|
if (PyType_Ready(&__pyx_type_5capnp__DynamicStructReader) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 255; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
|
|
if (__Pyx_SetVtable(__pyx_type_5capnp__DynamicStructReader.tp_dict, __pyx_vtabptr_5capnp__DynamicStructReader) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 255; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
|
|
if (__Pyx_SetAttrString(__pyx_m, "_DynamicStructReader", (PyObject *)&__pyx_type_5capnp__DynamicStructReader) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 255; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
|
|
__pyx_ptype_5capnp__DynamicStructReader = &__pyx_type_5capnp__DynamicStructReader;
|
|
if (PyType_Ready(&__pyx_type_5capnp___pyx_scope_struct___make_enum) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 39; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
|
|
__pyx_ptype_5capnp___pyx_scope_struct___make_enum = &__pyx_type_5capnp___pyx_scope_struct___make_enum;
|
|
__pyx_vtabptr_5capnp_StreamFdMessageReader = &__pyx_vtable_5capnp_StreamFdMessageReader;
|
|
__pyx_vtable_5capnp_StreamFdMessageReader.__pyx_base = *__pyx_vtabptr_5capnp_MessageReader;
|
|
__pyx_type_5capnp_StreamFdMessageReader.tp_base = __pyx_ptype_5capnp_MessageReader;
|
|
if (PyType_Ready(&__pyx_type_5capnp_StreamFdMessageReader) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 486; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
|
|
if (__Pyx_SetVtable(__pyx_type_5capnp_StreamFdMessageReader.tp_dict, __pyx_vtabptr_5capnp_StreamFdMessageReader) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 486; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
|
|
if (__Pyx_SetAttrString(__pyx_m, "StreamFdMessageReader", (PyObject *)&__pyx_type_5capnp_StreamFdMessageReader) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 486; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
|
|
__pyx_ptype_5capnp_StreamFdMessageReader = &__pyx_type_5capnp_StreamFdMessageReader;
|
|
__pyx_vtabptr_5capnp_MallocMessageBuilder = &__pyx_vtable_5capnp_MallocMessageBuilder;
|
|
__pyx_vtable_5capnp_MallocMessageBuilder.__pyx_base = *__pyx_vtabptr_5capnp_MessageBuilder;
|
|
__pyx_type_5capnp_MallocMessageBuilder.tp_base = __pyx_ptype_5capnp_MessageBuilder;
|
|
if (PyType_Ready(&__pyx_type_5capnp_MallocMessageBuilder) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 464; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
|
|
if (__Pyx_SetVtable(__pyx_type_5capnp_MallocMessageBuilder.tp_dict, __pyx_vtabptr_5capnp_MallocMessageBuilder) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 464; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
|
|
if (__Pyx_SetAttrString(__pyx_m, "MallocMessageBuilder", (PyObject *)&__pyx_type_5capnp_MallocMessageBuilder) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 464; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
|
|
__pyx_ptype_5capnp_MallocMessageBuilder = &__pyx_type_5capnp_MallocMessageBuilder;
|
|
__pyx_vtabptr_5capnp__DynamicValueReader = &__pyx_vtable_5capnp__DynamicValueReader;
|
|
__pyx_vtable_5capnp__DynamicValueReader._init = (PyObject *(*)(struct __pyx_obj_5capnp__DynamicValueReader *, ::capnp::DynamicValue::Reader))__pyx_f_5capnp_19_DynamicValueReader__init;
|
|
__pyx_vtable_5capnp__DynamicValueReader.getType = (int (*)(struct __pyx_obj_5capnp__DynamicValueReader *, int __pyx_skip_dispatch))__pyx_f_5capnp_19_DynamicValueReader_getType;
|
|
__pyx_vtable_5capnp__DynamicValueReader.toPython = (PyObject *(*)(struct __pyx_obj_5capnp__DynamicValueReader *, int __pyx_skip_dispatch))__pyx_f_5capnp_19_DynamicValueReader_toPython;
|
|
if (PyType_Ready(&__pyx_type_5capnp__DynamicValueReader) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 151; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
|
|
if (__Pyx_SetVtable(__pyx_type_5capnp__DynamicValueReader.tp_dict, __pyx_vtabptr_5capnp__DynamicValueReader) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 151; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
|
|
if (__Pyx_SetAttrString(__pyx_m, "_DynamicValueReader", (PyObject *)&__pyx_type_5capnp__DynamicValueReader) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 151; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
|
|
__pyx_ptype_5capnp__DynamicValueReader = &__pyx_type_5capnp__DynamicValueReader;
|
|
__pyx_vtabptr_5capnp_Schema = &__pyx_vtable_5capnp_Schema;
|
|
__pyx_vtable_5capnp_Schema._init = (PyObject *(*)(struct __pyx_obj_5capnp_Schema *, ::capnp::Schema))__pyx_f_5capnp_6Schema__init;
|
|
__pyx_vtable_5capnp_Schema.asStruct = (PyObject *(*)(struct __pyx_obj_5capnp_Schema *, int __pyx_skip_dispatch))__pyx_f_5capnp_6Schema_asStruct;
|
|
__pyx_vtable_5capnp_Schema.getDependency = (PyObject *(*)(struct __pyx_obj_5capnp_Schema *, PyObject *, int __pyx_skip_dispatch))__pyx_f_5capnp_6Schema_getDependency;
|
|
__pyx_vtable_5capnp_Schema.getProto = (PyObject *(*)(struct __pyx_obj_5capnp_Schema *, int __pyx_skip_dispatch))__pyx_f_5capnp_6Schema_getProto;
|
|
if (PyType_Ready(&__pyx_type_5capnp_Schema) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 410; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
|
|
if (__Pyx_SetVtable(__pyx_type_5capnp_Schema.tp_dict, __pyx_vtabptr_5capnp_Schema) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 410; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
|
|
if (__Pyx_SetAttrString(__pyx_m, "Schema", (PyObject *)&__pyx_type_5capnp_Schema) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 410; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
|
|
__pyx_ptype_5capnp_Schema = &__pyx_type_5capnp_Schema;
|
|
__pyx_vtabptr_5capnp__CodeGeneratorRequestReader = &__pyx_vtable_5capnp__CodeGeneratorRequestReader;
|
|
__pyx_vtable_5capnp__CodeGeneratorRequestReader._init = (PyObject *(*)(struct __pyx_obj_5capnp__CodeGeneratorRequestReader *, ::capnp::schema::CodeGeneratorRequest::Reader))__pyx_f_5capnp_27_CodeGeneratorRequestReader__init;
|
|
if (PyType_Ready(&__pyx_type_5capnp__CodeGeneratorRequestReader) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 397; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
|
|
if (__Pyx_SetVtable(__pyx_type_5capnp__CodeGeneratorRequestReader.tp_dict, __pyx_vtabptr_5capnp__CodeGeneratorRequestReader) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 397; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
|
|
if (__Pyx_SetAttrString(__pyx_m, "_CodeGeneratorRequestReader", (PyObject *)&__pyx_type_5capnp__CodeGeneratorRequestReader) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 397; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
|
|
__pyx_ptype_5capnp__CodeGeneratorRequestReader = &__pyx_type_5capnp__CodeGeneratorRequestReader;
|
|
__pyx_vtabptr_5capnp__DynamicUnionBuilder = &__pyx_vtable_5capnp__DynamicUnionBuilder;
|
|
__pyx_vtable_5capnp__DynamicUnionBuilder._init = (PyObject *(*)(struct __pyx_obj_5capnp__DynamicUnionBuilder *, ::capnp::DynamicUnion::Builder))__pyx_f_5capnp_20_DynamicUnionBuilder__init;
|
|
__pyx_vtable_5capnp__DynamicUnionBuilder._setattrInt = (PyObject *(*)(struct __pyx_obj_5capnp__DynamicUnionBuilder *, PyObject *, PyObject *))__pyx_f_5capnp_20_DynamicUnionBuilder__setattrInt;
|
|
__pyx_vtable_5capnp__DynamicUnionBuilder._setattrDouble = (PyObject *(*)(struct __pyx_obj_5capnp__DynamicUnionBuilder *, PyObject *, PyObject *))__pyx_f_5capnp_20_DynamicUnionBuilder__setattrDouble;
|
|
__pyx_vtable_5capnp__DynamicUnionBuilder._setattrBool = (PyObject *(*)(struct __pyx_obj_5capnp__DynamicUnionBuilder *, PyObject *, PyObject *))__pyx_f_5capnp_20_DynamicUnionBuilder__setattrBool;
|
|
__pyx_vtable_5capnp__DynamicUnionBuilder._setattrString = (PyObject *(*)(struct __pyx_obj_5capnp__DynamicUnionBuilder *, PyObject *, PyObject *))__pyx_f_5capnp_20_DynamicUnionBuilder__setattrString;
|
|
__pyx_vtable_5capnp__DynamicUnionBuilder._setattrVoid = (PyObject *(*)(struct __pyx_obj_5capnp__DynamicUnionBuilder *, PyObject *))__pyx_f_5capnp_20_DynamicUnionBuilder__setattrVoid;
|
|
__pyx_vtable_5capnp__DynamicUnionBuilder.which = (PyObject *(*)(struct __pyx_obj_5capnp__DynamicUnionBuilder *, int __pyx_skip_dispatch))__pyx_f_5capnp_20_DynamicUnionBuilder_which;
|
|
__pyx_vtable_5capnp__DynamicUnionBuilder.init = (PyObject *(*)(struct __pyx_obj_5capnp__DynamicUnionBuilder *, PyObject *, int __pyx_skip_dispatch, struct __pyx_opt_args_5capnp_20_DynamicUnionBuilder_init *__pyx_optional_args))__pyx_f_5capnp_20_DynamicUnionBuilder_init;
|
|
if (PyType_Ready(&__pyx_type_5capnp__DynamicUnionBuilder) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 344; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
|
|
if (__Pyx_SetVtable(__pyx_type_5capnp__DynamicUnionBuilder.tp_dict, __pyx_vtabptr_5capnp__DynamicUnionBuilder) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 344; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
|
|
if (__Pyx_SetAttrString(__pyx_m, "_DynamicUnionBuilder", (PyObject *)&__pyx_type_5capnp__DynamicUnionBuilder) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 344; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
|
|
__pyx_ptype_5capnp__DynamicUnionBuilder = &__pyx_type_5capnp__DynamicUnionBuilder;
|
|
__pyx_vtabptr_5capnp__DynamicListBuilder = &__pyx_vtable_5capnp__DynamicListBuilder;
|
|
__pyx_vtable_5capnp__DynamicListBuilder._init = (PyObject *(*)(struct __pyx_obj_5capnp__DynamicListBuilder *, ::capnp::DynamicList::Builder))__pyx_f_5capnp_19_DynamicListBuilder__init;
|
|
if (PyType_Ready(&__pyx_type_5capnp__DynamicListBuilder) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 89; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
|
|
if (__Pyx_SetVtable(__pyx_type_5capnp__DynamicListBuilder.tp_dict, __pyx_vtabptr_5capnp__DynamicListBuilder) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 89; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
|
|
if (__Pyx_SetAttrString(__pyx_m, "_DynamicListBuilder", (PyObject *)&__pyx_type_5capnp__DynamicListBuilder) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 89; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
|
|
__pyx_ptype_5capnp__DynamicListBuilder = &__pyx_type_5capnp__DynamicListBuilder;
|
|
__pyx_vtabptr_5capnp__DynamicStructBuilder = &__pyx_vtable_5capnp__DynamicStructBuilder;
|
|
__pyx_vtable_5capnp__DynamicStructBuilder._init = (PyObject *(*)(struct __pyx_obj_5capnp__DynamicStructBuilder *, ::capnp::DynamicStruct::Builder))__pyx_f_5capnp_21_DynamicStructBuilder__init;
|
|
__pyx_vtable_5capnp__DynamicStructBuilder._setattrInt = (PyObject *(*)(struct __pyx_obj_5capnp__DynamicStructBuilder *, PyObject *, PyObject *))__pyx_f_5capnp_21_DynamicStructBuilder__setattrInt;
|
|
__pyx_vtable_5capnp__DynamicStructBuilder._setattrDouble = (PyObject *(*)(struct __pyx_obj_5capnp__DynamicStructBuilder *, PyObject *, PyObject *))__pyx_f_5capnp_21_DynamicStructBuilder__setattrDouble;
|
|
__pyx_vtable_5capnp__DynamicStructBuilder._setattrBool = (PyObject *(*)(struct __pyx_obj_5capnp__DynamicStructBuilder *, PyObject *, PyObject *))__pyx_f_5capnp_21_DynamicStructBuilder__setattrBool;
|
|
__pyx_vtable_5capnp__DynamicStructBuilder._setattrString = (PyObject *(*)(struct __pyx_obj_5capnp__DynamicStructBuilder *, PyObject *, PyObject *))__pyx_f_5capnp_21_DynamicStructBuilder__setattrString;
|
|
__pyx_vtable_5capnp__DynamicStructBuilder._setattrVoid = (PyObject *(*)(struct __pyx_obj_5capnp__DynamicStructBuilder *, PyObject *))__pyx_f_5capnp_21_DynamicStructBuilder__setattrVoid;
|
|
__pyx_vtable_5capnp__DynamicStructBuilder.init = (PyObject *(*)(struct __pyx_obj_5capnp__DynamicStructBuilder *, PyObject *, int __pyx_skip_dispatch, struct __pyx_opt_args_5capnp_21_DynamicStructBuilder_init *__pyx_optional_args))__pyx_f_5capnp_21_DynamicStructBuilder_init;
|
|
if (PyType_Ready(&__pyx_type_5capnp__DynamicStructBuilder) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 270; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
|
|
if (__Pyx_SetVtable(__pyx_type_5capnp__DynamicStructBuilder.tp_dict, __pyx_vtabptr_5capnp__DynamicStructBuilder) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 270; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
|
|
if (__Pyx_SetAttrString(__pyx_m, "_DynamicStructBuilder", (PyObject *)&__pyx_type_5capnp__DynamicStructBuilder) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 270; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
|
|
__pyx_ptype_5capnp__DynamicStructBuilder = &__pyx_type_5capnp__DynamicStructBuilder;
|
|
if (PyType_Ready(&__pyx_type_5capnp___pyx_scope_struct_2___getattr__) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 276; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
|
|
__pyx_ptype_5capnp___pyx_scope_struct_2___getattr__ = &__pyx_type_5capnp___pyx_scope_struct_2___getattr__;
|
|
__pyx_vtabptr_5capnp_SchemaLoader = &__pyx_vtable_5capnp_SchemaLoader;
|
|
__pyx_vtable_5capnp_SchemaLoader.load = (PyObject *(*)(struct __pyx_obj_5capnp_SchemaLoader *, struct __pyx_obj_6schema__NodeReader *, int __pyx_skip_dispatch))__pyx_f_5capnp_12SchemaLoader_load;
|
|
__pyx_vtable_5capnp_SchemaLoader.get = (PyObject *(*)(struct __pyx_obj_5capnp_SchemaLoader *, PyObject *, int __pyx_skip_dispatch))__pyx_f_5capnp_12SchemaLoader_get;
|
|
if (PyType_Ready(&__pyx_type_5capnp_SchemaLoader) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 431; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
|
|
if (__Pyx_SetVtable(__pyx_type_5capnp_SchemaLoader.tp_dict, __pyx_vtabptr_5capnp_SchemaLoader) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 431; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
|
|
if (__Pyx_SetAttrString(__pyx_m, "SchemaLoader", (PyObject *)&__pyx_type_5capnp_SchemaLoader) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 431; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
|
|
__pyx_ptype_5capnp_SchemaLoader = &__pyx_type_5capnp_SchemaLoader;
|
|
/*--- Type import code ---*/
|
|
__pyx_ptype_6schema__NodeReader = __Pyx_ImportType("schema", "_NodeReader", sizeof(struct __pyx_obj_6schema__NodeReader), 1); if (unlikely(!__pyx_ptype_6schema__NodeReader)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 6; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
|
|
__pyx_vtabptr_6schema__NodeReader = (struct __pyx_vtabstruct_6schema__NodeReader*)__Pyx_GetVtable(__pyx_ptype_6schema__NodeReader->tp_dict); if (unlikely(!__pyx_vtabptr_6schema__NodeReader)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 6; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
|
|
/*--- Variable import code ---*/
|
|
/*--- Function import code ---*/
|
|
/*--- Execution code ---*/
|
|
|
|
/* "capnp.pyx":39
|
|
* cython.p_char
|
|
*
|
|
* def _make_enum(enum_name, *sequential, **named): # <<<<<<<<<<<<<<
|
|
* enums = dict(zip(sequential, range(len(sequential))), **named)
|
|
* reverse = dict((value, key) for key, value in enums.iteritems())
|
|
*/
|
|
__pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_5capnp_1_make_enum, NULL, __pyx_n_s__capnp); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 39; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
|
|
__Pyx_GOTREF(__pyx_t_1);
|
|
if (PyDict_SetItem(__pyx_d, __pyx_n_s___make_enum, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 39; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
|
|
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
|
|
|
|
/* "capnp.pyx":45
|
|
* return type(enum_name, (), enums)
|
|
*
|
|
* _Type = _make_enum('DynamicValue.Type', # <<<<<<<<<<<<<<
|
|
* UNKNOWN = capnp.TYPE_UNKNOWN,
|
|
* VOID = capnp.TYPE_VOID,
|
|
*/
|
|
__pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s___make_enum); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 45; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
|
|
__Pyx_GOTREF(__pyx_t_1);
|
|
__pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 45; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
|
|
__Pyx_GOTREF(((PyObject *)__pyx_t_2));
|
|
|
|
/* "capnp.pyx":46
|
|
*
|
|
* _Type = _make_enum('DynamicValue.Type',
|
|
* UNKNOWN = capnp.TYPE_UNKNOWN, # <<<<<<<<<<<<<<
|
|
* VOID = capnp.TYPE_VOID,
|
|
* BOOL = capnp.TYPE_BOOL,
|
|
*/
|
|
__pyx_t_3 = PyInt_FromLong( ::capnp::DynamicValue::UNKNOWN); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 46; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
|
|
__Pyx_GOTREF(__pyx_t_3);
|
|
if (PyDict_SetItem(__pyx_t_2, ((PyObject *)__pyx_n_s__UNKNOWN), __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 45; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
|
|
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
|
|
|
|
/* "capnp.pyx":47
|
|
* _Type = _make_enum('DynamicValue.Type',
|
|
* UNKNOWN = capnp.TYPE_UNKNOWN,
|
|
* VOID = capnp.TYPE_VOID, # <<<<<<<<<<<<<<
|
|
* BOOL = capnp.TYPE_BOOL,
|
|
* INT = capnp.TYPE_INT,
|
|
*/
|
|
__pyx_t_3 = PyInt_FromLong( ::capnp::DynamicValue::VOID); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 47; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
|
|
__Pyx_GOTREF(__pyx_t_3);
|
|
if (PyDict_SetItem(__pyx_t_2, ((PyObject *)__pyx_n_s__VOID), __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 45; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
|
|
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
|
|
|
|
/* "capnp.pyx":48
|
|
* UNKNOWN = capnp.TYPE_UNKNOWN,
|
|
* VOID = capnp.TYPE_VOID,
|
|
* BOOL = capnp.TYPE_BOOL, # <<<<<<<<<<<<<<
|
|
* INT = capnp.TYPE_INT,
|
|
* UINT = capnp.TYPE_UINT,
|
|
*/
|
|
__pyx_t_3 = PyInt_FromLong( ::capnp::DynamicValue::BOOL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 48; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
|
|
__Pyx_GOTREF(__pyx_t_3);
|
|
if (PyDict_SetItem(__pyx_t_2, ((PyObject *)__pyx_n_s__BOOL), __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 45; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
|
|
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
|
|
|
|
/* "capnp.pyx":49
|
|
* VOID = capnp.TYPE_VOID,
|
|
* BOOL = capnp.TYPE_BOOL,
|
|
* INT = capnp.TYPE_INT, # <<<<<<<<<<<<<<
|
|
* UINT = capnp.TYPE_UINT,
|
|
* FLOAT = capnp.TYPE_FLOAT,
|
|
*/
|
|
__pyx_t_3 = PyInt_FromLong( ::capnp::DynamicValue::INT); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 49; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
|
|
__Pyx_GOTREF(__pyx_t_3);
|
|
if (PyDict_SetItem(__pyx_t_2, ((PyObject *)__pyx_n_s__INT), __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 45; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
|
|
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
|
|
|
|
/* "capnp.pyx":50
|
|
* BOOL = capnp.TYPE_BOOL,
|
|
* INT = capnp.TYPE_INT,
|
|
* UINT = capnp.TYPE_UINT, # <<<<<<<<<<<<<<
|
|
* FLOAT = capnp.TYPE_FLOAT,
|
|
* TEXT = capnp.TYPE_TEXT,
|
|
*/
|
|
__pyx_t_3 = PyInt_FromLong( ::capnp::DynamicValue::UINT); 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);
|
|
if (PyDict_SetItem(__pyx_t_2, ((PyObject *)__pyx_n_s__UINT), __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 45; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
|
|
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
|
|
|
|
/* "capnp.pyx":51
|
|
* INT = capnp.TYPE_INT,
|
|
* UINT = capnp.TYPE_UINT,
|
|
* FLOAT = capnp.TYPE_FLOAT, # <<<<<<<<<<<<<<
|
|
* TEXT = capnp.TYPE_TEXT,
|
|
* DATA = capnp.TYPE_DATA,
|
|
*/
|
|
__pyx_t_3 = PyInt_FromLong( ::capnp::DynamicValue::FLOAT); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 51; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
|
|
__Pyx_GOTREF(__pyx_t_3);
|
|
if (PyDict_SetItem(__pyx_t_2, ((PyObject *)__pyx_n_s__FLOAT), __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 45; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
|
|
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
|
|
|
|
/* "capnp.pyx":52
|
|
* UINT = capnp.TYPE_UINT,
|
|
* FLOAT = capnp.TYPE_FLOAT,
|
|
* TEXT = capnp.TYPE_TEXT, # <<<<<<<<<<<<<<
|
|
* DATA = capnp.TYPE_DATA,
|
|
* LIST = capnp.TYPE_LIST,
|
|
*/
|
|
__pyx_t_3 = PyInt_FromLong( ::capnp::DynamicValue::TEXT); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 52; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
|
|
__Pyx_GOTREF(__pyx_t_3);
|
|
if (PyDict_SetItem(__pyx_t_2, ((PyObject *)__pyx_n_s__TEXT), __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 45; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
|
|
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
|
|
|
|
/* "capnp.pyx":53
|
|
* FLOAT = capnp.TYPE_FLOAT,
|
|
* TEXT = capnp.TYPE_TEXT,
|
|
* DATA = capnp.TYPE_DATA, # <<<<<<<<<<<<<<
|
|
* LIST = capnp.TYPE_LIST,
|
|
* ENUM = capnp.TYPE_ENUM,
|
|
*/
|
|
__pyx_t_3 = PyInt_FromLong( ::capnp::DynamicValue::DATA); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 53; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
|
|
__Pyx_GOTREF(__pyx_t_3);
|
|
if (PyDict_SetItem(__pyx_t_2, ((PyObject *)__pyx_n_s__DATA), __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 45; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
|
|
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
|
|
|
|
/* "capnp.pyx":54
|
|
* TEXT = capnp.TYPE_TEXT,
|
|
* DATA = capnp.TYPE_DATA,
|
|
* LIST = capnp.TYPE_LIST, # <<<<<<<<<<<<<<
|
|
* ENUM = capnp.TYPE_ENUM,
|
|
* STRUCT = capnp.TYPE_STRUCT,
|
|
*/
|
|
__pyx_t_3 = PyInt_FromLong( ::capnp::DynamicValue::LIST); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 54; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
|
|
__Pyx_GOTREF(__pyx_t_3);
|
|
if (PyDict_SetItem(__pyx_t_2, ((PyObject *)__pyx_n_s__LIST), __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 45; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
|
|
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
|
|
|
|
/* "capnp.pyx":55
|
|
* DATA = capnp.TYPE_DATA,
|
|
* LIST = capnp.TYPE_LIST,
|
|
* ENUM = capnp.TYPE_ENUM, # <<<<<<<<<<<<<<
|
|
* STRUCT = capnp.TYPE_STRUCT,
|
|
* UNION = capnp.TYPE_UNION,
|
|
*/
|
|
__pyx_t_3 = PyInt_FromLong( ::capnp::DynamicValue::ENUM); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 55; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
|
|
__Pyx_GOTREF(__pyx_t_3);
|
|
if (PyDict_SetItem(__pyx_t_2, ((PyObject *)__pyx_n_s__ENUM), __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 45; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
|
|
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
|
|
|
|
/* "capnp.pyx":56
|
|
* LIST = capnp.TYPE_LIST,
|
|
* ENUM = capnp.TYPE_ENUM,
|
|
* STRUCT = capnp.TYPE_STRUCT, # <<<<<<<<<<<<<<
|
|
* UNION = capnp.TYPE_UNION,
|
|
* INTERFACE = capnp.TYPE_INTERFACE,
|
|
*/
|
|
__pyx_t_3 = PyInt_FromLong( ::capnp::DynamicValue::STRUCT); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 56; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
|
|
__Pyx_GOTREF(__pyx_t_3);
|
|
if (PyDict_SetItem(__pyx_t_2, ((PyObject *)__pyx_n_s__STRUCT), __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 45; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
|
|
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
|
|
|
|
/* "capnp.pyx":57
|
|
* ENUM = capnp.TYPE_ENUM,
|
|
* STRUCT = capnp.TYPE_STRUCT,
|
|
* UNION = capnp.TYPE_UNION, # <<<<<<<<<<<<<<
|
|
* INTERFACE = capnp.TYPE_INTERFACE,
|
|
* OBJECT = capnp.TYPE_OBJECT)
|
|
*/
|
|
__pyx_t_3 = PyInt_FromLong( ::capnp::DynamicValue::UNION); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 57; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
|
|
__Pyx_GOTREF(__pyx_t_3);
|
|
if (PyDict_SetItem(__pyx_t_2, ((PyObject *)__pyx_n_s__UNION), __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 45; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
|
|
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
|
|
|
|
/* "capnp.pyx":58
|
|
* STRUCT = capnp.TYPE_STRUCT,
|
|
* UNION = capnp.TYPE_UNION,
|
|
* INTERFACE = capnp.TYPE_INTERFACE, # <<<<<<<<<<<<<<
|
|
* OBJECT = capnp.TYPE_OBJECT)
|
|
*
|
|
*/
|
|
__pyx_t_3 = PyInt_FromLong( ::capnp::DynamicValue::INTERFACE); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 58; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
|
|
__Pyx_GOTREF(__pyx_t_3);
|
|
if (PyDict_SetItem(__pyx_t_2, ((PyObject *)__pyx_n_s__INTERFACE), __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 45; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
|
|
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
|
|
|
|
/* "capnp.pyx":59
|
|
* UNION = capnp.TYPE_UNION,
|
|
* INTERFACE = capnp.TYPE_INTERFACE,
|
|
* OBJECT = capnp.TYPE_OBJECT) # <<<<<<<<<<<<<<
|
|
*
|
|
* cdef extern from "capnp/list.h" namespace " ::capnp":
|
|
*/
|
|
__pyx_t_3 = PyInt_FromLong( ::capnp::DynamicValue::OBJECT); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 59; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
|
|
__Pyx_GOTREF(__pyx_t_3);
|
|
if (PyDict_SetItem(__pyx_t_2, ((PyObject *)__pyx_n_s__OBJECT), __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 45; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
|
|
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
|
|
__pyx_t_3 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_k_tuple_50), ((PyObject *)__pyx_t_2)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 45; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
|
|
__Pyx_GOTREF(__pyx_t_3);
|
|
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
|
|
__Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
|
|
if (PyDict_SetItem(__pyx_d, __pyx_n_s___Type, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 45; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
|
|
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
|
|
|
|
/* "capnp.pyx":107
|
|
* return toPython(temp)
|
|
*
|
|
* def _setitem(self, index, valid_values value): # <<<<<<<<<<<<<<
|
|
* cdef C_DynamicValue.Reader temp = C_DynamicValue.Reader(value)
|
|
* self.thisptr.set(index, temp)
|
|
*/
|
|
__pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 107; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
|
|
__Pyx_GOTREF(((PyObject *)__pyx_t_3));
|
|
__pyx_t_2 = __pyx_FusedFunction_NewEx(&__pyx_fuse_0__pyx_mdef_5capnp_19_DynamicListBuilder_9_setitem, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_53, NULL, __pyx_n_s__capnp, ((PyObject *)__pyx_k_codeobj_52)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 107; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
|
|
__Pyx_GOTREF(__pyx_t_2);
|
|
__Pyx_CyFunction_SetDefaultsTuple(__pyx_t_2, ((PyObject *)__pyx_empty_tuple));
|
|
if (PyDict_SetItem(__pyx_t_3, ((PyObject *)__pyx_n_s__int), __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 107; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
|
|
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
|
|
__pyx_t_2 = __pyx_FusedFunction_NewEx(&__pyx_fuse_1__pyx_mdef_5capnp_19_DynamicListBuilder_11_setitem, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_53, NULL, __pyx_n_s__capnp, ((PyObject *)__pyx_k_codeobj_52)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 107; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
|
|
__Pyx_GOTREF(__pyx_t_2);
|
|
__Pyx_CyFunction_SetDefaultsTuple(__pyx_t_2, ((PyObject *)__pyx_empty_tuple));
|
|
if (PyDict_SetItem(__pyx_t_3, ((PyObject *)__pyx_n_s__long), __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 107; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
|
|
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
|
|
__pyx_t_2 = __pyx_FusedFunction_NewEx(&__pyx_fuse_2__pyx_mdef_5capnp_19_DynamicListBuilder_13_setitem, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_53, NULL, __pyx_n_s__capnp, ((PyObject *)__pyx_k_codeobj_52)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 107; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
|
|
__Pyx_GOTREF(__pyx_t_2);
|
|
__Pyx_CyFunction_SetDefaultsTuple(__pyx_t_2, ((PyObject *)__pyx_empty_tuple));
|
|
if (PyDict_SetItem(__pyx_t_3, ((PyObject *)__pyx_n_s__float), __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 107; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
|
|
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
|
|
__pyx_t_2 = __pyx_FusedFunction_NewEx(&__pyx_fuse_3__pyx_mdef_5capnp_19_DynamicListBuilder_15_setitem, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_53, NULL, __pyx_n_s__capnp, ((PyObject *)__pyx_k_codeobj_52)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 107; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
|
|
__Pyx_GOTREF(__pyx_t_2);
|
|
__Pyx_CyFunction_SetDefaultsTuple(__pyx_t_2, ((PyObject *)__pyx_empty_tuple));
|
|
if (PyDict_SetItem(__pyx_t_3, ((PyObject *)__pyx_n_s__double), __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 107; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
|
|
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
|
|
__pyx_t_2 = __pyx_FusedFunction_NewEx(&__pyx_fuse_4__pyx_mdef_5capnp_19_DynamicListBuilder_17_setitem, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_53, NULL, __pyx_n_s__capnp, ((PyObject *)__pyx_k_codeobj_52)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 107; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
|
|
__Pyx_GOTREF(__pyx_t_2);
|
|
__Pyx_CyFunction_SetDefaultsTuple(__pyx_t_2, ((PyObject *)__pyx_empty_tuple));
|
|
if (PyDict_SetItem(__pyx_t_3, ((PyObject *)__pyx_n_s__bint), __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 107; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
|
|
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
|
|
__pyx_t_2 = __pyx_FusedFunction_NewEx(&__pyx_fuse_5__pyx_mdef_5capnp_19_DynamicListBuilder_19_setitem, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_53, NULL, __pyx_n_s__capnp, ((PyObject *)__pyx_k_codeobj_52)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 107; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
|
|
__Pyx_GOTREF(__pyx_t_2);
|
|
__Pyx_CyFunction_SetDefaultsTuple(__pyx_t_2, ((PyObject *)__pyx_empty_tuple));
|
|
if (PyDict_SetItem(__pyx_t_3, ((PyObject *)__pyx_kp_s_5), __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 107; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
|
|
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
|
|
__pyx_t_2 = __pyx_FusedFunction_NewEx(&__pyx_mdef_5capnp_19_DynamicListBuilder_3_setitem, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_53, NULL, __pyx_n_s__capnp, ((PyObject *)__pyx_k_codeobj_52)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 107; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
|
|
__Pyx_GOTREF(__pyx_t_2);
|
|
__Pyx_CyFunction_SetDefaultsTuple(__pyx_t_2, ((PyObject *)__pyx_empty_tuple));
|
|
((__pyx_FusedFunctionObject *) __pyx_t_2)->__signatures__ = __pyx_t_3;
|
|
__Pyx_GIVEREF(__pyx_t_3);
|
|
if (PyDict_SetItem((PyObject *)__pyx_ptype_5capnp__DynamicListBuilder->tp_dict, __pyx_n_s___setitem, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 107; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
|
|
PyType_Modified(__pyx_ptype_5capnp__DynamicListBuilder);
|
|
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
|
|
|
|
/* "capnp.pyx":494
|
|
* self.thisptr = new schema_cpp.PackedFdMessageReader(fd)
|
|
*
|
|
* def writeMessageToFd(int fd, MessageBuilder m): # <<<<<<<<<<<<<<
|
|
* schema_cpp.writeMessageToFd(fd, deref(m.thisptr))
|
|
* def writePackedMessageToFd(int fd, MessageBuilder m):
|
|
*/
|
|
__pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_5capnp_3writeMessageToFd, NULL, __pyx_n_s__capnp); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 494; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
|
|
__Pyx_GOTREF(__pyx_t_1);
|
|
if (PyDict_SetItem(__pyx_d, __pyx_n_s__writeMessageToFd, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 494; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
|
|
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
|
|
|
|
/* "capnp.pyx":496
|
|
* def writeMessageToFd(int fd, MessageBuilder m):
|
|
* schema_cpp.writeMessageToFd(fd, deref(m.thisptr))
|
|
* def writePackedMessageToFd(int fd, MessageBuilder m): # <<<<<<<<<<<<<<
|
|
* schema_cpp.writePackedMessageToFd(fd, deref(m.thisptr))
|
|
*
|
|
*/
|
|
__pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_5capnp_5writePackedMessageToFd, NULL, __pyx_n_s__capnp); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 496; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
|
|
__Pyx_GOTREF(__pyx_t_1);
|
|
if (PyDict_SetItem(__pyx_d, __pyx_n_s_58, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 496; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
|
|
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
|
|
|
|
/* "capnp.pyx":499
|
|
* schema_cpp.writePackedMessageToFd(fd, deref(m.thisptr))
|
|
*
|
|
* def capitalize(s): # <<<<<<<<<<<<<<
|
|
* if len(s) < 2:
|
|
* return s
|
|
*/
|
|
__pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_5capnp_7capitalize, NULL, __pyx_n_s__capnp); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 499; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
|
|
__Pyx_GOTREF(__pyx_t_1);
|
|
if (PyDict_SetItem(__pyx_d, __pyx_n_s__capitalize, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 499; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
|
|
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
|
|
|
|
/* "capnp.pyx":503
|
|
* return s
|
|
* return s[0].upper() + s[1:]
|
|
* def upper_and_under(s): # <<<<<<<<<<<<<<
|
|
* if len(s) < 2:
|
|
* return s
|
|
*/
|
|
__pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_5capnp_9upper_and_under, NULL, __pyx_n_s__capnp); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 503; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
|
|
__Pyx_GOTREF(__pyx_t_1);
|
|
if (PyDict_SetItem(__pyx_d, __pyx_n_s__upper_and_under, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 503; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
|
|
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
|
|
|
|
/* "capnp.pyx":513
|
|
* return ''.join(ret).upper()
|
|
*
|
|
* from types import ModuleType # <<<<<<<<<<<<<<
|
|
* import re
|
|
* import schema
|
|
*/
|
|
__pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 513; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
|
|
__Pyx_GOTREF(__pyx_t_1);
|
|
__Pyx_INCREF(((PyObject *)__pyx_n_s__ModuleType));
|
|
PyList_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_n_s__ModuleType));
|
|
__Pyx_GIVEREF(((PyObject *)__pyx_n_s__ModuleType));
|
|
__pyx_t_4 = __Pyx_Import(((PyObject *)__pyx_n_s__types), ((PyObject *)__pyx_t_1), -1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 513; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
|
|
__Pyx_GOTREF(__pyx_t_4);
|
|
__Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
|
|
__pyx_t_1 = __Pyx_ImportFrom(__pyx_t_4, __pyx_n_s__ModuleType); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 513; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
|
|
__Pyx_GOTREF(__pyx_t_1);
|
|
if (PyDict_SetItem(__pyx_d, __pyx_n_s__ModuleType, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 513; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
|
|
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
|
|
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
|
|
|
|
/* "capnp.pyx":514
|
|
*
|
|
* from types import ModuleType
|
|
* import re # <<<<<<<<<<<<<<
|
|
* import schema
|
|
* import subprocess
|
|
*/
|
|
__pyx_t_4 = __Pyx_Import(((PyObject *)__pyx_n_s__re), 0, -1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 514; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
|
|
__Pyx_GOTREF(__pyx_t_4);
|
|
if (PyDict_SetItem(__pyx_d, __pyx_n_s__re, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 514; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
|
|
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
|
|
|
|
/* "capnp.pyx":515
|
|
* from types import ModuleType
|
|
* import re
|
|
* import schema # <<<<<<<<<<<<<<
|
|
* import subprocess
|
|
*
|
|
*/
|
|
__pyx_t_4 = __Pyx_Import(((PyObject *)__pyx_n_s__schema), 0, -1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 515; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
|
|
__Pyx_GOTREF(__pyx_t_4);
|
|
if (PyDict_SetItem(__pyx_d, __pyx_n_s__schema, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 515; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
|
|
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
|
|
|
|
/* "capnp.pyx":516
|
|
* import re
|
|
* import schema
|
|
* import subprocess # <<<<<<<<<<<<<<
|
|
*
|
|
* def _load(module, node, loader, name, isUnion = False):
|
|
*/
|
|
__pyx_t_4 = __Pyx_Import(((PyObject *)__pyx_n_s__subprocess), 0, -1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 516; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
|
|
__Pyx_GOTREF(__pyx_t_4);
|
|
if (PyDict_SetItem(__pyx_d, __pyx_n_s__subprocess, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 516; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
|
|
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
|
|
|
|
/* "capnp.pyx":518
|
|
* import subprocess
|
|
*
|
|
* def _load(module, node, loader, name, isUnion = False): # <<<<<<<<<<<<<<
|
|
* if name is None or len(name) == 0:
|
|
* return
|
|
*/
|
|
__pyx_t_4 = __Pyx_PyBool_FromLong(0); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 518; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
|
|
__Pyx_GOTREF(__pyx_t_4);
|
|
__pyx_k_36 = __pyx_t_4;
|
|
__Pyx_GIVEREF(__pyx_t_4);
|
|
__pyx_t_4 = 0;
|
|
__pyx_t_4 = PyCFunction_NewEx(&__pyx_mdef_5capnp_11_load, NULL, __pyx_n_s__capnp); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 518; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
|
|
__Pyx_GOTREF(__pyx_t_4);
|
|
if (PyDict_SetItem(__pyx_d, __pyx_n_s___load, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 518; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
|
|
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
|
|
|
|
/* "capnp.pyx":555
|
|
* return local_module
|
|
*
|
|
* def load(file_name, cat_path='/bin/cat'): # <<<<<<<<<<<<<<
|
|
* p = subprocess.Popen(['capnpc', '-o'+cat_path, file_name], stdout=subprocess.PIPE)
|
|
* retcode = p.wait()
|
|
*/
|
|
__pyx_t_4 = PyCFunction_NewEx(&__pyx_mdef_5capnp_13load, NULL, __pyx_n_s__capnp); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 555; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
|
|
__Pyx_GOTREF(__pyx_t_4);
|
|
if (PyDict_SetItem(__pyx_d, __pyx_n_s__load, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 555; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
|
|
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
|
|
|
|
/* "capnp.pyx":1
|
|
* # capnp.pyx # <<<<<<<<<<<<<<
|
|
* # distutils: language = c++
|
|
* # distutils: extra_compile_args = --std=c++11
|
|
*/
|
|
__pyx_t_4 = PyDict_New(); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
|
|
__Pyx_GOTREF(((PyObject *)__pyx_t_4));
|
|
if (PyDict_SetItem(__pyx_d, __pyx_n_s____test__, ((PyObject *)__pyx_t_4)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
|
|
__Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
|
|
goto __pyx_L0;
|
|
__pyx_L1_error:;
|
|
__Pyx_XDECREF(__pyx_t_1);
|
|
__Pyx_XDECREF(__pyx_t_2);
|
|
__Pyx_XDECREF(__pyx_t_3);
|
|
__Pyx_XDECREF(__pyx_t_4);
|
|
if (__pyx_m) {
|
|
__Pyx_AddTraceback("init capnp", __pyx_clineno, __pyx_lineno, __pyx_filename);
|
|
Py_DECREF(__pyx_m); __pyx_m = 0;
|
|
} else if (!PyErr_Occurred()) {
|
|
PyErr_SetString(PyExc_ImportError, "init capnp");
|
|
}
|
|
__pyx_L0:;
|
|
__Pyx_RefNannyFinishContext();
|
|
#if PY_MAJOR_VERSION < 3
|
|
return;
|
|
#else
|
|
return __pyx_m;
|
|
#endif
|
|
}
|
|
|
|
/* 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_GetBuiltinName(PyObject *name) {
|
|
PyObject* result = __Pyx_PyObject_GetAttrStr(__pyx_b, name);
|
|
if (unlikely(!result)) {
|
|
PyErr_Format(PyExc_NameError,
|
|
#if PY_MAJOR_VERSION >= 3
|
|
"name '%U' is not defined", name);
|
|
#else
|
|
"name '%s' is not defined", PyString_AS_STRING(name));
|
|
#endif
|
|
}
|
|
return result;
|
|
}
|
|
|
|
static void __Pyx_RaiseDoubleKeywordsError(
|
|
const char* func_name,
|
|
PyObject* kw_name)
|
|
{
|
|
PyErr_Format(PyExc_TypeError,
|
|
#if PY_MAJOR_VERSION >= 3
|
|
"%s() got multiple values for keyword argument '%U'", func_name, kw_name);
|
|
#else
|
|
"%s() got multiple values for keyword argument '%s'", func_name,
|
|
PyString_AsString(kw_name));
|
|
#endif
|
|
}
|
|
|
|
static int __Pyx_ParseOptionalKeywords(
|
|
PyObject *kwds,
|
|
PyObject **argnames[],
|
|
PyObject *kwds2,
|
|
PyObject *values[],
|
|
Py_ssize_t num_pos_args,
|
|
const char* function_name)
|
|
{
|
|
PyObject *key = 0, *value = 0;
|
|
Py_ssize_t pos = 0;
|
|
PyObject*** name;
|
|
PyObject*** first_kw_arg = argnames + num_pos_args;
|
|
while (PyDict_Next(kwds, &pos, &key, &value)) {
|
|
name = first_kw_arg;
|
|
while (*name && (**name != key)) name++;
|
|
if (*name) {
|
|
values[name-argnames] = value;
|
|
continue;
|
|
}
|
|
name = first_kw_arg;
|
|
#if PY_MAJOR_VERSION < 3
|
|
if (likely(PyString_CheckExact(key)) || likely(PyString_Check(key))) {
|
|
while (*name) {
|
|
if ((CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**name) == PyString_GET_SIZE(key))
|
|
&& _PyString_Eq(**name, key)) {
|
|
values[name-argnames] = value;
|
|
break;
|
|
}
|
|
name++;
|
|
}
|
|
if (*name) continue;
|
|
else {
|
|
PyObject*** argname = argnames;
|
|
while (argname != first_kw_arg) {
|
|
if ((**argname == key) || (
|
|
(CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**argname) == PyString_GET_SIZE(key))
|
|
&& _PyString_Eq(**argname, key))) {
|
|
goto arg_passed_twice;
|
|
}
|
|
argname++;
|
|
}
|
|
}
|
|
} else
|
|
#endif
|
|
if (likely(PyUnicode_Check(key))) {
|
|
while (*name) {
|
|
int cmp = (**name == key) ? 0 :
|
|
#if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3
|
|
(PyUnicode_GET_SIZE(**name) != PyUnicode_GET_SIZE(key)) ? 1 :
|
|
#endif
|
|
PyUnicode_Compare(**name, key);
|
|
if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad;
|
|
if (cmp == 0) {
|
|
values[name-argnames] = value;
|
|
break;
|
|
}
|
|
name++;
|
|
}
|
|
if (*name) continue;
|
|
else {
|
|
PyObject*** argname = argnames;
|
|
while (argname != first_kw_arg) {
|
|
int cmp = (**argname == key) ? 0 :
|
|
#if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3
|
|
(PyUnicode_GET_SIZE(**argname) != PyUnicode_GET_SIZE(key)) ? 1 :
|
|
#endif
|
|
PyUnicode_Compare(**argname, key);
|
|
if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad;
|
|
if (cmp == 0) goto arg_passed_twice;
|
|
argname++;
|
|
}
|
|
}
|
|
} else
|
|
goto invalid_keyword_type;
|
|
if (kwds2) {
|
|
if (unlikely(PyDict_SetItem(kwds2, key, value))) goto bad;
|
|
} else {
|
|
goto invalid_keyword;
|
|
}
|
|
}
|
|
return 0;
|
|
arg_passed_twice:
|
|
__Pyx_RaiseDoubleKeywordsError(function_name, key);
|
|
goto bad;
|
|
invalid_keyword_type:
|
|
PyErr_Format(PyExc_TypeError,
|
|
"%s() keywords must be strings", function_name);
|
|
goto bad;
|
|
invalid_keyword:
|
|
PyErr_Format(PyExc_TypeError,
|
|
#if PY_MAJOR_VERSION < 3
|
|
"%s() got an unexpected keyword argument '%s'",
|
|
function_name, PyString_AsString(key));
|
|
#else
|
|
"%s() got an unexpected keyword argument '%U'",
|
|
function_name, key);
|
|
#endif
|
|
bad:
|
|
return -1;
|
|
}
|
|
|
|
static void __Pyx_RaiseArgtupleInvalid(
|
|
const char* func_name,
|
|
int exact,
|
|
Py_ssize_t num_min,
|
|
Py_ssize_t num_max,
|
|
Py_ssize_t num_found)
|
|
{
|
|
Py_ssize_t num_expected;
|
|
const char *more_or_less;
|
|
if (num_found < num_min) {
|
|
num_expected = num_min;
|
|
more_or_less = "at least";
|
|
} else {
|
|
num_expected = num_max;
|
|
more_or_less = "at most";
|
|
}
|
|
if (exact) {
|
|
more_or_less = "exactly";
|
|
}
|
|
PyErr_Format(PyExc_TypeError,
|
|
"%s() takes %s %" CYTHON_FORMAT_SSIZE_T "d positional argument%s (%" CYTHON_FORMAT_SSIZE_T "d given)",
|
|
func_name, more_or_less, num_expected,
|
|
(num_expected == 1) ? "" : "s", num_found);
|
|
}
|
|
|
|
static CYTHON_INLINE int __Pyx_IterFinish(void) {
|
|
#if CYTHON_COMPILING_IN_CPYTHON
|
|
PyThreadState *tstate = PyThreadState_GET();
|
|
PyObject* exc_type = tstate->curexc_type;
|
|
if (unlikely(exc_type)) {
|
|
if (likely(exc_type == PyExc_StopIteration) || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration)) {
|
|
PyObject *exc_value, *exc_tb;
|
|
exc_value = tstate->curexc_value;
|
|
exc_tb = tstate->curexc_traceback;
|
|
tstate->curexc_type = 0;
|
|
tstate->curexc_value = 0;
|
|
tstate->curexc_traceback = 0;
|
|
Py_DECREF(exc_type);
|
|
Py_XDECREF(exc_value);
|
|
Py_XDECREF(exc_tb);
|
|
return 0;
|
|
} else {
|
|
return -1;
|
|
}
|
|
}
|
|
return 0;
|
|
#else
|
|
if (unlikely(PyErr_Occurred())) {
|
|
if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) {
|
|
PyErr_Clear();
|
|
return 0;
|
|
} else {
|
|
return -1;
|
|
}
|
|
}
|
|
return 0;
|
|
#endif
|
|
}
|
|
|
|
static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected) {
|
|
PyErr_Format(PyExc_ValueError,
|
|
"too many values to unpack (expected %" CYTHON_FORMAT_SSIZE_T "d)", expected);
|
|
}
|
|
|
|
static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index) {
|
|
PyErr_Format(PyExc_ValueError,
|
|
"need more than %" CYTHON_FORMAT_SSIZE_T "d value%s to unpack",
|
|
index, (index == 1) ? "" : "s");
|
|
}
|
|
|
|
static CYTHON_INLINE void __Pyx_RaiseNoneNotIterableError(void) {
|
|
PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable");
|
|
}
|
|
|
|
static void __Pyx_UnpackTupleError(PyObject *t, Py_ssize_t index) {
|
|
if (t == Py_None) {
|
|
__Pyx_RaiseNoneNotIterableError();
|
|
} else if (PyTuple_GET_SIZE(t) < index) {
|
|
__Pyx_RaiseNeedMoreValuesError(PyTuple_GET_SIZE(t));
|
|
} else {
|
|
__Pyx_RaiseTooManyValuesError(index);
|
|
}
|
|
}
|
|
|
|
static int __Pyx_IternextUnpackEndCheck(PyObject *retval, Py_ssize_t expected) {
|
|
if (unlikely(retval)) {
|
|
Py_DECREF(retval);
|
|
__Pyx_RaiseTooManyValuesError(expected);
|
|
return -1;
|
|
} else {
|
|
return __Pyx_IterFinish();
|
|
}
|
|
return 0;
|
|
}
|
|
|
|
static CYTHON_INLINE int __Pyx_unpack_tuple2(PyObject* tuple, PyObject** pvalue1, PyObject** pvalue2,
|
|
int is_tuple, int has_known_size, int decref_tuple) {
|
|
Py_ssize_t index;
|
|
PyObject *value1 = NULL, *value2 = NULL, *iter = NULL;
|
|
if (!is_tuple && unlikely(!PyTuple_Check(tuple))) {
|
|
iternextfunc iternext;
|
|
iter = PyObject_GetIter(tuple);
|
|
if (unlikely(!iter)) goto bad;
|
|
if (decref_tuple) { Py_DECREF(tuple); tuple = NULL; }
|
|
iternext = Py_TYPE(iter)->tp_iternext;
|
|
value1 = iternext(iter); if (unlikely(!value1)) { index = 0; goto unpacking_failed; }
|
|
value2 = iternext(iter); if (unlikely(!value2)) { index = 1; goto unpacking_failed; }
|
|
if (!has_known_size && unlikely(__Pyx_IternextUnpackEndCheck(iternext(iter), 2))) goto bad;
|
|
Py_DECREF(iter);
|
|
} else {
|
|
if (!has_known_size && unlikely(PyTuple_GET_SIZE(tuple) != 2)) {
|
|
__Pyx_UnpackTupleError(tuple, 2);
|
|
goto bad;
|
|
}
|
|
#if CYTHON_COMPILING_IN_PYPY
|
|
value1 = PySequence_ITEM(tuple, 0);
|
|
if (unlikely(!value1)) goto bad;
|
|
value2 = PySequence_ITEM(tuple, 1);
|
|
if (unlikely(!value2)) goto bad;
|
|
#else
|
|
value1 = PyTuple_GET_ITEM(tuple, 0);
|
|
value2 = PyTuple_GET_ITEM(tuple, 1);
|
|
Py_INCREF(value1);
|
|
Py_INCREF(value2);
|
|
#endif
|
|
if (decref_tuple) { Py_DECREF(tuple); }
|
|
}
|
|
*pvalue1 = value1;
|
|
*pvalue2 = value2;
|
|
return 0;
|
|
unpacking_failed:
|
|
if (!has_known_size && __Pyx_IterFinish() == 0)
|
|
__Pyx_RaiseNeedMoreValuesError(index);
|
|
bad:
|
|
Py_XDECREF(iter);
|
|
Py_XDECREF(value1);
|
|
Py_XDECREF(value2);
|
|
if (decref_tuple) { Py_XDECREF(tuple); }
|
|
return -1;
|
|
}
|
|
|
|
static CYTHON_INLINE PyObject* __Pyx_dict_iterator(PyObject* iterable, int is_dict, PyObject* method_name,
|
|
Py_ssize_t* p_orig_length, int* p_source_is_dict) {
|
|
is_dict = is_dict || likely(PyDict_CheckExact(iterable));
|
|
*p_source_is_dict = is_dict;
|
|
#if !CYTHON_COMPILING_IN_PYPY
|
|
if (is_dict) {
|
|
*p_orig_length = PyDict_Size(iterable);
|
|
Py_INCREF(iterable);
|
|
return iterable;
|
|
}
|
|
#endif
|
|
*p_orig_length = 0;
|
|
if (method_name) {
|
|
PyObject* iter;
|
|
iterable = __Pyx_PyObject_CallMethod0(iterable, method_name);
|
|
if (!iterable)
|
|
return NULL;
|
|
#if !CYTHON_COMPILING_IN_PYPY
|
|
if (PyTuple_CheckExact(iterable) || PyList_CheckExact(iterable))
|
|
return iterable;
|
|
#endif
|
|
iter = PyObject_GetIter(iterable);
|
|
Py_DECREF(iterable);
|
|
return iter;
|
|
}
|
|
return PyObject_GetIter(iterable);
|
|
}
|
|
static CYTHON_INLINE int __Pyx_dict_iter_next(PyObject* iter_obj, Py_ssize_t orig_length, Py_ssize_t* ppos,
|
|
PyObject** pkey, PyObject** pvalue, PyObject** pitem, int source_is_dict) {
|
|
PyObject* next_item;
|
|
#if !CYTHON_COMPILING_IN_PYPY
|
|
if (source_is_dict) {
|
|
PyObject *key, *value;
|
|
if (unlikely(orig_length != PyDict_Size(iter_obj))) {
|
|
PyErr_SetString(PyExc_RuntimeError, "dictionary changed size during iteration");
|
|
return -1;
|
|
}
|
|
if (unlikely(!PyDict_Next(iter_obj, ppos, &key, &value))) {
|
|
return 0;
|
|
}
|
|
if (pitem) {
|
|
PyObject* tuple = PyTuple_New(2);
|
|
if (unlikely(!tuple)) {
|
|
return -1;
|
|
}
|
|
Py_INCREF(key);
|
|
Py_INCREF(value);
|
|
PyTuple_SET_ITEM(tuple, 0, key);
|
|
PyTuple_SET_ITEM(tuple, 1, value);
|
|
*pitem = tuple;
|
|
} else {
|
|
if (pkey) {
|
|
Py_INCREF(key);
|
|
*pkey = key;
|
|
}
|
|
if (pvalue) {
|
|
Py_INCREF(value);
|
|
*pvalue = value;
|
|
}
|
|
}
|
|
return 1;
|
|
} else if (PyTuple_CheckExact(iter_obj)) {
|
|
Py_ssize_t pos = *ppos;
|
|
if (unlikely(pos >= PyTuple_GET_SIZE(iter_obj))) return 0;
|
|
*ppos = pos + 1;
|
|
next_item = PyTuple_GET_ITEM(iter_obj, pos);
|
|
Py_INCREF(next_item);
|
|
} else if (PyList_CheckExact(iter_obj)) {
|
|
Py_ssize_t pos = *ppos;
|
|
if (unlikely(pos >= PyList_GET_SIZE(iter_obj))) return 0;
|
|
*ppos = pos + 1;
|
|
next_item = PyList_GET_ITEM(iter_obj, pos);
|
|
Py_INCREF(next_item);
|
|
} else
|
|
#endif
|
|
{
|
|
next_item = PyIter_Next(iter_obj);
|
|
if (unlikely(!next_item)) {
|
|
return __Pyx_IterFinish();
|
|
}
|
|
}
|
|
if (pitem) {
|
|
*pitem = next_item;
|
|
} else if (pkey && pvalue) {
|
|
if (__Pyx_unpack_tuple2(next_item, pkey, pvalue, source_is_dict, source_is_dict, 1))
|
|
return -1;
|
|
} else if (pkey) {
|
|
*pkey = next_item;
|
|
} else {
|
|
*pvalue = next_item;
|
|
}
|
|
return 1;
|
|
}
|
|
|
|
static CYTHON_INLINE void __Pyx_RaiseClosureNameError(const char *varname) {
|
|
PyErr_Format(PyExc_NameError, "free variable '%s' referenced before assignment in enclosing scope", varname);
|
|
}
|
|
|
|
static CYTHON_INLINE void __Pyx_ErrRestore(PyObject *type, PyObject *value, PyObject *tb) {
|
|
#if CYTHON_COMPILING_IN_CPYTHON
|
|
PyObject *tmp_type, *tmp_value, *tmp_tb;
|
|
PyThreadState *tstate = PyThreadState_GET();
|
|
tmp_type = tstate->curexc_type;
|
|
tmp_value = tstate->curexc_value;
|
|
tmp_tb = tstate->curexc_traceback;
|
|
tstate->curexc_type = type;
|
|
tstate->curexc_value = value;
|
|
tstate->curexc_traceback = tb;
|
|
Py_XDECREF(tmp_type);
|
|
Py_XDECREF(tmp_value);
|
|
Py_XDECREF(tmp_tb);
|
|
#else
|
|
PyErr_Restore(type, value, tb);
|
|
#endif
|
|
}
|
|
static CYTHON_INLINE void __Pyx_ErrFetch(PyObject **type, PyObject **value, PyObject **tb) {
|
|
#if CYTHON_COMPILING_IN_CPYTHON
|
|
PyThreadState *tstate = PyThreadState_GET();
|
|
*type = tstate->curexc_type;
|
|
*value = tstate->curexc_value;
|
|
*tb = tstate->curexc_traceback;
|
|
tstate->curexc_type = 0;
|
|
tstate->curexc_value = 0;
|
|
tstate->curexc_traceback = 0;
|
|
#else
|
|
PyErr_Fetch(type, value, tb);
|
|
#endif
|
|
}
|
|
|
|
#if PY_MAJOR_VERSION < 3
|
|
static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb,
|
|
CYTHON_UNUSED PyObject *cause) {
|
|
Py_XINCREF(type);
|
|
if (!value || value == Py_None)
|
|
value = NULL;
|
|
else
|
|
Py_INCREF(value);
|
|
if (!tb || tb == Py_None)
|
|
tb = NULL;
|
|
else {
|
|
Py_INCREF(tb);
|
|
if (!PyTraceBack_Check(tb)) {
|
|
PyErr_SetString(PyExc_TypeError,
|
|
"raise: arg 3 must be a traceback or None");
|
|
goto raise_error;
|
|
}
|
|
}
|
|
#if PY_VERSION_HEX < 0x02050000
|
|
if (PyClass_Check(type)) {
|
|
#else
|
|
if (PyType_Check(type)) {
|
|
#endif
|
|
#if CYTHON_COMPILING_IN_PYPY
|
|
if (!value) {
|
|
Py_INCREF(Py_None);
|
|
value = Py_None;
|
|
}
|
|
#endif
|
|
PyErr_NormalizeException(&type, &value, &tb);
|
|
} else {
|
|
if (value) {
|
|
PyErr_SetString(PyExc_TypeError,
|
|
"instance exception may not have a separate value");
|
|
goto raise_error;
|
|
}
|
|
value = type;
|
|
#if PY_VERSION_HEX < 0x02050000
|
|
if (PyInstance_Check(type)) {
|
|
type = (PyObject*) ((PyInstanceObject*)type)->in_class;
|
|
Py_INCREF(type);
|
|
} else {
|
|
type = 0;
|
|
PyErr_SetString(PyExc_TypeError,
|
|
"raise: exception must be an old-style class or instance");
|
|
goto raise_error;
|
|
}
|
|
#else
|
|
type = (PyObject*) Py_TYPE(type);
|
|
Py_INCREF(type);
|
|
if (!PyType_IsSubtype((PyTypeObject *)type, (PyTypeObject *)PyExc_BaseException)) {
|
|
PyErr_SetString(PyExc_TypeError,
|
|
"raise: exception class must be a subclass of BaseException");
|
|
goto raise_error;
|
|
}
|
|
#endif
|
|
}
|
|
__Pyx_ErrRestore(type, value, tb);
|
|
return;
|
|
raise_error:
|
|
Py_XDECREF(value);
|
|
Py_XDECREF(type);
|
|
Py_XDECREF(tb);
|
|
return;
|
|
}
|
|
#else /* Python 3+ */
|
|
static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause) {
|
|
PyObject* owned_instance = NULL;
|
|
if (tb == Py_None) {
|
|
tb = 0;
|
|
} else if (tb && !PyTraceBack_Check(tb)) {
|
|
PyErr_SetString(PyExc_TypeError,
|
|
"raise: arg 3 must be a traceback or None");
|
|
goto bad;
|
|
}
|
|
if (value == Py_None)
|
|
value = 0;
|
|
if (PyExceptionInstance_Check(type)) {
|
|
if (value) {
|
|
PyErr_SetString(PyExc_TypeError,
|
|
"instance exception may not have a separate value");
|
|
goto bad;
|
|
}
|
|
value = type;
|
|
type = (PyObject*) Py_TYPE(value);
|
|
} else if (PyExceptionClass_Check(type)) {
|
|
PyObject *args;
|
|
if (!value)
|
|
args = PyTuple_New(0);
|
|
else if (PyTuple_Check(value)) {
|
|
Py_INCREF(value);
|
|
args = value;
|
|
} else
|
|
args = PyTuple_Pack(1, value);
|
|
if (!args)
|
|
goto bad;
|
|
owned_instance = PyEval_CallObject(type, args);
|
|
Py_DECREF(args);
|
|
if (!owned_instance)
|
|
goto bad;
|
|
value = owned_instance;
|
|
if (!PyExceptionInstance_Check(value)) {
|
|
PyErr_Format(PyExc_TypeError,
|
|
"calling %R should have returned an instance of "
|
|
"BaseException, not %R",
|
|
type, Py_TYPE(value));
|
|
goto bad;
|
|
}
|
|
} else {
|
|
PyErr_SetString(PyExc_TypeError,
|
|
"raise: exception class must be a subclass of BaseException");
|
|
goto bad;
|
|
}
|
|
#if PY_VERSION_HEX >= 0x03030000
|
|
if (cause) {
|
|
#else
|
|
if (cause && cause != Py_None) {
|
|
#endif
|
|
PyObject *fixed_cause;
|
|
if (cause == Py_None) {
|
|
fixed_cause = NULL;
|
|
} else 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;
|
|
}
|
|
PyException_SetCause(value, fixed_cause);
|
|
}
|
|
PyErr_SetObject(type, value);
|
|
if (tb) {
|
|
PyThreadState *tstate = PyThreadState_GET();
|
|
PyObject* tmp_tb = tstate->curexc_traceback;
|
|
if (tb != tmp_tb) {
|
|
Py_INCREF(tb);
|
|
tstate->curexc_traceback = tb;
|
|
Py_XDECREF(tmp_tb);
|
|
}
|
|
}
|
|
bad:
|
|
Py_XDECREF(owned_instance);
|
|
return;
|
|
}
|
|
#endif
|
|
|
|
static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j) {
|
|
PyObject *r;
|
|
if (!j) return NULL;
|
|
r = PyObject_GetItem(o, j);
|
|
Py_DECREF(j);
|
|
return r;
|
|
}
|
|
static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i,
|
|
int wraparound, int boundscheck) {
|
|
#if CYTHON_COMPILING_IN_CPYTHON
|
|
if (wraparound & unlikely(i < 0)) i += PyList_GET_SIZE(o);
|
|
if ((!boundscheck) || likely((0 <= i) & (i < PyList_GET_SIZE(o)))) {
|
|
PyObject *r = PyList_GET_ITEM(o, i);
|
|
Py_INCREF(r);
|
|
return r;
|
|
}
|
|
return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i));
|
|
#else
|
|
return PySequence_GetItem(o, i);
|
|
#endif
|
|
}
|
|
static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i,
|
|
int wraparound, int boundscheck) {
|
|
#if CYTHON_COMPILING_IN_CPYTHON
|
|
if (wraparound & unlikely(i < 0)) i += PyTuple_GET_SIZE(o);
|
|
if ((!boundscheck) || likely((0 <= i) & (i < PyTuple_GET_SIZE(o)))) {
|
|
PyObject *r = PyTuple_GET_ITEM(o, i);
|
|
Py_INCREF(r);
|
|
return r;
|
|
}
|
|
return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i));
|
|
#else
|
|
return PySequence_GetItem(o, i);
|
|
#endif
|
|
}
|
|
static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i,
|
|
int is_list, int wraparound, int boundscheck) {
|
|
#if CYTHON_COMPILING_IN_CPYTHON
|
|
if (is_list || PyList_CheckExact(o)) {
|
|
Py_ssize_t n = ((!wraparound) | likely(i >= 0)) ? i : i + PyList_GET_SIZE(o);
|
|
if ((!boundscheck) || (likely((n >= 0) & (n < PyList_GET_SIZE(o))))) {
|
|
PyObject *r = PyList_GET_ITEM(o, n);
|
|
Py_INCREF(r);
|
|
return r;
|
|
}
|
|
}
|
|
else if (PyTuple_CheckExact(o)) {
|
|
Py_ssize_t n = ((!wraparound) | likely(i >= 0)) ? i : i + PyTuple_GET_SIZE(o);
|
|
if ((!boundscheck) || likely((n >= 0) & (n < PyTuple_GET_SIZE(o)))) {
|
|
PyObject *r = PyTuple_GET_ITEM(o, n);
|
|
Py_INCREF(r);
|
|
return r;
|
|
}
|
|
} else {
|
|
PySequenceMethods *m = Py_TYPE(o)->tp_as_sequence;
|
|
if (likely(m && m->sq_item)) {
|
|
if (wraparound && unlikely(i < 0) && likely(m->sq_length)) {
|
|
Py_ssize_t l = m->sq_length(o);
|
|
if (likely(l >= 0)) {
|
|
i += l;
|
|
} else {
|
|
if (PyErr_ExceptionMatches(PyExc_OverflowError))
|
|
PyErr_Clear();
|
|
else
|
|
return NULL;
|
|
}
|
|
}
|
|
return m->sq_item(o, i);
|
|
}
|
|
}
|
|
#else
|
|
if (is_list || PySequence_Check(o)) {
|
|
return PySequence_GetItem(o, i);
|
|
}
|
|
#endif
|
|
return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i));
|
|
}
|
|
|
|
static CYTHON_INLINE int __Pyx_SetItemInt_Generic(PyObject *o, PyObject *j, PyObject *v) {
|
|
int r;
|
|
if (!j) return -1;
|
|
r = PyObject_SetItem(o, j, v);
|
|
Py_DECREF(j);
|
|
return r;
|
|
}
|
|
static CYTHON_INLINE int __Pyx_SetItemInt_Fast(PyObject *o, Py_ssize_t i, PyObject *v,
|
|
int is_list, int wraparound, int boundscheck) {
|
|
#if CYTHON_COMPILING_IN_CPYTHON
|
|
if (is_list || PyList_CheckExact(o)) {
|
|
Py_ssize_t n = (!wraparound) ? i : ((likely(i >= 0)) ? i : i + PyList_GET_SIZE(o));
|
|
if ((!boundscheck) || likely((n >= 0) & (n < PyList_GET_SIZE(o)))) {
|
|
PyObject* old = PyList_GET_ITEM(o, n);
|
|
Py_INCREF(v);
|
|
PyList_SET_ITEM(o, n, v);
|
|
Py_DECREF(old);
|
|
return 1;
|
|
}
|
|
} else {
|
|
PySequenceMethods *m = Py_TYPE(o)->tp_as_sequence;
|
|
if (likely(m && m->sq_ass_item)) {
|
|
if (wraparound && unlikely(i < 0) && likely(m->sq_length)) {
|
|
Py_ssize_t l = m->sq_length(o);
|
|
if (likely(l >= 0)) {
|
|
i += l;
|
|
} else {
|
|
if (PyErr_ExceptionMatches(PyExc_OverflowError))
|
|
PyErr_Clear();
|
|
else
|
|
return -1;
|
|
}
|
|
}
|
|
return m->sq_ass_item(o, i, v);
|
|
}
|
|
}
|
|
#else
|
|
#if CYTHON_COMPILING_IN_PYPY
|
|
if (is_list || (PySequence_Check(o) && !PyDict_Check(o))) {
|
|
#else
|
|
if (is_list || PySequence_Check(o)) {
|
|
#endif
|
|
return PySequence_SetItem(o, i, v);
|
|
}
|
|
#endif
|
|
return __Pyx_SetItemInt_Generic(o, PyInt_FromSsize_t(i), v);
|
|
}
|
|
|
|
static void __Pyx_WriteUnraisable(const char *name, CYTHON_UNUSED int clineno,
|
|
CYTHON_UNUSED int lineno, CYTHON_UNUSED const char *filename) {
|
|
PyObject *old_exc, *old_val, *old_tb;
|
|
PyObject *ctx;
|
|
__Pyx_ErrFetch(&old_exc, &old_val, &old_tb);
|
|
#if PY_MAJOR_VERSION < 3
|
|
ctx = PyString_FromString(name);
|
|
#else
|
|
ctx = PyUnicode_FromString(name);
|
|
#endif
|
|
__Pyx_ErrRestore(old_exc, old_val, old_tb);
|
|
if (!ctx) {
|
|
PyErr_WriteUnraisable(Py_None);
|
|
} else {
|
|
PyErr_WriteUnraisable(ctx);
|
|
Py_DECREF(ctx);
|
|
}
|
|
}
|
|
|
|
static CYTHON_INLINE PyObject *__Pyx_GetModuleGlobalName(PyObject *name) {
|
|
PyObject *result;
|
|
#if CYTHON_COMPILING_IN_CPYTHON
|
|
result = PyDict_GetItem(__pyx_d, name);
|
|
if (result) {
|
|
Py_INCREF(result);
|
|
} else {
|
|
#else
|
|
result = PyObject_GetItem(__pyx_d, name);
|
|
if (!result) {
|
|
PyErr_Clear();
|
|
#endif
|
|
result = __Pyx_GetBuiltinName(name);
|
|
}
|
|
return result;
|
|
}
|
|
|
|
static CYTHON_INLINE PyObject* __Pyx_PyObject_GetSlice(
|
|
PyObject* obj, Py_ssize_t cstart, Py_ssize_t cstop,
|
|
PyObject** _py_start, PyObject** _py_stop, PyObject** _py_slice,
|
|
int has_cstart, int has_cstop, CYTHON_UNUSED int wraparound) {
|
|
#if CYTHON_COMPILING_IN_CPYTHON
|
|
PyMappingMethods* mp;
|
|
#if PY_MAJOR_VERSION < 3
|
|
PySequenceMethods* ms = Py_TYPE(obj)->tp_as_sequence;
|
|
if (likely(ms && ms->sq_slice)) {
|
|
if (!has_cstart) {
|
|
if (_py_start && (*_py_start != Py_None)) {
|
|
cstart = __Pyx_PyIndex_AsSsize_t(*_py_start);
|
|
if ((cstart == (Py_ssize_t)-1) && PyErr_Occurred()) goto bad;
|
|
} else
|
|
cstart = 0;
|
|
}
|
|
if (!has_cstop) {
|
|
if (_py_stop && (*_py_stop != Py_None)) {
|
|
cstop = __Pyx_PyIndex_AsSsize_t(*_py_stop);
|
|
if ((cstop == (Py_ssize_t)-1) && PyErr_Occurred()) goto bad;
|
|
} else
|
|
cstop = PY_SSIZE_T_MAX;
|
|
}
|
|
if (wraparound && unlikely((cstart < 0) | (cstop < 0)) && likely(ms->sq_length)) {
|
|
Py_ssize_t l = ms->sq_length(obj);
|
|
if (likely(l >= 0)) {
|
|
if (cstop < 0) {
|
|
cstop += l;
|
|
if (cstop < 0) cstop = 0;
|
|
}
|
|
if (cstart < 0) {
|
|
cstart += l;
|
|
if (cstart < 0) cstart = 0;
|
|
}
|
|
} else {
|
|
if (PyErr_ExceptionMatches(PyExc_OverflowError))
|
|
PyErr_Clear();
|
|
else
|
|
goto bad;
|
|
}
|
|
}
|
|
return ms->sq_slice(obj, cstart, cstop);
|
|
}
|
|
#endif
|
|
mp = Py_TYPE(obj)->tp_as_mapping;
|
|
if (likely(mp && mp->mp_subscript))
|
|
#endif
|
|
{
|
|
PyObject* result;
|
|
PyObject *py_slice, *py_start, *py_stop;
|
|
if (_py_slice) {
|
|
py_slice = *_py_slice;
|
|
} else {
|
|
PyObject* owned_start = NULL;
|
|
PyObject* owned_stop = NULL;
|
|
if (_py_start) {
|
|
py_start = *_py_start;
|
|
} else {
|
|
if (has_cstart) {
|
|
owned_start = py_start = PyInt_FromSsize_t(cstart);
|
|
if (unlikely(!py_start)) goto bad;
|
|
} else
|
|
py_start = Py_None;
|
|
}
|
|
if (_py_stop) {
|
|
py_stop = *_py_stop;
|
|
} else {
|
|
if (has_cstop) {
|
|
owned_stop = py_stop = PyInt_FromSsize_t(cstop);
|
|
if (unlikely(!py_stop)) {
|
|
Py_XDECREF(owned_start);
|
|
goto bad;
|
|
}
|
|
} else
|
|
py_stop = Py_None;
|
|
}
|
|
py_slice = PySlice_New(py_start, py_stop, Py_None);
|
|
Py_XDECREF(owned_start);
|
|
Py_XDECREF(owned_stop);
|
|
if (unlikely(!py_slice)) goto bad;
|
|
}
|
|
#if CYTHON_COMPILING_IN_CPYTHON
|
|
result = mp->mp_subscript(obj, py_slice);
|
|
#else
|
|
result = PyObject_GetItem(obj, py_slice);
|
|
#endif
|
|
if (!_py_slice) {
|
|
Py_DECREF(py_slice);
|
|
}
|
|
return result;
|
|
}
|
|
PyErr_Format(PyExc_TypeError,
|
|
"'%.200s' object is unsliceable", Py_TYPE(obj)->tp_name);
|
|
bad:
|
|
return NULL;
|
|
}
|
|
|
|
static PyObject *
|
|
__Pyx_CyFunction_get_doc(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *closure)
|
|
{
|
|
if (unlikely(op->func_doc == NULL)) {
|
|
if (op->func.m_ml->ml_doc) {
|
|
#if PY_MAJOR_VERSION >= 3
|
|
op->func_doc = PyUnicode_FromString(op->func.m_ml->ml_doc);
|
|
#else
|
|
op->func_doc = PyString_FromString(op->func.m_ml->ml_doc);
|
|
#endif
|
|
if (unlikely(op->func_doc == NULL))
|
|
return NULL;
|
|
} else {
|
|
Py_INCREF(Py_None);
|
|
return Py_None;
|
|
}
|
|
}
|
|
Py_INCREF(op->func_doc);
|
|
return op->func_doc;
|
|
}
|
|
static int
|
|
__Pyx_CyFunction_set_doc(__pyx_CyFunctionObject *op, PyObject *value)
|
|
{
|
|
PyObject *tmp = op->func_doc;
|
|
if (value == NULL)
|
|
value = Py_None; /* Mark as deleted */
|
|
Py_INCREF(value);
|
|
op->func_doc = value;
|
|
Py_XDECREF(tmp);
|
|
return 0;
|
|
}
|
|
static PyObject *
|
|
__Pyx_CyFunction_get_name(__pyx_CyFunctionObject *op)
|
|
{
|
|
if (unlikely(op->func_name == NULL)) {
|
|
#if PY_MAJOR_VERSION >= 3
|
|
op->func_name = PyUnicode_InternFromString(op->func.m_ml->ml_name);
|
|
#else
|
|
op->func_name = PyString_InternFromString(op->func.m_ml->ml_name);
|
|
#endif
|
|
if (unlikely(op->func_name == NULL))
|
|
return NULL;
|
|
}
|
|
Py_INCREF(op->func_name);
|
|
return op->func_name;
|
|
}
|
|
static int
|
|
__Pyx_CyFunction_set_name(__pyx_CyFunctionObject *op, PyObject *value)
|
|
{
|
|
PyObject *tmp;
|
|
#if PY_MAJOR_VERSION >= 3
|
|
if (unlikely(value == NULL || !PyUnicode_Check(value))) {
|
|
#else
|
|
if (unlikely(value == NULL || !PyString_Check(value))) {
|
|
#endif
|
|
PyErr_SetString(PyExc_TypeError,
|
|
"__name__ must be set to a string object");
|
|
return -1;
|
|
}
|
|
tmp = op->func_name;
|
|
Py_INCREF(value);
|
|
op->func_name = value;
|
|
Py_XDECREF(tmp);
|
|
return 0;
|
|
}
|
|
static PyObject *
|
|
__Pyx_CyFunction_get_qualname(__pyx_CyFunctionObject *op)
|
|
{
|
|
Py_INCREF(op->func_qualname);
|
|
return op->func_qualname;
|
|
}
|
|
static int
|
|
__Pyx_CyFunction_set_qualname(__pyx_CyFunctionObject *op, PyObject *value)
|
|
{
|
|
PyObject *tmp;
|
|
#if PY_MAJOR_VERSION >= 3
|
|
if (unlikely(value == NULL || !PyUnicode_Check(value))) {
|
|
#else
|
|
if (unlikely(value == NULL || !PyString_Check(value))) {
|
|
#endif
|
|
PyErr_SetString(PyExc_TypeError,
|
|
"__qualname__ must be set to a string object");
|
|
return -1;
|
|
}
|
|
tmp = op->func_qualname;
|
|
Py_INCREF(value);
|
|
op->func_qualname = value;
|
|
Py_XDECREF(tmp);
|
|
return 0;
|
|
}
|
|
static PyObject *
|
|
__Pyx_CyFunction_get_self(__pyx_CyFunctionObject *m, CYTHON_UNUSED void *closure)
|
|
{
|
|
PyObject *self;
|
|
self = m->func_closure;
|
|
if (self == NULL)
|
|
self = Py_None;
|
|
Py_INCREF(self);
|
|
return self;
|
|
}
|
|
static PyObject *
|
|
__Pyx_CyFunction_get_dict(__pyx_CyFunctionObject *op)
|
|
{
|
|
if (unlikely(op->func_dict == NULL)) {
|
|
op->func_dict = PyDict_New();
|
|
if (unlikely(op->func_dict == NULL))
|
|
return NULL;
|
|
}
|
|
Py_INCREF(op->func_dict);
|
|
return op->func_dict;
|
|
}
|
|
static int
|
|
__Pyx_CyFunction_set_dict(__pyx_CyFunctionObject *op, PyObject *value)
|
|
{
|
|
PyObject *tmp;
|
|
if (unlikely(value == NULL)) {
|
|
PyErr_SetString(PyExc_TypeError,
|
|
"function's dictionary may not be deleted");
|
|
return -1;
|
|
}
|
|
if (unlikely(!PyDict_Check(value))) {
|
|
PyErr_SetString(PyExc_TypeError,
|
|
"setting function's dictionary to a non-dict");
|
|
return -1;
|
|
}
|
|
tmp = op->func_dict;
|
|
Py_INCREF(value);
|
|
op->func_dict = value;
|
|
Py_XDECREF(tmp);
|
|
return 0;
|
|
}
|
|
static PyObject *
|
|
__Pyx_CyFunction_get_globals(CYTHON_UNUSED __pyx_CyFunctionObject *op)
|
|
{
|
|
PyObject* dict = PyModule_GetDict(__pyx_m);
|
|
Py_XINCREF(dict);
|
|
return dict;
|
|
}
|
|
static PyObject *
|
|
__Pyx_CyFunction_get_closure(CYTHON_UNUSED __pyx_CyFunctionObject *op)
|
|
{
|
|
Py_INCREF(Py_None);
|
|
return Py_None;
|
|
}
|
|
static PyObject *
|
|
__Pyx_CyFunction_get_code(__pyx_CyFunctionObject *op)
|
|
{
|
|
PyObject* result = (op->func_code) ? op->func_code : Py_None;
|
|
Py_INCREF(result);
|
|
return result;
|
|
}
|
|
static int
|
|
__Pyx_CyFunction_init_defaults(__pyx_CyFunctionObject *op) {
|
|
PyObject *res = op->defaults_getter((PyObject *) op);
|
|
if (unlikely(!res))
|
|
return -1;
|
|
op->defaults_tuple = PyTuple_GET_ITEM(res, 0);
|
|
Py_INCREF(op->defaults_tuple);
|
|
op->defaults_kwdict = PyTuple_GET_ITEM(res, 1);
|
|
Py_INCREF(op->defaults_kwdict);
|
|
Py_DECREF(res);
|
|
return 0;
|
|
}
|
|
static int
|
|
__Pyx_CyFunction_set_defaults(__pyx_CyFunctionObject *op, PyObject* value) {
|
|
PyObject* tmp;
|
|
if (!value) {
|
|
value = Py_None;
|
|
} else if (value != Py_None && !PyTuple_Check(value)) {
|
|
PyErr_SetString(PyExc_TypeError,
|
|
"__defaults__ must be set to a tuple object");
|
|
return -1;
|
|
}
|
|
Py_INCREF(value);
|
|
tmp = op->defaults_tuple;
|
|
op->defaults_tuple = value;
|
|
Py_XDECREF(tmp);
|
|
return 0;
|
|
}
|
|
static PyObject *
|
|
__Pyx_CyFunction_get_defaults(__pyx_CyFunctionObject *op) {
|
|
PyObject* result = op->defaults_tuple;
|
|
if (unlikely(!result)) {
|
|
if (op->defaults_getter) {
|
|
if (__Pyx_CyFunction_init_defaults(op) < 0) return NULL;
|
|
result = op->defaults_tuple;
|
|
} else {
|
|
result = Py_None;
|
|
}
|
|
}
|
|
Py_INCREF(result);
|
|
return result;
|
|
}
|
|
static int
|
|
__Pyx_CyFunction_set_kwdefaults(__pyx_CyFunctionObject *op, PyObject* value) {
|
|
PyObject* tmp;
|
|
if (!value) {
|
|
value = Py_None;
|
|
} else if (value != Py_None && !PyDict_Check(value)) {
|
|
PyErr_SetString(PyExc_TypeError,
|
|
"__kwdefaults__ must be set to a dict object");
|
|
return -1;
|
|
}
|
|
Py_INCREF(value);
|
|
tmp = op->defaults_kwdict;
|
|
op->defaults_kwdict = value;
|
|
Py_XDECREF(tmp);
|
|
return 0;
|
|
}
|
|
static PyObject *
|
|
__Pyx_CyFunction_get_kwdefaults(__pyx_CyFunctionObject *op) {
|
|
PyObject* result = op->defaults_kwdict;
|
|
if (unlikely(!result)) {
|
|
if (op->defaults_getter) {
|
|
if (__Pyx_CyFunction_init_defaults(op) < 0) return NULL;
|
|
result = op->defaults_kwdict;
|
|
} else {
|
|
result = Py_None;
|
|
}
|
|
}
|
|
Py_INCREF(result);
|
|
return result;
|
|
}
|
|
static int
|
|
__Pyx_CyFunction_set_annotations(__pyx_CyFunctionObject *op, PyObject* value) {
|
|
PyObject* tmp;
|
|
if (!value || value == Py_None) {
|
|
value = NULL;
|
|
} else if (!PyDict_Check(value)) {
|
|
PyErr_SetString(PyExc_TypeError,
|
|
"__annotations__ must be set to a dict object");
|
|
return -1;
|
|
}
|
|
Py_XINCREF(value);
|
|
tmp = op->func_annotations;
|
|
op->func_annotations = value;
|
|
Py_XDECREF(tmp);
|
|
return 0;
|
|
}
|
|
static PyObject *
|
|
__Pyx_CyFunction_get_annotations(__pyx_CyFunctionObject *op) {
|
|
PyObject* result = op->func_annotations;
|
|
if (unlikely(!result)) {
|
|
result = PyDict_New();
|
|
if (unlikely(!result)) return NULL;
|
|
op->func_annotations = result;
|
|
}
|
|
Py_INCREF(result);
|
|
return result;
|
|
}
|
|
static PyGetSetDef __pyx_CyFunction_getsets[] = {
|
|
{(char *) "func_doc", (getter)__Pyx_CyFunction_get_doc, (setter)__Pyx_CyFunction_set_doc, 0, 0},
|
|
{(char *) "__doc__", (getter)__Pyx_CyFunction_get_doc, (setter)__Pyx_CyFunction_set_doc, 0, 0},
|
|
{(char *) "func_name", (getter)__Pyx_CyFunction_get_name, (setter)__Pyx_CyFunction_set_name, 0, 0},
|
|
{(char *) "__name__", (getter)__Pyx_CyFunction_get_name, (setter)__Pyx_CyFunction_set_name, 0, 0},
|
|
{(char *) "__qualname__", (getter)__Pyx_CyFunction_get_qualname, (setter)__Pyx_CyFunction_set_qualname, 0, 0},
|
|
{(char *) "__self__", (getter)__Pyx_CyFunction_get_self, 0, 0, 0},
|
|
{(char *) "func_dict", (getter)__Pyx_CyFunction_get_dict, (setter)__Pyx_CyFunction_set_dict, 0, 0},
|
|
{(char *) "__dict__", (getter)__Pyx_CyFunction_get_dict, (setter)__Pyx_CyFunction_set_dict, 0, 0},
|
|
{(char *) "func_globals", (getter)__Pyx_CyFunction_get_globals, 0, 0, 0},
|
|
{(char *) "__globals__", (getter)__Pyx_CyFunction_get_globals, 0, 0, 0},
|
|
{(char *) "func_closure", (getter)__Pyx_CyFunction_get_closure, 0, 0, 0},
|
|
{(char *) "__closure__", (getter)__Pyx_CyFunction_get_closure, 0, 0, 0},
|
|
{(char *) "func_code", (getter)__Pyx_CyFunction_get_code, 0, 0, 0},
|
|
{(char *) "__code__", (getter)__Pyx_CyFunction_get_code, 0, 0, 0},
|
|
{(char *) "func_defaults", (getter)__Pyx_CyFunction_get_defaults, (setter)__Pyx_CyFunction_set_defaults, 0, 0},
|
|
{(char *) "__defaults__", (getter)__Pyx_CyFunction_get_defaults, (setter)__Pyx_CyFunction_set_defaults, 0, 0},
|
|
{(char *) "__kwdefaults__", (getter)__Pyx_CyFunction_get_kwdefaults, (setter)__Pyx_CyFunction_set_kwdefaults, 0, 0},
|
|
{(char *) "__annotations__", (getter)__Pyx_CyFunction_get_annotations, (setter)__Pyx_CyFunction_set_annotations, 0, 0},
|
|
{0, 0, 0, 0, 0}
|
|
};
|
|
#ifndef PY_WRITE_RESTRICTED /* < Py2.5 */
|
|
#define PY_WRITE_RESTRICTED WRITE_RESTRICTED
|
|
#endif
|
|
static PyMemberDef __pyx_CyFunction_members[] = {
|
|
{(char *) "__module__", T_OBJECT, offsetof(__pyx_CyFunctionObject, func.m_module), PY_WRITE_RESTRICTED, 0},
|
|
{0, 0, 0, 0, 0}
|
|
};
|
|
static PyObject *
|
|
__Pyx_CyFunction_reduce(__pyx_CyFunctionObject *m, CYTHON_UNUSED PyObject *args)
|
|
{
|
|
#if PY_MAJOR_VERSION >= 3
|
|
return PyUnicode_FromString(m->func.m_ml->ml_name);
|
|
#else
|
|
return PyString_FromString(m->func.m_ml->ml_name);
|
|
#endif
|
|
}
|
|
static PyMethodDef __pyx_CyFunction_methods[] = {
|
|
{__Pyx_NAMESTR("__reduce__"), (PyCFunction)__Pyx_CyFunction_reduce, METH_VARARGS, 0},
|
|
{0, 0, 0, 0}
|
|
};
|
|
static PyObject *__Pyx_CyFunction_New(PyTypeObject *type, PyMethodDef *ml, int flags, PyObject* qualname,
|
|
PyObject *closure, PyObject *module, PyObject* code) {
|
|
__pyx_CyFunctionObject *op = PyObject_GC_New(__pyx_CyFunctionObject, type);
|
|
if (op == NULL)
|
|
return NULL;
|
|
op->flags = flags;
|
|
op->func_weakreflist = NULL;
|
|
op->func.m_ml = ml;
|
|
op->func.m_self = (PyObject *) op;
|
|
Py_XINCREF(closure);
|
|
op->func_closure = closure;
|
|
Py_XINCREF(module);
|
|
op->func.m_module = module;
|
|
op->func_dict = NULL;
|
|
op->func_name = NULL;
|
|
Py_INCREF(qualname);
|
|
op->func_qualname = qualname;
|
|
op->func_doc = NULL;
|
|
op->func_classobj = NULL;
|
|
Py_XINCREF(code);
|
|
op->func_code = code;
|
|
op->defaults_pyobjects = 0;
|
|
op->defaults = NULL;
|
|
op->defaults_tuple = NULL;
|
|
op->defaults_kwdict = NULL;
|
|
op->defaults_getter = NULL;
|
|
op->func_annotations = NULL;
|
|
PyObject_GC_Track(op);
|
|
return (PyObject *) op;
|
|
}
|
|
static int
|
|
__Pyx_CyFunction_clear(__pyx_CyFunctionObject *m)
|
|
{
|
|
Py_CLEAR(m->func_closure);
|
|
Py_CLEAR(m->func.m_module);
|
|
Py_CLEAR(m->func_dict);
|
|
Py_CLEAR(m->func_name);
|
|
Py_CLEAR(m->func_qualname);
|
|
Py_CLEAR(m->func_doc);
|
|
Py_CLEAR(m->func_code);
|
|
Py_CLEAR(m->func_classobj);
|
|
Py_CLEAR(m->defaults_tuple);
|
|
Py_CLEAR(m->defaults_kwdict);
|
|
Py_CLEAR(m->func_annotations);
|
|
if (m->defaults) {
|
|
PyObject **pydefaults = __Pyx_CyFunction_Defaults(PyObject *, m);
|
|
int i;
|
|
for (i = 0; i < m->defaults_pyobjects; i++)
|
|
Py_XDECREF(pydefaults[i]);
|
|
PyMem_Free(m->defaults);
|
|
m->defaults = NULL;
|
|
}
|
|
return 0;
|
|
}
|
|
static void __Pyx_CyFunction_dealloc(__pyx_CyFunctionObject *m)
|
|
{
|
|
PyObject_GC_UnTrack(m);
|
|
if (m->func_weakreflist != NULL)
|
|
PyObject_ClearWeakRefs((PyObject *) m);
|
|
__Pyx_CyFunction_clear(m);
|
|
PyObject_GC_Del(m);
|
|
}
|
|
static int __Pyx_CyFunction_traverse(__pyx_CyFunctionObject *m, visitproc visit, void *arg)
|
|
{
|
|
Py_VISIT(m->func_closure);
|
|
Py_VISIT(m->func.m_module);
|
|
Py_VISIT(m->func_dict);
|
|
Py_VISIT(m->func_name);
|
|
Py_VISIT(m->func_qualname);
|
|
Py_VISIT(m->func_doc);
|
|
Py_VISIT(m->func_code);
|
|
Py_VISIT(m->func_classobj);
|
|
Py_VISIT(m->defaults_tuple);
|
|
Py_VISIT(m->defaults_kwdict);
|
|
if (m->defaults) {
|
|
PyObject **pydefaults = __Pyx_CyFunction_Defaults(PyObject *, m);
|
|
int i;
|
|
for (i = 0; i < m->defaults_pyobjects; i++)
|
|
Py_VISIT(pydefaults[i]);
|
|
}
|
|
return 0;
|
|
}
|
|
static PyObject *__Pyx_CyFunction_descr_get(PyObject *func, PyObject *obj, PyObject *type)
|
|
{
|
|
__pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func;
|
|
if (m->flags & __Pyx_CYFUNCTION_STATICMETHOD) {
|
|
Py_INCREF(func);
|
|
return func;
|
|
}
|
|
if (m->flags & __Pyx_CYFUNCTION_CLASSMETHOD) {
|
|
if (type == NULL)
|
|
type = (PyObject *)(Py_TYPE(obj));
|
|
return PyMethod_New(func,
|
|
type, (PyObject *)(Py_TYPE(type)));
|
|
}
|
|
if (obj == Py_None)
|
|
obj = NULL;
|
|
return PyMethod_New(func, obj, type);
|
|
}
|
|
static PyObject*
|
|
__Pyx_CyFunction_repr(__pyx_CyFunctionObject *op)
|
|
{
|
|
#if PY_MAJOR_VERSION >= 3
|
|
return PyUnicode_FromFormat("<cyfunction %U at %p>",
|
|
op->func_qualname, (void *)op);
|
|
#else
|
|
return PyString_FromFormat("<cyfunction %s at %p>",
|
|
PyString_AsString(op->func_qualname), (void *)op);
|
|
#endif
|
|
}
|
|
#if CYTHON_COMPILING_IN_PYPY
|
|
static PyObject * __Pyx_CyFunction_Call(PyObject *func, PyObject *arg, PyObject *kw) {
|
|
PyCFunctionObject* f = (PyCFunctionObject*)func;
|
|
PyCFunction meth = PyCFunction_GET_FUNCTION(func);
|
|
PyObject *self = PyCFunction_GET_SELF(func);
|
|
Py_ssize_t size;
|
|
switch (PyCFunction_GET_FLAGS(func) & ~(METH_CLASS | METH_STATIC | METH_COEXIST)) {
|
|
case METH_VARARGS:
|
|
if (likely(kw == NULL) || PyDict_Size(kw) == 0)
|
|
return (*meth)(self, arg);
|
|
break;
|
|
case METH_VARARGS | METH_KEYWORDS:
|
|
return (*(PyCFunctionWithKeywords)meth)(self, arg, kw);
|
|
case METH_NOARGS:
|
|
if (likely(kw == NULL) || PyDict_Size(kw) == 0) {
|
|
size = PyTuple_GET_SIZE(arg);
|
|
if (size == 0)
|
|
return (*meth)(self, NULL);
|
|
PyErr_Format(PyExc_TypeError,
|
|
"%.200s() takes no arguments (%zd given)",
|
|
f->m_ml->ml_name, size);
|
|
return NULL;
|
|
}
|
|
break;
|
|
case METH_O:
|
|
if (likely(kw == NULL) || PyDict_Size(kw) == 0) {
|
|
size = PyTuple_GET_SIZE(arg);
|
|
if (size == 1)
|
|
return (*meth)(self, PyTuple_GET_ITEM(arg, 0));
|
|
PyErr_Format(PyExc_TypeError,
|
|
"%.200s() takes exactly one argument (%zd given)",
|
|
f->m_ml->ml_name, size);
|
|
return NULL;
|
|
}
|
|
break;
|
|
default:
|
|
PyErr_SetString(PyExc_SystemError, "Bad call flags in "
|
|
"__Pyx_CyFunction_Call. METH_OLDARGS is no "
|
|
"longer supported!");
|
|
return NULL;
|
|
}
|
|
PyErr_Format(PyExc_TypeError, "%.200s() takes no keyword arguments",
|
|
f->m_ml->ml_name);
|
|
return NULL;
|
|
}
|
|
#else
|
|
static PyObject * __Pyx_CyFunction_Call(PyObject *func, PyObject *arg, PyObject *kw) {
|
|
return PyCFunction_Call(func, arg, kw);
|
|
}
|
|
#endif
|
|
static PyTypeObject __pyx_CyFunctionType_type = {
|
|
PyVarObject_HEAD_INIT(0, 0)
|
|
__Pyx_NAMESTR("cython_function_or_method"), /*tp_name*/
|
|
sizeof(__pyx_CyFunctionObject), /*tp_basicsize*/
|
|
0, /*tp_itemsize*/
|
|
(destructor) __Pyx_CyFunction_dealloc, /*tp_dealloc*/
|
|
0, /*tp_print*/
|
|
0, /*tp_getattr*/
|
|
0, /*tp_setattr*/
|
|
#if PY_MAJOR_VERSION < 3
|
|
0, /*tp_compare*/
|
|
#else
|
|
0, /*reserved*/
|
|
#endif
|
|
(reprfunc) __Pyx_CyFunction_repr, /*tp_repr*/
|
|
0, /*tp_as_number*/
|
|
0, /*tp_as_sequence*/
|
|
0, /*tp_as_mapping*/
|
|
0, /*tp_hash*/
|
|
__Pyx_CyFunction_Call, /*tp_call*/
|
|
0, /*tp_str*/
|
|
0, /*tp_getattro*/
|
|
0, /*tp_setattro*/
|
|
0, /*tp_as_buffer*/
|
|
Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC, /* tp_flags*/
|
|
0, /*tp_doc*/
|
|
(traverseproc) __Pyx_CyFunction_traverse, /*tp_traverse*/
|
|
(inquiry) __Pyx_CyFunction_clear, /*tp_clear*/
|
|
0, /*tp_richcompare*/
|
|
offsetof(__pyx_CyFunctionObject, func_weakreflist), /* tp_weaklistoffse */
|
|
0, /*tp_iter*/
|
|
0, /*tp_iternext*/
|
|
__pyx_CyFunction_methods, /*tp_methods*/
|
|
__pyx_CyFunction_members, /*tp_members*/
|
|
__pyx_CyFunction_getsets, /*tp_getset*/
|
|
0, /*tp_base*/
|
|
0, /*tp_dict*/
|
|
__Pyx_CyFunction_descr_get, /*tp_descr_get*/
|
|
0, /*tp_descr_set*/
|
|
offsetof(__pyx_CyFunctionObject, func_dict),/*tp_dictoffset*/
|
|
0, /*tp_init*/
|
|
0, /*tp_alloc*/
|
|
0, /*tp_new*/
|
|
0, /*tp_free*/
|
|
0, /*tp_is_gc*/
|
|
0, /*tp_bases*/
|
|
0, /*tp_mro*/
|
|
0, /*tp_cache*/
|
|
0, /*tp_subclasses*/
|
|
0, /*tp_weaklist*/
|
|
0, /*tp_del*/
|
|
#if PY_VERSION_HEX >= 0x02060000
|
|
0, /*tp_version_tag*/
|
|
#endif
|
|
};
|
|
static int __Pyx_CyFunction_init(void) {
|
|
#if !CYTHON_COMPILING_IN_PYPY
|
|
__pyx_CyFunctionType_type.tp_call = PyCFunction_Call;
|
|
#endif
|
|
if (PyType_Ready(&__pyx_CyFunctionType_type) < 0)
|
|
return -1;
|
|
__pyx_CyFunctionType = &__pyx_CyFunctionType_type;
|
|
return 0;
|
|
}
|
|
static CYTHON_INLINE void *__Pyx_CyFunction_InitDefaults(PyObject *func, size_t size, int pyobjects) {
|
|
__pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func;
|
|
m->defaults = PyMem_Malloc(size);
|
|
if (!m->defaults)
|
|
return PyErr_NoMemory();
|
|
memset(m->defaults, 0, size);
|
|
m->defaults_pyobjects = pyobjects;
|
|
return m->defaults;
|
|
}
|
|
static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsTuple(PyObject *func, PyObject *tuple) {
|
|
__pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func;
|
|
m->defaults_tuple = tuple;
|
|
Py_INCREF(tuple);
|
|
}
|
|
static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsKwDict(PyObject *func, PyObject *dict) {
|
|
__pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func;
|
|
m->defaults_kwdict = dict;
|
|
Py_INCREF(dict);
|
|
}
|
|
static CYTHON_INLINE void __Pyx_CyFunction_SetAnnotationsDict(PyObject *func, PyObject *dict) {
|
|
__pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func;
|
|
m->func_annotations = dict;
|
|
Py_INCREF(dict);
|
|
}
|
|
|
|
static CYTHON_INLINE int __Pyx_CheckKeywordStrings(
|
|
PyObject *kwdict,
|
|
const char* function_name,
|
|
int kw_allowed)
|
|
{
|
|
PyObject* key = 0;
|
|
Py_ssize_t pos = 0;
|
|
#if CPYTHON_COMPILING_IN_PYPY
|
|
if (!kw_allowed && PyDict_Next(kwdict, &pos, &key, 0))
|
|
goto invalid_keyword;
|
|
return 1;
|
|
#else
|
|
while (PyDict_Next(kwdict, &pos, &key, 0)) {
|
|
#if PY_MAJOR_VERSION < 3
|
|
if (unlikely(!PyString_CheckExact(key)) && unlikely(!PyString_Check(key)))
|
|
#endif
|
|
if (unlikely(!PyUnicode_Check(key)))
|
|
goto invalid_keyword_type;
|
|
}
|
|
if ((!kw_allowed) && unlikely(key))
|
|
goto invalid_keyword;
|
|
return 1;
|
|
invalid_keyword_type:
|
|
PyErr_Format(PyExc_TypeError,
|
|
"%s() keywords must be strings", function_name);
|
|
return 0;
|
|
#endif
|
|
invalid_keyword:
|
|
PyErr_Format(PyExc_TypeError,
|
|
#if PY_MAJOR_VERSION < 3
|
|
"%s() got an unexpected keyword argument '%s'",
|
|
function_name, PyString_AsString(key));
|
|
#else
|
|
"%s() got an unexpected keyword argument '%U'",
|
|
function_name, key);
|
|
#endif
|
|
return 0;
|
|
}
|
|
|
|
static int __Pyx_ArgTypeTest(PyObject *obj, PyTypeObject *type, int none_allowed,
|
|
const char *name, int exact)
|
|
{
|
|
if (!type) {
|
|
PyErr_Format(PyExc_SystemError, "Missing type object");
|
|
return 0;
|
|
}
|
|
if (none_allowed && obj == Py_None) return 1;
|
|
else if (exact) {
|
|
if (Py_TYPE(obj) == type) return 1;
|
|
}
|
|
else {
|
|
if (PyObject_TypeCheck(obj, type)) return 1;
|
|
}
|
|
PyErr_Format(PyExc_TypeError,
|
|
"Argument '%s' has incorrect type (expected %s, got %s)",
|
|
name, type->tp_name, Py_TYPE(obj)->tp_name);
|
|
return 0;
|
|
}
|
|
|
|
static CYTHON_INLINE int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type) {
|
|
if (unlikely(!type)) {
|
|
PyErr_Format(PyExc_SystemError, "Missing type object");
|
|
return 0;
|
|
}
|
|
if (likely(PyObject_TypeCheck(obj, type)))
|
|
return 1;
|
|
PyErr_Format(PyExc_TypeError, "Cannot convert %.200s to %.200s",
|
|
Py_TYPE(obj)->tp_name, type->tp_name);
|
|
return 0;
|
|
}
|
|
|
|
static CYTHON_INLINE void __Pyx_RaiseUnboundLocalError(const char *varname) {
|
|
PyErr_Format(PyExc_UnboundLocalError, "local variable '%s' referenced before assignment", varname);
|
|
}
|
|
|
|
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);
|
|
#else
|
|
PyObject *ob = PyCObject_FromVoidPtr(vtable, 0);
|
|
#endif
|
|
if (!ob)
|
|
goto bad;
|
|
if (PyDict_SetItem(dict, __pyx_n_s____pyx_vtable__, ob) < 0)
|
|
goto bad;
|
|
Py_DECREF(ob);
|
|
return 0;
|
|
bad:
|
|
Py_XDECREF(ob);
|
|
return -1;
|
|
}
|
|
|
|
static void* __Pyx_GetVtable(PyObject *dict) {
|
|
void* ptr;
|
|
PyObject *ob = PyObject_GetItem(dict, __pyx_n_s____pyx_vtable__);
|
|
if (!ob)
|
|
goto bad;
|
|
#if PY_VERSION_HEX >= 0x02070000 && !(PY_MAJOR_VERSION==3&&PY_MINOR_VERSION==0)
|
|
ptr = PyCapsule_GetPointer(ob, 0);
|
|
#else
|
|
ptr = PyCObject_AsVoidPtr(ob);
|
|
#endif
|
|
if (!ptr && !PyErr_Occurred())
|
|
PyErr_SetString(PyExc_RuntimeError, "invalid vtable found for imported type");
|
|
Py_DECREF(ob);
|
|
return ptr;
|
|
bad:
|
|
Py_XDECREF(ob);
|
|
return NULL;
|
|
}
|
|
|
|
static PyObject *
|
|
__pyx_FusedFunction_New(PyTypeObject *type, PyMethodDef *ml, int flags,
|
|
PyObject *qualname, PyObject *self,
|
|
PyObject *module, PyObject *code)
|
|
{
|
|
__pyx_FusedFunctionObject *fusedfunc =
|
|
(__pyx_FusedFunctionObject *) __Pyx_CyFunction_New(type, ml, flags, qualname,
|
|
self, module, code);
|
|
if (!fusedfunc)
|
|
return NULL;
|
|
fusedfunc->__signatures__ = NULL;
|
|
fusedfunc->type = NULL;
|
|
fusedfunc->self = NULL;
|
|
return (PyObject *) fusedfunc;
|
|
}
|
|
static void __pyx_FusedFunction_dealloc(__pyx_FusedFunctionObject *self) {
|
|
__pyx_FusedFunction_clear(self);
|
|
__pyx_FusedFunctionType->tp_free((PyObject *) self);
|
|
}
|
|
static int
|
|
__pyx_FusedFunction_traverse(__pyx_FusedFunctionObject *self,
|
|
visitproc visit,
|
|
void *arg)
|
|
{
|
|
Py_VISIT(self->self);
|
|
Py_VISIT(self->type);
|
|
Py_VISIT(self->__signatures__);
|
|
return __Pyx_CyFunction_traverse((__pyx_CyFunctionObject *) self, visit, arg);
|
|
}
|
|
static int
|
|
__pyx_FusedFunction_clear(__pyx_FusedFunctionObject *self)
|
|
{
|
|
Py_CLEAR(self->self);
|
|
Py_CLEAR(self->type);
|
|
Py_CLEAR(self->__signatures__);
|
|
return __Pyx_CyFunction_clear((__pyx_CyFunctionObject *) self);
|
|
}
|
|
static PyObject *
|
|
__pyx_FusedFunction_descr_get(PyObject *self, PyObject *obj, PyObject *type)
|
|
{
|
|
__pyx_FusedFunctionObject *func, *meth;
|
|
func = (__pyx_FusedFunctionObject *) self;
|
|
if (func->self || func->func.flags & __Pyx_CYFUNCTION_STATICMETHOD) {
|
|
Py_INCREF(self);
|
|
return self;
|
|
}
|
|
if (obj == Py_None)
|
|
obj = NULL;
|
|
meth = (__pyx_FusedFunctionObject *) __pyx_FusedFunction_NewEx(
|
|
((PyCFunctionObject *) func)->m_ml,
|
|
((__pyx_CyFunctionObject *) func)->flags,
|
|
((__pyx_CyFunctionObject *) func)->func_qualname,
|
|
((__pyx_CyFunctionObject *) func)->func_closure,
|
|
((PyCFunctionObject *) func)->m_module,
|
|
((__pyx_CyFunctionObject *) func)->func_code);
|
|
if (!meth)
|
|
return NULL;
|
|
Py_XINCREF(func->func.func_classobj);
|
|
meth->func.func_classobj = func->func.func_classobj;
|
|
Py_XINCREF(func->__signatures__);
|
|
meth->__signatures__ = func->__signatures__;
|
|
Py_XINCREF(type);
|
|
meth->type = type;
|
|
Py_XINCREF(func->func.defaults_tuple);
|
|
meth->func.defaults_tuple = func->func.defaults_tuple;
|
|
if (func->func.flags & __Pyx_CYFUNCTION_CLASSMETHOD)
|
|
obj = type;
|
|
Py_XINCREF(obj);
|
|
meth->self = obj;
|
|
return (PyObject *) meth;
|
|
}
|
|
static PyObject *
|
|
_obj_to_str(PyObject *obj)
|
|
{
|
|
if (PyType_Check(obj))
|
|
return PyObject_GetAttr(obj, __pyx_n_s____name__);
|
|
else
|
|
return PyObject_Str(obj);
|
|
}
|
|
static PyObject *
|
|
__pyx_FusedFunction_getitem(__pyx_FusedFunctionObject *self, PyObject *idx)
|
|
{
|
|
PyObject *signature = NULL;
|
|
PyObject *unbound_result_func;
|
|
PyObject *result_func = NULL;
|
|
if (self->__signatures__ == NULL) {
|
|
PyErr_SetString(PyExc_TypeError, "Function is not fused");
|
|
return NULL;
|
|
}
|
|
if (PyTuple_Check(idx)) {
|
|
PyObject *list = PyList_New(0);
|
|
Py_ssize_t n = PyTuple_GET_SIZE(idx);
|
|
PyObject *string = NULL;
|
|
PyObject *sep = NULL;
|
|
int i;
|
|
if (!list)
|
|
return NULL;
|
|
for (i = 0; i < n; i++) {
|
|
PyObject *item = PyTuple_GET_ITEM(idx, i);
|
|
string = _obj_to_str(item);
|
|
if (!string || PyList_Append(list, string) < 0)
|
|
goto __pyx_err;
|
|
Py_DECREF(string);
|
|
}
|
|
sep = PyUnicode_FromString("|");
|
|
if (sep)
|
|
signature = PyUnicode_Join(sep, list);
|
|
__pyx_err:
|
|
;
|
|
Py_DECREF(list);
|
|
Py_XDECREF(sep);
|
|
} else {
|
|
signature = _obj_to_str(idx);
|
|
}
|
|
if (!signature)
|
|
return NULL;
|
|
unbound_result_func = PyObject_GetItem(self->__signatures__, signature);
|
|
if (unbound_result_func) {
|
|
if (self->self || self->type) {
|
|
__pyx_FusedFunctionObject *unbound = (__pyx_FusedFunctionObject *) unbound_result_func;
|
|
Py_CLEAR(unbound->func.func_classobj);
|
|
Py_XINCREF(self->func.func_classobj);
|
|
unbound->func.func_classobj = self->func.func_classobj;
|
|
result_func = __pyx_FusedFunction_descr_get(unbound_result_func,
|
|
self->self, self->type);
|
|
} else {
|
|
result_func = unbound_result_func;
|
|
Py_INCREF(result_func);
|
|
}
|
|
}
|
|
Py_DECREF(signature);
|
|
Py_XDECREF(unbound_result_func);
|
|
return result_func;
|
|
}
|
|
static PyObject *
|
|
__pyx_FusedFunction_callfunction(PyObject *func, PyObject *args, PyObject *kw)
|
|
{
|
|
__pyx_CyFunctionObject *cyfunc = (__pyx_CyFunctionObject *) func;
|
|
PyObject *result;
|
|
int static_specialized = (cyfunc->flags & __Pyx_CYFUNCTION_STATICMETHOD &&
|
|
!((__pyx_FusedFunctionObject *) func)->__signatures__);
|
|
if (cyfunc->flags & __Pyx_CYFUNCTION_CCLASS && !static_specialized) {
|
|
Py_ssize_t argc;
|
|
PyObject *new_args;
|
|
PyObject *self;
|
|
PyObject *m_self;
|
|
argc = PyTuple_GET_SIZE(args);
|
|
new_args = PyTuple_GetSlice(args, 1, argc);
|
|
if (!new_args)
|
|
return NULL;
|
|
self = PyTuple_GetItem(args, 0);
|
|
if (!self)
|
|
return NULL;
|
|
m_self = cyfunc->func.m_self;
|
|
cyfunc->func.m_self = self;
|
|
result = __Pyx_CyFunction_Call(func, new_args, kw);
|
|
cyfunc->func.m_self = m_self;
|
|
Py_DECREF(new_args);
|
|
} else {
|
|
result = __Pyx_CyFunction_Call(func, args, kw);
|
|
}
|
|
return result;
|
|
}
|
|
/* Note: the 'self' from method binding is passed in in the args tuple,
|
|
whereas PyCFunctionObject's m_self is passed in as the first
|
|
argument to the C function. For extension methods we need
|
|
to pass 'self' as 'm_self' and not as the first element of the
|
|
args tuple.
|
|
*/
|
|
static PyObject *
|
|
__pyx_FusedFunction_call(PyObject *func, PyObject *args, PyObject *kw)
|
|
{
|
|
__pyx_FusedFunctionObject *binding_func = (__pyx_FusedFunctionObject *) func;
|
|
Py_ssize_t argc = PyTuple_GET_SIZE(args);
|
|
PyObject *new_args = NULL;
|
|
__pyx_FusedFunctionObject *new_func = NULL;
|
|
PyObject *result = NULL;
|
|
PyObject *self = NULL;
|
|
int is_staticmethod = binding_func->func.flags & __Pyx_CYFUNCTION_STATICMETHOD;
|
|
int is_classmethod = binding_func->func.flags & __Pyx_CYFUNCTION_CLASSMETHOD;
|
|
if (binding_func->self) {
|
|
Py_ssize_t i;
|
|
new_args = PyTuple_New(argc + 1);
|
|
if (!new_args)
|
|
return NULL;
|
|
self = binding_func->self;
|
|
Py_INCREF(self);
|
|
PyTuple_SET_ITEM(new_args, 0, self);
|
|
for (i = 0; i < argc; i++) {
|
|
PyObject *item = PyTuple_GET_ITEM(args, i);
|
|
Py_INCREF(item);
|
|
PyTuple_SET_ITEM(new_args, i + 1, item);
|
|
}
|
|
args = new_args;
|
|
} else if (binding_func->type) {
|
|
if (argc < 1) {
|
|
PyErr_Format(PyExc_TypeError, "Need at least one argument, 0 given.");
|
|
return NULL;
|
|
}
|
|
self = PyTuple_GET_ITEM(args, 0);
|
|
}
|
|
if (self && !is_classmethod && !is_staticmethod &&
|
|
!PyObject_IsInstance(self, binding_func->type)) {
|
|
PyErr_Format(PyExc_TypeError,
|
|
"First argument should be of type %s, got %s.",
|
|
((PyTypeObject *) binding_func->type)->tp_name,
|
|
self->ob_type->tp_name);
|
|
goto __pyx_err;
|
|
}
|
|
if (binding_func->__signatures__) {
|
|
PyObject *tup = PyTuple_Pack(4, binding_func->__signatures__, args,
|
|
kw == NULL ? Py_None : kw,
|
|
binding_func->func.defaults_tuple);
|
|
if (!tup)
|
|
goto __pyx_err;
|
|
new_func = (__pyx_FusedFunctionObject *) __pyx_FusedFunction_callfunction(func, tup, NULL);
|
|
Py_DECREF(tup);
|
|
if (!new_func)
|
|
goto __pyx_err;
|
|
Py_XINCREF(binding_func->func.func_classobj);
|
|
Py_CLEAR(new_func->func.func_classobj);
|
|
new_func->func.func_classobj = binding_func->func.func_classobj;
|
|
func = (PyObject *) new_func;
|
|
}
|
|
result = __pyx_FusedFunction_callfunction(func, args, kw);
|
|
__pyx_err:
|
|
Py_XDECREF(new_args);
|
|
Py_XDECREF((PyObject *) new_func);
|
|
return result;
|
|
}
|
|
static PyMemberDef __pyx_FusedFunction_members[] = {
|
|
{(char *) "__signatures__",
|
|
T_OBJECT,
|
|
offsetof(__pyx_FusedFunctionObject, __signatures__),
|
|
READONLY,
|
|
__Pyx_DOCSTR(0)},
|
|
{0, 0, 0, 0, 0},
|
|
};
|
|
static PyMappingMethods __pyx_FusedFunction_mapping_methods = {
|
|
0,
|
|
(binaryfunc) __pyx_FusedFunction_getitem,
|
|
0,
|
|
};
|
|
static PyTypeObject __pyx_FusedFunctionType_type = {
|
|
PyVarObject_HEAD_INIT(0, 0)
|
|
__Pyx_NAMESTR("fused_cython_function"), /*tp_name*/
|
|
sizeof(__pyx_FusedFunctionObject), /*tp_basicsize*/
|
|
0, /*tp_itemsize*/
|
|
(destructor) __pyx_FusedFunction_dealloc, /*tp_dealloc*/
|
|
0, /*tp_print*/
|
|
0, /*tp_getattr*/
|
|
0, /*tp_setattr*/
|
|
#if PY_MAJOR_VERSION < 3
|
|
0, /*tp_compare*/
|
|
#else
|
|
0, /*reserved*/
|
|
#endif
|
|
0, /*tp_repr*/
|
|
0, /*tp_as_number*/
|
|
0, /*tp_as_sequence*/
|
|
&__pyx_FusedFunction_mapping_methods, /*tp_as_mapping*/
|
|
0, /*tp_hash*/
|
|
(ternaryfunc) __pyx_FusedFunction_call, /*tp_call*/
|
|
0, /*tp_str*/
|
|
0, /*tp_getattro*/
|
|
0, /*tp_setattro*/
|
|
0, /*tp_as_buffer*/
|
|
Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC | Py_TPFLAGS_BASETYPE, /* tp_flags*/
|
|
0, /*tp_doc*/
|
|
(traverseproc) __pyx_FusedFunction_traverse, /*tp_traverse*/
|
|
(inquiry) __pyx_FusedFunction_clear,/*tp_clear*/
|
|
0, /*tp_richcompare*/
|
|
0, /*tp_weaklistoffset*/
|
|
0, /*tp_iter*/
|
|
0, /*tp_iternext*/
|
|
0, /*tp_methods*/
|
|
__pyx_FusedFunction_members, /*tp_members*/
|
|
__pyx_CyFunction_getsets, /*tp_getset*/
|
|
&__pyx_CyFunctionType_type, /*tp_base*/
|
|
0, /*tp_dict*/
|
|
__pyx_FusedFunction_descr_get, /*tp_descr_get*/
|
|
0, /*tp_descr_set*/
|
|
0, /*tp_dictoffset*/
|
|
0, /*tp_init*/
|
|
0, /*tp_alloc*/
|
|
0, /*tp_new*/
|
|
0, /*tp_free*/
|
|
0, /*tp_is_gc*/
|
|
0, /*tp_bases*/
|
|
0, /*tp_mro*/
|
|
0, /*tp_cache*/
|
|
0, /*tp_subclasses*/
|
|
0, /*tp_weaklist*/
|
|
0, /*tp_del*/
|
|
#if PY_VERSION_HEX >= 0x02060000
|
|
0, /*tp_version_tag*/
|
|
#endif
|
|
};
|
|
static int __pyx_FusedFunction_init(void) {
|
|
if (PyType_Ready(&__pyx_FusedFunctionType_type) < 0) {
|
|
return -1;
|
|
}
|
|
__pyx_FusedFunctionType = &__pyx_FusedFunctionType_type;
|
|
return 0;
|
|
}
|
|
|
|
static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name) {
|
|
PyObject* value = __Pyx_PyObject_GetAttrStr(module, name);
|
|
if (unlikely(!value) && PyErr_ExceptionMatches(PyExc_AttributeError)) {
|
|
PyErr_Format(PyExc_ImportError,
|
|
#if PY_MAJOR_VERSION < 3
|
|
"cannot import name %.230s", PyString_AS_STRING(name));
|
|
#else
|
|
"cannot import name %S", name);
|
|
#endif
|
|
}
|
|
return value;
|
|
}
|
|
|
|
static CYTHON_INLINE void __Pyx_ExceptionSave(PyObject **type, PyObject **value, PyObject **tb) {
|
|
#if CYTHON_COMPILING_IN_CPYTHON
|
|
PyThreadState *tstate = PyThreadState_GET();
|
|
*type = tstate->exc_type;
|
|
*value = tstate->exc_value;
|
|
*tb = tstate->exc_traceback;
|
|
Py_XINCREF(*type);
|
|
Py_XINCREF(*value);
|
|
Py_XINCREF(*tb);
|
|
#else
|
|
PyErr_GetExcInfo(type, value, tb);
|
|
#endif
|
|
}
|
|
static void __Pyx_ExceptionReset(PyObject *type, PyObject *value, PyObject *tb) {
|
|
#if CYTHON_COMPILING_IN_CPYTHON
|
|
PyObject *tmp_type, *tmp_value, *tmp_tb;
|
|
PyThreadState *tstate = PyThreadState_GET();
|
|
tmp_type = tstate->exc_type;
|
|
tmp_value = tstate->exc_value;
|
|
tmp_tb = tstate->exc_traceback;
|
|
tstate->exc_type = type;
|
|
tstate->exc_value = value;
|
|
tstate->exc_traceback = tb;
|
|
Py_XDECREF(tmp_type);
|
|
Py_XDECREF(tmp_value);
|
|
Py_XDECREF(tmp_tb);
|
|
#else
|
|
PyErr_SetExcInfo(type, value, tb);
|
|
#endif
|
|
}
|
|
|
|
static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level) {
|
|
PyObject *empty_list = 0;
|
|
PyObject *module = 0;
|
|
PyObject *global_dict = 0;
|
|
PyObject *empty_dict = 0;
|
|
PyObject *list;
|
|
#if PY_VERSION_HEX < 0x03030000
|
|
PyObject *py_import;
|
|
py_import = __Pyx_PyObject_GetAttrStr(__pyx_b, __pyx_n_s____import__);
|
|
if (!py_import)
|
|
goto bad;
|
|
#endif
|
|
if (from_list)
|
|
list = from_list;
|
|
else {
|
|
empty_list = PyList_New(0);
|
|
if (!empty_list)
|
|
goto bad;
|
|
list = empty_list;
|
|
}
|
|
global_dict = PyModule_GetDict(__pyx_m);
|
|
if (!global_dict)
|
|
goto bad;
|
|
empty_dict = PyDict_New();
|
|
if (!empty_dict)
|
|
goto bad;
|
|
#if PY_VERSION_HEX >= 0x02050000
|
|
{
|
|
#if PY_MAJOR_VERSION >= 3
|
|
if (level == -1) {
|
|
if (strchr(__Pyx_MODULE_NAME, '.')) {
|
|
#if PY_VERSION_HEX < 0x03030000
|
|
PyObject *py_level = PyInt_FromLong(1);
|
|
if (!py_level)
|
|
goto bad;
|
|
module = PyObject_CallFunctionObjArgs(py_import,
|
|
name, global_dict, empty_dict, list, py_level, NULL);
|
|
Py_DECREF(py_level);
|
|
#else
|
|
module = PyImport_ImportModuleLevelObject(
|
|
name, global_dict, empty_dict, list, 1);
|
|
#endif
|
|
if (!module) {
|
|
if (!PyErr_ExceptionMatches(PyExc_ImportError))
|
|
goto bad;
|
|
PyErr_Clear();
|
|
}
|
|
}
|
|
level = 0; /* try absolute import on failure */
|
|
}
|
|
#endif
|
|
if (!module) {
|
|
#if PY_VERSION_HEX < 0x03030000
|
|
PyObject *py_level = PyInt_FromLong(level);
|
|
if (!py_level)
|
|
goto bad;
|
|
module = PyObject_CallFunctionObjArgs(py_import,
|
|
name, global_dict, empty_dict, list, py_level, NULL);
|
|
Py_DECREF(py_level);
|
|
#else
|
|
module = PyImport_ImportModuleLevelObject(
|
|
name, global_dict, empty_dict, list, level);
|
|
#endif
|
|
}
|
|
}
|
|
#else
|
|
if (level>0) {
|
|
PyErr_SetString(PyExc_RuntimeError, "Relative import is not supported for Python <=2.4.");
|
|
goto bad;
|
|
}
|
|
module = PyObject_CallFunctionObjArgs(py_import,
|
|
name, global_dict, empty_dict, list, NULL);
|
|
#endif
|
|
bad:
|
|
#if PY_VERSION_HEX < 0x03030000
|
|
Py_XDECREF(py_import);
|
|
#endif
|
|
Py_XDECREF(empty_list);
|
|
Py_XDECREF(empty_dict);
|
|
return module;
|
|
}
|
|
|
|
static CYTHON_INLINE PyObject *__Pyx_PyInt_to_py_uint64_t(uint64_t val) {
|
|
const uint64_t neg_one = (uint64_t)-1, const_zero = (uint64_t)0;
|
|
const int is_unsigned = const_zero < neg_one;
|
|
if ((sizeof(uint64_t) == sizeof(char)) ||
|
|
(sizeof(uint64_t) == sizeof(short))) {
|
|
return PyInt_FromLong((long)val);
|
|
} else if ((sizeof(uint64_t) == sizeof(int)) ||
|
|
(sizeof(uint64_t) == sizeof(long))) {
|
|
if (is_unsigned)
|
|
return PyLong_FromUnsignedLong((unsigned long)val);
|
|
else
|
|
return PyInt_FromLong((long)val);
|
|
} else if (sizeof(uint64_t) == sizeof(PY_LONG_LONG)) {
|
|
if (is_unsigned)
|
|
return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG)val);
|
|
else
|
|
return PyLong_FromLongLong((PY_LONG_LONG)val);
|
|
} else {
|
|
int one = 1; int little = (int)*(unsigned char *)&one;
|
|
unsigned char *bytes = (unsigned char *)&val;
|
|
return _PyLong_FromByteArray(bytes, sizeof(uint64_t),
|
|
little, !is_unsigned);
|
|
}
|
|
}
|
|
|
|
static CYTHON_INLINE PyObject *__Pyx_PyInt_to_py_int64_t(int64_t val) {
|
|
const int64_t neg_one = (int64_t)-1, const_zero = (int64_t)0;
|
|
const int is_unsigned = const_zero < neg_one;
|
|
if ((sizeof(int64_t) == sizeof(char)) ||
|
|
(sizeof(int64_t) == sizeof(short))) {
|
|
return PyInt_FromLong((long)val);
|
|
} else if ((sizeof(int64_t) == sizeof(int)) ||
|
|
(sizeof(int64_t) == sizeof(long))) {
|
|
if (is_unsigned)
|
|
return PyLong_FromUnsignedLong((unsigned long)val);
|
|
else
|
|
return PyInt_FromLong((long)val);
|
|
} else if (sizeof(int64_t) == sizeof(PY_LONG_LONG)) {
|
|
if (is_unsigned)
|
|
return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG)val);
|
|
else
|
|
return PyLong_FromLongLong((PY_LONG_LONG)val);
|
|
} else {
|
|
int one = 1; int little = (int)*(unsigned char *)&one;
|
|
unsigned char *bytes = (unsigned char *)&val;
|
|
return _PyLong_FromByteArray(bytes, sizeof(int64_t),
|
|
little, !is_unsigned);
|
|
}
|
|
}
|
|
|
|
static CYTHON_INLINE uint64_t __Pyx_PyInt_from_py_uint64_t(PyObject* x) {
|
|
const uint64_t neg_one = (uint64_t)-1, const_zero = (uint64_t)0;
|
|
const int is_unsigned = const_zero < neg_one;
|
|
if (sizeof(uint64_t) == sizeof(char)) {
|
|
if (is_unsigned)
|
|
return (uint64_t)__Pyx_PyInt_AsUnsignedChar(x);
|
|
else
|
|
return (uint64_t)__Pyx_PyInt_AsSignedChar(x);
|
|
} else if (sizeof(uint64_t) == sizeof(short)) {
|
|
if (is_unsigned)
|
|
return (uint64_t)__Pyx_PyInt_AsUnsignedShort(x);
|
|
else
|
|
return (uint64_t)__Pyx_PyInt_AsSignedShort(x);
|
|
} else if (sizeof(uint64_t) == sizeof(int)) {
|
|
if (is_unsigned)
|
|
return (uint64_t)__Pyx_PyInt_AsUnsignedInt(x);
|
|
else
|
|
return (uint64_t)__Pyx_PyInt_AsSignedInt(x);
|
|
} else if (sizeof(uint64_t) == sizeof(long)) {
|
|
if (is_unsigned)
|
|
return (uint64_t)__Pyx_PyInt_AsUnsignedLong(x);
|
|
else
|
|
return (uint64_t)__Pyx_PyInt_AsSignedLong(x);
|
|
} else if (sizeof(uint64_t) == sizeof(PY_LONG_LONG)) {
|
|
if (is_unsigned)
|
|
return (uint64_t)__Pyx_PyInt_AsUnsignedLongLong(x);
|
|
else
|
|
return (uint64_t)__Pyx_PyInt_AsSignedLongLong(x);
|
|
} else {
|
|
#if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray)
|
|
PyErr_SetString(PyExc_RuntimeError,
|
|
"_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
|
|
#else
|
|
uint64_t val;
|
|
PyObject *v = __Pyx_PyNumber_Int(x);
|
|
#if PY_MAJOR_VERSION < 3
|
|
if (likely(v) && !PyLong_Check(v)) {
|
|
PyObject *tmp = v;
|
|
v = PyNumber_Long(tmp);
|
|
Py_DECREF(tmp);
|
|
}
|
|
#endif
|
|
if (likely(v)) {
|
|
int one = 1; int is_little = (int)*(unsigned char *)&one;
|
|
unsigned char *bytes = (unsigned char *)&val;
|
|
int ret = _PyLong_AsByteArray((PyLongObject *)v,
|
|
bytes, sizeof(val),
|
|
is_little, !is_unsigned);
|
|
Py_DECREF(v);
|
|
if (likely(!ret))
|
|
return val;
|
|
}
|
|
#endif
|
|
return (uint64_t)-1;
|
|
}
|
|
}
|
|
|
|
static CYTHON_INLINE unsigned char __Pyx_PyInt_AsUnsignedChar(PyObject* x) {
|
|
const unsigned char neg_one = (unsigned char)-1, const_zero = 0;
|
|
const int is_unsigned = neg_one > const_zero;
|
|
if (sizeof(unsigned char) < sizeof(long)) {
|
|
long val = __Pyx_PyInt_AsLong(x);
|
|
if (unlikely(val != (long)(unsigned char)val)) {
|
|
if (!unlikely(val == -1 && PyErr_Occurred())) {
|
|
PyErr_SetString(PyExc_OverflowError,
|
|
(is_unsigned && unlikely(val < 0)) ?
|
|
"can't convert negative value to unsigned char" :
|
|
"value too large to convert to unsigned char");
|
|
}
|
|
return (unsigned char)-1;
|
|
}
|
|
return (unsigned char)val;
|
|
}
|
|
return (unsigned char)__Pyx_PyInt_AsUnsignedLong(x);
|
|
}
|
|
|
|
static CYTHON_INLINE unsigned short __Pyx_PyInt_AsUnsignedShort(PyObject* x) {
|
|
const unsigned short neg_one = (unsigned short)-1, const_zero = 0;
|
|
const int is_unsigned = neg_one > const_zero;
|
|
if (sizeof(unsigned short) < sizeof(long)) {
|
|
long val = __Pyx_PyInt_AsLong(x);
|
|
if (unlikely(val != (long)(unsigned short)val)) {
|
|
if (!unlikely(val == -1 && PyErr_Occurred())) {
|
|
PyErr_SetString(PyExc_OverflowError,
|
|
(is_unsigned && unlikely(val < 0)) ?
|
|
"can't convert negative value to unsigned short" :
|
|
"value too large to convert to unsigned short");
|
|
}
|
|
return (unsigned short)-1;
|
|
}
|
|
return (unsigned short)val;
|
|
}
|
|
return (unsigned short)__Pyx_PyInt_AsUnsignedLong(x);
|
|
}
|
|
|
|
static CYTHON_INLINE unsigned int __Pyx_PyInt_AsUnsignedInt(PyObject* x) {
|
|
const unsigned int neg_one = (unsigned int)-1, const_zero = 0;
|
|
const int is_unsigned = neg_one > const_zero;
|
|
if (sizeof(unsigned int) < sizeof(long)) {
|
|
long val = __Pyx_PyInt_AsLong(x);
|
|
if (unlikely(val != (long)(unsigned int)val)) {
|
|
if (!unlikely(val == -1 && PyErr_Occurred())) {
|
|
PyErr_SetString(PyExc_OverflowError,
|
|
(is_unsigned && unlikely(val < 0)) ?
|
|
"can't convert negative value to unsigned int" :
|
|
"value too large to convert to unsigned int");
|
|
}
|
|
return (unsigned int)-1;
|
|
}
|
|
return (unsigned int)val;
|
|
}
|
|
return (unsigned int)__Pyx_PyInt_AsUnsignedLong(x);
|
|
}
|
|
|
|
static CYTHON_INLINE char __Pyx_PyInt_AsChar(PyObject* x) {
|
|
const char neg_one = (char)-1, const_zero = 0;
|
|
const int is_unsigned = neg_one > const_zero;
|
|
if (sizeof(char) < sizeof(long)) {
|
|
long val = __Pyx_PyInt_AsLong(x);
|
|
if (unlikely(val != (long)(char)val)) {
|
|
if (!unlikely(val == -1 && PyErr_Occurred())) {
|
|
PyErr_SetString(PyExc_OverflowError,
|
|
(is_unsigned && unlikely(val < 0)) ?
|
|
"can't convert negative value to char" :
|
|
"value too large to convert to char");
|
|
}
|
|
return (char)-1;
|
|
}
|
|
return (char)val;
|
|
}
|
|
return (char)__Pyx_PyInt_AsLong(x);
|
|
}
|
|
|
|
static CYTHON_INLINE short __Pyx_PyInt_AsShort(PyObject* x) {
|
|
const short neg_one = (short)-1, const_zero = 0;
|
|
const int is_unsigned = neg_one > const_zero;
|
|
if (sizeof(short) < sizeof(long)) {
|
|
long val = __Pyx_PyInt_AsLong(x);
|
|
if (unlikely(val != (long)(short)val)) {
|
|
if (!unlikely(val == -1 && PyErr_Occurred())) {
|
|
PyErr_SetString(PyExc_OverflowError,
|
|
(is_unsigned && unlikely(val < 0)) ?
|
|
"can't convert negative value to short" :
|
|
"value too large to convert to short");
|
|
}
|
|
return (short)-1;
|
|
}
|
|
return (short)val;
|
|
}
|
|
return (short)__Pyx_PyInt_AsLong(x);
|
|
}
|
|
|
|
static CYTHON_INLINE int __Pyx_PyInt_AsInt(PyObject* x) {
|
|
const int neg_one = (int)-1, const_zero = 0;
|
|
const int is_unsigned = neg_one > const_zero;
|
|
if (sizeof(int) < sizeof(long)) {
|
|
long val = __Pyx_PyInt_AsLong(x);
|
|
if (unlikely(val != (long)(int)val)) {
|
|
if (!unlikely(val == -1 && PyErr_Occurred())) {
|
|
PyErr_SetString(PyExc_OverflowError,
|
|
(is_unsigned && unlikely(val < 0)) ?
|
|
"can't convert negative value to int" :
|
|
"value too large to convert to int");
|
|
}
|
|
return (int)-1;
|
|
}
|
|
return (int)val;
|
|
}
|
|
return (int)__Pyx_PyInt_AsLong(x);
|
|
}
|
|
|
|
static CYTHON_INLINE signed char __Pyx_PyInt_AsSignedChar(PyObject* x) {
|
|
const signed char neg_one = (signed char)-1, const_zero = 0;
|
|
const int is_unsigned = neg_one > const_zero;
|
|
if (sizeof(signed char) < sizeof(long)) {
|
|
long val = __Pyx_PyInt_AsLong(x);
|
|
if (unlikely(val != (long)(signed char)val)) {
|
|
if (!unlikely(val == -1 && PyErr_Occurred())) {
|
|
PyErr_SetString(PyExc_OverflowError,
|
|
(is_unsigned && unlikely(val < 0)) ?
|
|
"can't convert negative value to signed char" :
|
|
"value too large to convert to signed char");
|
|
}
|
|
return (signed char)-1;
|
|
}
|
|
return (signed char)val;
|
|
}
|
|
return (signed char)__Pyx_PyInt_AsSignedLong(x);
|
|
}
|
|
|
|
static CYTHON_INLINE signed short __Pyx_PyInt_AsSignedShort(PyObject* x) {
|
|
const signed short neg_one = (signed short)-1, const_zero = 0;
|
|
const int is_unsigned = neg_one > const_zero;
|
|
if (sizeof(signed short) < sizeof(long)) {
|
|
long val = __Pyx_PyInt_AsLong(x);
|
|
if (unlikely(val != (long)(signed short)val)) {
|
|
if (!unlikely(val == -1 && PyErr_Occurred())) {
|
|
PyErr_SetString(PyExc_OverflowError,
|
|
(is_unsigned && unlikely(val < 0)) ?
|
|
"can't convert negative value to signed short" :
|
|
"value too large to convert to signed short");
|
|
}
|
|
return (signed short)-1;
|
|
}
|
|
return (signed short)val;
|
|
}
|
|
return (signed short)__Pyx_PyInt_AsSignedLong(x);
|
|
}
|
|
|
|
static CYTHON_INLINE signed int __Pyx_PyInt_AsSignedInt(PyObject* x) {
|
|
const signed int neg_one = (signed int)-1, const_zero = 0;
|
|
const int is_unsigned = neg_one > const_zero;
|
|
if (sizeof(signed int) < sizeof(long)) {
|
|
long val = __Pyx_PyInt_AsLong(x);
|
|
if (unlikely(val != (long)(signed int)val)) {
|
|
if (!unlikely(val == -1 && PyErr_Occurred())) {
|
|
PyErr_SetString(PyExc_OverflowError,
|
|
(is_unsigned && unlikely(val < 0)) ?
|
|
"can't convert negative value to signed int" :
|
|
"value too large to convert to signed int");
|
|
}
|
|
return (signed int)-1;
|
|
}
|
|
return (signed int)val;
|
|
}
|
|
return (signed int)__Pyx_PyInt_AsSignedLong(x);
|
|
}
|
|
|
|
static CYTHON_INLINE int __Pyx_PyInt_AsLongDouble(PyObject* x) {
|
|
const int neg_one = (int)-1, const_zero = 0;
|
|
const int is_unsigned = neg_one > const_zero;
|
|
if (sizeof(int) < sizeof(long)) {
|
|
long val = __Pyx_PyInt_AsLong(x);
|
|
if (unlikely(val != (long)(int)val)) {
|
|
if (!unlikely(val == -1 && PyErr_Occurred())) {
|
|
PyErr_SetString(PyExc_OverflowError,
|
|
(is_unsigned && unlikely(val < 0)) ?
|
|
"can't convert negative value to int" :
|
|
"value too large to convert to int");
|
|
}
|
|
return (int)-1;
|
|
}
|
|
return (int)val;
|
|
}
|
|
return (int)__Pyx_PyInt_AsLong(x);
|
|
}
|
|
|
|
#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3
|
|
#if CYTHON_USE_PYLONG_INTERNALS
|
|
#include "longintrepr.h"
|
|
#endif
|
|
#endif
|
|
static CYTHON_INLINE unsigned long __Pyx_PyInt_AsUnsignedLong(PyObject* x) {
|
|
const unsigned long neg_one = (unsigned long)-1, const_zero = 0;
|
|
const int is_unsigned = neg_one > const_zero;
|
|
#if PY_MAJOR_VERSION < 3
|
|
if (likely(PyInt_Check(x))) {
|
|
long val = PyInt_AS_LONG(x);
|
|
if (is_unsigned && unlikely(val < 0)) {
|
|
PyErr_SetString(PyExc_OverflowError,
|
|
"can't convert negative value to unsigned long");
|
|
return (unsigned long)-1;
|
|
}
|
|
return (unsigned long)val;
|
|
} else
|
|
#endif
|
|
if (likely(PyLong_Check(x))) {
|
|
if (is_unsigned) {
|
|
#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3
|
|
#if CYTHON_USE_PYLONG_INTERNALS
|
|
if (sizeof(digit) <= sizeof(unsigned long)) {
|
|
switch (Py_SIZE(x)) {
|
|
case 0: return 0;
|
|
case 1: return (unsigned long) ((PyLongObject*)x)->ob_digit[0];
|
|
}
|
|
}
|
|
#endif
|
|
#endif
|
|
if (unlikely(Py_SIZE(x) < 0)) {
|
|
PyErr_SetString(PyExc_OverflowError,
|
|
"can't convert negative value to unsigned long");
|
|
return (unsigned long)-1;
|
|
}
|
|
return (unsigned long)PyLong_AsUnsignedLong(x);
|
|
} else {
|
|
#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3
|
|
#if CYTHON_USE_PYLONG_INTERNALS
|
|
if (sizeof(digit) <= sizeof(unsigned long)) {
|
|
switch (Py_SIZE(x)) {
|
|
case 0: return 0;
|
|
case 1: return +(unsigned long) ((PyLongObject*)x)->ob_digit[0];
|
|
case -1: return -(unsigned long) ((PyLongObject*)x)->ob_digit[0];
|
|
}
|
|
}
|
|
#endif
|
|
#endif
|
|
return (unsigned long)PyLong_AsLong(x);
|
|
}
|
|
} else {
|
|
unsigned long val;
|
|
PyObject *tmp = __Pyx_PyNumber_Int(x);
|
|
if (!tmp) return (unsigned long)-1;
|
|
val = __Pyx_PyInt_AsUnsignedLong(tmp);
|
|
Py_DECREF(tmp);
|
|
return val;
|
|
}
|
|
}
|
|
|
|
#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3
|
|
#if CYTHON_USE_PYLONG_INTERNALS
|
|
#include "longintrepr.h"
|
|
#endif
|
|
#endif
|
|
static CYTHON_INLINE unsigned PY_LONG_LONG __Pyx_PyInt_AsUnsignedLongLong(PyObject* x) {
|
|
const unsigned PY_LONG_LONG neg_one = (unsigned PY_LONG_LONG)-1, const_zero = 0;
|
|
const int is_unsigned = neg_one > const_zero;
|
|
#if PY_MAJOR_VERSION < 3
|
|
if (likely(PyInt_Check(x))) {
|
|
long val = PyInt_AS_LONG(x);
|
|
if (is_unsigned && unlikely(val < 0)) {
|
|
PyErr_SetString(PyExc_OverflowError,
|
|
"can't convert negative value to unsigned PY_LONG_LONG");
|
|
return (unsigned PY_LONG_LONG)-1;
|
|
}
|
|
return (unsigned PY_LONG_LONG)val;
|
|
} else
|
|
#endif
|
|
if (likely(PyLong_Check(x))) {
|
|
if (is_unsigned) {
|
|
#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3
|
|
#if CYTHON_USE_PYLONG_INTERNALS
|
|
if (sizeof(digit) <= sizeof(unsigned PY_LONG_LONG)) {
|
|
switch (Py_SIZE(x)) {
|
|
case 0: return 0;
|
|
case 1: return (unsigned PY_LONG_LONG) ((PyLongObject*)x)->ob_digit[0];
|
|
}
|
|
}
|
|
#endif
|
|
#endif
|
|
if (unlikely(Py_SIZE(x) < 0)) {
|
|
PyErr_SetString(PyExc_OverflowError,
|
|
"can't convert negative value to unsigned PY_LONG_LONG");
|
|
return (unsigned PY_LONG_LONG)-1;
|
|
}
|
|
return (unsigned PY_LONG_LONG)PyLong_AsUnsignedLongLong(x);
|
|
} else {
|
|
#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3
|
|
#if CYTHON_USE_PYLONG_INTERNALS
|
|
if (sizeof(digit) <= sizeof(unsigned PY_LONG_LONG)) {
|
|
switch (Py_SIZE(x)) {
|
|
case 0: return 0;
|
|
case 1: return +(unsigned PY_LONG_LONG) ((PyLongObject*)x)->ob_digit[0];
|
|
case -1: return -(unsigned PY_LONG_LONG) ((PyLongObject*)x)->ob_digit[0];
|
|
}
|
|
}
|
|
#endif
|
|
#endif
|
|
return (unsigned PY_LONG_LONG)PyLong_AsLongLong(x);
|
|
}
|
|
} else {
|
|
unsigned PY_LONG_LONG val;
|
|
PyObject *tmp = __Pyx_PyNumber_Int(x);
|
|
if (!tmp) return (unsigned PY_LONG_LONG)-1;
|
|
val = __Pyx_PyInt_AsUnsignedLongLong(tmp);
|
|
Py_DECREF(tmp);
|
|
return val;
|
|
}
|
|
}
|
|
|
|
#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3
|
|
#if CYTHON_USE_PYLONG_INTERNALS
|
|
#include "longintrepr.h"
|
|
#endif
|
|
#endif
|
|
static CYTHON_INLINE long __Pyx_PyInt_AsLong(PyObject* x) {
|
|
const long neg_one = (long)-1, const_zero = 0;
|
|
const int is_unsigned = neg_one > const_zero;
|
|
#if PY_MAJOR_VERSION < 3
|
|
if (likely(PyInt_Check(x))) {
|
|
long val = PyInt_AS_LONG(x);
|
|
if (is_unsigned && unlikely(val < 0)) {
|
|
PyErr_SetString(PyExc_OverflowError,
|
|
"can't convert negative value to long");
|
|
return (long)-1;
|
|
}
|
|
return (long)val;
|
|
} else
|
|
#endif
|
|
if (likely(PyLong_Check(x))) {
|
|
if (is_unsigned) {
|
|
#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3
|
|
#if CYTHON_USE_PYLONG_INTERNALS
|
|
if (sizeof(digit) <= sizeof(long)) {
|
|
switch (Py_SIZE(x)) {
|
|
case 0: return 0;
|
|
case 1: return (long) ((PyLongObject*)x)->ob_digit[0];
|
|
}
|
|
}
|
|
#endif
|
|
#endif
|
|
if (unlikely(Py_SIZE(x) < 0)) {
|
|
PyErr_SetString(PyExc_OverflowError,
|
|
"can't convert negative value to long");
|
|
return (long)-1;
|
|
}
|
|
return (long)PyLong_AsUnsignedLong(x);
|
|
} else {
|
|
#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3
|
|
#if CYTHON_USE_PYLONG_INTERNALS
|
|
if (sizeof(digit) <= sizeof(long)) {
|
|
switch (Py_SIZE(x)) {
|
|
case 0: return 0;
|
|
case 1: return +(long) ((PyLongObject*)x)->ob_digit[0];
|
|
case -1: return -(long) ((PyLongObject*)x)->ob_digit[0];
|
|
}
|
|
}
|
|
#endif
|
|
#endif
|
|
return (long)PyLong_AsLong(x);
|
|
}
|
|
} else {
|
|
long val;
|
|
PyObject *tmp = __Pyx_PyNumber_Int(x);
|
|
if (!tmp) return (long)-1;
|
|
val = __Pyx_PyInt_AsLong(tmp);
|
|
Py_DECREF(tmp);
|
|
return val;
|
|
}
|
|
}
|
|
|
|
#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3
|
|
#if CYTHON_USE_PYLONG_INTERNALS
|
|
#include "longintrepr.h"
|
|
#endif
|
|
#endif
|
|
static CYTHON_INLINE PY_LONG_LONG __Pyx_PyInt_AsLongLong(PyObject* x) {
|
|
const PY_LONG_LONG neg_one = (PY_LONG_LONG)-1, const_zero = 0;
|
|
const int is_unsigned = neg_one > const_zero;
|
|
#if PY_MAJOR_VERSION < 3
|
|
if (likely(PyInt_Check(x))) {
|
|
long val = PyInt_AS_LONG(x);
|
|
if (is_unsigned && unlikely(val < 0)) {
|
|
PyErr_SetString(PyExc_OverflowError,
|
|
"can't convert negative value to PY_LONG_LONG");
|
|
return (PY_LONG_LONG)-1;
|
|
}
|
|
return (PY_LONG_LONG)val;
|
|
} else
|
|
#endif
|
|
if (likely(PyLong_Check(x))) {
|
|
if (is_unsigned) {
|
|
#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3
|
|
#if CYTHON_USE_PYLONG_INTERNALS
|
|
if (sizeof(digit) <= sizeof(PY_LONG_LONG)) {
|
|
switch (Py_SIZE(x)) {
|
|
case 0: return 0;
|
|
case 1: return (PY_LONG_LONG) ((PyLongObject*)x)->ob_digit[0];
|
|
}
|
|
}
|
|
#endif
|
|
#endif
|
|
if (unlikely(Py_SIZE(x) < 0)) {
|
|
PyErr_SetString(PyExc_OverflowError,
|
|
"can't convert negative value to PY_LONG_LONG");
|
|
return (PY_LONG_LONG)-1;
|
|
}
|
|
return (PY_LONG_LONG)PyLong_AsUnsignedLongLong(x);
|
|
} else {
|
|
#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3
|
|
#if CYTHON_USE_PYLONG_INTERNALS
|
|
if (sizeof(digit) <= sizeof(PY_LONG_LONG)) {
|
|
switch (Py_SIZE(x)) {
|
|
case 0: return 0;
|
|
case 1: return +(PY_LONG_LONG) ((PyLongObject*)x)->ob_digit[0];
|
|
case -1: return -(PY_LONG_LONG) ((PyLongObject*)x)->ob_digit[0];
|
|
}
|
|
}
|
|
#endif
|
|
#endif
|
|
return (PY_LONG_LONG)PyLong_AsLongLong(x);
|
|
}
|
|
} else {
|
|
PY_LONG_LONG val;
|
|
PyObject *tmp = __Pyx_PyNumber_Int(x);
|
|
if (!tmp) return (PY_LONG_LONG)-1;
|
|
val = __Pyx_PyInt_AsLongLong(tmp);
|
|
Py_DECREF(tmp);
|
|
return val;
|
|
}
|
|
}
|
|
|
|
#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3
|
|
#if CYTHON_USE_PYLONG_INTERNALS
|
|
#include "longintrepr.h"
|
|
#endif
|
|
#endif
|
|
static CYTHON_INLINE signed long __Pyx_PyInt_AsSignedLong(PyObject* x) {
|
|
const signed long neg_one = (signed long)-1, const_zero = 0;
|
|
const int is_unsigned = neg_one > const_zero;
|
|
#if PY_MAJOR_VERSION < 3
|
|
if (likely(PyInt_Check(x))) {
|
|
long val = PyInt_AS_LONG(x);
|
|
if (is_unsigned && unlikely(val < 0)) {
|
|
PyErr_SetString(PyExc_OverflowError,
|
|
"can't convert negative value to signed long");
|
|
return (signed long)-1;
|
|
}
|
|
return (signed long)val;
|
|
} else
|
|
#endif
|
|
if (likely(PyLong_Check(x))) {
|
|
if (is_unsigned) {
|
|
#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3
|
|
#if CYTHON_USE_PYLONG_INTERNALS
|
|
if (sizeof(digit) <= sizeof(signed long)) {
|
|
switch (Py_SIZE(x)) {
|
|
case 0: return 0;
|
|
case 1: return (signed long) ((PyLongObject*)x)->ob_digit[0];
|
|
}
|
|
}
|
|
#endif
|
|
#endif
|
|
if (unlikely(Py_SIZE(x) < 0)) {
|
|
PyErr_SetString(PyExc_OverflowError,
|
|
"can't convert negative value to signed long");
|
|
return (signed long)-1;
|
|
}
|
|
return (signed long)PyLong_AsUnsignedLong(x);
|
|
} else {
|
|
#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3
|
|
#if CYTHON_USE_PYLONG_INTERNALS
|
|
if (sizeof(digit) <= sizeof(signed long)) {
|
|
switch (Py_SIZE(x)) {
|
|
case 0: return 0;
|
|
case 1: return +(signed long) ((PyLongObject*)x)->ob_digit[0];
|
|
case -1: return -(signed long) ((PyLongObject*)x)->ob_digit[0];
|
|
}
|
|
}
|
|
#endif
|
|
#endif
|
|
return (signed long)PyLong_AsLong(x);
|
|
}
|
|
} else {
|
|
signed long val;
|
|
PyObject *tmp = __Pyx_PyNumber_Int(x);
|
|
if (!tmp) return (signed long)-1;
|
|
val = __Pyx_PyInt_AsSignedLong(tmp);
|
|
Py_DECREF(tmp);
|
|
return val;
|
|
}
|
|
}
|
|
|
|
#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3
|
|
#if CYTHON_USE_PYLONG_INTERNALS
|
|
#include "longintrepr.h"
|
|
#endif
|
|
#endif
|
|
static CYTHON_INLINE signed PY_LONG_LONG __Pyx_PyInt_AsSignedLongLong(PyObject* x) {
|
|
const signed PY_LONG_LONG neg_one = (signed PY_LONG_LONG)-1, const_zero = 0;
|
|
const int is_unsigned = neg_one > const_zero;
|
|
#if PY_MAJOR_VERSION < 3
|
|
if (likely(PyInt_Check(x))) {
|
|
long val = PyInt_AS_LONG(x);
|
|
if (is_unsigned && unlikely(val < 0)) {
|
|
PyErr_SetString(PyExc_OverflowError,
|
|
"can't convert negative value to signed PY_LONG_LONG");
|
|
return (signed PY_LONG_LONG)-1;
|
|
}
|
|
return (signed PY_LONG_LONG)val;
|
|
} else
|
|
#endif
|
|
if (likely(PyLong_Check(x))) {
|
|
if (is_unsigned) {
|
|
#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3
|
|
#if CYTHON_USE_PYLONG_INTERNALS
|
|
if (sizeof(digit) <= sizeof(signed PY_LONG_LONG)) {
|
|
switch (Py_SIZE(x)) {
|
|
case 0: return 0;
|
|
case 1: return (signed PY_LONG_LONG) ((PyLongObject*)x)->ob_digit[0];
|
|
}
|
|
}
|
|
#endif
|
|
#endif
|
|
if (unlikely(Py_SIZE(x) < 0)) {
|
|
PyErr_SetString(PyExc_OverflowError,
|
|
"can't convert negative value to signed PY_LONG_LONG");
|
|
return (signed PY_LONG_LONG)-1;
|
|
}
|
|
return (signed PY_LONG_LONG)PyLong_AsUnsignedLongLong(x);
|
|
} else {
|
|
#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3
|
|
#if CYTHON_USE_PYLONG_INTERNALS
|
|
if (sizeof(digit) <= sizeof(signed PY_LONG_LONG)) {
|
|
switch (Py_SIZE(x)) {
|
|
case 0: return 0;
|
|
case 1: return +(signed PY_LONG_LONG) ((PyLongObject*)x)->ob_digit[0];
|
|
case -1: return -(signed PY_LONG_LONG) ((PyLongObject*)x)->ob_digit[0];
|
|
}
|
|
}
|
|
#endif
|
|
#endif
|
|
return (signed PY_LONG_LONG)PyLong_AsLongLong(x);
|
|
}
|
|
} else {
|
|
signed PY_LONG_LONG val;
|
|
PyObject *tmp = __Pyx_PyNumber_Int(x);
|
|
if (!tmp) return (signed PY_LONG_LONG)-1;
|
|
val = __Pyx_PyInt_AsSignedLongLong(tmp);
|
|
Py_DECREF(tmp);
|
|
return val;
|
|
}
|
|
}
|
|
|
|
static CYTHON_INLINE void __Pyx_ExceptionSwap(PyObject **type, PyObject **value, PyObject **tb) {
|
|
PyObject *tmp_type, *tmp_value, *tmp_tb;
|
|
#if CYTHON_COMPILING_IN_CPYTHON
|
|
PyThreadState *tstate = PyThreadState_GET();
|
|
tmp_type = tstate->exc_type;
|
|
tmp_value = tstate->exc_value;
|
|
tmp_tb = tstate->exc_traceback;
|
|
tstate->exc_type = *type;
|
|
tstate->exc_value = *value;
|
|
tstate->exc_traceback = *tb;
|
|
#else
|
|
PyErr_GetExcInfo(&tmp_type, &tmp_value, &tmp_tb);
|
|
PyErr_SetExcInfo(*type, *value, *tb);
|
|
#endif
|
|
*type = tmp_type;
|
|
*value = tmp_value;
|
|
*tb = tmp_tb;
|
|
}
|
|
|
|
static PyObject *__Pyx_Generator_Next(PyObject *self);
|
|
static PyObject *__Pyx_Generator_Send(PyObject *self, PyObject *value);
|
|
static PyObject *__Pyx_Generator_Close(PyObject *self);
|
|
static PyObject *__Pyx_Generator_Throw(PyObject *gen, PyObject *args);
|
|
static PyTypeObject *__pyx_GeneratorType = 0;
|
|
#define __Pyx_Generator_CheckExact(obj) (Py_TYPE(obj) == __pyx_GeneratorType)
|
|
#define __Pyx_Generator_Undelegate(gen) Py_CLEAR((gen)->yieldfrom)
|
|
#if 1 || PY_VERSION_HEX < 0x030300B0
|
|
static int __Pyx_PyGen_FetchStopIterationValue(PyObject **pvalue) {
|
|
PyObject *et, *ev, *tb;
|
|
PyObject *value = NULL;
|
|
__Pyx_ErrFetch(&et, &ev, &tb);
|
|
if (!et) {
|
|
Py_XDECREF(tb);
|
|
Py_XDECREF(ev);
|
|
Py_INCREF(Py_None);
|
|
*pvalue = Py_None;
|
|
return 0;
|
|
}
|
|
if (unlikely(et != PyExc_StopIteration) &&
|
|
unlikely(!PyErr_GivenExceptionMatches(et, PyExc_StopIteration))) {
|
|
__Pyx_ErrRestore(et, ev, tb);
|
|
return -1;
|
|
}
|
|
if (likely(et == PyExc_StopIteration)) {
|
|
if (likely(!ev) || !PyObject_IsInstance(ev, PyExc_StopIteration)) {
|
|
if (!ev) {
|
|
Py_INCREF(Py_None);
|
|
ev = Py_None;
|
|
}
|
|
Py_XDECREF(tb);
|
|
Py_DECREF(et);
|
|
*pvalue = ev;
|
|
return 0;
|
|
}
|
|
}
|
|
PyErr_NormalizeException(&et, &ev, &tb);
|
|
if (unlikely(!PyObject_IsInstance(ev, PyExc_StopIteration))) {
|
|
__Pyx_ErrRestore(et, ev, tb);
|
|
return -1;
|
|
}
|
|
Py_XDECREF(tb);
|
|
Py_DECREF(et);
|
|
#if PY_VERSION_HEX >= 0x030300A0
|
|
value = ((PyStopIterationObject *)ev)->value;
|
|
Py_INCREF(value);
|
|
Py_DECREF(ev);
|
|
#else
|
|
{
|
|
PyObject* args = PyObject_GetAttr(ev, __pyx_n_s__args);
|
|
Py_DECREF(ev);
|
|
if (likely(args)) {
|
|
value = PyObject_GetItem(args, 0);
|
|
Py_DECREF(args);
|
|
}
|
|
if (unlikely(!value)) {
|
|
__Pyx_ErrRestore(NULL, NULL, NULL);
|
|
Py_INCREF(Py_None);
|
|
value = Py_None;
|
|
}
|
|
}
|
|
#endif
|
|
*pvalue = value;
|
|
return 0;
|
|
}
|
|
#endif
|
|
static CYTHON_INLINE
|
|
void __Pyx_Generator_ExceptionClear(__pyx_GeneratorObject *self) {
|
|
PyObject *exc_type = self->exc_type;
|
|
PyObject *exc_value = self->exc_value;
|
|
PyObject *exc_traceback = self->exc_traceback;
|
|
self->exc_type = NULL;
|
|
self->exc_value = NULL;
|
|
self->exc_traceback = NULL;
|
|
Py_XDECREF(exc_type);
|
|
Py_XDECREF(exc_value);
|
|
Py_XDECREF(exc_traceback);
|
|
}
|
|
static CYTHON_INLINE
|
|
int __Pyx_Generator_CheckRunning(__pyx_GeneratorObject *gen) {
|
|
if (unlikely(gen->is_running)) {
|
|
PyErr_SetString(PyExc_ValueError,
|
|
"generator already executing");
|
|
return 1;
|
|
}
|
|
return 0;
|
|
}
|
|
static CYTHON_INLINE
|
|
PyObject *__Pyx_Generator_SendEx(__pyx_GeneratorObject *self, PyObject *value) {
|
|
PyObject *retval;
|
|
assert(!self->is_running);
|
|
if (unlikely(self->resume_label == 0)) {
|
|
if (unlikely(value && value != Py_None)) {
|
|
PyErr_SetString(PyExc_TypeError,
|
|
"can't send non-None value to a "
|
|
"just-started generator");
|
|
return NULL;
|
|
}
|
|
}
|
|
if (unlikely(self->resume_label == -1)) {
|
|
PyErr_SetNone(PyExc_StopIteration);
|
|
return NULL;
|
|
}
|
|
if (value) {
|
|
#if CYTHON_COMPILING_IN_PYPY
|
|
#else
|
|
/* Generators always return to their most recent caller, not
|
|
* necessarily their creator. */
|
|
if (self->exc_traceback) {
|
|
PyThreadState *tstate = PyThreadState_GET();
|
|
PyTracebackObject *tb = (PyTracebackObject *) self->exc_traceback;
|
|
PyFrameObject *f = tb->tb_frame;
|
|
Py_XINCREF(tstate->frame);
|
|
assert(f->f_back == NULL);
|
|
f->f_back = tstate->frame;
|
|
}
|
|
#endif
|
|
__Pyx_ExceptionSwap(&self->exc_type, &self->exc_value,
|
|
&self->exc_traceback);
|
|
} else {
|
|
__Pyx_Generator_ExceptionClear(self);
|
|
}
|
|
self->is_running = 1;
|
|
retval = self->body((PyObject *) self, value);
|
|
self->is_running = 0;
|
|
if (retval) {
|
|
__Pyx_ExceptionSwap(&self->exc_type, &self->exc_value,
|
|
&self->exc_traceback);
|
|
#if CYTHON_COMPILING_IN_PYPY
|
|
#else
|
|
/* Don't keep the reference to f_back any longer than necessary. It
|
|
* may keep a chain of frames alive or it could create a reference
|
|
* cycle. */
|
|
if (self->exc_traceback) {
|
|
PyTracebackObject *tb = (PyTracebackObject *) self->exc_traceback;
|
|
PyFrameObject *f = tb->tb_frame;
|
|
Py_CLEAR(f->f_back);
|
|
}
|
|
#endif
|
|
} else {
|
|
__Pyx_Generator_ExceptionClear(self);
|
|
}
|
|
return retval;
|
|
}
|
|
static CYTHON_INLINE
|
|
PyObject *__Pyx_Generator_FinishDelegation(__pyx_GeneratorObject *gen) {
|
|
PyObject *ret;
|
|
PyObject *val = NULL;
|
|
__Pyx_Generator_Undelegate(gen);
|
|
__Pyx_PyGen_FetchStopIterationValue(&val);
|
|
ret = __Pyx_Generator_SendEx(gen, val);
|
|
Py_XDECREF(val);
|
|
return ret;
|
|
}
|
|
static PyObject *__Pyx_Generator_Next(PyObject *self) {
|
|
__pyx_GeneratorObject *gen = (__pyx_GeneratorObject*) self;
|
|
PyObject *yf = gen->yieldfrom;
|
|
if (unlikely(__Pyx_Generator_CheckRunning(gen)))
|
|
return NULL;
|
|
if (yf) {
|
|
PyObject *ret;
|
|
gen->is_running = 1;
|
|
ret = Py_TYPE(yf)->tp_iternext(yf);
|
|
gen->is_running = 0;
|
|
if (likely(ret)) {
|
|
return ret;
|
|
}
|
|
return __Pyx_Generator_FinishDelegation(gen);
|
|
}
|
|
return __Pyx_Generator_SendEx(gen, Py_None);
|
|
}
|
|
static PyObject *__Pyx_Generator_Send(PyObject *self, PyObject *value) {
|
|
__pyx_GeneratorObject *gen = (__pyx_GeneratorObject*) self;
|
|
PyObject *yf = gen->yieldfrom;
|
|
if (unlikely(__Pyx_Generator_CheckRunning(gen)))
|
|
return NULL;
|
|
if (yf) {
|
|
PyObject *ret;
|
|
gen->is_running = 1;
|
|
if (__Pyx_Generator_CheckExact(yf)) {
|
|
ret = __Pyx_Generator_Send(yf, value);
|
|
} else {
|
|
if (value == Py_None)
|
|
ret = PyIter_Next(yf);
|
|
else
|
|
ret = __Pyx_PyObject_CallMethod1(yf, __pyx_n_s__send, value);
|
|
}
|
|
gen->is_running = 0;
|
|
if (likely(ret)) {
|
|
return ret;
|
|
}
|
|
return __Pyx_Generator_FinishDelegation(gen);
|
|
}
|
|
return __Pyx_Generator_SendEx(gen, value);
|
|
}
|
|
static int __Pyx_Generator_CloseIter(__pyx_GeneratorObject *gen, PyObject *yf) {
|
|
PyObject *retval = NULL;
|
|
int err = 0;
|
|
if (__Pyx_Generator_CheckExact(yf)) {
|
|
retval = __Pyx_Generator_Close(yf);
|
|
if (!retval)
|
|
return -1;
|
|
} else {
|
|
PyObject *meth;
|
|
gen->is_running = 1;
|
|
meth = PyObject_GetAttr(yf, __pyx_n_s__close);
|
|
if (unlikely(!meth)) {
|
|
if (!PyErr_ExceptionMatches(PyExc_AttributeError)) {
|
|
PyErr_WriteUnraisable(yf);
|
|
}
|
|
PyErr_Clear();
|
|
} else {
|
|
retval = PyObject_CallFunction(meth, NULL);
|
|
Py_DECREF(meth);
|
|
if (!retval)
|
|
err = -1;
|
|
}
|
|
gen->is_running = 0;
|
|
}
|
|
Py_XDECREF(retval);
|
|
return err;
|
|
}
|
|
static PyObject *__Pyx_Generator_Close(PyObject *self) {
|
|
__pyx_GeneratorObject *gen = (__pyx_GeneratorObject *) self;
|
|
PyObject *retval, *raised_exception;
|
|
PyObject *yf = gen->yieldfrom;
|
|
int err = 0;
|
|
if (unlikely(__Pyx_Generator_CheckRunning(gen)))
|
|
return NULL;
|
|
if (yf) {
|
|
Py_INCREF(yf);
|
|
err = __Pyx_Generator_CloseIter(gen, yf);
|
|
__Pyx_Generator_Undelegate(gen);
|
|
Py_DECREF(yf);
|
|
}
|
|
if (err == 0)
|
|
#if PY_VERSION_HEX < 0x02050000
|
|
PyErr_SetNone(PyExc_StopIteration);
|
|
#else
|
|
PyErr_SetNone(PyExc_GeneratorExit);
|
|
#endif
|
|
retval = __Pyx_Generator_SendEx(gen, NULL);
|
|
if (retval) {
|
|
Py_DECREF(retval);
|
|
PyErr_SetString(PyExc_RuntimeError,
|
|
"generator ignored GeneratorExit");
|
|
return NULL;
|
|
}
|
|
raised_exception = PyErr_Occurred();
|
|
if (!raised_exception
|
|
|| raised_exception == PyExc_StopIteration
|
|
#if PY_VERSION_HEX >= 0x02050000
|
|
|| raised_exception == PyExc_GeneratorExit
|
|
|| PyErr_GivenExceptionMatches(raised_exception, PyExc_GeneratorExit)
|
|
#endif
|
|
|| PyErr_GivenExceptionMatches(raised_exception, PyExc_StopIteration))
|
|
{
|
|
if (raised_exception) PyErr_Clear(); /* ignore these errors */
|
|
Py_INCREF(Py_None);
|
|
return Py_None;
|
|
}
|
|
return NULL;
|
|
}
|
|
static PyObject *__Pyx_Generator_Throw(PyObject *self, PyObject *args) {
|
|
__pyx_GeneratorObject *gen = (__pyx_GeneratorObject *) self;
|
|
PyObject *typ;
|
|
PyObject *tb = NULL;
|
|
PyObject *val = NULL;
|
|
PyObject *yf = gen->yieldfrom;
|
|
if (!PyArg_UnpackTuple(args, (char *)"throw", 1, 3, &typ, &val, &tb))
|
|
return NULL;
|
|
if (unlikely(__Pyx_Generator_CheckRunning(gen)))
|
|
return NULL;
|
|
if (yf) {
|
|
PyObject *ret;
|
|
Py_INCREF(yf);
|
|
#if PY_VERSION_HEX >= 0x02050000
|
|
if (PyErr_GivenExceptionMatches(typ, PyExc_GeneratorExit)) {
|
|
int err = __Pyx_Generator_CloseIter(gen, yf);
|
|
Py_DECREF(yf);
|
|
__Pyx_Generator_Undelegate(gen);
|
|
if (err < 0)
|
|
return __Pyx_Generator_SendEx(gen, NULL);
|
|
goto throw_here;
|
|
}
|
|
#endif
|
|
gen->is_running = 1;
|
|
if (__Pyx_Generator_CheckExact(yf)) {
|
|
ret = __Pyx_Generator_Throw(yf, args);
|
|
} else {
|
|
PyObject *meth = PyObject_GetAttr(yf, __pyx_n_s__throw);
|
|
if (unlikely(!meth)) {
|
|
Py_DECREF(yf);
|
|
if (!PyErr_ExceptionMatches(PyExc_AttributeError)) {
|
|
gen->is_running = 0;
|
|
return NULL;
|
|
}
|
|
PyErr_Clear();
|
|
__Pyx_Generator_Undelegate(gen);
|
|
gen->is_running = 0;
|
|
goto throw_here;
|
|
}
|
|
ret = PyObject_CallObject(meth, args);
|
|
Py_DECREF(meth);
|
|
}
|
|
gen->is_running = 0;
|
|
Py_DECREF(yf);
|
|
if (!ret) {
|
|
ret = __Pyx_Generator_FinishDelegation(gen);
|
|
}
|
|
return ret;
|
|
}
|
|
throw_here:
|
|
__Pyx_Raise(typ, val, tb, NULL);
|
|
return __Pyx_Generator_SendEx(gen, NULL);
|
|
}
|
|
static int __Pyx_Generator_traverse(PyObject *self, visitproc visit, void *arg) {
|
|
__pyx_GeneratorObject *gen = (__pyx_GeneratorObject *) self;
|
|
Py_VISIT(gen->closure);
|
|
Py_VISIT(gen->classobj);
|
|
Py_VISIT(gen->yieldfrom);
|
|
Py_VISIT(gen->exc_type);
|
|
Py_VISIT(gen->exc_value);
|
|
Py_VISIT(gen->exc_traceback);
|
|
return 0;
|
|
}
|
|
static int __Pyx_Generator_clear(PyObject *self) {
|
|
__pyx_GeneratorObject *gen = (__pyx_GeneratorObject *) self;
|
|
Py_CLEAR(gen->closure);
|
|
Py_CLEAR(gen->classobj);
|
|
Py_CLEAR(gen->yieldfrom);
|
|
Py_CLEAR(gen->exc_type);
|
|
Py_CLEAR(gen->exc_value);
|
|
Py_CLEAR(gen->exc_traceback);
|
|
return 0;
|
|
}
|
|
static void __Pyx_Generator_dealloc(PyObject *self) {
|
|
__pyx_GeneratorObject *gen = (__pyx_GeneratorObject *) self;
|
|
PyObject_GC_UnTrack(gen);
|
|
if (gen->gi_weakreflist != NULL)
|
|
PyObject_ClearWeakRefs(self);
|
|
PyObject_GC_Track(self);
|
|
if (gen->resume_label > 0) {
|
|
Py_TYPE(gen)->tp_del(self);
|
|
if (self->ob_refcnt > 0)
|
|
return; /* resurrected. :( */
|
|
}
|
|
PyObject_GC_UnTrack(self);
|
|
__Pyx_Generator_clear(self);
|
|
PyObject_GC_Del(gen);
|
|
}
|
|
static void __Pyx_Generator_del(PyObject *self) {
|
|
PyObject *res;
|
|
PyObject *error_type, *error_value, *error_traceback;
|
|
__pyx_GeneratorObject *gen = (__pyx_GeneratorObject *) self;
|
|
if (gen->resume_label <= 0)
|
|
return ;
|
|
assert(self->ob_refcnt == 0);
|
|
self->ob_refcnt = 1;
|
|
__Pyx_ErrFetch(&error_type, &error_value, &error_traceback);
|
|
res = __Pyx_Generator_Close(self);
|
|
if (res == NULL)
|
|
PyErr_WriteUnraisable(self);
|
|
else
|
|
Py_DECREF(res);
|
|
__Pyx_ErrRestore(error_type, error_value, error_traceback);
|
|
/* Undo the temporary resurrection; can't use DECREF here, it would
|
|
* cause a recursive call.
|
|
*/
|
|
assert(self->ob_refcnt > 0);
|
|
if (--self->ob_refcnt == 0)
|
|
return; /* this is the normal path out */
|
|
/* close() resurrected it! Make it look like the original Py_DECREF
|
|
* never happened.
|
|
*/
|
|
{
|
|
Py_ssize_t refcnt = self->ob_refcnt;
|
|
_Py_NewReference(self);
|
|
self->ob_refcnt = refcnt;
|
|
}
|
|
#if CYTHON_COMPILING_IN_CPYTHON
|
|
assert(PyType_IS_GC(self->ob_type) &&
|
|
_Py_AS_GC(self)->gc.gc_refs != _PyGC_REFS_UNTRACKED);
|
|
/* If Py_REF_DEBUG, _Py_NewReference bumped _Py_RefTotal, so
|
|
* we need to undo that. */
|
|
_Py_DEC_REFTOTAL;
|
|
#endif
|
|
/* If Py_TRACE_REFS, _Py_NewReference re-added self to the object
|
|
* chain, so no more to do there.
|
|
* If COUNT_ALLOCS, the original decref bumped tp_frees, and
|
|
* _Py_NewReference bumped tp_allocs: both of those need to be
|
|
* undone.
|
|
*/
|
|
#ifdef COUNT_ALLOCS
|
|
--Py_TYPE(self)->tp_frees;
|
|
--Py_TYPE(self)->tp_allocs;
|
|
#endif
|
|
}
|
|
static PyMemberDef __pyx_Generator_memberlist[] = {
|
|
{(char *) "gi_running",
|
|
#if PY_VERSION_HEX >= 0x02060000
|
|
T_BOOL,
|
|
#else
|
|
T_BYTE,
|
|
#endif
|
|
offsetof(__pyx_GeneratorObject, is_running),
|
|
READONLY,
|
|
NULL},
|
|
{0, 0, 0, 0, 0}
|
|
};
|
|
static PyMethodDef __pyx_Generator_methods[] = {
|
|
{__Pyx_NAMESTR("send"), (PyCFunction) __Pyx_Generator_Send, METH_O, 0},
|
|
{__Pyx_NAMESTR("throw"), (PyCFunction) __Pyx_Generator_Throw, METH_VARARGS, 0},
|
|
{__Pyx_NAMESTR("close"), (PyCFunction) __Pyx_Generator_Close, METH_NOARGS, 0},
|
|
{0, 0, 0, 0}
|
|
};
|
|
static PyTypeObject __pyx_GeneratorType_type = {
|
|
PyVarObject_HEAD_INIT(0, 0)
|
|
__Pyx_NAMESTR("generator"), /*tp_name*/
|
|
sizeof(__pyx_GeneratorObject), /*tp_basicsize*/
|
|
0, /*tp_itemsize*/
|
|
(destructor) __Pyx_Generator_dealloc,/*tp_dealloc*/
|
|
0, /*tp_print*/
|
|
0, /*tp_getattr*/
|
|
0, /*tp_setattr*/
|
|
#if PY_MAJOR_VERSION < 3
|
|
0, /*tp_compare*/
|
|
#else
|
|
0, /*reserved*/
|
|
#endif
|
|
0, /*tp_repr*/
|
|
0, /*tp_as_number*/
|
|
0, /*tp_as_sequence*/
|
|
0, /*tp_as_mapping*/
|
|
0, /*tp_hash*/
|
|
0, /*tp_call*/
|
|
0, /*tp_str*/
|
|
0, /*tp_getattro*/
|
|
0, /*tp_setattro*/
|
|
0, /*tp_as_buffer*/
|
|
Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC, /* tp_flags*/
|
|
0, /*tp_doc*/
|
|
(traverseproc) __Pyx_Generator_traverse, /*tp_traverse*/
|
|
0, /*tp_clear*/
|
|
0, /*tp_richcompare*/
|
|
offsetof(__pyx_GeneratorObject, gi_weakreflist), /* tp_weaklistoffse */
|
|
0, /*tp_iter*/
|
|
(iternextfunc) __Pyx_Generator_Next, /*tp_iternext*/
|
|
__pyx_Generator_methods, /*tp_methods*/
|
|
__pyx_Generator_memberlist, /*tp_members*/
|
|
0, /*tp_getset*/
|
|
0, /*tp_base*/
|
|
0, /*tp_dict*/
|
|
0, /*tp_descr_get*/
|
|
0, /*tp_descr_set*/
|
|
0, /*tp_dictoffset*/
|
|
0, /*tp_init*/
|
|
0, /*tp_alloc*/
|
|
0, /*tp_new*/
|
|
0, /*tp_free*/
|
|
0, /*tp_is_gc*/
|
|
0, /*tp_bases*/
|
|
0, /*tp_mro*/
|
|
0, /*tp_cache*/
|
|
0, /*tp_subclasses*/
|
|
0, /*tp_weaklist*/
|
|
__Pyx_Generator_del, /*tp_del*/
|
|
#if PY_VERSION_HEX >= 0x02060000
|
|
0, /*tp_version_tag*/
|
|
#endif
|
|
};
|
|
static __pyx_GeneratorObject *__Pyx_Generator_New(__pyx_generator_body_t body,
|
|
PyObject *closure) {
|
|
__pyx_GeneratorObject *gen =
|
|
PyObject_GC_New(__pyx_GeneratorObject, &__pyx_GeneratorType_type);
|
|
if (gen == NULL)
|
|
return NULL;
|
|
gen->body = body;
|
|
gen->closure = closure;
|
|
Py_XINCREF(closure);
|
|
gen->is_running = 0;
|
|
gen->resume_label = 0;
|
|
gen->classobj = NULL;
|
|
gen->yieldfrom = NULL;
|
|
gen->exc_type = NULL;
|
|
gen->exc_value = NULL;
|
|
gen->exc_traceback = NULL;
|
|
gen->gi_weakreflist = NULL;
|
|
PyObject_GC_Track(gen);
|
|
return gen;
|
|
}
|
|
static int __pyx_Generator_init(void) {
|
|
__pyx_GeneratorType_type.tp_getattro = PyObject_GenericGetAttr;
|
|
__pyx_GeneratorType_type.tp_iter = PyObject_SelfIter;
|
|
if (PyType_Ready(&__pyx_GeneratorType_type)) {
|
|
return -1;
|
|
}
|
|
__pyx_GeneratorType = &__pyx_GeneratorType_type;
|
|
return 0;
|
|
}
|
|
|
|
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;
|
|
}
|
|
|
|
#ifndef __PYX_HAVE_RT_ImportModule
|
|
#define __PYX_HAVE_RT_ImportModule
|
|
static PyObject *__Pyx_ImportModule(const char *name) {
|
|
PyObject *py_name = 0;
|
|
PyObject *py_module = 0;
|
|
py_name = __Pyx_PyIdentifier_FromString(name);
|
|
if (!py_name)
|
|
goto bad;
|
|
py_module = PyImport_Import(py_name);
|
|
Py_DECREF(py_name);
|
|
return py_module;
|
|
bad:
|
|
Py_XDECREF(py_name);
|
|
return 0;
|
|
}
|
|
#endif
|
|
|
|
#ifndef __PYX_HAVE_RT_ImportType
|
|
#define __PYX_HAVE_RT_ImportType
|
|
static PyTypeObject *__Pyx_ImportType(const char *module_name, const char *class_name,
|
|
size_t size, int strict)
|
|
{
|
|
PyObject *py_module = 0;
|
|
PyObject *result = 0;
|
|
PyObject *py_name = 0;
|
|
char warning[200];
|
|
Py_ssize_t basicsize;
|
|
#ifdef Py_LIMITED_API
|
|
PyObject *py_basicsize;
|
|
#endif
|
|
py_module = __Pyx_ImportModule(module_name);
|
|
if (!py_module)
|
|
goto bad;
|
|
py_name = __Pyx_PyIdentifier_FromString(class_name);
|
|
if (!py_name)
|
|
goto bad;
|
|
result = PyObject_GetAttr(py_module, py_name);
|
|
Py_DECREF(py_name);
|
|
py_name = 0;
|
|
Py_DECREF(py_module);
|
|
py_module = 0;
|
|
if (!result)
|
|
goto bad;
|
|
if (!PyType_Check(result)) {
|
|
PyErr_Format(PyExc_TypeError,
|
|
"%s.%s is not a type object",
|
|
module_name, class_name);
|
|
goto bad;
|
|
}
|
|
#ifndef Py_LIMITED_API
|
|
basicsize = ((PyTypeObject *)result)->tp_basicsize;
|
|
#else
|
|
py_basicsize = PyObject_GetAttrString(result, "__basicsize__");
|
|
if (!py_basicsize)
|
|
goto bad;
|
|
basicsize = PyLong_AsSsize_t(py_basicsize);
|
|
Py_DECREF(py_basicsize);
|
|
py_basicsize = 0;
|
|
if (basicsize == (Py_ssize_t)-1 && PyErr_Occurred())
|
|
goto bad;
|
|
#endif
|
|
if (!strict && (size_t)basicsize > size) {
|
|
PyOS_snprintf(warning, sizeof(warning),
|
|
"%s.%s size changed, may indicate binary incompatibility",
|
|
module_name, class_name);
|
|
#if PY_VERSION_HEX < 0x02050000
|
|
if (PyErr_Warn(NULL, warning) < 0) goto bad;
|
|
#else
|
|
if (PyErr_WarnEx(NULL, warning, 0) < 0) goto bad;
|
|
#endif
|
|
}
|
|
else if ((size_t)basicsize != size) {
|
|
PyErr_Format(PyExc_ValueError,
|
|
"%s.%s has the wrong size, try recompiling",
|
|
module_name, class_name);
|
|
goto bad;
|
|
}
|
|
return (PyTypeObject *)result;
|
|
bad:
|
|
Py_XDECREF(py_module);
|
|
Py_XDECREF(result);
|
|
return NULL;
|
|
}
|
|
#endif
|
|
|
|
static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line) {
|
|
int start = 0, mid = 0, end = count - 1;
|
|
if (end >= 0 && code_line > entries[end].code_line) {
|
|
return count;
|
|
}
|
|
while (start < end) {
|
|
mid = (start + end) / 2;
|
|
if (code_line < entries[mid].code_line) {
|
|
end = mid;
|
|
} else if (code_line > entries[mid].code_line) {
|
|
start = mid + 1;
|
|
} else {
|
|
return mid;
|
|
}
|
|
}
|
|
if (code_line <= entries[mid].code_line) {
|
|
return mid;
|
|
} else {
|
|
return mid + 1;
|
|
}
|
|
}
|
|
static PyCodeObject *__pyx_find_code_object(int code_line) {
|
|
PyCodeObject* code_object;
|
|
int pos;
|
|
if (unlikely(!code_line) || unlikely(!__pyx_code_cache.entries)) {
|
|
return NULL;
|
|
}
|
|
pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line);
|
|
if (unlikely(pos >= __pyx_code_cache.count) || unlikely(__pyx_code_cache.entries[pos].code_line != code_line)) {
|
|
return NULL;
|
|
}
|
|
code_object = __pyx_code_cache.entries[pos].code_object;
|
|
Py_INCREF(code_object);
|
|
return code_object;
|
|
}
|
|
static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object) {
|
|
int pos, i;
|
|
__Pyx_CodeObjectCacheEntry* entries = __pyx_code_cache.entries;
|
|
if (unlikely(!code_line)) {
|
|
return;
|
|
}
|
|
if (unlikely(!entries)) {
|
|
entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Malloc(64*sizeof(__Pyx_CodeObjectCacheEntry));
|
|
if (likely(entries)) {
|
|
__pyx_code_cache.entries = entries;
|
|
__pyx_code_cache.max_count = 64;
|
|
__pyx_code_cache.count = 1;
|
|
entries[0].code_line = code_line;
|
|
entries[0].code_object = code_object;
|
|
Py_INCREF(code_object);
|
|
}
|
|
return;
|
|
}
|
|
pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line);
|
|
if ((pos < __pyx_code_cache.count) && unlikely(__pyx_code_cache.entries[pos].code_line == code_line)) {
|
|
PyCodeObject* tmp = entries[pos].code_object;
|
|
entries[pos].code_object = code_object;
|
|
Py_DECREF(tmp);
|
|
return;
|
|
}
|
|
if (__pyx_code_cache.count == __pyx_code_cache.max_count) {
|
|
int new_max = __pyx_code_cache.max_count + 64;
|
|
entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Realloc(
|
|
__pyx_code_cache.entries, new_max*sizeof(__Pyx_CodeObjectCacheEntry));
|
|
if (unlikely(!entries)) {
|
|
return;
|
|
}
|
|
__pyx_code_cache.entries = entries;
|
|
__pyx_code_cache.max_count = new_max;
|
|
}
|
|
for (i=__pyx_code_cache.count; i>pos; i--) {
|
|
entries[i] = entries[i-1];
|
|
}
|
|
entries[pos].code_line = code_line;
|
|
entries[pos].code_object = code_object;
|
|
__pyx_code_cache.count++;
|
|
Py_INCREF(code_object);
|
|
}
|
|
|
|
#include "compile.h"
|
|
#include "frameobject.h"
|
|
#include "traceback.h"
|
|
static PyCodeObject* __Pyx_CreateCodeObjectForTraceback(
|
|
const char *funcname, int c_line,
|
|
int py_line, const char *filename) {
|
|
PyCodeObject *py_code = 0;
|
|
PyObject *py_srcfile = 0;
|
|
PyObject *py_funcname = 0;
|
|
#if PY_MAJOR_VERSION < 3
|
|
py_srcfile = PyString_FromString(filename);
|
|
#else
|
|
py_srcfile = PyUnicode_FromString(filename);
|
|
#endif
|
|
if (!py_srcfile) goto bad;
|
|
if (c_line) {
|
|
#if PY_MAJOR_VERSION < 3
|
|
py_funcname = PyString_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line);
|
|
#else
|
|
py_funcname = PyUnicode_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line);
|
|
#endif
|
|
}
|
|
else {
|
|
#if PY_MAJOR_VERSION < 3
|
|
py_funcname = PyString_FromString(funcname);
|
|
#else
|
|
py_funcname = PyUnicode_FromString(funcname);
|
|
#endif
|
|
}
|
|
if (!py_funcname) goto bad;
|
|
py_code = __Pyx_PyCode_New(
|
|
0, /*int argcount,*/
|
|
0, /*int kwonlyargcount,*/
|
|
0, /*int nlocals,*/
|
|
0, /*int stacksize,*/
|
|
0, /*int flags,*/
|
|
__pyx_empty_bytes, /*PyObject *code,*/
|
|
__pyx_empty_tuple, /*PyObject *consts,*/
|
|
__pyx_empty_tuple, /*PyObject *names,*/
|
|
__pyx_empty_tuple, /*PyObject *varnames,*/
|
|
__pyx_empty_tuple, /*PyObject *freevars,*/
|
|
__pyx_empty_tuple, /*PyObject *cellvars,*/
|
|
py_srcfile, /*PyObject *filename,*/
|
|
py_funcname, /*PyObject *name,*/
|
|
py_line, /*int firstlineno,*/
|
|
__pyx_empty_bytes /*PyObject *lnotab*/
|
|
);
|
|
Py_DECREF(py_srcfile);
|
|
Py_DECREF(py_funcname);
|
|
return py_code;
|
|
bad:
|
|
Py_XDECREF(py_srcfile);
|
|
Py_XDECREF(py_funcname);
|
|
return NULL;
|
|
}
|
|
static void __Pyx_AddTraceback(const char *funcname, int c_line,
|
|
int py_line, const char *filename) {
|
|
PyCodeObject *py_code = 0;
|
|
PyObject *py_globals = 0;
|
|
PyFrameObject *py_frame = 0;
|
|
py_code = __pyx_find_code_object(c_line ? c_line : py_line);
|
|
if (!py_code) {
|
|
py_code = __Pyx_CreateCodeObjectForTraceback(
|
|
funcname, c_line, py_line, filename);
|
|
if (!py_code) goto bad;
|
|
__pyx_insert_code_object(c_line ? c_line : py_line, py_code);
|
|
}
|
|
py_globals = PyModule_GetDict(__pyx_m);
|
|
if (!py_globals) goto bad;
|
|
py_frame = PyFrame_New(
|
|
PyThreadState_GET(), /*PyThreadState *tstate,*/
|
|
py_code, /*PyCodeObject *code,*/
|
|
py_globals, /*PyObject *globals,*/
|
|
0 /*PyObject *locals*/
|
|
);
|
|
if (!py_frame) goto bad;
|
|
py_frame->f_lineno = py_line;
|
|
PyTraceBack_Here(py_frame);
|
|
bad:
|
|
Py_XDECREF(py_code);
|
|
Py_XDECREF(py_frame);
|
|
}
|
|
|
|
static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) {
|
|
while (t->p) {
|
|
#if PY_MAJOR_VERSION < 3
|
|
if (t->is_unicode) {
|
|
*t->p = PyUnicode_DecodeUTF8(t->s, t->n - 1, NULL);
|
|
} else if (t->intern) {
|
|
*t->p = PyString_InternFromString(t->s);
|
|
} else {
|
|
*t->p = PyString_FromStringAndSize(t->s, t->n - 1);
|
|
}
|
|
#else /* Python 3+ has unicode identifiers */
|
|
if (t->is_unicode | t->is_str) {
|
|
if (t->intern) {
|
|
*t->p = PyUnicode_InternFromString(t->s);
|
|
} else if (t->encoding) {
|
|
*t->p = PyUnicode_Decode(t->s, t->n - 1, t->encoding, NULL);
|
|
} else {
|
|
*t->p = PyUnicode_FromStringAndSize(t->s, t->n - 1);
|
|
}
|
|
} else {
|
|
*t->p = PyBytes_FromStringAndSize(t->s, t->n - 1);
|
|
}
|
|
#endif
|
|
if (!*t->p)
|
|
return -1;
|
|
++t;
|
|
}
|
|
return 0;
|
|
}
|
|
|
|
static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(char* c_str) {
|
|
return __Pyx_PyUnicode_FromStringAndSize(c_str, strlen(c_str));
|
|
}
|
|
static CYTHON_INLINE char* __Pyx_PyObject_AsString(PyObject* o) {
|
|
Py_ssize_t ignore;
|
|
return __Pyx_PyObject_AsStringAndSize(o, &ignore);
|
|
}
|
|
static CYTHON_INLINE char* __Pyx_PyObject_AsStringAndSize(PyObject* o, Py_ssize_t *length) {
|
|
#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT
|
|
if (
|
|
#if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
|
|
__Pyx_sys_getdefaultencoding_not_ascii &&
|
|
#endif
|
|
PyUnicode_Check(o)) {
|
|
#if PY_VERSION_HEX < 0x03030000
|
|
char* defenc_c;
|
|
PyObject* defenc = _PyUnicode_AsDefaultEncodedString(o, NULL);
|
|
if (!defenc) return NULL;
|
|
defenc_c = PyBytes_AS_STRING(defenc);
|
|
#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
|
|
{
|
|
char* end = defenc_c + PyBytes_GET_SIZE(defenc);
|
|
char* c;
|
|
for (c = defenc_c; c < end; c++) {
|
|
if ((unsigned char) (*c) >= 128) {
|
|
PyUnicode_AsASCIIString(o);
|
|
return NULL;
|
|
}
|
|
}
|
|
}
|
|
#endif /*__PYX_DEFAULT_STRING_ENCODING_IS_ASCII*/
|
|
*length = PyBytes_GET_SIZE(defenc);
|
|
return defenc_c;
|
|
#else /* PY_VERSION_HEX < 0x03030000 */
|
|
if (PyUnicode_READY(o) == -1) return NULL;
|
|
#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
|
|
if (PyUnicode_IS_ASCII(o)) {
|
|
*length = PyUnicode_GET_DATA_SIZE(o);
|
|
return PyUnicode_AsUTF8(o);
|
|
} else {
|
|
PyUnicode_AsASCIIString(o);
|
|
return NULL;
|
|
}
|
|
#else /* __PYX_DEFAULT_STRING_ENCODING_IS_ASCII */
|
|
return PyUnicode_AsUTF8AndSize(o, length);
|
|
#endif /* __PYX_DEFAULT_STRING_ENCODING_IS_ASCII */
|
|
#endif /* PY_VERSION_HEX < 0x03030000 */
|
|
} else
|
|
#endif /* __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT */
|
|
{
|
|
char* result;
|
|
int r = PyBytes_AsStringAndSize(o, &result, length);
|
|
if (r < 0) {
|
|
return NULL;
|
|
} else {
|
|
return result;
|
|
}
|
|
}
|
|
}
|
|
static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject* x) {
|
|
int is_true = x == Py_True;
|
|
if (is_true | (x == Py_False) | (x == Py_None)) return is_true;
|
|
else return PyObject_IsTrue(x);
|
|
}
|
|
static CYTHON_INLINE PyObject* __Pyx_PyNumber_Int(PyObject* x) {
|
|
PyNumberMethods *m;
|
|
const char *name = NULL;
|
|
PyObject *res = NULL;
|
|
#if PY_MAJOR_VERSION < 3
|
|
if (PyInt_Check(x) || PyLong_Check(x))
|
|
#else
|
|
if (PyLong_Check(x))
|
|
#endif
|
|
return Py_INCREF(x), x;
|
|
m = Py_TYPE(x)->tp_as_number;
|
|
#if PY_MAJOR_VERSION < 3
|
|
if (m && m->nb_int) {
|
|
name = "int";
|
|
res = PyNumber_Int(x);
|
|
}
|
|
else if (m && m->nb_long) {
|
|
name = "long";
|
|
res = PyNumber_Long(x);
|
|
}
|
|
#else
|
|
if (m && m->nb_int) {
|
|
name = "int";
|
|
res = PyNumber_Long(x);
|
|
}
|
|
#endif
|
|
if (res) {
|
|
#if PY_MAJOR_VERSION < 3
|
|
if (!PyInt_Check(res) && !PyLong_Check(res)) {
|
|
#else
|
|
if (!PyLong_Check(res)) {
|
|
#endif
|
|
PyErr_Format(PyExc_TypeError,
|
|
"__%s__ returned non-%s (type %.200s)",
|
|
name, name, Py_TYPE(res)->tp_name);
|
|
Py_DECREF(res);
|
|
return NULL;
|
|
}
|
|
}
|
|
else if (!PyErr_Occurred()) {
|
|
PyErr_SetString(PyExc_TypeError,
|
|
"an integer is required");
|
|
}
|
|
return res;
|
|
}
|
|
static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject* b) {
|
|
Py_ssize_t ival;
|
|
PyObject* x = PyNumber_Index(b);
|
|
if (!x) return -1;
|
|
ival = PyInt_AsSsize_t(x);
|
|
Py_DECREF(x);
|
|
return ival;
|
|
}
|
|
static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t ival) {
|
|
#if PY_VERSION_HEX < 0x02050000
|
|
if (ival <= LONG_MAX)
|
|
return PyInt_FromLong((long)ival);
|
|
else {
|
|
unsigned char *bytes = (unsigned char *) &ival;
|
|
int one = 1; int little = (int)*(unsigned char*)&one;
|
|
return _PyLong_FromByteArray(bytes, sizeof(size_t), little, 0);
|
|
}
|
|
#else
|
|
return PyInt_FromSize_t(ival);
|
|
#endif
|
|
}
|
|
static CYTHON_INLINE size_t __Pyx_PyInt_AsSize_t(PyObject* x) {
|
|
unsigned PY_LONG_LONG val = __Pyx_PyInt_AsUnsignedLongLong(x);
|
|
if (unlikely(val != (unsigned PY_LONG_LONG)(size_t)val)) {
|
|
if ((val != (unsigned PY_LONG_LONG)-1) || !PyErr_Occurred())
|
|
PyErr_SetString(PyExc_OverflowError,
|
|
"value too large to convert to size_t");
|
|
return (size_t)-1;
|
|
}
|
|
return (size_t)val;
|
|
}
|
|
|
|
|
|
#endif /* Py_PYTHON_H */
|