From 02d3799b54c55d7803bc933fab44cb2fde38323e Mon Sep 17 00:00:00 2001 From: Daniel Drake Date: Wed, 16 Jul 2008 16:48:31 +0000 Subject: #7532 install + open content bundles through journal --- (limited to 'src/sugar/datastore/datastore.py') diff --git a/src/sugar/datastore/datastore.py b/src/sugar/datastore/datastore.py index b7792f4..b88a877 100644 --- a/src/sugar/datastore/datastore.py +++ b/src/sugar/datastore/datastore.py @@ -169,6 +169,24 @@ class DSObject(object): logging.debug('activityfactory.creating bundle with id %r', bundle.get_bundle_id()) activityfactory.create(bundle.get_bundle_id()) + + elif self.is_content_bundle() and not bundle_id: + + logging.debug('Creating content bundle') + bundle = ContentBundle(self.file_path) + if not bundle.is_installed(): + logging.debug('Installing content bundle') + bundle.install() + + activities = self._get_activities_for_mime('text/html') + if len(activities) == 0: + logging.warning('No activity can open HTML content bundles') + return + + uri = bundle.get_start_uri() + logging.debug('activityfactory.creating with uri %s', uri) + activityfactory.create_with_uri(activities[0].bundle_id, + bundle.get_start_uri()) else: if not self.get_activities() and bundle_id is None: logging.warning('No activity can open this object, %s.' % -- cgit v0.9.1