From c170781eec486fda8d2d94a3d2fd671e3604f7dc Mon Sep 17 00:00:00 2001 From: Vincent Vinet Date: Wed, 14 Oct 2009 14:47:48 +0000 Subject: find the bundle_id used in TProbe to connect to the active activity in the engine --- 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 -- cgit v0.9.1