From 8bcdacf1ce502e67f1373174bf50c894119ca6f9 Mon Sep 17 00:00:00 2001 From: Sengian Date: Sat, 12 May 2012 20:59:59 +0200 Subject: [PATCH] RTFInput: Problem with old RTF bracket addition --- src/calibre/ebooks/rtf2xml/add_brackets.py | 57 ++++++++++++++-------- 1 file changed, 37 insertions(+), 20 deletions(-) diff --git a/src/calibre/ebooks/rtf2xml/add_brackets.py b/src/calibre/ebooks/rtf2xml/add_brackets.py index bec3ce3abc..1f37772c8f 100755 --- a/src/calibre/ebooks/rtf2xml/add_brackets.py +++ b/src/calibre/ebooks/rtf2xml/add_brackets.py @@ -101,6 +101,14 @@ class AddBrackets: def __in_body_func(self, line): """ + Select what action to take in body: + 1-At the end of the file close the braket if a bracket was opened + This happens if there is achange + 2-If an open bracket is found the code inside is ignore + (written without modifications) + 3-If an accepted control word is found put the line + in a buffer then chage state to after cw + 4-Else simply write the line """ if line == 'cb 0: sys.stderr.write( 'Sorry, but this files has a mix of old and new RTF.\n' 'Some characteristics cannot be converted.\n') - os.remove(self.__write_to) + os.remove(self.__write_to) \ No newline at end of file