OLD | NEW |
1 #!/usr/bin/python | 1 #!/usr/bin/python |
2 # Copyright (c) 2012 The Chromium Authors. All rights reserved. | 2 # Copyright (c) 2012 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 """Docbuilder for extension docs.""" | 6 """Docbuilder for extension docs.""" |
7 | 7 |
8 import glob | 8 import glob |
9 import os | 9 import os |
10 import os.path | 10 import os.path |
11 import shutil | 11 import shutil |
12 import sys | 12 import sys |
13 import time | 13 import time |
14 import urllib | 14 import urllib |
15 | 15 |
16 from subprocess import Popen, PIPE | 16 from subprocess import Popen, PIPE |
17 from optparse import OptionParser | 17 from optparse import OptionParser |
18 | 18 |
19 _script_path = os.path.realpath(__file__) | 19 _script_path = os.path.realpath(__file__) |
20 _build_dir = os.path.dirname(_script_path) | 20 _build_dir = os.path.dirname(_script_path) |
21 _base_dir = os.path.normpath(_build_dir + "/..") | 21 _base_dir = os.path.normpath(_build_dir + "/..") |
22 _static_dir = _base_dir + "/static" | 22 _static_dir = _base_dir + "/static" |
23 _js_dir = _base_dir + "/js" | 23 _js_dir = _base_dir + "/js" |
24 _template_dir = _base_dir + "/template" | 24 _template_dir = _base_dir + "/template" |
25 _samples_dir = _base_dir + "/examples" | 25 _samples_dir = _base_dir + "/examples" |
26 _extension_api_dir = os.path.normpath(_base_dir + "/../api") | 26 _extension_api_dir = os.path.normpath(_base_dir + "/../api") |
27 | 27 |
28 _extension_api_json_schemas = glob.glob(_extension_api_dir + | 28 _extension_api_json_schemas = glob.glob(_extension_api_dir + |
29 '/[a-zA-Z0-9]*.json') | 29 '/[a-zA-Z0-9]*.json') |
| 30 _extension_api_json_schemas += glob.glob(_extension_api_dir + |
| 31 '/*/[a-zA-Z0-9]*.json') |
30 _extension_api_idl_schemas = glob.glob(_extension_api_dir + | 32 _extension_api_idl_schemas = glob.glob(_extension_api_dir + |
31 '/[a-zA-Z0-9]*.idl') | 33 '/[a-zA-Z0-9]*.idl') |
| 34 _extension_api_idl_schemas += glob.glob(_extension_api_dir + |
| 35 '/*/[a-zA-Z0-9]*.idl') |
32 _api_template_html = _template_dir + "/api_template.html" | 36 _api_template_html = _template_dir + "/api_template.html" |
33 _page_shell_html = _template_dir + "/page_shell.html" | 37 _page_shell_html = _template_dir + "/page_shell.html" |
34 _generator_html = _build_dir + "/generator.html" | 38 _generator_html = _build_dir + "/generator.html" |
35 _samples_json = _base_dir + "/samples.json" | 39 _samples_json = _base_dir + "/samples.json" |
36 | 40 |
37 _expected_output_preamble = "#BEGIN" | 41 _expected_output_preamble = "#BEGIN" |
38 _expected_output_postamble = "#END" | 42 _expected_output_postamble = "#END" |
39 | 43 |
40 # HACK! This is required because we can only depend on python 2.4 and | 44 # HACK! This is required because we can only depend on python 2.4 and |
41 # the calling environment may not be setup to set the PYTHONPATH | 45 # the calling environment may not be setup to set the PYTHONPATH |
(...skipping 190 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
232 # Cleanup our temporary IDL->JSON files | 236 # Cleanup our temporary IDL->JSON files |
233 api_manifest.cleanupGeneratedFiles() | 237 api_manifest.cleanupGeneratedFiles() |
234 | 238 |
235 if 'EX_OK' in dir(os): | 239 if 'EX_OK' in dir(os): |
236 return os.EX_OK | 240 return os.EX_OK |
237 else: | 241 else: |
238 return 0 | 242 return 0 |
239 | 243 |
240 if __name__ == '__main__': | 244 if __name__ == '__main__': |
241 sys.exit(main()) | 245 sys.exit(main()) |
OLD | NEW |