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

Side by Side Diff: mojo/public/tools/bindings/pylib/mojom/generate/module.py

Issue 443293003: Mojo: Add PRESUBMIT.py to mojo/. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 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
OLDNEW
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 # This module's classes provide an interface to mojo modules. Modules are 5 # This module's classes provide an interface to mojo modules. Modules are
6 # collections of interfaces and structs to be used by mojo ipc clients and 6 # collections of interfaces and structs to be used by mojo ipc clients and
7 # servers. 7 # servers.
8 # 8 #
9 # A simple interface would be created this way: 9 # A simple interface would be created this way:
10 # module = mojom.generate.module.Module('Foo') 10 # module = mojom.generate.module.Module('Foo')
(...skipping 202 matching lines...) Expand 10 before | Expand all | Expand 10 after
213 213
214 class Module(object): 214 class Module(object):
215 def __init__(self, name=None, namespace=None): 215 def __init__(self, name=None, namespace=None):
216 self.name = name 216 self.name = name
217 self.path = name 217 self.path = name
218 self.namespace = namespace 218 self.namespace = namespace
219 self.structs = [] 219 self.structs = []
220 self.interfaces = [] 220 self.interfaces = []
221 221
222 def AddInterface(self, name): 222 def AddInterface(self, name):
223 interface=Interface(name, module=self); 223 self.interfaces.append(Interface(name, module=self))
224 self.interfaces.append(interface)
225 return interface 224 return interface
226 225
227 def AddStruct(self, name): 226 def AddStruct(self, name):
228 struct=Struct(name, module=self) 227 struct=Struct(name, module=self)
229 self.structs.append(struct) 228 self.structs.append(struct)
230 return struct 229 return struct
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698