Back to index

python3.2  3.2.2
Public Member Functions | Public Attributes | Static Public Attributes | Private Attributes
test.test_xml_etree.CleanContext Class Reference
Inheritance diagram for test.test_xml_etree.CleanContext:
Inheritance graph
[legend]
Collaboration diagram for test.test_xml_etree.CleanContext:
Collaboration graph
[legend]

List of all members.

Public Member Functions

def __init__
def __enter__
def __exit__

Public Attributes

_PyObject_HEAD_EXTRA Py_ssize_t ob_refcnt
struct _typeobjectob_type

Static Public Attributes

 checkwarnings = None

Private Attributes

 _nsmap
 _path_cache

Detailed Description

Provide default namespace mapping and path cache.

Definition at line 1856 of file test_xml_etree.py.


Constructor & Destructor Documentation

def test.test_xml_etree.CleanContext.__init__ (   self,
  quiet = False 
)

Definition at line 1860 of file test_xml_etree.py.

01860 
01861     def __init__(self, quiet=False):
01862         if sys.flags.optimize >= 2:
01863             # under -OO, doctests cannot be run and therefore not all warnings
01864             # will be emitted
01865             quiet = True
01866         deprecations = (
01867             # Search behaviour is broken if search path starts with "/".
01868             ("This search is broken in 1.3 and earlier, and will be fixed "
01869              "in a future version.  If you rely on the current behaviour, "
01870              "change it to '.+'", FutureWarning),
01871             # Element.getchildren() and Element.getiterator() are deprecated.
01872             ("This method will be removed in future versions.  "
01873              "Use .+ instead.", DeprecationWarning),
01874             ("This method will be removed in future versions.  "
01875              "Use .+ instead.", PendingDeprecationWarning),
01876             # XMLParser.doctype() is deprecated.
01877             ("This method of XMLParser is deprecated.  Define doctype.. "
01878              "method on the TreeBuilder target.", DeprecationWarning))
01879         self.checkwarnings = support.check_warnings(*deprecations, quiet=quiet)

Here is the caller graph for this function:


Member Function Documentation

Definition at line 1880 of file test_xml_etree.py.

01880 
01881     def __enter__(self):
01882         from xml.etree import ElementTree
01883         self._nsmap = ElementTree._namespace_map
01884         self._path_cache = ElementTree.ElementPath._cache
01885         # Copy the default namespace mapping
01886         ElementTree._namespace_map = self._nsmap.copy()
01887         # Copy the path cache (should be empty)
01888         ElementTree.ElementPath._cache = self._path_cache.copy()
01889         self.checkwarnings.__enter__()

def test.test_xml_etree.CleanContext.__exit__ (   self,
  args 
)

Definition at line 1890 of file test_xml_etree.py.

01890 
01891     def __exit__(self, *args):
01892         from xml.etree import ElementTree
01893         # Restore mapping and path cache
01894         ElementTree._namespace_map = self._nsmap
01895         ElementTree.ElementPath._cache = self._path_cache
01896         self.checkwarnings.__exit__(*args)
01897 


Member Data Documentation

Definition at line 1882 of file test_xml_etree.py.

Definition at line 1883 of file test_xml_etree.py.

Definition at line 1858 of file test_xml_etree.py.

Definition at line 107 of file object.h.

struct _typeobject* _object::ob_type [inherited]

Definition at line 108 of file object.h.


The documentation for this class was generated from the following file: