From 1814d2879286cb230c81d1e5d1456b5f74bae647 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Tue, 25 Jul 2023 04:56:37 +0000 Subject: [PATCH] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- khal/khalendar/event.py | 4 +--- khal/ui/__init__.py | 8 ++------ khal/ui/calendarwidget.py | 2 +- khal/utils.py | 7 +------ 4 files changed, 5 insertions(+), 16 deletions(-) diff --git a/khal/khalendar/event.py b/khal/khalendar/event.py index a653f94f7..58b1499ac 100644 --- a/khal/khalendar/event.py +++ b/khal/khalendar/event.py @@ -426,9 +426,7 @@ def summary(self) -> str: suffix = 'rd' else: suffix = 'th' - return '{name}\'s {number}{suffix} {desc}{leap}'.format( - name=name, number=number, suffix=suffix, desc=description, leap=leap, - ) + return f'{name}\'s {number}{suffix} {description}{leap}' else: return self._vevents[self.ref].get('SUMMARY', '') diff --git a/khal/ui/__init__.py b/khal/ui/__init__.py index 5f5df56b2..f2923d8c5 100644 --- a/khal/ui/__init__.py +++ b/khal/ui/__init__.py @@ -138,11 +138,7 @@ def relative_day(self, day: dt.date, dtformat: str) -> str: approx_delta = utils.relative_timedelta_str(day) - return '{weekday}, {day} ({approx_delta})'.format( - weekday=weekday, - approx_delta=approx_delta, - day=daystr, - ) + return f'{weekday}, {daystr} ({approx_delta})' def keypress(self, _, key: str) -> str: binds = self._conf['keybindings'] @@ -245,7 +241,7 @@ def __init__( set_focus_date_callback=None, **kwargs): self._init: bool = True - self.parent: 'ClassicView' = parent + self.parent: ClassicView = parent self.delete_status = delete_status self.toggle_delete_instance = toggle_delete_instance self.toggle_delete_all = toggle_delete_all diff --git a/khal/ui/calendarwidget.py b/khal/ui/calendarwidget.py index 87c7435ad..1b46b0d9c 100644 --- a/khal/ui/calendarwidget.py +++ b/khal/ui/calendarwidget.py @@ -242,7 +242,7 @@ def __init__(self, walker: 'CalendarWalker'): self.on_press = walker.on_press self._marked: Optional[MarkType] = None self._pos_old: Optional[Tuple[int, int]] = None - self.body: 'CalendarWalker' + self.body: CalendarWalker super().__init__(walker) @property diff --git a/khal/utils.py b/khal/utils.py index 30ba2125e..ef13edd58 100644 --- a/khal/utils.py +++ b/khal/utils.py @@ -174,12 +174,7 @@ def relative_timedelta_str(day: dt.date) -> str: if count > 1: unit += 's' - return '{approx}{count} {unit} {direction}'.format( - approx=approx, - count=count, - unit=unit, - direction=direction, - ) + return f'{approx}{count} {unit} {direction}' def get_wrapped_text(widget):