Chromium Code Reviews| OLD | NEW |
|---|---|
| (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 # Traverses apidoc and dartdoc and lists all possible input files that are | |
| 7 # used when building API documentation. Used by gyp to determine when apidocs | |
| 8 # 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.
| |
| 9 | |
| 10 import os | |
| 11 import sys | |
| 12 | |
| 13 def main(argv): | |
| 14 if len(argv) == 1: | |
| 15 dir = os.curdir | |
| 16 else: | |
| 17 dir = argv[1] | |
| 18 for root, directories, files in os.walk(dir): | |
| 19 if root == os.curdir: | |
| 20 directories[0:] = [ | |
| 21 os.path.join('utils', 'apidoc'), | |
| 22 os.path.join('lib', 'dartdoc') | |
| 23 ] | |
| 24 | |
| 25 for filename in files: | |
| 26 if filename.endswith(( | |
| 27 '.css', '.dart', '.ico', '.js', '.json', '.png', '.sh', '.txt')): | |
| 28 print os.path.relpath(os.path.join(root, filename)) | |
| 29 | |
| 30 if __name__ == '__main__': | |
| 31 sys.exit(main(sys.argv)) | |
| OLD | NEW |