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

Side by Side Diff: gyp/find.py

Issue 2253373002: Add executable bit and shebang to python files (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 4 years, 4 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 | « gn/gypi_to_gn.py ('k') | 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/env python
2 #
1 # Copyright 2015 Google Inc. 3 # Copyright 2015 Google Inc.
2 # 4 #
3 # Use of this source code is governed by a BSD-style license that can be 5 # Use of this source code is governed by a BSD-style license that can be
4 # found in the LICENSE file. 6 # found in the LICENSE file.
5 7
6 ''' 8 '''
7 find.py is a poor-man's emulation of `find -name=$1 $2` on Unix. 9 find.py is a poor-man's emulation of `find -name=$1 $2` on Unix.
8 10
9 Call python find.py <glob> <directory>... to list all files matching glob under 11 Call python find.py <glob> <directory>... to list all files matching glob under
10 directory (recursively). E.g. 12 directory (recursively). E.g.
11 $ python find.py '*.cpp' ../tests/ ../bench/ 13 $ python find.py '*.cpp' ../tests/ ../bench/
12 will print all .cpp files under ../tests/ and ../bench/. 14 will print all .cpp files under ../tests/ and ../bench/.
13 ''' 15 '''
14 16
15 import fnmatch 17 import fnmatch
16 import os 18 import os
17 import sys 19 import sys
18 20
19 for directory in sys.argv[2:]: 21 for directory in sys.argv[2:]:
20 for d, kids, files in os.walk(directory): 22 for d, kids, files in os.walk(directory):
21 files.sort() 23 files.sort()
22 for f in files: 24 for f in files:
23 if fnmatch.fnmatch(f, sys.argv[1]): 25 if fnmatch.fnmatch(f, sys.argv[1]):
24 print os.path.join(d, f).replace('\\', '/') # Gyp wants Unix paths. 26 print os.path.join(d, f).replace('\\', '/') # Gyp wants Unix paths.
OLDNEW
« no previous file with comments | « gn/gypi_to_gn.py ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698