class HelloWorld(object):
def index(self):
return "Hello World!"
index.exposed = True
cherrypy.tree.mount(HelloWorld(), "/")
cherrypy.engine.start()
# Put your main loop in a try finally to ensure that we tell
# cherrypy to stop when we're done (even if we have an unhandled exception).
# This is important, or it will hang your process when your
# application doesn't exit properly.
try:
for x in range(15):
print "doing my own main loop", x
import time
time.sleep(1) # sleep so that we can confirm the server is running
finally:
print "I'm done, and am now exiting."
cherrypy.engine.stop()
Lakin
Not broken, just different. In 3.1 you make two calls: engine.start(),
then engine.block(). That change was made in part to make what you're
doing more explicit, not to mention more obvious that the feature is
both there and desirable.
Robert Brewer
fuma...@aminus.org
I don't think it's broken.
Lakin