Compare commits

...

3 Commits

Author SHA1 Message Date
fec4315be2 typo fix 2025-02-27 20:34:49 +00:00
a3e3db3c37 move callbacks/observer examples into examples/events/ 2025-02-27 20:33:59 +00:00
3e201443e0 upd env name 2025-02-27 20:26:26 +00:00
7 changed files with 10 additions and 2 deletions

View File

@ -0,0 +1,8 @@
# Events
If you want to receive updates on certain events there are two routes you can take:
- Register a class that implements an `on_update(self, event) -> None` method on the `{Remote}.subject` class.
- Register callback functions/methods on the `{Remote}.subject` class, one for each type of update.
Included are examples of both approaches.

View File

@ -58,5 +58,5 @@ def test_all():
def generate_badges():
for kind in ['basic', 'banana', 'potato']:
subprocess.run(
['tox', 'r', '-e', 'genbadges'], env=os.environ.copy() | {'KIND': kind}
['tox', 'r', '-e', 'genbadge'], env=os.environ.copy() | {'KIND': kind}
)

View File

@ -10,7 +10,7 @@ commands_pre =
commands =
poetry run pytest tests
[testenv:genbadges]
[testenv:genbadge]
passenv = *
setenv = VIRTUALENV_DISCOVERY=pyenv
allowlist_externals = poetry