MCPcopy Index your code
hub / github.com/PySimpleGUI/PySimpleGUI / update_days

Function update_days

PySimpleGUI/PySimpleGUI.py:21793–21805  ·  view source on GitHub ↗
(window, month, year, begin_at_sunday_plus)

Source from the content-addressed store, hash-verified

21791 cur_year = start_year or cur_year
21792
21793 def update_days(window, month, year, begin_at_sunday_plus):
21794 [window[(week, day)].update('') for day in range(7) for week in range(6)]
21795 weeks = calendar.monthcalendar(year, month)
21796 month_days = list(itertools.chain.from_iterable([[0 for _ in range(8 - begin_at_sunday_plus)]] + weeks))
21797 if month_days[6] == 0:
21798 month_days = month_days[7:]
21799 if month_days[6] == 0:
21800 month_days = month_days[7:]
21801 for i, day in enumerate(month_days):
21802 offset = i
21803 if offset >= 6 * 7:
21804 break
21805 window[(offset // 7, offset % 7)].update(str(day) if day else '')
21806
21807 def make_days_layout():
21808 days_layout = []

Callers 1

popup_get_dateFunction · 0.70

Calls 1

updateMethod · 0.45

Tested by

no test coverage detected