MCPcopy Create free account
hub / github.com/pexpect/pexpect / expect_loop

Method expect_loop

pexpect/spawnbase.py:434–442  ·  view source on GitHub ↗

This is the common loop used inside expect. The 'searcher' should be an instance of searcher_re or searcher_string, which describes how and what to search for in the input. See expect() for other arguments, return value and exceptions.

(self, searcher, timeout=-1, searchwindowsize=-1)

Source from the content-addressed store, hash-verified

432 return exp.expect_loop(timeout)
433
434 def expect_loop(self, searcher, timeout=-1, searchwindowsize=-1):
435 '''This is the common loop used inside expect. The 'searcher' should be
436 an instance of searcher_re or searcher_string, which describes how and
437 what to search for in the input.
438
439 See expect() for other arguments, return value and exceptions. '''
440
441 exp = Expecter(self, searcher, searchwindowsize)
442 return exp.expect_loop(timeout)
443
444 def read(self, size=-1):
445 '''This reads at most "size" bytes from the file (less if the read hits

Callers

nothing calls this directly

Calls 2

expect_loopMethod · 0.95
ExpecterClass · 0.85

Tested by

no test coverage detected