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

Side by Side Diff: mojo/nacl/generator/generate_nacl_bindings.py

Issue 813483005: Prepend jinja2 path for hermeticity. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: merge Created 5 years, 9 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
« no previous file with comments | « no previous file | no next file » | 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 # Copyright 2014 The Chromium Authors. All rights reserved. 2 # Copyright 2014 The Chromium Authors. All rights reserved.
3 # Use of this source code is governed by a BSD-style license that can be 3 # Use of this source code is governed by a BSD-style license that can be
4 # found in the LICENSE file. 4 # found in the LICENSE file.
5 5
6 # pylint: disable=W0104,W0106,F0401,R0201 6 # pylint: disable=W0104,W0106,F0401,R0201
7 7
8 import errno 8 import errno
9 import optparse 9 import optparse
10 import os.path 10 import os.path
(...skipping 11 matching lines...) Expand all
22 also be "above" this file).""" 22 also be "above" this file)."""
23 path = _ScriptDir() 23 path = _ScriptDir()
24 while True: 24 while True:
25 path, tail = os.path.split(path) 25 path, tail = os.path.split(path)
26 assert tail 26 assert tail
27 if tail == dirname: 27 if tail == dirname:
28 return path 28 return path
29 29
30 30
31 def _AddThirdPartyImportPath(): 31 def _AddThirdPartyImportPath():
32 sys.path.append(os.path.join(_GetDirAbove('mojo'), 'third_party')) 32 sys.path.insert(0, os.path.join(_GetDirAbove('mojo'), 'third_party'))
33 33
34 34
35 _AddThirdPartyImportPath() 35 _AddThirdPartyImportPath()
36 import jinja2 36 import jinja2
37 37
38 loader = jinja2.FileSystemLoader(_ScriptDir()) 38 loader = jinja2.FileSystemLoader(_ScriptDir())
39 jinja_env = jinja2.Environment(loader=loader, keep_trailing_newline=True) 39 jinja_env = jinja2.Environment(loader=loader, keep_trailing_newline=True)
40 40
41 41
42 # Accumulate lines of code with varying levels of indentation. 42 # Accumulate lines of code with varying levels of indentation.
(...skipping 455 matching lines...) Expand 10 before | Expand all | Expand 10 after
498 GenerateMojoSyscall(mojo.functions, out) 498 GenerateMojoSyscall(mojo.functions, out)
499 499
500 out = OutFile(options.out_dir, 'mojo_irt.h') 500 out = OutFile(options.out_dir, 'mojo_irt.h')
501 GenerateMojoIrtHeader(mojo.functions, out) 501 GenerateMojoIrtHeader(mojo.functions, out)
502 502
503 out = OutFile(options.out_dir, 'mojo_irt.c') 503 out = OutFile(options.out_dir, 'mojo_irt.c')
504 GenerateMojoIrtImplementation(mojo.functions, out) 504 GenerateMojoIrtImplementation(mojo.functions, out)
505 505
506 if __name__ == '__main__': 506 if __name__ == '__main__':
507 main(sys.argv[1:]) 507 main(sys.argv[1:])
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698