Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(134)

Side by Side Diff: ppapi/generators/idl_namespace.py

Issue 7715036: More multi-version support (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 9 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « ppapi/generators/idl_generator.py ('k') | ppapi/generators/idl_node.py » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 """ 7 """
8 IDLNamespace for PPAPI 8 IDLNamespace for PPAPI
9 9
10 This file defines the behavior of the AST namespace which allows for resolving 10 This file defines the behavior of the AST namespace which allows for resolving
(...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after
98 # IDLVersionMap 98 # IDLVersionMap
99 # 99 #
100 # A version map, can map from an float interface version, to a global 100 # A version map, can map from an float interface version, to a global
101 # release string. 101 # release string.
102 # 102 #
103 class IDLVersionMap(object): 103 class IDLVersionMap(object):
104 def __init__(self): 104 def __init__(self):
105 self.version_to_release = {} 105 self.version_to_release = {}
106 self.release_to_version = {} 106 self.release_to_version = {}
107 self.versions = [] 107 self.versions = []
108 self.releases = []
108 109
109 def AddReleaseVersionMapping(self, release, version): 110 def AddReleaseVersionMapping(self, release, version):
110 self.version_to_release[version] = release 111 self.version_to_release[version] = release
111 self.release_to_version[release] = version 112 self.release_to_version[release] = version
112 self.versions = sorted(self.version_to_release.keys()) 113 self.versions = sorted(self.version_to_release.keys())
114 self.releases = sorted(self.release_to_version.keys())
113 115
114 def GetRelease(self, version): 116 def GetRelease(self, version):
115 # Check for exact match 117 # Check for exact match
116 if version in self.versions: 118 if version in self.versions:
117 return self.version_to_release[version] 119 return self.version_to_release[version]
118 120
119 def GetVersion(self, release): 121 def GetVersion(self, release):
120 return self.release_to_version[release] 122 return self.release_to_version[release]
121 123
122 124
(...skipping 216 matching lines...) Expand 10 before | Expand all | Expand 10 after
339 341
340 if errors: 342 if errors:
341 print 'Test failed with %d errors.' % errors 343 print 'Test failed with %d errors.' % errors
342 else: 344 else:
343 print 'Passed.' 345 print 'Passed.'
344 return errors 346 return errors
345 347
346 if __name__ == '__main__': 348 if __name__ == '__main__':
347 sys.exit(Main(sys.argv[1:])) 349 sys.exit(Main(sys.argv[1:]))
348 350
OLDNEW
« no previous file with comments | « ppapi/generators/idl_generator.py ('k') | ppapi/generators/idl_node.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698