rpms/libhocr/F-13 libhocr-no-scanner.patch, NONE, 1.1 libhocr.spec, 1.5, 1.6
Oron Peled
oron at fedoraproject.org
Tue Jul 6 22:16:52 UTC 2010
Author: oron
Update of /cvs/pkgs/rpms/libhocr/F-13
In directory cvs01.phx2.fedoraproject.org:/tmp/cvs-serv16421
Modified Files:
libhocr.spec
Added Files:
libhocr-no-scanner.patch
Log Message:
Update to match F-12 patches + release number
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/F-13/libhocr.spec,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -p -r1.5 -r1.6
--- libhocr.spec 1 Mar 2010 22:14:05 -0000 1.5
+++ libhocr.spec 6 Jul 2010 22:16:52 -0000 1.6
@@ -7,14 +7,18 @@
Name: libhocr
Version: 0.10.17
-Release: 5%{?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.
@@ -69,6 +73,7 @@ The %{name}-python package contains pyth
%prep
%setup -q
%patch0
+%patch1
%build
@@ -165,7 +170,13 @@ rm -rf %{buildroot}
%changelog
-* Mon Mar 1 2010 Oron Peled <oron at actcom.co.il> - 0.10.17-5
+* 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
More information about the scm-commits
mailing list