rules.py 文件源码

python
阅读 25 收藏 0 点赞 0 评论 0

项目:klaxer 作者: klaxer 项目源码 文件源码
def __init__(self):
        self._classification_rules = {}
        self._exclusion_rules = {}
        self._enrichment_rules = {}
        self._routing_rules = {}
        self._config = None

        try:
            # TODO: Absolute path? Where should this live?
            with open('config/klaxer.yml', 'r') as ymlfile:
                self._config = yaml.load(ymlfile)
        except yaml.YAMLError as ye:
            raise ConfigurationError('failed to parse config') from ye

        for section in self._config:
            # Subsequent definitions of the same service will overwrite the
            # previous ones.
            self._build_rules(section)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号