~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/xml_serializer.py

  • Committer: Martin Pool
  • Date: 2006-06-20 07:55:43 UTC
  • mfrom: (1798 +trunk)
  • mto: This revision was merged to the branch mainline in revision 1799.
  • Revision ID: mbp@sourcefrog.net-20060620075543-b10f6575d4a4fa32
[merge] bzr.dev

Show diffs side-by-side

added added

removed removed

Lines of Context:
27
27
try:
28
28
    from cElementTree import (ElementTree, SubElement, Element,
29
29
                              XMLTreeBuilder, fromstring, tostring)
 
30
    import elementtree
30
31
except ImportError:
31
32
    mutter('WARNING: using slower ElementTree; consider installing cElementTree'
32
33
           " and make sure it's on your PYTHONPATH")
33
34
    from util.elementtree.ElementTree import (ElementTree, SubElement,
34
35
                                              Element, XMLTreeBuilder,
35
36
                                              fromstring, tostring)
 
37
    import util.elementtree as elementtree
36
38
 
37
39
from bzrlib.errors import BzrError
38
40
 
73
75
        return ElementTree().parse(f)
74
76
 
75
77
 
76
 
# performance tuning for elementree's serialiser. THis should be
 
78
# performance tuning for elementree's serialiser. This should be
77
79
# sent upstream - RBC 20060523.
78
 
# the functions here are patched into elementree at runtime.
79
 
import elementtree.ElementTree
 
80
# the functions here are patched into elementtree at runtime.
80
81
import re
81
82
escape_re = re.compile("[&'\"<>]")
82
83
escape_map = {