Skip to content

WIP - Migrate to TOML, and allow multiple calendars#116

Open
mendhak wants to merge 40 commits into
masterfrom
toml_migration
Open

WIP - Migrate to TOML, and allow multiple calendars#116
mendhak wants to merge 40 commits into
masterfrom
toml_migration

Conversation

@mendhak
Copy link
Copy Markdown
Owner

@mendhak mendhak commented May 3, 2026

No description provided.

Comment thread config_toml_test.py Outdated
Comment thread config.example.toml
Copy link
Copy Markdown
Owner Author

@mendhak mendhak May 3, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Moving from the very lengthy and complicated env.sh to config.toml. It doesn't take the length away, just organizes it a bit better. There are now sections for display, calendar, weather, alerts.

Comment thread config.example.toml
# Get your Calendar ID from Google Calendar Settings > Share this calendar
# Format: xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx@group.calendar.google.com

[[calendar.providers.google]]
Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Importantly the [[ double ]] notation allows for multiple instances of the same thing (an array). This is how we can do multiple calendars.

Comment thread requirements.txt
Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • TODO: Not sure about this. Might go back to fixed versions, except for urllib which needs a minimum version.

events_result = service.events().list(
calendarId=self.google_calendar_id,
timeMin=self.from_date.isoformat() + 'Z',
timeZone=google_calendar_timezone,
Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this shouldn't be needed any more, because in the calling script we convert it to timezone naive datetimes when merging and sorting. I did a bit of testing and it seemed OK but... y'know... timezones...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant