From 26f5ffd5ba38085b6c1d3d8332aa50084ca58435 Mon Sep 17 00:00:00 2001 From: David Euresti Date: Wed, 5 Apr 2017 16:54:05 -0400 Subject: [PATCH] Add stubs for cmd (#1128) --- stdlib/2and3/cmd.pyi | 41 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) create mode 100644 stdlib/2and3/cmd.pyi diff --git a/stdlib/2and3/cmd.pyi b/stdlib/2and3/cmd.pyi new file mode 100644 index 000000000..dc305c95c --- /dev/null +++ b/stdlib/2and3/cmd.pyi @@ -0,0 +1,41 @@ +# Stubs for cmd (Python 2/3) + +from typing import Any, Optional, Text, IO, List, Callable, Tuple + +class Cmd: + prompt = ... # type: str + identchars = ... # type: str + ruler = ... # type: str + lastcmd = ... # type: str + intro = ... # type: Optional[Any] + doc_leader = ... # type: str + doc_header = ... # type: str + misc_header = ... # type: str + undoc_header = ... # type: str + nohelp = ... # type: str + use_rawinput = ... # type: bool + stdin = ... # type: IO[str] + stdout = ... # type: IO[str] + cmdqueue = ... # type: List[str] + completekey = ... # type: str + def __init__(self, completekey: str = ..., stdin: Optional[IO[str]] = ..., stdout: Optional[IO[str]] = ...) -> None: ... + old_completer = ... # type: Optional[Callable[[str, int], Optional[str]]] + def cmdloop(self, intro: Optional[Any] = ...) -> None: ... + def precmd(self, line: str) -> str: ... + def postcmd(self, stop: bool, line: str) -> bool: ... + def preloop(self) -> None: ... + def postloop(self) -> None: ... + def parseline(self, line: str) -> Tuple[Optional[str], Optional[str], str]: ... + def onecmd(self, line: str) -> bool: ... + def emptyline(self) -> bool: ... + def default(self, line: str) -> bool: ... + def completedefault(self, *ignored: Any) -> List[str]: ... + def completenames(self, text: str, *ignored: Any) -> List[str]: ... + completion_matches = ... # type: Optional[List[str]] + def complete(self, text: str, state: int) -> Optional[List[str]]: ... + def get_names(self) -> List[str]: ... + # Only the first element of args matters. + def complete_help(self, *args: Any) -> List[str]: ... + def do_help(self, arg: Optional[str]) -> None: ... + def print_topics(self, header: str, cmds: Optional[List[str]], cmdlen: Any, maxcol: int) -> None: ... + def columnize(self, list: Optional[List[str]], displaywidth: int = ...) -> None: ...