[Twisted-Python] using stdio with Twisted

Neurophyre listbox at evernex.com
Mon Mar 19 22:16:23 EDT 2007


I'm building an old-school BBS client using Twisted.  It needs to  
take user input, parse it, send messages over the wire and get  
messages back and display them.. the usual.  I'm just now getting to  
writing the UI and have run into a couple problems.

First, whether using protocol.Protocol or  
protocols.basic.LineReceiver (in raw mode) with  
internet.stdio.StandardIO, I have the same problem: the dataReceived  
(or rawDataReceived in the case of LineReceiver in raw mode)  
functions are only called after one types some text and hits return.   
I need to process input on a keystroke level, since there will be  
prompts at which a single keystroke will do things.

Second, I was looking at  
twisted.conch.insults.insults.TerminalProtocol after some Googling --  
does anyone know if I can just drop this in in place of  
protocols.basic.LineReceiver (or whatever) and have it work properly,  
or does it require some special invocation and/or grab stdio by itself?


More information about the Twisted-Python mailing list