Package pyamf :: Class BaseEncoder
[hide private]
[frames] | no frames]

Class BaseEncoder

source code


Base AMF encoder.

Instance Methods [hide private]
 
__init__(self, data=None, context=None)
x.__init__(...) initializes x; see x.__class__.__doc__ for signature
source code
callable or None.
_getWriteElementFunc(self, data)
Gets a function used to encode the data.
source code
callable or None.
_writeElementFunc(self, data)
Gets a function used to encode the data.
source code
 
writeElement(self, data)
Writes the data.
source code

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

Instance Variables [hide private]
type or types.ClassType context_class
Holds the class that will create context objects for the implementing Encoder.
list type_map = []
A list of types -> functions.
An instance of BaseEncoder.context_class context
The context for the encoding.
BufferedByteStream stream
The underlying data stream.
Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

__init__(self, data=None, context=None)
(Constructor)

source code 

x.__init__(...) initializes x; see x.__class__.__doc__ for signature

Parameters:
Raises:
  • TypeError - The context parameter must be of type Context.
Overrides: object.__init__

_getWriteElementFunc(self, data)

source code 

Gets a function used to encode the data.

Parameters:
  • data (mixed) - Python data.
Returns: callable or None.
The function used to encode data to the stream.

_writeElementFunc(self, data)

source code 

Gets a function used to encode the data.

Parameters:
  • data (mixed) - Python data.
Returns: callable or None.
The function used to encode data to the stream.

writeElement(self, data)

source code 

Writes the data.

Parameters:
  • data (mixed) - The data to be encoded to the data stream.

Instance Variable Details [hide private]

context_class

Holds the class that will create context objects for the implementing Encoder.
Type:
type or types.ClassType
Value:
pyamf.BaseContext

type_map

A list of types -> functions. The types is a list of possible instances or functions to call (that return a bool) to determine the correct function to call to encode the data.
Type:
list
Value:
[]