blob: 7393746fcb04b6aedc9f2997b464e439c46800e0 [file] [log] [blame]
# coding=utf8
# Copyright (c) 2011 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Ignores issues not using the right project base url regex."""
import logging
import os
import re
import find_depot_tools # pylint: disable=W0611
import breakpad
from verification import base
class ProjectBaseUrlVerifier(base.Verifier):
"""Needs the project base url to match at least one regexp in self.regex."""
name = 'project_bases'
def __init__(self, project_bases):
super(ProjectBaseUrlVerifier, self).__init__()
self.project_bases = project_bases
def verify(self, pending):
matches = filter(
None, (re.match(r, pending.base_url) for r in self.project_bases))
if not matches:'%s not in whitelist' % pending.base_url)
state = base.IGNORED
if len(matches) != 1:
Exception('pending.base_url triggered multiple matches'), '')
match = matches[0]
if match.lastindex:
pending.relpath ='/').replace(
'/', os.sep)
state = base.SUCCEEDED
pending.verifications[] = base.SimpleStatus(state)
def update_status(self, queue):