Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorWalter Bender <walter.bender@gmail.com>2011-12-07 22:41:14 (GMT)
committer Walter Bender <walter.bender@gmail.com>2011-12-07 22:41:14 (GMT)
commit93e9daca8bf8b42f9d968319c01bfd40ecabaa0a (patch)
tree25833161cf17a951827e64988322542c936979cf
parenta67d7b1f053061339e3657bc7337d412738ae15c (diff)
helps to turn on sharing when sharing
-rw-r--r--ReflectionActivity.py15
1 files changed, 8 insertions, 7 deletions
diff --git a/ReflectionActivity.py b/ReflectionActivity.py
index a49f4ad..1147436 100644
--- a/ReflectionActivity.py
+++ b/ReflectionActivity.py
@@ -180,7 +180,7 @@ class ReflectionActivity(activity.Activity):
def _new_tube_common(self, sharer):
""" Joining and sharing are mostly the same... """
if self._shared_activity is None:
- print("Error: Failed to share or join activity ... \
+ _logger.debug("Error: Failed to share or join activity ... \
_shared_activity is null in _shared_cb()")
return
@@ -195,14 +195,15 @@ class ReflectionActivity(activity.Activity):
'NewTube', self._new_tube_cb)
if sharer:
- print('This is my activity: making a tube...')
+ _logger.debug('This is my activity: making a tube...')
id = self.tubes_chan[telepathy.CHANNEL_TYPE_TUBES].OfferDBusTube(
SERVICE, {})
else:
- print('I am joining an activity: waiting for a tube...')
+ _logger.debug('I am joining an activity: waiting for a tube...')
self.tubes_chan[telepathy.CHANNEL_TYPE_TUBES].ListTubes(
reply_handler=self._list_tubes_reply_cb,
error_handler=self._list_tubes_error_cb)
+ self._game.set_sharing(True)
def _list_tubes_reply_cb(self, tubes):
""" Reply to a list request. """
@@ -211,12 +212,12 @@ class ReflectionActivity(activity.Activity):
def _list_tubes_error_cb(self, e):
""" Log errors. """
- print('Error: ListTubes() failed: %s', e)
+ _logger.debug('Error: ListTubes() failed: %s' % (e))
def _new_tube_cb(self, id, initiator, type, service, params, state):
""" Create a new tube. """
- print('New tube: ID=%d initator=%d type=%d service=%s params=%r \
-state=%d' % (id, initiator, type, service, params, state))
+ _logger.debug('New tube: ID=%d initator=%d type=%d service=%s \
+params=%r state=%d' % (id, initiator, type, service, params, state))
if (type == telepathy.TUBE_TYPE_DBUS and service == SERVICE):
if state == telepathy.TUBE_STATE_LOCAL_PENDING:
@@ -244,7 +245,7 @@ state=%d' % (id, initiator, type, service, params, state))
try:
command, payload = event_message.split('|', 2)
except ValueError:
- print('Could not split event message %s' % (event_message))
+ _logger.debug('Could not split event message %s' % (event_message))
return
self._processing_methods[command][0](payload)