From 5b1db87cec9b159ffad84a465b871b27b75fad82 Mon Sep 17 00:00:00 2001 From: Tomeu Vizoso Date: Sun, 26 Aug 2007 17:00:08 +0000 Subject: Add some warnings to the new icon stuff. --- diff --git a/sugar/graphics/icon.py b/sugar/graphics/icon.py index cee7dec..f4b466c 100644 --- a/sugar/graphics/icon.py +++ b/sugar/graphics/icon.py @@ -182,6 +182,8 @@ class _IconBuffer(object): icon_info.file_name = info.get_filename() icon_info.attach_x = attach_x icon_info.attach_y = attach_y + else: + logging.warning('No icon with the name %s was found in the theme.' % self.icon_name) return icon_info @@ -413,9 +415,13 @@ class CanvasIcon(hippo.CanvasBox, hippo.CanvasItem): self.props.fill_color = value.get_fill_color() self.props.stroke_color = value.get_stroke_color() elif pspec.name == 'fill-color': + if not isinstance(value, str): + raise TypeError('fill-color must be a string') self._buffer.fill_color = value self.emit_paint_needed(0, 0, -1, -1) elif pspec.name == 'stroke-color': + if not isinstance(value, str): + raise TypeError('stroke-color must be a string') self._buffer.stroke_color = value self.emit_paint_needed(0, 0, -1, -1) elif pspec.name == 'size': -- cgit v0.9.1