diff options
author | Andrew Tridgell <tridge@samba.org> | 2008-09-23 11:15:46 -0700 |
---|---|---|
committer | Andrew Tridgell <tridge@samba.org> | 2008-09-23 11:15:46 -0700 |
commit | 66092ced5e1dc4d35923a3c90bcb3214a885b17d (patch) | |
tree | d40fd46e86244f1b45abda2a95c8fe84bfc88c3c /source4/web_server/swat | |
parent | 9cf29abee296ea2fcdf712687a6ce2cf9fd9d74c (diff) | |
parent | 353aaf26c5f71d9a94e799a1c1e37449211e7a87 (diff) | |
download | samba-66092ced5e1dc4d35923a3c90bcb3214a885b17d.tar.gz samba-66092ced5e1dc4d35923a3c90bcb3214a885b17d.tar.bz2 samba-66092ced5e1dc4d35923a3c90bcb3214a885b17d.zip |
Merge branch 'master' of ssh://git.samba.org/data/git/samba
Diffstat (limited to 'source4/web_server/swat')
-rw-r--r-- | source4/web_server/swat/__init__.py | 18 |
1 files changed, 15 insertions, 3 deletions
diff --git a/source4/web_server/swat/__init__.py b/source4/web_server/swat/__init__.py index e0d85dbe2c..d434bb260b 100644 --- a/source4/web_server/swat/__init__.py +++ b/source4/web_server/swat/__init__.py @@ -1,4 +1,5 @@ #!/usr/bin/python +# -*- coding: utf-8 -*- # Unix SMB/CIFS implementation. # Copyright © Jelmer Vernooij <jelmer@samba.org> 2008 @@ -19,9 +20,20 @@ # along with this program. If not, see <http://www.gnu.org/licenses/>. # -def SWAT(environ, start_response): +def __call__(environ, start_response): status = '200 OK' - response_headers = [('Content-type','text/plain')] + response_headers = [('Content-type','text/html')] start_response(status, response_headers) - return ['Hello world!\n'] + yield '<table>\n' + for key, value in environ.items(): + if isinstance(value, str): + yield '\t<tr><td><b>%s</b></td><td>%s</td></tr>\n' % (key, value) + + yield '</table>\n' + +if __name__ == '__main__': + from wsgiref import simple_server + httpd = simple_server.make_server('localhost', 8090, __call__) + print "Serving HTTP on port 8090..." + httpd.serve_forever() |