[sugar-toolkit-gtk3/f21] Patch for running Activities if the Translation is broken

Peter Robinson pbrobinson at fedoraproject.org
Tue Nov 25 12:39:18 UTC 2014


commit bf71bc52e6b5a6d22257966a65eddabc0ce81e29
Author: Peter Robinson <pbrobinson at gmail.com>
Date:   Tue Nov 25 12:39:06 2014 +0000

     Patch for running Activities if the Translation is broken

 170.patch               |   47 +++++++++++++++++++++++++++++++++++++++++++++++
 sugar-toolkit-gtk3.spec |   11 ++++++++---
 2 files changed, 55 insertions(+), 3 deletions(-)
---
diff --git a/170.patch b/170.patch
new file mode 100644
index 0000000..905369b
--- /dev/null
+++ b/170.patch
@@ -0,0 +1,47 @@
+From 2dc3979903e1e83f64c4841c782dbb72d33286df Mon Sep 17 00:00:00 2001
+From: Gonzalo Odiard <godiard at gmail.com>
+Date: Mon, 24 Nov 2014 13:40:24 -0300
+Subject: [PATCH] Don't break if translation can't be parsed
+
+If the .linfo file can't be parsed, use the untranslated name/summary,
+but don't  break activity load.
+---
+ src/sugar3/bundle/activitybundle.py | 21 ++++++++++++---------
+ 1 file changed, 12 insertions(+), 9 deletions(-)
+
+diff --git a/src/sugar3/bundle/activitybundle.py b/src/sugar3/bundle/activitybundle.py
+index cbee15f..f9a700a 100644
+--- a/src/sugar3/bundle/activitybundle.py
++++ b/src/sugar3/bundle/activitybundle.py
+@@ -229,19 +229,22 @@ def _get_linfo_file(self):
+ 
+     def _parse_linfo(self, linfo_file):
+         cp = ConfigParser()
+-        cp.readfp(linfo_file)
++        try:
++            cp.readfp(linfo_file)
+ 
+-        section = 'Activity'
++            section = 'Activity'
+ 
+-        if cp.has_option(section, 'name'):
+-            self._name = cp.get(section, 'name')
++            if cp.has_option(section, 'name'):
++                self._name = cp.get(section, 'name')
+ 
+-        if cp.has_option(section, 'summary'):
+-            self._summary = cp.get(section, 'summary')
++            if cp.has_option(section, 'summary'):
++                self._summary = cp.get(section, 'summary')
+ 
+-        if cp.has_option(section, 'tags'):
+-            tag_list = cp.get(section, 'tags').strip(';')
+-            self._tags = [tag.strip() for tag in tag_list.split(';')]
++            if cp.has_option(section, 'tags'):
++                tag_list = cp.get(section, 'tags').strip(';')
++                self._tags = [tag.strip() for tag in tag_list.split(';')]
++        except ConfigParser.ParsingError as e:
++            logging.exception('Exception reading linfo file: %s', e)
+ 
+     def get_locale_path(self):
+         """Get the locale path inside the (installed) activity bundle."""
diff --git a/sugar-toolkit-gtk3.spec b/sugar-toolkit-gtk3.spec
index a00d37e..48834a4 100644
--- a/sugar-toolkit-gtk3.spec
+++ b/sugar-toolkit-gtk3.spec
@@ -3,12 +3,13 @@
 Summary: Sugar toolkit GTK+ 3
 Name:    sugar-toolkit-gtk3
 Version: 0.102.0
-Release: 3%{?dist}
+Release: 4%{?dist}
+License: LGPLv2+
+Group:   System Environment/Libraries
 URL:     http://wiki.laptop.org/go/Sugar
 Source0: http://download.sugarlabs.org/sources/sucrose/glucose/%{name}/%{name}-%{version}.tar.xz
 Source1: macros.sugar
-License: LGPLv2+
-Group:   System Environment/Libraries
+Patch0:  170.patch
 
 BuildRequires: alsa-lib-devel
 BuildRequires: gettext-devel
@@ -48,6 +49,7 @@ the SugarExt-1.0 library through gobject-introspection.
 
 %prep
 %setup -q
+%patch0 -p1 -b .trans
 
 %build
 %configure
@@ -82,6 +84,9 @@ find %{buildroot} -type f -name "*.la" -delete
 %{_datadir}/gir-1.0/*.gir
 
 %changelog
+* Tue Nov 25 2014 Peter Robinson <pbrobinson at fedoraproject.org> 0.102.0-4
+- Patch for running Activities if the Translation is broken
+
 * Mon Aug 18 2014 Fedora Release Engineering <rel-eng at lists.fedoraproject.org> - 0.102.0-3
 - Rebuilt for https://fedoraproject.org/wiki/Fedora_21_22_Mass_Rebuild
 


More information about the scm-commits mailing list