remotelogin/connections/terminal/__init__.py
def expect(
        self,
        *expect_value_list,
        flags=0,
        remove_prompt_to_compare=True,
        all_matches_required=False,
        all_matches_in_sequence=False,
        callback=None,
        multiple=False,
        store=None,
        **kwargs
    ):
        """ execute a expect on one or more patterns

        Args:
            *expect_value_list:
            flags (int): regular expression flags to apply to all regexes
            remove_prompt_to_compare (bool): in most cases we want to compare without the prompt,
                                             in some cases we want to check for the prompt (like when checking for prompt)
            all_matches_required (bool): whether accept the match only if all matches are found
            all_matches_in_sequence (bool): whether to accept a match when all matches appeared in order
            callback (function):
            multiple (bool):
            store (list): if not None we will append values for each expect
            **kwargs:

        Returns:
            expect.Expect

        """
        exp_object = expect.Expect(
            self.last_cmd_sent,
            all_matches_in_sequence=all_matches_in_sequence,
            all_matches_required=all_matches_required,
            continue_matching=multiple,
        )

        if callback and not callable(callback):
            raise ValueError("The call_back should be a function")

        for v in expect_value_list:
            if not isinstance(v, expect.ExpectedRegex):
                v = expect.ExpectedRegex(
                    v, flags=flags, remove_prompt_to_compare=remove_prompt_to_compare
                )
            exp_object.add(v)

        chain = kwargs.pop("chain", store is not None or self._chain_all_expects)

        ret = self._expect_cmd(exp_object, **kwargs)

        if callback:
            callback(ret)

        if store is not None:
            store.append(ret)

        if chain:
            return self
        else:
            return ret.results()
 execute a expect on one or more patterns

        Args:
            *expect_value_list:
            flags (int): regular expression flags to apply to all regexes
            remove_prompt_to_compare (bool): in most cases we want to compare without the prompt,
                                             in some cases we want to check for the prompt (like when checking for prompt)
            all_matches_required (bool): whether accept the match only if all matches are found
            all_matches_in_sequence (bool): whether to accept a match when all matches appeared in order
            callback (function):
            multiple (bool):
            store (list): if not None we will append values for each expect
            **kwargs:

        Returns:
            expect.Expect

        
execute a expect on one or more patterns
execute a expect on one or more patterns
def expect(
        self,
        *expect_value_list,
        flags=0,
        remove_prompt_to_compare=True,
        all_matches_required=False,
        all_matches_in_sequence=False,
        callback=None,
        multiple=False,
        store=None,
        **kwargs
    ):
        exp_object = expect.Expect(
            self.last_cmd_sent,
            all_matches_in_sequence=all_matches_in_sequence,
            all_matches_required=all_matches_required,
            continue_matching=multiple,
        )
        if callback and not callable(callback):
            raise ValueError("The call_back should be a function")
        for v in expect_value_list:
            if not isinstance(v, expect.ExpectedRegex):
                v = expect.ExpectedRegex(
                    v, flags=flags, remove_prompt_to_compare=remove_prompt_to_compare
                )
            exp_object.add(v)
        chain = kwargs.pop("chain", store is not None or self._chain_all_expects)
        ret = self._expect_cmd(exp_object, **kwargs)
        if callback:
            callback(ret)
        if store is not None:
            store.append(ret)
        if chain:
            return self
        else:
            return ret.results()
def expect ( self , * expect_value_list , flags = 0 , remove_prompt_to_compare = True , all_matches_required = False , all_matches_in_sequence = False , callback = None , multiple = False , store = None , ** kwargs ) : exp_object = expect . Expect ( self . last_cmd_sent , all_matches_in_sequence = all_matches_in_sequence , all_matches_required = all_matches_required , continue_matching = multiple , ) if callback and not callable ( callback ) : raise ValueError ( "The call_back should be a function" ) for v in expect_value_list : if not isinstance ( v , expect . ExpectedRegex ) : v = expect . ExpectedRegex ( v , flags = flags , remove_prompt_to_compare = remove_prompt_to_compare ) exp_object . add ( v ) chain = kwargs . pop ( "chain" , store is not None or self . _chain_all_expects ) ret = self . _expect_cmd ( exp_object , ** kwargs ) if callback : callback ( ret ) if store is not None : store . append ( ret ) if chain : return self else : return ret . results ( )
execute a expect on one or more patterns
execute a expect on one or more patterns
""" execute a expect on one or more patterns

        Args:
            *expect_value_list:
            flags (int): regular expression flags to apply to all regexes
            remove_prompt_to_compare (bool): in most cases we want to compare without the prompt,
                                             in some cases we want to check for the prompt (like when checking for prompt)
            all_matches_required (bool): whether accept the match only if all matches are found
            all_matches_in_sequence (bool): whether to accept a match when all matches appeared in order
            callback (function):
            multiple (bool):
            store (list): if not None we will append values for each expect
            **kwargs:

        Returns:
            expect.Expect

        """
None
self
flags
regular expression flags to apply to all regexes
regular expression flags to apply to all regexes
remove_prompt_to_compare
in most cases we want to compare without the prompt,
in some cases we want to check for the prompt (like when checking for prompt)
in most cases we want to compare without the prompt in some cases we want to check for the prompt ( like when checking for prompt )
all_matches_required
whether accept the match only if all matches are found
whether accept the match only if all matches are found
all_matches_in_sequence
whether to accept a match when all matches appeared in order
whether to accept a match when all matches appeared in order
callback
None
multiple
None
store
if not None we will append values for each expect
if not None we will append values for each expect
*expect_value_list
None
**kwargs
None