OLD | NEW |
1 #!/usr/bin/python | 1 #!/usr/bin/python |
2 # | 2 # |
3 # Copyright (c) 2011 The Chromium Authors. All rights reserved. | 3 # Copyright (c) 2011 The Chromium Authors. All rights reserved. |
4 # Use of this source code is governed by a BSD-style license that can be | 4 # Use of this source code is governed by a BSD-style license that can be |
5 # found in the LICENSE file. | 5 # found in the LICENSE file. |
6 | 6 |
7 """Nodes for PPAPI IDL AST""" | 7 """Nodes for PPAPI IDL AST""" |
8 | 8 |
9 # | 9 # |
10 # IDL Node | 10 # IDL Node |
(...skipping 196 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
207 def IsRelease(self, release): | 207 def IsRelease(self, release): |
208 label = self.GetLabel() | 208 label = self.GetLabel() |
209 # Assume object is always available if there is no Label | 209 # Assume object is always available if there is no Label |
210 if not label: | 210 if not label: |
211 return True | 211 return True |
212 | 212 |
213 version = label.GetVersion(release) | 213 version = label.GetVersion(release) |
214 out = self.IsVersion(version) | 214 out = self.IsVersion(version) |
215 return out | 215 return out |
216 | 216 |
| 217 def InReleases(self, releases): |
| 218 for rel in releases: |
| 219 if self.IsRelease(rel): return True |
| 220 return False |
| 221 |
217 def GetLabel(self): | 222 def GetLabel(self): |
218 label = self.GetProperty('LABEL') | 223 label = self.GetProperty('LABEL') |
219 if not label: | 224 if not label: |
220 self.Error('No label availible.') | 225 self.Error('No label availible.') |
221 return None | 226 return None |
222 return label | 227 return label |
223 | 228 |
224 def GetType(self, release): | 229 def GetType(self, release): |
225 label = self.GetLabel() | 230 label = self.GetLabel() |
226 if not label: return None | 231 if not label: return None |
(...skipping 127 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
354 errors += ChildTest() | 359 errors += ChildTest() |
355 | 360 |
356 if errors: | 361 if errors: |
357 ErrOut.Log('IDLNode failed with %d errors.' % errors) | 362 ErrOut.Log('IDLNode failed with %d errors.' % errors) |
358 return -1 | 363 return -1 |
359 return 0 | 364 return 0 |
360 | 365 |
361 if __name__ == '__main__': | 366 if __name__ == '__main__': |
362 sys.exit(Main()) | 367 sys.exit(Main()) |
363 | 368 |
OLD | NEW |