Skip to content

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

Open
@arnauldvm

Description

@arnauldvm

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    priority: p3Desirable enhancement or fix. May not be included in next release.type: feature request‘Nice-to-have’ improvement, new feature or different behavior or design.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions