From: Jelmer Vernooij Date: Sun, 16 Jan 2011 23:43:04 +0000 (+0100) Subject: web_server: Display trivial placeholder page if SWAT could not be found. X-Git-Url: http://git.samba.org/samba.git/?p=samba.git;a=commitdiff_plain;h=e665fce31c29f502dc6a21559c4766ab627fb35a web_server: Display trivial placeholder page if SWAT could not be found. Autobuild-User: Jelmer Vernooij Autobuild-Date: Mon Jan 17 01:27:10 CET 2011 on sn-devel-104 --- diff --git a/source4/scripting/python/samba/web_server/__init__.py b/source4/scripting/python/samba/web_server/__init__.py index b5ac69c96a2..da528f42d1e 100644 --- a/source4/scripting/python/samba/web_server/__init__.py +++ b/source4/scripting/python/samba/web_server/__init__.py @@ -20,17 +20,30 @@ # along with this program. If not, see . # -def __call__(environ, start_response): + + +def render_placeholder(environ, start_response): status = '200 OK' response_headers = [('Content-type','text/html')] start_response(status, response_headers) - yield '\n' - for key, value in environ.items(): - if isinstance(value, str): - yield '\t\n' % (key, value) + yield "\n" + yield "\n" + yield " The Samba web service\n" + yield "\n" + + yield "\n" + yield "

Welcome to this Samba web server.

\n" + yield "

This page is a simple placeholder. You probably want to install " + yield "SWAT. More information can be found " + yield "on the wiki.

" + yield "

\n" + yield "\n" + yield "\n" + + +__call__ = render_placeholder - yield '
%s%s
\n' if __name__ == '__main__': from wsgiref import simple_server