| Index: tools/list_files.py
|
| diff --git a/tools/list_files.py b/tools/list_files.py
|
| index e94443bb59f3b548f921f23c6af4254f0ae5eea3..ba46fd989bd0a78efb94a9eec7817e9edb997967 100644
|
| --- a/tools/list_files.py
|
| +++ b/tools/list_files.py
|
| @@ -13,10 +13,10 @@ import os
|
| import re
|
| import sys
|
|
|
| -
|
| -def main(argv):
|
| - pattern = re.compile(argv[1])
|
| - for directory in argv[2:]:
|
| +def list_files(pattern_str, search_directories):
|
| + pattern = re.compile(pattern_str)
|
| + found_files = []
|
| + for directory in search_directories:
|
| for root, directories, files in os.walk(directory):
|
| if '.svn' in directories:
|
| directories.remove('.svn')
|
| @@ -24,8 +24,14 @@ def main(argv):
|
| fullname = os.path.relpath(os.path.join(root, filename))
|
| fullname = fullname.replace(os.sep, '/')
|
| if re.search(pattern, fullname):
|
| - print fullname
|
| + found_files.append(fullname)
|
| + return found_files
|
|
|
| +def main(argv):
|
| + pattern_str = argv[1]
|
| + directories = argv[2:]
|
| + for filename in list_files(pattern_str, directories):
|
| + print filename
|
|
|
| if __name__ == '__main__':
|
| sys.exit(main(sys.argv))
|
|
|