Added fallback for non-existance of colon
Signed-off-by: Jim Martens <github@2martens.de>
This commit is contained in:
@ -76,6 +76,8 @@ def sync(calendar_url: str, event_collection_path: str) -> None:
|
|||||||
event_content = event_content.replace('<location>', location_info[0])
|
event_content = event_content.replace('<location>', location_info[0])
|
||||||
if len(location_info) == 2:
|
if len(location_info) == 2:
|
||||||
event_content = event_content.replace('<address>', location_info[1])
|
event_content = event_content.replace('<address>', location_info[1])
|
||||||
|
else
|
||||||
|
event_content = event.content.replace('<address>', location_info[0])
|
||||||
|
|
||||||
event_filename = begin.date().isoformat() + '-' + event.name.replace(' ', '_') + '.markdown'
|
event_filename = begin.date().isoformat() + '-' + event.name.replace(' ', '_') + '.markdown'
|
||||||
with open(event_collection_path + event_filename, 'w', encoding='utf-8', newline='\n') as event_file:
|
with open(event_collection_path + event_filename, 'w', encoding='utf-8', newline='\n') as event_file:
|
||||||
|
|||||||
Reference in New Issue
Block a user