Actually register the service. Fix a typo

This commit is contained in:
Marco Pesenti Gritti 2006-05-12 18:43:03 -04:00
parent aba40b2fd9
commit d9ad506f88
2 changed files with 7 additions and 2 deletions

View File

@ -159,9 +159,12 @@ 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)
if self._model:

View File

@ -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