Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

It should be possible to control printed messages, e.g. in class Flow #171

Open
arnauldvm opened this issue Jan 15, 2022 · 1 comment
Open
Labels
priority: p3 Desirable enhancement or fix. May not be included in next release. type: feature request ‘Nice-to-have’ improvement, new feature or different behavior or design.

Comments

@arnauldvm
Copy link

arnauldvm commented Jan 15, 2022

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.)

@yoshi-automation yoshi-automation added triage me I really want to be triaged. 🚨 This issue needs some love. labels Jan 16, 2022
@arithmetic1728 arithmetic1728 added type: feature request ‘Nice-to-have’ improvement, new feature or different behavior or design. priority: p3 Desirable enhancement or fix. May not be included in next release. and removed triage me I really want to be triaged. labels Mar 30, 2022
@yoshi-automation yoshi-automation removed the 🚨 This issue needs some love. label Mar 30, 2022
@arithmetic1728
Copy link
Contributor

setting p3 for the future request

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
priority: p3 Desirable enhancement or fix. May not be included in next release. type: feature request ‘Nice-to-have’ improvement, new feature or different behavior or design.
Projects
None yet
Development

No branches or pull requests

3 participants