suppress.py 文件源码

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

项目:nojs 作者: chrisdickinson 项目源码 文件源码
def _ParseConfigFile(config_path):
  print 'Parsing %s' % config_path
  issues_dict = {}
  dom = minidom.parse(config_path)
  for issue in dom.getElementsByTagName('issue'):
    issue_id = issue.attributes['id'].value
    severity = issue.getAttribute('severity')

    path_elements = (
        p.attributes.get('path')
        for p in issue.getElementsByTagName('ignore'))
    paths = set(p.value for p in path_elements if p)

    regexp_elements = (
        p.attributes.get('regexp')
        for p in issue.getElementsByTagName('ignore'))
    regexps = set(r.value for r in regexp_elements if r)

    issues_dict[issue_id] = _Issue(severity, paths, regexps)
  return issues_dict
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号