From 182e6b3558e7151f88ee0cfb6a02081a8df1d7c0 Mon Sep 17 00:00:00 2001
From: Aleksey Lim <alsroot@member.fsf.org>
Date: Sun, 27 Sep 2009 17:05:27 +0000
Subject: Do no use random color if metadata color is not valid #1435
---
src/sugar/graphics/xocolor.py | 10 +++++++---
1 files changed, 7 insertions(+), 3 deletions(-)
diff --git a/src/sugar/graphics/xocolor.py b/src/sugar/graphics/xocolor.py
index 00238d9..cc93966 100644
a
|
b
|
STABLE. |
22 | 22 | import random |
23 | 23 | import logging |
24 | 24 | |
| 25 | from sugar.graphics import style |
| 26 | |
25 | 27 | colors = [ |
26 | 28 | ['#B20008', '#FF2B34'], \ |
27 | 29 | ['#FF2B34', '#B20008'], \ |
… |
… |
class XoColor: |
229 | 231 | if color_string == None: |
230 | 232 | randomize = True |
231 | 233 | elif not is_valid(color_string): |
232 | | logging.error('Color string is not valid: %s, will generate a ' |
233 | | 'random color pair.', color_string) |
234 | | randomize = True |
| 234 | logging.debug('Color string is not valid: %s, fallback to default', |
| 235 | color_string) |
| 236 | color_string = '%s,%s' % (style.COLOR_BUTTON_GREY.get_svg(), |
| 237 | style.COLOR_TRANSPARENT.get_svg()) |
| 238 | randomize = False |
235 | 239 | else: |
236 | 240 | randomize = False |
237 | 241 | |