import os

from django.conf import settings

# find an etree implementation
try:
    from lxml import etree
except ImportError:
    try:
        # Python 2.5
        import xml.etree.cElementTree as etree
    except ImportError:
        try:
            # Python 2.5
            import xml.etree.ElementTree as etree
        except ImportError:
            try:
                # normal cElementTree install
                import cElementTree as etree
            except ImportError:
                try:
                    # normal ElementTree install
                    import elementtree.ElementTree as etree
                except ImportError:
                    print("Failed to import ElementTree from any known place")


try:
    from django.contrib.staticfiles.finders import find
except ImportError:
    def find(path):
        return os.path.join(settings.MEDIA_ROOT, path)
