Parse and store the config comments and create maps for dot notion lookup

def _parse_extra(self, fp):
        """ Parse and store the config comments and create maps for dot notion lookup """

        comment = ''
        section = ''

        fp.seek(0)
        for line in fp:
            line = line.rstrip()

            if not line:
                if comment:
                    comment += '\n'
                continue

            if line.startswith('#'):  # Comment
                comment += line + '\n'
                continue

            if line.startswith('['):  # Section
                section = line.strip('[]')
                self._add_dot_key(section)
                if comment:
                    self._comments[section] = comment.rstrip()

            elif CONFIG_KEY_RE.match(line):  # Config
                key = line.split('=', 1)[0].strip()
                self._add_dot_key(section, key)
                if comment:
                    self._comments[(section, key)] = comment.rstrip()

            comment = ''

        if comment:
            self._comments[self.LAST_COMMENT_KEY] = comment