'Generate key-to-(start, stop) table of contents.'

def _generate_toc(self):

    (starts, stops) = ([], [])
    self._file.seek(0)
    while True:
        line_pos = self._file.tell()
        line = self._file.readline()
        if line.startswith('From    '):
            if (len(stops) < len(starts)):
                stops.append((line_pos - len(os.linesep)))
            starts.append(line_pos)
        elif (line == ''):
            stops.append(line_pos)
            break
    self._toc = dict(enumerate(zip(starts, stops)))
    self._next_key = len(self._toc)
    self._file_length = self._file.tell()
