From 05a90f1bcb5139c7a331a93c323feb8122921dd5 Mon Sep 17 00:00:00 2001 From: Sengian Date: Tue, 25 Jan 2011 00:48:32 +0100 Subject: [PATCH] ... --- src/calibre/ebooks/rtf2xml/get_char_map.py | 3 --- src/calibre/ebooks/rtf2xml/hex_2_utf8.py | 1 - src/calibre/ebooks/rtf2xml/process_tokens.py | 4 ++-- 3 files changed, 2 insertions(+), 6 deletions(-) diff --git a/src/calibre/ebooks/rtf2xml/get_char_map.py b/src/calibre/ebooks/rtf2xml/get_char_map.py index fb3ef28b4f..cb118b0df8 100755 --- a/src/calibre/ebooks/rtf2xml/get_char_map.py +++ b/src/calibre/ebooks/rtf2xml/get_char_map.py @@ -30,8 +30,6 @@ class GetCharMap: 'char_file'--the file with the mappings - - Returns: nothing @@ -62,7 +60,6 @@ class GetCharMap: fields[1].replace('\\colon', ':') map_dict[fields[1]] = fields[3] - if not found_map: msg = 'no map found\nmap is "%s"\n'%(map,) raise self.__bug_handler, msg diff --git a/src/calibre/ebooks/rtf2xml/hex_2_utf8.py b/src/calibre/ebooks/rtf2xml/hex_2_utf8.py index 38f21fd10b..7b8e148661 100755 --- a/src/calibre/ebooks/rtf2xml/hex_2_utf8.py +++ b/src/calibre/ebooks/rtf2xml/hex_2_utf8.py @@ -155,7 +155,6 @@ class Hex2Utf8: char_file = self.__char_file, bug_handler = self.__bug_handler, ) - print self.__default_char_map up_128_dict = char_map_obj.get_char_map(map=self.__default_char_map) bt_128_dict = char_map_obj.get_char_map(map = 'bottom_128') ms_standard_dict = char_map_obj.get_char_map(map = 'ms_standard') diff --git a/src/calibre/ebooks/rtf2xml/process_tokens.py b/src/calibre/ebooks/rtf2xml/process_tokens.py index 56e61d2b60..1edf69b32d 100755 --- a/src/calibre/ebooks/rtf2xml/process_tokens.py +++ b/src/calibre/ebooks/rtf2xml/process_tokens.py @@ -757,7 +757,7 @@ class ProcessTokens: def process_cw(self, token): """Change the value of the control word by determining what dictionary it belongs to""" - special = [ '*', ':', '}', '{', '~', '_', '-', ';' ] + special = [ '*', ':', '}', '{', '~', '_', '-', ';' ] ##if token != "{" or token != "}": token = token[1:] # strip off leading \ token = token.replace(" ", "") @@ -793,7 +793,7 @@ class ProcessTokens: raise self.__exception_handler, msg the_index = token.find('\\ ') - if token is not None and the_index > -1: + if token is not None and the_index > -1: msg = 'Invalid RTF: token "\\ " not valid.\n' raise self.__exception_handler, msg elif token[:1] == "\\":