Chromium Code Reviews| Index: utils/apidoc/scripts/list_files.py |
| diff --git a/utils/apidoc/scripts/list_files.py b/utils/apidoc/scripts/list_files.py |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..178c7464eb6ca86a28654f3f1ef9f0b294765a4b |
| --- /dev/null |
| +++ b/utils/apidoc/scripts/list_files.py |
| @@ -0,0 +1,31 @@ |
| +#!/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. |
| + |
| +# Traverses apidoc and dartdoc and lists all possible input files that are |
| +# used when building API documentation. Used by gyp to determine when apidocs |
| +# need to be regenerated (see `apidoc.gyp`). |
|
dgrove
2012/03/30 17:46:31
Can this be written in dart?
Bob Nystrom
2012/03/30 18:01:40
It was initially. It turns out, no. This script is
dgrove
2012/03/30 18:16:25
As we discussed, this could use the prebuilt VM th
Bob Nystrom
2012/03/30 19:00:58
Done.
|
| + |
| +import os |
| +import sys |
| + |
| +def main(argv): |
| + if len(argv) == 1: |
| + dir = os.curdir |
| + else: |
| + dir = argv[1] |
| + for root, directories, files in os.walk(dir): |
| + if root == os.curdir: |
| + directories[0:] = [ |
| + os.path.join('utils', 'apidoc'), |
| + os.path.join('lib', 'dartdoc') |
| + ] |
| + |
| + for filename in files: |
| + if filename.endswith(( |
| + '.css', '.dart', '.ico', '.js', '.json', '.png', '.sh', '.txt')): |
| + print os.path.relpath(os.path.join(root, filename)) |
| + |
| +if __name__ == '__main__': |
| + sys.exit(main(sys.argv)) |