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

Side by Side Diff: tools/list_pkg_directories.py

Issue 2346163005: Remove package root target and support scripts (Closed)
Patch Set: Created 4 years, 3 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 | « tools/dartium/build.py ('k') | tools/make_links.py » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 #!/usr/bin/env python
2 # Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
3 # for details. All rights reserved. Use of this source code is governed by a
4 # BSD-style license that can be found in the LICENSE file.
5
6 """Tool for listing the directories under pkg, with their lib directories.
7 Used in pkg.gyp. Lists all of the directories in the directory passed in as an
8 argument to this script which have a lib subdirectory.
9
10 Usage:
11 python tools/list_pkg_directories.py OPTIONS DIRECTORY
12 """
13
14 import optparse
15 import os
16 import sys
17
18 def get_options():
19 result = optparse.OptionParser()
20 result.add_option("--exclude",
21 help='A comma-separated list of directory names to exclude.')
22 return result.parse_args()
23
24 def main(argv):
25 (options, args) = get_options()
26 directory = args[0]
27 exclude = options.exclude.split(',') if options.exclude else []
28
29 paths = [
30 path + '/lib' for path in os.listdir(directory)
31 if path not in exclude and os.path.isdir(os.path.join(directory, path))
32 ]
33
34 for lib in filter(lambda x: os.path.exists(os.path.join(directory, x)),
35 paths):
36 print '%s/%s' % (directory, lib)
37
38 if __name__ == '__main__':
39 sys.exit(main(sys.argv))
OLDNEW
« no previous file with comments | « tools/dartium/build.py ('k') | tools/make_links.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698