Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/rpms/sugar-toolkit/sugar-toolkit-4-4-XoColor-don-t-choke-if-passed-the-wrong-type-SL-1408.patch
diff options
context:
space:
mode:
authormanish <manish@robbie.oficina.paraguayeduca.org>2011-01-18 03:04:40 (GMT)
committer manish <manish@robbie.oficina.paraguayeduca.org>2011-01-18 03:04:40 (GMT)
commit3c2790abdd589957c36ece2e34f429a8c14823ef (patch)
treef94b4e1da82306adf2a72a759f35127b66491cdc /rpms/sugar-toolkit/sugar-toolkit-4-4-XoColor-don-t-choke-if-passed-the-wrong-type-SL-1408.patch
parenta69619a4da09e35b738d6a03fa4d01c1af082e6d (diff)
Backport 0.90 fixes (thanks to alsroot)
Diffstat (limited to 'rpms/sugar-toolkit/sugar-toolkit-4-4-XoColor-don-t-choke-if-passed-the-wrong-type-SL-1408.patch')
-rw-r--r--rpms/sugar-toolkit/sugar-toolkit-4-4-XoColor-don-t-choke-if-passed-the-wrong-type-SL-1408.patch40
1 files changed, 40 insertions, 0 deletions
diff --git a/rpms/sugar-toolkit/sugar-toolkit-4-4-XoColor-don-t-choke-if-passed-the-wrong-type-SL-1408.patch b/rpms/sugar-toolkit/sugar-toolkit-4-4-XoColor-don-t-choke-if-passed-the-wrong-type-SL-1408.patch
new file mode 100644
index 0000000..0ad36b1
--- /dev/null
+++ b/rpms/sugar-toolkit/sugar-toolkit-4-4-XoColor-don-t-choke-if-passed-the-wrong-type-SL-1408.patch
@@ -0,0 +1,40 @@
+From patchwork Sat Jan 15 17:07:19 2011
+Content-Type: text/plain; charset="utf-8"
+MIME-Version: 1.0
+Content-Transfer-Encoding: 7bit
+Subject: [sugar-toolkit,
+ 4/4] XoColor: don't choke if passed the wrong type (SL#1408)
+Date: Sat, 15 Jan 2011 22:07:19 -0000
+From: Aleksey Lim <alsroot@member.fsf.org>
+X-Patchwork-Id: 576
+Message-Id: <1295111239-22177-5-git-send-email-alsroot@member.fsf.org>
+To: dextrose@lists.sugarlabs.org
+
+From: Sascha Silbe <sascha-pgp@silbe.org>
+
+Color data is stored in the Journal as a JSON dump, so we can get back
+arbitrary types. XoColor already checks the color string for validity and
+handles invalid strings gracefully, so it makes sense to enhance this to
+invalid types as well.
+
+Acked-by: Simon Schampijer <simon@schampijer.de>
+
+---
+src/sugar/graphics/xocolor.py | 4 ++++
+ 1 files changed, 4 insertions(+), 0 deletions(-)
+
+diff --git a/src/sugar/graphics/xocolor.py b/src/sugar/graphics/xocolor.py
+index fd329cb..036d695 100644
+--- a/src/sugar/graphics/xocolor.py
++++ b/src/sugar/graphics/xocolor.py
+@@ -209,6 +209,10 @@ colors = [
+
+
+ def _parse_string(color_string):
++ if not isinstance(color_string, (str, unicode)):
++ logging.error('Invalid color string: %r', color_string)
++ return None
++
+ if color_string == 'white':
+ return ['#ffffff', '#414141']
+ elif color_string == 'insensitive':