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/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]: ... 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"},