Generated by Cython 3.0.11
Yellow lines hint at Python interaction.
Click on a line that starts with a "+
" to see the C code that Cython generated for it.
Raw output: fcio.c
+001: from fcio_def cimport FCIOOpen, FCIOClose, FCIODebug, FCIOGetRecord, FCIOTimeout, FCIOStreamHandle, FCIOData, FCIOTag
__pyx_t_4 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 1, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); if (PyDict_SetItem(__pyx_d, __pyx_n_s_test, __pyx_t_4) < 0) __PYX_ERR(4, 1, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
002: from fcio_def cimport FCIOMaxChannels, FCIOMaxSamples, FCIOMaxPulses, FCIOTraceBufferLength
003: from fcio_def cimport FCIOSetMemField
004:
005: cimport cython
006: cimport numpy
007:
+008: import tempfile, os, subprocess
__pyx_t_7 = __Pyx_ImportDottedModule(__pyx_n_s_tempfile, NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(4, 8, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (PyDict_SetItem(__pyx_d, __pyx_n_s_tempfile, __pyx_t_7) < 0) __PYX_ERR(4, 8, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __pyx_t_7 = __Pyx_ImportDottedModule(__pyx_n_s_os, NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(4, 8, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (PyDict_SetItem(__pyx_d, __pyx_n_s_os, __pyx_t_7) < 0) __PYX_ERR(4, 8, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __pyx_t_7 = __Pyx_ImportDottedModule(__pyx_n_s_subprocess, NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(4, 8, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (PyDict_SetItem(__pyx_d, __pyx_n_s_subprocess, __pyx_t_7) < 0) __PYX_ERR(4, 8, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
+009: from warnings import warn
__pyx_t_7 = PyList_New(1); if (unlikely(!__pyx_t_7)) __PYX_ERR(4, 9, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_INCREF(__pyx_n_s_warn); __Pyx_GIVEREF(__pyx_n_s_warn); if (__Pyx_PyList_SET_ITEM(__pyx_t_7, 0, __pyx_n_s_warn)) __PYX_ERR(4, 9, __pyx_L1_error); __pyx_t_4 = __Pyx_Import(__pyx_n_s_warnings, __pyx_t_7, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 9, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __pyx_t_7 = __Pyx_ImportFrom(__pyx_t_4, __pyx_n_s_warn); if (unlikely(!__pyx_t_7)) __PYX_ERR(4, 9, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (PyDict_SetItem(__pyx_d, __pyx_n_s_warn, __pyx_t_7) < 0) __PYX_ERR(4, 9, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
010:
011: include "dead_interval_tracker.pyx"
012: include "extension.pyx"
013: include "config.pyx"
014: include "event.pyx"
015: include "recevent.pyx"
016: include "status.pyx"
017:
018: include "../cy_fsp/fsp.pyx"
019:
+020: cdef class Tags:
struct __pyx_obj_4fcio_Tags { PyObject_HEAD };
021: """
022: A wrapper class for the fcio tag enum.
023: Provides supported tags as attributes.
024: """
025:
+026: Config = FCIOTag.FCIOConfig
__pyx_t_4 = __Pyx_PyInt_From_FCIOTag(FCIOConfig); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 26, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_4fcio_Tags, __pyx_n_s_Config, __pyx_t_4) < 0) __PYX_ERR(4, 26, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; PyType_Modified(__pyx_ptype_4fcio_Tags);
+027: Event = FCIOTag.FCIOEvent
__pyx_t_4 = __Pyx_PyInt_From_FCIOTag(FCIOEvent); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 27, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_4fcio_Tags, __pyx_n_s_Event, __pyx_t_4) < 0) __PYX_ERR(4, 27, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; PyType_Modified(__pyx_ptype_4fcio_Tags);
+028: Status = FCIOTag.FCIOStatus
__pyx_t_4 = __Pyx_PyInt_From_FCIOTag(FCIOStatus); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 28, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_4fcio_Tags, __pyx_n_s_Status, __pyx_t_4) < 0) __PYX_ERR(4, 28, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; PyType_Modified(__pyx_ptype_4fcio_Tags);
+029: RecEvent = FCIOTag.FCIORecEvent
__pyx_t_4 = __Pyx_PyInt_From_FCIOTag(FCIORecEvent); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 29, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_4fcio_Tags, __pyx_n_s_RecEvent, __pyx_t_4) < 0) __PYX_ERR(4, 29, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; PyType_Modified(__pyx_ptype_4fcio_Tags);
+030: SparseEvent = FCIOTag.FCIOSparseEvent
__pyx_t_4 = __Pyx_PyInt_From_FCIOTag(FCIOSparseEvent); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 30, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_4fcio_Tags, __pyx_n_s_SparseEvent, __pyx_t_4) < 0) __PYX_ERR(4, 30, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; PyType_Modified(__pyx_ptype_4fcio_Tags);
+031: EventHeader = FCIOTag.FCIOEventHeader
__pyx_t_4 = __Pyx_PyInt_From_FCIOTag(FCIOEventHeader); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 31, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_4fcio_Tags, __pyx_n_s_EventHeader, __pyx_t_4) < 0) __PYX_ERR(4, 31, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; PyType_Modified(__pyx_ptype_4fcio_Tags);
+032: FSPConfig = FCIOTag.FCIOFSPConfig
__pyx_t_4 = __Pyx_PyInt_From_FCIOTag(FCIOFSPConfig); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 32, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_4fcio_Tags, __pyx_n_s_FSPConfig, __pyx_t_4) < 0) __PYX_ERR(4, 32, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; PyType_Modified(__pyx_ptype_4fcio_Tags);
+033: FSPEvent = FCIOTag.FCIOFSPEvent
__pyx_t_4 = __Pyx_PyInt_From_FCIOTag(FCIOFSPEvent); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 33, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_4fcio_Tags, __pyx_n_s_FSPEvent, __pyx_t_4) < 0) __PYX_ERR(4, 33, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; PyType_Modified(__pyx_ptype_4fcio_Tags);
+034: FSPStatus = FCIOTag.FCIOFSPStatus
__pyx_t_4 = __Pyx_PyInt_From_FCIOTag(FCIOFSPStatus); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 34, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_4fcio_Tags, __pyx_n_s_FSPStatus, __pyx_t_4) < 0) __PYX_ERR(4, 34, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; PyType_Modified(__pyx_ptype_4fcio_Tags);
035:
036: # could be replaced with FCIOTagStr(int tag) in fcio_utils.c
+037: def str(tag):
/* Python wrapper */ static PyObject *__pyx_pw_4fcio_4Tags_1str(PyObject *__pyx_v_tag, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ static PyMethodDef __pyx_mdef_4fcio_4Tags_1str = {"str", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4fcio_4Tags_1str, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; static PyObject *__pyx_pw_4fcio_4Tags_1str(PyObject *__pyx_v_tag, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("str (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("str", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "str", 0))) return NULL; __pyx_r = __pyx_pf_4fcio_4Tags_str(((struct __pyx_obj_4fcio_Tags *)__pyx_v_tag)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_4fcio_4Tags_str(struct __pyx_obj_4fcio_Tags *__pyx_v_tag) { PyObject *__pyx_r = NULL; /* … */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("fcio.Tags.str", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* … */ __pyx_tuple__67 = PyTuple_Pack(1, __pyx_n_s_tag); if (unlikely(!__pyx_tuple__67)) __PYX_ERR(4, 37, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__67); __Pyx_GIVEREF(__pyx_tuple__67); /* … */ __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_4fcio_4Tags_1str, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Tags_str, NULL, __pyx_n_s_fcio, __pyx_d, ((PyObject *)__pyx_codeobj__68)); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 37, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_4fcio_Tags, __pyx_n_s_str, __pyx_t_4) < 0) __PYX_ERR(4, 37, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; PyType_Modified(__pyx_ptype_4fcio_Tags); __pyx_codeobj__68 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__67, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_fcio_cy_fcio_fcio_pyx, __pyx_n_s_str, 37, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__68)) __PYX_ERR(4, 37, __pyx_L1_error)
+038: if tag == FCIOTag.FCIOConfig:
__pyx_t_1 = __Pyx_PyInt_From_FCIOTag(FCIOConfig); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 38, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = PyObject_RichCompare(((PyObject *)__pyx_v_tag), __pyx_t_1, Py_EQ); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 38, __pyx_L1_error) __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_ERR(4, 38, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (__pyx_t_3) { /* … */ }
+039: return "Config"
__Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_n_s_Config); __pyx_r = __pyx_n_s_Config; goto __pyx_L0;
+040: elif tag == FCIOTag.FCIOEvent:
__pyx_t_2 = __Pyx_PyInt_From_FCIOTag(FCIOEvent); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 40, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_1 = PyObject_RichCompare(((PyObject *)__pyx_v_tag), __pyx_t_2, Py_EQ); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 40, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(4, 40, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_3) { /* … */ }
+041: return "Event"
__Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_n_s_Event); __pyx_r = __pyx_n_s_Event; goto __pyx_L0;
+042: elif tag == FCIOTag.FCIOStatus:
__pyx_t_1 = __Pyx_PyInt_From_FCIOTag(FCIOStatus); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 42, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = PyObject_RichCompare(((PyObject *)__pyx_v_tag), __pyx_t_1, Py_EQ); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 42, __pyx_L1_error) __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_ERR(4, 42, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (__pyx_t_3) { /* … */ }
+043: return "Status"
__Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_n_s_Status); __pyx_r = __pyx_n_s_Status; goto __pyx_L0;
+044: elif tag == FCIOTag.FCIORecEvent:
__pyx_t_2 = __Pyx_PyInt_From_FCIOTag(FCIORecEvent); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 44, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_1 = PyObject_RichCompare(((PyObject *)__pyx_v_tag), __pyx_t_2, Py_EQ); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 44, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(4, 44, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_3) { /* … */ }
+045: return "RecEvent"
__Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_n_s_RecEvent); __pyx_r = __pyx_n_s_RecEvent; goto __pyx_L0;
+046: elif tag == FCIOTag.FCIOSparseEvent:
__pyx_t_1 = __Pyx_PyInt_From_FCIOTag(FCIOSparseEvent); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 46, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = PyObject_RichCompare(((PyObject *)__pyx_v_tag), __pyx_t_1, Py_EQ); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 46, __pyx_L1_error) __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_ERR(4, 46, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (__pyx_t_3) { /* … */ }
+047: return "SparseEvent"
__Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_n_s_SparseEvent); __pyx_r = __pyx_n_s_SparseEvent; goto __pyx_L0;
+048: elif tag == FCIOTag.FCIOEventHeader:
__pyx_t_2 = __Pyx_PyInt_From_FCIOTag(FCIOEventHeader); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 48, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_1 = PyObject_RichCompare(((PyObject *)__pyx_v_tag), __pyx_t_2, Py_EQ); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 48, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(4, 48, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_3) { /* … */ }
+049: return "EventHeader"
__Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_n_s_EventHeader); __pyx_r = __pyx_n_s_EventHeader; goto __pyx_L0;
+050: elif tag == FCIOTag.FCIOFSPConfig:
__pyx_t_1 = __Pyx_PyInt_From_FCIOTag(FCIOFSPConfig); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 50, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = PyObject_RichCompare(((PyObject *)__pyx_v_tag), __pyx_t_1, Py_EQ); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 50, __pyx_L1_error) __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_ERR(4, 50, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (__pyx_t_3) { /* … */ }
+051: return "FSPConfig"
__Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_n_s_FSPConfig); __pyx_r = __pyx_n_s_FSPConfig; goto __pyx_L0;
+052: elif tag == FCIOTag.FCIOFSPEvent:
__pyx_t_2 = __Pyx_PyInt_From_FCIOTag(FCIOFSPEvent); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 52, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_1 = PyObject_RichCompare(((PyObject *)__pyx_v_tag), __pyx_t_2, Py_EQ); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 52, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(4, 52, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_3) { /* … */ }
+053: return "FSPEvent"
__Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_n_s_FSPEvent); __pyx_r = __pyx_n_s_FSPEvent; goto __pyx_L0;
+054: elif tag == FCIOTag.FCIOFSPStatus:
__pyx_t_1 = __Pyx_PyInt_From_FCIOTag(FCIOFSPStatus); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 54, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = PyObject_RichCompare(((PyObject *)__pyx_v_tag), __pyx_t_1, Py_EQ); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 54, __pyx_L1_error) __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_ERR(4, 54, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (__pyx_t_3) { /* … */ }
+055: return "FSPStatus"
__Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_n_s_FSPStatus); __pyx_r = __pyx_n_s_FSPStatus; goto __pyx_L0;
056: else:
+057: return "Unknown"
/*else*/ { __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_n_s_Unknown); __pyx_r = __pyx_n_s_Unknown; goto __pyx_L0; }
058:
+059: class Limits:
__pyx_t_4 = __Pyx_Py3MetaclassPrepare((PyObject *) NULL, __pyx_empty_tuple, __pyx_n_s_Limits, __pyx_n_s_Limits, (PyObject *) NULL, __pyx_n_s_fcio, __pyx_kp_s_A_wrapper_class_to_expose_the_c); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 59, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); /* … */ __pyx_t_7 = __Pyx_Py3ClassCreate(((PyObject*)&PyType_Type), __pyx_n_s_Limits, __pyx_empty_tuple, __pyx_t_4, NULL, 0, 0); if (unlikely(!__pyx_t_7)) __PYX_ERR(4, 59, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (PyDict_SetItem(__pyx_d, __pyx_n_s_Limits, __pyx_t_7) < 0) __PYX_ERR(4, 59, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
060: """
061: A wrapper class to expose the compile time defines used in fcio.c
062: """
+063: MaxChannels = FCIOMaxChannels
__pyx_t_7 = __Pyx_PyInt_From_int(FCIOMaxChannels); if (unlikely(!__pyx_t_7)) __PYX_ERR(4, 63, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (__Pyx_SetNameInClass(__pyx_t_4, __pyx_n_s_MaxChannels, __pyx_t_7) < 0) __PYX_ERR(4, 63, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
+064: MaxSamples = FCIOMaxSamples
__pyx_t_7 = __Pyx_PyInt_From_int(FCIOMaxSamples); if (unlikely(!__pyx_t_7)) __PYX_ERR(4, 64, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (__Pyx_SetNameInClass(__pyx_t_4, __pyx_n_s_MaxSamples, __pyx_t_7) < 0) __PYX_ERR(4, 64, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
+065: MaxPulses = FCIOMaxPulses
__pyx_t_7 = __Pyx_PyInt_From_int(FCIOMaxPulses); if (unlikely(!__pyx_t_7)) __PYX_ERR(4, 65, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (__Pyx_SetNameInClass(__pyx_t_4, __pyx_n_s_MaxPulses, __pyx_t_7) < 0) __PYX_ERR(4, 65, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
+066: TraceBufferLength = FCIOTraceBufferLength
__pyx_t_7 = __Pyx_PyInt_From_int(FCIOTraceBufferLength); if (unlikely(!__pyx_t_7)) __PYX_ERR(4, 66, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (__Pyx_SetNameInClass(__pyx_t_4, __pyx_n_s_TraceBufferLength, __pyx_t_7) < 0) __PYX_ERR(4, 66, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
067:
+068: cdef class FCIO:
struct __pyx_obj_4fcio_FCIO { PyObject_HEAD struct __pyx_vtabstruct_4fcio_FCIO *__pyx_vtab; FCIOData *_fcio_data; int _timeout; int _buffersize; int _debug; int _tag; PyObject *_compression; PyObject *_peer; PyObject *_compression_process; PyObject *_peer_is_memory; struct __pyx_obj_4fcio_Config *config; struct __pyx_obj_4fcio_Event *event; struct __pyx_obj_4fcio_RecEvent *recevent; struct __pyx_obj_4fcio_Status *status; int _extended; struct __pyx_obj_4fcio_FSP *_fsp; }; /* … */ struct __pyx_vtabstruct_4fcio_FCIO { PyObject *(*get_record)(struct __pyx_obj_4fcio_FCIO *, int __pyx_skip_dispatch); }; static struct __pyx_vtabstruct_4fcio_FCIO *__pyx_vtabptr_4fcio_FCIO;
069: """
070: The main class providing access to the data fields.
071: Interaction mainly by using the get_record() function or FCIO's properties.
072:
073: Parameters
074: ----------
075: peer : str
076: the path to the peer to open, can be zst or gzip compressed files.
077:
078: timeout : int
079: the timeout with which the connection should happend in milliseconds.
080: default: 0
081: -1 : wait indefinitely
082: >=0 : wait these milliseconds and return
083:
084: buffersize : int
085: the size of the internal buffer used by bufio in bytes.
086: default: 0 uses bufios sane default size
087:
088: debug : int
089: sets the debug level of the fcio.c library using FCIODebug(debug)
090: does not affect the verbosity of fcio-py parts
091: default: 0
092:
093: compression : str
094: allows decompressing the file pointed to by peer while reading.
095: 'zst' : use zstd executable to open file. autodetected if file ends with '.zst'
096: 'gzip' : use gzip executable to open file. autodetected if file ends with '.gz'
097: default 'auto' : determines possible compression by inspecting the peer ending
098:
099: extended : bool
100: enables additional properties of the FCIO record classes by replacing the FCIO properties with their extended classes.
101: e.g. type(FCIO.event) == Event or EventExt
102: some of these additions require additional calculations during reading, which might not be required and can be turned off by
103: setting 'extended' to False.
104: default: True
105:
106: these properties provide access to:
107: - values derived from more basic values in the record
108: - explicit naming of certain field entries
109: - explicit limits to some array accessing, which fall on the responsibility of the programmer in the fcio.c library
110:
111: examples:
112: - FCIO.event.card_address exposes an unsigned short array for the channels recorded in this event
113: - FCIO.event.utc_unix applies the reference way to calculate the absolute time from the Config and Event records (timestamp and timeoffset depending on gps clock presence)
114: - FCIO.event.trace array only returns the updated waveforms if the record was a SparseEvent
115: - FCIO.event.fpga_baseline/.fpga_energy in correct units for both firmware versions
116: - ...
117: """
118:
119: cdef FCIOData* _fcio_data
120: cdef int _timeout
121: cdef int _buffersize
122: cdef int _debug
123: cdef int _tag
124:
125: cdef object _compression # compression type, <str>
126: cdef object _peer # path to data file, <str>
127: cdef object _compression_process # handle for the subprocess
128: cdef object _peer_is_memory # mem:// peer is special, we save a boolean to remember
129:
130: cdef Config config
131: cdef Event event
132: cdef RecEvent recevent
133: cdef Status status
134: cdef bint _extended
135:
136: cdef FSP _fsp
137:
+138: def __cinit__(self, peer : str | char[::1] = None, timeout : int = 0, buffersize : int = 0, debug : int = 0, compression : str = 'auto', extended : bool = False):
/* Python wrapper */ static int __pyx_pw_4fcio_4FCIO_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static int __pyx_pw_4fcio_4FCIO_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_peer = 0; PyObject *__pyx_v_timeout = 0; PyObject *__pyx_v_buffersize = 0; PyObject *__pyx_v_debug = 0; PyObject *__pyx_v_compression = 0; PyObject *__pyx_v_extended = 0; CYTHON_UNUSED Py_ssize_t __pyx_nargs; CYTHON_UNUSED PyObject *const *__pyx_kwvalues; int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0); #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return -1; #endif __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_peer,&__pyx_n_s_timeout,&__pyx_n_s_buffersize,&__pyx_n_s_debug,&__pyx_n_s_compression,&__pyx_n_s_extended,0}; PyObject* values[6] = {0,0,0,0,0,0}; values[0] = __Pyx_Arg_NewRef_VARARGS(((PyObject *)Py_None)); values[1] = __Pyx_Arg_NewRef_VARARGS(__pyx_k__22); values[2] = __Pyx_Arg_NewRef_VARARGS(__pyx_k__23); values[3] = __Pyx_Arg_NewRef_VARARGS(__pyx_k__24); values[4] = __Pyx_Arg_NewRef_VARARGS(((PyObject*)__pyx_n_s_auto)); values[5] = __Pyx_Arg_NewRef_VARARGS(((PyObject *)Py_False)); if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 6: values[5] = __Pyx_Arg_VARARGS(__pyx_args, 5); CYTHON_FALLTHROUGH; case 5: values[4] = __Pyx_Arg_VARARGS(__pyx_args, 4); CYTHON_FALLTHROUGH; case 4: values[3] = __Pyx_Arg_VARARGS(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = __Pyx_Arg_VARARGS(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_VARARGS(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_VARARGS(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_VARARGS(__pyx_kwds); switch (__pyx_nargs) { case 0: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_VARARGS(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_peer); if (value) { values[0] = __Pyx_Arg_NewRef_VARARGS(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(4, 138, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 1: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_VARARGS(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_timeout); if (value) { values[1] = __Pyx_Arg_NewRef_VARARGS(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(4, 138, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_VARARGS(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_buffersize); if (value) { values[2] = __Pyx_Arg_NewRef_VARARGS(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(4, 138, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 3: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_VARARGS(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_debug); if (value) { values[3] = __Pyx_Arg_NewRef_VARARGS(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(4, 138, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 4: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_VARARGS(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_compression); if (value) { values[4] = __Pyx_Arg_NewRef_VARARGS(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(4, 138, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 5: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_VARARGS(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_extended); if (value) { values[5] = __Pyx_Arg_NewRef_VARARGS(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(4, 138, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "__cinit__") < 0)) __PYX_ERR(4, 138, __pyx_L3_error) } } else { switch (__pyx_nargs) { case 6: values[5] = __Pyx_Arg_VARARGS(__pyx_args, 5); CYTHON_FALLTHROUGH; case 5: values[4] = __Pyx_Arg_VARARGS(__pyx_args, 4); CYTHON_FALLTHROUGH; case 4: values[3] = __Pyx_Arg_VARARGS(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = __Pyx_Arg_VARARGS(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_VARARGS(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_VARARGS(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_peer = values[0]; __pyx_v_timeout = ((PyObject*)values[1]); __pyx_v_buffersize = ((PyObject*)values[2]); __pyx_v_debug = ((PyObject*)values[3]); __pyx_v_compression = ((PyObject*)values[4]); __pyx_v_extended = values[5]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 0, 6, __pyx_nargs); __PYX_ERR(4, 138, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_VARARGS(values[__pyx_temp]); } } __Pyx_AddTraceback("fcio.FCIO.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return -1; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_timeout), (&PyInt_Type), 0, "timeout", 1))) __PYX_ERR(4, 138, __pyx_L1_error) if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_buffersize), (&PyInt_Type), 0, "buffersize", 1))) __PYX_ERR(4, 138, __pyx_L1_error) if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_debug), (&PyInt_Type), 0, "debug", 1))) __PYX_ERR(4, 138, __pyx_L1_error) if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_compression), (&PyString_Type), 0, "compression", 1))) __PYX_ERR(4, 138, __pyx_L1_error) __pyx_r = __pyx_pf_4fcio_4FCIO___cinit__(((struct __pyx_obj_4fcio_FCIO *)__pyx_v_self), __pyx_v_peer, __pyx_v_timeout, __pyx_v_buffersize, __pyx_v_debug, __pyx_v_compression, __pyx_v_extended); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = -1; __pyx_L0:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_VARARGS(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_4fcio_4FCIO___cinit__(struct __pyx_obj_4fcio_FCIO *__pyx_v_self, PyObject *__pyx_v_peer, PyObject *__pyx_v_timeout, PyObject *__pyx_v_buffersize, PyObject *__pyx_v_debug, PyObject *__pyx_v_compression, PyObject *__pyx_v_extended) { int __pyx_r; /* … */ /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_AddTraceback("fcio.FCIO.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } /* … */ if (!(likely(__Pyx_Py3Int_CheckExact(__pyx_int_0)) || __Pyx_RaiseUnexpectedTypeError("int", __pyx_int_0))) __PYX_ERR(4, 138, __pyx_L1_error) __Pyx_INCREF(__pyx_int_0); __pyx_k__22 = ((PyObject*)__pyx_int_0); __Pyx_GIVEREF(__pyx_int_0); if (!(likely(__Pyx_Py3Int_CheckExact(__pyx_int_0)) || __Pyx_RaiseUnexpectedTypeError("int", __pyx_int_0))) __PYX_ERR(4, 138, __pyx_L1_error) __Pyx_INCREF(__pyx_int_0); __pyx_k__23 = ((PyObject*)__pyx_int_0); __Pyx_GIVEREF(__pyx_int_0); if (!(likely(__Pyx_Py3Int_CheckExact(__pyx_int_0)) || __Pyx_RaiseUnexpectedTypeError("int", __pyx_int_0))) __PYX_ERR(4, 138, __pyx_L1_error) __Pyx_INCREF(__pyx_int_0); __pyx_k__24 = ((PyObject*)__pyx_int_0); __Pyx_GIVEREF(__pyx_int_0);
+139: self._fcio_data = NULL
__pyx_v_self->_fcio_data = NULL;
+140: self._peer = peer
__Pyx_INCREF(__pyx_v_peer); __Pyx_GIVEREF(__pyx_v_peer); __Pyx_GOTREF(__pyx_v_self->_peer); __Pyx_DECREF(__pyx_v_self->_peer); __pyx_v_self->_peer = __pyx_v_peer;
+141: self._buffersize = buffersize
__pyx_t_1 = __Pyx_PyInt_As_int(__pyx_v_buffersize); if (unlikely((__pyx_t_1 == (int)-1) && PyErr_Occurred())) __PYX_ERR(4, 141, __pyx_L1_error) __pyx_v_self->_buffersize = __pyx_t_1;
+142: self._timeout = timeout
__pyx_t_1 = __Pyx_PyInt_As_int(__pyx_v_timeout); if (unlikely((__pyx_t_1 == (int)-1) && PyErr_Occurred())) __PYX_ERR(4, 142, __pyx_L1_error) __pyx_v_self->_timeout = __pyx_t_1;
+143: self._debug = debug
__pyx_t_1 = __Pyx_PyInt_As_int(__pyx_v_debug); if (unlikely((__pyx_t_1 == (int)-1) && PyErr_Occurred())) __PYX_ERR(4, 143, __pyx_L1_error) __pyx_v_self->_debug = __pyx_t_1;
+144: self._compression = compression
__Pyx_INCREF(__pyx_v_compression); __Pyx_GIVEREF(__pyx_v_compression); __Pyx_GOTREF(__pyx_v_self->_compression); __Pyx_DECREF(__pyx_v_self->_compression); __pyx_v_self->_compression = __pyx_v_compression;
+145: self._extended = extended
__pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_extended); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) __PYX_ERR(4, 145, __pyx_L1_error) __pyx_v_self->_extended = __pyx_t_2;
146:
+147: if peer:
__pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_peer); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(4, 147, __pyx_L1_error) if (__pyx_t_2) { /* … */ }
+148: self.open(peer, timeout, buffersize, debug, compression, extended)
__pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_open); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 148, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = NULL; __pyx_t_6 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_4))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_5)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); __pyx_t_6 = 1; } } #endif { PyObject *__pyx_callargs[7] = {__pyx_t_5, __pyx_v_peer, __pyx_v_timeout, __pyx_v_buffersize, __pyx_v_debug, __pyx_v_compression, __pyx_v_extended}; __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_6, 6+__pyx_t_6); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 148, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
149:
+150: def __dealloc__(self):
/* Python wrapper */ static void __pyx_pw_4fcio_4FCIO_3__dealloc__(PyObject *__pyx_v_self); /*proto*/ static void __pyx_pw_4fcio_4FCIO_3__dealloc__(PyObject *__pyx_v_self) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__dealloc__ (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_pf_4fcio_4FCIO_2__dealloc__(((struct __pyx_obj_4fcio_FCIO *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); } static void __pyx_pf_4fcio_4FCIO_2__dealloc__(struct __pyx_obj_4fcio_FCIO *__pyx_v_self) { /* … */ /* function exit code */ }
+151: if self._fcio_data != NULL:
__pyx_t_1 = (__pyx_v_self->_fcio_data != NULL); if (__pyx_t_1) { /* … */ }
+152: FCIOClose(self._fcio_data)
(void)(FCIOClose(__pyx_v_self->_fcio_data));
153:
+154: def __enter__(self):
/* Python wrapper */ static PyObject *__pyx_pw_4fcio_4FCIO_5__enter__(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ static PyMethodDef __pyx_mdef_4fcio_4FCIO_5__enter__ = {"__enter__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4fcio_4FCIO_5__enter__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; static PyObject *__pyx_pw_4fcio_4FCIO_5__enter__(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__enter__ (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("__enter__", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__enter__", 0))) return NULL; __pyx_r = __pyx_pf_4fcio_4FCIO_4__enter__(((struct __pyx_obj_4fcio_FCIO *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_4fcio_4FCIO_4__enter__(struct __pyx_obj_4fcio_FCIO *__pyx_v_self) { PyObject *__pyx_r = NULL; /* … */ /* function exit code */ __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* … */ __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_4fcio_4FCIO_5__enter__, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_FCIO___enter, NULL, __pyx_n_s_fcio, __pyx_d, ((PyObject *)__pyx_codeobj__72)); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 154, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_4fcio_FCIO, __pyx_n_s_enter, __pyx_t_4) < 0) __PYX_ERR(4, 154, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; PyType_Modified(__pyx_ptype_4fcio_FCIO); /* … */ __pyx_codeobj__72 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__39, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_fcio_cy_fcio_fcio_pyx, __pyx_n_s_enter, 154, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__72)) __PYX_ERR(4, 154, __pyx_L1_error)
+155: return self
__Pyx_XDECREF(__pyx_r); __Pyx_INCREF((PyObject *)__pyx_v_self); __pyx_r = ((PyObject *)__pyx_v_self); goto __pyx_L0;
156:
+157: def __exit__(self, exc_type, exc_val, exc_tb):
/* Python wrapper */ static PyObject *__pyx_pw_4fcio_4FCIO_7__exit__(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ static PyMethodDef __pyx_mdef_4fcio_4FCIO_7__exit__ = {"__exit__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4fcio_4FCIO_7__exit__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; static PyObject *__pyx_pw_4fcio_4FCIO_7__exit__(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { CYTHON_UNUSED PyObject *__pyx_v_exc_type = 0; CYTHON_UNUSED PyObject *__pyx_v_exc_val = 0; CYTHON_UNUSED PyObject *__pyx_v_exc_tb = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__exit__ (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_exc_type,&__pyx_n_s_exc_val,&__pyx_n_s_exc_tb,0}; PyObject* values[3] = {0,0,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_exc_type)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(4, 157, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_exc_val)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(4, 157, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("__exit__", 1, 3, 3, 1); __PYX_ERR(4, 157, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (likely((values[2] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_exc_tb)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[2]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(4, 157, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("__exit__", 1, 3, 3, 2); __PYX_ERR(4, 157, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "__exit__") < 0)) __PYX_ERR(4, 157, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 3)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); } __pyx_v_exc_type = values[0]; __pyx_v_exc_val = values[1]; __pyx_v_exc_tb = values[2]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("__exit__", 1, 3, 3, __pyx_nargs); __PYX_ERR(4, 157, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("fcio.FCIO.__exit__", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_4fcio_4FCIO_6__exit__(((struct __pyx_obj_4fcio_FCIO *)__pyx_v_self), __pyx_v_exc_type, __pyx_v_exc_val, __pyx_v_exc_tb); int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_4fcio_4FCIO_6__exit__(struct __pyx_obj_4fcio_FCIO *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_exc_type, CYTHON_UNUSED PyObject *__pyx_v_exc_val, CYTHON_UNUSED PyObject *__pyx_v_exc_tb) { PyObject *__pyx_r = NULL; /* … */ /* function exit code */ __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("fcio.FCIO.__exit__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* … */ __pyx_tuple__73 = PyTuple_Pack(4, __pyx_n_s_self, __pyx_n_s_exc_type, __pyx_n_s_exc_val, __pyx_n_s_exc_tb); if (unlikely(!__pyx_tuple__73)) __PYX_ERR(4, 157, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__73); __Pyx_GIVEREF(__pyx_tuple__73); /* … */ __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_4fcio_4FCIO_7__exit__, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_FCIO___exit, NULL, __pyx_n_s_fcio, __pyx_d, ((PyObject *)__pyx_codeobj__74)); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 157, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_4fcio_FCIO, __pyx_n_s_exit, __pyx_t_4) < 0) __PYX_ERR(4, 157, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; PyType_Modified(__pyx_ptype_4fcio_FCIO); __pyx_codeobj__74 = (PyObject*)__Pyx_PyCode_New(4, 0, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__73, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_fcio_cy_fcio_fcio_pyx, __pyx_n_s_exit, 157, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__74)) __PYX_ERR(4, 157, __pyx_L1_error)
+158: self.close()
__pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_close); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 158, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; __pyx_t_4 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_4 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 0+__pyx_t_4); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 158, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
159:
+160: def __del__(self):
/* Python wrapper */ static void __pyx_pw_4fcio_4FCIO_9__del__(PyObject *__pyx_v_self); /*proto*/ static void __pyx_pw_4fcio_4FCIO_9__del__(PyObject *__pyx_v_self) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__del__ (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_pf_4fcio_4FCIO_8__del__(((struct __pyx_obj_4fcio_FCIO *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); } static void __pyx_pf_4fcio_4FCIO_8__del__(struct __pyx_obj_4fcio_FCIO *__pyx_v_self) { /* … */ /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_WriteUnraisable("fcio.FCIO.__del__", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0); __pyx_L0:; __Pyx_RefNannyFinishContext(); }
+161: self.close()
__pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_close); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 161, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; __pyx_t_4 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_4 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 0+__pyx_t_4); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 161, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
162:
+163: @property
/* Python wrapper */ static PyObject *__pyx_pw_4fcio_4FCIO_5debug_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_4fcio_4FCIO_5debug_1__get__(PyObject *__pyx_v_self) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_4fcio_4FCIO_5debug___get__(((struct __pyx_obj_4fcio_FCIO *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_4fcio_4FCIO_5debug___get__(struct __pyx_obj_4fcio_FCIO *__pyx_v_self) { PyObject *__pyx_r = NULL; /* … */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("fcio.FCIO.debug.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; }
164: def debug(self):
165: """
166: returns the set debug level
167: """
+168: return self._debug
__Pyx_XDECREF(__pyx_r); __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->_debug); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 168, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0;
169:
+170: @debug.setter
/* Python wrapper */ static int __pyx_pw_4fcio_4FCIO_5debug_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/ static int __pyx_pw_4fcio_4FCIO_5debug_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__set__ (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_4fcio_4FCIO_5debug_2__set__(((struct __pyx_obj_4fcio_FCIO *)__pyx_v_self), ((PyObject *)__pyx_v_value)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_4fcio_4FCIO_5debug_2__set__(struct __pyx_obj_4fcio_FCIO *__pyx_v_self, PyObject *__pyx_v_value) { int __pyx_r; /* … */ /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("fcio.FCIO.debug.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; return __pyx_r; }
171: def debug(self, value):
172: """
173: set the fcio.c debug level
174: """
+175: self._debug = value
__pyx_t_1 = __Pyx_PyInt_As_int(__pyx_v_value); if (unlikely((__pyx_t_1 == (int)-1) && PyErr_Occurred())) __PYX_ERR(4, 175, __pyx_L1_error) __pyx_v_self->_debug = __pyx_t_1;
+176: FCIODebug(self._debug)
(void)(FCIODebug(__pyx_v_self->_debug));
177:
+178: @property
/* Python wrapper */ static PyObject *__pyx_pw_4fcio_4FCIO_7timeout_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_4fcio_4FCIO_7timeout_1__get__(PyObject *__pyx_v_self) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_4fcio_4FCIO_7timeout___get__(((struct __pyx_obj_4fcio_FCIO *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_4fcio_4FCIO_7timeout___get__(struct __pyx_obj_4fcio_FCIO *__pyx_v_self) { PyObject *__pyx_r = NULL; /* … */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("fcio.FCIO.timeout.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; }
179: def timeout(self):
180: """
181: returns the set timeout in milliseconds
182: """
+183: return self._timeout
__Pyx_XDECREF(__pyx_r); __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->_timeout); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 183, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0;
184:
+185: @timeout.setter
/* Python wrapper */ static int __pyx_pw_4fcio_4FCIO_7timeout_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/ static int __pyx_pw_4fcio_4FCIO_7timeout_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__set__ (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_4fcio_4FCIO_7timeout_2__set__(((struct __pyx_obj_4fcio_FCIO *)__pyx_v_self), ((PyObject *)__pyx_v_value)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_4fcio_4FCIO_7timeout_2__set__(struct __pyx_obj_4fcio_FCIO *__pyx_v_self, PyObject *__pyx_v_value) { int __pyx_r; /* … */ /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("fcio.FCIO.timeout.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; return __pyx_r; }
186: def timeout(self, value):
187: """
188: adjust the timeout of the fcio.c library FCIOGetRecord functionality
189: """
+190: self._timeout = FCIOTimeout(self._fcio_data, value)
__pyx_t_1 = __Pyx_PyInt_As_int(__pyx_v_value); if (unlikely((__pyx_t_1 == (int)-1) && PyErr_Occurred())) __PYX_ERR(4, 190, __pyx_L1_error) __pyx_v_self->_timeout = FCIOTimeout(__pyx_v_self->_fcio_data, __pyx_t_1);
191:
+192: @property
/* Python wrapper */ static PyObject *__pyx_pw_4fcio_4FCIO_10buffersize_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_4fcio_4FCIO_10buffersize_1__get__(PyObject *__pyx_v_self) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_4fcio_4FCIO_10buffersize___get__(((struct __pyx_obj_4fcio_FCIO *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_4fcio_4FCIO_10buffersize___get__(struct __pyx_obj_4fcio_FCIO *__pyx_v_self) { PyObject *__pyx_r = NULL; /* … */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("fcio.FCIO.buffersize.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; }
193: def buffersize(self):
194: """
195: returns the set bufio buffersize in bytes
196: """
+197: return self._buffersize
__Pyx_XDECREF(__pyx_r); __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->_buffersize); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 197, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0;
198:
+199: def open(self, peer : str | char[::1] = None, timeout : int = None, buffersize : int = None, debug : int = None, compression : str = None, extended : bool = None):
/* Python wrapper */ static PyObject *__pyx_pw_4fcio_4FCIO_11open(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ static PyMethodDef __pyx_mdef_4fcio_4FCIO_11open = {"open", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4fcio_4FCIO_11open, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; static PyObject *__pyx_pw_4fcio_4FCIO_11open(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_peer = 0; PyObject *__pyx_v_timeout = 0; PyObject *__pyx_v_buffersize = 0; PyObject *__pyx_v_debug = 0; PyObject *__pyx_v_compression = 0; PyObject *__pyx_v_extended = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("open (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_peer,&__pyx_n_s_timeout,&__pyx_n_s_buffersize,&__pyx_n_s_debug,&__pyx_n_s_compression,&__pyx_n_s_extended,0}; PyObject* values[6] = {0,0,0,0,0,0}; values[0] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None)); values[1] = __Pyx_Arg_NewRef_FASTCALL(((PyObject*)Py_None)); values[2] = __Pyx_Arg_NewRef_FASTCALL(((PyObject*)Py_None)); values[3] = __Pyx_Arg_NewRef_FASTCALL(((PyObject*)Py_None)); values[4] = __Pyx_Arg_NewRef_FASTCALL(((PyObject*)Py_None)); values[5] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None)); if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 6: values[5] = __Pyx_Arg_FASTCALL(__pyx_args, 5); CYTHON_FALLTHROUGH; case 5: values[4] = __Pyx_Arg_FASTCALL(__pyx_args, 4); CYTHON_FALLTHROUGH; case 4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_peer); if (value) { values[0] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(4, 199, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 1: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_timeout); if (value) { values[1] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(4, 199, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_buffersize); if (value) { values[2] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(4, 199, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 3: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_debug); if (value) { values[3] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(4, 199, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 4: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_compression); if (value) { values[4] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(4, 199, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 5: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_extended); if (value) { values[5] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(4, 199, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "open") < 0)) __PYX_ERR(4, 199, __pyx_L3_error) } } else { switch (__pyx_nargs) { case 6: values[5] = __Pyx_Arg_FASTCALL(__pyx_args, 5); CYTHON_FALLTHROUGH; case 5: values[4] = __Pyx_Arg_FASTCALL(__pyx_args, 4); CYTHON_FALLTHROUGH; case 4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_peer = values[0]; __pyx_v_timeout = ((PyObject*)values[1]); __pyx_v_buffersize = ((PyObject*)values[2]); __pyx_v_debug = ((PyObject*)values[3]); __pyx_v_compression = ((PyObject*)values[4]); __pyx_v_extended = values[5]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("open", 0, 0, 6, __pyx_nargs); __PYX_ERR(4, 199, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("fcio.FCIO.open", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_timeout), (&PyInt_Type), 1, "timeout", 1))) __PYX_ERR(4, 199, __pyx_L1_error) if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_buffersize), (&PyInt_Type), 1, "buffersize", 1))) __PYX_ERR(4, 199, __pyx_L1_error) if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_debug), (&PyInt_Type), 1, "debug", 1))) __PYX_ERR(4, 199, __pyx_L1_error) if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_compression), (&PyString_Type), 1, "compression", 1))) __PYX_ERR(4, 199, __pyx_L1_error) __pyx_r = __pyx_pf_4fcio_4FCIO_10open(((struct __pyx_obj_4fcio_FCIO *)__pyx_v_self), __pyx_v_peer, __pyx_v_timeout, __pyx_v_buffersize, __pyx_v_debug, __pyx_v_compression, __pyx_v_extended); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_4fcio_4FCIO_10open(struct __pyx_obj_4fcio_FCIO *__pyx_v_self, PyObject *__pyx_v_peer, PyObject *__pyx_v_timeout, PyObject *__pyx_v_buffersize, PyObject *__pyx_v_debug, PyObject *__pyx_v_compression, PyObject *__pyx_v_extended) { __Pyx_memviewslice __pyx_v_memory = { 0, 0, { 0 }, { 0 }, { 0 } }; char *__pyx_v_memory_addr; PyObject *__pyx_v_memory_size = NULL; int __pyx_v_compression_minimum_timeout; PyObject *__pyx_v_tmpdir = NULL; PyObject *__pyx_v_fifo = NULL; PyObject *__pyx_r = NULL; /* … */ /* function exit code */ __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_7); __PYX_XCLEAR_MEMVIEW(&__pyx_t_11, 1); __Pyx_XDECREF(__pyx_t_16); __Pyx_XDECREF(__pyx_t_17); __Pyx_AddTraceback("fcio.FCIO.open", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __PYX_XCLEAR_MEMVIEW(&__pyx_v_memory, 1); __Pyx_XDECREF(__pyx_v_memory_size); __Pyx_XDECREF(__pyx_v_tmpdir); __Pyx_XDECREF(__pyx_v_fifo); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* … */ __pyx_tuple__75 = PyTuple_Pack(14, __pyx_n_s_self, __pyx_n_s_peer, __pyx_n_s_timeout, __pyx_n_s_buffersize, __pyx_n_s_debug, __pyx_n_s_compression, __pyx_n_s_extended, __pyx_n_s_memory, __pyx_n_s_print_mem_addr, __pyx_n_s_memory_addr, __pyx_n_s_memory_size, __pyx_n_s_compression_minimum_timeout, __pyx_n_s_tmpdir, __pyx_n_s_fifo); if (unlikely(!__pyx_tuple__75)) __PYX_ERR(4, 199, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__75); __Pyx_GIVEREF(__pyx_tuple__75); __pyx_codeobj__76 = (PyObject*)__Pyx_PyCode_New(7, 0, 0, 14, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__75, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_fcio_cy_fcio_fcio_pyx, __pyx_n_s_open, 199, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__76)) __PYX_ERR(4, 199, __pyx_L1_error) /* … */ __pyx_t_4 = __Pyx_PyDict_NewPresized(6); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 199, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_peer, __pyx_kp_s_str_char_1) < 0) __PYX_ERR(4, 199, __pyx_L1_error) if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_timeout, __pyx_n_s_int) < 0) __PYX_ERR(4, 199, __pyx_L1_error) if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_buffersize, __pyx_n_s_int) < 0) __PYX_ERR(4, 199, __pyx_L1_error) if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_debug, __pyx_n_s_int) < 0) __PYX_ERR(4, 199, __pyx_L1_error) if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_compression, __pyx_n_s_str) < 0) __PYX_ERR(4, 199, __pyx_L1_error) if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_extended, __pyx_n_s_bool) < 0) __PYX_ERR(4, 199, __pyx_L1_error) __pyx_t_7 = __Pyx_CyFunction_New(&__pyx_mdef_4fcio_4FCIO_11open, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_FCIO_open, NULL, __pyx_n_s_fcio, __pyx_d, ((PyObject *)__pyx_codeobj__76)); if (unlikely(!__pyx_t_7)) __PYX_ERR(4, 199, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_7, __pyx_tuple__77); __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_7, __pyx_t_4); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_4fcio_FCIO, __pyx_n_s_open, __pyx_t_7) < 0) __PYX_ERR(4, 199, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; PyType_Modified(__pyx_ptype_4fcio_FCIO); __pyx_tuple__77 = PyTuple_Pack(6, Py_None, Py_None, Py_None, Py_None, Py_None, Py_None); if (unlikely(!__pyx_tuple__77)) __PYX_ERR(4, 199, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__77); __Pyx_GIVEREF(__pyx_tuple__77);
+200: self.close()
__pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_close); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 200, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; __pyx_t_4 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_4 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 0+__pyx_t_4); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 200, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
201:
+202: if buffersize:
__pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_v_buffersize); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(4, 202, __pyx_L1_error) if (__pyx_t_5) { /* … */ }
+203: self._buffersize = buffersize
__pyx_t_6 = __Pyx_PyInt_As_int(__pyx_v_buffersize); if (unlikely((__pyx_t_6 == (int)-1) && PyErr_Occurred())) __PYX_ERR(4, 203, __pyx_L1_error) __pyx_v_self->_buffersize = __pyx_t_6;
+204: if timeout:
__pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_v_timeout); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(4, 204, __pyx_L1_error) if (__pyx_t_5) { /* … */ }
+205: self._timeout = timeout
__pyx_t_6 = __Pyx_PyInt_As_int(__pyx_v_timeout); if (unlikely((__pyx_t_6 == (int)-1) && PyErr_Occurred())) __PYX_ERR(4, 205, __pyx_L1_error) __pyx_v_self->_timeout = __pyx_t_6;
+206: if debug:
__pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_v_debug); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(4, 206, __pyx_L1_error) if (__pyx_t_5) { /* … */ }
+207: self._debug = debug
__pyx_t_6 = __Pyx_PyInt_As_int(__pyx_v_debug); if (unlikely((__pyx_t_6 == (int)-1) && PyErr_Occurred())) __PYX_ERR(4, 207, __pyx_L1_error) __pyx_v_self->_debug = __pyx_t_6;
+208: if compression:
__pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_v_compression); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(4, 208, __pyx_L1_error) if (__pyx_t_5) { /* … */ }
+209: self._compression = compression
__Pyx_INCREF(__pyx_v_compression); __Pyx_GIVEREF(__pyx_v_compression); __Pyx_GOTREF(__pyx_v_self->_compression); __Pyx_DECREF(__pyx_v_self->_compression); __pyx_v_self->_compression = __pyx_v_compression;
+210: if extended:
__pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_v_extended); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(4, 210, __pyx_L1_error) if (__pyx_t_5) { /* … */ }
+211: self._extended = extended
__pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_v_extended); if (unlikely((__pyx_t_5 == (int)-1) && PyErr_Occurred())) __PYX_ERR(4, 211, __pyx_L1_error) __pyx_v_self->_extended = __pyx_t_5;
212:
+213: FCIODebug(debug)
__pyx_t_6 = __Pyx_PyInt_As_int(__pyx_v_debug); if (unlikely((__pyx_t_6 == (int)-1) && PyErr_Occurred())) __PYX_ERR(4, 213, __pyx_L1_error) (void)(FCIODebug(__pyx_t_6));
214:
215: cdef char[::1] memory
216: cdef long long print_mem_addr
217:
+218: if isinstance(peer, str):
__pyx_t_5 = PyString_Check(__pyx_v_peer);
if (__pyx_t_5) {
/* … */
goto __pyx_L8;
}
+219: self._peer = peer
__Pyx_INCREF(__pyx_v_peer); __Pyx_GIVEREF(__pyx_v_peer); __Pyx_GOTREF(__pyx_v_self->_peer); __Pyx_DECREF(__pyx_v_self->_peer); __pyx_v_self->_peer = __pyx_v_peer;
+220: self._peer_is_memory = True if self._peer.startswith("mem://") else False
__pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->_peer, __pyx_n_s_startswith); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 220, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_7 = NULL; __pyx_t_4 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_3))) { __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_7)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_7); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); __pyx_t_4 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_7, __pyx_kp_s_mem}; __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_4, 1+__pyx_t_4); __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 220, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(4, 220, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (__pyx_t_5) { __Pyx_INCREF(Py_True); __pyx_t_1 = Py_True; } else { __Pyx_INCREF(Py_False); __pyx_t_1 = Py_False; } __Pyx_GIVEREF(__pyx_t_1); __Pyx_GOTREF(__pyx_v_self->_peer_is_memory); __Pyx_DECREF(__pyx_v_self->_peer_is_memory); __pyx_v_self->_peer_is_memory = __pyx_t_1; __pyx_t_1 = 0;
221: else:
+222: try:
/*else*/ { { /*try:*/ { /* … */ } __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0; goto __pyx_L14_try_end; __pyx_L9_error:; __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; __PYX_XCLEAR_MEMVIEW(&__pyx_t_11, 1); __pyx_t_11.memview = NULL; __pyx_t_11.data = NULL; __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; /* … */ __pyx_L11_except_error:; __Pyx_XGIVEREF(__pyx_t_8); __Pyx_XGIVEREF(__pyx_t_9); __Pyx_XGIVEREF(__pyx_t_10); __Pyx_ExceptionReset(__pyx_t_8, __pyx_t_9, __pyx_t_10); goto __pyx_L1_error; __pyx_L12_except_return:; __Pyx_XGIVEREF(__pyx_t_8); __Pyx_XGIVEREF(__pyx_t_9); __Pyx_XGIVEREF(__pyx_t_10); __Pyx_ExceptionReset(__pyx_t_8, __pyx_t_9, __pyx_t_10); goto __pyx_L0; __pyx_L14_try_end:; } } __pyx_L8:;
+223: memory = memoryview(peer)
__pyx_t_1 = PyMemoryView_FromObject(__pyx_v_peer); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 223, __pyx_L9_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_11 = __Pyx_PyObject_to_MemoryviewSlice_dc_char(__pyx_t_1, PyBUF_WRITABLE); if (unlikely(!__pyx_t_11.memview)) __PYX_ERR(4, 223, __pyx_L9_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_memory = __pyx_t_11; __pyx_t_11.memview = NULL; __pyx_t_11.data = NULL;
+224: memory_addr = &memory[0]
__pyx_t_12 = 0; __pyx_t_6 = -1; if (__pyx_t_12 < 0) { __pyx_t_12 += __pyx_v_memory.shape[0]; if (unlikely(__pyx_t_12 < 0)) __pyx_t_6 = 0; } else if (unlikely(__pyx_t_12 >= __pyx_v_memory.shape[0])) __pyx_t_6 = 0; if (unlikely(__pyx_t_6 != -1)) { __Pyx_RaiseBufferIndexError(__pyx_t_6); __PYX_ERR(4, 224, __pyx_L9_error) } __pyx_v_memory_addr = (&(*((char *) ( /* dim=0 */ ((char *) (((char *) __pyx_v_memory.data) + __pyx_t_12)) ))));
+225: memory_size = memory.itemsize * memory.shape[0]
__pyx_t_1 = __pyx_memoryview_fromslice(__pyx_v_memory, 1, (PyObject *(*)(char *)) __pyx_memview_get_char, (int (*)(char *, PyObject *)) __pyx_memview_set_char, 0);; if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 225, __pyx_L9_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_itemsize); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 225, __pyx_L9_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = PyInt_FromSsize_t((__pyx_v_memory.shape[0])); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 225, __pyx_L9_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_3 = PyNumber_Multiply(__pyx_t_2, __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 225, __pyx_L9_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_memory_size = __pyx_t_3; __pyx_t_3 = 0;
226:
227: # TODO: investigae what could be used instead of unsigned long to store the memory address savely
+228: self._peer = f"mem://0x{<unsigned long>memory_addr:x}/{memory_size}"
__pyx_t_3 = PyTuple_New(4); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 228, __pyx_L9_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_13 = 0; __pyx_t_14 = 127; __Pyx_INCREF(__pyx_kp_u_mem_0x); __pyx_t_13 += 8; __Pyx_GIVEREF(__pyx_kp_u_mem_0x); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_kp_u_mem_0x); __pyx_t_1 = __Pyx_PyUnicode_From_unsigned_long(((unsigned long)__pyx_v_memory_addr), 0, ' ', 'x'); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 228, __pyx_L9_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_13 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_1); __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_1); __pyx_t_1 = 0; __Pyx_INCREF(__pyx_kp_u__25); __pyx_t_13 += 1; __Pyx_GIVEREF(__pyx_kp_u__25); PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_kp_u__25); __pyx_t_1 = __Pyx_PyObject_FormatSimple(__pyx_v_memory_size, __pyx_empty_unicode); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 228, __pyx_L9_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_14 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_1) > __pyx_t_14) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_1) : __pyx_t_14; __pyx_t_13 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_1); __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_3, 3, __pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = __Pyx_PyUnicode_Join(__pyx_t_3, 4, __pyx_t_13, __pyx_t_14); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 228, __pyx_L9_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_GIVEREF(__pyx_t_1); __Pyx_GOTREF(__pyx_v_self->_peer); __Pyx_DECREF(__pyx_v_self->_peer); __pyx_v_self->_peer = __pyx_t_1; __pyx_t_1 = 0;
229:
+230: self._peer_is_memory = True
__Pyx_INCREF(Py_True); __Pyx_GIVEREF(Py_True); __Pyx_GOTREF(__pyx_v_self->_peer_is_memory); __Pyx_DECREF(__pyx_v_self->_peer_is_memory); __pyx_v_self->_peer_is_memory = Py_True;
+231: except TypeError:
__pyx_t_6 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_TypeError); if (__pyx_t_6) { __Pyx_AddTraceback("fcio.FCIO.open", __pyx_clineno, __pyx_lineno, __pyx_filename); if (__Pyx_GetException(&__pyx_t_1, &__pyx_t_3, &__pyx_t_2) < 0) __PYX_ERR(4, 231, __pyx_L11_except_error) __Pyx_XGOTREF(__pyx_t_1); __Pyx_XGOTREF(__pyx_t_3); __Pyx_XGOTREF(__pyx_t_2);
+232: return
__Pyx_XDECREF(__pyx_r); __pyx_r = Py_None; __Pyx_INCREF(Py_None); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; goto __pyx_L12_except_return; } goto __pyx_L11_except_error;
233:
+234: if debug > 4:
__pyx_t_2 = PyObject_RichCompare(__pyx_v_debug, __pyx_int_4, Py_GT); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 234, __pyx_L1_error) __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(4, 234, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (__pyx_t_5) { /* … */ }
+235: print(f"fcio-py/open: peer {self._peer} timeout {self._timeout} buffersize {self._buffersize} debug {self._debug} compression {self._compression} extended {self._extended}")
__pyx_t_2 = PyTuple_New(12); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 235, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_13 = 0; __pyx_t_14 = 127; __Pyx_INCREF(__pyx_kp_u_fcio_py_open_peer); __pyx_t_13 += 19; __Pyx_GIVEREF(__pyx_kp_u_fcio_py_open_peer); PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_kp_u_fcio_py_open_peer); __pyx_t_3 = __Pyx_PyObject_FormatSimple(__pyx_v_self->_peer, __pyx_empty_unicode); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 235, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_14 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_3) > __pyx_t_14) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_3) : __pyx_t_14; __pyx_t_13 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_3); __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_3); __pyx_t_3 = 0; __Pyx_INCREF(__pyx_kp_u_timeout_2); __pyx_t_13 += 9; __Pyx_GIVEREF(__pyx_kp_u_timeout_2); PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_kp_u_timeout_2); __pyx_t_3 = __Pyx_PyUnicode_From_int(__pyx_v_self->_timeout, 0, ' ', 'd'); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 235, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_13 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_3); __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_2, 3, __pyx_t_3); __pyx_t_3 = 0; __Pyx_INCREF(__pyx_kp_u_buffersize_2); __pyx_t_13 += 12; __Pyx_GIVEREF(__pyx_kp_u_buffersize_2); PyTuple_SET_ITEM(__pyx_t_2, 4, __pyx_kp_u_buffersize_2); __pyx_t_3 = __Pyx_PyUnicode_From_int(__pyx_v_self->_buffersize, 0, ' ', 'd'); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 235, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_13 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_3); __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_2, 5, __pyx_t_3); __pyx_t_3 = 0; __Pyx_INCREF(__pyx_kp_u_debug_2); __pyx_t_13 += 7; __Pyx_GIVEREF(__pyx_kp_u_debug_2); PyTuple_SET_ITEM(__pyx_t_2, 6, __pyx_kp_u_debug_2); __pyx_t_3 = __Pyx_PyUnicode_From_int(__pyx_v_self->_debug, 0, ' ', 'd'); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 235, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_13 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_3); __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_2, 7, __pyx_t_3); __pyx_t_3 = 0; __Pyx_INCREF(__pyx_kp_u_compression_2); __pyx_t_13 += 13; __Pyx_GIVEREF(__pyx_kp_u_compression_2); PyTuple_SET_ITEM(__pyx_t_2, 8, __pyx_kp_u_compression_2); __pyx_t_3 = __Pyx_PyObject_FormatSimple(__pyx_v_self->_compression, __pyx_empty_unicode); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 235, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_14 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_3) > __pyx_t_14) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_3) : __pyx_t_14; __pyx_t_13 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_3); __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_2, 9, __pyx_t_3); __pyx_t_3 = 0; __Pyx_INCREF(__pyx_kp_u_extended_2); __pyx_t_13 += 10; __Pyx_GIVEREF(__pyx_kp_u_extended_2); PyTuple_SET_ITEM(__pyx_t_2, 10, __pyx_kp_u_extended_2); __pyx_t_3 = __Pyx_PyUnicode_FromBInt_bint(__pyx_v_self->_extended); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 235, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_13 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_3); __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_2, 11, __pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = __Pyx_PyUnicode_Join(__pyx_t_2, 12, __pyx_t_13, __pyx_t_14); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 235, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_builtin_print, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 235, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
236:
+237: if self._compression == 'auto':
__pyx_t_5 = (__Pyx_PyString_Equals(__pyx_v_self->_compression, __pyx_n_s_auto, Py_EQ)); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(4, 237, __pyx_L1_error) if (__pyx_t_5) { /* … */ }
+238: if self._peer.endswith('.zst'):
__pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->_peer, __pyx_n_s_endswith); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 238, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_1 = NULL; __pyx_t_4 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_3))) { __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_1)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_1); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); __pyx_t_4 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_1, __pyx_kp_s_zst}; __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_4, 1+__pyx_t_4); __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 238, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(4, 238, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (__pyx_t_5) { /* … */ goto __pyx_L19; }
+239: self._compression = 'zstd'
__Pyx_INCREF(__pyx_n_s_zstd); __Pyx_GIVEREF(__pyx_n_s_zstd); __Pyx_GOTREF(__pyx_v_self->_compression); __Pyx_DECREF(__pyx_v_self->_compression); __pyx_v_self->_compression = __pyx_n_s_zstd;
+240: elif self._peer.endswith('.gz'):
__pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->_peer, __pyx_n_s_endswith); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 240, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_1 = NULL; __pyx_t_4 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_3))) { __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_1)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_1); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); __pyx_t_4 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_1, __pyx_kp_s_gz}; __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_4, 1+__pyx_t_4); __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 240, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(4, 240, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (__pyx_t_5) { /* … */ goto __pyx_L19; }
+241: self._compression = 'gzip'
__Pyx_INCREF(__pyx_n_s_gzip); __Pyx_GIVEREF(__pyx_n_s_gzip); __Pyx_GOTREF(__pyx_v_self->_compression); __Pyx_DECREF(__pyx_v_self->_compression); __pyx_v_self->_compression = __pyx_n_s_gzip;
242: else:
+243: self._compression = 'none'
/*else*/ { __Pyx_INCREF(__pyx_n_s_none); __Pyx_GIVEREF(__pyx_n_s_none); __Pyx_GOTREF(__pyx_v_self->_compression); __Pyx_DECREF(__pyx_v_self->_compression); __pyx_v_self->_compression = __pyx_n_s_none; } __pyx_L19:;
244:
245: # 1 second minimum timeout for launching the subprocess to decompress the file
+246: cdef int compression_minimum_timeout = 1000
__pyx_v_compression_minimum_timeout = 0x3E8;
247:
+248: if self._compression == 'zstd':
__pyx_t_5 = (__Pyx_PyString_Equals(__pyx_v_self->_compression, __pyx_n_s_zstd, Py_EQ)); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(4, 248, __pyx_L1_error) if (__pyx_t_5) { /* … */ goto __pyx_L20; }
+249: tmpdir = tempfile.TemporaryDirectory(prefix="fcio_")
__Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_tempfile); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 249, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_TemporaryDirectory); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 249, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 249, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_prefix, __pyx_n_s_fcio_2) < 0) __PYX_ERR(4, 249, __pyx_L1_error) __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_empty_tuple, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 249, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_v_tmpdir = __pyx_t_1; __pyx_t_1 = 0;
+250: if self._timeout >= 0 and self._timeout < compression_minimum_timeout:
__pyx_t_15 = (__pyx_v_self->_timeout >= 0); if (__pyx_t_15) { } else { __pyx_t_5 = __pyx_t_15; goto __pyx_L22_bool_binop_done; } __pyx_t_15 = (__pyx_v_self->_timeout < __pyx_v_compression_minimum_timeout); __pyx_t_5 = __pyx_t_15; __pyx_L22_bool_binop_done:; if (__pyx_t_5) { /* … */ }
+251: self._timeout = compression_minimum_timeout
__pyx_v_self->_timeout = __pyx_v_compression_minimum_timeout;
+252: fifo = os.path.join(tmpdir.name, os.path.basename(self._peer))
__Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_os); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 252, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_path); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 252, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_join); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 252, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_tmpdir, __pyx_n_s_name); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 252, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_GetModuleGlobalName(__pyx_t_16, __pyx_n_s_os); if (unlikely(!__pyx_t_16)) __PYX_ERR(4, 252, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_16); __pyx_t_17 = __Pyx_PyObject_GetAttrStr(__pyx_t_16, __pyx_n_s_path); if (unlikely(!__pyx_t_17)) __PYX_ERR(4, 252, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_17); __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; __pyx_t_16 = __Pyx_PyObject_GetAttrStr(__pyx_t_17, __pyx_n_s_basename); if (unlikely(!__pyx_t_16)) __PYX_ERR(4, 252, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_16); __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0; __pyx_t_17 = NULL; __pyx_t_4 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_16))) { __pyx_t_17 = PyMethod_GET_SELF(__pyx_t_16); if (likely(__pyx_t_17)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_16); __Pyx_INCREF(__pyx_t_17); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_16, function); __pyx_t_4 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_17, __pyx_v_self->_peer}; __pyx_t_7 = __Pyx_PyObject_FastCall(__pyx_t_16, __pyx_callargs+1-__pyx_t_4, 1+__pyx_t_4); __Pyx_XDECREF(__pyx_t_17); __pyx_t_17 = 0; if (unlikely(!__pyx_t_7)) __PYX_ERR(4, 252, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; } __pyx_t_16 = NULL; __pyx_t_4 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_16 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_16)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_16); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_4 = 1; } } #endif { PyObject *__pyx_callargs[3] = {__pyx_t_16, __pyx_t_3, __pyx_t_7}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 2+__pyx_t_4); __Pyx_XDECREF(__pyx_t_16); __pyx_t_16 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 252, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __pyx_v_fifo = __pyx_t_1; __pyx_t_1 = 0;
+253: os.mkfifo(fifo)
__Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_os); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 253, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_mkfifo); if (unlikely(!__pyx_t_7)) __PYX_ERR(4, 253, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = NULL; __pyx_t_4 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_7))) { __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_7); if (likely(__pyx_t_2)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7); __Pyx_INCREF(__pyx_t_2); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_7, function); __pyx_t_4 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_v_fifo}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_7, __pyx_callargs+1-__pyx_t_4, 1+__pyx_t_4); __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 253, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+254: self._compression_process = subprocess.Popen(["zstd","-df","--no-progress","-q","--no-sparse","-o",fifo,self._peer])
__Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_subprocess); if (unlikely(!__pyx_t_7)) __PYX_ERR(4, 254, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_Popen); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 254, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __pyx_t_7 = PyList_New(8); if (unlikely(!__pyx_t_7)) __PYX_ERR(4, 254, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_INCREF(__pyx_n_s_zstd); __Pyx_GIVEREF(__pyx_n_s_zstd); if (__Pyx_PyList_SET_ITEM(__pyx_t_7, 0, __pyx_n_s_zstd)) __PYX_ERR(4, 254, __pyx_L1_error); __Pyx_INCREF(__pyx_kp_s_df); __Pyx_GIVEREF(__pyx_kp_s_df); if (__Pyx_PyList_SET_ITEM(__pyx_t_7, 1, __pyx_kp_s_df)) __PYX_ERR(4, 254, __pyx_L1_error); __Pyx_INCREF(__pyx_kp_s_no_progress); __Pyx_GIVEREF(__pyx_kp_s_no_progress); if (__Pyx_PyList_SET_ITEM(__pyx_t_7, 2, __pyx_kp_s_no_progress)) __PYX_ERR(4, 254, __pyx_L1_error); __Pyx_INCREF(__pyx_kp_s_q); __Pyx_GIVEREF(__pyx_kp_s_q); if (__Pyx_PyList_SET_ITEM(__pyx_t_7, 3, __pyx_kp_s_q)) __PYX_ERR(4, 254, __pyx_L1_error); __Pyx_INCREF(__pyx_kp_s_no_sparse); __Pyx_GIVEREF(__pyx_kp_s_no_sparse); if (__Pyx_PyList_SET_ITEM(__pyx_t_7, 4, __pyx_kp_s_no_sparse)) __PYX_ERR(4, 254, __pyx_L1_error); __Pyx_INCREF(__pyx_kp_s_o); __Pyx_GIVEREF(__pyx_kp_s_o); if (__Pyx_PyList_SET_ITEM(__pyx_t_7, 5, __pyx_kp_s_o)) __PYX_ERR(4, 254, __pyx_L1_error); __Pyx_INCREF(__pyx_v_fifo); __Pyx_GIVEREF(__pyx_v_fifo); if (__Pyx_PyList_SET_ITEM(__pyx_t_7, 6, __pyx_v_fifo)) __PYX_ERR(4, 254, __pyx_L1_error); __Pyx_INCREF(__pyx_v_self->_peer); __Pyx_GIVEREF(__pyx_v_self->_peer); if (__Pyx_PyList_SET_ITEM(__pyx_t_7, 7, __pyx_v_self->_peer)) __PYX_ERR(4, 254, __pyx_L1_error); __pyx_t_3 = NULL; __pyx_t_4 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_4 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_t_7}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 1+__pyx_t_4); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 254, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __Pyx_GIVEREF(__pyx_t_1); __Pyx_GOTREF(__pyx_v_self->_compression_process); __Pyx_DECREF(__pyx_v_self->_compression_process); __pyx_v_self->_compression_process = __pyx_t_1; __pyx_t_1 = 0;
+255: self._fcio_data = FCIOOpen(fifo.encode(u"ascii"), self._timeout, self._buffersize)
__pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_fifo, __pyx_n_s_encode); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 255, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_7 = NULL; __pyx_t_4 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_7)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_7); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_4 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_7, __pyx_n_u_ascii}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 1+__pyx_t_4); __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 255, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __pyx_t_18 = __Pyx_PyObject_AsString(__pyx_t_1); if (unlikely((!__pyx_t_18) && PyErr_Occurred())) __PYX_ERR(4, 255, __pyx_L1_error) __pyx_v_self->_fcio_data = FCIOOpen(__pyx_t_18, __pyx_v_self->_timeout, __pyx_v_self->_buffersize); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+256: os.unlink(fifo)
__Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_os); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 256, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_unlink); if (unlikely(!__pyx_t_7)) __PYX_ERR(4, 256, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = NULL; __pyx_t_4 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_7))) { __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_7); if (likely(__pyx_t_2)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7); __Pyx_INCREF(__pyx_t_2); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_7, function); __pyx_t_4 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_v_fifo}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_7, __pyx_callargs+1-__pyx_t_4, 1+__pyx_t_4); __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 256, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+257: tmpdir.cleanup()
__pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_tmpdir, __pyx_n_s_cleanup); if (unlikely(!__pyx_t_7)) __PYX_ERR(4, 257, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __pyx_t_2 = NULL; __pyx_t_4 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_7))) { __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_7); if (likely(__pyx_t_2)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7); __Pyx_INCREF(__pyx_t_2); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_7, function); __pyx_t_4 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_7, __pyx_callargs+1-__pyx_t_4, 0+__pyx_t_4); __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 257, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+258: if self._fcio_data == NULL:
__pyx_t_5 = (__pyx_v_self->_fcio_data == NULL); if (unlikely(__pyx_t_5)) { /* … */ }
+259: raise IOError(f"{self._peer} couldn't be opened. The decompression is handled by a subprocess. Try increasing the timeout.")
__pyx_t_1 = __Pyx_PyObject_FormatSimple(__pyx_v_self->_peer, __pyx_empty_unicode); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 259, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_7 = __Pyx_PyUnicode_ConcatInPlace(__pyx_t_1, __pyx_kp_u_couldn_t_be_opened_The_decompre); if (unlikely(!__pyx_t_7)) __PYX_ERR(4, 259, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_builtin_IOError, __pyx_t_7); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 259, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_Raise(__pyx_t_1, 0, 0, 0); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __PYX_ERR(4, 259, __pyx_L1_error)
260:
+261: elif self._compression == 'gzip':
__pyx_t_5 = (__Pyx_PyString_Equals(__pyx_v_self->_compression, __pyx_n_s_gzip, Py_EQ)); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(4, 261, __pyx_L1_error) if (__pyx_t_5) { /* … */ goto __pyx_L20; }
+262: tmpdir = tempfile.TemporaryDirectory(prefix="fcio_")
__Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_tempfile); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 262, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_TemporaryDirectory); if (unlikely(!__pyx_t_7)) __PYX_ERR(4, 262, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 262, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_prefix, __pyx_n_s_fcio_2) < 0) __PYX_ERR(4, 262, __pyx_L1_error) __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_empty_tuple, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 262, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_tmpdir = __pyx_t_2; __pyx_t_2 = 0;
+263: if self._timeout >= 0 and self._timeout < compression_minimum_timeout:
__pyx_t_15 = (__pyx_v_self->_timeout >= 0); if (__pyx_t_15) { } else { __pyx_t_5 = __pyx_t_15; goto __pyx_L26_bool_binop_done; } __pyx_t_15 = (__pyx_v_self->_timeout < __pyx_v_compression_minimum_timeout); __pyx_t_5 = __pyx_t_15; __pyx_L26_bool_binop_done:; if (__pyx_t_5) { /* … */ }
+264: self._timeout = compression_minimum_timeout
__pyx_v_self->_timeout = __pyx_v_compression_minimum_timeout;
+265: fifo = os.path.join(tmpdir.name, os.path.basename(self._peer))
__Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_os); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 265, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_path); if (unlikely(!__pyx_t_7)) __PYX_ERR(4, 265, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_join); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 265, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_tmpdir, __pyx_n_s_name); if (unlikely(!__pyx_t_7)) __PYX_ERR(4, 265, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_GetModuleGlobalName(__pyx_t_16, __pyx_n_s_os); if (unlikely(!__pyx_t_16)) __PYX_ERR(4, 265, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_16); __pyx_t_17 = __Pyx_PyObject_GetAttrStr(__pyx_t_16, __pyx_n_s_path); if (unlikely(!__pyx_t_17)) __PYX_ERR(4, 265, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_17); __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; __pyx_t_16 = __Pyx_PyObject_GetAttrStr(__pyx_t_17, __pyx_n_s_basename); if (unlikely(!__pyx_t_16)) __PYX_ERR(4, 265, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_16); __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0; __pyx_t_17 = NULL; __pyx_t_4 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_16))) { __pyx_t_17 = PyMethod_GET_SELF(__pyx_t_16); if (likely(__pyx_t_17)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_16); __Pyx_INCREF(__pyx_t_17); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_16, function); __pyx_t_4 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_17, __pyx_v_self->_peer}; __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_16, __pyx_callargs+1-__pyx_t_4, 1+__pyx_t_4); __Pyx_XDECREF(__pyx_t_17); __pyx_t_17 = 0; if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 265, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; } __pyx_t_16 = NULL; __pyx_t_4 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_1))) { __pyx_t_16 = PyMethod_GET_SELF(__pyx_t_1); if (likely(__pyx_t_16)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1); __Pyx_INCREF(__pyx_t_16); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_1, function); __pyx_t_4 = 1; } } #endif { PyObject *__pyx_callargs[3] = {__pyx_t_16, __pyx_t_7, __pyx_t_3}; __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_1, __pyx_callargs+1-__pyx_t_4, 2+__pyx_t_4); __Pyx_XDECREF(__pyx_t_16); __pyx_t_16 = 0; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 265, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } __pyx_v_fifo = __pyx_t_2; __pyx_t_2 = 0;
+266: os.mkfifo(fifo)
__Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_os); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 266, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_mkfifo); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 266, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = NULL; __pyx_t_4 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_3))) { __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_1)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_1); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); __pyx_t_4 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_1, __pyx_v_fifo}; __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_4, 1+__pyx_t_4); __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 266, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+267: self._compression_process = subprocess.Popen(["gzip","q","-d","-c",self._peer,">",fifo])
__Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_subprocess); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 267, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_Popen); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 267, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = PyList_New(7); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 267, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(__pyx_n_s_gzip); __Pyx_GIVEREF(__pyx_n_s_gzip); if (__Pyx_PyList_SET_ITEM(__pyx_t_3, 0, __pyx_n_s_gzip)) __PYX_ERR(4, 267, __pyx_L1_error); __Pyx_INCREF(__pyx_n_s_q_2); __Pyx_GIVEREF(__pyx_n_s_q_2); if (__Pyx_PyList_SET_ITEM(__pyx_t_3, 1, __pyx_n_s_q_2)) __PYX_ERR(4, 267, __pyx_L1_error); __Pyx_INCREF(__pyx_kp_s_d); __Pyx_GIVEREF(__pyx_kp_s_d); if (__Pyx_PyList_SET_ITEM(__pyx_t_3, 2, __pyx_kp_s_d)) __PYX_ERR(4, 267, __pyx_L1_error); __Pyx_INCREF(__pyx_kp_s_c_2); __Pyx_GIVEREF(__pyx_kp_s_c_2); if (__Pyx_PyList_SET_ITEM(__pyx_t_3, 3, __pyx_kp_s_c_2)) __PYX_ERR(4, 267, __pyx_L1_error); __Pyx_INCREF(__pyx_v_self->_peer); __Pyx_GIVEREF(__pyx_v_self->_peer); if (__Pyx_PyList_SET_ITEM(__pyx_t_3, 4, __pyx_v_self->_peer)) __PYX_ERR(4, 267, __pyx_L1_error); __Pyx_INCREF(__pyx_kp_s__26); __Pyx_GIVEREF(__pyx_kp_s__26); if (__Pyx_PyList_SET_ITEM(__pyx_t_3, 5, __pyx_kp_s__26)) __PYX_ERR(4, 267, __pyx_L1_error); __Pyx_INCREF(__pyx_v_fifo); __Pyx_GIVEREF(__pyx_v_fifo); if (__Pyx_PyList_SET_ITEM(__pyx_t_3, 6, __pyx_v_fifo)) __PYX_ERR(4, 267, __pyx_L1_error); __pyx_t_7 = NULL; __pyx_t_4 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_1))) { __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_1); if (likely(__pyx_t_7)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1); __Pyx_INCREF(__pyx_t_7); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_1, function); __pyx_t_4 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_7, __pyx_t_3}; __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_1, __pyx_callargs+1-__pyx_t_4, 1+__pyx_t_4); __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 267, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } __Pyx_GIVEREF(__pyx_t_2); __Pyx_GOTREF(__pyx_v_self->_compression_process); __Pyx_DECREF(__pyx_v_self->_compression_process); __pyx_v_self->_compression_process = __pyx_t_2; __pyx_t_2 = 0;
+268: self._fcio_data = FCIOOpen(fifo.encode(u"ascii"), self._timeout, self._buffersize)
__pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_fifo, __pyx_n_s_encode); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 268, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_3 = NULL; __pyx_t_4 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_1))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_1); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_1, function); __pyx_t_4 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_n_u_ascii}; __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_1, __pyx_callargs+1-__pyx_t_4, 1+__pyx_t_4); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 268, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } __pyx_t_18 = __Pyx_PyObject_AsString(__pyx_t_2); if (unlikely((!__pyx_t_18) && PyErr_Occurred())) __PYX_ERR(4, 268, __pyx_L1_error) __pyx_v_self->_fcio_data = FCIOOpen(__pyx_t_18, __pyx_v_self->_timeout, __pyx_v_self->_buffersize); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+269: os.unlink(fifo)
__Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_os); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 269, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_unlink); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 269, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = NULL; __pyx_t_4 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_3))) { __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_1)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_1); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); __pyx_t_4 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_1, __pyx_v_fifo}; __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_4, 1+__pyx_t_4); __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 269, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+270: tmpdir.cleanup()
__pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_tmpdir, __pyx_n_s_cleanup); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 270, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_1 = NULL; __pyx_t_4 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_3))) { __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_1)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_1); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); __pyx_t_4 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_1, NULL}; __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_4, 0+__pyx_t_4); __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 270, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+271: if self._fcio_data == NULL:
__pyx_t_5 = (__pyx_v_self->_fcio_data == NULL); if (unlikely(__pyx_t_5)) { /* … */ }
+272: raise IOError(f"{self._peer} couldn't be opened. The decompression is handled by a subprocess. Try increasing the timeout.")
__pyx_t_2 = __Pyx_PyObject_FormatSimple(__pyx_v_self->_peer, __pyx_empty_unicode); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 272, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __Pyx_PyUnicode_ConcatInPlace(__pyx_t_2, __pyx_kp_u_couldn_t_be_opened_The_decompre); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 272, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_builtin_IOError, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 272, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_Raise(__pyx_t_2, 0, 0, 0); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __PYX_ERR(4, 272, __pyx_L1_error)
273:
+274: elif self._compression == 'none':
__pyx_t_5 = (__Pyx_PyString_Equals(__pyx_v_self->_compression, __pyx_n_s_none, Py_EQ)); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(4, 274, __pyx_L1_error) if (likely(__pyx_t_5)) { /* … */ goto __pyx_L20; }
+275: self._fcio_data = FCIOOpen(self._peer.encode(u"ascii"), self._timeout, self._buffersize)
__pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->_peer, __pyx_n_s_encode); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 275, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_1 = NULL; __pyx_t_4 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_3))) { __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_1)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_1); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); __pyx_t_4 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_1, __pyx_n_u_ascii}; __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_4, 1+__pyx_t_4); __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 275, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __pyx_t_18 = __Pyx_PyObject_AsString(__pyx_t_2); if (unlikely((!__pyx_t_18) && PyErr_Occurred())) __PYX_ERR(4, 275, __pyx_L1_error) __pyx_v_self->_fcio_data = FCIOOpen(__pyx_t_18, __pyx_v_self->_timeout, __pyx_v_self->_buffersize); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
276: else:
+277: raise ValueError(f"Compression parameter {self._compression} is not supported. Files ending in '.zst' or '.gz' will be automatically decompressed during reading.")
/*else*/ { __pyx_t_2 = PyTuple_New(3); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 277, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_13 = 0; __pyx_t_14 = 127; __Pyx_INCREF(__pyx_kp_u_Compression_parameter); __pyx_t_13 += 22; __Pyx_GIVEREF(__pyx_kp_u_Compression_parameter); PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_kp_u_Compression_parameter); __pyx_t_3 = __Pyx_PyObject_FormatSimple(__pyx_v_self->_compression, __pyx_empty_unicode); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 277, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_14 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_3) > __pyx_t_14) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_3) : __pyx_t_14; __pyx_t_13 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_3); __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_3); __pyx_t_3 = 0; __Pyx_INCREF(__pyx_kp_u_is_not_supported_Files_ending_i); __pyx_t_13 += 101; __Pyx_GIVEREF(__pyx_kp_u_is_not_supported_Files_ending_i); PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_kp_u_is_not_supported_Files_ending_i); __pyx_t_3 = __Pyx_PyUnicode_Join(__pyx_t_2, 3, __pyx_t_13, __pyx_t_14); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 277, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 277, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_Raise(__pyx_t_2, 0, 0, 0); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __PYX_ERR(4, 277, __pyx_L1_error) } __pyx_L20:;
278:
+279: if self._fcio_data == NULL:
__pyx_t_5 = (__pyx_v_self->_fcio_data == NULL); if (unlikely(__pyx_t_5)) { /* … */ }
+280: raise IOError(f"Couldn't open: {self._peer}")
__pyx_t_2 = __Pyx_PyObject_FormatSimple(__pyx_v_self->_peer, __pyx_empty_unicode); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 280, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __Pyx_PyUnicode_Concat(__pyx_kp_u_Couldn_t_open, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 280, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_builtin_IOError, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 280, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_Raise(__pyx_t_2, 0, 0, 0); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __PYX_ERR(4, 280, __pyx_L1_error)
281:
+282: while self.get_record():
while (1) { __pyx_t_2 = ((struct __pyx_vtabstruct_4fcio_FCIO *)__pyx_v_self->__pyx_vtab)->get_record(__pyx_v_self, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 282, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(4, 282, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (!__pyx_t_5) break;
+283: if self._tag == FCIOTag.FCIOConfig:
__pyx_t_5 = (__pyx_v_self->_tag == FCIOConfig); if (__pyx_t_5) { /* … */ } } __pyx_L31_break:;
+284: break
goto __pyx_L31_break;
285:
+286: def close(self) -> None:
/* Python wrapper */ static PyObject *__pyx_pw_4fcio_4FCIO_13close(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_4fcio_4FCIO_12close, "\n If a datafile is opened, close it and deallocate the FCIOData structure.\n "); static PyMethodDef __pyx_mdef_4fcio_4FCIO_13close = {"close", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4fcio_4FCIO_13close, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_4fcio_4FCIO_12close}; static PyObject *__pyx_pw_4fcio_4FCIO_13close(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("close (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("close", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "close", 0))) return NULL; __pyx_r = __pyx_pf_4fcio_4FCIO_12close(((struct __pyx_obj_4fcio_FCIO *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_4fcio_4FCIO_12close(struct __pyx_obj_4fcio_FCIO *__pyx_v_self) { PyObject *__pyx_r = NULL; /* … */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* … */ __pyx_t_7 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_7)) __PYX_ERR(4, 286, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_return, __pyx_n_s_None) < 0) __PYX_ERR(4, 286, __pyx_L1_error) __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_4fcio_4FCIO_13close, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_FCIO_close, NULL, __pyx_n_s_fcio, __pyx_d, ((PyObject *)__pyx_codeobj__78)); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 286, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_7); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_4fcio_FCIO, __pyx_n_s_close, __pyx_t_4) < 0) __PYX_ERR(4, 286, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; PyType_Modified(__pyx_ptype_4fcio_FCIO); /* … */ __pyx_codeobj__78 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__39, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_fcio_cy_fcio_fcio_pyx, __pyx_n_s_close, 286, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__78)) __PYX_ERR(4, 286, __pyx_L1_error)
287: """
288: If a datafile is opened, close it and deallocate the FCIOData structure.
289: """
+290: if self._fcio_data:
__pyx_t_1 = (__pyx_v_self->_fcio_data != 0); if (__pyx_t_1) { /* … */ }
+291: FCIOClose(self._fcio_data)
(void)(FCIOClose(__pyx_v_self->_fcio_data));
+292: self._fcio_data = NULL
__pyx_v_self->_fcio_data = NULL;
293:
+294: def set_mem_field(self, char[::1] memory not None):
/* Python wrapper */ static PyObject *__pyx_pw_4fcio_4FCIO_15set_mem_field(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ static PyMethodDef __pyx_mdef_4fcio_4FCIO_15set_mem_field = {"set_mem_field", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4fcio_4FCIO_15set_mem_field, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; static PyObject *__pyx_pw_4fcio_4FCIO_15set_mem_field(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { __Pyx_memviewslice __pyx_v_memory = { 0, 0, { 0 }, { 0 }, { 0 } }; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("set_mem_field (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_memory,0}; PyObject* values[1] = {0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_memory)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(4, 294, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "set_mem_field") < 0)) __PYX_ERR(4, 294, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_memory = __Pyx_PyObject_to_MemoryviewSlice_dc_char(values[0], PyBUF_WRITABLE); if (unlikely(!__pyx_v_memory.memview)) __PYX_ERR(4, 294, __pyx_L3_error) } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("set_mem_field", 1, 1, 1, __pyx_nargs); __PYX_ERR(4, 294, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __PYX_XCLEAR_MEMVIEW(&__pyx_v_memory, 1); __Pyx_AddTraceback("fcio.FCIO.set_mem_field", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(((PyObject *)__pyx_v_memory.memview) == Py_None)) { PyErr_Format(PyExc_TypeError, "Argument '%.200s' must not be None", "memory"); __PYX_ERR(4, 294, __pyx_L1_error) } __pyx_r = __pyx_pf_4fcio_4FCIO_14set_mem_field(((struct __pyx_obj_4fcio_FCIO *)__pyx_v_self), __pyx_v_memory); int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; __PYX_XCLEAR_MEMVIEW(&__pyx_v_memory, 1); { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_4fcio_4FCIO_14set_mem_field(struct __pyx_obj_4fcio_FCIO *__pyx_v_self, __Pyx_memviewslice __pyx_v_memory) { PyObject *__pyx_r = NULL; /* … */ /* function exit code */ __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_10); __Pyx_AddTraceback("fcio.FCIO.set_mem_field", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* … */ __pyx_tuple__79 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_memory); if (unlikely(!__pyx_tuple__79)) __PYX_ERR(4, 294, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__79); __Pyx_GIVEREF(__pyx_tuple__79); /* … */ __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_4fcio_4FCIO_15set_mem_field, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_FCIO_set_mem_field, NULL, __pyx_n_s_fcio, __pyx_d, ((PyObject *)__pyx_codeobj__80)); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 294, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_4fcio_FCIO, __pyx_n_s_set_mem_field, __pyx_t_4) < 0) __PYX_ERR(4, 294, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; PyType_Modified(__pyx_ptype_4fcio_FCIO); __pyx_codeobj__80 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__79, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_fcio_cy_fcio_fcio_pyx, __pyx_n_s_set_mem_field, 294, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__80)) __PYX_ERR(4, 294, __pyx_L1_error)
+295: if self._peer_is_memory:
__pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_self->_peer_is_memory); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(4, 295, __pyx_L1_error) if (__pyx_t_1) { /* … */ goto __pyx_L3; }
+296: if 0 != FCIOSetMemField(FCIOStreamHandle(self._fcio_data), &memory[0], len(memory)*memory.itemsize):
__pyx_t_2 = 0; __pyx_t_3 = -1; if (__pyx_t_2 < 0) { __pyx_t_2 += __pyx_v_memory.shape[0]; if (unlikely(__pyx_t_2 < 0)) __pyx_t_3 = 0; } else if (unlikely(__pyx_t_2 >= __pyx_v_memory.shape[0])) __pyx_t_3 = 0; if (unlikely(__pyx_t_3 != -1)) { __Pyx_RaiseBufferIndexError(__pyx_t_3); __PYX_ERR(4, 296, __pyx_L1_error) } __pyx_t_4 = __Pyx_MemoryView_Len(__pyx_v_memory); __pyx_t_5 = PyInt_FromSsize_t(__pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(4, 296, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_6 = __pyx_memoryview_fromslice(__pyx_v_memory, 1, (PyObject *(*)(char *)) __pyx_memview_get_char, (int (*)(char *, PyObject *)) __pyx_memview_set_char, 0);; if (unlikely(!__pyx_t_6)) __PYX_ERR(4, 296, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_itemsize); if (unlikely(!__pyx_t_7)) __PYX_ERR(4, 296, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_6 = PyNumber_Multiply(__pyx_t_5, __pyx_t_7); if (unlikely(!__pyx_t_6)) __PYX_ERR(4, 296, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __pyx_t_8 = __Pyx_PyInt_As_size_t(__pyx_t_6); if (unlikely((__pyx_t_8 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(4, 296, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_1 = (0 != FCIOSetMemField(FCIOStreamHandle(__pyx_v_self->_fcio_data), (&(*((char *) ( /* dim=0 */ ((char *) (((char *) __pyx_v_memory.data) + __pyx_t_2)) )))), __pyx_t_8)); if (unlikely(__pyx_t_1)) { /* … */ }
+297: raise IOError(f"Couldn't set memory field: {memory}")
__pyx_t_6 = __pyx_memoryview_fromslice(__pyx_v_memory, 1, (PyObject *(*)(char *)) __pyx_memview_get_char, (int (*)(char *, PyObject *)) __pyx_memview_set_char, 0);; if (unlikely(!__pyx_t_6)) __PYX_ERR(4, 297, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_7 = __Pyx_PyObject_FormatSimple(__pyx_t_6, __pyx_empty_unicode); if (unlikely(!__pyx_t_7)) __PYX_ERR(4, 297, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_6 = __Pyx_PyUnicode_Concat(__pyx_kp_u_Couldn_t_set_memory_field, __pyx_t_7); if (unlikely(!__pyx_t_6)) __PYX_ERR(4, 297, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __pyx_t_7 = __Pyx_PyObject_CallOneArg(__pyx_builtin_IOError, __pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(4, 297, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_Raise(__pyx_t_7, 0, 0, 0); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __PYX_ERR(4, 297, __pyx_L1_error)
298: else:
+299: warn(f"fcio-py/set_mem_field was called but peer is not mem:// : {self._peer}, ignoring call to set_mem_field.")
/*else*/ { __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_warn); if (unlikely(!__pyx_t_6)) __PYX_ERR(4, 299, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_5 = PyTuple_New(3); if (unlikely(!__pyx_t_5)) __PYX_ERR(4, 299, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_4 = 0; __pyx_t_9 = 127; __Pyx_INCREF(__pyx_kp_u_fcio_py_set_mem_field_was_called); __pyx_t_4 += 58; __Pyx_GIVEREF(__pyx_kp_u_fcio_py_set_mem_field_was_called); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_kp_u_fcio_py_set_mem_field_was_called); __pyx_t_10 = __Pyx_PyObject_FormatSimple(__pyx_v_self->_peer, __pyx_empty_unicode); if (unlikely(!__pyx_t_10)) __PYX_ERR(4, 299, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); __pyx_t_9 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_10) > __pyx_t_9) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_10) : __pyx_t_9; __pyx_t_4 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_10); __Pyx_GIVEREF(__pyx_t_10); PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_10); __pyx_t_10 = 0; __Pyx_INCREF(__pyx_kp_u_ignoring_call_to_set_mem_field); __pyx_t_4 += 33; __Pyx_GIVEREF(__pyx_kp_u_ignoring_call_to_set_mem_field); PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_kp_u_ignoring_call_to_set_mem_field); __pyx_t_10 = __Pyx_PyUnicode_Join(__pyx_t_5, 3, __pyx_t_4, __pyx_t_9); if (unlikely(!__pyx_t_10)) __PYX_ERR(4, 299, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_5 = NULL; __pyx_t_11 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_6))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_6); if (likely(__pyx_t_5)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_6, function); __pyx_t_11 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_t_10}; __pyx_t_7 = __Pyx_PyObject_FastCall(__pyx_t_6, __pyx_callargs+1-__pyx_t_11, 1+__pyx_t_11); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; if (unlikely(!__pyx_t_7)) __PYX_ERR(4, 299, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; } __pyx_L3:;
300:
+301: cpdef get_record(self):
static PyObject *__pyx_pw_4fcio_4FCIO_17get_record(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ static PyObject *__pyx_f_4fcio_4FCIO_get_record(struct __pyx_obj_4fcio_FCIO *__pyx_v_self, int __pyx_skip_dispatch) { PyObject *__pyx_r = NULL; /* 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_PyType_HasFeature(Py_TYPE(((PyObject *)__pyx_v_self)), (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))) { #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS static PY_UINT64_T __pyx_tp_dict_version = __PYX_DICT_VERSION_INIT, __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT; if (unlikely(!__Pyx_object_dict_version_matches(((PyObject *)__pyx_v_self), __pyx_tp_dict_version, __pyx_obj_dict_version))) { PY_UINT64_T __pyx_typedict_guard = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self)); #endif __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_get_record); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 301, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (!__Pyx_IsSameCFunction(__pyx_t_1, (void*) __pyx_pw_4fcio_4FCIO_17get_record)) { __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_t_1); __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_3))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); __pyx_t_5 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_4, NULL}; __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_5, 0+__pyx_t_5); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 301, __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; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; goto __pyx_L0; } #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS __pyx_tp_dict_version = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self)); __pyx_obj_dict_version = __Pyx_get_object_dict_version(((PyObject *)__pyx_v_self)); if (unlikely(__pyx_typedict_guard != __pyx_tp_dict_version)) { __pyx_tp_dict_version = __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT; } #endif __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS } #endif } /* … */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("fcio.FCIO.get_record", __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_4fcio_4FCIO_17get_record(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_4fcio_4FCIO_16get_record, "\n Calls FCIOGetRecord.\n Saves the returned tag (accessible via FCIO.tag).\n\n Returns False if the tag <= 0 indicating either a stream error or timeout.\n Returns True otherwise.\n "); static PyMethodDef __pyx_mdef_4fcio_4FCIO_17get_record = {"get_record", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4fcio_4FCIO_17get_record, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_4fcio_4FCIO_16get_record}; static PyObject *__pyx_pw_4fcio_4FCIO_17get_record(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("get_record (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("get_record", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "get_record", 0))) return NULL; __pyx_r = __pyx_pf_4fcio_4FCIO_16get_record(((struct __pyx_obj_4fcio_FCIO *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_4fcio_4FCIO_16get_record(struct __pyx_obj_4fcio_FCIO *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __pyx_f_4fcio_4FCIO_get_record(__pyx_v_self, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 301, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("fcio.FCIO.get_record", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* … */ __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_4fcio_4FCIO_17get_record, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_FCIO_get_record, NULL, __pyx_n_s_fcio, __pyx_d, ((PyObject *)__pyx_codeobj__81)); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 301, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_4fcio_FCIO, __pyx_n_s_get_record, __pyx_t_4) < 0) __PYX_ERR(4, 301, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; PyType_Modified(__pyx_ptype_4fcio_FCIO); /* … */ __pyx_codeobj__81 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__39, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_fcio_cy_fcio_fcio_pyx, __pyx_n_s_get_record, 301, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__81)) __PYX_ERR(4, 301, __pyx_L1_error)
302: """
303: Calls FCIOGetRecord.
304: Saves the returned tag (accessible via FCIO.tag).
305:
306: Returns False if the tag <= 0 indicating either a stream error or timeout.
307: Returns True otherwise.
308: """
+309: if self._fcio_data:
__pyx_t_6 = (__pyx_v_self->_fcio_data != 0); if (likely(__pyx_t_6)) { /* … */ }
+310: self._tag = FCIOGetRecord(self._fcio_data)
__pyx_v_self->_tag = FCIOGetRecord(__pyx_v_self->_fcio_data);
311:
+312: if self._tag == FCIOTag.FCIOConfig:
__pyx_t_6 = (__pyx_v_self->_tag == FCIOConfig); if (__pyx_t_6) { /* … */ goto __pyx_L4; }
313: # config must always be allocated first.
+314: self.config = Config(self)
__pyx_t_1 = __Pyx_PyObject_CallOneArg(((PyObject *)__pyx_ptype_4fcio_Config), ((PyObject *)__pyx_v_self)); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 314, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_GIVEREF(__pyx_t_1); __Pyx_GOTREF((PyObject *)__pyx_v_self->config); __Pyx_DECREF((PyObject *)__pyx_v_self->config); __pyx_v_self->config = ((struct __pyx_obj_4fcio_Config *)__pyx_t_1); __pyx_t_1 = 0;
+315: self.status = Status(self)
__pyx_t_1 = __Pyx_PyObject_CallOneArg(((PyObject *)__pyx_ptype_4fcio_Status), ((PyObject *)__pyx_v_self)); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 315, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_GIVEREF(__pyx_t_1); __Pyx_GOTREF((PyObject *)__pyx_v_self->status); __Pyx_DECREF((PyObject *)__pyx_v_self->status); __pyx_v_self->status = ((struct __pyx_obj_4fcio_Status *)__pyx_t_1); __pyx_t_1 = 0;
+316: self.event = Event(self)
__pyx_t_1 = __Pyx_PyObject_CallOneArg(((PyObject *)__pyx_ptype_4fcio_Event), ((PyObject *)__pyx_v_self)); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 316, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_GIVEREF(__pyx_t_1); __Pyx_GOTREF((PyObject *)__pyx_v_self->event); __Pyx_DECREF((PyObject *)__pyx_v_self->event); __pyx_v_self->event = ((struct __pyx_obj_4fcio_Event *)__pyx_t_1); __pyx_t_1 = 0;
+317: self.recevent = RecEvent(self)
__pyx_t_1 = __Pyx_PyObject_CallOneArg(((PyObject *)__pyx_ptype_4fcio_RecEvent), ((PyObject *)__pyx_v_self)); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 317, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_GIVEREF(__pyx_t_1); __Pyx_GOTREF((PyObject *)__pyx_v_self->recevent); __Pyx_DECREF((PyObject *)__pyx_v_self->recevent); __pyx_v_self->recevent = ((struct __pyx_obj_4fcio_RecEvent *)__pyx_t_1); __pyx_t_1 = 0;
+318: elif (self._tag in [FCIOTag.FCIOEvent, FCIOTag.FCIOSparseEvent, FCIOTag.FCIOEventHeader]):
switch (__pyx_v_self->_tag) { case FCIOEvent: case FCIOSparseEvent: case FCIOEventHeader: __pyx_t_6 = 1; break; default: __pyx_t_6 = 0; break; } __pyx_t_7 = __pyx_t_6; if (__pyx_t_7) { /* … */ goto __pyx_L4; }
+319: self.event.update()
__pyx_t_1 = ((struct __pyx_vtabstruct_4fcio_Event *)__pyx_v_self->event->__pyx_base.__pyx_vtab)->__pyx_base.update(((struct __pyx_obj_4fcio_FCIOExt *)__pyx_v_self->event)); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 319, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+320: elif self._tag == FCIOTag.FCIORecEvent:
__pyx_t_7 = (__pyx_v_self->_tag == FCIORecEvent); if (__pyx_t_7) { /* … */ goto __pyx_L4; }
+321: self.recevent.update()
__pyx_t_1 = ((struct __pyx_vtabstruct_4fcio_RecEvent *)__pyx_v_self->recevent->__pyx_base.__pyx_vtab)->__pyx_base.update(((struct __pyx_obj_4fcio_FCIOExt *)__pyx_v_self->recevent)); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 321, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+322: elif self._tag == FCIOTag.FCIOFSPConfig:
__pyx_t_7 = (__pyx_v_self->_tag == FCIOFSPConfig); if (__pyx_t_7) { /* … */ goto __pyx_L4; }
+323: self._fsp = FSP()
__pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_4fcio_FSP)); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 323, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_GIVEREF(__pyx_t_1); __Pyx_GOTREF((PyObject *)__pyx_v_self->_fsp); __Pyx_DECREF((PyObject *)__pyx_v_self->_fsp); __pyx_v_self->_fsp = ((struct __pyx_obj_4fcio_FSP *)__pyx_t_1); __pyx_t_1 = 0;
+324: self._fsp.read_config(self)
__pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self->_fsp), __pyx_n_s_read_config); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 324, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_5 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_3, ((PyObject *)__pyx_v_self)}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 324, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+325: elif self._tag == FCIOTag.FCIOFSPEvent:
__pyx_t_7 = (__pyx_v_self->_tag == FCIOFSPEvent); if (__pyx_t_7) { /* … */ goto __pyx_L4; }
+326: self._fsp.read_event(self)
__pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self->_fsp), __pyx_n_s_read_event); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 326, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_5 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_3, ((PyObject *)__pyx_v_self)}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 326, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+327: elif self._tag == FCIOTag.FCIOFSPStatus:
__pyx_t_7 = (__pyx_v_self->_tag == FCIOFSPStatus); if (__pyx_t_7) { /* … */ goto __pyx_L4; }
+328: self._fsp.read_status(self)
__pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self->_fsp), __pyx_n_s_read_status); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 328, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_5 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_3, ((PyObject *)__pyx_v_self)}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 328, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+329: elif self._tag <= 0:
__pyx_t_7 = (__pyx_v_self->_tag <= 0); if (__pyx_t_7) { /* … */ } __pyx_L4:;
+330: return False
__Pyx_XDECREF(__pyx_r); __Pyx_INCREF(Py_False); __pyx_r = Py_False; goto __pyx_L0;
331:
+332: return True
__Pyx_XDECREF(__pyx_r); __Pyx_INCREF(Py_True); __pyx_r = Py_True; goto __pyx_L0;
333: else:
+334: raise IOError(f"File {self._peer} not opened.")
/*else*/ { __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 334, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_8 = 0; __pyx_t_9 = 127; __Pyx_INCREF(__pyx_kp_u_File); __pyx_t_8 += 5; __Pyx_GIVEREF(__pyx_kp_u_File); PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_kp_u_File); __pyx_t_2 = __Pyx_PyObject_FormatSimple(__pyx_v_self->_peer, __pyx_empty_unicode); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 334, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_9 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_2) > __pyx_t_9) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_2) : __pyx_t_9; __pyx_t_8 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_2); __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_2); __pyx_t_2 = 0; __Pyx_INCREF(__pyx_kp_u_not_opened); __pyx_t_8 += 12; __Pyx_GIVEREF(__pyx_kp_u_not_opened); PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_kp_u_not_opened); __pyx_t_2 = __Pyx_PyUnicode_Join(__pyx_t_1, 3, __pyx_t_8, __pyx_t_9); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 334, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_builtin_IOError, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 334, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_Raise(__pyx_t_1, 0, 0, 0); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __PYX_ERR(4, 334, __pyx_L1_error) }
335:
+336: @property
/* Python wrapper */ static PyObject *__pyx_pw_4fcio_4FCIO_3tag_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_4fcio_4FCIO_3tag_1__get__(PyObject *__pyx_v_self) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_4fcio_4FCIO_3tag___get__(((struct __pyx_obj_4fcio_FCIO *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_4fcio_4FCIO_3tag___get__(struct __pyx_obj_4fcio_FCIO *__pyx_v_self) { PyObject *__pyx_r = NULL; /* … */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("fcio.FCIO.tag.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; }
337: def tag(self):
338: """
339: returns the current tag
340: """
+341: return self._tag
__Pyx_XDECREF(__pyx_r); __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->_tag); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 341, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0;
342:
+343: @property
/* Python wrapper */ static PyObject *__pyx_pw_4fcio_4FCIO_6config_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_4fcio_4FCIO_6config_1__get__(PyObject *__pyx_v_self) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_4fcio_4FCIO_6config___get__(((struct __pyx_obj_4fcio_FCIO *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_4fcio_4FCIO_6config___get__(struct __pyx_obj_4fcio_FCIO *__pyx_v_self) { PyObject *__pyx_r = NULL; /* … */ /* function exit code */ __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; }
344: def config(self):
345: """
346: returns the current FCIOConfig record
347: """
+348: return self.config
__Pyx_XDECREF(__pyx_r); __Pyx_INCREF((PyObject *)__pyx_v_self->config); __pyx_r = ((PyObject *)__pyx_v_self->config); goto __pyx_L0;
349:
+350: @property
/* Python wrapper */ static PyObject *__pyx_pw_4fcio_4FCIO_5event_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_4fcio_4FCIO_5event_1__get__(PyObject *__pyx_v_self) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_4fcio_4FCIO_5event___get__(((struct __pyx_obj_4fcio_FCIO *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_4fcio_4FCIO_5event___get__(struct __pyx_obj_4fcio_FCIO *__pyx_v_self) { PyObject *__pyx_r = NULL; /* … */ /* function exit code */ __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; }
351: def event(self):
352: """
353: returns the current FCIOEvent record
354: """
+355: return self.event
__Pyx_XDECREF(__pyx_r); __Pyx_INCREF((PyObject *)__pyx_v_self->event); __pyx_r = ((PyObject *)__pyx_v_self->event); goto __pyx_L0;
356:
+357: @property
/* Python wrapper */ static PyObject *__pyx_pw_4fcio_4FCIO_8recevent_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_4fcio_4FCIO_8recevent_1__get__(PyObject *__pyx_v_self) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_4fcio_4FCIO_8recevent___get__(((struct __pyx_obj_4fcio_FCIO *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_4fcio_4FCIO_8recevent___get__(struct __pyx_obj_4fcio_FCIO *__pyx_v_self) { PyObject *__pyx_r = NULL; /* … */ /* function exit code */ __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; }
358: def recevent(self):
359: """
360: returns the current FCIORecEvent record
361: """
+362: return self.recevent
__Pyx_XDECREF(__pyx_r); __Pyx_INCREF((PyObject *)__pyx_v_self->recevent); __pyx_r = ((PyObject *)__pyx_v_self->recevent); goto __pyx_L0;
363:
+364: @property
/* Python wrapper */ static PyObject *__pyx_pw_4fcio_4FCIO_6status_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_4fcio_4FCIO_6status_1__get__(PyObject *__pyx_v_self) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_4fcio_4FCIO_6status___get__(((struct __pyx_obj_4fcio_FCIO *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_4fcio_4FCIO_6status___get__(struct __pyx_obj_4fcio_FCIO *__pyx_v_self) { PyObject *__pyx_r = NULL; /* … */ /* function exit code */ __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_gb_4fcio_4FCIO_4tags_2generator1(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value); /* proto */
365: def status(self):
366: """
367: returns the current FCIOStatus record
368: """
+369: return self.status
__Pyx_XDECREF(__pyx_r); __Pyx_INCREF((PyObject *)__pyx_v_self->status); __pyx_r = ((PyObject *)__pyx_v_self->status); goto __pyx_L0;
370:
+371: @property
/* Python wrapper */ static PyObject *__pyx_pw_4fcio_4FCIO_4tags_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_4fcio_4FCIO_4tags_1__get__(PyObject *__pyx_v_self) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_4fcio_4FCIO_4tags___get__(((struct __pyx_obj_4fcio_FCIO *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_4fcio_4FCIO_4tags___get__(struct __pyx_obj_4fcio_FCIO *__pyx_v_self) { struct __pyx_obj_4fcio___pyx_scope_struct_1___get__ *__pyx_cur_scope; PyObject *__pyx_r = NULL; __pyx_cur_scope = (struct __pyx_obj_4fcio___pyx_scope_struct_1___get__ *)__pyx_tp_new_4fcio___pyx_scope_struct_1___get__(__pyx_ptype_4fcio___pyx_scope_struct_1___get__, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_cur_scope)) { __pyx_cur_scope = ((struct __pyx_obj_4fcio___pyx_scope_struct_1___get__ *)Py_None); __Pyx_INCREF(Py_None); __PYX_ERR(4, 371, __pyx_L1_error) } else { __Pyx_GOTREF((PyObject *)__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); { __pyx_CoroutineObject *gen = __Pyx_Generator_New((__pyx_coroutine_body_t) __pyx_gb_4fcio_4FCIO_4tags_2generator1, NULL, (PyObject *) __pyx_cur_scope, __pyx_n_s_get, __pyx_n_s_FCIO___get, __pyx_n_s_fcio); if (unlikely(!gen)) __PYX_ERR(4, 371, __pyx_L1_error) __Pyx_DECREF(__pyx_cur_scope); __Pyx_RefNannyFinishContext(); return (PyObject *) gen; } /* function exit code */ __pyx_L1_error:; __Pyx_AddTraceback("fcio.FCIO.tags.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __Pyx_DECREF((PyObject *)__pyx_cur_scope); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_gb_4fcio_4FCIO_4tags_2generator1(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value) /* generator body */ { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("tags", 0); __pyx_L3_first_run:; if (unlikely(!__pyx_sent_value)) __PYX_ERR(4, 371, __pyx_L1_error) /* … */ /* function exit code */ PyErr_SetNone(PyExc_StopIteration); goto __pyx_L0; __pyx_L1_error:; __Pyx_Generator_Replace_StopIteration(0); __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("tags", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_L0:; __Pyx_XDECREF(__pyx_r); __pyx_r = 0; #if !CYTHON_USE_EXC_INFO_STACK __Pyx_Coroutine_ResetAndClearException(__pyx_generator); #endif __pyx_generator->resume_label = -1; __Pyx_Coroutine_clear((PyObject*)__pyx_generator); __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_gb_4fcio_4FCIO_7configs_2generator2(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value); /* proto */ /* … */ struct __pyx_obj_4fcio___pyx_scope_struct_1___get__ { PyObject_HEAD struct __pyx_obj_4fcio_FCIO *__pyx_v_self; };
372: def tags(self):
373: """
374: Iterate through all FCIO records in the datastream.
375:
376: Returns the current tag. Comparable behaviour to FCIOGetRecord of fcio.c
377: """
+378: while self.get_record():
while (1) { __pyx_t_1 = ((struct __pyx_vtabstruct_4fcio_FCIO *)__pyx_cur_scope->__pyx_v_self->__pyx_vtab)->get_record(__pyx_cur_scope->__pyx_v_self, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 378, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(4, 378, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (!__pyx_t_2) break;
+379: yield self._tag
__pyx_t_1 = __Pyx_PyInt_From_int(__pyx_cur_scope->__pyx_v_self->_tag); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 379, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); __Pyx_Coroutine_ResetAndClearException(__pyx_generator); /* return from generator, yielding value */ __pyx_generator->resume_label = 1; return __pyx_r; __pyx_L6_resume_from_yield:; if (unlikely(!__pyx_sent_value)) __PYX_ERR(4, 379, __pyx_L1_error) } CYTHON_MAYBE_UNUSED_VAR(__pyx_cur_scope);
380:
+381: @property
/* Python wrapper */ static PyObject *__pyx_pw_4fcio_4FCIO_7configs_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_4fcio_4FCIO_7configs_1__get__(PyObject *__pyx_v_self) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_4fcio_4FCIO_7configs___get__(((struct __pyx_obj_4fcio_FCIO *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_4fcio_4FCIO_7configs___get__(struct __pyx_obj_4fcio_FCIO *__pyx_v_self) { struct __pyx_obj_4fcio___pyx_scope_struct_2___get__ *__pyx_cur_scope; PyObject *__pyx_r = NULL; __pyx_cur_scope = (struct __pyx_obj_4fcio___pyx_scope_struct_2___get__ *)__pyx_tp_new_4fcio___pyx_scope_struct_2___get__(__pyx_ptype_4fcio___pyx_scope_struct_2___get__, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_cur_scope)) { __pyx_cur_scope = ((struct __pyx_obj_4fcio___pyx_scope_struct_2___get__ *)Py_None); __Pyx_INCREF(Py_None); __PYX_ERR(4, 381, __pyx_L1_error) } else { __Pyx_GOTREF((PyObject *)__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); { __pyx_CoroutineObject *gen = __Pyx_Generator_New((__pyx_coroutine_body_t) __pyx_gb_4fcio_4FCIO_7configs_2generator2, NULL, (PyObject *) __pyx_cur_scope, __pyx_n_s_get, __pyx_n_s_FCIO___get, __pyx_n_s_fcio); if (unlikely(!gen)) __PYX_ERR(4, 381, __pyx_L1_error) __Pyx_DECREF(__pyx_cur_scope); __Pyx_RefNannyFinishContext(); return (PyObject *) gen; } /* function exit code */ __pyx_L1_error:; __Pyx_AddTraceback("fcio.FCIO.configs.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __Pyx_DECREF((PyObject *)__pyx_cur_scope); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_gb_4fcio_4FCIO_7configs_2generator2(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value) /* generator body */ { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("configs", 0); __pyx_L3_first_run:; if (unlikely(!__pyx_sent_value)) __PYX_ERR(4, 381, __pyx_L1_error) /* … */ /* function exit code */ PyErr_SetNone(PyExc_StopIteration); goto __pyx_L0; __pyx_L1_error:; __Pyx_Generator_Replace_StopIteration(0); __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("configs", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_L0:; __Pyx_XDECREF(__pyx_r); __pyx_r = 0; #if !CYTHON_USE_EXC_INFO_STACK __Pyx_Coroutine_ResetAndClearException(__pyx_generator); #endif __pyx_generator->resume_label = -1; __Pyx_Coroutine_clear((PyObject*)__pyx_generator); __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_gb_4fcio_4FCIO_6events_2generator3(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value); /* proto */ /* … */ struct __pyx_obj_4fcio___pyx_scope_struct_2___get__ { PyObject_HEAD struct __pyx_obj_4fcio_FCIO *__pyx_v_self; };
382: def configs(self):
383: """
384: Iterate through all FCIOConfig records in the datastream.
385:
386: Returns the current config.
387: """
+388: while self.get_record():
while (1) { __pyx_t_1 = ((struct __pyx_vtabstruct_4fcio_FCIO *)__pyx_cur_scope->__pyx_v_self->__pyx_vtab)->get_record(__pyx_cur_scope->__pyx_v_self, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 388, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(4, 388, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (!__pyx_t_2) break;
+389: if self._tag == FCIOTag.FCIOConfig:
__pyx_t_2 = (__pyx_cur_scope->__pyx_v_self->_tag == FCIOConfig); if (__pyx_t_2) { /* … */ } } CYTHON_MAYBE_UNUSED_VAR(__pyx_cur_scope);
+390: yield self.config
__Pyx_INCREF((PyObject *)__pyx_cur_scope->__pyx_v_self->config); __pyx_r = ((PyObject *)__pyx_cur_scope->__pyx_v_self->config); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); __Pyx_Coroutine_ResetAndClearException(__pyx_generator); /* return from generator, yielding value */ __pyx_generator->resume_label = 1; return __pyx_r; __pyx_L7_resume_from_yield:; if (unlikely(!__pyx_sent_value)) __PYX_ERR(4, 390, __pyx_L1_error)
391:
+392: @property
/* Python wrapper */ static PyObject *__pyx_pw_4fcio_4FCIO_6events_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_4fcio_4FCIO_6events_1__get__(PyObject *__pyx_v_self) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_4fcio_4FCIO_6events___get__(((struct __pyx_obj_4fcio_FCIO *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_4fcio_4FCIO_6events___get__(struct __pyx_obj_4fcio_FCIO *__pyx_v_self) { struct __pyx_obj_4fcio___pyx_scope_struct_3___get__ *__pyx_cur_scope; PyObject *__pyx_r = NULL; __pyx_cur_scope = (struct __pyx_obj_4fcio___pyx_scope_struct_3___get__ *)__pyx_tp_new_4fcio___pyx_scope_struct_3___get__(__pyx_ptype_4fcio___pyx_scope_struct_3___get__, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_cur_scope)) { __pyx_cur_scope = ((struct __pyx_obj_4fcio___pyx_scope_struct_3___get__ *)Py_None); __Pyx_INCREF(Py_None); __PYX_ERR(4, 392, __pyx_L1_error) } else { __Pyx_GOTREF((PyObject *)__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); { __pyx_CoroutineObject *gen = __Pyx_Generator_New((__pyx_coroutine_body_t) __pyx_gb_4fcio_4FCIO_6events_2generator3, NULL, (PyObject *) __pyx_cur_scope, __pyx_n_s_get, __pyx_n_s_FCIO___get, __pyx_n_s_fcio); if (unlikely(!gen)) __PYX_ERR(4, 392, __pyx_L1_error) __Pyx_DECREF(__pyx_cur_scope); __Pyx_RefNannyFinishContext(); return (PyObject *) gen; } /* function exit code */ __pyx_L1_error:; __Pyx_AddTraceback("fcio.FCIO.events.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __Pyx_DECREF((PyObject *)__pyx_cur_scope); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_gb_4fcio_4FCIO_6events_2generator3(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value) /* generator body */ { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("events", 0); __pyx_L3_first_run:; if (unlikely(!__pyx_sent_value)) __PYX_ERR(4, 392, __pyx_L1_error) /* … */ /* function exit code */ PyErr_SetNone(PyExc_StopIteration); goto __pyx_L0; __pyx_L1_error:; __Pyx_Generator_Replace_StopIteration(0); __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("events", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_L0:; __Pyx_XDECREF(__pyx_r); __pyx_r = 0; #if !CYTHON_USE_EXC_INFO_STACK __Pyx_Coroutine_ResetAndClearException(__pyx_generator); #endif __pyx_generator->resume_label = -1; __Pyx_Coroutine_clear((PyObject*)__pyx_generator); __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_gb_4fcio_4FCIO_9recevents_2generator4(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value); /* proto */ /* … */ struct __pyx_obj_4fcio___pyx_scope_struct_3___get__ { PyObject_HEAD struct __pyx_obj_4fcio_FCIO *__pyx_v_self; };
393: def events(self):
394: """
395: Iterate through all FCIOEvent or FCIOSparseEvent records in the datastream.
396:
397: Returns the current event.
398: """
+399: while self.get_record():
while (1) { __pyx_t_1 = ((struct __pyx_vtabstruct_4fcio_FCIO *)__pyx_cur_scope->__pyx_v_self->__pyx_vtab)->get_record(__pyx_cur_scope->__pyx_v_self, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 399, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(4, 399, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (!__pyx_t_2) break;
+400: if self._tag in [FCIOTag.FCIOEvent, FCIOTag.FCIOSparseEvent, FCIOTag.FCIOEventHeader]:
switch (__pyx_cur_scope->__pyx_v_self->_tag) { case FCIOEvent: case FCIOSparseEvent: case FCIOEventHeader: /* … */ break; default: break; } } CYTHON_MAYBE_UNUSED_VAR(__pyx_cur_scope);
+401: yield self.event
__Pyx_INCREF((PyObject *)__pyx_cur_scope->__pyx_v_self->event); __pyx_r = ((PyObject *)__pyx_cur_scope->__pyx_v_self->event); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); __Pyx_Coroutine_ResetAndClearException(__pyx_generator); /* return from generator, yielding value */ __pyx_generator->resume_label = 1; return __pyx_r; __pyx_L6_resume_from_yield:; if (unlikely(!__pyx_sent_value)) __PYX_ERR(4, 401, __pyx_L1_error)
402:
+403: @property
/* Python wrapper */ static PyObject *__pyx_pw_4fcio_4FCIO_9recevents_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_4fcio_4FCIO_9recevents_1__get__(PyObject *__pyx_v_self) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_4fcio_4FCIO_9recevents___get__(((struct __pyx_obj_4fcio_FCIO *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_4fcio_4FCIO_9recevents___get__(struct __pyx_obj_4fcio_FCIO *__pyx_v_self) { struct __pyx_obj_4fcio___pyx_scope_struct_4___get__ *__pyx_cur_scope; PyObject *__pyx_r = NULL; __pyx_cur_scope = (struct __pyx_obj_4fcio___pyx_scope_struct_4___get__ *)__pyx_tp_new_4fcio___pyx_scope_struct_4___get__(__pyx_ptype_4fcio___pyx_scope_struct_4___get__, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_cur_scope)) { __pyx_cur_scope = ((struct __pyx_obj_4fcio___pyx_scope_struct_4___get__ *)Py_None); __Pyx_INCREF(Py_None); __PYX_ERR(4, 403, __pyx_L1_error) } else { __Pyx_GOTREF((PyObject *)__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); { __pyx_CoroutineObject *gen = __Pyx_Generator_New((__pyx_coroutine_body_t) __pyx_gb_4fcio_4FCIO_9recevents_2generator4, NULL, (PyObject *) __pyx_cur_scope, __pyx_n_s_get, __pyx_n_s_FCIO___get, __pyx_n_s_fcio); if (unlikely(!gen)) __PYX_ERR(4, 403, __pyx_L1_error) __Pyx_DECREF(__pyx_cur_scope); __Pyx_RefNannyFinishContext(); return (PyObject *) gen; } /* function exit code */ __pyx_L1_error:; __Pyx_AddTraceback("fcio.FCIO.recevents.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __Pyx_DECREF((PyObject *)__pyx_cur_scope); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_gb_4fcio_4FCIO_9recevents_2generator4(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value) /* generator body */ { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("recevents", 0); __pyx_L3_first_run:; if (unlikely(!__pyx_sent_value)) __PYX_ERR(4, 403, __pyx_L1_error) /* … */ /* function exit code */ PyErr_SetNone(PyExc_StopIteration); goto __pyx_L0; __pyx_L1_error:; __Pyx_Generator_Replace_StopIteration(0); __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("recevents", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_L0:; __Pyx_XDECREF(__pyx_r); __pyx_r = 0; #if !CYTHON_USE_EXC_INFO_STACK __Pyx_Coroutine_ResetAndClearException(__pyx_generator); #endif __pyx_generator->resume_label = -1; __Pyx_Coroutine_clear((PyObject*)__pyx_generator); __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_gb_4fcio_4FCIO_8statuses_2generator5(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value); /* proto */ /* … */ struct __pyx_obj_4fcio___pyx_scope_struct_4___get__ { PyObject_HEAD struct __pyx_obj_4fcio_FCIO *__pyx_v_self; };
404: def recevents(self):
405: """
406: Iterate through all FCIORecEvent records in the datastream.
407:
408: Returns the current event.
409: """
+410: while self.get_record():
while (1) { __pyx_t_1 = ((struct __pyx_vtabstruct_4fcio_FCIO *)__pyx_cur_scope->__pyx_v_self->__pyx_vtab)->get_record(__pyx_cur_scope->__pyx_v_self, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 410, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(4, 410, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (!__pyx_t_2) break;
+411: if self._tag == FCIOTag.FCIORecEvent:
__pyx_t_2 = (__pyx_cur_scope->__pyx_v_self->_tag == FCIORecEvent); if (__pyx_t_2) { /* … */ } } CYTHON_MAYBE_UNUSED_VAR(__pyx_cur_scope);
+412: yield self.recevent
__Pyx_INCREF((PyObject *)__pyx_cur_scope->__pyx_v_self->recevent); __pyx_r = ((PyObject *)__pyx_cur_scope->__pyx_v_self->recevent); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); __Pyx_Coroutine_ResetAndClearException(__pyx_generator); /* return from generator, yielding value */ __pyx_generator->resume_label = 1; return __pyx_r; __pyx_L7_resume_from_yield:; if (unlikely(!__pyx_sent_value)) __PYX_ERR(4, 412, __pyx_L1_error)
413:
+414: @property
/* Python wrapper */ static PyObject *__pyx_pw_4fcio_4FCIO_8statuses_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_4fcio_4FCIO_8statuses_1__get__(PyObject *__pyx_v_self) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_4fcio_4FCIO_8statuses___get__(((struct __pyx_obj_4fcio_FCIO *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_4fcio_4FCIO_8statuses___get__(struct __pyx_obj_4fcio_FCIO *__pyx_v_self) { struct __pyx_obj_4fcio___pyx_scope_struct_5___get__ *__pyx_cur_scope; PyObject *__pyx_r = NULL; __pyx_cur_scope = (struct __pyx_obj_4fcio___pyx_scope_struct_5___get__ *)__pyx_tp_new_4fcio___pyx_scope_struct_5___get__(__pyx_ptype_4fcio___pyx_scope_struct_5___get__, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_cur_scope)) { __pyx_cur_scope = ((struct __pyx_obj_4fcio___pyx_scope_struct_5___get__ *)Py_None); __Pyx_INCREF(Py_None); __PYX_ERR(4, 414, __pyx_L1_error) } else { __Pyx_GOTREF((PyObject *)__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); { __pyx_CoroutineObject *gen = __Pyx_Generator_New((__pyx_coroutine_body_t) __pyx_gb_4fcio_4FCIO_8statuses_2generator5, NULL, (PyObject *) __pyx_cur_scope, __pyx_n_s_get, __pyx_n_s_FCIO___get, __pyx_n_s_fcio); if (unlikely(!gen)) __PYX_ERR(4, 414, __pyx_L1_error) __Pyx_DECREF(__pyx_cur_scope); __Pyx_RefNannyFinishContext(); return (PyObject *) gen; } /* function exit code */ __pyx_L1_error:; __Pyx_AddTraceback("fcio.FCIO.statuses.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __Pyx_DECREF((PyObject *)__pyx_cur_scope); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_gb_4fcio_4FCIO_8statuses_2generator5(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value) /* generator body */ { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("statuses", 0); __pyx_L3_first_run:; if (unlikely(!__pyx_sent_value)) __PYX_ERR(4, 414, __pyx_L1_error) /* … */ /* function exit code */ PyErr_SetNone(PyExc_StopIteration); goto __pyx_L0; __pyx_L1_error:; __Pyx_Generator_Replace_StopIteration(0); __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("statuses", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_L0:; __Pyx_XDECREF(__pyx_r); __pyx_r = 0; #if !CYTHON_USE_EXC_INFO_STACK __Pyx_Coroutine_ResetAndClearException(__pyx_generator); #endif __pyx_generator->resume_label = -1; __Pyx_Coroutine_clear((PyObject*)__pyx_generator); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* … */ struct __pyx_obj_4fcio___pyx_scope_struct_5___get__ { PyObject_HEAD struct __pyx_obj_4fcio_FCIO *__pyx_v_self; };
415: def statuses(self):
416: """
417: Iterate through all FCIOStatus records in the datastream.
418:
419: Returns the current event.
420: """
+421: while self.get_record():
while (1) { __pyx_t_1 = ((struct __pyx_vtabstruct_4fcio_FCIO *)__pyx_cur_scope->__pyx_v_self->__pyx_vtab)->get_record(__pyx_cur_scope->__pyx_v_self, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 421, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(4, 421, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (!__pyx_t_2) break;
+422: if self._tag == FCIOTag.FCIOStatus:
__pyx_t_2 = (__pyx_cur_scope->__pyx_v_self->_tag == FCIOStatus); if (__pyx_t_2) { /* … */ } } CYTHON_MAYBE_UNUSED_VAR(__pyx_cur_scope);
+423: yield self.status
__Pyx_INCREF((PyObject *)__pyx_cur_scope->__pyx_v_self->status); __pyx_r = ((PyObject *)__pyx_cur_scope->__pyx_v_self->status); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); __Pyx_Coroutine_ResetAndClearException(__pyx_generator); /* return from generator, yielding value */ __pyx_generator->resume_label = 1; return __pyx_r; __pyx_L7_resume_from_yield:; if (unlikely(!__pyx_sent_value)) __PYX_ERR(4, 423, __pyx_L1_error)
424:
+425: @property
/* Python wrapper */ static PyObject *__pyx_pw_4fcio_4FCIO_3fsp_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_4fcio_4FCIO_3fsp_1__get__(PyObject *__pyx_v_self) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_4fcio_4FCIO_3fsp___get__(((struct __pyx_obj_4fcio_FCIO *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_4fcio_4FCIO_3fsp___get__(struct __pyx_obj_4fcio_FCIO *__pyx_v_self) { PyObject *__pyx_r = NULL; /* … */ /* function exit code */ __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; }
426: def fsp(self):
+427: return self._fsp
__Pyx_XDECREF(__pyx_r); __Pyx_INCREF((PyObject *)__pyx_v_self->_fsp); __pyx_r = ((PyObject *)__pyx_v_self->_fsp); goto __pyx_L0;