OLD | NEW |
---|---|
1 #!/usr/bin/python | 1 #!/usr/bin/python |
2 # Copyright (c) 2011 The Chromium Authors. All rights reserved. | 2 # Copyright (c) 2011 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 os | 8 import os |
9 import os.path | 9 import os.path |
10 import shutil | 10 import shutil |
11 import sys | 11 import sys |
12 import time | 12 import time |
13 import urllib | 13 import urllib |
14 | 14 |
15 from subprocess import Popen, PIPE | 15 from subprocess import Popen, PIPE |
16 from optparse import OptionParser | 16 from optparse import OptionParser |
17 | 17 |
18 _script_path = os.path.realpath(__file__) | 18 _script_path = os.path.realpath(__file__) |
19 _build_dir = os.path.dirname(_script_path) | 19 _build_dir = os.path.dirname(_script_path) |
20 _base_dir = os.path.normpath(_build_dir + "/..") | 20 _base_dir = os.path.normpath(_build_dir + "/..") |
21 _static_dir = _base_dir + "/static" | 21 _static_dir = _base_dir + "/static" |
22 _js_dir = _base_dir + "/js" | 22 _js_dir = _base_dir + "/js" |
23 _template_dir = _base_dir + "/template" | 23 _template_dir = _base_dir + "/template" |
24 _samples_dir = _base_dir + "/examples" | 24 _samples_dir = _base_dir + "/examples" |
25 _extension_api_dir = os.path.normpath(_base_dir + "/../api") | 25 _extension_api_dir = os.path.normpath(_base_dir + "/../api") |
26 | 26 |
27 _extension_api_json = _extension_api_dir + "/extension_api.json" | 27 _extension_api_json = _extension_api_dir + "/extension_api.json" |
28 _extension_api_extension_json = | |
Aaron Boodman
2011/12/07 23:30:35
If this is only used in the one place below, maybe
koz (OOO until 15th September)
2011/12/09 19:24:18
As per kalman's comment, I've rolled all of these
| |
29 _extension_api_dir + "/extension_api_extension.json" | |
not at google - send to devlin
2011/12/08 00:32:49
would be nice to do an ls *.json on here so that w
koz (OOO until 15th September)
2011/12/09 19:24:18
Done.
| |
28 _devtools_api_json = _extension_api_dir + "/devtools_api.json" | 30 _devtools_api_json = _extension_api_dir + "/devtools_api.json" |
29 _api_template_html = _template_dir + "/api_template.html" | 31 _api_template_html = _template_dir + "/api_template.html" |
30 _page_shell_html = _template_dir + "/page_shell.html" | 32 _page_shell_html = _template_dir + "/page_shell.html" |
31 _generator_html = _build_dir + "/generator.html" | 33 _generator_html = _build_dir + "/generator.html" |
32 _samples_json = _base_dir + "/samples.json" | 34 _samples_json = _base_dir + "/samples.json" |
33 | 35 |
34 _expected_output_preamble = "#BEGIN" | 36 _expected_output_preamble = "#BEGIN" |
35 _expected_output_postamble = "#END" | 37 _expected_output_postamble = "#END" |
36 | 38 |
37 # HACK! This is required because we can only depend on python 2.4 and | 39 # HACK! This is required because we can only depend on python 2.4 and |
(...skipping 140 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
178 default=True) | 180 default=True) |
179 options, args = parser.parse_args() | 181 options, args = parser.parse_args() |
180 | 182 |
181 if (options.dump_render_tree_path and | 183 if (options.dump_render_tree_path and |
182 os.path.isfile(options.dump_render_tree_path)): | 184 os.path.isfile(options.dump_render_tree_path)): |
183 dump_render_tree = options.dump_render_tree_path | 185 dump_render_tree = options.dump_render_tree_path |
184 else: | 186 else: |
185 dump_render_tree = FindDumpRenderTree() | 187 dump_render_tree = FindDumpRenderTree() |
186 | 188 |
187 # Load the manifest of existing API Methods | 189 # Load the manifest of existing API Methods |
188 api_manifest = ApiManifest([_extension_api_json, _devtools_api_json]) | 190 api_manifest = ApiManifest([_extension_api_json, |
191 _extension_api_extension_json, | |
192 _devtools_api_json]) | |
Aaron Boodman
2011/12/07 23:30:35
That was lucky.
koz (OOO until 15th September)
2011/12/09 19:24:18
Yes :-)
| |
189 | 193 |
190 # Read static file names | 194 # Read static file names |
191 static_names = GetStaticFileNames() | 195 static_names = GetStaticFileNames() |
192 | 196 |
193 # Read module names | 197 # Read module names |
194 module_names = api_manifest.getModuleNames() | 198 module_names = api_manifest.getModuleNames() |
195 | 199 |
196 # All pages to generate | 200 # All pages to generate |
197 page_names = static_names | module_names | 201 page_names = static_names | module_names |
198 | 202 |
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
235 if (os.path.isfile(debug_log)): | 239 if (os.path.isfile(debug_log)): |
236 os.remove(debug_log) | 240 os.remove(debug_log) |
237 | 241 |
238 if 'EX_OK' in dir(os): | 242 if 'EX_OK' in dir(os): |
239 return os.EX_OK | 243 return os.EX_OK |
240 else: | 244 else: |
241 return 0 | 245 return 0 |
242 | 246 |
243 if __name__ == '__main__': | 247 if __name__ == '__main__': |
244 sys.exit(main()) | 248 sys.exit(main()) |
OLD | NEW |