| OLD | NEW |
| 1 # Copyright 2016 The Chromium Authors. All rights reserved. | 1 # Copyright 2016 The Chromium Authors. All rights reserved. |
| 2 # Use of this source code is governed by a BSD-style license that can be | 2 # Use of this source code is governed by a BSD-style license that can be |
| 3 # found in the LICENSE file. | 3 # found in the LICENSE file. |
| 4 | 4 |
| 5 """Findit for crash (ClusterFuzz & Fracas/Chromecrash) configuration.""" | 5 """Findit for crash (ClusterFuzz & Fracas/Chromecrash) configuration.""" |
| 6 | 6 |
| 7 import re | 7 import re |
| 8 | 8 |
| 9 from google.appengine.ext import ndb | 9 from google.appengine.ext import ndb |
| 10 | 10 |
| 11 from crash.type_enums import CrashClient |
| 11 from model.versioned_config import VersionedConfig | 12 from model.versioned_config import VersionedConfig |
| 12 | 13 |
| 13 | 14 |
| 14 class CrashConfig(VersionedConfig): | 15 class CrashConfig(VersionedConfig): |
| 15 """Global configuration of settings for processing Chrome crashes.""" | 16 """Global configuration of settings for processing Chrome crashes.""" |
| 16 | 17 |
| 17 def __init__(self, *args, **kargs): | 18 def __init__(self, *args, **kargs): |
| 18 super(CrashConfig, self).__init__(*args, **kargs) | 19 super(CrashConfig, self).__init__(*args, **kargs) |
| 19 self.cached_component_classifier = None | 20 self.cached_component_classifier = None |
| 20 | 21 |
| (...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 97 [re.compile(path), | 98 [re.compile(path), |
| 98 re.compile(function) if function else None, | 99 re.compile(function) if function else None, |
| 99 component]) | 100 component]) |
| 100 | 101 |
| 101 self.cached_component_classifier = { | 102 self.cached_component_classifier = { |
| 102 'top_n': self.component_classifier['top_n'], | 103 'top_n': self.component_classifier['top_n'], |
| 103 'path_function_component': compiled_path_function_component | 104 'path_function_component': compiled_path_function_component |
| 104 } | 105 } |
| 105 | 106 |
| 106 return self.cached_component_classifier | 107 return self.cached_component_classifier |
| 108 |
| 109 def GetClientConfig(self, client_id): |
| 110 """Gets client specific config using client_id.""" |
| 111 if client_id == CrashClient.FRACAS: |
| 112 return self.fracas |
| 113 elif client_id == CrashClient.CRACAS: # pragma: no cover. |
| 114 # TODO(katesonia): Add crash config of cracas. |
| 115 return None |
| 116 elif client_id == CrashClient.CLUSTERFUZZ: # pragma: no cover. |
| 117 # TODO(katesonia): Add crash config of clusterfuzz. |
| 118 return None |
| 119 |
| 120 return None |
| OLD | NEW |