mirror of
https://github.com/WolframResearch/WolframLanguageForJupyter.git
synced 2025-04-15 19:26:04 +00:00
Add TODO comment
This commit is contained in:
parent
5f6f6363f0
commit
66a03632cc
@ -66,6 +66,36 @@ If[
|
||||
uninteract[expr_] := UsingFrontEnd[applyHook[$Pre, expr]];
|
||||
SetAttributes[uninteract, HoldAll];
|
||||
|
||||
(************************************
|
||||
version of Print that
|
||||
sends output to Jupyter
|
||||
*************************************)
|
||||
|
||||
(* redirect Print calls into a message to Jupyter, in order to print in Jupyter *)
|
||||
(* TODO: review other methods: through EvaluationData or WSTP so we don't redefine Print *)
|
||||
(* TODO: remove this and just permanently set $Output to {..., loopState["WolframLanguageForJupyter-stdout"], ...} *)
|
||||
Unprotect[Print];
|
||||
Print[ourArgs___, opts:OptionsPattern[]] :=
|
||||
Block[
|
||||
{
|
||||
$inPrint = True,
|
||||
$Output
|
||||
},
|
||||
If[
|
||||
loopState["printFunction"] =!= False,
|
||||
$Output = {OpenWrite[FormatType -> OutputForm]};
|
||||
If[
|
||||
!FailureQ[First[$Output]],
|
||||
Print[ourArgs, opts];
|
||||
loopState["printFunction"][
|
||||
Import[$Output[[1,1]], "String"]
|
||||
];
|
||||
Close[First[$Output]];
|
||||
];
|
||||
];
|
||||
] /; !TrueQ[$inPrint];
|
||||
Protect[Print];
|
||||
|
||||
(************************************
|
||||
version of Write that
|
||||
sends output to Jupyter
|
||||
@ -136,35 +166,6 @@ If[
|
||||
] /; !TrueQ[$inWriteString];
|
||||
Protect[WriteString];
|
||||
|
||||
(************************************
|
||||
version of Print that
|
||||
sends output to Jupyter
|
||||
*************************************)
|
||||
|
||||
(* redirect Print calls into a message to Jupyter, in order to print in Jupyter *)
|
||||
(* TODO: review other methods: through EvaluationData or WSTP so we don't redefine Print *)
|
||||
Unprotect[Print];
|
||||
Print[ourArgs___, opts:OptionsPattern[]] :=
|
||||
Block[
|
||||
{
|
||||
$inPrint = True,
|
||||
$Output
|
||||
},
|
||||
If[
|
||||
loopState["printFunction"] =!= False,
|
||||
$Output = {OpenWrite[FormatType -> OutputForm]};
|
||||
If[
|
||||
!FailureQ[First[$Output]],
|
||||
Print[ourArgs, opts];
|
||||
loopState["printFunction"][
|
||||
Import[$Output[[1,1]], "String"]
|
||||
];
|
||||
Close[First[$Output]];
|
||||
];
|
||||
];
|
||||
] /; !TrueQ[$inPrint];
|
||||
Protect[Print];
|
||||
|
||||
(************************************
|
||||
versions of Quit and Exit that
|
||||
ask the Jupyter console
|
||||
|
Loading…
x
Reference in New Issue
Block a user