From d35c19b6aaeb79df700bf063f4bf3d298c20bf7a Mon Sep 17 00:00:00 2001 From: Reinier Heeres Date: Tue, 18 Dec 2007 12:43:34 +0000 Subject: Allow activity up- and downgrades #4906, also fix #5382 --- (limited to 'lib/sugar/datastore/datastore.py') diff --git a/lib/sugar/datastore/datastore.py b/lib/sugar/datastore/datastore.py index 5238d18..334c866 100644 --- a/lib/sugar/datastore/datastore.py +++ b/lib/sugar/datastore/datastore.py @@ -160,10 +160,16 @@ class DSObject(object): if bundle_id is not None: raise ValueError('Object is a bundle, cannot be resumed as an activity.') + logging.debug('Creating activity bundle') bundle = ActivityBundle(self.file_path) if not bundle.is_installed(): + logging.debug('Installing activity bundle') bundle.install() + elif bundle.need_upgrade(): + logging.debug('Upgrading activity bundle') + bundle.upgrade() + logging.debug('activityfactory.creating bundle with id %r', bundle.get_bundle_id()) activityfactory.create(bundle.get_bundle_id()) else: if not self.get_activities() and bundle_id is None: -- cgit v0.9.1