]> git.zarvox.org Git - shortlog.git/commitdiff
Split testing entrypoint out from CGI entrypoint
authorDrew Fisher <drew.m.fisher@gmail.com>
Sun, 2 Oct 2022 03:54:15 +0000 (20:54 -0700)
committerDrew Fisher <drew.m.fisher@gmail.com>
Sun, 2 Oct 2022 03:54:15 +0000 (20:54 -0700)
shortlog-testing.py [new file with mode: 0644]
shortlog.py

diff --git a/shortlog-testing.py b/shortlog-testing.py
new file mode 100644 (file)
index 0000000..add38e1
--- /dev/null
@@ -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()
index 8e3abe62096f256765671618f64860f3d7b59663..4eaf96a4c168d44632d203d3693e969818624d1f 100755 (executable)
@@ -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()