Using twisted, not telnetlib for interactive telnet (WAS: RE: Improving telnetlib)
Matthew.Warren at Digica.com
Fri Oct 6 06:03:37 EDT 2006
> >The trouble is, I havent got a clue where to start and would
> >a couple of pointers to get me going...
> I'd suggest taking a look at Twisted, which contains a more complete
> telnet implementation (not as important for being able to launch vi),
> an ssh implementation (which you might want to use instead of telnet),
> a VT102 implementation (which is actually what will help you
> run programs
> that want to fiddle around with the cursor in fancy ways), as
> well as a
> fair amount of work towards a simple terminal emulator (to
> help you keep
> track of what vi has done to your virtual terminal).
> API docs for insults:
> And for the telnet implementation:
Looking through those docs quickly leads me into quite a bewildering
As a kind of way to perhaps get me heading in the right direction and
understanding how I start to hang all that together to get what I want,
I would appreciate it if anyone could look at this little code snippet I
have, and illustrate how I can end up doing the same thing with twisted,
but end up with an interactive connection that can handle vi... From
there I will happily trundle off by myself.
I think I'm looking for help in getting that AhA! moment :)
((connection / password handling etc..))
print '\nTELNET entity '+self.Name+' entering interactive
mode. Use '+retkey+' to come back\n'
...at this point I am essentially on the remote system command line,
with a very dumb terminal. How could I do this in twisted and end up
with a fairly clever terminal?
This email is confidential and may be privileged. If you are not the intended recipient please notify the sender immediately and delete the email from your computer.
You should not copy the email, use it for any purpose or disclose its contents to any other person.
Please note that any views or opinions presented in this email may be personal to the author and do not necessarily represent the views or opinions of Digica.
It is the responsibility of the recipient to check this email for the presence of viruses. Digica accepts no liability for any damage caused by any virus transmitted by this email.
UK: Phoenix House, Colliers Way, Nottingham, NG8 6AT UK
Reception Tel: + 44 (0) 115 977 1177
Support Centre: 0845 607 7070
Fax: + 44 (0) 115 977 7000
SOUTH AFRICA: Building 3, Parc du Cap, Mispel Road, Bellville, 7535, South Africa
Tel: + 27 (0) 21 957 4900
Fax: + 27 (0) 21 948 3135
More information about the Python-list