Skip to content

Commit eaa1b90

Browse files
committed
Add stream option to pxconfig
1 parent adee116 commit eaa1b90

File tree

1 file changed

+10
-3
lines changed

1 file changed

+10
-3
lines changed

ipyparallel/client/magics.py

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -106,13 +106,15 @@ def exec_args(f):
106106
),
107107
magic_arguments.argument(
108108
'--stream',
109-
action="store_true",
110-
default=True,
109+
action="store_const",
110+
const=True,
111+
dest='stream',
111112
help="stream stdout/stderr in real-time (only valid when using blocking execution)",
112113
),
113114
magic_arguments.argument(
114115
'--no-stream',
115-
action="store_false",
116+
action="store_const",
117+
const=False,
116118
dest='stream',
117119
help="do not stream stdout/stderr in real-time",
118120
),
@@ -218,6 +220,8 @@ class ParallelMagics(Magics):
218220
last_result = None
219221
# verbose flag
220222
verbose = False
223+
# streaming output flag
224+
stream_ouput = True
221225

222226
def __init__(self, shell, view, suffix=''):
223227
self.view = view
@@ -261,6 +265,8 @@ def pxconfig(self, line):
261265
self.view.block = args.block
262266
if args.set_verbose is not None:
263267
self.verbose = args.set_verbose
268+
if args.stream is not None:
269+
self.stream_ouput = args.stream
264270

265271
@magic_arguments.magic_arguments()
266272
@output_args
@@ -316,6 +322,7 @@ def parallel_execute(
316322

317323
# defaults:
318324
block = self.view.block if block is None else block
325+
stream_output = self.stream_ouput if stream_output is None else stream_output
319326

320327
base = "Parallel" if block else "Async parallel"
321328

0 commit comments

Comments
 (0)