Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 # Copyright 2013 The Chromium Authors. All rights reserved. | 1 # Copyright 2013 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 import posixpath | 5 import posixpath |
| 6 | 6 |
| 7 from compiled_file_system import Cache, SingleFile, Unicode | 7 from compiled_file_system import Cache, SingleFile, Unicode |
| 8 from extensions_paths import API_PATHS | 8 from extensions_paths import API_PATHS |
| 9 from features_bundle import HasParent, GetParentName | 9 from features_bundle import HasParent, GetParentName |
| 10 from file_system import FileNotFoundError | 10 from file_system import FileNotFoundError |
| (...skipping 24 matching lines...) Expand all Loading... | |
| 35 self.name = name | 35 self.name = name |
| 36 self.restrictedTo = None | 36 self.restrictedTo = None |
| 37 | 37 |
| 38 def __eq__(self, o): | 38 def __eq__(self, o): |
| 39 return self.name == o.name and self.restrictedTo == o.restrictedTo | 39 return self.name == o.name and self.restrictedTo == o.restrictedTo |
| 40 | 40 |
| 41 def __ne__(self, o): | 41 def __ne__(self, o): |
| 42 return not (self == o) | 42 return not (self == o) |
| 43 | 43 |
| 44 def __repr__(self): | 44 def __repr__(self): |
| 45 return '<ContentScriptAPI name=%s, restrictedTo=%s>' % (name, restrictedTo) | 45 return ('<ContentScriptAPI name=%s, restrictedTo=%s>' % |
| 46 (self.name, self.restrictedTo)) | |
|
Ken Rockot(use gerrit already)
2015/05/26 00:26:23
This is just a drive-by bugfix caught while hackin
| |
| 46 | 47 |
| 47 def __str__(self): | 48 def __str__(self): |
| 48 return repr(self) | 49 return repr(self) |
| 49 | 50 |
| 50 | 51 |
| 51 class APIModels(object): | 52 class APIModels(object): |
| 52 '''Tracks APIs and their Models. | 53 '''Tracks APIs and their Models. |
| 53 ''' | 54 ''' |
| 54 | 55 |
| 55 def __init__(self, | 56 def __init__(self, |
| (...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 177 | 178 |
| 178 def IterModels(self): | 179 def IterModels(self): |
| 179 future_models = [(name, self.GetModel(name)) for name in self.GetNames()] | 180 future_models = [(name, self.GetModel(name)) for name in self.GetNames()] |
| 180 for name, future_model in future_models: | 181 for name, future_model in future_models: |
| 181 try: | 182 try: |
| 182 model = future_model.Get() | 183 model = future_model.Get() |
| 183 except FileNotFoundError: | 184 except FileNotFoundError: |
| 184 continue | 185 continue |
| 185 if model: | 186 if model: |
| 186 yield name, model | 187 yield name, model |
| OLD | NEW |