Implements interfaces: twisted.conch.interfaces.ISession

A stub ISession implementation for our StubAvatar. The instance variables generally keep track of method invocations so that we can test that the methods were called.

Instance Variable avatar the StubAvatar we are adapting.
Instance Variable ptyRequest if present, the terminal, window size, and modes passed to the getPty method.
Instance Variable windowChange if present, the window size passed to the windowChangned method.
Instance Variable shellProtocol if present, the SSHSessionProcessProtocol passed to the openShell method.
Instance Variable shellTransport if present, the EchoTransport connected to shellProtocol.
Instance Variable execProtocol if present, the SSHSessionProcessProtocol passed to the execCommand method.
Instance Variable execTransport if present, the EchoTransport connected to execProtocol.
Instance Variable execCommandLine if present, the command line passed to the execCommand method.
Instance Variable gotEOF if present, an EOF message was received.
Instance Variable gotClosed if present, a closed message was received.
Method __init__ Store the avatar we're adapting.
Method getPty If the terminal is 'bad', fail. Otherwise, store the information in the ptyRequest variable.
Method windowChanged If all the window sizes are 0, fail. Otherwise, store the size in the windowChange variable.
Method openShell If we have gotten a shell request before, fail. Otherwise, store the process protocol in the shellProtocol variable, connect it to the EchoTransport and store that as shellTransport.
Method execCommand If the command is 'true', store the command, the process protocol, and the transport we connect to the process protocol. Otherwise, just store the command and raise an error.
Method eofReceived Note that EOF has been received.
Method closed Note that close has been received.
avatar =
the StubAvatar we are adapting.
ptyRequest =
if present, the terminal, window size, and modes passed to the getPty method.
windowChange =
if present, the window size passed to the windowChangned method.
shellProtocol =
if present, the SSHSessionProcessProtocol passed to the openShell method.
shellTransport =
if present, the EchoTransport connected to shellProtocol.
execProtocol =
if present, the SSHSessionProcessProtocol passed to the execCommand method.
execTransport =
if present, the EchoTransport connected to execProtocol.
execCommandLine =
if present, the command line passed to the execCommand method.
gotEOF =
if present, an EOF message was received.
gotClosed =
if present, a closed message was received.
def __init__(self, avatar):

Store the avatar we're adapting.

def getPty(self, terminal, window, modes):

If the terminal is 'bad', fail. Otherwise, store the information in the ptyRequest variable.

def windowChanged(self, window):

If all the window sizes are 0, fail. Otherwise, store the size in the windowChange variable.

def openShell(self, pp):

If we have gotten a shell request before, fail. Otherwise, store the process protocol in the shellProtocol variable, connect it to the EchoTransport and store that as shellTransport.

def execCommand(self, pp, command):

If the command is 'true', store the command, the process protocol, and the transport we connect to the process protocol. Otherwise, just store the command and raise an error.

def eofReceived(self):

Note that EOF has been received.

def closed(self):

Note that close has been received.

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