Description
Is your feature request related to a problem? Please describe.
In command line tools that are processing data automatically, I want to be in control of what goes to STDOUT.
It is not possible because of methods writing spontaneously on STDOUT (how bad mannered is it ;-)).
Typically, the methods run_console
and run_local_server
of the class Flow
.
Describe the solution you'd like
- Either: add a flag to these methods to disable the print
- Or: add a parameter to these methods so that the invoker may provide the output stream to write the message to (sys.stdin : same as now, sys.stderr: STDERR, None: disable...)
(Note: other methods invoking them should also provide such parameters.)
Alternatively, the flag/parameter could be set globally.
Describe alternatives you've considered
Adding a | grep -v 'Please visit this URL to authorize this application'
after my script.
Ugly.
from contextlib import redirect_stdout
...
with redirect_stdout(sys.stderr):
...
Slightly better.
Additional context
(There might be other classes than Flow
with the same problem. Didn't check.)