@@ -31,6 +31,13 @@ def index(self):
31
31
cherrypy .quickstart (Root (), '/' , config )
32
32
33
33
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
+
34
41
35
42
def run_gevent_server (host = "127.0.0.1" , port = 9001 ):
36
43
from gevent import monkey ; monkey .patch_all ()
@@ -89,7 +96,11 @@ class ServerFactory(WebSocketServerFactory):
89
96
parser .add_argument ('--run-all' , dest = 'run_all' , action = 'store_true' ,
90
97
help = 'Run all servers backend' )
91
98
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' )
93
104
parser .add_argument ('--run-gevent-server' , dest = 'run_gevent' , action = 'store_true' ,
94
105
help = 'Run the gevent server backend' )
95
106
parser .add_argument ('--run-tornado-server' , dest = 'run_tornado' , action = 'store_true' ,
@@ -129,6 +140,18 @@ class ServerFactory(WebSocketServerFactory):
129
140
p3 .daemon = True
130
141
procs .append (p3 )
131
142
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
+
132
155
for p in procs :
133
156
p .start ()
134
157
logging .info ("Starting process... %d" % p .pid )
0 commit comments