adding stubs for passpy API (#6651)

Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
This commit is contained in:
Kevin-Gruber
2021-12-22 16:57:45 +01:00
committed by GitHub
parent bf246b28a9
commit bd0cbf41f4
5 changed files with 40 additions and 0 deletions

View File

@@ -0,0 +1 @@
version = "1.0.*"

View File

@@ -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

View File

@@ -0,0 +1,2 @@
class StoreNotInitialisedError(FileNotFoundError): ...
class RecursiveCopyMoveError(OSError): ...

View File

@@ -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]]]]: ...

View File

@@ -0,0 +1 @@
def gen_password(length: int, symbols: bool = ...) -> str: ...