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

Unified Diff: tools/json_schema_compiler/js_externs_generator.py

Issue 2915423002: Externs generation: spit out src/-normalized path in generation messages (Closed)
Patch Set: path comments 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
« no previous file with comments | « no previous file | tools/json_schema_compiler/js_externs_generator_test.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/json_schema_compiler/js_externs_generator.py
diff --git a/tools/json_schema_compiler/js_externs_generator.py b/tools/json_schema_compiler/js_externs_generator.py
index a5ef075ac260f574782cf4d06f974e3e662c0e79..d0011e079a2e54e9069c7d0473a626b20b86a1ae 100644
--- a/tools/json_schema_compiler/js_externs_generator.py
+++ b/tools/json_schema_compiler/js_externs_generator.py
@@ -37,7 +37,15 @@ class _Generator(object):
"""Generates a Code object with the schema for the entire namespace.
"""
c = Code()
- (c.Append(self._GetHeader(sys.argv[0], self._namespace.name))
+ # /abs/path/src/tools/json_schema_compiler/
+ script_dir = os.path.dirname(os.path.abspath(__file__))
+ # /abs/path/src/
+ src_root = os.path.normpath(os.path.join(script_dir, '..', '..'))
+ # tools/json_schema_compiler/
+ src_to_script = os.path.relpath(script_dir, src_root)
+ # tools/json_schema_compiler/compiler.py
+ compiler_path = os.path.join(src_to_script, 'compiler.py')
+ (c.Append(self._GetHeader(compiler_path, self._namespace.name))
.Append())
self._AppendNamespaceObject(c)
« no previous file with comments | « no previous file | tools/json_schema_compiler/js_externs_generator_test.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698