From 502b21567bf21c5b7fea5ebb4edf22c316bb0967 Mon Sep 17 00:00:00 2001 From: Roman Glushko Date: Tue, 2 Jan 2024 12:12:51 +0200 Subject: [PATCH 1/3] #31 added typing for event constructors --- notifykit/_notifykit_lib.pyi | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/notifykit/_notifykit_lib.pyi b/notifykit/_notifykit_lib.pyi index 527fc58..9f2b6df 100644 --- a/notifykit/_notifykit_lib.pyi +++ b/notifykit/_notifykit_lib.pyi @@ -52,32 +52,48 @@ class AccessEvent: access_type: AccessType access_mode: Optional[AccessMode] + def __init__(self, path: str, access_type: AccessType, access_mode: Optional[AccessMode]) -> None: ... + class CreateEvent: path: Path file_type: ObjectType + def __init__(self, path: str, file_type: ObjectType) -> None: ... + class ModifyDataEvent: path: Path data_type: DataType + def __init__(self, path: str, data_type: DataType) -> None: ... + class ModifyMetadataEvent: path: Path metadata_type: MetadataType + def __init__(self, path: str, metadata_type: MetadataType) -> None: ... + class ModifyOtherEvent: path: Path + def __init__(self, path: str) -> None: ... + class ModifyUnknownEvent: path: Path + def __init__(self, path: str) -> None: ... + class DeleteEvent: path: Path file_type: ObjectType + def __init__(self, path: str, file_type: ObjectType) -> None: ... + class RenameEvent: old_path: Path new_path: Path + def __init__(self, old_path: str, new_path: str) -> None: ... + class WatcherWrapper: """ Watcher listens to filesystem events and retrieves them for the Notifier. From 371854b5f81c643b212f6bf8b2600840aeb9e725 Mon Sep 17 00:00:00 2001 From: Roman Glushko Date: Tue, 2 Jan 2024 12:15:18 +0200 Subject: [PATCH 2/3] #31 Made path typing actual --- notifykit/_notifykit_lib.pyi | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/notifykit/_notifykit_lib.pyi b/notifykit/_notifykit_lib.pyi index 9f2b6df..a0a74c4 100644 --- a/notifykit/_notifykit_lib.pyi +++ b/notifykit/_notifykit_lib.pyi @@ -48,49 +48,49 @@ class MetadataType(IntEnum): OTHER = 6 class AccessEvent: - path: Path + path: str access_type: AccessType access_mode: Optional[AccessMode] def __init__(self, path: str, access_type: AccessType, access_mode: Optional[AccessMode]) -> None: ... class CreateEvent: - path: Path + path: str file_type: ObjectType def __init__(self, path: str, file_type: ObjectType) -> None: ... class ModifyDataEvent: - path: Path + path: str data_type: DataType def __init__(self, path: str, data_type: DataType) -> None: ... class ModifyMetadataEvent: - path: Path + path: str metadata_type: MetadataType def __init__(self, path: str, metadata_type: MetadataType) -> None: ... class ModifyOtherEvent: - path: Path + path: str def __init__(self, path: str) -> None: ... class ModifyUnknownEvent: - path: Path + path: str def __init__(self, path: str) -> None: ... class DeleteEvent: - path: Path + path: str file_type: ObjectType def __init__(self, path: str, file_type: ObjectType) -> None: ... class RenameEvent: - old_path: Path - new_path: Path + old_path: str + new_path: str def __init__(self, old_path: str, new_path: str) -> None: ... From a094595df76f9cb055a1d7683ef639c737569c98 Mon Sep 17 00:00:00 2001 From: Roman Glushko Date: Tue, 2 Jan 2024 13:16:08 +0200 Subject: [PATCH 3/3] #31 linting --- notifykit/_notifykit_lib.pyi | 1 - 1 file changed, 1 deletion(-) diff --git a/notifykit/_notifykit_lib.pyi b/notifykit/_notifykit_lib.pyi index a0a74c4..ea9c041 100644 --- a/notifykit/_notifykit_lib.pyi +++ b/notifykit/_notifykit_lib.pyi @@ -1,5 +1,4 @@ from enum import IntEnum -from pathlib import Path from typing import List, Optional, Any """