Skip to content

Add keywords Read Until Multiple and Read Until Multiple Regexp equivalent to Read Until and Read Until Regexp but accepting multiple expectations #476

Description

@hpierre001

Add keywords Read Until Multiple and Read Until Multiple Regexp equivalent to Read Until and Read Until Regexp but accepting multiple expectations
Those keywords would then return the index of the matched expectation and the output.
An argument could be used to add the prompt as an expectation with index -1.

The signatures would be:

def read_until_multiple(*expected, loglevel=None, until_prompt=False, strip_prompt=False):
def read_until_multiple_regexp(*regexp, loglevel=None, until_prompt=False, strip_prompt=False):

This would help handling cases where there is multiple behaviors such as an error returning to the prompt while the normal behavior would request other actions from the user. For example requesting a manual entry on linux, if the entry is not found an error is returned while otherwise we are on the requested manual entry.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions