1 # -*- coding: utf-8 -*-
3 # Unix SMB/CIFS implementation.
4 # Copyright © Jelmer Vernooij <jelmer@samba.org> 2008
6 # Implementation of SWAT that uses WSGI
8 # This program is free software; you can redistribute it and/or modify
9 # it under the terms of the GNU General Public License as published by
10 # the Free Software Foundation; either version 3 of the License, or
11 # (at your option) any later version.
13 # This program is distributed in the hope that it will be useful,
14 # but WITHOUT ANY WARRANTY; without even the implied warranty of
15 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 # GNU General Public License for more details.
18 # You should have received a copy of the GNU General Public License
19 # along with this program. If not, see <http://www.gnu.org/licenses/>.
24 def render_placeholder(environ
, start_response
):
26 response_headers
= [('Content-type', 'text/html')]
27 start_response(status
, response_headers
)
29 yield "<!doctype html>\n"
31 yield " <title>The Samba web service</title>\n"
35 yield "<p>Welcome to this Samba web server.</p>\n"
36 yield "<p>This page is a simple placeholder. You probably want to install "
37 yield "SWAT. More information can be found "
38 yield "<a href='http://wiki.samba.org/index.php/SWAT'>on the wiki</a>.</p>"
44 __call__
= render_placeholder
47 if __name__
== '__main__':
48 from wsgiref
import simple_server
49 httpd
= simple_server
.make_server('localhost', 8090, __call__
)
50 print "Serving HTTP on port 8090..."