diff --git a/nbstripout/_nbstripout.py b/nbstripout/_nbstripout.py index f84e6e1..bf1807f 100644 --- a/nbstripout/_nbstripout.py +++ b/nbstripout/_nbstripout.py @@ -471,7 +471,7 @@ def main(): warnings.simplefilter("ignore", category=UserWarning) nb = read(f, as_version=NO_CONVERT) - nb = strip_output(nb, args.keep_output, args.keep_count, extra_keys, args.drop_empty_cells, + nb = strip_output(nb, args.keep_output, args.keep_count, extra_keys, args.dry_run, args.drop_empty_cells, args.drop_tagged_cells.split(), args.strip_init_cells, _parse_size(args.max_size)) if args.dry_run: @@ -517,7 +517,7 @@ def main(): warnings.simplefilter("ignore", category=UserWarning) nb = read(input_stream, as_version=NO_CONVERT) - nb = strip_output(nb, args.keep_output, args.keep_count, extra_keys, args.drop_empty_cells, + nb = strip_output(nb, args.keep_output, args.keep_count, extra_keys, args.dry_run, args.drop_empty_cells, args.drop_tagged_cells.split(), args.strip_init_cells, _parse_size(args.max_size)) if args.dry_run: diff --git a/nbstripout/_utils.py b/nbstripout/_utils.py index abc9e17..5cefa8d 100644 --- a/nbstripout/_utils.py +++ b/nbstripout/_utils.py @@ -94,7 +94,7 @@ def strip_zeppelin_output(nb): return nb -def strip_output(nb, keep_output, keep_count, extra_keys=[], drop_empty_cells=False, drop_tagged_cells=[], +def strip_output(nb, keep_output, keep_count, extra_keys=[], dry_run=False, drop_empty_cells=False, drop_tagged_cells=[], strip_init_cells=False, max_size=0): """ Strip the outputs, execution count/prompt number and miscellaneous @@ -129,6 +129,9 @@ def strip_output(nb, keep_output, keep_count, extra_keys=[], drop_empty_cells=Fa # Remove the outputs, unless directed otherwise if 'outputs' in cell: + + if dry_run: + print("Dry Run!") # Default behavior (max_size == 0) strips all outputs. if not keep_output_this_cell: