MCPcopy Create free account
hub / github.com/RT-Thread/env-windows / sync

Method sync

tools/python-3.11.9-amd64/Tools/demo/spreadsheet.py:779–794  ·  view source on GitHub ↗

Fill the GUI cells from the sheet cells.

(self)

Source from the content-addressed store, hash-verified

777 self.sync()
778
779 def sync(self):
780 "Fill the GUI cells from the sheet cells."
781 self.sheet.recalc()
782 for (x, y), gridcell in self.gridcells.items():
783 if x == 0 or y == 0:
784 continue
785 cell = self.sheet.getcell(x, y)
786 if cell is None:
787 gridcell['text'] = ""
788 else:
789 if hasattr(cell, 'format'):
790 text, alignment = cell.format()
791 else:
792 text, alignment = str(cell), LEFT
793 gridcell['text'] = text
794 gridcell['anchor'] = align2anchor[alignment]
795
796
797def test_basic():

Callers 3

__init__Method · 0.95
delete_eventMethod · 0.95
change_cellMethod · 0.95

Calls 5

strFunction · 0.85
getcellMethod · 0.80
recalcMethod · 0.45
itemsMethod · 0.45
formatMethod · 0.45

Tested by

no test coverage detected