From 9a44da4488a0ff00150eb5cb114f74ba560b96a6 Mon Sep 17 00:00:00 2001 From: mike Date: Fri, 04 Dec 2009 05:58:29 +0000 Subject: Creator, Remote : Dual code review power! --- (limited to 'tutorius/TProbe.py') diff --git a/tutorius/TProbe.py b/tutorius/TProbe.py index c0eedee..e2fe556 100644 --- a/tutorius/TProbe.py +++ b/tutorius/TProbe.py @@ -25,11 +25,14 @@ import cPickle as pickle from functools import partial +from jarabe.model.shell import get_model +from sugar.bundle.activitybundle import ActivityBundle + from . import addon from . import properties from .services import ObjectStore -from .dbustools import remote_call, save_args, ignore, logError +from .dbustools import save_args, ignore, logError import copy """ @@ -510,7 +513,6 @@ class ProbeProxy: """ Unregister an event listener @param address identifier given by subscribe() - @param block Force a synchroneous dbus call if True @return None """ LOGGER.debug("ProbeProxy :: Unregister adress %s issued", str(address)) @@ -522,7 +524,7 @@ class ProbeProxy: else: LOGGER.debug("ProbeProxy :: unsubscribe address %s failed : not registered", address) - def detach(self, block=False): + def detach(self): """ Detach the ProbeProxy from it's TProbe. All installed actions and subscribed events should be removed. @@ -544,8 +546,6 @@ class ProbeManager(object): """ _LOGGER = logging.getLogger("sugar.tutorius.ProbeManager") - default_instance = None - def __init__(self, proxy_class=ProbeProxy): """Constructor @param proxy_class Class to use for creating Proxies to activities. @@ -560,14 +560,18 @@ class ProbeManager(object): ProbeManager._LOGGER.debug("__init__()") - ProbeManager.default_instance = self - def setCurrentActivity(self, activity_id): if not activity_id in self._probes: raise RuntimeError("Activity not attached, id : %s"%activity_id) self._current_activity = activity_id def getCurrentActivity(self): + # TODO : Insert the correct call to remember the current activity, + # taking the views and frame into account + current_act = get_model().get_active_activity() + current_act_bundle = ActivityBundle(current_act.get_bundle_path()) + current_act_id = current_act_bundle.get_bundle_id() + self._current_activity = current_act_id return self._current_activity currentActivity = property(fget=getCurrentActivity, fset=setCurrentActivity) -- cgit v0.9.1