class Telnet(protocol.Protocol): (source)
Known subclasses: twisted.conch.telnet.TelnetTransport
Method | __init__ |
Undocumented |
Method | application |
Called with application-level data. |
Method | command |
Undocumented |
Method | connection |
Called when the connection is shut down. |
Method | data |
Called whenever data is received. |
Method | disable |
Signal a programming error by raising an exception. |
Method | disable |
Signal a programming error by raising an exception. |
Method | do |
Undocumented |
Method | do |
Undocumented |
Method | do |
Undocumented |
Method | do |
Undocumented |
Method | do |
Undocumented |
Method | dont |
Undocumented |
Method | dont |
Undocumented |
Method | dont |
Undocumented |
Method | dont |
Undocumented |
Method | dont |
Undocumented |
Method | enable |
Reject all attempts to enable options. |
Method | enable |
Reject all attempts to enable options. |
Method | get |
Undocumented |
Method | negotiate |
Undocumented |
Method | request |
Send a negotiation message for the option about with data as the payload. |
Method | telnet_ |
Undocumented |
Method | telnet_ |
Undocumented |
Method | telnet_ |
Undocumented |
Method | telnet_ |
Undocumented |
Method | unhandled |
Called for commands for which no handler is installed. |
Method | unhandled |
Called for subnegotiations for which no handler is installed. |
Method | will |
Indicate our willingness to enable an option. |
Method | will |
Undocumented |
Method | will |
Undocumented |
Method | will |
Undocumented |
Method | will |
Undocumented |
Method | wont |
Indicate we are not willing to enable an option. |
Method | wont |
Undocumented |
Method | wont |
Undocumented |
Method | wont |
Undocumented |
Method | wont |
Undocumented |
Class Variable | do |
Undocumented |
Class Variable | dont |
Undocumented |
Class Variable | will |
Undocumented |
Class Variable | wont |
Undocumented |
Instance Variable | command |
Undocumented |
Instance Variable | command |
A mapping of bytes to callables. When a telnet command is received, the command byte (the first byte after IAC) is looked up in this dictionary. If a callable is found, it is invoked with the argument of the command, or None if the command takes no argument... |
Instance Variable | commands |
Undocumented |
Instance Variable | negotiation |
A mapping of bytes to callables. When a subnegotiation command is received, the command byte (the first byte after SB) is looked up in this dictionary. If a callable is found, it is invoked with the argument of the subnegotiation... |
Instance Variable | options |
A mapping of option bytes to their current state. This state is likely of little use to user code. Changes should not be made to it. |
Instance Variable | state |
A string indicating the current parse state. It can take on the values "data", "escaped", "command", "newline", "subnegotiation", and "subnegotiation-escaped". Changes should not be made to it. |
Instance Variable | transport |
This protocol's transport object. |
Class | _ |
Represents the state of an option on both sides of a telnet connection. |
Method | _do |
Undocumented |
Method | _dont |
Undocumented |
Method | _will |
Undocumented |
Method | _wont |
Undocumented |
Method | _write |
Undocumented |
Inherited from Protocol
:
Method | log |
Return a prefix matching the class name, to identify log messages related to this protocol instance. |
Class Variable | factory |
Undocumented |
Inherited from BaseProtocol
(via Protocol
):
Method | connection |
Called when a connection is made. |
Method | make |
Make a connection to a transport and a server. |
Instance Variable | connected |
Undocumented |
twisted.conch.telnet.TelnetTransport
Called when the connection is shut down.
Clear any circular references here, and any external references to this Protocol. The connection has been closed.
Parameters | |
reason:twisted.python.failure.Failure | Undocumented |
Called whenever data is received.
Use this method to translate to a higher-level message. Usually, some callback will be made upon the receipt of each complete protocol message.
Parameters | |
data | a string of indeterminate length. Please keep in mind that you will probably need to buffer some data, as partial (or multiple) protocol messages may be received! I recommend that unit tests for protocols call through to this method with differing chunk sizes, down to one byte at a time. |
twisted.conch.telnet.TelnetTransport
Signal a programming error by raising an exception.
enableLocal
must return true for the given value of option in order for this method to be called. If a subclass of Telnet
overrides enableLocal to allow certain options to be enabled, it must also override disableLocal to disable those options.
Raises | |
NotImplementedError | Always raised. |
twisted.conch.telnet.TelnetTransport
Signal a programming error by raising an exception.
enableRemote
must return true for the given value of option in order for this method to be called. If a subclass of Telnet
overrides enableRemote to allow certain options to be enabled, it must also override disableRemote tto disable those options.
Raises | |
NotImplementedError | Always raised. |
Send a negotiation message for the option about with data as the payload.
Parameters | |
about | Undocumented |
data:bytes | the payload |
See Also | |
ITelnetTransport.requestNegotiation |
twisted.conch.telnet.TelnetTransport
Called for commands for which no handler is installed.
twisted.conch.telnet.TelnetTransport
Called for subnegotiations for which no handler is installed.
A mapping of bytes to callables. When a telnet command is received, the command byte (the first byte after IAC) is looked up in this dictionary. If a callable is found, it is invoked with the argument of the command, or None if the command takes no argument. Values should be added to this dictionary if commands wish to be handled. By default, only WILL, WONT, DO, and DONT are handled. These should not be overridden, as this class handles them correctly and provides an API for interacting with them.
A mapping of bytes to callables. When a subnegotiation command is received, the command byte (the first byte after SB) is looked up in this dictionary. If a callable is found, it is invoked with the argument of the subnegotiation. Values should be added to this dictionary if subnegotiations are to be handled. By default, no values are handled.
A mapping of option bytes to their current state. This state is likely of little use to user code. Changes should not be made to it.
A string indicating the current parse state. It can take on the values "data", "escaped", "command", "newline", "subnegotiation", and "subnegotiation-escaped". Changes should not be made to it.