Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/sugar/p2p/model/AbstractModel.py
blob: a5fbe493a61c40b274e5fddfc279083538efbab3 (plain)
1
2
3
4
5
6
7
8
9
10
class AbstractModel:
	def __init__(self):
		self._listeners = []
	
	def add_listener(self, listener):
		self._listeners.append(listener)
	
	def _notify_model_change(self, key):
		for listener in self._listeners:
			listener(self, key)