#3 Added spawn.expect_lookahead() method

open
nobody
None
5
2004-01-15
2004-01-15
Ed Warnicke
No

This patch adds a method spawn.expect_lookahead() which
takes
exactly the same arguments as spawn.expect() and
behaves the same way, except that it doesn't strip any
data from the buffer, it
essentially does the following after it calls
spawn.expect():

self.buffer = self.before + self.match.group() +
self.buffer

This is useful when you need to lookahead to decide
which of several pexpect functions to run to continue a
conversation.

Discussion

  • Ed Warnicke
    Ed Warnicke
    2004-01-15