This commit is contained in:
Kovid Goyal 2011-03-23 13:17:22 -06:00
parent da20ff6502
commit 0e6557fe43
2 changed files with 10 additions and 6 deletions

View File

@ -284,6 +284,7 @@ class Amazon(Source):
'com': _('US'), 'com': _('US'),
'fr' : _('France'), 'fr' : _('France'),
'de' : _('Germany'), 'de' : _('Germany'),
'uk' : _('UK'),
} }
def create_query(self, log, title=None, authors=None, identifiers={}): # {{{ def create_query(self, log, title=None, authors=None, identifiers={}): # {{{
@ -331,7 +332,7 @@ class Amazon(Source):
# }}} # }}}
def get_cached_cover_url(self, identifiers): def get_cached_cover_url(self, identifiers): # {{{
url = None url = None
asin = identifiers.get('amazon', None) asin = identifiers.get('amazon', None)
if asin is None: if asin is None:
@ -344,6 +345,7 @@ class Amazon(Source):
url = self.cached_identifier_to_cover_url(asin) url = self.cached_identifier_to_cover_url(asin)
return url return url
# }}}
def identify(self, log, result_queue, abort, title=None, authors=None, # {{{ def identify(self, log, result_queue, abort, title=None, authors=None, # {{{
identifiers={}, timeout=30): identifiers={}, timeout=30):
@ -442,8 +444,7 @@ class Amazon(Source):
return None return None
# }}} # }}}
if __name__ == '__main__': # tests {{{
if __name__ == '__main__':
# To run these test use: calibre-debug -e # To run these test use: calibre-debug -e
# src/calibre/ebooks/metadata/sources/amazon.py # src/calibre/ebooks/metadata/sources/amazon.py
from calibre.ebooks.metadata.sources.test import (test_identify_plugin, from calibre.ebooks.metadata.sources.test import (test_identify_plugin,
@ -489,5 +490,5 @@ if __name__ == '__main__':
), ),
]) ])
# }}}

View File

@ -245,8 +245,11 @@ class Colors:
self.__token_info = line[:16] self.__token_info = line[:16]
action = self.__state_dict.get(self.__state) action = self.__state_dict.get(self.__state)
if action is None: if action is None:
sys.stderr.write('no matching state in module fonts.py\n') try:
sys.stderr.write(self.__state + '\n') sys.stderr.write('no matching state in module fonts.py\n')
sys.stderr.write(self.__state + '\n')
except:
pass
action(line) action(line)
copy_obj = copy.Copy(bug_handler = self.__bug_handler) copy_obj = copy.Copy(bug_handler = self.__bug_handler)
if self.__copy: if self.__copy: