ocarina/src/core/bt/slist.py

23 lines
381 B
Python
Raw Normal View History

2010-02-24 19:16:57 -05:00
__author__="bjschuma"
__date__ ="$Feb 22, 2010 10:52:13 PM$"
# This is a sorted list (as long as items are inserted with add() )
class Slist(list):
2010-02-24 19:16:57 -05:00
def __init__(self):
list.__init__(self)
def add(self, item, priority):
self += [(priority,item)]
2010-02-24 19:16:57 -05:00
self.sort()
def remove(self, item):
for tuple in self:
if tuple[1] == item:
list.remove(self,tuple)
break