Skip to content

Commit

Permalink
[pre-commit.ci] auto fixes from pre-commit.com hooks
Browse files Browse the repository at this point in the history
for more information, see https://pre-commit.ci
  • Loading branch information
pre-commit-ci[bot] authored and WhyNotHugo committed Aug 15, 2023
1 parent 96e59bd commit 8fcfc8f
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 24 deletions.
14 changes: 6 additions & 8 deletions khal/configwizard.py
Original file line number Diff line number Diff line change
Expand Up @@ -355,14 +355,12 @@ def create_config(vdirs, dateformat, timeformat, default_calendar=None):
config.append(f'type = {type_}')

config.append('\n[locale]')
config.append('timeformat = {timeformat}\n'
'dateformat = {dateformat}\n'
'longdateformat = {longdateformat}\n'
'datetimeformat = {dateformat} {timeformat}\n'
'longdatetimeformat = {longdateformat} {timeformat}\n'
.format(timeformat=timeformat,
dateformat=dateformat,
longdateformat=dateformat))
config.append(f'timeformat = {timeformat}\n'
f'dateformat = {dateformat}\n'
f'longdateformat = {dateformat}\n'
f'datetimeformat = {dateformat} {timeformat}\n'
f'longdatetimeformat = {dateformat} {timeformat}\n'
)
if default_calendar:
config.append('[default]')
config.append(f'default_calendar = {default_calendar}\n')
Expand Down
4 changes: 2 additions & 2 deletions khal/khalendar/backend.py
Original file line number Diff line number Diff line change
Expand Up @@ -329,8 +329,8 @@ def update_vcf_dates(self, vevent_str: str, href: str, etag: str='',
self.sql_ex(sql_s, stuple)
except sqlite3.IntegrityError as error:
raise UpdateFailed('Database integrity error creating birthday event '
'on {} for contact {} (UID: {}): '
'{}'.format(date, name, uuid, error))
f'on {date} for contact {name} (UID: {uuid}): '
f'{error}')

def _update_impl(self, vevent: icalendar.cal.Event, href: str, calendar: str) -> None:
"""insert `vevent` into the database
Expand Down
4 changes: 1 addition & 3 deletions khal/khalendar/event.py
Original file line number Diff line number Diff line change
Expand Up @@ -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', '')

Expand Down
6 changes: 1 addition & 5 deletions khal/ui/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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']
Expand Down
7 changes: 1 addition & 6 deletions khal/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down

0 comments on commit 8fcfc8f

Please sign in to comment.