ocarina/src/core/ct/slist.py

23 lines
381 B
Python
Raw Normal View History

2010-03-14 21:29:38 -04: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):
def __init__(self):
list.__init__(self)
def add(self, item, priority):
self += [(priority,item)]
self.sort()
def remove(self, item):
for tuple in self:
if tuple[1] == item:
list.remove(self,tuple)
break