summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormathieui <mathieui@mathieui.net>2020-05-28 19:34:56 +0200
committermathieui <mathieui@mathieui.net>2020-06-01 09:09:09 +0200
commiteb0f24c935ac37d8654f5e77c52bd4c460ca24e1 (patch)
treecec76669c5e526c0ce41ac91bade734de3e72306
parent927f3843ad96048f13bef297d4ce7e129517a840 (diff)
downloadpoezio-eb0f24c935ac37d8654f5e77c52bd4c460ca24e1.tar.gz
poezio-eb0f24c935ac37d8654f5e77c52bd4c460ca24e1.tar.bz2
poezio-eb0f24c935ac37d8654f5e77c52bd4c460ca24e1.tar.xz
poezio-eb0f24c935ac37d8654f5e77c52bd4c460ca24e1.zip
Add a shlex pyi (based on upstream)
-rw-r--r--poezio/poezio_shlex.pyi45
1 files changed, 45 insertions, 0 deletions
diff --git a/poezio/poezio_shlex.pyi b/poezio/poezio_shlex.pyi
new file mode 100644
index 00000000..affbe12b
--- /dev/null
+++ b/poezio/poezio_shlex.pyi
@@ -0,0 +1,45 @@
+from typing import List, Tuple, Any, TextIO, Union, Optional, Iterable, TypeVar
+import sys
+
+def split(s: str, comments: bool = ..., posix: bool = ...) -> List[str]: ...
+if sys.version_info >= (3, 8):
+ def join(split_command: Iterable[str]) -> str: ...
+def quote(s: str) -> str: ...
+
+_SLT = TypeVar('_SLT', bound=shlex)
+
+class shlex(Iterable[str]):
+ commenters: str
+ wordchars: str
+ whitespace: str
+ escape: str
+ quotes: str
+ escapedquotes: str
+ whitespace_split: bool
+ infile: str
+ instream: TextIO
+ source: str
+ debug: int
+ lineno: int
+ token: str
+ eof: str
+ if sys.version_info >= (3, 6):
+ punctuation_chars: str
+
+ if sys.version_info >= (3, 6):
+ def __init__(self, instream: Union[str, TextIO] = ..., infile: Optional[str] = ...,
+ posix: bool = ..., punctuation_chars: Union[bool, str] = ...) -> None: ...
+ else:
+ def __init__(self, instream: Union[str, TextIO] = ..., infile: Optional[str] = ...,
+ posix: bool = ...) -> None: ...
+ def get_token(self) -> Tuple[int, int, str]: ...
+ def push_token(self, tok: str) -> None: ...
+ def read_token(self) -> str: ...
+ def sourcehook(self, filename: str) -> Tuple[str, TextIO]: ...
+ # TODO argument types
+ def push_source(self, newstream: Any, newfile: Any = ...) -> None: ...
+ def pop_source(self) -> None: ...
+ def error_leader(self, infile: str = ...,
+ lineno: int = ...) -> None: ...
+ def __iter__(self: _SLT) -> _SLT: ...
+ def __next__(self) -> str: ...