f19afa5cbf
BUG= R=rnystrom@google.com Review URL: https://codereview.chromium.org//18238010 git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@24827 260f80e4-7a28-3924-810f-c04153c831b5
27 lines
882 B
Python
27 lines
882 B
Python
#!/usr/bin/env python
|
|
# Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
|
|
# for details. All rights reserved. Use of this source code is governed by a
|
|
# BSD-style license that can be found in the LICENSE file.
|
|
|
|
'''Tool for listing the directories under pkg, with their lib directories.
|
|
Used in pkg.gyp. Lists all of the directories in the directory passed in as an
|
|
argument to this script which have a lib subdirectory.
|
|
|
|
Usage:
|
|
python tools/list_pkg_directories.py directory_to_list
|
|
'''
|
|
|
|
import os
|
|
import sys
|
|
|
|
def main(argv):
|
|
directory = argv[1]
|
|
paths = map(lambda x: x + '/lib', filter(lambda x: os.path.isdir(
|
|
os.path.join(directory, x)), os.listdir(directory)))
|
|
for lib in filter(lambda x: os.path.exists(os.path.join(directory, x)),
|
|
paths):
|
|
print '%s/%s' % (directory, lib)
|
|
|
|
if __name__ == '__main__':
|
|
sys.exit(main(sys.argv))
|