class documentation

class FailingResponder(Responder): (source)

View In Hierarchy

Variant of `Responder` which is capable of detecting incorrect responses. This class adds a ``sentinel`` parameter to ``__init__``, and its ``submit`` will raise `.ResponseNotAccepted` if it detects that sentinel value in the stream. .. versionadded:: 1.0

Method __init__ Imprint this `Responder` with necessary parameters.
Method submit Act on ``stream`` data, potentially returning responses.
Instance Variable failure_index Undocumented
Instance Variable sentinel Undocumented
Instance Variable tried Undocumented

Inherited from Responder:

Method pattern_matches Generic "search for pattern in stream, using index" behavior.
Instance Variable index Undocumented
Instance Variable pattern Undocumented
Instance Variable response Undocumented
def __init__(self, pattern, response, sentinel): (source)

Imprint this `Responder` with necessary parameters. :param pattern: A raw string (e.g. ``r"\[sudo\] password for .*:"``) which will be turned into a regular expression. :param response: The string to submit to the subprocess' stdin when ``pattern`` is detected.

def submit(self, stream): (source)

Act on ``stream`` data, potentially returning responses. :param str stream: All data read on this stream since the beginning of the session. :returns: An iterable of ``str`` (which may be empty). .. versionadded:: 1.0

failure_index: int = (source)

Undocumented

sentinel = (source)

Undocumented

Undocumented