From 73962f4e8ae142980fa3a225f7205be4079a6aed Mon Sep 17 00:00:00 2001 From: Roman Glushko Date: Wed, 27 Dec 2023 16:47:14 +0200 Subject: [PATCH 1/2] Exposed event type & updated the notifier type --- notifykit/__init__.py | 3 ++- notifykit/_notifier.py | 10 +++++----- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/notifykit/__init__.py b/notifykit/__init__.py index edcb321..ae7132e 100644 --- a/notifykit/__init__.py +++ b/notifykit/__init__.py @@ -1,4 +1,4 @@ -from notifykit._notifier import Notifier, NotifierT +from notifykit._notifier import Notifier, NotifierT, Event from notifykit._notifykit_lib import ( __version__, ObjectType, @@ -22,6 +22,7 @@ "Notifier", "NotifierT", "VERSION", + "Event", "ObjectType", "AccessType", "AccessMode", diff --git a/notifykit/_notifier.py b/notifykit/_notifier.py index 8a410b7..c13734c 100644 --- a/notifykit/_notifier.py +++ b/notifykit/_notifier.py @@ -1,6 +1,6 @@ from os import PathLike import anyio -from typing import Sequence, Protocol, Optional, Any, List +from typing import Sequence, Protocol, Optional, List from notifykit._notifykit_lib import ( WatcherWrapper, AccessEvent, @@ -32,16 +32,16 @@ def watch( def unwatch(self, paths: Sequence[str]) -> None: ... - def __enter__(self) -> "Notifier": + def __aiter__(self) -> "Notifier": ... - def __exit__(self, *args: Any, **kwargs: Any) -> None: + def __iter__(self) -> "Notifier": ... - def __aiter__(self) -> "Notifier": + def __next__(self) -> List[Event]: ... - def __iter__(self) -> "Notifier": + async def __anext__(self) -> List[Event]: ... From 04d89f1ed3f792d38defeff5361e4e645bf510ad Mon Sep 17 00:00:00 2001 From: Roman Glushko Date: Wed, 27 Dec 2023 16:48:25 +0200 Subject: [PATCH 2/2] =?UTF-8?q?=F0=9F=94=96=20v0.0.6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Cargo.toml | 2 +- pyproject.toml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 4a33a7f..e001b21 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "notifykit_lib" -version = "0.0.5" +version = "0.0.6" edition = "2021" license = "A toolkit for building applications watching filesystem changes" homepage = "https://github.com/roma-glushko/notifykit" diff --git a/pyproject.toml b/pyproject.toml index faa3816..5023988 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "notifykit" -version = "0.0.5" +version = "0.0.6" description = "A modern efficient Python toolkit for building applications that need to watch filesystem changes" authors = [ {name = "Roman Glushko", email = "roman.glushko.m@gmail.com"},