description format from config

This commit is contained in:
Dmitry Belyaev 2018-03-28 23:12:12 +03:00
parent 5f5beada4e
commit a0ded66f85
Signed by: b4tman
GPG Key ID: 014E87EC54B77673
2 changed files with 6 additions and 3 deletions

View File

@ -69,8 +69,11 @@ def make_event(person, year):
lang_params = {'language': event_config['language']}
if 'birthday_no_year' not in person:
description += ', %d %s' % (age(person, year), zodiac_sign(person))
if 'birthday_no_year' in person:
description = description.replace('{age}', '')
description = description.format(
age=age(person, year), zodiac=zodiac_sign(person))
event = Event()
event.add('uid', sha1(person['name'] + ' birthday ' + str(year)))

View File

@ -3,7 +3,7 @@ calname: My friends birthdays!
timezone: UTC
events:
description: Happy birthday
description: Happy birthday, {age} {zodiac}
categories: birthday
scale: