From 4899c541104f97bb57e141116bedc0e3c556cb81 Mon Sep 17 00:00:00 2001 From: Eric Seidel Date: Fri, 31 Oct 2014 11:46:02 -0700 Subject: [PATCH] Fix urls under /sky to work again Turns out that the /sky mapping to the gen directory was interfering with our new pattern of mapping the actual /sky directory. So now we use a more restrictive mapping pattern of only mapping /sky/services, similar for /mojo/services and /mojo/public. Fixed an exception of not finding _sky_server when a custom sky_server was already running. R=abarth@chromium.org Review URL: https://codereview.chromium.org/692163002 --- engine/src/flutter/tools/sky_server | 13 ++++++------- engine/src/flutter/tools/skydb | 6 +++++- 2 files changed, 11 insertions(+), 8 deletions(-) diff --git a/engine/src/flutter/tools/sky_server b/engine/src/flutter/tools/sky_server index bd40138855..0fe0fe91ff 100755 --- a/engine/src/flutter/tools/sky_server +++ b/engine/src/flutter/tools/sky_server @@ -65,18 +65,17 @@ def main(): 'tools.staticdir.dir': os.path.abspath(args.app_path), 'tools.staticdir.indexlister': skydir, }, - '/mojo': { + '/mojo/public': { 'tools.staticdir.on': True, - 'tools.staticdir.dir': os.path.join(GEN_ROOT, 'mojo'), + 'tools.staticdir.dir': os.path.join(GEN_ROOT, 'mojo', 'public'), }, - '/sky': { + '/mojo/services': { 'tools.staticdir.on': True, - 'tools.staticdir.dir': os.path.join(GEN_ROOT, 'sky'), + 'tools.staticdir.dir': os.path.join(GEN_ROOT, 'mojo', 'services'), }, - '/sky/framework': { + '/sky/services': { 'tools.staticdir.on': True, - 'tools.staticdir.dir': - os.path.join(SKY_ROOT, 'framework'), + 'tools.staticdir.dir': os.path.join(GEN_ROOT, 'sky', 'services'), }, } cherrypy.quickstart(config=config) diff --git a/engine/src/flutter/tools/skydb b/engine/src/flutter/tools/skydb index a20b6ff1b6..d0340cdd08 100755 --- a/engine/src/flutter/tools/skydb +++ b/engine/src/flutter/tools/skydb @@ -26,6 +26,9 @@ SUPPORTED_MIME_TYPES = [ ] class SkyDebugger(object): + def __init__(self): + self._sky_server = None + @staticmethod def _port_in_use(port): sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM) @@ -46,7 +49,8 @@ class SkyDebugger(object): if self._port_in_use(HTTP_PORT): logging.warn( - 'Port %s already in use, assuming custom sky_server started.') + 'Port %s already in use, assuming custom sky_server started.' % + HTTP_PORT) else: server_command = [ os.path.join(SKY_TOOLS_DIRECTORY, 'sky_server'),