[Twisted-Python] Re: Conch/insults -- using HistoricRecvLine

Bjoern Schliessmann chronoss at gmx.de
Thu Dec 13 16:50:54 EST 2007

At first, thank you for the detailed explanation :)

Jean-Paul Calderone wrote:

> I haven't had a chance to work with this part of Twisted much
> recently, but after my most recent attempt, I think I decided that
> the approach taken by HistoricRecvLine doesn't lead to easily
> extensible or reusable code.  I had been investigating an API
> based on an explicit buffer object which allowed different
> components to be isolated from each other.  You can take a look at
> the incomplete results of this (again, no documentation, sorry)
> here: 

Mh, I'm not too familiar with the insults API. I'll have to look
into it deeper first.

> If you want to stick with HistoricRecvLine

I don't really want. As you mentioned, it has a full telnet
implementation a few layers down, which I don't need at all. 

I have a custom text protocol which is for quite some time "abused"
for manual input, so I'm trying to add some minimal convenience on
the server side.

> then the only suggestion that comes to mind to make is for you to
> keep your original LineReceiver sub-class separate from your
> HistoricRecvLine subclass.  Give a reference to the former to the
> latter: have the HistoricvRecvLine subclass's lineReceived method
> call lineReceived on the LineReceiver subclass (which may not need
> to be a LineReceiver subclass anymore); give the LineReceiver
> subclass a transport which knows how to interact with the terminal
> in a way which is not disruptive to HistoricRecvLine's use of it.

Since I haven't achieved setting up a working HistoricRecvLine yet,
and I wouldn't like to have such deep telnet functionality, I'm
going to look into other options. The most simple would be using
rlwrap (3rd party program) for all clients which is work. 

What I'd like most is just to have the server interpret a few
keystrokes specially, for a history function (saving the last
commands given in this session) and _perhaps_ a basic autocompleter
for a set of (~10) commands. 

I'm afraid I have no specific questions for now (but I appreciate
your offer). I think I'll look into the implementation of
LineReceiver and try to figure out where I can tap dataReceived to
catch (and filter out) a few special keystrokes.



BOFH excuse #295:

The Token fell out of the ring. Call us when you find it.

More information about the Twisted-Python mailing list