MCPcopy Index your code
hub / github.com/python/cpython / get_sidebar_lines

Method get_sidebar_lines

Lib/idlelib/idle_test/test_sidebar.py:455–463  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

453 sys.stdout = self._saved_stdout
454
455 def get_sidebar_lines(self):
456 canvas = self.shell.shell_sidebar.canvas
457 texts = list(canvas.find(tk.ALL))
458 texts_by_y_coords = {
459 canvas.bbox(text)[1]: canvas.itemcget(text, 'text')
460 for text in texts
461 }
462 line_y_coords = self.get_shell_line_y_coords()
463 return [texts_by_y_coords.get(y, None) for y in line_y_coords]
464
465 def assert_sidebar_lines_end_with(self, expected_lines):
466 self.shell.shell_sidebar.update_sidebar()

Calls 6

listClass · 0.85
findMethod · 0.45
bboxMethod · 0.45
itemcgetMethod · 0.45
getMethod · 0.45

Tested by

no test coverage detected