diff options
author | Christian Geier <geier@lostpackets.de> | 2023-05-23 16:05:10 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-05-23 16:05:10 +0200 |
commit | d7d33bb4472a8aa6001df1bf8aef23719063004a (patch) | |
tree | 49f2463b2ea3542e25ef600c040a061485aba369 | |
parent | 54c78f084dc9ac1247a207babbeae98a94f327a7 (diff) | |
parent | f641e50f989b198fa20e48cea3d2f7e1bbf31ddd (diff) |
Merge pull request #1254 from pimutils/fix/1249
do not use urwid private methods anymore
-rw-r--r-- | khal/ui/calendarwidget.py | 12 |
1 files changed, 3 insertions, 9 deletions
diff --git a/khal/ui/calendarwidget.py b/khal/ui/calendarwidget.py index 20b67f30..fe911dd0 100644 --- a/khal/ui/calendarwidget.py +++ b/khal/ui/calendarwidget.py @@ -146,7 +146,8 @@ class DateCColumns(urwid.Columns): self.contents[old_pos][0].set_styles( self.get_styles(self.contents[old_pos][0].date, False)) - def _set_focus_position(self, position): + @urwid.Columns.focus_position.setter + def focus_position(self, position: int) -> None: """calls on_date_change before calling super()._set_focus_position""" # do not call when building up the interface, lots of potentially # expensive calls made here @@ -157,7 +158,7 @@ class DateCColumns(urwid.Columns): self.contents[position][0].set_styles( self.get_styles(self.contents[position][0].date, True)) self.on_date_change(self.contents[position][0].date) - super()._set_focus_position(position) + urwid.Columns.focus_position.fset(self, position) def set_focus_date(self, a_date): for num, day in enumerate(self.contents[1:8], 1): @@ -175,13 +176,6 @@ class DateCColumns(urwid.Columns): return num raise ValueError('%s not found in this week' % a_date) - focus_position = property( - urwid.Columns._get_focus_position, - _set_focus_position, - doc=('Index of child widget in focus. Raises IndexError if read when ' - 'CColumns is empty, or when set to an invalid index.') - ) - def keypress(self, size, key): """only leave calendar area on pressing 'tab' or 'enter'""" |