From bfe8fac5bf0982d4602b2e76e2e9eb07fd20c6ae Mon Sep 17 00:00:00 2001 From: Robey Pointer Date: Wed, 16 Aug 2006 14:31:06 -0700 Subject: [PATCH] [project @ robey@lag.net-20060816213106-99cffe9de5d555c5] don't need odict anymore --- paramiko/hostkeys.py | 1 - paramiko/odict.py | 63 -------------------------------------------- 2 files changed, 64 deletions(-) delete mode 100644 paramiko/odict.py diff --git a/paramiko/hostkeys.py b/paramiko/hostkeys.py index bf5f442..c8450b9 100644 --- a/paramiko/hostkeys.py +++ b/paramiko/hostkeys.py @@ -26,7 +26,6 @@ import UserDict from paramiko.common import * from paramiko.dsskey import DSSKey -from paramiko.odict import odict from paramiko.rsakey import RSAKey diff --git a/paramiko/odict.py b/paramiko/odict.py deleted file mode 100644 index 103e52f..0000000 --- a/paramiko/odict.py +++ /dev/null @@ -1,63 +0,0 @@ -# -# This file and source code are in the public domain. -# - -class odict (dict): - """ - A dictionary with ordered keys. Based on the cookbook recipe at: - http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/107747 - """ - - def __init__(self, *larg, **kwarg): - self._keys = [] - dict.__init__(self, *larg, **kwarg) - - def __delitem__(self, key): - dict.__delitem__(self, key) - self._keys.remove(key) - - def __setitem__(self, key, item): - dict.__setitem__(self, key, item) - if key not in self._keys: - self._keys.append(key) - - def clear(self): - dict.clear(self) - self._keys = [] - - def copy(self): - od = odict(self) - return od - - def items(self): - return zip(self._keys, self.values()) - - def iteritems(self): - for k in self._keys: - yield k, self[k] - - def keys(self): - return self._keys[:] - - def popitem(self): - try: - key = self._keys[-1] - except IndexError: - raise KeyError('dictionary is empty') - - val = self[key] - del self[key] - - return (key, val) - - def setdefault(self, key, failobj=None): - if key not in self._keys: - self._keys.append(key) - dict.setdefault(self, key, failobj) - - def update(self, d): - for key, item in d.items(): - self.__setitem__(key, item) - - def values(self): - return map(self.get, self._keys)