[kernel] r5566 -
people/waldi/linux-2.6/debian/lib/python/debian_linux
Bastian Blank
waldi at costa.debian.org
Sun Jan 22 20:27:36 UTC 2006
Author: waldi
Date: Sun Jan 22 20:27:35 2006
New Revision: 5566
Modified:
people/waldi/linux-2.6/debian/lib/python/debian_linux/utils.py
Log:
debian/lib/python/debian_linux/utils.py: Remove old class.
Modified: people/waldi/linux-2.6/debian/lib/python/debian_linux/utils.py
==============================================================================
--- people/waldi/linux-2.6/debian/lib/python/debian_linux/utils.py (original)
+++ people/waldi/linux-2.6/debian/lib/python/debian_linux/utils.py Sun Jan 22 20:27:35 2006
@@ -1,10 +1,10 @@
import debian, re, textwrap
-class _sorted_dict(dict):
- __slots__ = ('_list')
+class sorted_dict(dict):
+ __slots__ = '_list',
def __init__(self, entries = None):
- super(_sorted_dict, self).__init__()
+ super(sorted_dict, self).__init__()
self._list = []
if entries is not None:
for key, value in entries:
@@ -14,6 +14,11 @@
super(_sorted_dict, self).__delitem__(key)
self._list.remove(key)
+ def __setitem__(self, key, value):
+ super(sorted_dict, self).__setitem__(key, value)
+ if key not in self._list:
+ self._list.append(key)
+
def iterkeys(self):
for i in iter(self._list):
yield i
@@ -26,14 +31,6 @@
for i in iter(self._list):
yield self[i]
-class sorted_dict(_sorted_dict):
- __slots__ = ()
-
- def __setitem__(self, key, value):
- super(sorted_dict, self).__setitem__(key, value)
- if key not in self._list:
- self._list.append(key)
-
class field_list(list):
TYPE_WHITESPACE = object()
TYPE_COMMATA = object()
More information about the Kernel-svn-changes
mailing list