##// END OF EJS Templates
Catch interrupted poll() in terminal console...
Catch interrupted poll() in terminal console Alternative to my own PR #8108 - catch ZMQError in run_cell, and if it's caused by an interrupt, ignore it. more complex, especially if we want to handle the timeout nicely as proposed in the comments, but it's possibly also more convenient for other users of that API. Or perhaps not - I'm not sure what makes sense for other API consumers in this case. Fixes gh-8105

File last commit:

r18589:135227ac
r20836:0b3b28de
Show More
style_bw_ipython.tplx
45 lines | 1.5 KiB | text/plain | TextLexer
((= Black&white ipython input/output style =))
((*- extends 'base.tplx' -*))
%===============================================================================
% Input
%===============================================================================
((* block input scoped *))
((( add_prompt(cell.source, cell, 'In ') )))
((* endblock input *))
%===============================================================================
% Output
%===============================================================================
((* block execute_result scoped *))
((*- for type in output.data | filter_data_type -*))
((*- if type in ['text/plain']*))
((( add_prompt(output.data['text/plain'], cell, 'Out') )))
((*- else -*))
\verb+Out[((( cell.execution_count )))]:+((( super() )))
((*- endif -*))
((*- endfor -*))
((* endblock execute_result *))
%==============================================================================
% Support Macros
%==============================================================================
% Name: draw_prompt
% Purpose: Renders an output/input prompt
((* macro add_prompt(text, cell, prompt) -*))
((*- if cell.execution_count is defined -*))
((*- set execution_count = "" ~ (cell.execution_count | replace(None, " ")) -*))
((*- else -*))
((*- set execution_count = " " -*))
((*- endif -*))
((*- set indentation = " " * (execution_count | length + 7) -*))
\begin{verbatim}
(((- text | add_prompts(first=prompt ~ '[' ~ execution_count ~ ']: ', cont=indentation) -)))
\end{verbatim}
((*- endmacro *))