diff options
author | Vincent Vinet <vince.vinet@gmail.com> | 2009-10-14 14:47:48 (GMT) |
---|---|---|
committer | Vincent Vinet <vince.vinet@gmail.com> | 2009-10-14 14:47:48 (GMT) |
commit | c170781eec486fda8d2d94a3d2fd671e3604f7dc (patch) | |
tree | d42700fb8807a00583ab8fd3b0c4b079d356b71b | |
parent | 0928acd3d2d845fd6cd28cd848652aedecae0bdb (diff) |
find the bundle_id used in TProbe to connect to the active activity in the enginelp429661
-rw-r--r-- | tutorius/engine.py | 13 |
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 |