
On Sat, 07 Jun 2008 20:24:32 +0200, Marcin Kasperski <marcin.kasperski@softax.com.pl> wrote:
Long time ago I wrote some code using twisted.protocols.telnet.Telnet. Now I get:
DeprecationWarning: As of Twisted 2.1, twisted.protocols.telnet is deprecated. See twisted.conch.telnet for the current, supported API.
The problem is ... I do not know how to migrate. Bare substitution of twisted.conch.telnet instead of twisted.protocols.telnet does not work (my code, which subclassed Telnet and provided welcomeMessage, checkUserAndPass, and loggedIn, simply is not called).
I checked for docs, but twisted.conch has only some docs about SSH clients, and by looking only at the code I can't figure what should I do. I suspect that I should use AuthenticatingTelnetProtocol but I do not understand how should I do it (what is this portal, why should I return some other protocol).
I grepped through all examples for this class, but found nothing.
So: how should one migrate twisted.telnet.Telnet to twisted.conch.telnet? Does there exist any example of simple telnet server?
http://twistedmatrix.com/pipermail/twisted-python/2007-June/015623.html may help somewhat. There are also some examples in doc/conch/examples/ and on the website. twisted.conch.telnet.Telnet is a much more complete telnet implementation. It also lacks the application-specific features that were present in twisted.protocols.telnet.Telnet, like welcomeMessage and loggedIn. AuthenticatingTelnetProtocol is vaguely like the old Telnet class, but it is intended more as an example of what kind of things you can do, rather than a robust base class for whatever your application requires. Jean-Paul