From d2c082916573fad6ac06ffa8226b01ec98ae888c Mon Sep 17 00:00:00 2001 From: Dan Williams Date: Thu, 24 Aug 2006 11:09:53 -0400 Subject: [PATCH] Don't traceback when somebody doesn't advertise their color --- shell/PresenceService/Buddy.py | 4 +++- sugar/presence/Buddy.py | 2 ++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/shell/PresenceService/Buddy.py b/shell/PresenceService/Buddy.py index fc4d1855..6d3ff3d4 100644 --- a/shell/PresenceService/Buddy.py +++ b/shell/PresenceService/Buddy.py @@ -74,7 +74,9 @@ class BuddyDBusHelper(dbus.service.Object): props['name'] = self._parent.get_name() props['ip4_address'] = self._parent.get_address() props['owner'] = self._parent.is_owner() - props['color'] = self._parent.get_color() + color = self._parent.get_color() + if color: + props['color'] = self._parent.get_color() return props diff --git a/sugar/presence/Buddy.py b/sugar/presence/Buddy.py index 5ae41f8f..dc5427d7 100644 --- a/sugar/presence/Buddy.py +++ b/sugar/presence/Buddy.py @@ -35,6 +35,8 @@ class Buddy(gobject.GObject): self._buddy.connect_to_signal('LeftActivity', self._left_activity_cb) self._buddy.connect_to_signal('PropertyChanged', self._property_changed_cb) self._properties = self._buddy.getProperties() + if not self._properties.has_key('color'): + self._properties['color'] = "#deadbe" def object_path(self): return self._object_path