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

Side by Side Diff: mojo/public/tools/dart_list_packages_contents.py

Issue 1132063007: Rationalize Dart mojo and sky package structure (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: Created 5 years, 7 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 | « mojo/public/tools/dart_list_mojoms.py ('k') | mojo/public/tools/dart_package.py » ('j') | 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/python 1 #!/usr/bin/python
2 # Copyright 2015 The Chromium Authors. All rights reserved. 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 3 # Use of this source code is governed by a BSD-style license that can be
4 # found in the LICENSE file. 4 # found in the LICENSE file.
5 5
6 """This script outputs the filenames of the files that are in the "packages/" 6 """This script outputs the filenames of the files that are in the "packages/"
7 subdir of the given directory, relative to that directory.""" 7 subdir of the given directory, relative to that directory."""
8 8
9 import argparse 9 import argparse
10 import os 10 import os
11 import sys 11 import sys
12 12
13 def main(target_directory): 13 def main(target_directory, package_name):
14 os.chdir(target_directory) 14 os.chdir(target_directory)
15 self_path = 'packages/' + package_name
15 for root, _, files in os.walk("packages", followlinks=True): 16 for root, _, files in os.walk("packages", followlinks=True):
16 for f in files: 17 for f in files:
17 print os.path.join(root, f) 18 path = os.path.join(root, f)
19 # Skip the contents of our own packages/package_name symlink.
20 if not path.startswith(self_path):
21 print os.path.join(root, f)
18 22
19 if __name__ == '__main__': 23 if __name__ == '__main__':
20 parser = argparse.ArgumentParser( 24 parser = argparse.ArgumentParser(
21 description="List filenames of files in the packages/ subdir of the " 25 description="List filenames of files in the packages/ subdir of the "
22 "given directory.") 26 "given directory.")
23 parser.add_argument("--target-directory", 27 parser.add_argument("--target-directory",
24 dest="target_directory", 28 dest="target_directory",
25 metavar="<target-directory>", 29 metavar="<target-directory>",
26 type=str, 30 type=str,
27 required=True, 31 required=True,
28 help="The target directory, specified relative to this " 32 help="The target directory, specified relative to this "
29 "directory.") 33 "directory.")
34 parser.add_argument("--package-name",
35 dest="package_name",
36 metavar="<package-name>",
37 type=str,
38 required=True,
39 help="The name of the package whose packages/ is being "
40 "dumped.")
30 args = parser.parse_args() 41 args = parser.parse_args()
31 sys.exit(main(args.target_directory)) 42 sys.exit(main(args.target_directory, args.package_name))
OLDNEW
« no previous file with comments | « mojo/public/tools/dart_list_mojoms.py ('k') | mojo/public/tools/dart_package.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698