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

Side by Side Diff: mojo/tools/mojo_demo.py

Issue 960233007: Add super-primitive shelldb (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 5 years, 9 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 | « no previous file | sky/tools/shelldb » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 #!/usr/bin/env python 1 #!/usr/bin/env python
2 # Copyright 2014 The Chromium Authors. All rights reserved. 2 # Copyright 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 from mopy.config import Config 6 from mopy.config import Config
7 import argparse 7 import argparse
8 import mopy.paths 8 import mopy.paths
9 import os 9 import os
10 import pipes 10 import pipes
(...skipping 17 matching lines...) Expand all
28 args = parser.parse_args() 28 args = parser.parse_args()
29 29
30 config = Config(target_os=Config.OS_LINUX, is_debug=True) 30 config = Config(target_os=Config.OS_LINUX, is_debug=True)
31 paths = mopy.paths.Paths(config, build_dir=args.build_dir) 31 paths = mopy.paths.Paths(config, build_dir=args.build_dir)
32 mojo_shell = paths.mojo_shell_path 32 mojo_shell = paths.mojo_shell_path
33 33
34 cmd = [mojo_shell] 34 cmd = [mojo_shell]
35 cmd.append('--v=1') 35 cmd.append('--v=1')
36 36
37 HTTP_PORT = 9999 37 HTTP_PORT = 9999
38 sky_paths = skypy.paths.Paths(paths.build_dir)
39 configuration = 'Debug' if config.is_debug else 'Release' 38 configuration = 'Debug' if config.is_debug else 'Release'
40 server = SkyServer(sky_paths, HTTP_PORT, configuration, paths.src_root) 39 server = SkyServer(HTTP_PORT, configuration, paths.src_root)
41 40
42 if args.demo == 'browser': 41 if args.demo == 'browser':
43 base_url = server.path_as_url(paths.build_dir) 42 base_url = server.path_as_url(paths.build_dir)
44 wm_url = os.path.join(base_url, 'example_window_manager.mojo') 43 wm_url = os.path.join(base_url, 'example_window_manager.mojo')
45 browser_url = os.path.join(base_url, 'browser.mojo') 44 browser_url = os.path.join(base_url, 'browser.mojo')
46 cmd.append('--url-mappings=mojo:window_manager=mojo:example_window_manager') 45 cmd.append('--url-mappings=mojo:window_manager=mojo:example_window_manager')
47 cmd.append('--args-for=mojo:window_manager %s' % (wm_url)) 46 cmd.append('--args-for=mojo:window_manager %s' % (wm_url))
48 cmd.append('--args-for=mojo:browser %s' % (browser_url)) 47 cmd.append('--args-for=mojo:browser %s' % (browser_url))
49 cmd.append('mojo:window_manager') 48 cmd.append('mojo:window_manager')
50 elif args.demo == 'wm_flow': 49 elif args.demo == 'wm_flow':
(...skipping 13 matching lines...) Expand all
64 63
65 # http://stackoverflow.com/questions/4748344/whats-the-reverse-of-shlex-split 64 # http://stackoverflow.com/questions/4748344/whats-the-reverse-of-shlex-split
66 # shlex.quote doesn't exist until 3.3 65 # shlex.quote doesn't exist until 3.3
67 # This doesn't print exactly what we want, but it's better than nothing: 66 # This doesn't print exactly what we want, but it's better than nothing:
68 print " ".join(map(pipes.quote, cmd)) 67 print " ".join(map(pipes.quote, cmd))
69 with server: 68 with server:
70 return subprocess.call(cmd) 69 return subprocess.call(cmd)
71 70
72 if __name__ == '__main__': 71 if __name__ == '__main__':
73 sys.exit(main()) 72 sys.exit(main())
OLDNEW
« no previous file with comments | « no previous file | sky/tools/shelldb » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698