A trivial extension of the telnet protocol class useful to unit tests.

Method __init__ Undocumented
Method applicationDataReceived Record the given data in self.events.
Method unhandledCommand Record the given command in self.events.
Method unhandledSubnegotiation Record the given subnegotiation command in self.events.

Inherited from Telnet:

Instance Variable commandMap 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.
Instance Variable negotiationMap 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.
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.
Method getOptionState Undocumented
Method will Indicate our willingness to enable an option.
Method wont Indicate we are not willing to enable an option.
Method do Undocumented
Method dont Undocumented
Method requestNegotiation Send a negotiation message for the option about with data as the payload.
Method dataReceived Called whenever data is received.
Method connectionLost Called when the connection is shut down.
Method commandReceived Undocumented
Method negotiate Undocumented
Method telnet_WILL Undocumented
Method will_no_false Undocumented
Method will_no_true Undocumented
Method will_yes_false Undocumented
Method will_yes_true Undocumented
Method telnet_WONT Undocumented
Method wont_no_false Undocumented
Method wont_no_true Undocumented
Method wont_yes_false Undocumented
Method wont_yes_true Undocumented
Method telnet_DO Undocumented
Method do_no_false Undocumented
Method do_no_true Undocumented
Method do_yes_false Undocumented
Method do_yes_true Undocumented
Method telnet_DONT Undocumented
Method dont_no_false Undocumented
Method dont_no_true Undocumented
Method dont_yes_false Undocumented
Method dont_yes_true Undocumented
Method enableLocal Reject all attempts to enable options.
Method enableRemote Reject all attempts to enable options.
Method disableLocal Signal a programming error by raising an exception.
Method disableRemote Signal a programming error by raising an exception.
Method _write Undocumented
Class _OptionState 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

Inherited from Protocol (via Telnet):

Method logPrefix Return a prefix matching the class name, to identify log messages related to this protocol instance.

Inherited from BaseProtocol (via Telnet, Protocol):

Method makeConnection Make a connection to a transport and a server.
Method connectionMade Called when a connection is made.
def __init__(self):
Undocumented
def applicationDataReceived(self, data):

Record the given data in self.events.

def unhandledCommand(self, command, data):

Record the given command in self.events.

def unhandledSubnegotiation(self, command, data):

Record the given subnegotiation command in self.events.

API Documentation for twisted, generated by pydoctor at 2020-03-25 17:34:30.