summaryrefslogtreecommitdiff
path: root/source4/web_server/swat/__init__.py
diff options
context:
space:
mode:
authorJelmer Vernooij <jelmer@samba.org>2008-10-21 14:51:13 +0200
committerJelmer Vernooij <jelmer@samba.org>2008-10-21 14:51:13 +0200
commit5209a846a9157e649fcdcb561f7eaf19c8c0e465 (patch)
treeb0a7e52b5646c8eec182dbc391e7934b6804488c /source4/web_server/swat/__init__.py
parent625359b2e266105022309df8985720108ecd6f67 (diff)
parent2ee8d29d22bcb1c350ab59d71b0aee548489bc9c (diff)
downloadsamba-5209a846a9157e649fcdcb561f7eaf19c8c0e465.tar.gz
samba-5209a846a9157e649fcdcb561f7eaf19c8c0e465.tar.bz2
samba-5209a846a9157e649fcdcb561f7eaf19c8c0e465.zip
Merge branch 'master' of ssh://git.samba.org/data/git/samba into regsrv
Conflicts: source4/lib/registry/ldb.c source4/rpc_server/winreg/rpc_winreg.c
Diffstat (limited to 'source4/web_server/swat/__init__.py')
-rw-r--r--source4/web_server/swat/__init__.py18
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()