Try to import Python's OrderedDict

There is an OrderedDict in Python 2.7+.
The try order is now as follows:
* OrderedDict from Python's collections module
* OrderedDict from the jsonencode module (dependency)
* OrderedDict from the ordereddict module (pypi package)
* our own OrderedDict
This commit is contained in:
Laurent Bachelier 2011-04-23 23:44:45 +02:00
commit 5ac2de43d7

View file

@ -18,9 +18,15 @@
# along with weboob. If not, see <http://www.gnu.org/licenses/>. # along with weboob. If not, see <http://www.gnu.org/licenses/>.
try:
from collections import OrderedDict
except ImportError:
try:
from simplejson import OrderedDict
except ImportError:
try: try:
from ordereddict import OrderedDict from ordereddict import OrderedDict
except: except ImportError:
## {{{ http://code.activestate.com/recipes/576693/ (r6) ## {{{ http://code.activestate.com/recipes/576693/ (r6)
from UserDict import DictMixin from UserDict import DictMixin