Did I find the right examples for you? yes no      Crawl my project      Python Jobs

All Samples(1)  |  Call(0)  |  Derive(0)  |  Import(1)
Encode a list of items into a container with the given tag and write it
to a stream.  The list is written using indefinite-length encoding, so
no extra copying occurs.

@param fd: the file object to write into
@type fd: file
@param tag: the tag to use for this list
@type tag: L{Tag}
@param items: a list of items to put into the container
@type items: list or iterable

        def encode_container(fd, tag, items):
    """
    Encode a list of items into a container with the given tag and write it
    to a stream.  The list is written using indefinite-length encoding, so
    no extra copying occurs.
    
    @param fd: the file object to write into
    @type fd: file
    @param tag: the tag to use for this list
    @type tag: L{Tag}
    @param items: a list of items to put into the container
    @type items: list or iterable
    """
    Tag.from_tag(tag, None).write(fd)
    b = BERStream(fd)
    for x in items:
        b.add(x)
    b._add_eof()
        


src/s/p/spoonrpc-0.1.1/spoon/ber/__init__.py   spoonrpc(Download)
 
from tag import Tag
from stream import BERStream, encoder, zencoder, decoder, encode_container, decode_container
from stream import EOF_TYPE, NULL_TYPE, INT_TYPE, BYTES_TYPE, UTF8_TYPE, LIST_TYPE