diff options
author | flavio <fdanesse@gmail.com> | 2012-09-09 21:33:04 (GMT) |
---|---|---|
committer | flavio <fdanesse@gmail.com> | 2012-09-09 21:33:04 (GMT) |
commit | 11e8e42c6deda09309037ce42cfb58c7f82b928a (patch) | |
tree | 0da31d8e61e8210aefe2a4d9aaee02b5bcc374d8 | |
parent | 4ea9295e3e53906245b3264c5b014e535e279abb (diff) |
Change _shared_activity by shared_activity
-rw-r--r-- | activity.py | 23 |
1 files changed, 10 insertions, 13 deletions
diff --git a/activity.py b/activity.py index 69506ee..4fe73c6 100644 --- a/activity.py +++ b/activity.py @@ -84,9 +84,6 @@ class AcousticMeasureActivity(activity.Activity): self._logger = logging.getLogger('acousticmeasure-activity') GObject.threads_init() - - # FIXME: object has no attribute _shared_activity - self._shared_activity = None try: self._logger.debug("locale: " + locale.setlocale(locale.LC_ALL, @@ -386,25 +383,25 @@ participants, so you cannot join.") self._make_ready() def _sharing_setup(self): - if self._shared_activity is None: + if self.shared_activity is None: self._logger.error('Failed to share or join activity') return - self.conn = self._shared_activity.telepathy_conn - self.tubes_chan = self._shared_activity.telepathy_tubes_chan - self.text_chan = self._shared_activity.telepathy_text_chan + self.conn = self.shared_activity.telepathy_conn + self.tubes_chan = self.shared_activity.telepathy_tubes_chan + self.text_chan = self.shared_activity.telepathy_text_chan self.tubes_chan[telepathy.CHANNEL_TYPE_TUBES].connect_to_signal( 'NewTube', self._new_tube_cb) self.tubes_chan[telepathy.CHANNEL_TYPE_TUBES].connect_to_signal( 'TubeStateChanged', self._tube_state_cb) - self._shared_activity.connect('buddy-joined', self._buddy_joined_cb) - self._shared_activity.connect('buddy-left', self._buddy_left_cb) + self.shared_activity.connect('buddy-joined', self._buddy_joined_cb) + self.shared_activity.connect('buddy-left', self._buddy_left_cb) # Optional - included for example: # Find out who's already in the shared activity: - for buddy in self._shared_activity.get_joined_buddies(): + for buddy in self.shared_activity.get_joined_buddies(): self._logger.debug('Buddy %s is already in the activity', buddy.props.nick) @@ -416,12 +413,12 @@ participants, so you cannot join.") self._logger.error('ListTubes() failed: %s', e) def _joined_cb(self, activity): - if not self._shared_activity: + if not self.shared_activity: return # Find out who's already in the shared activity: n = 0 - for buddy in self._shared_activity.get_joined_buddies(): + for buddy in self.shared_activity.get_joined_buddies(): n += 1 self._logger.debug('Buddy %s is already in the activity' % \ buddy.props.nick) @@ -438,7 +435,7 @@ participants, so you cannot join.") error_handler=self._list_tubes_error_cb) else: self._logger.debug("There are already two people, not joining") - self._shared_activity.leave() + self.shared_activity.leave() thread.start_new_thread(self._change_message, ('full',)) def _new_tube_cb(self, id, initiator, type, service, params, state): |