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

Side by Side Diff: mojo/public/tools/prepend.py

Issue 1410053006: Move third_party/mojo/src/mojo/public to mojo/public (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: merge Created 5 years, 1 month 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 | « mojo/public/tools/gn/zip.py ('k') | mojo/runner/BUILD.gn » ('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/env python 1 #!/usr/bin/env python
2 # 2 #
3 # Copyright 2014 The Chromium Authors. All rights reserved. 3 # Copyright 2014 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 Prepends a given file with a given line. This can be used to add a shebang line 8 Prepends a given file with a given line. This can be used to add a shebang line
9 to a generated file. 9 to a generated file.
10 """ 10 """
(...skipping 17 matching lines...) Expand all
28 28
29 # Warning - this reads all of the input file into memory. 29 # Warning - this reads all of the input file into memory.
30 with open(output_path, 'w') as output_file: 30 with open(output_path, 'w') as output_file:
31 output_file.write(line + '\n') 31 output_file.write(line + '\n')
32 with open(input_path, 'r') as input_file: 32 with open(input_path, 'r') as input_file:
33 shutil.copyfileobj(input_file, output_file) 33 shutil.copyfileobj(input_file, output_file)
34 34
35 35
36 if __name__ == '__main__': 36 if __name__ == '__main__':
37 sys.exit(main()) 37 sys.exit(main())
OLDNEW
« no previous file with comments | « mojo/public/tools/gn/zip.py ('k') | mojo/runner/BUILD.gn » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698