From acf29ef25e52a18470084f5afa4bb97b8a57885f Mon Sep 17 00:00:00 2001 From: Marco Pesenti Gritti Date: Mon, 15 May 2006 14:33:02 -0400 Subject: [PATCH] Forgot to add this --- sugar/p2p/model/AbstractModel.py | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100644 sugar/p2p/model/AbstractModel.py diff --git a/sugar/p2p/model/AbstractModel.py b/sugar/p2p/model/AbstractModel.py new file mode 100644 index 00000000..a5fbe493 --- /dev/null +++ b/sugar/p2p/model/AbstractModel.py @@ -0,0 +1,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)