Add some debug output when sharing activities

This commit is contained in:
Dan Williams 2007-04-13 16:00:22 -04:00
parent cc2d69e364
commit 17adb7b58b

View File

@ -233,18 +233,22 @@ class Activity(DBusGObject):
self._tp.disconnect(sigid) self._tp.disconnect(sigid)
if exc: if exc:
logging.debug("Share of activity %s failed: %s" % (self._id, exc))
async_err_cb(exc) async_err_cb(exc)
else: else:
self._handle_share_join(tp, text_channel) self._handle_share_join(tp, text_channel)
self.send_properties() self.send_properties()
async_cb(dbus.ObjectPath(self._object_path)) async_cb(dbus.ObjectPath(self._object_path))
logging.debug("Share of activity %s succeeded." % self._id)
def _share(self, (async_cb, async_err_cb)): def _share(self, (async_cb, async_err_cb)):
logging.debug("Starting share of activity %s" % self._id)
if self._joined: if self._joined:
async_err_cb(RuntimeError("Already shared activity %s" % self.props.id)) async_err_cb(RuntimeError("Already shared activity %s" % self.props.id))
return return
sigid = self._tp.connect('activity-shared', self._shared_cb) sigid = self._tp.connect('activity-shared', self._shared_cb)
self._tp.share_activity(self.props.id, (sigid, async_cb, async_err_cb)) self._tp.share_activity(self.props.id, (sigid, async_cb, async_err_cb))
logging.debug("done with share attempt %s" % self._id)
def _joined_cb(self, tp, activity_id, text_channel, exc, userdata): def _joined_cb(self, tp, activity_id, text_channel, exc, userdata):
if activity_id != self.props.id: if activity_id != self.props.id: