This commit is contained in:
Kovid Goyal 2011-02-16 16:03:38 -07:00
parent 32c1415aae
commit 5ec3d6e5ee
3 changed files with 26 additions and 4 deletions

View File

@ -0,0 +1,22 @@
#!/usr/bin/env python
# vim:fileencoding=UTF-8:ts=4:sw=4:sta:et:sts=4:ai
from __future__ import (unicode_literals, division, absolute_import,
print_function)
__license__ = 'GPL v3'
__copyright__ = '2011, Kovid Goyal <kovid@kovidgoyal.net>'
__docformat__ = 'restructuredtext en'
from calibre.ebooks.metadata.sources.base import Source
class Amazon(Source):
name = 'Amazon'
description = _('Downloads metadata from Amazon')
capabilities = frozenset(['identify', 'cover'])
touched_fields = frozenset(['title', 'authors', 'isbn', 'pubdate',
'comments', 'cover_data'])

View File

@ -162,8 +162,7 @@ class GoogleBooks(Source):
touched_fields = frozenset(['title', 'authors', 'isbn', 'tags', 'pubdate', touched_fields = frozenset(['title', 'authors', 'isbn', 'tags', 'pubdate',
'comments', 'publisher', 'author_sort']) # language currently disabled 'comments', 'publisher', 'author_sort']) # language currently disabled
def create_query(self, log, title=None, authors=None, identifiers={}, def create_query(self, log, title=None, authors=None, identifiers={}):
start_index=1):
BASE_URL = 'http://books.google.com/books/feeds/volumes?' BASE_URL = 'http://books.google.com/books/feeds/volumes?'
isbn = identifiers.get('isbn', None) isbn = identifiers.get('isbn', None)
q = '' q = ''
@ -188,7 +187,7 @@ class GoogleBooks(Source):
return BASE_URL+urlencode({ return BASE_URL+urlencode({
'q':q, 'q':q,
'max-results':20, 'max-results':20,
'start-index':start_index, 'start-index':1,
'min-viewability':'none', 'min-viewability':'none',
}) })

View File

@ -87,5 +87,6 @@ def test_identify_plugin(name, tests):
prints('Log saved to', lf) prints('Log saved to', lf)
raise SystemExit(1) raise SystemExit(1)
prints('Log saved to', lf) if os.stat(lf).st_size > 10:
prints('There were some errors, see log', lf)