blob: be403a8de501aeec2a8de54a63ae32ad50d810f4 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
|
# Copyright 2013 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import os
import sys
from render_servlet import RenderServlet
from server_instance import ServerInstance
from servlet import Request
class _LocalRenderServletDelegate(object):
def CreateServerInstance(self):
return ServerInstance.ForLocal()
class LocalRenderer(object):
'''Renders pages fetched from the local file system.
'''
@staticmethod
def Render(path):
assert not '\\' in path
return RenderServlet(Request.ForTest(path),
_LocalRenderServletDelegate()).Get()
|