From 1a3d520dce5d5accebde23cd46a181b57e0860d1 Mon Sep 17 00:00:00 2001 From: Marco Pesenti Gritti Date: Wed, 31 Oct 2007 14:58:37 +0100 Subject: [PATCH] Smarter mime_types parsing logic. Works also if there are spaces between types. --- NEWS | 1 + lib/sugar/bundle/activitybundle.py | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/NEWS b/NEWS index f147a8a0..d91d4247 100644 --- a/NEWS +++ b/NEWS @@ -1,3 +1,4 @@ +* #4552 Allow to open images in Paint (marco) * #4518: Encode nickname in UTF-8 when writing it out to .sugar/*/config (smcv) * sugar-control: Use NM for radio on/off, check for superuser (erikos) diff --git a/lib/sugar/bundle/activitybundle.py b/lib/sugar/bundle/activitybundle.py index 8ba61fe0..ce1510f0 100644 --- a/lib/sugar/bundle/activitybundle.py +++ b/lib/sugar/bundle/activitybundle.py @@ -93,8 +93,8 @@ class ActivityBundle(Bundle): self._path) if cp.has_option(section, 'mime_types'): - mime_list = cp.get(section, 'mime_types') - self._mime_types = mime_list.strip(';').split(';') + mime_list = cp.get(section, 'mime_types').strip(';') + self._mime_types = [ mime.strip() for mime in mime_list.split(';') ] if cp.has_option(section, 'show_launcher'): if cp.get(section, 'show_launcher') == 'no':