OLD | NEW |
1 #!/usr/bin/env python | 1 #!/usr/bin/env python |
2 # Copyright (c) 2014 The Chromium Authors. All rights reserved. | 2 # Copyright (c) 2014 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 """Script to regenerate API docs using doxygen. | 6 """Script to regenerate API docs using doxygen. |
7 """ | 7 """ |
8 | 8 |
9 import argparse | 9 import argparse |
10 import collections | 10 import collections |
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
45 u.close() | 45 u.close() |
46 | 46 |
47 channel_info = {} | 47 channel_info = {} |
48 for os_row in data: | 48 for os_row in data: |
49 osname = os_row['os'] | 49 osname = os_row['os'] |
50 if osname not in ('win', 'mac', 'linux'): | 50 if osname not in ('win', 'mac', 'linux'): |
51 continue | 51 continue |
52 for version_row in os_row['versions']: | 52 for version_row in os_row['versions']: |
53 channel = version_row['channel'] | 53 channel = version_row['channel'] |
54 # We don't display canary docs. | 54 # We don't display canary docs. |
55 if channel == 'canary': | 55 if channel.startswith('canary'): |
56 continue | 56 continue |
57 | 57 |
58 version = version_row['version'].split('.')[0] # Major version | 58 version = version_row['version'].split('.')[0] # Major version |
59 branch = version_row['true_branch'] | 59 branch = version_row['true_branch'] |
60 if branch is None: | 60 if branch is None: |
61 branch = 'trunk' | 61 branch = 'trunk' |
62 | 62 |
63 if channel in channel_info: | 63 if channel in channel_info: |
64 existing_info = channel_info[channel] | 64 existing_info = channel_info[channel] |
65 if branch != existing_info.branch: | 65 if branch != existing_info.branch: |
(...skipping 240 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
306 def main(argv): | 306 def main(argv): |
307 parser = argparse.ArgumentParser(description=__doc__) | 307 parser = argparse.ArgumentParser(description=__doc__) |
308 parser.add_argument('-v', '--verbose', | 308 parser.add_argument('-v', '--verbose', |
309 help='Verbose output', action='store_true') | 309 help='Verbose output', action='store_true') |
310 parser.add_argument('out_directory') | 310 parser.add_argument('out_directory') |
311 options = parser.parse_args(argv) | 311 options = parser.parse_args(argv) |
312 | 312 |
313 if options.verbose: | 313 if options.verbose: |
314 Trace.verbose = True | 314 Trace.verbose = True |
315 | 315 |
316 channel_info = GetChannelInfo() | 316 for channel, info in GetChannelInfo().iteritems(): |
317 for channel, info in channel_info.iteritems(): | |
318 GenerateDocs(options.out_directory, channel, info.version, info.branch) | 317 GenerateDocs(options.out_directory, channel, info.version, info.branch) |
319 | 318 |
320 return 0 | 319 return 0 |
321 | 320 |
322 | 321 |
323 if __name__ == '__main__': | 322 if __name__ == '__main__': |
324 try: | 323 try: |
325 rtn = main(sys.argv[1:]) | 324 rtn = main(sys.argv[1:]) |
326 except KeyboardInterrupt: | 325 except KeyboardInterrupt: |
327 sys.stderr.write('%s: interrupted\n' % os.path.basename(__file__)) | 326 sys.stderr.write('%s: interrupted\n' % os.path.basename(__file__)) |
328 rtn = 1 | 327 rtn = 1 |
329 sys.exit(rtn) | 328 sys.exit(rtn) |
OLD | NEW |