yimmo.Context ==================== Contains the WSGI PEP3333 interface seen by python .. note:: Yimmo WSGI function naming uses the following pattern: - python object methods: ``yimmo_Context_`` - C-only functions to manipulate python objects: ``ymo_wsgi_ctx_`` --------------------------------------------------------------------------- C Utility Functions --------------------------------------------------------------------------- .. c:function:: yimmo_context_t* ymo_wsgi_ctx_update_environ( PyObject* pEnviron, ymo_wsgi_exchange_t* exchange) Update ``environ`` with values from ``exchange``: .. c:function:: ymo_wsgi_exchange_t* ymo_wsgi_ctx_exchange(yimmo_context_t* ctx) Return the exchange for this context. --------------------------------------------------------------------------- yimmo.Context --------------------------------------------------------------------------- .. py:currentmodule:: yimmo .. py:class:: Context This class encapsulates the exchange information for a given session, as well as providing the input/output streams and other facilities required by `PEP3333`_. .. c:function:: void yimmo_Context_dealloc(yimmo_context_t* self) .. py:method:: Context.__del__() .. c:function:: PyObject* yimmo_Context_start_response( yimmo_context_t* self, PyObject* const* args, Py_ssize_t nargs) .. py:method:: Context.start_response(status, response_headers, exc_info=None) PEP 3333 start_response .. c:function:: PyObject* yimmo_Context_read( yimmo_context_t* self, PyObject* const* args, Py_ssize_t nargs) .. py:method:: Context.read(size=-1) Implements the PEP3333 read(size) method for wsgi.input. The semantics are the same as io.RawIOBase.read(size=-1). The size parameter must be passed as a positional argument, not a kkwarg. .. c:function:: PyObject* yimmo_Context_readline( yimmo_context_t* self, PyObject* const* args, Py_ssize_t nargs) .. py:method:: Context.readline(size=-1) Implements the PEP3333 readline(size) method for wsgi.input. The semantics are the same as io.IOBase.readline(size=-1). The size parameter must be passed as a positional argument, not a kwarg. .. c:function:: PyObject* yimmo_Context_readlines( yimmo_context_t* self, PyObject* const* args, Py_ssize_t nargs) .. py:method:: Context.readlines(hint=-1) Implements the PEP3333 readlines(hint=-1) method for wsgi.input. The semantics are almost the same as io.IOBase.readlines(size=-1), save for the hint exception allowed by PEP3333: the hint parameter is ignored. The hint parameter must be passed as a positional argument, not a kkwarg. .. c:function:: PyObject* yimmo_Context_iter(yimmo_context_t* self) .. py:method:: Context.__iter__() Support the iterator protocol for WSGI context request bodies. .. c:function:: PyObject* yimmo_Context_write( yimmo_context_t* self, PyObject* const* args, Py_ssize_t nargs) .. py:method:: Context.write(b) PEP 3333: imperative write callback for content data (backwards compatibility for applications that don't provide data as a return value).