diff --git a/stubs/passpy/METADATA.toml b/stubs/passpy/METADATA.toml new file mode 100644 index 000000000..f3e83f9c4 --- /dev/null +++ b/stubs/passpy/METADATA.toml @@ -0,0 +1 @@ +version = "1.0.*" diff --git a/stubs/passpy/passpy/__init__.pyi b/stubs/passpy/passpy/__init__.pyi new file mode 100644 index 000000000..98430cc71 --- /dev/null +++ b/stubs/passpy/passpy/__init__.pyi @@ -0,0 +1,5 @@ +from .exceptions import RecursiveCopyMoveError as RecursiveCopyMoveError, StoreNotInitialisedError as StoreNotInitialisedError +from .store import Store as Store +from .util import gen_password as gen_password + +VERSION: str diff --git a/stubs/passpy/passpy/exceptions.pyi b/stubs/passpy/passpy/exceptions.pyi new file mode 100644 index 000000000..f3a532d6c --- /dev/null +++ b/stubs/passpy/passpy/exceptions.pyi @@ -0,0 +1,2 @@ +class StoreNotInitialisedError(FileNotFoundError): ... +class RecursiveCopyMoveError(OSError): ... diff --git a/stubs/passpy/passpy/store.pyi b/stubs/passpy/passpy/store.pyi new file mode 100644 index 000000000..d2a27049e --- /dev/null +++ b/stubs/passpy/passpy/store.pyi @@ -0,0 +1,31 @@ +from _typeshed import StrPath +from collections.abc import Iterator +from typing import Match + +class Store: + def __init__( + self, + gpg_bin: str = ..., + git_bin: str = ..., + store_dir: str = ..., + use_agent: bool = ..., + interactive: bool = ..., + verbose: bool = ..., + ) -> None: ... + def __iter__(self) -> Iterator[str]: ... + def is_init(self) -> bool: ... + def init_store(self, gpg_ids: None | str | list[str], path: StrPath | None = ...) -> None: ... + def init_git(self) -> None: ... + def git(self, method: str, *args: object, **kwargs: object) -> None: ... + def get_key(self, path: StrPath | None) -> str | None: ... + def set_key(self, path: StrPath | None, key_data: str, force: bool = ...) -> None: ... + def remove_path(self, path: StrPath, recursive: bool = ..., force: bool = ...) -> None: ... + def gen_key( + self, path: StrPath | None, length: int, symbols: bool = ..., force: bool = ..., inplace: bool = ... + ) -> str | None: ... + def copy_path(self, old_path: StrPath, new_path: StrPath, force: bool = ...) -> None: ... + def move_path(self, old_path: StrPath, new_path: StrPath, force: bool = ...) -> None: ... + def list_dir(self, path: StrPath) -> tuple[list[str], list[str]]: ... + def iter_dir(self, path: StrPath) -> Iterator[str]: ... + def find(self, names: None | str | list[str]) -> list[str]: ... + def search(self, term: str) -> dict[str, list[tuple[str, Match[str]]]]: ... diff --git a/stubs/passpy/passpy/util.pyi b/stubs/passpy/passpy/util.pyi new file mode 100644 index 000000000..e76e8abca --- /dev/null +++ b/stubs/passpy/passpy/util.pyi @@ -0,0 +1 @@ +def gen_password(length: int, symbols: bool = ...) -> str: ...