suppress.py 文件源码

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

项目:nojs 作者: chrisdickinson 项目源码 文件源码
def _ParseAndMergeResultFile(result_path, issues_dict):
  print 'Parsing and merging %s' % result_path
  dom = minidom.parse(result_path)
  for issue in dom.getElementsByTagName('issue'):
    issue_id = issue.attributes['id'].value
    severity = issue.attributes['severity'].value
    path = issue.getElementsByTagName('location')[0].attributes['file'].value
    # Strip temporary file path.
    path = re.sub(_TMP_DIR_RE, '', path)
    # Escape Java inner class name separator and suppress with regex instead
    # of path. Doesn't use re.escape() as it is a bit too aggressive and
    # escapes '_', causing trouble with PRODUCT_DIR.
    regexp = path.replace('$', r'\$')
    if issue_id not in issues_dict:
      issues_dict[issue_id] = _Issue(severity, set(), set())
    issues_dict[issue_id].regexps.add(regexp)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号