ICS: refactoring
This commit is contained in:
parent
632db0c37f
commit
96b06a686b
1 changed files with 6 additions and 3 deletions
|
@ -326,7 +326,8 @@ def talk_to_ics(talk):
|
|||
if 'time' not in talk or 'duration' not in talk:
|
||||
return None
|
||||
e = ics.Event(
|
||||
uid="%s@%d.hackmeeting.org\n" % (talk['id'], talk['day'].year),
|
||||
uid="%s@%d.hackmeeting.org" % (talk['id'],
|
||||
get_global_data()['startdate'].year),
|
||||
name=talk['id'],
|
||||
begin=talk['time'],
|
||||
duration=datetime.timedelta(minutes=talk['duration']),
|
||||
|
@ -335,9 +336,11 @@ def talk_to_ics(talk):
|
|||
# ics.py has some problems with unicode
|
||||
# unidecode replaces letters with their most similar ASCII counterparts
|
||||
# (ie: accents get stripped)
|
||||
e.description = unidecode.unidecode(talk['text'])
|
||||
|
||||
if 'text' in talk:
|
||||
e.description = unidecode.unidecode(talk['text'])
|
||||
e.url = pelican.settings['SCHEDULEURL'] + '#talk-' + talk['id']
|
||||
if 'room' in talk:
|
||||
e.location = talk['room']
|
||||
|
||||
return e
|
||||
|
||||
|
|
Loading…
Reference in a new issue