By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
443,768 Members | 2,054 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 443,768 IT Pros & Developers. It's quick & easy.

Using twisted,

P: n/a

The trouble is, I havent got a clue where to start and would
appreciate
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:

http://twistedmatrix.com/documents/c...wisted.conch.i
nsults.html

And for the telnet implementation:

http://twistedmatrix.com/documents/c...wisted.conch.t
elnet.html

Looking through those docs quickly leads me into quite a bewildering
maze.

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 :)

Snippet;

C=telnetlib.Telnet(self.TCPAddress)
.
.
((connection / password handling etc..))
.
.
if AliasedSubbedCmd=='__interact':
if system=='UNIX':
retkey='^D'
else:
retkey='^Z'
print '\nTELNET entity '+self.Name+' entering interactive
mode. Use '+retkey+' to come back\n'
C.mt_interact()
....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?
Thanks,

Matt.

This email is confidential and may be privileged. If you are not the intended recipient please notify the sender immediately and delete the email fromyour 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 ofDigica.
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
http://www.digica.com

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
http://www.digica.com
Oct 6 '06 #1
Share this question for a faster answer!
Share on Google+

This discussion thread is closed

Replies have been disabled for this discussion.