write_data_to_file(): add no_stdout parameter
This commit is contained in:
parent
6620b4dba0
commit
52f26202a8
2 changed files with 5 additions and 1 deletions
|
|
@ -159,6 +159,7 @@ def write_data_to_file(
|
|||
ask_overwrite = True,
|
||||
ask_tty = True,
|
||||
no_tty = False,
|
||||
no_stdout = False,
|
||||
quiet = False,
|
||||
binary = False,
|
||||
ignore_opt_outdir = False,
|
||||
|
|
@ -269,7 +270,9 @@ def write_data_to_file(
|
|||
|
||||
return True
|
||||
|
||||
if cfg.stdout or outfile in ('', '-'):
|
||||
if no_stdout:
|
||||
do_file(outfile, ask_write_prompt)
|
||||
elif cfg.stdout or outfile in ('', '-'):
|
||||
do_stdout()
|
||||
elif sys.stdin.isatty() and not sys.stdout.isatty():
|
||||
do_stdout()
|
||||
|
|
|
|||
|
|
@ -205,6 +205,7 @@ def write_to_file(fn, data, binary=False):
|
|||
fn,
|
||||
data,
|
||||
quiet = True,
|
||||
no_stdout = True,
|
||||
binary = binary,
|
||||
ignore_opt_outdir = True)
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue