diff --git a/stubs/pydu/system.pyi b/stubs/pydu/system.pyi new file mode 100644 index 0000000..6986116 --- /dev/null +++ b/stubs/pydu/system.pyi @@ -0,0 +1,19 @@ +import os +from typing import Callable, List +from pydu.platform import WINDOWS + + +def makedirs(path: str, mode: int=0o755, ignore_errors: bool=False, exist_ok: bool=False) -> None: ... +def remove(path: str, ignore_errors: bool=False, onerror: Callable=None) -> None: ... +def removes(paths: List[str], ignore_errors: bool=False, onerror: Callable=None) -> None: ... +def open_file(path: str, mode: str='wb+', buffer_size: int=-1, ignore_errors: bool=False) -> None: ... +def copy(src: str, dst: str, ignore_errors: bool=False, follow_symlinks: bool=True) -> None: ... +def touch(path: str) -> None: ... +def chmod(path: str, mode: int, recursive: bool=False) -> None: ... +def which(cmd: str, mode: int=os.F_OK | os.X_OK, path: str=None) -> None: ... +if WINDOWS: + class chcp(object): + def __init__(self, code: str) -> None: ... +else: + def symlink(src: str, dst: str, overwrite: bool=False, ignore_errors: bool=False) -> None: ... + def link(src: str, dst: str, overwrite: bool=False, ignore_errors: bool=False) -> None: ...