Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2525)

Side by Side Diff: mojo/spy/ui/spy_shell_to_html.py

Issue 281623007: Add mojo web UI framework based on Nat's TVCM (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: missed a few Created 6 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « mojo/spy/ui/spy_shell_to_html ('k') | mojo/spy/ui/spy_test.js » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 # Copyright 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.
4 import sys
5 import os
6 import optparse
7
8 from ui import spy_project
9 from tvcm import generate
10
11 def Main(args):
12 parser = optparse.OptionParser()
13 parser.add_option('--output-file', '-o')
14 options,args = parser.parse_args(args)
15
16 if options.output_file:
17 ofile = open(options.output_file, 'w')
18 else:
19 ofile = sys.stdout
20 GenerateHTML(ofile)
21 if ofile != sys.stdout:
22 ofile.close()
23
24 def GenerateHTML(ofile):
25 project = spy_project.SpyProject()
26 load_sequence = project.CalcLoadSequenceForModuleNames(
27 ['ui.spy_shell'])
28 bootstrap_js = """
29
30 document.addEventListener('DOMContentLoaded', function() {
31 document.body.appendChild(new ui.SpyShell('ws://127.0.0.1:42424'));
32
33 });
34 """
35 bootstrap_script = generate.ExtraScript(text_content=bootstrap_js)
36 generate.GenerateStandaloneHTMLToFile(
37 ofile, load_sequence,
38 title='Mojo spy',
39 extra_scripts=[bootstrap_script])
OLDNEW
« no previous file with comments | « mojo/spy/ui/spy_shell_to_html ('k') | mojo/spy/ui/spy_test.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698