diff options
author | Dan Winship <dwinship@redhat.com> | 2007-09-20 16:20:21 (GMT) |
---|---|---|
committer | Dan Winship <dwinship@redhat.com> | 2007-09-20 16:20:21 (GMT) |
commit | f377d6e5197f07b82c3ccd29e2899e02f03b3d8e (patch) | |
tree | e97ccb375edad622576dc083c529556d4b2a3be3 /sugar/datastore/datastore.py | |
parent | 99ce1835e4d8cb176ebdf12572a8e193b1dd1e88 (diff) |
Redo activity bundles in terms of sugar.bundle.bundle
Diffstat (limited to 'sugar/datastore/datastore.py')
-rw-r--r-- | sugar/datastore/datastore.py | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/sugar/datastore/datastore.py b/sugar/datastore/datastore.py index 48a3e52..0c2379d 100644 --- a/sugar/datastore/datastore.py +++ b/sugar/datastore/datastore.py @@ -24,9 +24,10 @@ import gobject from sugar.datastore import dbus_helpers from sugar import activity -from sugar.activity.bundle import Bundle from sugar.activity.activityhandle import ActivityHandle from sugar.bundle.contentbundle import ContentBundle +from sugar.bundle.activitybundle import ActivityBundle +from sugar.bundle.contentbundle import ContentBundle from sugar.objects import mime class DSMetadata(gobject.GObject): @@ -121,22 +122,24 @@ class DSObject(object): return activities + def is_activity_bundle(self): + return self.metadata['mime_type'] in \ + [ActivityBundle.MIME_TYPE, ActivityBundle.DEPRECATED_MIME_TYPE] + def is_content_bundle(self): return self.metadata['mime_type'] == ContentBundle.MIME_TYPE - # FIXME: should become is_activity_bundle() def is_bundle(self): - return self.metadata['mime_type'] in ['application/vnd.olpc-x-sugar', - 'application/vnd.olpc-sugar'] + return self.is_activity_bundle() or self.is_content_bundle() def resume(self, service_name=None): from sugar.activity import activityfactory - if self.is_bundle(): + if self.is_activity_bundle(): if service_name is not None: raise ValueError('Object is a bundle, cannot be resumed as an activity.') - bundle = Bundle(self.file_path) + bundle = ActivityBundle(self.file_path) if not bundle.is_installed(): bundle.install() |