[Twisted-Python] twisted.protocols.telnet is deprecated. But how should I migrate?
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?
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
Jean-Paul Calderone wrote:
On Sat, 07 Jun 2008 20:24:32 +0200, Marcin Kasperski <marcin.kasperski@softax.com.pl> wrote:
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 This link is the information I've been trying to find for two weeks. :) Thanks for posting it, and to the OP for posting the right question. Trying to learn twisted and python at the same time. So far I've got a server that will allow chatting via SSH or TCP, I've been attempting to get telnet negotiation working right on the straight TCP side, this should help a lot.
participants (3)
-
Curt
-
Jean-Paul Calderone
-
Marcin Kasperski