Package spoon :: Package ber :: Class BERStream
[hide private]
[frames] | no frames]

Class BERStream

source code

object --+
         |
        BERStream

FIXME docs

Instance Methods [hide private]
  __init__(self, fd, size=None)
x.__init__(...) initializes x; see x.__class__.__doc__ for signature
  _add_eof(self)
  _next_tag(self)
  add(self, item, compress=False)
Write an object into the stream.
  has_next(self)
Return True if there is still more data left in this stream, and a future call to next should succeed.
object next(self)
Return the next item from this stream.

Inherited from object: __delattr__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __str__


Static Methods [hide private]
  _get_encoder(item, compress=False)
  can_encode(item)

Class Variables [hide private]
  _decoder_table = {<ASN.1 Tag(APPLICATION, 2, size=None, container=Tru...
  _encoder_table = {<type 'NoneType'>: <function encode_null at 0xa7ad6...
  _zencoder_table = {<class 'spoon.Serial'>: <function encode_pyobjz at ...

Properties [hide private]

Inherited from object: __class__


Method Details [hide private]

__init__(self, fd, size=None)
(Constructor)

source code 
x.__init__(...) initializes x; see x.__class__.__doc__ for signature
Overrides: object.__init__
(inherited documentation)

_add_eof(self)

source code 
None

_get_encoder(item, compress=False)
Static Method

 
None

_next_tag(self)

source code 
None

add(self, item, compress=False)

source code 
Write an object into the stream. Simple types (None, bool, int, long, str, unicode, list, and tuple) are handled by default encoders. Other encoders may be added with the encoder decorator.
Parameters:
  • item (object) - object to add

can_encode(item)
Static Method

 
None

has_next(self)

source code 
Return True if there is still more data left in this stream, and a future call to next should succeed.
Returns:
True if the stream has more data to read

next(self)

source code 
Return the next item from this stream. Objects are decoded using the codecs registered via the decoder operator, though simple types (None, bool, int, long, str, unicode, list, and tuple) have default decoders.
Returns: object
the next object from the stream
Raises:

Class Variable Details [hide private]

_decoder_table

None
Value:
{<ASN.1 Tag(UNIVERSAL, 1, size=None, container=False)>: <function deco
de_bool at 0xa7ad695c>,
 <ASN.1 Tag(UNIVERSAL, 2, size=None, container=False)>: <function deco
de_int at 0xa7ad69cc>,
 <ASN.1 Tag(UNIVERSAL, 4, size=None, container=False)>: <function deco
de_str at 0xa7ad6a3c>,
 <ASN.1 Tag(UNIVERSAL, 5, size=None, container=False)>: <function deco
de_null at 0xa7ad68ec>,
...                                                                    
      

_encoder_table

None
Value:
{<type 'int'>: <function encode_int at 0xa7ad6994>,
 <type 'list'>: <function encode_list at 0xa7ad6ae4>,
 <type 'long'>: <function encode_int at 0xa7ad6994>,
 <type 'dict'>: <function encode_dict at 0xa7ad92cc>,
 <type 'NoneType'>: <function encode_null at 0xa7ad68b4>,
 <type 'str'>: <function encode_str at 0xa7ad6a04>,
 <type 'tuple'>: <function encode_list at 0xa7ad6ae4>,
 <type 'unicode'>: <function encode_unicode at 0xa7ad6a74>,
...                                                                    
      

_zencoder_table

None
Value:
{<class 'spoon.Serial'>: <function encode_pyobjz at 0xa7ad933c>}