-
Notifications
You must be signed in to change notification settings - Fork 105
/
Copy pathpath.pyi
197 lines (185 loc) · 7 KB
/
path.pyi
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
from typing import Any, AnyStr, Callable, ContextManager, Generic, IO, Iterable, Iterator, List, Optional, Text, Type, Union
from typing_extensions import Final, Literal
import os
import sys
class _FNMatcher(Generic[AnyStr]):
pattern: AnyStr = ...
def __init__(self, pattern: AnyStr) -> None: ...
def __call__(self, path: local) -> bool: ...
class _Stat:
path: Final[local] = ...
mode: Final[int]
ino: Final[int]
dev: Final[int]
nlink: Final[int]
uid: Final[int]
gid: Final[int]
size: Final[int]
atime: Final[float]
mtime: Final[float]
ctime: Final[float]
atime_ns: Final[int]
mtime_ns: Final[int]
ctime_ns: Final[int]
if sys.version_info >= (3, 8) and sys.platform == "win32":
reparse_tag: Final[int]
blocks: Final[int]
blksize: Final[int]
rdev: Final[int]
flags: Final[int]
gen: Final[int]
birthtime: Final[int]
rsize: Final[int]
creator: Final[int]
type: Final[int]
if sys.platform != 'win32':
@property
def owner(self) -> str: ...
@property
def group(self) -> str: ...
def isdir(self) -> bool: ...
def isfile(self) -> bool: ...
def islink(self) -> bool: ...
if sys.version_info >= (3, 6):
_PathLike = os.PathLike
else:
class _PathLike(Generic[AnyStr]):
def __fspath__(self) -> AnyStr: ...
_PathType = Union[bytes, Text, _PathLike[str], _PathLike[bytes], local]
class local(_PathLike[str]):
class ImportMismatchError(ImportError): ...
sep: Final[str]
strpath: Final[str]
def __init__(self, path: _PathType = ..., expanduser: bool = ...) -> None: ...
def __hash__(self) -> int: ...
def __eq__(self, other: object) -> bool: ...
def __ne__(self, other: object) -> bool: ...
def __lt__(self, other: object) -> bool: ...
def __gt__(self, other: object) -> bool: ...
def __add__(self, other: object) -> local: ...
def __cmp__(self, other: object) -> int: ...
def __div__(self, other: _PathType) -> local: ...
def __truediv__(self, other: _PathType) -> local: ...
def __fspath__(self) -> str: ...
@classmethod
def get_temproot(cls) -> local: ...
@classmethod
def make_numbered_dir(
cls,
prefix: str = ...,
rootdir: Optional[local] = ...,
keep: Optional[int] = ...,
lock_timeout: int = ...,
) -> local: ...
@classmethod
def mkdtemp(cls, rootdir: Optional[local] = ...) -> local: ...
@classmethod
def sysfind(
cls,
name: _PathType,
checker: Optional[Callable[[local], bool]] = ...,
paths: Optional[Iterable[_PathType]] = ...,
) -> Optional[local]: ...
@property
def basename(self) -> str: ...
@property
def dirname(self) -> str: ...
@property
def purebasename(self) -> str: ...
@property
def ext(self) -> str: ...
def as_cwd(self) -> ContextManager[Optional[local]]: ...
def atime(self) -> float: ...
def bestrelpath(self, dest: local) -> str: ...
def chdir(self) -> local: ...
def check(
self,
*,
basename: int = ..., notbasename: int = ...,
basestarts: int = ..., notbasestarts: int = ...,
dir: int = ..., notdir: int = ...,
dotfile: int = ..., notdotfile: int = ...,
endswith: int = ..., notendswith: int = ...,
exists: int = ..., notexists: int = ...,
ext: int = ..., notext: int = ...,
file: int = ..., notfile: int = ...,
fnmatch: int = ..., notfnmatch: int = ...,
link: int = ..., notlink: int = ...,
relto: int = ..., notrelto: int = ...,
) -> bool: ...
def chmod(self, mode: int, rec: Union[int, str, Text, Callable[[local], bool]] = ...) -> None: ...
if sys.platform != 'win32':
def chown(self, user: Union[int, str], group: Union[int, str], rec: int = ...) -> None: ...
def common(self, other: local) -> Optional[local]: ...
def computehash(self, hashtype: str = ..., chunksize: int = ...) -> str: ...
def copy(self, target: local, mode: bool = ..., stat: bool = ...) -> None: ...
def dirpath(self, *args: _PathType, abs: int = ...) -> local: ...
def dump(self, obj: Any, bin: Optional[int] = ...) -> None: ...
def ensure(self, *args: _PathType, dir: int = ...) -> local: ...
def ensure_dir(self, *args: _PathType) -> local: ...
def exists(self) -> bool: ...
def fnmatch(self, pattern: str): _FNMatcher
def isdir(self) -> bool: ...
def isfile(self) -> bool: ...
def islink(self) -> bool: ...
def join(self, *args: _PathType, abs: int = ...) -> local: ...
def listdir(
self,
fil: Optional[Union[str, Text, Callable[[local], bool]]] = ...,
sort: Optional[bool] = ...,
) -> List[local]: ...
def load(self) -> Any: ...
def lstat(self) -> _Stat: ...
def mkdir(self, *args: _PathType) -> local: ...
if sys.platform != 'win32':
def mklinkto(self, oldname: Union[str, local]) -> None: ...
def mksymlinkto(self, value: local, absolute: int = ...) -> None: ...
def move(self, target: local) -> None: ...
def mtime(self) -> float: ...
def new(
self,
*,
drive: str = ...,
dirname: str = ...,
basename: str = ...,
purebasename: str = ...,
ext: str = ...,
) -> local: ...
def open(self, mode: str = ..., ensure: bool = ..., encoding: Optional[str] = ...) -> IO[Any]: ...
def parts(self, reverse: bool = ...) -> List[local]: ...
def pyimport(
self,
modname: Optional[str] = ...,
ensuresyspath: Union[bool, Literal["append", "importlib"]] = ...,
) -> Any: ...
def pypkgpath(self) -> Optional[local]: ...
def read(self, mode: str = ...) -> Union[Text, bytes]: ...
def read_binary(self) -> bytes: ...
def read_text(self, encoding: str) -> Text: ...
def readlines(self, cr: int = ...) -> List[str]: ...
if sys.platform != 'win32':
def readlink(self) -> str: ...
def realpath(self) -> local: ...
def relto(self, relpath: Union[str, local]) -> str: ...
def remove(self, rec: int = ..., ignore_errors: bool = ...) -> None: ...
def rename(self, target: _PathType) -> None: ...
def samefile(self, other: _PathType) -> bool: ...
def setmtime(self, mtime: Optional[float] = ...) -> None: ...
def size(self) -> int: ...
def stat(self, raising: bool = ...) -> _Stat: ...
def sysexec(self, *argv: Any, **popen_opts: Any) -> Text: ...
def visit(
self,
fil: Optional[Union[str, Text, Callable[[local], bool]]] = ...,
rec: Optional[Union[Literal[1, True], str, Text, Callable[[local], bool]]] = ...,
ignore: Type[Exception] = ...,
bf: bool = ...,
sort: bool = ...,
) -> Iterator[local]: ...
def write(self, data: Any, mode: str = ..., ensure: bool = ...) -> None: ...
def write_binary(self, data: bytes, ensure: bool = ...) -> None: ...
def write_text(self, data: Union[str, Text], encoding: str, ensure: bool = ...) -> None: ...
# Untyped types below here.
svnwc: Any
svnurl: Any
SvnAuth: Any