Don't traceback when somebody doesn't advertise their color

This commit is contained in:
Dan Williams 2006-08-24 11:09:53 -04:00
parent 3f50668494
commit d2c0829165
2 changed files with 5 additions and 1 deletions

View File

@ -74,7 +74,9 @@ class BuddyDBusHelper(dbus.service.Object):
props['name'] = self._parent.get_name() props['name'] = self._parent.get_name()
props['ip4_address'] = self._parent.get_address() props['ip4_address'] = self._parent.get_address()
props['owner'] = self._parent.is_owner() 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 return props

View File

@ -35,6 +35,8 @@ class Buddy(gobject.GObject):
self._buddy.connect_to_signal('LeftActivity', self._left_activity_cb) self._buddy.connect_to_signal('LeftActivity', self._left_activity_cb)
self._buddy.connect_to_signal('PropertyChanged', self._property_changed_cb) self._buddy.connect_to_signal('PropertyChanged', self._property_changed_cb)
self._properties = self._buddy.getProperties() self._properties = self._buddy.getProperties()
if not self._properties.has_key('color'):
self._properties['color'] = "#deadbe"
def object_path(self): def object_path(self):
return self._object_path return self._object_path