diff options
author | Marco Pesenti Gritti <mpg@redhat.com> | 2007-02-21 23:57:49 (GMT) |
---|---|---|
committer | Marco Pesenti Gritti <mpg@redhat.com> | 2007-02-21 23:57:49 (GMT) |
commit | 0b6b6cd6acfedd3bfc326623ad0ccff21c5c4d5e (patch) | |
tree | cf895acdce9d1aa3ff11f875c361719a00d39ea4 /sugar/activity/activityfactory.py | |
parent | 0d7bdeb20a6a807852a92aa5e854d1f5bfa9d82f (diff) |
Cleanup the Activity API, code needs more love.
Diffstat (limited to 'sugar/activity/activityfactory.py')
-rw-r--r-- | sugar/activity/activityfactory.py | 15 |
1 files changed, 6 insertions, 9 deletions
diff --git a/sugar/activity/activityfactory.py b/sugar/activity/activityfactory.py index 6148466..90b49f7 100644 --- a/sugar/activity/activityfactory.py +++ b/sugar/activity/activityfactory.py @@ -36,14 +36,13 @@ class ActivityCreationHandler(gobject.GObject): 'error': (gobject.SIGNAL_RUN_FIRST, gobject.TYPE_NONE, ([gobject.TYPE_PYOBJECT])), - 'success': (gobject.SIGNAL_RUN_FIRST, - gobject.TYPE_NONE, - ([gobject.TYPE_PYOBJECT])) } def __init__(self, service_name, activity_handle): gobject.GObject.__init__(self) + self._service_name = service_name + if activity_handle: self._activity_handle = activity_handle else: @@ -91,14 +90,12 @@ class ActivityCreationHandler(gobject.GObject): return act_id def _reply_handler(self, xid): - bus = dbus.SessionBus() - proxy_obj = bus.get_object(_ACTIVITY_SERVICE_NAME + '%d' % xid, - _ACTIVITY_SERVICE_PATH + "/%s" % xid) - activity = dbus.Interface(proxy_obj, _ACTIVITY_INTERFACE) - self.emit('success', activity) + logging.debug("Activity created %s (%s)." % + (self._activity_handle.activity_id, self._service_name)) def _error_handler(self, err): - logging.debug("Couldn't create activity: %s" % err) + logging.debug("Couldn't create activity %s (%s): %s" % + (self._activity_handle.activity_id, self._service_name, err)) self.emit('error', err) def create(service_name, activity_handle=None): |