Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 #!/usr/bin/python | |
|
tonyg
2015/04/09 12:55:57
bikeshed: /me wonders whether we should have a moj
blundell
2015/04/09 15:34:36
Let's see if we come up with any more ;).
| |
| 2 # Copyright 2015 The Chromium Authors. All rights reserved. | |
| 3 # Use of this source code is governed by a BSD-style license that can be | |
| 4 # found in the LICENSE file. | |
| 5 | |
| 6 """This script outputs the filenames of the files that are in the "packages/" | |
| 7 subdir of the given directory, relative to that directory.""" | |
| 8 | |
| 9 import argparse | |
| 10 import os | |
| 11 import sys | |
| 12 | |
| 13 def main(target_directory): | |
| 14 os.chdir(target_directory) | |
| 15 for root, _, files in os.walk("packages", followlinks=True): | |
| 16 for f in files: | |
| 17 print os.path.join(root, f) | |
| 18 | |
| 19 if __name__ == '__main__': | |
| 20 parser = argparse.ArgumentParser( | |
| 21 description="List filenames of files in the packages/ subdir of the " | |
| 22 "given directory.") | |
| 23 parser.add_argument("--target-directory", | |
| 24 dest="target_directory", | |
| 25 metavar="<target-directory>", | |
| 26 type=str, | |
| 27 required=True, | |
| 28 help="The target directory, specified relative to this " | |
| 29 "directory.") | |
| 30 args = parser.parse_args() | |
| 31 sys.exit(main(args.target_directory)) | |
| OLD | NEW |