MCPcopy Create free account
hub / github.com/DeepRec-AI/DeepRec / _display_lines

Method _display_lines

tensorflow/python/debug/cli/curses_ui.py:1130–1169  ·  view source on GitHub ↗

Display RichTextLines object on screen. Args: output: A RichTextLines object. min_num_rows: (int) Minimum number of output rows. Returns: 1) The text pad object used to display the main text body. 2) (int) number of rows of the text pad, which may exceed screen size

(self, output, min_num_rows)

Source from the content-addressed store, hash-verified

1128 self._scroll_output(_SCROLL_HOME)
1129
1130 def _display_lines(self, output, min_num_rows):
1131 """Display RichTextLines object on screen.
1132
1133 Args:
1134 output: A RichTextLines object.
1135 min_num_rows: (int) Minimum number of output rows.
1136
1137 Returns:
1138 1) The text pad object used to display the main text body.
1139 2) (int) number of rows of the text pad, which may exceed screen size.
1140 3) (int) number of columns of the text pad.
1141
1142 Raises:
1143 ValueError: If input argument "output" is invalid.
1144 """
1145
1146 if not isinstance(output, debugger_cli_common.RichTextLines):
1147 raise ValueError(
1148 "Output is required to be an instance of RichTextLines, but is not.")
1149
1150 self._screen_refresh()
1151
1152 # Number of rows the output area will have.
1153 rows = max(min_num_rows, len(output.lines))
1154
1155 # Size of the output pad, which may exceed screen size and require
1156 # scrolling.
1157 cols = self._max_x - 2
1158
1159 # Create new output pad.
1160 pad = self._screen_new_output_pad(rows, cols)
1161
1162 for i in xrange(len(output.lines)):
1163 if i in output.font_attr_segs:
1164 self._screen_add_line_to_output_pad(
1165 pad, i, output.lines[i], color_segments=output.font_attr_segs[i])
1166 else:
1167 self._screen_add_line_to_output_pad(pad, i, output.lines[i])
1168
1169 return pad, rows, cols
1170
1171 def _display_nav_bar(self):
1172 nav_bar_width = self._max_x - 2

Callers 4

_display_candidatesMethod · 0.95
_toastMethod · 0.95

Calls 4

_screen_refreshMethod · 0.95
maxFunction · 0.50

Tested by

no test coverage detected