--- /dev/null
+# -*- coding: utf-8 -*-
+#
+# Copyright (C) 2007-2011 Edgewall Software
+# All rights reserved.
+#
+# This software is licensed as described in the file COPYING, which
+# you should have received as part of this distribution. The terms
+# are also available at http://babel.edgewall.org/wiki/License.
+#
+# This software consists of voluntary contributions made by many
+# individuals. For the exact contribution history, see the revision
+# history and logs, available at http://babel.edgewall.org/log/.
+
+try:
+ from xml.etree import ElementTree
+except ImportError:
+ from elementtree import ElementTree
+
+try:
+ any = any
+except NameError:
+ def any(iterable):
+ return filter(None, list(iterable))
+
+try:
+ import threading
+except ImportError:
+ import dummy_threading as threading
+
import os
import cPickle as pickle
-try:
- import threading
-except ImportError:
- import dummy_threading as threading
from UserDict import DictMixin
+from babel.compat import threading
+
__all__ = ['exists', 'locale_identifiers', 'load']
__docformat__ = 'restructuredtext en'
import os
import re
import sys
-try:
- from xml.etree.ElementTree import parse
-except ImportError:
- from elementtree.ElementTree import parse
# Make sure we're using Babel source, and not some previously installed version
sys.path.insert(0, os.path.join(os.path.dirname(sys.argv[0]), '..'))
from babel import dates, numbers
+from babel.compat import any, ElementTree
from babel.plural import PluralRule
from babel.localedata import Alias
+parse = ElementTree.parse
weekdays = {'mon': 0, 'tue': 1, 'wed': 2, 'thu': 3, 'fri': 4, 'sat': 5,
'sun': 6}
-try:
- any
-except NameError:
- def any(iterable):
- return filter(None, list(iterable))
-
def _text(elem):
buf = [elem.text or '']