From 3356fe6a8b51eb9df2f235f2399e313d18e8fb43 Mon Sep 17 00:00:00 2001 From: Sengian Date: Sat, 8 Jan 2011 08:35:59 +0100 Subject: [PATCH] cleaning RTF footnote --- src/calibre/ebooks/rtf2xml/footnote.py | 84 ++++++++++++++------------ 1 file changed, 47 insertions(+), 37 deletions(-) diff --git a/src/calibre/ebooks/rtf2xml/footnote.py b/src/calibre/ebooks/rtf2xml/footnote.py index a596ca73f6..0027348cde 100755 --- a/src/calibre/ebooks/rtf2xml/footnote.py +++ b/src/calibre/ebooks/rtf2xml/footnote.py @@ -16,7 +16,9 @@ # # ######################################################################### import os, tempfile + from calibre.ebooks.rtf2xml import copy + class Footnote: """ Two public methods are available. The first separates all of the @@ -35,6 +37,7 @@ class Footnote: self.__copy = copy self.__write_to = tempfile.mktemp() self.__found_a_footnote = 0 + def __first_line_func(self, line): """ Print the tag info for footnotes. Check whether footnote is an @@ -47,6 +50,7 @@ class Footnote: self.__write_to_foot_obj.write( 'mi%s\n' % self.__footnote_count) self.__first_line = 0 + def __in_footnote_func(self, line): """Handle all tokens that are part of footnote""" if self.__first_line: @@ -68,6 +72,7 @@ class Footnote: 'mi