On Mon, 5 Dec 2005 11:52:11 +0800 (CST), Suet Lung Cheung <[EMAIL PROTECTED]>
wrote:
Hi Paul,
Thanks for your help. However it seems doesn't work. When I press Ctrl-C, it even
doesn't call the stopService() function. I print a "Hello World" inside the
function but it doesn't say hello to the world. And I've tried returning a Deferred from
this function. However it quit before the callback is called. Can u give advice on this?
Do u know where can I find some example about this? Thanks a lot.
Snow Dragon
[EMAIL PROTECTED]:~$ cat > stop-service.py
from twisted.application import service
application = service.Application("stop-service demo")
class Demo(service.Service):
def stopService(self):
print "Stopping!"
Demo().setServiceParent(application)
[EMAIL PROTECTED]:~$ twistd -noy stop-service.py
2005/12/05 00:23 EST [-] Log opened.
2005/12/05 00:23 EST [-] twistd SVN-Trunk (/usr/bin/python 2.4.2) starting up
2005/12/05 00:23 EST [-] reactor class:
twisted.internet.selectreactor.SelectReactor
2005/12/05 00:23 EST [-] Loading stop-service.py...
2005/12/05 00:23 EST [-] Loaded.
2005/12/05 00:23 EST [-] Received SIGINT, shutting down.
2005/12/05 00:23 EST [-] Stopping! < - - - - - - - - - stopService
2005/12/05 00:23 EST [-] Main loop terminated.
2005/12/05 00:23 EST [-] Server Shut Down.
[EMAIL PROTECTED]:~$
Jean-Paul
_______________________________________________
Twisted-web mailing list
[email protected]
http://twistedmatrix.com/cgi-bin/mailman/listinfo/twisted-web