~chicharreros/magicicada-gui/trunk

« back to all changes in this revision

Viewing changes to magicicada/syncdaemon.py

  • Committer: natalia.bidart at canonical
  • Date: 2010-08-16 20:45:51 UTC
  • mfrom: (61.3.13 update-consistently)
  • Revision ID: natalia.bidart@canonical.com-20100816204551-cu44f2daus5zc3ot
Visual update is done more consistently within the update method. Fixes LP: #612192, #612193.

Show diffs side-by-side

added added

removed removed

Lines of Context:
204
204
    def _send_status_changed(self, name, description, is_error, is_connected,
205
205
                             is_online, queues, connection):
206
206
        """Send status changed signal."""
207
 
        logger.debug("    new status: name=%r, description=%r, is_error=%s, "
208
 
                     "is_connected=%s, is_online=%s, queues=%r, connection=%r",
209
 
                     name, description, is_error, is_connected, is_online,
210
 
                     queues, connection)
 
207
        kwargs = dict(name=name, description=description,
 
208
                      is_error=is_error, is_connected=is_connected,
 
209
                      is_online=is_online, queues=queues,
 
210
                      connection=connection)
 
211
        xs = sorted(kwargs.iteritems())
 
212
        logger.debug("    new status: %s", ', '.join('%s=%r' % i for i in xs))
211
213
 
212
214
        # check status changes to call other callbacks
213
215
        if is_connected and not self.current_state.is_connected:
220
222
            self.on_offline_callback()
221
223
 
222
224
        # set current state to new values and call status changed cb
223
 
        self.current_state.set(name=name, description=description,
224
 
                                is_error=is_error, is_connected=is_connected,
225
 
                                is_online=is_online, queues=queues,
226
 
                                connection=connection)
227
 
        self.status_changed_callback(name, description, is_error, is_connected,
228
 
                                     is_online, queues, connection)
 
225
        self.current_state.set(**kwargs)
 
226
        self.status_changed_callback(**kwargs)
229
227
 
230
228
        # if corresponds, supervise MQ
231
229
        if self._mqcaller is None: