""" Copyright(C) 2007 INL Written by Damien Boucard <damien.boucard AT inl.fr> This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 3 of the License. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, see <http://www.gnu.org/licenses/>. """ etree = None try: from lxml import etree except ImportError: pass if not etree: try: # Python 2.5 ElementTree from xml.etree import ElementTree as etree except ImportError, err: pass if not etree: try: # Python 2.4 cElementTree import cElementTree as etree except ImportError: pass if not etree: try: # Python 2.4 ElementTree from elementtree import ElementTree as etree except ImportError: pass if not etree: raise ImportError("Cannot import an elementtree-compliant xml "+ "library. Please install one of those "+ "libraries (by order of recommendation) : "+ "(1) lxml, (2) cElementTree or (3) ElementTree")