From f0db185735054f6ca84d5eda9bd3c9ddc6601bf7 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Tue, 16 Jun 2009 07:36:47 -0700 Subject: [PATCH 01/21] New recipe for the Economic Tise India by Darko Miletic --- .../images/news/theeconomictimes_india.png | Bin 0 -> 529 bytes src/calibre/web/feeds/recipes/__init__.py | 1 + .../recipes/recipe_theeconomictimes_india.py | 56 ++++++++++++++++++ 3 files changed, 57 insertions(+) create mode 100644 src/calibre/gui2/images/news/theeconomictimes_india.png create mode 100644 src/calibre/web/feeds/recipes/recipe_theeconomictimes_india.py diff --git a/src/calibre/gui2/images/news/theeconomictimes_india.png b/src/calibre/gui2/images/news/theeconomictimes_india.png new file mode 100644 index 0000000000000000000000000000000000000000..ddd252d6b6f97556559c06564b8ec7ed83686d0b GIT binary patch literal 529 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61|;P_|4#%`Y)RhkE)4%caKYZ?lYt_f1s;*b zK-vS0-A-oPfdtD69Mgd`SU*F|v9*U87#OWQT^vI!PCuP&=)sgI(I&6la%A?or~F3K zuPj`;TazQFP?#@ggyM>?RE%ikKXh0$%5#d3A=e( zxfU)>|MUNSb>;o{kGXfo)}CR~(Y^G?oT=~i!yWg|?7q33F@kM{>HMARwh9zYx#K5v z_r*u64J+f{U9K=#d4+e%lmitTZ$wPq*v5Bq$C+hK~qf{YD=;|f8i&G64-u8X{t?Mz-K)wC8#X9$;_x{an*soS^kmVJiV?IIY z;evuE`;22>3m5JF_2XW}VVN7oue`EEO?3-m`gcFOoc?dEi@}Wx_B&eN|6rI 0) or (rurl.find('/quickiearticleshow/') > 0): + return None + return rurl + + def preprocess_html(self, soup): + soup.html['xml:lang'] = self.lang + soup.html['lang'] = self.lang + mlang = Tag(soup,'meta',[("http-equiv","Content-Language"),("content",self.lang)]) + mcharset = Tag(soup,'meta',[("http-equiv","Content-Type"),("content","text/html; charset=utf-8")]) + soup.head.insert(0,mlang) + soup.head.insert(1,mcharset) + return self.adeify_images(soup) + \ No newline at end of file From 12f0d53b1ae894d4e91111c4fbdac4b74a8e2f4b Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Tue, 16 Jun 2009 08:52:28 -0700 Subject: [PATCH 02/21] Fix #2607 (Remove non-numerical characters from ISBN when fetching metadata) --- src/calibre/ebooks/metadata/fetch.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/calibre/ebooks/metadata/fetch.py b/src/calibre/ebooks/metadata/fetch.py index f950e1282c..f7a6a559b7 100644 --- a/src/calibre/ebooks/metadata/fetch.py +++ b/src/calibre/ebooks/metadata/fetch.py @@ -3,7 +3,7 @@ __license__ = 'GPL 3' __copyright__ = '2009, Kovid Goyal ' __docformat__ = 'restructuredtext en' -import traceback, sys, textwrap +import traceback, sys, textwrap, re from threading import Thread from calibre import preferred_encoding @@ -90,6 +90,8 @@ def search(title=None, author=None, publisher=None, isbn=None, isbndb_key=None, verbose=0): assert not(title is None and author is None and publisher is None and \ isbn is None) + if isbn is not None: + isbn = re.sub(r'[^a-zA-Z0-9]', '', isbn).upper() fetchers = [FetchGoogle(title, author, publisher, isbn, verbose)] if isbndb_key: fetchers.append(FetchISBNDB(title, author, publisher, isbn, verbose, From bd59e2453c037daa67e7dead8af2c44d8af15bd1 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Tue, 16 Jun 2009 21:52:41 -0700 Subject: [PATCH 03/21] Fix #2623 (UnicodeEncodeError: 'ascii' codec can't encode character u'\xe6' in position 458: ordinal not in range(128)) --- src/calibre/ebooks/epub/output.py | 1 + src/calibre/ebooks/oeb/iterator.py | 5 +++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/calibre/ebooks/epub/output.py b/src/calibre/ebooks/epub/output.py index 3256e1168a..0794747a64 100644 --- a/src/calibre/ebooks/epub/output.py +++ b/src/calibre/ebooks/epub/output.py @@ -56,6 +56,7 @@ class EPUBOutput(OutputFormatPlugin): TITLEPAGE_COVER = '''\ + Cover