More service_name -> bundle_id renaming

This commit is contained in:
Marco Pesenti Gritti 2007-10-09 17:03:00 +02:00
parent 7c59d10a06
commit b03cf6c5e8

View File

@ -144,11 +144,11 @@ class DSObject(object):
def is_bundle(self): def is_bundle(self):
return self.is_activity_bundle() or self.is_content_bundle() return self.is_activity_bundle() or self.is_content_bundle()
def resume(self, service_name=None): def resume(self, bundle_id=None):
from sugar.activity import activityfactory from sugar.activity import activityfactory
if self.is_activity_bundle(): if self.is_activity_bundle():
if service_name is not None: if bundle_id is not None:
raise ValueError('Object is a bundle, cannot be resumed as an activity.') raise ValueError('Object is a bundle, cannot be resumed as an activity.')
bundle = ActivityBundle(self.file_path) bundle = ActivityBundle(self.file_path)
@ -157,11 +157,11 @@ class DSObject(object):
activityfactory.create(bundle.get_bundle_id()) activityfactory.create(bundle.get_bundle_id())
else: else:
if not self.get_activities() and service_name is None: if not self.get_activities() and bundle_id is None:
logging.warning('No activity can open this object.') logging.warning('No activity can open this object.')
return return
if service_name is None: if bundle_id is None:
service_name = self.get_activities()[0].service_name bundle_id = self.get_activities()[0].bundle_id
activity_id = self.metadata['activity_id'] activity_id = self.metadata['activity_id']
object_id = self.object_id object_id = self.object_id
@ -169,9 +169,9 @@ class DSObject(object):
if activity_id: if activity_id:
handle = ActivityHandle(object_id=object_id, handle = ActivityHandle(object_id=object_id,
activity_id=activity_id) activity_id=activity_id)
activityfactory.create(service_name, handle) activityfactory.create(bundle_id, handle)
else: else:
activityfactory.create_with_object_id(service_name, object_id) activityfactory.create_with_object_id(bundle_id, object_id)
def destroy(self): def destroy(self):
if self._destroyed: if self._destroyed: