Mercurial > hg > index.fcgi > www > www-1
diff myrss/myrss_test_server.py @ 42:a1456ecd25b9
fix bug with threadpool; create WSGI app and test server; use logging
author | paulo |
---|---|
date | Mon, 04 Feb 2013 23:58:02 -0800 |
parents | |
children | df6a1a347584 |
line diff
1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/myrss/myrss_test_server.py Mon Feb 04 23:58:02 2013 -0800 1.3 @@ -0,0 +1,14 @@ 1.4 +import wsgiref.simple_server 1.5 +import SocketServer 1.6 + 1.7 +import myrss_parser 1.8 + 1.9 + 1.10 +class ThreadingWSGIServer(SocketServer.ThreadingMixIn, wsgiref.simple_server.WSGIServer): 1.11 + pass 1.12 + 1.13 + 1.14 +if __name__ == "__main__": 1.15 + httpd = ThreadingWSGIServer(('', 8000), wsgiref.simple_server.WSGIRequestHandler) 1.16 + httpd.set_app(myrss_parser.MyRssApp()) 1.17 + httpd.serve_forever()