Skip to content

Space: Add get_children#61

Merged
PenguinBoi12 merged 9 commits into
mainfrom
feature/space-get_children
Jun 29, 2026
Merged

Space: Add get_children#61
PenguinBoi12 merged 9 commits into
mainfrom
feature/space-get_children

Conversation

@PenguinBoi12

@PenguinBoi12 PenguinBoi12 commented Jun 23, 2026

Copy link
Copy Markdown
Contributor

This PR adds get_children to the new Space class. get_children retrieves all children and converts them into Room or Space instance through the make_room factory. Bot also leverages the new make_room factory.

The PR includes a module-level registry in room.py to centralize the creation logic of Room and Space. This avoids duplicating the instantiation logic while keeping Room and Space cleanly separated. The registry uses __init_subclass__ so subclasses self-register, avoiding a standalone factory module that would have added circular imports.

@PenguinBoi12 PenguinBoi12 changed the title Space get children Space get_children Jun 23, 2026
@PenguinBoi12 PenguinBoi12 changed the title Space get_children Space: Add get_children Jun 23, 2026
# Conflicts:
#	matrix/bot.py
#	matrix/space.py
#	tests/test_bot.py
@PenguinBoi12 PenguinBoi12 force-pushed the feature/space-get_children branch from 3e197f2 to 2b449b0 Compare June 23, 2026 06:06
@PenguinBoi12 PenguinBoi12 marked this pull request as ready for review June 28, 2026 00:00
@PenguinBoi12 PenguinBoi12 force-pushed the feature/space-get_children branch from f98caaf to 83fb8de Compare June 28, 2026 04:03
@PenguinBoi12 PenguinBoi12 requested a review from chrisdedman June 29, 2026 01:04

@chrisdedman chrisdedman left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM. Do you think we should have an example in /examples/ ?

@PenguinBoi12

Copy link
Copy Markdown
Contributor Author

LGTM. Do you think we should have an example in /examples/ ?

I don't think so, instead I'll write some doc about all that.

@PenguinBoi12 PenguinBoi12 merged commit e45ce5f into main Jun 29, 2026
4 checks passed
@PenguinBoi12 PenguinBoi12 deleted the feature/space-get_children branch June 29, 2026 01:46
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.

2 participants