def read_conf(self):
        retval = {}

        for _afile in self.source_file():
            res = ConfigFile(_afile).read()

            orders    = []
            for _aline in res:
                _aline = _aline.rstrip('\r\n')

                regex_str = "^(?P<comment>%s)?[ \t]*(?P<key>[^%s ]+)[ \t]*%s *(?P<value>.*)$" % (self._comment,self._delim,self._delim,)
                regex = re.compile(r"%s" % regex_str)

                m = regex.match(_aline)
                if m:
                    comment = m.group('comment')
                    key     = m.group('key')
                    value   = m.group('value')
                    if not value.rfind(self._comment) == -1:
                        value = value[:value.rfind(self._comment)]

                    if self._multidefine and self.dop.isset(self._module,[_afile,key]) is True:
                        new_value = self.dop.get(self._module,[_afile,key])
                        if type(new_value) == str:
                            new_value = [new_value]
                        if not value in new_value:
                            new_value.append(value)
                    else:
                        new_value = value
                    self.dop.set(self._module,[_afile,key],new_value)
                    if not key in orders:
                        orders.append(key)

                    if comment is not None:
                        self.dop.comment(self._module,[_afile,key])

            orders_key = "%sORDERS" % (self._reserved_key_prefix,)
            self.dop.set(self._module,[_afile,orders_key],orders)

        #self.dop.preprint_r(self._module)
        return self.dop.getconf(self._module)
dataset/ETHPy150Open karesansui/karesansui/karesansui/lib/parser/base/sh_conf_parser.py/shConfParser.read_conf/original