Logo Search packages:      
Sourcecode: calibre version File versions  Download package

def calibre::ebooks::rtf2xml::paragraphs::Paragraphs::make_paragraphs (   self  ) 

Requires:
    nothing
Returns:
    nothing (changes the original file)
Logic:
    Read one line in at a time. Determine what action to take based on
    the state. If the state is before the body, look for the
    beginning of the body.
    When the body is found, change the state to 'not_paragraph'. The
    only other state is 'paragraph'.

Definition at line 221 of file paragraphs.py.

00221                              :
        """
        Requires:
            nothing
        Returns:
            nothing (changes the original file)
        Logic:
            Read one line in at a time. Determine what action to take based on
            the state. If the state is before the body, look for the
            beginning of the body.
            When the body is found, change the state to 'not_paragraph'. The
            only other state is 'paragraph'.
        """
        self.__initiate_values()
        read_obj = open(self.__file, 'r')
        self.__write_obj = open(self.__write_to, 'w')
        line_to_read = 1
        while line_to_read:
            line_to_read = read_obj.readline()
            line = line_to_read
            self.__token_info = line[:16]
            action = self.__state_dict.get(self.__state)
            if action == None:
                sys.stderr.write('no no matching state in module sections.py\n')
                sys.stderr.write(self.__state + '\n')
            action(line)
        read_obj.close()
        self.__write_obj.close()
        copy_obj = copy.Copy(bug_handler = self.__bug_handler)
        if self.__copy:
            copy_obj.copy_file(self.__write_to, "paragraphs.data")
        copy_obj.rename(self.__write_to, self.__file)
        os.remove(self.__write_to)
        os.remove(self.__write_to)


Generated by  Doxygen 1.6.0   Back to index