Package pyamf :: Module xml
[hide private]
[frames] | no frames]

Module xml

source code

Provides XML support.


Since: 0.6

Functions [hide private]
 
set_default_interface(etree)
Sets the default interface that PyAMF will use to deal with XML entities (both objects and blobs).
source code
 
find_libs()
Run through ETREE_MODULES and find ElementTree implementations so that any type can be encoded.
source code
 
is_xml(obj)
Determines obj is a valid XML type.
source code
 
_get_type(e)
Returns the type associated with handling XML objects from this etree interface.
source code
 
_get_etree_type(etree)
Returns the type associated with handling XML objects from this etree interface.
source code
 
_no_et() source code
 
_bootstrap() source code
 
tostring(element, *args, **kwargs)
Helper func to provide easy access to the (possibly) moving target that is ET.
source code
 
fromstring(*args, **kwargs)
Helper func to provide easy access to the (possibly) moving target that is ET.
source code
Variables [hide private]
  ETREE_MODULES = ['lxml.etree', 'xml.etree.cElementTree', 'cEle...
  types = None
hash(x)
  modules = {}
  ET = None
hash(x)
  __package__ = None
hash(x)
Function Details [hide private]

find_libs()

source code 

Run through ETREE_MODULES and find ElementTree implementations so that any type can be encoded.

We work through the C implementations first, then the pure Python versions. The downside to this is that all libraries will be imported but only one is ever used. The libs are small (relatively) and the flexibility that this gives seems to outweigh the cost. Time will tell.

is_xml(obj)

source code 

Determines obj is a valid XML type.

If types is not populated then find_libs be called.


Variables Details [hide private]

ETREE_MODULES

Value:
['lxml.etree',
 'xml.etree.cElementTree',
 'cElementTree',
 'xml.etree.ElementTree',
 'elementtree.ElementTree']