Disable view source for Developer Tools.
[chromium-blink-merge.git] / chrome / common / extensions / docs / server2 / local_renderer.py
blob96b15f1cedd72e8bfe5657065ed21982ce3c17a2
1 # Copyright 2013 The Chromium Authors. All rights reserved.
2 # Use of this source code is governed by a BSD-style license that can be
3 # found in the LICENSE file.
5 from render_servlet import RenderServlet
6 from server_instance import ServerInstance
7 from servlet import Request
9 class _LocalRenderServletDelegate(object):
10 def CreateServerInstance(self):
11 return ServerInstance.ForLocal()
13 class LocalRenderer(object):
14 '''Renders pages fetched from the local file system.
15 '''
16 @staticmethod
17 def Render(path):
18 assert not '\\' in path
19 return RenderServlet(Request.ForTest(path),
20 _LocalRenderServletDelegate()).Get()