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]
 
clear(self)
Resets the context.
source code
str
getString(self, ref)
Gets a string based on a reference ref.
source code
int
getStringReference(self, s)
Return string reference.
source code
int
addString(self, s)
Creates a reference to s.
source code
 
getClassDefinition(self, ref)
Return class reference.
source code
int
getClassDefinitionReference(self, class_def)
Return class definition reference.
source code
 
addClassDefinition(self, class_def)
Creates a reference to class_def.
source code
 
removeClassDefinition(self, class_def) source code
 
getLegacyXML(self, ref)
Return the legacy XML reference.
source code
int
getLegacyXMLReference(self, doc)
Return legacy XML reference.
source code
int
addLegacyXML(self, doc)
Creates a reference to doc.
source code
 
__copy__(self) source code

Inherited from BaseContext: __init__, addObject, getClassAlias, getObject, getObjectReference

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

Instance Variables [hide private]
list classes
A list of ClassDefinition.
list legacy_xml
A list of legacy encoded XML documents.
list strings
A list of string references.
Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

clear(self)

source code 

Resets the context.

Overrides: BaseContext.clear

getString(self, ref)

source code 

Gets a string based on a reference ref.

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

getStringReference(self, s)

source code 

Return string reference.

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

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:
  • ValueError - Trying to store a reference to an empty string.

getClassDefinition(self, ref)

source code 

Return class reference.

Returns:
Class reference.
Raises:

getClassDefinitionReference(self, class_def)

source code 

Return class definition reference.

Parameters:
  • class_def (ClassDefinition or instance or class) - The class definition reference to be found.
Returns: int
The reference to class_def.
Raises:

getLegacyXML(self, ref)

source code 

Return the legacy XML reference. This is the flash.xml.XMLDocument class in ActionScript 3.0 and the top-level XML class in ActionScript 1.0 and 2.0.

Parameters:
  • ref (int) - The reference index.
Returns:
Instance of ET
Raises:

getLegacyXMLReference(self, doc)

source code 

Return legacy XML reference.

Parameters:
  • doc (ET) - The XML document to reference.
Returns: int
The reference to doc.
Raises:

addLegacyXML(self, doc)

source code 

Creates a reference to doc.

If doc is already referenced that index will be returned. Otherwise a new index will be created.

Parameters:
  • doc (ET) - The XML document to reference.
Returns: int
The reference to doc.

__copy__(self)

source code 
Overrides: BaseContext.__copy__