~malept/ubuntu/lucid/python2.6/dev-dependency-fix

« back to all changes in this revision

Viewing changes to Lib/xml/__init__.py

  • Committer: Bazaar Package Importer
  • Author(s): Matthias Klose
  • Date: 2009-02-13 12:51:00 UTC
  • Revision ID: james.westby@ubuntu.com-20090213125100-uufgcb9yeqzujpqw
Tags: upstream-2.6.1
ImportĀ upstreamĀ versionĀ 2.6.1

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
"""Core XML support for Python.
 
2
 
 
3
This package contains four sub-packages:
 
4
 
 
5
dom -- The W3C Document Object Model.  This supports DOM Level 1 +
 
6
       Namespaces.
 
7
 
 
8
parsers -- Python wrappers for XML parsers (currently only supports Expat).
 
9
 
 
10
sax -- The Simple API for XML, developed by XML-Dev, led by David
 
11
       Megginson and ported to Python by Lars Marius Garshol.  This
 
12
       supports the SAX 2 API.
 
13
 
 
14
etree -- The ElementTree XML library.  This is a subset of the full
 
15
       ElementTree XML release.
 
16
 
 
17
"""
 
18
 
 
19
 
 
20
__all__ = ["dom", "parsers", "sax", "etree"]
 
21
 
 
22
# When being checked-out without options, this has the form
 
23
# "<dollar>Revision: x.y </dollar>"
 
24
# When exported using -kv, it is "x.y".
 
25
__version__ = "$Revision: 41660 $".split()[-2:][0]
 
26
 
 
27
 
 
28
_MINIMUM_XMLPLUS_VERSION = (0, 8, 4)
 
29
 
 
30
 
 
31
try:
 
32
    import _xmlplus
 
33
except ImportError:
 
34
    pass
 
35
else:
 
36
    try:
 
37
        v = _xmlplus.version_info
 
38
    except AttributeError:
 
39
        # _xmlplus is too old; ignore it
 
40
        pass
 
41
    else:
 
42
        if v >= _MINIMUM_XMLPLUS_VERSION:
 
43
            import sys
 
44
            _xmlplus.__path__.extend(__path__)
 
45
            sys.modules[__name__] = _xmlplus
 
46
        else:
 
47
            del v