File tree Expand file tree Collapse file tree 1 file changed +2
-22
lines changed Expand file tree Collapse file tree 1 file changed +2
-22
lines changed Original file line number Diff line number Diff line change 26
26
from IPython .core .profiledir import ProfileDir , ProfileDirError
27
27
from IPython .paths import get_ipython_dir
28
28
from IPython .utils .capture import RichOutput
29
- from IPython .utils .coloransi import TermColors
30
29
from IPython .utils .path import compress_user
31
30
from jupyter_client .localinterfaces import is_local_ip , localhost
32
31
from jupyter_client .session import Session
@@ -155,37 +154,18 @@ def __repr__(self):
155
154
156
155
return f"<ExecuteReply[{ self .execution_count } ]: { text_out } >"
157
156
158
- def _plaintext (self ):
157
+ def _plaintext (self ) -> str :
159
158
execute_result = self .metadata ['execute_result' ] or {'data' : {}}
160
159
text_out = execute_result ['data' ].get ('text/plain' , '' )
161
160
162
161
if not text_out :
163
162
return ''
164
163
165
- ip = get_ipython ()
166
- if ip is None :
167
- colors = "NoColor"
168
- else :
169
- colors = ip .colors
170
-
171
- if colors == "NoColor" :
172
- out = normal = ""
173
- else :
174
- out = TermColors .Red
175
- normal = TermColors .Normal
176
-
177
164
if '\n ' in text_out and not text_out .startswith ('\n ' ):
178
165
# add newline for multiline reprs
179
166
text_out = '\n ' + text_out
180
167
181
- return '' .join (
182
- [
183
- out ,
184
- f"Out[{ self .metadata ['engine_id' ]} :{ self .execution_count } ]: " ,
185
- normal ,
186
- text_out ,
187
- ]
188
- )
168
+ return f"Out[{ self .metadata ['engine_id' ]} :{ self .execution_count } ]: { text_out } "
189
169
190
170
def _repr_pretty_ (self , p , cycle ):
191
171
p .text (self ._plaintext ())
You can’t perform that action at this time.
0 commit comments