From 285c9ef2f398b326e11203ccd803125e9c580b15 Mon Sep 17 00:00:00 2001 From: Prodesire Date: Wed, 7 Mar 2018 13:00:03 +0800 Subject: [PATCH] add type hint for system --- stubs/pydu/system.pyi | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 stubs/pydu/system.pyi 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: ...