From a1e4d136f860b03abcafc7bf2e2d65b412bc13cd Mon Sep 17 00:00:00 2001 From: JCTutorius Date: Sun, 27 Dec 2009 19:32:14 +0000 Subject: Merge branch 'master' of gitorious@git.sugarlabs.org:tutorius/mainline --- (limited to 'tutorius/engine.py') diff --git a/tutorius/engine.py b/tutorius/engine.py index 39cfeeb..95aefe7 100644 --- a/tutorius/engine.py +++ b/tutorius/engine.py @@ -108,7 +108,7 @@ class TutorialRunner(object): # Verify if we just completed the subscription of all the events for this state self._verify_event_install_state() - def subscribe_error(self, event_name, exception): + def subscribe_error(self, event_name, event, exception): # TODO : Do correct error handling here LOGGER.debug("TutorialRunner :: Could not subscribe to event %s, got exception : %s"%(event_name, str(exception))) self._subscription_errors[event_name] = exception @@ -309,6 +309,10 @@ class Engine: """ Launch a tutorial @param tutorialID unique tutorial identifier used to retrieve it from the disk """ + + if self._probeManager.is_activity_launching: + return + if self._tutorial: self.stop() @@ -317,10 +321,15 @@ class Engine: #Get the active activity from the shell activity = self._shell.get_active_activity() - #TProbes automatically use the bundle id, available from the ActivityBundle - bundle = ActivityBundle(activity.get_bundle_path()) - self._tutorial._activity_id = bundle.get_bundle_id() #HACK until we have activity id's in action/events + LOGGER.debug("Engine :: Launching tutorial on activity %s", activity.get_type()) + if hasattr(activity, 'is_journal') and activity.is_journal(): + self._tutorial._activity_id = 'org.laptop.JournalActivity' + else: + #TProbes automatically use the bundle id, available from the ActivityBundle + bundle = ActivityBundle(activity.get_bundle_path()) + + self._tutorial._activity_id = bundle.get_bundle_id() #HACK until we have activity id's in action/events self._tutorial.start() -- cgit v0.9.1