diff options
author | Jeff Quast <contact@jeffquast.com> | 2015-09-20 13:57:54 -0700 |
---|---|---|
committer | Jeff Quast <contact@jeffquast.com> | 2015-09-20 14:45:06 -0700 |
commit | 27f512d0b6bb290a6a79e4af95d31f7a3555d728 (patch) | |
tree | f9cc22cf81fb14bf2b9994e9b4db44e402796522 /pexpect/pty_spawn.py | |
parent | faff3e605b2e1d6d30d3f9ded95473ccfbb8daf0 (diff) | |
download | pexpect-git-27f512d0b6bb290a6a79e4af95d31f7a3555d728.tar.gz |
Improve docstrings about searchwindowsize value
In class initializer:
- introduce its default value and its relationship
to the *maxread* keyword argument.
- reduce explanation search cost relationship
in expect method:
- document its similar re-use of class attribute
and keyword argument 'searchwindowsize' when the
value of -1 is used.
Diffstat (limited to 'pexpect/pty_spawn.py')
-rw-r--r-- | pexpect/pty_spawn.py | 15 |
1 files changed, 6 insertions, 9 deletions
diff --git a/pexpect/pty_spawn.py b/pexpect/pty_spawn.py index 73dec56..6a71741 100644 --- a/pexpect/pty_spawn.py +++ b/pexpect/pty_spawn.py @@ -78,15 +78,12 @@ class spawn(SpawnBase): output are read back from the child. This feature is useful in conjunction with searchwindowsize. - The searchwindowsize attribute sets the how far back in the incoming - seach buffer Pexpect will search for pattern matches. Every time - Pexpect reads some data from the child it will append the data to the - incoming buffer. The default is to search from the beginning of the - incoming buffer each time new data is read from the child. But this is - very inefficient if you are running a command that generates a large - amount of data where you want to match. The searchwindowsize does not - affect the size of the incoming data buffer. You will still have - access to the full buffer after expect() returns. + When the keyword argument *searchwindowsize* is None (default), the + full buffer is searched at each iteration of receiving incoming data. + The default number of bytes scanned at each iteration is very large + and may be reduced to collaterally reduce search cost. After + :meth:`~.expect` returns, the full buffer attribute remains up to + size *maxread* irrespective of *searchwindowsize* value. The logfile member turns on or off logging. All input and output will be copied to the given file object. Set logfile to None to stop |