Rework event provider and other changes #21

Merged
leming merged 5 commits from leming_rework-event-provider into main 2026-06-29 20:43:01 +00:00
Owner

This PR contains multiple changes.
Regarding event provider rework:

  • Place existing implementation in a class based on abstract class. This is to make it at least somewhat testable.
  • Return structured Event data from EventProvider.
  • Improved workflow, along with comments.

Changes unrelated to that, with no significant order:

  • Rename f to file.
  • Add logging support.
  • Replace os/str paths with pathlib.
  • Fix wrong timezone.
  • Add a load of TODOs.
This PR contains multiple changes. Regarding event provider rework: - Place existing implementation in a class based on abstract class. This is to make it at least somewhat testable. - Return structured `Event` data from `EventProvider`. - Improved workflow, along with comments. Changes unrelated to that, with no significant order: - Rename `f` to `file`. - Add `logging` support. - Replace `os`/`str` paths with `pathlib`. - Fix wrong timezone. - Add a load of TODOs.
- Use logging where possible.
- Use pathlib instead of os and strings.
- Fail quickly on no DISCORD_TOKEN.
- Fix some issues from previous commit.
@ -5,36 +5,39 @@ Discord connector to export events to one or more Discord communities (aka guild
"""
Collaborator

If we treat mobilizon as event_provider, shouldn't this be event_consumer?

If we treat mobilizon as event_provider, shouldn't this be event_consumer?
Author
Owner

Yes, yes it should. To be solved in some future PR.

Yes, yes it should. To be solved in some future PR.
leming marked this conversation as resolved
@ -134,3 +141,3 @@
template = env.get_template(template_name)
now_paris = datetime.datetime.now(ZoneInfo("Europe/Paris")).strftime("%Y-%m-%d %H:%M")
now_paris = datetime.now(ZoneInfo("Europe/Paris")).strftime("%Y-%m-%d %H:%M")
Collaborator

I think we can move to Warsaw now.

I think we can move to Warsaw now.
leming marked this conversation as resolved
@ -32,3 +35,4 @@
TEMPLATES = {
"templates/newsletter_template.html": "newsletter_events.html",
}
CREATOR_URL = "https://events.hs3.pl"
Collaborator

Second time? There's already one in kronos-ui

Second time? There's already one in kronos-ui
Author
Owner

I intend to merge kronos and kronos-ui in the long run, right now TODO must do.

I intend to merge `kronos` and `kronos-ui` in the long run, right now TODO must do.
leming marked this conversation as resolved
Collaborator

Cool, but a short description could help understand why are we here :)

Cool, but a short description could help understand why are we here :)
doomhammer approved these changes 2026-06-28 19:22:01 +00:00
Dismissed
@ -0,0 +375,4 @@
if __name__ == "__main__":
logging.basicConfig(format="%(asctime)s %(levelname)s: %(message)s", level=logging.INFO)
# TODO: executable part of this script is only for development purposes. Replace with tests.
Collaborator

💚

💚
@ -0,0 +247,4 @@
List of events.
"""
# TODO: this function seem weird - move responsiblity elsewhere?
# Or add explicit method for Typst to get data?
Collaborator

👍

👍
@ -73,3 +89,3 @@
"description": description,
"physicalAddress": None,
"picture": os.path.relpath(pic_path, start="src/typst"),
"picture": pic_path.relative_to("src/path"),
Collaborator

src/path?

`src/path`?
doomhammer approved these changes 2026-06-29 20:29:00 +00:00
leming merged commit 1ca24df016 into main 2026-06-29 20:43:01 +00:00
leming deleted branch leming_rework-event-provider 2026-06-29 20:43:03 +00:00
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
2 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
leming/kronos!21
No description provided.