mirror of
https://github.com/msgpack/msgpack-c.git
synced 2025-03-19 04:52:59 +01:00
Release 0.1.0
This commit is contained in:
parent
900785e1aa
commit
e5c49dae13
@ -3,8 +3,8 @@ MessagePack Python Binding
|
|||||||
===========================
|
===========================
|
||||||
|
|
||||||
:author: Naoki INADA
|
:author: Naoki INADA
|
||||||
:version: 0.0.1
|
:version: 0.1.0
|
||||||
:date: 2009-06-27
|
:date: 2009-07-12
|
||||||
|
|
||||||
HOW TO USE
|
HOW TO USE
|
||||||
-----------
|
-----------
|
||||||
|
@ -139,7 +139,7 @@ cdef class Packer(object):
|
|||||||
|
|
||||||
|
|
||||||
def pack(object o, object stream):
|
def pack(object o, object stream):
|
||||||
"""pack a object `o` and write it to stream)."""
|
"""pack an object `o` and write it to stream)."""
|
||||||
packer = Packer()
|
packer = Packer()
|
||||||
stream.write(packer.pack(o))
|
stream.write(packer.pack(o))
|
||||||
|
|
||||||
@ -164,7 +164,7 @@ cdef extern from "unpack.h":
|
|||||||
|
|
||||||
|
|
||||||
def unpackb(object packed_bytes):
|
def unpackb(object packed_bytes):
|
||||||
"""Unpack packed_bytes to object. Returns unpacked object."""
|
"""Unpack packed_bytes to object. Returns an unpacked object."""
|
||||||
cdef const_char_ptr p = packed_bytes
|
cdef const_char_ptr p = packed_bytes
|
||||||
cdef template_context ctx
|
cdef template_context ctx
|
||||||
cdef size_t off = 0
|
cdef size_t off = 0
|
||||||
@ -179,7 +179,7 @@ def unpackb(object packed_bytes):
|
|||||||
unpacks = unpackb
|
unpacks = unpackb
|
||||||
|
|
||||||
def unpack(object stream):
|
def unpack(object stream):
|
||||||
"""unpack from stream."""
|
"""unpack an object from stream."""
|
||||||
packed = stream.read()
|
packed = stream.read()
|
||||||
return unpackb(packed)
|
return unpackb(packed)
|
||||||
|
|
||||||
@ -196,14 +196,14 @@ cdef class UnpackIterator(object):
|
|||||||
return self
|
return self
|
||||||
|
|
||||||
cdef class Unpacker(object):
|
cdef class Unpacker(object):
|
||||||
"""Unpacker(file_like=None, read_size=4096)
|
"""Unpacker(file_like=None, read_size=1024*1024)
|
||||||
|
|
||||||
Streaming unpacker.
|
Streaming unpacker.
|
||||||
file_like must have read(n) method.
|
file_like must have read(n) method.
|
||||||
read_size is used like file_like.read(read_size)
|
read_size is used like file_like.read(read_size)
|
||||||
|
|
||||||
If file_like is None, you can feed() bytes. feed() is useful
|
If file_like is None, you can ``feed()`` bytes. ``feed()`` is
|
||||||
for unpack from non-blocking stream.
|
useful for unpacking from non-blocking stream.
|
||||||
|
|
||||||
exsample 1:
|
exsample 1:
|
||||||
unpacker = Unpacker(afile)
|
unpacker = Unpacker(afile)
|
||||||
|
@ -5,7 +5,7 @@ from distutils.core import setup, Extension
|
|||||||
from Cython.Distutils import build_ext
|
from Cython.Distutils import build_ext
|
||||||
import os
|
import os
|
||||||
|
|
||||||
version = '0.0.1dev'
|
version = '0.1.0'
|
||||||
|
|
||||||
msgpack_mod = Extension('msgpack._msgpack',
|
msgpack_mod = Extension('msgpack._msgpack',
|
||||||
sources=['msgpack/_msgpack.pyx']
|
sources=['msgpack/_msgpack.pyx']
|
||||||
|
Loading…
x
Reference in New Issue
Block a user