massive update, probably broken
[dotfiles/.git] / .config / coc / extensions / node_modules / coc-pyright / node_modules / pyright / dist / typeshed-fallback / stubs / paramiko / paramiko / sftp_client.pyi
1 from logging import Logger
2 from typing import IO, Any, Callable, Iterator, Text
3
4 from paramiko.channel import Channel
5 from paramiko.sftp import BaseSFTP
6 from paramiko.sftp_attr import SFTPAttributes
7 from paramiko.sftp_file import SFTPFile
8 from paramiko.transport import Transport
9 from paramiko.util import ClosingContextManager
10
11 _Callback = Callable[[int, int], Any]
12
13 b_slash: bytes
14
15 class SFTPClient(BaseSFTP, ClosingContextManager):
16     sock: Channel
17     ultra_debug: bool
18     request_number: int
19     logger: Logger
20     def __init__(self, sock: Channel) -> None: ...
21     @classmethod
22     def from_transport(
23         cls, t: Transport, window_size: int | None = ..., max_packet_size: int | None = ...
24     ) -> SFTPClient | None: ...
25     def close(self) -> None: ...
26     def get_channel(self) -> Channel | None: ...
27     def listdir(self, path: str = ...) -> list[str]: ...
28     def listdir_attr(self, path: str = ...) -> list[SFTPAttributes]: ...
29     def listdir_iter(self, path: bytes | Text = ..., read_aheads: int = ...) -> Iterator[SFTPAttributes]: ...
30     def open(self, filename: bytes | Text, mode: str = ..., bufsize: int = ...) -> SFTPFile: ...
31     file = open
32     def remove(self, path: bytes | Text) -> None: ...
33     unlink = remove
34     def rename(self, oldpath: bytes | Text, newpath: bytes | Text) -> None: ...
35     def posix_rename(self, oldpath: bytes | Text, newpath: bytes | Text) -> None: ...
36     def mkdir(self, path: bytes | Text, mode: int = ...) -> None: ...
37     def rmdir(self, path: bytes | Text) -> None: ...
38     def stat(self, path: bytes | Text) -> SFTPAttributes: ...
39     def lstat(self, path: bytes | Text) -> SFTPAttributes: ...
40     def symlink(self, source: bytes | Text, dest: bytes | Text) -> None: ...
41     def chmod(self, path: bytes | Text, mode: int) -> None: ...
42     def chown(self, path: bytes | Text, uid: int, gid: int) -> None: ...
43     def utime(self, path: bytes | Text, times: tuple[float, float] | None) -> None: ...
44     def truncate(self, path: bytes | Text, size: int) -> None: ...
45     def readlink(self, path: bytes | Text) -> Text | None: ...
46     def normalize(self, path: bytes | Text) -> Text: ...
47     def chdir(self, path: None | bytes | Text = ...) -> None: ...
48     def getcwd(self) -> Text | None: ...
49     def putfo(
50         self, fl: IO[bytes], remotepath: bytes | Text, file_size: int = ..., callback: _Callback | None = ..., confirm: bool = ...
51     ) -> SFTPAttributes: ...
52     def put(
53         self, localpath: bytes | Text, remotepath: bytes | Text, callback: _Callback | None = ..., confirm: bool = ...
54     ) -> SFTPAttributes: ...
55     def getfo(self, remotepath: bytes | Text, fl: IO[bytes], callback: _Callback | None = ..., prefetch: bool = ...) -> int: ...
56     def get(
57         self, remotepath: bytes | Text, localpath: bytes | Text, callback: _Callback | None = ..., prefetch: bool = ...
58     ) -> None: ...
59
60 class SFTP(SFTPClient): ...