[gphotoframe/f18] Fix traceback when choosing photo source on setting gui

Mamoru Tasaka mtasaka at fedoraproject.org
Mon Aug 13 07:40:16 UTC 2012


commit b7782b980eaf38877933c4901431d1a1ca00aa16
Author: Mamoru Tasaka <tasaka1 at localhost.localdomain>
Date:   Mon Aug 13 16:35:45 2012 +0900

    Fix traceback when choosing photo source on setting gui
    
    - Fix traceback when choosing folder plugin on setting gui
    - Handle exif file with zero denominator on geometry information

 gphotoframe-2.0a2-fix-gdk-oldsymbol.patch          |   17 ++++++
 ....0a2-fix-traceback-choosing-folder-plugin.patch |   53 ++++++++++++++++++++
 gphotoframe-2.0a2-parseexif-geom-zerovalue.patch   |   30 +++++++++++
 gphotoframe.spec                                   |   29 +++++++++--
 4 files changed, 123 insertions(+), 6 deletions(-)
---
diff --git a/gphotoframe-2.0a2-fix-gdk-oldsymbol.patch b/gphotoframe-2.0a2-fix-gdk-oldsymbol.patch
new file mode 100644
index 0000000..443584e
--- /dev/null
+++ b/gphotoframe-2.0a2-fix-gdk-oldsymbol.patch
@@ -0,0 +1,17 @@
+--- gphotoframe-2.0-a2/lib/preferences/photosource.py.gdksymbol	2012-02-24 21:31:51.000000000 +0900
++++ gphotoframe-2.0-a2/lib/preferences/photosource.py	2012-08-13 00:29:12.000000000 +0900
+@@ -1,4 +1,4 @@
+-from gi.repository import Gtk
++from gi.repository import Gtk, Gdk
+ # from gettext import gettext as _
+ 
+ from ..constants import UI_FILE
+@@ -54,7 +54,7 @@
+         self.treeview.set_cursor(row, None, False)
+ 
+     def on_treeview1_button_press_event(self, widget, event):
+-        if event.type == Gdk._2BUTTON_PRESS:
++        if event.type == Gdk.EventType._2BUTTON_PRESS:
+             self.on_button4_clicked(widget)
+             return True
+ 
diff --git a/gphotoframe-2.0a2-fix-traceback-choosing-folder-plugin.patch b/gphotoframe-2.0a2-fix-traceback-choosing-folder-plugin.patch
new file mode 100644
index 0000000..14b45b9
--- /dev/null
+++ b/gphotoframe-2.0a2-fix-traceback-choosing-folder-plugin.patch
@@ -0,0 +1,53 @@
+--- ./gphotoframe-2.0-a2/lib/liststore.py.debug	2012-02-24 21:31:51.000000000 +0900
++++ ./gphotoframe-2.0-a2/lib/liststore.py	2012-08-13 14:59:32.000000000 +0900
+@@ -39,13 +39,22 @@
+         self._start_timer()
+ 
+     def append(self, d, iter=None, is_delay=False):
+-        if 'source' not in d or d['source'] not in plugins.MAKE_PHOTO_TOKEN:
++        if 'source' not in d:
+             return None
+ 
+-        obj = plugins.MAKE_PHOTO_TOKEN[ d['source'] ](
++        sourcestr = d['source']
++        if sourcestr not in plugins.MAKE_PHOTO_TOKEN:
++            try:
++                sourcestr = sourcestr.decode('utf-8')
++            except:
++                return None
++            if sourcestr not in plugins.MAKE_PHOTO_TOKEN:
++                return None
++
++        obj = plugins.MAKE_PHOTO_TOKEN[ sourcestr ](
+             d['target'], d['argument'], d['weight'], d['options'], self)
+-        pixbuf = plugins.PLUGIN_INFO_TOKEN[d['source']]().get_icon_pixbuf()
+-        list = [ pixbuf, d['source'],
++        pixbuf = plugins.PLUGIN_INFO_TOKEN[sourcestr]().get_icon_pixbuf()
++        list = [ pixbuf, sourcestr,
+                  d['target'], d['argument'], d['weight'], d['options'], obj ]
+ 
+         new_iter = self.insert_before(iter, list)
+--- ./gphotoframe-2.0-a2/lib/preferences/plugin.py.debug	2012-02-24 21:31:51.000000000 +0900
++++ ./gphotoframe-2.0-a2/lib/preferences/plugin.py	2012-08-13 16:17:36.000000000 +0900
+@@ -41,7 +41,8 @@
+         self.gui.get_object('button6').set_sensitive(state)
+ 
+     def on_treeview2_cursor_changed(self, widget):
+-        (model, iter) = self.treeview.get_selection().get_selected()
++        selection = self.treeview.get_selection()
++        (model, iter) = selection.get_selected() if selection else (None, None)
+         plugin_type = model[iter][2] if iter else None
+ 
+         state = bool(plugin_type in DIALOG_TOKEN)
+--- ./gphotoframe-2.0-a2/lib/preferences/treeview.py.debug	2012-02-24 21:31:51.000000000 +0900
++++ ./gphotoframe-2.0-a2/lib/preferences/treeview.py	2012-08-13 16:14:13.000000000 +0900
+@@ -11,5 +11,8 @@
+         self._set_button_sensitive(False)
+ 
+     def on_treeview1_cursor_changed(self, widget):
+-        if self.treeview.get_selection().get_selected()[1] != None:
++        selection = self.treeview.get_selection()
++        if not selection:
++            return
++        if selection.get_selected()[1] != None:
+             self._set_button_sensitive(True)
diff --git a/gphotoframe-2.0a2-parseexif-geom-zerovalue.patch b/gphotoframe-2.0a2-parseexif-geom-zerovalue.patch
new file mode 100644
index 0000000..df06dff
--- /dev/null
+++ b/gphotoframe-2.0a2-parseexif-geom-zerovalue.patch
@@ -0,0 +1,30 @@
+--- ./gphotoframe-2.0-a2/lib/plugins/base/parseexif.py.zero	2012-02-15 16:05:52.000000000 +0900
++++ ./gphotoframe-2.0-a2/lib/plugins/base/parseexif.py	2012-08-13 16:21:32.000000000 +0900
+@@ -61,6 +61,14 @@
+ 
+         return orientation
+ 
++    def realvalue_geo(self, fracs):
++        result = 0.
++        factor = 1.
++        for frac in fracs:
++            result += frac.num and frac.num / factor / frac.den or 0.
++            factor *= 60.
++        return result
++
+     def get_geo(self):
+         lat_array = self.tags.get('GPS GPSLatitude')
+         lon_array = self.tags.get('GPS GPSLongitude')
+@@ -70,8 +78,10 @@
+             lon = lon_array.values
+             lat = lat_array.values
+ 
+-            x = lon[0].num + lon[1].num/60 + lon[2].num/3600/lon[2].den
+-            y = lat[0].num + lat[1].num/60 + lat[2].num/3600/lat[2].den
++            #x = lon[0].num + lon[1].num/60. + lon[2].num/3600./lon[2].den
++            #y = lat[0].num + lat[1].num/60. + lat[2].num/3600./lat[2].den
++            x = self.realvalue_geo(lon)
++            y = self.realvalue_geo(lat)
+ 
+             lon_ref = -1 if str(self.tags.get('GPS GPSLongitudeRef')) == 'W' else 1
+             lat_ref = -1 if str(self.tags.get('GPS GPSLatitudeRef'))  == 'S' else 1
diff --git a/gphotoframe.spec b/gphotoframe.spec
index 8620c53..dff4f85 100644
--- a/gphotoframe.spec
+++ b/gphotoframe.spec
@@ -11,14 +11,14 @@
 %global	mainver	2.0
 %define	minorver	-a2
 
-%global	mainrel	1
+%global	mainrel	2
 
 %global	rpmminorver	%(echo "%minorver" | sed -e 's|^-||' | sed -e 's|\\\.||')
 %global	fedorarel	%{?minorver:0.}%{mainrel}%{?minorver:.%rpmminorver}
 
 Name:		gphotoframe
 Version:	%{mainver}
-Release:	%{fedorarel}%{?dist}.1
+Release:	%{fedorarel}%{?dist}
 Summary:	Photo Frame Gadget for the GNOME Desktop
 
 Group:		Amusements/Graphics
@@ -29,6 +29,14 @@ License:	GPLv3 and GPLv2+ and GFDL
 URL:		http://code.google.com/p/gphotoframe/
 Source0:	http://gphotoframe.googlecode.com/files/%{name}-%{mainver}%{?minorver}.tar.gz
 
+# Fix traceback when choosing photo source on setting gui:
+# upstream hp commit c6189be818cc
+Patch0:	gphotoframe-2.0a2-fix-gdk-oldsymbol.patch
+# Fix traceback when choosing folder plugin on setting gui
+Patch1:	gphotoframe-2.0a2-fix-traceback-choosing-folder-plugin.patch
+# Handle exif file with zero denominator on geometry information
+Patch2:	gphotoframe-2.0a2-parseexif-geom-zerovalue.patch
+
 BuildRequires:	GConf2
 BuildRequires:	desktop-file-utils
 BuildRequires:	gettext
@@ -80,6 +88,10 @@ for gnome-screensaver compatibility.
 %prep
 %setup -q -n %{name}-%{mainver}%{?minorver}
 
+%patch0 -p1 -b .oldsymbol
+%patch1 -p2 -b .folder
+%patch2 -p2 -b .zeroden
+
 # Remove unneeded shebangs
 grep -rl '^#![ \t]*%{_bindir}' lib/ | \
 	xargs sed -i -e '\@^#![ \t]*%{_bindir}@d'
@@ -160,14 +172,14 @@ exit 0
 %postun
 if [ $1 -eq 0 ] ; then
 	touch --no-create %{_datadir}/icons/hicolor >/dev/null
-	gtk-update-icon-cache %{_datadir}/icons/hicolor >/dev/null
-	glib-compile-schemas %{_datadir}/glib-2.0/schemas > /dev/null
+	gtk-update-icon-cache %{_datadir}/icons/hicolor &>/dev/null
+	glib-compile-schemas %{_datadir}/glib-2.0/schemas &> /dev/null
 fi
 exit 0
 
 %posttrans
-gtk-update-icon-cache %{_datadir}/icons/hicolor >/dev/null
-glib-compile-schemas %{_datadir}/glib-2.0/schemas > /dev/null
+gtk-update-icon-cache %{_datadir}/icons/hicolor &>/dev/null
+glib-compile-schemas %{_datadir}/glib-2.0/schemas &> /dev/null
 exit 0
 
 
@@ -203,6 +215,11 @@ exit 0
 %{_datadir}/applications/screensavers/%{name}-screensaver.desktop
 
 %changelog
+* Mon Aug 19 2012 Mamoru Tasaka <mtasaka at fedoraproject.org> - 2.0-0.2.a2
+- Fix traceback when choosing photo source on setting gui
+- Fix traceback when choosing folder plugin on setting gui
+- Handle exif file with zero denominator on geometry information
+
 * Thu Jul 19 2012 Fedora Release Engineering <rel-eng at lists.fedoraproject.org> - 2.0-0.1.a2.1
 - Rebuilt for https://fedoraproject.org/wiki/Fedora_18_Mass_Rebuild
 


More information about the scm-commits mailing list