From f9b0d68a48712c790f0870381c89d11de0466eeb Mon Sep 17 00:00:00 2001 From: Tomeu Vizoso Date: Wed, 30 Jun 2010 16:01:58 +0000 Subject: Refactor the logic for sharing into _ShareCommand and implement joining a shared instance with _JoinCommand. --- (limited to 'src/sugar/presence/buddy.py') diff --git a/src/sugar/presence/buddy.py b/src/sugar/presence/buddy.py index 4722485..aa16f7e 100644 --- a/src/sugar/presence/buddy.py +++ b/src/sugar/presence/buddy.py @@ -276,17 +276,17 @@ class Buddy(BaseBuddy): error_handler=self.__error_handler_cb) def __got_properties_cb(self, properties): - _logger.debug('__got_properties_cb', properties) + _logger.debug('__got_properties_cb %r', properties) self._get_properties_call = None self._update_properties(properties) def __got_attributes_cb(self, attributes): - _logger.debug('__got_attributes_cb', attributes) + _logger.debug('__got_attributes_cb %r', attributes) self._get_attributes_call = None self._update_attributes(attributes[self._contact_handle]) def __error_handler_cb(self, error): - _logger.debug('__error_handler_cb', error) + _logger.debug('__error_handler_cb %r', error) def __properties_changed_cb(self, new_props): _logger.debug('%r: Buddy properties changed to %r', self, new_props) @@ -314,7 +314,11 @@ class Buddy(BaseBuddy): self.props.nick = attributes[nick_key] def do_get_property(self, pspec): - if self._get_properties_call is not None: + if pspec.name == 'nick' and self._get_attributes_call is not None: + _logger.debug('%r: Blocking on GetContactAttributes() because someone ' + 'wants property nick', self) + self._get_attributes_call.block() + elif pspec.name != 'nick' and self._get_properties_call is not None: _logger.debug('%r: Blocking on GetProperties() because someone ' 'wants property %s', self, pspec.name) self._get_properties_call.block() -- cgit v0.9.1