OLD | NEW |
---|---|
1 # Copyright (c) 2012 Google Inc. All rights reserved. | 1 # Copyright (c) 2012 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 from __future__ import with_statement | 5 from __future__ import with_statement |
6 | 6 |
7 import errno | 7 import errno |
8 import filecmp | 8 import filecmp |
9 import os.path | 9 import os.path |
10 import re | 10 import re |
(...skipping 343 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
354 'darwin': 'mac', | 354 'darwin': 'mac', |
355 'sunos5': 'solaris', | 355 'sunos5': 'solaris', |
356 'freebsd7': 'freebsd', | 356 'freebsd7': 'freebsd', |
357 'freebsd8': 'freebsd', | 357 'freebsd8': 'freebsd', |
358 } | 358 } |
359 flavor = flavors.get(sys.platform, 'linux') | 359 flavor = flavors.get(sys.platform, 'linux') |
360 return params.get('flavor', flavor) | 360 return params.get('flavor', flavor) |
361 | 361 |
362 | 362 |
363 def CopyTool(flavor, out_path): | 363 def CopyTool(flavor, out_path): |
364 """Finds (mac|sun)_tool.gyp in the gyp directory and copies it | 364 """Finds (mac|sun|win)_tool.gyp in the gyp directory and copies it |
365 to |out_path|.""" | 365 to |out_path|.""" |
366 prefix = { 'solaris': 'sun', 'mac': 'mac' }.get(flavor, None) | 366 prefix = { 'solaris': 'sun', 'mac': 'mac', 'win': 'win' }.get(flavor, None) |
Nico
2012/02/27 16:23:30
likewise
scottmg
2012/02/28 00:01:13
Done.
| |
367 if not prefix: | 367 if not prefix: |
368 return | 368 return |
369 | 369 |
370 # Slurp input file. | 370 # Slurp input file. |
371 source_path = os.path.join( | 371 source_path = os.path.join( |
372 os.path.dirname(os.path.abspath(__file__)), '%s_tool.py' % prefix) | 372 os.path.dirname(os.path.abspath(__file__)), '%s_tool.py' % prefix) |
373 with open(source_path) as source_file: | 373 with open(source_path) as source_file: |
374 source = source_file.readlines() | 374 source = source_file.readlines() |
375 | 375 |
376 # Add header and write it out. | 376 # Add header and write it out. |
(...skipping 16 matching lines...) Expand all Loading... | |
393 if idfun is None: | 393 if idfun is None: |
394 def idfun(x): return x | 394 def idfun(x): return x |
395 seen = {} | 395 seen = {} |
396 result = [] | 396 result = [] |
397 for item in seq: | 397 for item in seq: |
398 marker = idfun(item) | 398 marker = idfun(item) |
399 if marker in seen: continue | 399 if marker in seen: continue |
400 seen[marker] = 1 | 400 seen[marker] = 1 |
401 result.append(item) | 401 result.append(item) |
402 return result | 402 return result |
OLD | NEW |