rpms/libhocr/devel libhocr-no-scanner.patch, NONE, 1.1 libhocr.spec, 1.4, 1.5

Oron Peled oron at fedoraproject.org
Tue Jul 6 20:57:08 UTC 2010


Author: oron

Update of /cvs/pkgs/rpms/libhocr/devel
In directory cvs01.phx2.fedoraproject.org:/tmp/cvs-serv25637

Modified Files:
	libhocr.spec 
Added Files:
	libhocr-no-scanner.patch 
Log Message:
Update to match F-12 fixes.


libhocr-no-scanner.patch:
 sane-pygtk |   38 ++++++++++++++++++++++----------------
 1 file changed, 22 insertions(+), 16 deletions(-)

--- NEW FILE libhocr-no-scanner.patch ---
diff -up ./examples/hocr-gtk/sane-pygtk.orig ./examples/hocr-gtk/sane-pygtk
--- ./examples/hocr-gtk/sane-pygtk.orig	2010-06-07 01:21:33.000000000 +0300
+++ ./examples/hocr-gtk/sane-pygtk	2010-06-07 01:23:06.000000000 +0300
@@ -39,14 +39,14 @@ comments = "SANE (Scanner Access Now Eas
 
 # set gettext support
 locale_dir = '/usr/share/locale'
-try:
-    import locale
-    import gettext
-    locale.setlocale(locale.LC_ALL, "")
-    gtk.glade.bindtextdomain(app_name, locale_dir)
-    gettext.install(app_name, locale_dir, unicode=1)
+try:
+    import locale
+    import gettext
+    locale.setlocale(locale.LC_ALL, "")
+    gtk.glade.bindtextdomain(app_name, locale_dir)
+    gettext.install(app_name, locale_dir, unicode=1)
 except (IOError,locale.Error), e:
-    print "WARNING: Can't load locale"
+    print "WARNING: Can't load locale"
     _ = lambda x : x
 
 # set global functions
@@ -152,7 +152,6 @@ class MainWindow:
         
         # get scanners in system
         self.sane_devices = sane.get_devices()
-        self.sane_devices_counter = len(self.sane_devices)
         
         # set the scanners combobox
         for device in self.sane_devices:
@@ -205,13 +204,22 @@ class MainWindow:
         
         dialog.destroy()
         
-    def button_preview_clicked_cb(self, obj):
-        "button_preview_clicked_cb activated"
-        
+    def open_scanner(self):
+	if len(self.sane_devices) <= 0:
+          show_error_message(_("No scanners reported by sane"))
+	  raise RuntimeError("No scanners reported by sane\nRecheck your sane configuration")
         # open scanner
         scanner_number = self.config.getint('settings', 'scanner') - 1
+	if scanner_number < 0 or scanner_number >= len(self.sane_devices):
+          show_error_message(_("Bad scanner number %d configured.\nPlease select a valid scanner from the list") % scanner_number)
+	  raise RuntimeError("Invalid scanner %d" % scanner_number)
         scanner = sane.open(self.sane_devices[scanner_number][0])
-        
+	return scanner
+
+    def button_preview_clicked_cb(self, obj):
+        "button_preview_clicked_cb activated"
+        # open scanner
+	scanner = self.open_scanner()
         # options
         options = get_scanner_option (scanner, 'mode')
         if options:
@@ -278,9 +286,7 @@ class MainWindow:
     def button_scan_clicked_cb(self, obj):
         "button_scan_clicked_cb activated"
         # open scanner
-        scanner_number = self.config.getint('settings', 'scanner') - 1
-        scanner = sane.open(self.sane_devices[scanner_number][0])
-        
+	scanner = self.open_scanner()
         # options
         options = get_scanner_option (scanner, 'mode')
         if options:
@@ -529,7 +535,7 @@ class MainWindow:
         # reset settings options
         if scanner_number < len(self.sane_devices):
             try:
-                scanner = sane.open(self.sane_devices[scanner_number][0])
+	        scanner = self.open_scanner()
                 
                 # if scanner exist fill in all the settings
                 


Index: libhocr.spec
===================================================================
RCS file: /cvs/pkgs/rpms/libhocr/devel/libhocr.spec,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -p -r1.4 -r1.5
--- libhocr.spec	25 Jul 2009 05:53:54 -0000	1.4
+++ libhocr.spec	6 Jul 2010 20:57:08 -0000	1.5
@@ -7,14 +7,18 @@
 
 Name:		libhocr
 Version:	0.10.17
-Release:	4%{?dist}
+Release:	6%{?dist}
 Summary:	A Hebrew optical character recognition library
 
 Group:		System Environment/Libraries
 License:	GPLv3+
 URL:		http://hocr.berlios.de
 Source0:	http://download.berlios.de/hocr/%{name}-%{version}.tar.bz2
+# Sent upstream (private mail, the project has no mailing list)
 Patch0:		libhocr-missing-incl.patch
+# Fix fedora bugs #574259, #577657, #574631
+# Sent upstream (private mail, the project has no mailing list)
+Patch1:		libhocr-no-scanner.patch
 BuildRoot:	%{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
 
 BuildRequires:	fftw-devel, hspell-devel, libtiff-devel
@@ -23,7 +27,7 @@ BuildRequires:	swig, python-devel, gtk2-
 
 %description
 LibHocr is a GNU Hebrew optical character recognition library. It scans
-document images, improve the image, analyses the page layout, recognises
+document images, improve the image, analyzes the page layout, recognizes
 the characters and outputs the text. The output texts are now editable
 text, ready for your blog, word processor or any other use.
 
@@ -47,6 +51,7 @@ Summary:	GTK+ application for %{name}
 Group:		Applications/Productivity
 Requires:	%{name} = %{version}-%{release}
 Requires:	python-imaging-sane, pygtk2-libglade
+Requires:	python(hocr) = %{version}-%{release}
 # We use gtktextbuffer which uses gtkspell which have a runtime
 # check of the spellcheck backends... so here it is:
 Requires:	hspell
@@ -59,6 +64,7 @@ Summary:	Python bindings for %{name}
 Group:		System Environment/Libraries
 Requires:	%{name} = %{version}-%{release}
 Requires:	python > 2.5
+Provides:	python(hocr) = %{version}-%{release}
 
 %description    python
 The %{name}-python package contains python binding for %{name}.
@@ -67,6 +73,7 @@ The %{name}-python package contains pyth
 %prep
 %setup -q
 %patch0
+%patch1
 
 
 %build
@@ -163,6 +170,16 @@ rm -rf %{buildroot}
 
 
 %changelog
+* Mon Jun  7 2010 Oron Peled <oron at actcom.co.il> - 0.10.17-6
+- Fix fedora bugs #574259, #577657, #574631
+- Applied a local patch, since upstream did not issued any release
+  since Mar-2010, despite several bug reports (some with fixes).
+  I'll send this fix upstream for inclusion (one can always hope ;-)
+
+* Thu Feb 18 2010 Oron Peled <oron at actcom.co.il> - 0.10.17-5
+- Fix fedora bug 565233 -- Added python(hocr) as provides to
+  libhocr-python and as requires to libhocr-gtk
+
 * Fri Jul 24 2009 Fedora Release Engineering <rel-eng at lists.fedoraproject.org> - 0.10.17-4
 - Rebuilt for https://fedoraproject.org/wiki/Fedora_12_Mass_Rebuild
 



More information about the scm-commits mailing list