1cedac228d2dd51db4b79ea1e72c7f249408ee061Torne (Richard Coles)#!/usr/bin/env python
2cedac228d2dd51db4b79ea1e72c7f249408ee061Torne (Richard Coles)# Copyright 2014 The Chromium Authors. All rights reserved.
3cedac228d2dd51db4b79ea1e72c7f249408ee061Torne (Richard Coles)# Use of this source code is governed by a BSD-style license that can be
4cedac228d2dd51db4b79ea1e72c7f249408ee061Torne (Richard Coles)# found in the LICENSE file.
5cedac228d2dd51db4b79ea1e72c7f249408ee061Torne (Richard Coles)"""Starts the mojo spy dev server.
6cedac228d2dd51db4b79ea1e72c7f249408ee061Torne (Richard Coles)
7cedac228d2dd51db4b79ea1e72c7f249408ee061Torne (Richard Coles)During normal usage of mojo spy, the spy files are compiled into standalone
8cedac228d2dd51db4b79ea1e72c7f249408ee061Torne (Richard Coles)HTML+JS+CSS snippets that are then embedded in the mojo shell.
9cedac228d2dd51db4b79ea1e72c7f249408ee061Torne (Richard Coles)
10cedac228d2dd51db4b79ea1e72c7f249408ee061Torne (Richard Coles)The dev server allows edit-reload style development of the spy UI in isolation
11cedac228d2dd51db4b79ea1e72c7f249408ee061Torne (Richard Coles)of the c++ bits. To use, start the dev server, navigate to the URL the script
12cedac228d2dd51db4b79ea1e72c7f249408ee061Torne (Richard Coles)prints, and run any of the tests listed. Reloading in the browser loads the
13cedac228d2dd51db4b79ea1e72c7f249408ee061Torne (Richard Coles)latest content from disk, enabling a traditional web development workflow.
14cedac228d2dd51db4b79ea1e72c7f249408ee061Torne (Richard Coles)"""
15cedac228d2dd51db4b79ea1e72c7f249408ee061Torne (Richard Coles)import sys
16cedac228d2dd51db4b79ea1e72c7f249408ee061Torne (Richard Coles)
17cedac228d2dd51db4b79ea1e72c7f249408ee061Torne (Richard Coles)from ui import dev_server
18cedac228d2dd51db4b79ea1e72c7f249408ee061Torne (Richard Coles)
19cedac228d2dd51db4b79ea1e72c7f249408ee061Torne (Richard Coles)COMPONENTS_PORT = 8015
20cedac228d2dd51db4b79ea1e72c7f249408ee061Torne (Richard Coles)
21cedac228d2dd51db4b79ea1e72c7f249408ee061Torne (Richard Coles)if __name__ == '__main__':
22cedac228d2dd51db4b79ea1e72c7f249408ee061Torne (Richard Coles)  sys.exit(dev_server.Main(COMPONENTS_PORT, sys.argv[1:]))
23