Changeset 2642


Ignore:
Timestamp:
24/06/07 13:53:34 (12 years ago)
Author:
lawrence
Message:

Helping csml work in python 2.5 (finding celementtree :-)

Location:
TI02-CSML/trunk/csml
Files:
1 added
3 edited

Legend:

Unmodified
Added
Removed
  • TI02-CSML/trunk/csml/API/__init__.py

    r2585 r2642  
    33 
    44#import element tree and the parser api 
    5 from cElementTree import * 
     5try: #python 2.5 
     6    from xml.etree.cElementTree import * 
     7except ImportError: 
     8    try: 
     9        # if you've installed it yourself it comes this way 
     10        from cElementTree import * 
     11    except ImportError: 
     12        # if you've egged it this is the way it comes 
     13        from elementtree.cElementTree import * 
     14 
    615import csml.parser 
    716import ops_Dataset 
  • TI02-CSML/trunk/csml/API/ops_Dataset.py

    r2602 r2642  
    55import csml.parser_extra 
    66import csml.API.existDB 
    7 import cElementTree as ET 
    8  
     7try: #python 2.5 
     8    from xml.etree import cElementTree as ET 
     9except ImportError: 
     10    try: 
     11        # if you've installed it yourself it comes this way 
     12        import cElementTree as ET 
     13    except ImportError: 
     14        # if you've egged it this is the way it comes 
     15        from elementtree import cElementTree as ET 
    916 
    1017def testmethod(self): 
  • TI02-CSML/trunk/csml/parser_extra.py

    r2632 r2642  
    1212try: #python 2.5 
    1313    from xml.etree import ElementTree as etree 
     14    from xml.etree import cElementTree as ET 
    1415except ImportError: 
    1516    try: 
    1617        # if you've installed it yourself it comes this way 
    1718        import ElementTree as etree 
     19        import cElementTree as ET 
    1820    except ImportError: 
    1921        # if you've egged it this is the way it comes 
    2022        from elementtree import ElementTree as etree 
     23        from elementtree import cElementTree as ET 
    2124import string 
    22 import cElementTree as ET 
    2325import codecs 
    2426 
Note: See TracChangeset for help on using the changeset viewer.