'Private method for joining headers and footers to body. This method
reads from the temporary file until the proper footnote marker is
found. It collects all the tokens until the end of the footnote, and
returns them as a string.'

def __get_head_from_temp(self, num):

    look_for = (('mi<mk<header-ope<' + num) + '\n')
    found_head = False
    string_to_return = ''
    for line in self.__read_from_head_obj:
        if found_head:
            if (line == 'mi<mk<header-clo\n'):
                return string_to_return
            string_to_return += line
        elif (line == look_for):
            found_head = True
