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

Unified Diff: mojo/tools/mojo_shell.py

Issue 1157993010: Add --sky support in mojo_shell.py. (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 5 years, 6 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « mojo/devtools/common/devtoolslib/http_server.py ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: mojo/tools/mojo_shell.py
diff --git a/mojo/tools/mojo_shell.py b/mojo/tools/mojo_shell.py
index ae1c7cb5325520a53409aab228a02a69db8a3194..0d7e94d27bdef89dffd519ff8c5a5da95a3b6c38 100755
--- a/mojo/tools/mojo_shell.py
+++ b/mojo/tools/mojo_shell.py
@@ -6,6 +6,7 @@
import argparse
import logging
import sys
+import os.path
import devtools
devtools.add_lib_to_path()
@@ -60,6 +61,8 @@ def main():
_DEFAULT_WINDOW_MANAGER)
parser.add_argument('--no-debugger', action="store_true",
help='Do not spawn mojo:debugger.')
+ parser.add_argument('--sky',
qsr 2015/06/08 15:18:52 This is not only sky. This is for all embeddable a
ppi 2015/06/08 15:29:14 As discussed offline, this is quite sky specific,
+ help='Loads the given Sky file.')
parser.add_argument('-v', '--verbose', action="store_true",
help="Increase output verbosity")
@@ -98,6 +101,24 @@ def main():
if not launcher_args.no_debugger:
args.extend(shell_arguments.ConfigureDebugger(shell))
+ if launcher_args.sky:
+ packages_local_path = os.path.join(paths.build_dir, 'gen', 'dart-pkg',
+ 'packages')
+ additional_mappings = [
+ ('packages/', packages_local_path),
+ ]
+ server_url = shell.ServeLocalDirectory(paths.src_root,
+ additional_mappings=additional_mappings)
+ sky_url = server_url + launcher_args.sky
+
+ args.append('mojo:window_manager %s' % sky_url)
+ args = shell_arguments.AppendToArgument(args, '--content-handlers=',
+ 'text/sky,mojo:sky_viewer')
+ args = shell_arguments.AppendToArgument(args, '--content-handlers=',
+ 'application/dart,mojo:sky_viewer')
+ if launcher_args.verbose:
+ print "Shell arguments: " + str(args)
+
shell.Run(args)
return 0
« no previous file with comments | « mojo/devtools/common/devtoolslib/http_server.py ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698