Package pyamf :: Module amf3 :: Class Context
[hide private]
[frames] | no frames]

Class Context

source code


I hold the AMF3 context for en/decoding streams.

Instance Methods [hide private]
 
__init__(self)
x.__init__(...) initializes x; see help(type(x)) for signature
source code
 
clear(self)
Clears the context.
source code
str or None
getString(self, ref)
Gets a string based on a reference ref.
source code
int or None
getStringReference(self, s)
Return string reference.
source code
int
addString(self, s)
Creates a reference to s.
source code
 
getClassByReference(self, ref)
Return class reference.
source code
 
getClass(self, klass)
Return class reference.
source code
 
addClass(self, alias, klass)
Creates a reference to class_def.
source code
 
getObjectForProxy(self, proxy)
Returns the unproxied version of proxy as stored in the context, or unproxies the proxy and returns that 'raw' object.
source code
 
addProxyObject(self, obj, proxied)
Stores a reference to the unproxied and proxied versions of obj for later retrieval.
source code
 
getProxyForObject(self, obj)
Returns the proxied version of obj as stored in the context, or creates a new proxied object and returns that.
source code

Inherited from codec.Context: addObject, getBytesForString, getClassAlias, getObject, getObjectReference, getStringForBytes

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

Instance Variables [hide private]
list classes
A list of ClassDefinition.
list strings
A list of string references.

Inherited from codec.Context: extra

Inherited from codec.Context (private): _class_aliases, _objects, _unicodes

Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

__init__(self)
(Constructor)

source code 

x.__init__(...) initializes x; see help(type(x)) for signature

Overrides: object.__init__
(inherited documentation)

clear(self)

source code 

Clears the context.

Overrides: codec.Context.clear

getString(self, ref)

source code 

Gets a string based on a reference ref.

Parameters:
  • ref (str) - The reference index.
Returns: str or None
The referenced string.

getStringReference(self, s)

source code 

Return string reference.

Parameters:
  • s (str) - The referenced string.
Returns: int or None
The reference index to the string.

addString(self, s)

source code 

Creates a reference to s. If the reference already exists, that reference is returned.

Parameters:
  • s (str) - The string to be referenced.
Returns: int
The reference index.
Raises:
  • TypeError - The parameter s is not of basestring type.

getClassByReference(self, ref)

source code 

Return class reference.

Returns:
Class reference.

getClass(self, klass)

source code 

Return class reference.

Returns:
Class reference.

addClass(self, alias, klass)

source code 

Creates a reference to class_def.

Parameters:
  • alias - ClassDefinition instance.

getObjectForProxy(self, proxy)

source code 

Returns the unproxied version of proxy as stored in the context, or unproxies the proxy and returns that 'raw' object.

See Also: pyamf.flex.unproxy_object

Since: 0.6

addProxyObject(self, obj, proxied)

source code 

Stores a reference to the unproxied and proxied versions of obj for later retrieval.

Since: 0.6

getProxyForObject(self, obj)

source code 

Returns the proxied version of obj as stored in the context, or creates a new proxied object and returns that.

See Also: pyamf.flex.proxy_object

Since: 0.6