提交 d47c4829 编写于 作者: E Eric Seidel

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
上级 ae147c58
......@@ -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)
......
......@@ -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'),
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册