From 0e6557fe433d60913e9830a59bf10c2a582b1a82 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Wed, 23 Mar 2011 13:17:22 -0600 Subject: [PATCH] ... --- src/calibre/ebooks/metadata/sources/amazon.py | 9 +++++---- src/calibre/ebooks/rtf2xml/colors.py | 7 +++++-- 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/src/calibre/ebooks/metadata/sources/amazon.py b/src/calibre/ebooks/metadata/sources/amazon.py index c9c7350a74..6a1f151d62 100644 --- a/src/calibre/ebooks/metadata/sources/amazon.py +++ b/src/calibre/ebooks/metadata/sources/amazon.py @@ -284,6 +284,7 @@ class Amazon(Source): 'com': _('US'), 'fr' : _('France'), 'de' : _('Germany'), + 'uk' : _('UK'), } 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 asin = identifiers.get('amazon', None) if asin is None: @@ -344,6 +345,7 @@ class Amazon(Source): url = self.cached_identifier_to_cover_url(asin) return url + # }}} def identify(self, log, result_queue, abort, title=None, authors=None, # {{{ identifiers={}, timeout=30): @@ -442,8 +444,7 @@ class Amazon(Source): return None # }}} - -if __name__ == '__main__': +if __name__ == '__main__': # tests {{{ # To run these test use: calibre-debug -e # src/calibre/ebooks/metadata/sources/amazon.py from calibre.ebooks.metadata.sources.test import (test_identify_plugin, @@ -489,5 +490,5 @@ if __name__ == '__main__': ), ]) - +# }}} diff --git a/src/calibre/ebooks/rtf2xml/colors.py b/src/calibre/ebooks/rtf2xml/colors.py index e85b59571c..70c069eb80 100755 --- a/src/calibre/ebooks/rtf2xml/colors.py +++ b/src/calibre/ebooks/rtf2xml/colors.py @@ -245,8 +245,11 @@ class Colors: self.__token_info = line[:16] action = self.__state_dict.get(self.__state) if action is None: - sys.stderr.write('no matching state in module fonts.py\n') - sys.stderr.write(self.__state + '\n') + try: + sys.stderr.write('no matching state in module fonts.py\n') + sys.stderr.write(self.__state + '\n') + except: + pass action(line) copy_obj = copy.Copy(bug_handler = self.__bug_handler) if self.__copy: