xref: /aosp_15_r20/external/pigweed/pw_console/py/pw_console/templates/repl_output.jinja (revision 61c4878ac05f98d0ceed94b57d316916de578985)
1{#
2Copyright 2021 The Pigweed Authors
3
4Licensed under the Apache License, Version 2.0 (the "License"); you may not
5use this file except in compliance with the License. You may obtain a copy of
6the License at
7
8    https://www.apache.org/licenses/LICENSE-2.0
9
10Unless required by applicable law or agreed to in writing, software
11distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
12WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
13License for the specific language governing permissions and limitations under
14the License.
15#}
16{% for code in code_items %}
17{% set index = loop.index if show_index else '' %}
18{% set prompt_indent_text = '... ' %}
19{% set input_text = code.input if code.input else '' %}
20
21>>> {{ input_text|indent(width=prompt_indent_text) }}
22{% if code.stdout -%}
23  {{ code.stdout }}
24{%- endif %}
25{% if code.stderr -%}
26  {{ code.stderr }}
27{%- endif %}
28{% if code.is_running %}
29Running...
30{% endif %}
31{% if code.exception_text %}
32{{ code.exception_text }}
33{% elif code.result_str %}
34{{ code.result_str }}
35{% elif code.output %}
36{{ code.output }}
37{% endif %}
38{% endfor -%}
39