def _parse()

in decisionai_plugin/common/util/configuration.py [0:0]


    def _parse(self, path):
        config = RawConfigParser()
        content = get_config_as_str(path)

        if path.endswith('.ini'):
            config.read_string(content)
            return config
        elif path.endswith('.properties'):
            config.read_string('[properties]\n' + content)
            return config['properties']
        elif path.endswith('.yaml'):
            buffer = StringIO(content)
            return YAML(typ='safe').load(buffer)
        else:
            raise Exception('Configure file type not supported: {}'.format(path))