Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/shell
diff options
context:
space:
mode:
authorDan Williams <dcbw@localhost.localdomain>2006-08-25 16:11:25 (GMT)
committer Dan Williams <dcbw@localhost.localdomain>2006-08-25 16:11:25 (GMT)
commitba3d5fce8c5051fbb6d9557d127f922145ad7f41 (patch)
tree7768e220440f1f5642e6d75b1418ff75443b2561 /shell
parent8ac55c287ebf678a1166fd5d4f3c3d6676168f2d (diff)
Don't traceback when buddies have bad colors
Diffstat (limited to 'shell')
-rw-r--r--shell/home/FriendsModel.py10
1 files changed, 8 insertions, 2 deletions
diff --git a/shell/home/FriendsModel.py b/shell/home/FriendsModel.py
index 0df084c..791aa81 100644
--- a/shell/home/FriendsModel.py
+++ b/shell/home/FriendsModel.py
@@ -2,6 +2,7 @@ import gobject
from sugar.presence import PresenceService
from sugar.canvas.IconColor import IconColor
+import logging
class Friend:
def __init__(self, buddy):
@@ -11,8 +12,13 @@ class Friend:
return self._buddy.get_name()
def get_color(self):
- color = self._buddy.get_color()
- return IconColor(color)
+ color = self._buddy.get_color()
+ try:
+ icolor = IconColor(color)
+ except RuntimeError:
+ icolor = IconColor()
+ logging.info("Buddy %s doesn't have an allowed color; using a random color instead." % self.get_name())
+ return icolor
class FriendsModel(gobject.GObject):
__gsignals__ = {