mergebot.py 文件源码

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

项目:merge-bot 作者: jasonkuster 项目源码 文件源码
def parse_configs():
    """Parses config files out of config/ directory.

    Returns:
        Array of MergeBotConfig objects.
    """
    configs = []
    yaml.add_constructor(u'!MergeBotConfig', mergebotconfig_constructor)
    l.info('Parsing Config Files')
    for filename in glob.iglob('config/*.yaml'):
        with open(filename) as cfg:
            try:
                l.info('Opening {}'.format(filename))
                config = yaml.load(cfg)
                l.info('{} Successfully Read'.format(filename))
                configs.append(config)
            except yaml.YAMLError as exc:
                l.fatal(
                    'Error parsing file {filename}: {exc}. Please fix and try '
                    'again.'.format(filename=filename, exc=exc))
    return configs
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号