From: Drew Fisher Date: Sun, 2 Oct 2022 03:54:15 +0000 (-0700) Subject: Split testing entrypoint out from CGI entrypoint X-Git-Url: http://git.zarvox.org/shortlog/%7B%7B%20url_for%28%27main.signup_page%27%29%20%7D%7D?a=commitdiff_plain;h=ec19a74dc7b3a0a22a56cdf9fc21d9bb68e65a9e;p=shortlog.git Split testing entrypoint out from CGI entrypoint --- diff --git a/shortlog-testing.py b/shortlog-testing.py new file mode 100644 index 0000000..add38e1 --- /dev/null +++ b/shortlog-testing.py @@ -0,0 +1,21 @@ +#!/usr/bin/python3 + +import shortlog + +if __name__ == "__main__": + # cherrypy WSGI container + from wsgiref.simple_server import make_server + with make_server('127.0.0.1', 5000, shortlog.application) as httpd: + print("Serving on port 5000...") + httpd.serve_forever() + + #import cherrypy + #cherrypy.tree.graft(shortlog.application, "/") + #cherrypy.server.unsubscribe() + #server = cherrypy._cpserver.Server() + #server.socket_host = "127.0.0.1" + #server.socket_port= 5000 + #server.thread_pool = 4 + #server.subscribe() + #cherrypy.engine.start() + #cherrypy.engine.block() diff --git a/shortlog.py b/shortlog.py index 8e3abe6..4eaf96a 100755 --- a/shortlog.py +++ b/shortlog.py @@ -389,15 +389,3 @@ def application(env, start_response): if __name__ == "__main__": # CGI interface CGIHandler().run(application) - - # cherrypy WSGI container - #import cherrypy - #cherrypy.tree.graft(application, "/") - #cherrypy.server.unsubscribe() - #server = cherrypy._cpserver.Server() - #server.socket_host = "127.0.0.1" - #server.socket_port= 5000 - #server.thread_pool = 4 - #server.subscribe() - #cherrypy.engine.start() - #cherrypy.engine.block()