1 # Copyright (c) 2014 The Chromium Authors. All rights reserved.
2 # Use of this source code is governed by a BSD-style license that can be
3 # found in the LICENSE file.
10 from trace_viewer import trace_viewer_project
13 parser = optparse.OptionParser(usage="%prog --outdir=<directory>")
14 parser.add_option("--outdir", dest="out_dir",
15 help="Where to place generated content")
16 options, args = parser.parse_args(args)
18 if not options.out_dir:
19 sys.stderr.write("ERROR: Must specify --outdir=<directory>")
23 filenames = ["about_tracing.html"]
24 project = trace_viewer_project.TraceViewerProject()
25 load_sequence = project.CalcLoadSequenceForModuleFilenames(filenames)
29 o = open(os.path.join(options.out_dir, "about_tracing.html"), 'w')
31 tvcm.GenerateStandaloneHTMLToFile(
34 title='chrome://tracing',
35 flattened_js_url='tracing.js')
36 except tvcm.module.DepsException, ex:
37 sys.stderr.write("Error: %s\n\n" % str(ex))
42 o = open(os.path.join(options.out_dir, "about_tracing.js"), 'w')
43 tvcm.GenerateJSToFile(
46 use_include_tags_for_scripts=True,
47 dir_for_include_tag_root=options.out_dir)