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

Unified Diff: mojo/public/tools/bindings/mojom_bindings_generator.py

Issue 2888503002: Mojo bindings generator: introduce Stylizer to specify naming rules. (Closed)
Patch Set: Created 3 years, 7 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 side-by-side diff with in-line comments
Download patch
Index: mojo/public/tools/bindings/mojom_bindings_generator.py
diff --git a/mojo/public/tools/bindings/mojom_bindings_generator.py b/mojo/public/tools/bindings/mojom_bindings_generator.py
index c6f90a3cc240178d0d24f429ba0a8d2b8c6c8414..c8ffc6e168cbc9780dd6cbb81f2a82227fe556c6 100755
--- a/mojo/public/tools/bindings/mojom_bindings_generator.py
+++ b/mojo/public/tools/bindings/mojom_bindings_generator.py
@@ -175,7 +175,7 @@ class MojomProcessor(object):
return self._processed_files[rel_filename.path]
tree = self._parsed_files[rel_filename.path]
- dirname, name = os.path.split(rel_filename.path)
+ dirname = os.path.dirname(rel_filename.path)
# Process all our imports first and collect the module object for each.
# We use these to generate proper type info.
@@ -187,17 +187,15 @@ class MojomProcessor(object):
imports[parsed_imp.import_filename] = self._GenerateModule(
args, remaining_args, generator_modules, rel_import_file)
- module = translate.OrderedModule(tree, name, imports)
+ # Set the module path as relative to the source root.
+ # Normalize to unix-style path here to keep the generators simpler.
+ module_path = rel_filename.relative_path().replace('\\', '/')
+
+ module = translate.OrderedModule(tree, module_path, imports)
if args.scrambled_message_id_salt:
ScrambleMethodOrdinals(module.interfaces, args.scrambled_message_id_salt)
- # Set the path as relative to the source root.
- module.path = rel_filename.relative_path()
-
- # Normalize to unix-style path here to keep the generators simpler.
- module.path = module.path.replace('\\', '/')
-
if self._should_generate(rel_filename.path):
AddComputedData(module)
for language, generator_module in generator_modules.iteritems():

Powered by Google App Engine
This is Rietveld 408576698