[Twisted-Python] Insults, Can't write from connectionMade?

Mike Pelletier mike at mkp.ca
Sat Jul 8 11:55:55 EDT 2006


Hello, twisted Twisted coders.  I am trying to get familiarised with 
twisted.conch.insults.  I've run into some behaviour I cannot explain.  
Attached is a .tac including the following excerpt:

class MyTerminalProtocol(insults.TerminalProtocol):
    width = 80
    height = 24
    
    def connectionMade(self):
        self.terminalSize(self.width, self.height)
        self.terminal.write(" world\n")

    def terminalSize(self, width, height):
        self.width, self.height = width, height
        self.terminal.eraseDisplay()
        self.terminal.write("Hello,")

When a connection is made, the screen is cleared and "Hello," is written, 
but " world\n" is not (or at least it never appears on the terminal).  Why 
is "world\n" not written?

Oddly (or perhaps revealingly for someone with more clues than me), when in a 
previous version I did not use TelnetTransport and TelnetBootstrapProtocol, I 
was able to write just fine from connectionMade.

TIA for a liberal and violent application of the clue stick.

Mike.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: insults_proto.tac
Type: application/x-python
Size: 1102 bytes
Desc: not available
Url : http://twistedmatrix.com/pipermail/twisted-python/attachments/20060708/13b9d5aa/attachment.bin 


More information about the Twisted-Python mailing list