[Twisted-Python] Re: Telnet Client as Line Receiver?

Christopher Armstrong radix at twistedmatrix.com
Tue Oct 28 06:40:02 EST 2003


On Mon, Oct 27, 2003 at 08:41:11PM -0000, Mark Evans wrote:
> More curiosity:
> 
> * What is the preferred mechanism for local echo
> of characters on the client side?  Presumably
> TM has hooks for such things, with all its event
> handling capabilities.

No, there is no special support for echoing characters back. This is a
user-interface issue, and doesn't have anything to do with the
(non-existent) TelnetClient client protocol implementation.

> * The Shell class lives in telnet.py and the Telnet
> superclass lives in a file with the same name.
> I suggest a file name change here, maybe telnet_shell.py.

Yes, but Python has namespaces, unlike C, or whatever else you may be
used to. t.manhole.telnet is not t.protocols.telnet.

> * The factoring between Telnet class and Shell doesn't
> seem clean, on initial impression.  Telnet is already
> halfway towards a server-only functionality, all of
> which should be factored into Shell.  The Telnet protocol
> class should be agnostic between server and client
> usage.

No. Shell (in twisted.manhole.telnet) should not be where the server
implementation of the telnet protocol lives. Shell is for a remote
Python shell, not a general purpose Telnet server protocol
implementation.

twisted.protocols.telnet.Telnet should remain as the server
implementation of the Telnet protocol, and t.p.telnet.TelnetClient
should be added, using recommendations I pointed out in my other post.

Hope that helps!

-- 
 Twisted | Christopher Armstrong: International Man of Twistery
  Radix  |          Release Manager,  Twisted Project
---------+            http://radix.twistedmatrix.com




More information about the Twisted-Python mailing list