From d9ad506f88ffa17a002170c60928892a76fa1216 Mon Sep 17 00:00:00 2001 From: Marco Pesenti Gritti Date: Fri, 12 May 2006 18:43:03 -0400 Subject: [PATCH] Actually register the service. Fix a typo --- sugar/browser/browser.py | 3 +++ sugar/p2p/Model.py | 6 ++++-- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/sugar/browser/browser.py b/sugar/browser/browser.py index 3de0c90d..22007442 100755 --- a/sugar/browser/browser.py +++ b/sugar/browser/browser.py @@ -159,8 +159,11 @@ class NavigationToolbar(gtk.Toolbar): class BrowserActivity(activity.Activity): def __init__(self, group, uri): activity.Activity.__init__(self) + self.uri = uri self._group = group + + self._setup_shared(uri) def _setup_shared(self, uri): self._model = self._group.get_store().get_model(uri) diff --git a/sugar/p2p/Model.py b/sugar/p2p/Model.py index f4bda478..3556d8da 100644 --- a/sugar/p2p/Model.py +++ b/sugar/p2p/Model.py @@ -25,7 +25,8 @@ class ModelRequestHandler(object): return self._model.set_value(key, value) class LocalModel: - def __init__(self, model_id): + def __init__(self, group, model_id): + self._group = group self._model_id = model_id self._values = {} @@ -39,6 +40,7 @@ class LocalModel: service = Service(self._model_id, MODEL_SERVICE_TYPE, '', MODEL_SERVICE_PORT) self._setup_server(service) + service.register(self._group) # FIXME this is duplicated with StreamReader def _setup_server(self, service): @@ -61,7 +63,7 @@ class Store: self._local_models = {} def create_model(self, model_id): - model = LocalModel(model_id) + model = LocalModel(self._group, model_id) self._local_models[model_id] = model return model