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

Side by Side Diff: pylib/gyp/generator/gypd.py

Issue 1454433002: Python 3 compatibility Base URL: https://chromium.googlesource.com/external/gyp.git@master
Patch Set: Rebase with master (4ec6c4e3a94bd04a6da2858163d40b2429b8aad1) Created 4 years, 8 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
OLDNEW
1 # Copyright (c) 2011 Google Inc. All rights reserved. 1 # Copyright (c) 2011 Google Inc. 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 """gypd output module 5 """gypd output module
6 6
7 This module produces gyp input as its output. Output files are given the 7 This module produces gyp input as its output. Output files are given the
8 .gypd extension to avoid overwriting the .gyp files that they are generated 8 .gypd extension to avoid overwriting the .gyp files that they are generated
9 from. Internal references to .gyp files (such as those found in 9 from. Internal references to .gyp files (such as those found in
10 "dependencies" sections) are not adjusted to point to .gypd files instead; 10 "dependencies" sections) are not adjusted to point to .gypd files instead;
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after
81 gyp.common.ParseQualifiedTarget(qualified_target)[0:2] 81 gyp.common.ParseQualifiedTarget(qualified_target)[0:2]
82 82
83 if input_file[-4:] != '.gyp': 83 if input_file[-4:] != '.gyp':
84 continue 84 continue
85 input_file_stem = input_file[:-4] 85 input_file_stem = input_file[:-4]
86 output_file = input_file_stem + params['options'].suffix + '.gypd' 86 output_file = input_file_stem + params['options'].suffix + '.gypd'
87 87
88 if not output_file in output_files: 88 if not output_file in output_files:
89 output_files[output_file] = input_file 89 output_files[output_file] = input_file
90 90
91 for output_file, input_file in output_files.iteritems(): 91 for output_file, input_file in output_files.items():
92 output = open(output_file, 'w') 92 output = open(output_file, 'w')
93 pprint.pprint(data[input_file], output) 93 pprint.pprint(data[input_file], output)
94 output.close() 94 output.close()
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698