matrix-python 1.0.1__py3-none-any.whl → 1.0.2__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
matrix/_version.py CHANGED
@@ -18,7 +18,7 @@ version_tuple: tuple[int | str, ...]
18
18
  commit_id: str | None
19
19
  __commit_id__: str | None
20
20
 
21
- __version__ = version = '1.0.1'
22
- __version_tuple__ = version_tuple = (1, 0, 1)
21
+ __version__ = version = '1.0.2'
22
+ __version_tuple__ = version_tuple = (1, 0, 2)
23
23
 
24
- __commit_id__ = commit_id = 'g8e6ddd04d'
24
+ __commit_id__ = commit_id = 'g451ecb6e4'
matrix/bot.py CHANGED
@@ -5,7 +5,7 @@ import logging
5
5
 
6
6
  from typing import Optional, Any
7
7
 
8
- from nio import AsyncClient, Event, MatrixRoom
8
+ from nio import AsyncClient, Event, MatrixRoom, SyncResponse
9
9
 
10
10
  from .room import Room, make_room
11
11
  from .space import Space
@@ -297,6 +297,7 @@ class Bot(Registry):
297
297
  self.register_command(self.help)
298
298
 
299
299
  self.client.add_event_callback(self._on_matrix_event, Event)
300
+ self.client.add_response_callback(self._on_sync, SyncResponse)
300
301
  self._auto_register_events()
301
302
 
302
303
  def start(self, *, config: Config | str) -> None:
@@ -351,15 +352,16 @@ class Bot(Registry):
351
352
  async def _wait_until_synced(self) -> None:
352
353
  await self._synced.wait()
353
354
 
355
+ async def _on_sync(self, _response: SyncResponse) -> None:
356
+ """Mark the bot as synced once a sync with the homeserver completes."""
357
+ self._synced.set()
358
+
354
359
  # MATRIX EVENTS
355
360
 
356
361
  async def on_message(self, room: Room, event: Event) -> None:
357
362
  await self._process_commands(room, event)
358
363
 
359
364
  async def _on_matrix_event(self, matrix_room: MatrixRoom, event: Event) -> None:
360
- if not self._synced.is_set():
361
- self._synced.set()
362
-
363
365
  # ignore bot events
364
366
  if event.sender == self.client.user:
365
367
  return
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: matrix-python
3
- Version: 1.0.1
3
+ Version: 1.0.2
4
4
  Summary: An easy-to-use Matrix bot framework designed for quick development and minimal setup
5
5
  Author: Simon Roy, Chris Dedman Rollet
6
6
  Maintainer-email: Code Society Lab <admin@codesociety.xyz>
@@ -34,18 +34,18 @@ Description-Content-Type: text/markdown
34
34
  Requires-Dist: matrix-nio==0.26.0
35
35
  Requires-Dist: logger
36
36
  Requires-Dist: PyYAML==6.0.3
37
- Requires-Dist: markdown==3.10.2
37
+ Requires-Dist: markdown==3.10.3
38
38
  Requires-Dist: APScheduler==3.11.3
39
39
  Requires-Dist: envyaml==1.10.211231
40
40
  Provides-Extra: dev
41
- Requires-Dist: pytest==9.1.1; extra == "dev"
41
+ Requires-Dist: pytest==9.2.0; extra == "dev"
42
42
  Requires-Dist: pytest-cov==7.1.0; extra == "dev"
43
- Requires-Dist: pytest-asyncio==1.4.0; extra == "dev"
44
- Requires-Dist: black==26.5.1; extra == "dev"
45
- Requires-Dist: mypy==2.1.0; extra == "dev"
46
- Requires-Dist: pre-commit==4.6.1; extra == "dev"
47
- Requires-Dist: types-PyYAML==6.0.12.20260724; extra == "dev"
48
- Requires-Dist: types-Markdown==3.10.2.20260518; extra == "dev"
43
+ Requires-Dist: pytest-asyncio==1.4.1; extra == "dev"
44
+ Requires-Dist: black==26.10.1; extra == "dev"
45
+ Requires-Dist: mypy==2.4.1; extra == "dev"
46
+ Requires-Dist: pre-commit==4.6.2; extra == "dev"
47
+ Requires-Dist: types-PyYAML==6.0.12.20260906; extra == "dev"
48
+ Requires-Dist: types-Markdown==3.11.2.20261029; extra == "dev"
49
49
  Provides-Extra: doc
