Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/tutorius/TProbe.py
diff options
context:
space:
mode:
Diffstat (limited to 'tutorius/TProbe.py')
-rw-r--r--tutorius/TProbe.py18
1 files changed, 11 insertions, 7 deletions
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)