Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--tutorius/engine.py13
1 files changed, 5 insertions, 8 deletions
diff --git a/tutorius/engine.py b/tutorius/engine.py
index f695de6..dda9f3f 100644
--- a/tutorius/engine.py
+++ b/tutorius/engine.py
@@ -3,6 +3,7 @@ import dbus.mainloop.glib
from jarabe.model import shell
from sugar.tutorius.bundler import TutorialStore
+from sugar.bundle.activitybundle import ActivityBundle
class Engine:
"""
@@ -16,7 +17,6 @@ class Engine:
self._shell = shell.get_model()
self._tutorial = None
-
def launch(self, tutorialID):
""" Launch a tutorial
@param tutorialID unique tutorial identifier used to retrieve it from the disk
@@ -27,16 +27,13 @@ class Engine:
store = TutorialStore()
- #FIXME Cleanup the handling of 'aliases'
+ #Get the active activity from the shell
activity = self._shell.get_active_activity()
self._tutorial = store.load_tutorial(tutorialID, bundle_path=activity.get_bundle_path())
- self._tutorial.attach("org.laptop.Calculate")
-# if activity in self._activities:
-# self._tutorial.attach(self._activities[activity])
-# else:
-# raise RuntimeError("Current activity alias unknown")
-
+ #TProbes automatically use the bundle id, available from the ActivityBundle
+ bundle = ActivityBundle(activity.get_bundle_path())
+ self._tutorial.attach(bundle.get_bundle_id())
def stop(self):
""" Stop the current tutorial