[Twisted-Python] twistd tap file are not created

Pet petshmidt at googlemail.com
Mon Mar 9 06:02:01 MDT 2009


Hello,

I'm trying an example from twisted book and when I run this:
twistd -n reverse_app.py

application works, but no .tap file is created

Another question, how are twisted daemons actually stopped?

Pet

reverse_app.py
from twisted.application import service
import reverse

application = service.Application("Reverser")
reverserService = reverse.ReverserService()
reverserService.setServiceParent(application)



reverse.py:
from twisted.application import service, internet
from twisted.internet import protocol, reactor
from twisted.protocols import basic

def reverse(string):
    return string[::-1]

class ReverserProtocol(basic.LineReceiver):
    def lineReceived(self, line):
        if hasattr(self, 'handle_' + line):
            getattr(self, 'handle_' + line)()
        else:
            self.sendLine(reverse(line))

    def handle_quit(self):
        self.transport.loseConnection()

class ReverserFactory(protocol.ServerFactory):
    protocol = ReverserProtocol

class ReverserService(internet.TCPServer):
    def _  _init_  _(self):
        internet.TCPServer.__init__(self, 2323, ReverserFactory())




More information about the Twisted-Python mailing list