notion-export-ics
notion-export-ics copied to clipboard
TypeError in resulting ICS file
After removing an erroneous character from the built-in error message and some more troubleshooting I managed to get this running. However I have the following issues:
- settings.json is not fully respected
- when quering the server using the settings in webapp (you might want to document that) it presents the user with a webinterface with fields for url > not populated with block/url in settings, title format > I'd expect it to use 'block' from settings for that, and resulting url (calculated)
when opening the resulting url I do get an ICS file, but with the following error for each entry
SUMMARY:TypeError('__repr__ returned non-string (type NoneType)'\,)
and general error
Imported from Notion\, via notion-export-ics\, but failed.
I'll also include the following trace
Traceback (most recent call last): File "/volume1/homes/user/cron/notion-export-ics/webapp.py", line 38, in make_ics cal = get_ical(client, calendar_url, title_format) File "/volume1/homes/user/cron/notion-export-ics/notion_ics.py", line 77, in get_ical desc += " - {}: {}\n".format(name, v) TypeError: __repr__ returned non-string (type NoneType) 192.168.0.11 - - [09/Sep/2020 09:57:14] "GET /ics?url=aHR0cHM6Ly93d3cubm90aW9uLnNvL25vd3Rvbi80NGNiYjY4MmJhYWQ0NDliODk2NzExMTYxZTY4ZTQ5MD92PWMxZGUwYzQ1ODdkODRkMDM4ODA4NDgzODNkOTk5OGM2&format=e05BTUV9 HTTP/1.1" 200 - Traceback (most recent call last): File "/volume1/homes/user/cron/notion-export-ics/webapp.py", line 38, in make_ics cal = get_ical(client, calendar_url, title_format) File "/volume1/homes/user/cron/notion-export-ics/notion_ics.py", line 77, in get_ical desc += " - {}: {}\n".format(name, v) TypeError: __repr__ returned non-string (type NoneType) 192.168.0.11 - - [09/Sep/2020 09:59:00] "GET /ics?url=aHR0cHM6Ly93d3cubm90aW9uLnNvL25vd3Rvbi80NGNiYjY4MmJhYWQ0NDliODk2NzExMTYxZTY4ZTQ5MD92PWMxZGUwYzQ1ODdkODRkMDM4ODA4NDgzODNkOTk5OGM2&format=RGVhZGxpbmU%3D HTTP/1.1" 200 -
Where to start debugging this?
Maybe it has something to do with changes in notion-py. I monkey-patched the following methods, that's where I would start debugging (see code):
# Hack some representation stuff into notion-py
BasicBlock.__repr__ = BasicBlock.__str__ = lambda self: self.title
User.__repr__ = User.__str__ = lambda self: self.given_name or self.family_name
Shouldnt the f preceding the exception statement on line 25 be omitted as well?
Shouldnt the f preceding the exception statement on line 25 be omitted as well?
Those are python f-strings :)