From 32f97b48c31f60f306854753a3df734f63b798fc Mon Sep 17 00:00:00 2001 From: Gonzalo Odiard Date: Wed, 30 Oct 2013 10:36:33 -0300 Subject: [PATCH] Workaround to enable start of activities still using service_name While we deprecated service_name a long time ago, still there are activities using it, and is a source of frequent problems. Signed-off-by: Gonzalo Odiard --- src/sugar3/bundle/activitybundle.py | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/src/sugar3/bundle/activitybundle.py b/src/sugar3/bundle/activitybundle.py index 1443cd98..ce8d006b 100644 --- a/src/sugar3/bundle/activitybundle.py +++ b/src/sugar3/bundle/activitybundle.py @@ -128,9 +128,15 @@ class ActivityBundle(Bundle): if cp.has_option(section, 'bundle_id'): self._bundle_id = cp.get(section, 'bundle_id') else: - raise MalformedBundleException( - 'Activity bundle %s does not specify a bundle id' % - self._path) + if cp.has_option(section, 'service_name'): + self._bundle_id = cp.get(section, 'service_name') + logging.error('ATTENTION: service_name property in the ' + 'activity.info file is deprecated, should be ' + ' changed to bundle_id') + else: + raise MalformedBundleException( + 'Activity bundle %s does not specify a bundle id' % + self._path) if cp.has_option(section, 'name'): self._name = cp.get(section, 'name')