50
50
  Requires-Dist: mkdocs==1.6.1; extra == "doc"
51
51
  Requires-Dist: mkdocs-material==9.7.7; extra == "doc"
@@ -1,8 +1,8 @@
1
1
  matrix/__init__.py,sha256=bFfC9KRjuvxLh1eEAiE3RH63ofHf3SyDrdG0yHd5VgM,868
2
2
  matrix/_error_handler.py,sha256=JVLnE9Z1oSZkgZOUE_hHtjn_5pKzb1Sl_1Ib6so-new,425
3
- matrix/_version.py,sha256=kVzd70nsc9npCjHx31js_RWm0e0yw03untTZxUpY9Ys,528
3
+ matrix/_version.py,sha256=IYo_2kh6E4DG59MxlD-WLxP1hLLYDXscN3je1-fn8Tw,528
4
4
  matrix/api.py,sha256=ZzMzxviJzCCYhZ_KUXlwAKwHFkdw5zrRclqtWRI0Ikc,3381
5
- matrix/bot.py,sha256=y5lP8Gdk6ILDl-GUjCf-7SU1i3rdoGHWtzTVlDgzb5U,14091
5
+ matrix/bot.py,sha256=rTqohJoEwXjM8SSDHXNp-a4is2wPPMcmh_t99DUKy3g,14277
6
6
  matrix/checks.py,sha256=Y2iBgFRocG3CHbGBaN3E9u34Rc47uASCIwrZc6Lf8pc,3063
7
7
  matrix/command.py,sha256=DnxdJA-4Q01VrCtiZK-kBThCkxpasyfAsLgM-_FZ6vY,10044
8
8
  matrix/component.py,sha256=-yBHSYkwHMBws1fbzDc0tsYlVOGzmHvwHMmKMoQF3s8,2866
@@ -24,7 +24,7 @@ matrix/types.py,sha256=xQxtawietfWn_EWBk3Mun_aG02cxExvxYB3eeTKlR9A,524
24
24
  matrix/help/__init__.py,sha256=1u7V7T_-VgYDeQCTXsc4y8Fo-8gJhOqYJq2U3cUjMWg,168
25
25
  matrix/help/help_command.py,sha256=DEhOpMGx0-43m--sVqQjq-w71r6yKsrxSPDMFsr4oE4,12277
26
26
  matrix/help/pagination.py,sha256=tmqgz_msP0qWefCiMDzDcGMP830z89VgQHxptj8ogzc,2175
27
- matrix_python-1.0.1.dist-info/METADATA,sha256=DiJI5MuEUHts8uuY5n9jeerM7qKrInO3DVlfbezQyN4,6403
28
- matrix_python-1.0.1.dist-info/WHEEL,sha256=K260EYznzXsJYBQGqmI8VTxEdiZYNvDZwW9cBh9-_MA,91
29
- matrix_python-1.0.1.dist-info/top_level.txt,sha256=BvHVM9c7-5SLzg-1OCRpHKgqAubWhRN1e38e6coHs-g,7
30
- matrix_python-1.0.1.dist-info/RECORD,,
27
+ matrix_python-1.0.2.dist-info/METADATA,sha256=i6L01lypYI6Diz0RzpCZeIfgLfppD5KrRqa_K6jIYh0,6404
28
+ matrix_python-1.0.2.dist-info/WHEEL,sha256=mOdXR9C3wMVov7cSY8PY-XCzo3SmmWCHvGQr5csJoao,91
29
+ matrix_python-1.0.2.dist-info/top_level.txt,sha256=BvHVM9c7-5SLzg-1OCRpHKgqAubWhRN1e38e6coHs-g,7
30
+ matrix_python-1.0.2.dist-info/RECORD,,
@@ -1,5 +1,5 @@
1
1
  Wheel-Version: 1.0
2
- Generator: setuptools (83.0.0)
2
+ Generator: setuptools (84.2.1)
3
3
  Root-Is-Purelib: true
4
4
  Tag: py3-none-any
5
5