]>
Commit | Line | Data |
---|---|---|
be05b434 RD |
1 | class AbstractModel(object): |
2 | ||
3 | def __init__(self): | |
4 | self.listeners = [] | |
5 | ||
6 | def addListener(self, listenerFunc): | |
7 | self.listeners.append(listenerFunc) | |
8 | ||
9 | def removeListener(self, listenerFunc): | |
10 | self.listeners.remove(listenerFunc) | |
11 | ||
12 | def update(self): | |
13 | for eachFunc in self.listeners: | |
14 | eachFunc(self) | |
15 |