From ec19a74dc7b3a0a22a56cdf9fc21d9bb68e65a9e Mon Sep 17 00:00:00 2001 From: Drew Fisher Date: Sat, 1 Oct 2022 20:54:15 -0700 Subject: [PATCH] Split testing entrypoint out from CGI entrypoint --- shortlog-testing.py | 21 +++++++++++++++++++++ shortlog.py | 12 ------------ 2 files changed, 21 insertions(+), 12 deletions(-) create mode 100644 shortlog-testing.py 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() -- 2.39.2