Index: chrome/common/extensions/docs/server2/preview.py |
diff --git a/chrome/common/extensions/docs/server2/preview.py b/chrome/common/extensions/docs/server2/preview.py |
index aa7531dd40652a21fa7eb62ac7b67905a0d5f1d8..f26bfe8c6f7f5d055e2bfac5cf08bacb539b400d 100755 |
--- a/chrome/common/extensions/docs/server2/preview.py |
+++ b/chrome/common/extensions/docs/server2/preview.py |
@@ -57,11 +57,9 @@ class _Request(object): |
self.path = path |
self.url = 'http://localhost' + path |
-def _Render(path, local_path): |
+def _Render(path): |
response = _Response() |
- Handler(_Request(urlparse.urlparse(path).path), |
- response, |
- local_path=local_path).get() |
+ Handler(_Request(urlparse.urlparse(path).path), response).get() |
content = response.out.getvalue() |
if isinstance(content, unicode): |
content = content.encode('utf-8', 'replace') |
@@ -76,7 +74,7 @@ class RequestHandler(BaseHTTPRequestHandler): |
"""A HTTPRequestHandler that outputs the docs page generated by Handler. |
""" |
def do_GET(self): |
- content, status, headers = _Render(self.path, RequestHandler.local_path) |
+ content, status, headers = _Render(self.path) |
self.send_response(status) |
for k, v in headers.iteritems(): |
self.send_header(k, v) |
@@ -148,7 +146,6 @@ if __name__ == '__main__': |
print(' http://localhost:%s/apps/' % opts.port) |
print('') |
- RequestHandler.local_path = opts.directory |
server = HTTPServer(('', int(opts.port)), RequestHandler) |
try: |
server.serve_forever() |