You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The 'increasingly useful' case in Readme.rst seems to show when we initialize bash object, it keeps the standard output as same input for all subsequent bash function calls. But it is not the case. Instead, each bash object initialization or bash function call will update the standard output as input for next bash call in a chain fashion.
Snippet from Readme.rst:
This becomes increasingly useful if you later need to reuse one such command::
>>> b = bash('ls tmp')
>>> b
a.txt
bash.py
bash.pyc
tests.py
tests.pyc
>>> b.bash('grep ".pyc"')
bash.pyc
tests.pyc
>>> b.bash('grep ".py$"')
[Note: The output is actually empty.]
code snippet:
def sync(self, timeout=None):
kwargs = {'input': self.stdout} # 2. use previous stdout as input for next run
if timeout:
kwargs['timeout'] = timeout
if not SUBPROCESS_HAS_TIMEOUT:
raise ValueError(
"Timeout given but subprocess doesn't support it. "
"Install subprocess32 and try again."
)
self.stdout, self.stderr = self.p.communicate(**kwargs) # 1. update self.stdout each run
Suggestion:
Revise this case in readme.
The text was updated successfully, but these errors were encountered:
The 'increasingly useful' case in Readme.rst seems to show when we initialize bash object, it keeps the standard output as same input for all subsequent bash function calls. But it is not the case. Instead, each bash object initialization or bash function call will update the standard output as input for next bash call in a chain fashion.
Snippet from Readme.rst:
This becomes increasingly useful if you later need to reuse one such command::
Actual Result:
code snippet:
Suggestion:
Revise this case in readme.
The text was updated successfully, but these errors were encountered: