@@ -31,6 +31,13 @@ def index(self):
3131 cherrypy .quickstart (Root (), '/' , config )
3232
3333
34+ def run_cherrypy_server_with_python3 (host = "127.0.0.1" , port = 9004 ):
35+ run_cherrypy_server (host , port )
36+
37+
38+ def run_cherrypy_server_with_pypy (host = "127.0.0.1" , port = 9005 ):
39+ run_cherrypy_server (host , port )
40+
3441
3542def run_gevent_server (host = "127.0.0.1" , port = 9001 ):
3643 from gevent import monkey ; monkey .patch_all ()
@@ -89,7 +96,11 @@ class ServerFactory(WebSocketServerFactory):
8996 parser .add_argument ('--run-all' , dest = 'run_all' , action = 'store_true' ,
9097 help = 'Run all servers backend' )
9198 parser .add_argument ('--run-cherrypy-server' , dest = 'run_cherrypy' , action = 'store_true' ,
92- help = 'Run the CheryPy server backend' )
99+ help = 'Run the CherryPy server backend' )
100+ parser .add_argument ('--run-cherrypy-server-pypy' , dest = 'run_cherrypy_pypy' , action = 'store_true' ,
101+ help = 'Run the CherryPy server backend with PyPy' )
102+ parser .add_argument ('--run-cherrypy-server-py3k' , dest = 'run_cherrypy_py3k' , action = 'store_true' ,
103+ help = 'Run the CherryPy server backend with Python 3' )
93104 parser .add_argument ('--run-gevent-server' , dest = 'run_gevent' , action = 'store_true' ,
94105 help = 'Run the gevent server backend' )
95106 parser .add_argument ('--run-tornado-server' , dest = 'run_tornado' , action = 'store_true' ,
@@ -129,6 +140,18 @@ class ServerFactory(WebSocketServerFactory):
129140 p3 .daemon = True
130141 procs .append (p3 )
131142
143+ logger .warning ("CherryPy server on PyPy: %s" % args .run_cherrypy_pypy )
144+ if args .run_cherrypy_pypy :
145+ p4 = Process (target = run_cherrypy_server_with_pypy )
146+ p4 .daemon = True
147+ procs .append (p4 )
148+
149+ logger .warning ("CherryPy server on Python 3: %s" % args .run_cherrypy_py3k )
150+ if args .run_cherrypy_py3k :
151+ p5 = Process (target = run_cherrypy_server_with_python3 )
152+ p5 .daemon = True
153+ procs .append (p5 )
154+
132155 for p in procs :
133156 p .start ()
134157 logging .info ("Starting process... %d" % p .pid )
0 commit comments