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

Side by Side Diff: sky/tools/skypy/skyserver.py

Issue 955263004: Make shelldb not crash. (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 | « sky/tools/shelldb ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 # Copyright 2014 The Chromium Authors. All rights reserved. 1 # Copyright 2014 The Chromium Authors. All rights reserved.
2 # Use of this source code is governed by a BSD-style license that can be 2 # Use of this source code is governed by a BSD-style license that can be
3 # found in the LICENSE file. 3 # found in the LICENSE file.
4 4
5 import socket 5 import socket
6 import subprocess 6 import subprocess
7 import logging 7 import logging
8 import os.path 8 import os.path
9 9
10 SKYPY_PATH = os.path.dirname(__file__) 10 SKYPY_PATH = os.path.dirname(os.path.abspath(__file__))
11 SKY_TOOLS_PATH = os.path.dirname(SKYPY_PATH) 11 SKY_TOOLS_PATH = os.path.dirname(SKYPY_PATH)
12 SKY_ROOT = os.path.dirname(SKY_TOOLS_PATH) 12 SKY_ROOT = os.path.dirname(SKY_TOOLS_PATH)
13 SRC_ROOT = os.path.dirname(SKY_ROOT) 13 SRC_ROOT = os.path.dirname(SKY_ROOT)
14 14
15 class SkyServer(object): 15 class SkyServer(object):
16 def __init__(self, port, configuration, root): 16 def __init__(self, port, configuration, root):
17 self.port = port 17 self.port = port
18 self.configuration = configuration 18 self.configuration = configuration
19 self.root = root 19 self.root = root
20 self.server = None 20 self.server = None
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
56 def __exit__(self, exc_type, exc_value, traceback): 56 def __exit__(self, exc_type, exc_value, traceback):
57 self.stop() 57 self.stop()
58 58
59 def path_as_url(self, path): 59 def path_as_url(self, path):
60 return self.url_for_path(self.port, self.root, path) 60 return self.url_for_path(self.port, self.root, path)
61 61
62 @staticmethod 62 @staticmethod
63 def url_for_path(port, root, path): 63 def url_for_path(port, root, path):
64 relative_path = os.path.relpath(path, root) 64 relative_path = os.path.relpath(path, root)
65 return 'http://localhost:%s/%s' % (port, relative_path) 65 return 'http://localhost:%s/%s' % (port, relative_path)
OLDNEW
« no previous file with comments | « sky/tools/shelldb ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698