rpms/alexandria/F-11 alexandria-0.6.5-WorldCat-results.patch, NONE, 1.1 alexandria-0.6.5-crash-in-turkish.patch, 1.1, 1.2 alexandria.spec, 1.38, 1.39
Mamoru Tasaka
mtasaka at fedoraproject.org
Wed Sep 2 15:05:56 UTC 2009
- Previous message (by thread): rpms/alexandria/F-10 alexandria-0.6.5-WorldCat-results.patch, NONE, 1.1 alexandria-0.6.5-crash-in-turkish.patch, 1.1, 1.2 alexandria.spec, 1.31, 1.32
- Next message (by thread): rpms/dzen2/F-10 dzen2-0.8.5-check_environment.patch, NONE, 1.1 dzen2-0.8.5-verbose.patch, NONE, 1.1 dzen2-dbar.1, NONE, 1.1 dzen2-gcpubar.1, NONE, 1.1 dzen2-gdbar.1, NONE, 1.1 dzen2-textwidth.1, NONE, 1.1 dzen2.1, NONE, 1.1 dzen2.spec, NONE, 1.1 .cvsignore, 1.1, 1.2 sources, 1.1, 1.2
- Messages sorted by:
[ date ]
[ thread ]
[ subject ]
[ author ]
Author: mtasaka
Update of /cvs/extras/rpms/alexandria/F-11
In directory cvs1.fedora.phx.redhat.com:/tmp/cvs-serv504/F-11
Modified Files:
alexandria-0.6.5-crash-in-turkish.patch alexandria.spec
Added Files:
alexandria-0.6.5-WorldCat-results.patch
Log Message:
Sync with devel
alexandria-0.6.5-WorldCat-results.patch:
worldcat.rb | 35 ++++++++++++++++++++++++++++-------
1 file changed, 28 insertions(+), 7 deletions(-)
--- NEW FILE alexandria-0.6.5-WorldCat-results.patch ---
Index: lib/alexandria/book_providers/worldcat.rb
===================================================================
--- lib/alexandria/book_providers/worldcat.rb (revision 1088)
+++ lib/alexandria/book_providers/worldcat.rb (revision 1089)
@@ -23,7 +23,11 @@
# New WorldCat provider, taken from the Palatina MetaDataSource and
# modified to fit the structure of Alexandria book providers.
# (25 Feb 2009)
+#
+# Updated from Palatina, to reflect changes in the worldcat website.
+# (1 Sep 2009)
+
require 'cgi'
require 'alexandria/net'
@@ -136,7 +140,17 @@
raise NoResultsError
end
- title_header = doc%'h1.item-title'
+
+ if doc % 'table.table-results'
+ log.info { "Found multiple results for lookup: fetching first result only" }
+ search_results = parse_search_result_data(html)
+ first = search_results.first
+ rslt2 = transport.get_response(URI.parse(first[:url]))
+ html2 = rslt2.body
+ doc = Hpricot(html2)
+ end
+
+ title_header = doc%'h1.title'
title = title_header.inner_text if title_header
unless title
log.warn { "Unexpected lack of title from WorldCat lookup" }
@@ -145,18 +159,25 @@
log.info { "Found book #{title} at WorldCat" }
authors = []
- authors_div = doc%'div.item-author'
- if authors_div
- (authors_div/:a).each do |a|
+ authors_tr = doc%'tr#details-allauthors'
+ if authors_tr
+ (authors_tr/:a).each do |a|
authors << a.inner_text
end
end
# can we do better? get the City name?? or multiple publishers?
- publisher_row = doc%'td.label[text()*=Publisher]/..'
+ bibdata = doc % 'div#bibdata'
+ bibdata_table = bibdata % :table
+ publisher_row = bibdata_table % 'th[text()*=Publisher]/..'
+
if publisher_row
publication_info = (publisher_row/'td').last.inner_text
- publication_info =~ /:*([^;,]+)/
+ if publication_info.index(':')
+ publication_info =~ /:[\s]*([^;,]+)/
+ else
+ publication_info =~ /([^;,]+)/
+ end
publisher = $1
publication_info =~ /([12][0-9]{3})/
year = $1.to_i if $1
@@ -167,7 +188,7 @@
isbn = search_isbn
unless isbn
- isbn_row = doc%'td.label[text()*=ISBN]/..'
+ isbn_row = doc % 'tr#details-standardno' ##bibdata_table % 'th[text()*=ISBN]/..'
if isbn_row
isbns = (isbn_row/'td').last.inner_text.split
isbn = Library.canonicalise_isbn(isbns.first)
alexandria-0.6.5-crash-in-turkish.patch:
icons.rb | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
Index: alexandria-0.6.5-crash-in-turkish.patch
===================================================================
RCS file: /cvs/extras/rpms/alexandria/F-11/alexandria-0.6.5-crash-in-turkish.patch,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -p -r1.1 -r1.2
--- alexandria-0.6.5-crash-in-turkish.patch 28 Aug 2009 19:32:15 -0000 1.1
+++ alexandria-0.6.5-crash-in-turkish.patch 2 Sep 2009 15:05:56 -0000 1.2
@@ -1,7 +1,7 @@
Index: lib/alexandria/ui/icons.rb
===================================================================
--- lib/alexandria/ui/icons.rb (revision 1087)
-+++ lib/alexandria/ui/icons.rb (working copy)
++++ lib/alexandria/ui/icons.rb (revision 1088)
@@ -63,7 +63,9 @@
def self.load_icon_images
Dir.entries(ICONS_DIR).each do |file|
Index: alexandria.spec
===================================================================
RCS file: /cvs/extras/rpms/alexandria/F-11/alexandria.spec,v
retrieving revision 1.38
retrieving revision 1.39
diff -u -p -r1.38 -r1.39
--- alexandria.spec 28 Aug 2009 19:32:15 -0000 1.38
+++ alexandria.spec 2 Sep 2009 15:05:56 -0000 1.39
@@ -5,7 +5,7 @@
%define majorver 0.6.5
%undefine minorver
-%define fedorarel 6
+%define fedorarel 7
%define rel %{?minorver:0.}%{fedorarel}%{?minorver:.%minorver}
@@ -33,9 +33,11 @@ Patch4: alexandria-0.6.5-search-result-
# ref: alexandria-Bugs-27000
Patch5: alexandria-0.6.5-deastore-author-missing.patch
# Alexandria crashes in tr_TR.UTF-8 on startup
-# RH bug 520170
-# Must report upstream
+# RH bug 520170, alexandria-Bugs-27015
Patch6: alexandria-0.6.5-crash-in-turkish.patch
+# Fix for parsing WorldCat search result
+# ref: alexandria-Bugs-27028
+Patch7: alexandria-0.6.5-WorldCat-results.patch
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
BuildArch: noarch
@@ -90,6 +92,7 @@ Alexandria is a GNOME application to hel
%patch4 -p0 -b .sanity
%patch5 -p0 -b .deastore
%patch6 -p0 -b .tr_TR
+%patch7 -p0 -b .worldcat
# Embed Fedora EVR
%{__sed} -i.evr \
@@ -216,16 +219,20 @@ exit 0
%{_datadir}/icons/hicolor/*/apps/%{name}.*
%changelog
+* Wed Sep 2 2009 Mamoru Tasaka <mtasaka at ioa.s.u-tokyo.ac.jp> - 0.6.5-7
+- Fix for parsing WorldCat provider search result (alexandria-Bugs-27028)
+
* Sat Aug 28 2009 Mamoru Tasaka <mtasaka at ioa.s.u-tokyo.ac.jp> - 0.6.5-6
-- Fix crash on startup in tr_TR.UTF-8 (bug 520170)
+- Fix crash on startup in tr_TR.UTF-8 (bug 520170, alexandria-Bugs-27015)
* Thu Aug 27 2009 Mamoru Tasaka <mtasaka at ioa.s.u-tokyo.ac.jp> - 0.6.5-5
- Add sanity check for invalid search result, now using upstream patch
- Fix DeaStore provider where search result contains no Author
+ (alexandria-Bugs-27000)
* Fri Aug 21 2009 Mamoru Tasaka <mtasaka at ioa.s.u-tokyo.ac.jp> - 0.6.5-3
- Clarify GLib.convert usage in utils.rb (does not change the
- functionality of alexandria)
+ functionality of alexandria, alexandria-Bugs-26968)
* Thu Aug 20 2009 Mamoru Tasaka <mtasaka at ioa.s.u-tokyo.ac.jp> - 0.6.5-2
- Kill the previous 2 patches (for now)
- Previous message (by thread): rpms/alexandria/F-10 alexandria-0.6.5-WorldCat-results.patch, NONE, 1.1 alexandria-0.6.5-crash-in-turkish.patch, 1.1, 1.2 alexandria.spec, 1.31, 1.32
- Next message (by thread): rpms/dzen2/F-10 dzen2-0.8.5-check_environment.patch, NONE, 1.1 dzen2-0.8.5-verbose.patch, NONE, 1.1 dzen2-dbar.1, NONE, 1.1 dzen2-gcpubar.1, NONE, 1.1 dzen2-gdbar.1, NONE, 1.1 dzen2-textwidth.1, NONE, 1.1 dzen2.1, NONE, 1.1 dzen2.spec, NONE, 1.1 .cvsignore, 1.1, 1.2 sources, 1.1, 1.2
- Messages sorted by:
[ date ]
[ thread ]
[ subject ]
[ author ]
More information about the fedora-extras-commits
mailing list