Add defaults for third-party stubs E-H (#9954)

This commit is contained in:
Alex Waygood
2023-03-27 17:09:01 +01:00
committed by GitHub
parent 0c0a58f36d
commit 1cd3ae8e30
58 changed files with 509 additions and 496 deletions

View File

@@ -18,15 +18,15 @@ length_size_units: Any
time_units: Any
def coerce_boolean(value: object) -> bool: ...
def coerce_pattern(value: str | Pattern[str], flags: int = ...) -> Pattern[str]: ...
def coerce_pattern(value: str | Pattern[str], flags: int = 0) -> Pattern[str]: ...
def coerce_seconds(value: float | datetime.timedelta) -> float: ...
def format_size(num_bytes: float, keep_width: bool = ..., binary: bool = ...) -> str: ...
def parse_size(size: str, binary: bool = ...) -> int: ...
def format_length(num_metres: float, keep_width: bool = ...) -> str: ...
def format_size(num_bytes: float, keep_width: bool = False, binary: bool = False) -> str: ...
def parse_size(size: str, binary: bool = False) -> int: ...
def format_length(num_metres: float, keep_width: bool = False) -> str: ...
def parse_length(length: str) -> float: ...
def format_number(number: float, num_decimals: int = ...) -> str: ...
def round_number(count: float, keep_width: bool = ...) -> str: ...
def format_timespan(num_seconds: float | datetime.timedelta, detailed: bool = ..., max_units: int = ...) -> str: ...
def format_number(number: float, num_decimals: int = 2) -> str: ...
def round_number(count: float, keep_width: bool = False) -> str: ...
def format_timespan(num_seconds: float | datetime.timedelta, detailed: bool = False, max_units: int = 3) -> str: ...
def parse_timespan(timespan: str) -> float: ...
def parse_date(datestring: str) -> tuple[int, int, int, int, int, int]: ...
def format_path(pathname: str) -> str: ...
@@ -37,13 +37,13 @@ class Timer:
resumable: bool
start_time: float
total_time: float
def __init__(self, start_time: Incomplete | None = ..., resumable: bool = ...) -> None: ...
def __init__(self, start_time: Incomplete | None = None, resumable: bool = False) -> None: ...
def __enter__(self): ...
def __exit__(
self,
exc_type: type[BaseException] | None = ...,
exc_value: BaseException | None = ...,
traceback: TracebackType | None = ...,
exc_type: type[BaseException] | None = None,
exc_value: BaseException | None = None,
traceback: TracebackType | None = None,
) -> None: ...
def sleep(self, seconds: float) -> None: ...
@property

View File

@@ -8,14 +8,14 @@ _KT = TypeVar("_KT")
_VT = TypeVar("_VT")
class CaseInsensitiveDict(OrderedDict[_KT, _VT], Generic[_KT, _VT]):
def __init__(self, other: Incomplete | None = ..., **kw) -> None: ...
def __init__(self, other: Incomplete | None = None, **kw) -> None: ...
def coerce_key(self, key): ...
@classmethod
def fromkeys(cls, iterable, value: Incomplete | None = ...): ...
def get(self, key, default: Incomplete | None = ...): ...
def pop(self, key, default: Incomplete | None = ...): ...
def setdefault(self, key, default: Incomplete | None = ...): ...
def update(self, other: Incomplete | None = ..., **kw) -> None: ... # type: ignore[override]
def fromkeys(cls, iterable, value: Incomplete | None = None): ...
def get(self, key, default: Incomplete | None = None): ...
def pop(self, key, default: Incomplete | None = None): ...
def setdefault(self, key, default: Incomplete | None = None): ...
def update(self, other: Incomplete | None = None, **kw) -> None: ... # type: ignore[override]
def __contains__(self, key): ...
def __delitem__(self, key) -> None: ...
def __getitem__(self, key): ...

View File

@@ -10,4 +10,4 @@ def print_formatted_timespan(value) -> None: ...
def print_parsed_length(value) -> None: ...
def print_parsed_size(value) -> None: ...
def demonstrate_ansi_formatting() -> None: ...
def demonstrate_256_colors(i, j, group: Incomplete | None = ...) -> None: ...
def demonstrate_256_colors(i, j, group: Incomplete | None = None) -> None: ...

View File

@@ -4,11 +4,11 @@ from typing import Any
MAX_ATTEMPTS: int
logger: Any
def prompt_for_confirmation(question, default: Incomplete | None = ..., padding: bool = ...): ...
def prompt_for_choice(choices, default: Incomplete | None = ..., padding: bool = ...): ...
def prompt_for_input(question, default: Incomplete | None = ..., padding: bool = ..., strip: bool = ...): ...
def prompt_for_confirmation(question, default: Incomplete | None = None, padding: bool = True): ...
def prompt_for_choice(choices, default: Incomplete | None = None, padding: bool = True): ...
def prompt_for_input(question, default: Incomplete | None = None, padding: bool = True, strip: bool = True): ...
def prepare_prompt_text(prompt_text, **options): ...
def prepare_friendly_prompts() -> None: ...
def retry_limit(limit=...) -> None: ...
def retry_limit(limit=10) -> None: ...
class TooManyInvalidReplies(Exception): ...

View File

@@ -8,8 +8,8 @@ def enable_man_role(app) -> None: ...
def enable_pypi_role(app) -> None: ...
def enable_special_methods(app) -> None: ...
def enable_usage_formatting(app) -> None: ...
def man_role(role, rawtext, text, lineno, inliner, options=..., content=...): ...
def pypi_role(role, rawtext, text, lineno, inliner, options=..., content=...): ...
def man_role(role, rawtext, text, lineno, inliner, options={}, content=[]): ...
def pypi_role(role, rawtext, text, lineno, inliner, options={}, content=[]): ...
def setup(app): ...
def special_methods_callback(app, what, name, obj, skip, options): ...
def usage_message_callback(app, what, name, obj, options, lines) -> None: ...

View File

@@ -1,6 +1,6 @@
from _typeshed import Incomplete
def format_smart_table(data, column_names): ...
def format_pretty_table(data, column_names: Incomplete | None = ..., horizontal_bar: str = ..., vertical_bar: str = ...): ...
def format_pretty_table(data, column_names: Incomplete | None = None, horizontal_bar: str = "-", vertical_bar: str = "|"): ...
def format_robust_table(data, column_names): ...
def format_rst_table(data, column_names: Incomplete | None = ...): ...
def format_rst_table(data, column_names: Incomplete | None = None): ...

View File

@@ -15,24 +15,24 @@ DEFAULT_COLUMNS: int
DEFAULT_ENCODING: str
HIGHLIGHT_COLOR: Any
def ansi_strip(text, readline_hints: bool = ...): ...
def ansi_strip(text, readline_hints: bool = True): ...
def ansi_style(**kw): ...
def ansi_width(text): ...
def ansi_wrap(text, **kw): ...
def auto_encode(stream, text, *args, **kw) -> None: ...
def clean_terminal_output(text): ...
def connected_to_terminal(stream: Incomplete | None = ...): ...
def connected_to_terminal(stream: Incomplete | None = None): ...
def enable_ansi_support(): ...
def find_terminal_size(): ...
def find_terminal_size_using_ioctl(stream): ...
def find_terminal_size_using_stty(): ...
def get_pager_command(text: Incomplete | None = ...): ...
def get_pager_command(text: Incomplete | None = None): ...
def have_windows_native_ansi_support(): ...
def message(text, *args, **kw) -> None: ...
def output(text, *args, **kw) -> None: ...
def readline_strip(expr): ...
def readline_wrap(expr): ...
def show_pager(formatted_text, encoding=...) -> None: ...
def terminal_supports_colors(stream: Incomplete | None = ...): ...
def show_pager(formatted_text, encoding="UTF-8") -> None: ...
def terminal_supports_colors(stream: Incomplete | None = None): ...
def usage(usage_text) -> None: ...
def warning(text, *args, **kw) -> None: ...

View File

@@ -3,7 +3,7 @@ from typing import Any
from humanfriendly.compat import HTMLParser
def html_to_ansi(data, callback: Incomplete | None = ...): ...
def html_to_ansi(data, callback: Incomplete | None = None): ...
class HTMLConverter(HTMLParser):
BLOCK_TAGS: Any
@@ -15,7 +15,7 @@ class HTMLConverter(HTMLParser):
def current_style(self): ...
stack: Any
def close(self) -> None: ...
def emit_style(self, style: Incomplete | None = ...) -> None: ...
def emit_style(self, style: Incomplete | None = None) -> None: ...
def handle_charref(self, value) -> None: ...
link_text: Any
def handle_data(self, data) -> None: ...

View File

@@ -16,15 +16,15 @@ class Spinner:
counter: int
last_update: int
def __init__(self, **options) -> None: ...
def step(self, progress: int = ..., label: Incomplete | None = ...) -> None: ...
def step(self, progress: int = 0, label: Incomplete | None = None) -> None: ...
def sleep(self) -> None: ...
def clear(self) -> None: ...
def __enter__(self): ...
def __exit__(
self,
exc_type: type[BaseException] | None = ...,
exc_value: BaseException | None = ...,
traceback: TracebackType | None = ...,
exc_type: type[BaseException] | None = None,
exc_value: BaseException | None = None,
traceback: TracebackType | None = None,
) -> None: ...
class AutomaticSpinner:
@@ -32,11 +32,11 @@ class AutomaticSpinner:
show_time: Any
shutdown_event: Any
subprocess: Any
def __init__(self, label, show_time: bool = ...) -> None: ...
def __init__(self, label, show_time: bool = True) -> None: ...
def __enter__(self) -> None: ...
def __exit__(
self,
exc_type: type[BaseException] | None = ...,
exc_value: BaseException | None = ...,
traceback: TracebackType | None = ...,
exc_type: type[BaseException] | None = None,
exc_value: BaseException | None = None,
traceback: TracebackType | None = None,
) -> None: ...

View File

@@ -5,9 +5,9 @@ from typing import Any
from humanfriendly.compat import StringIO
def configure_logging(log_level=...) -> None: ...
def configure_logging(log_level=10) -> None: ...
def make_dirs(pathname) -> None: ...
def retry(func, timeout: int = ..., exc_type=...): ...
def retry(func, timeout: int = 60, exc_type=...): ...
def run_cli(entry_point, *arguments, **options): ...
def skip_on_raise(*exc_types): ...
def touch(filename) -> None: ...
@@ -18,9 +18,9 @@ class ContextManager:
def __enter__(self): ...
def __exit__(
self,
exc_type: type[BaseException] | None = ...,
exc_value: BaseException | None = ...,
traceback: TracebackType | None = ...,
exc_type: type[BaseException] | None = None,
exc_value: BaseException | None = None,
traceback: TracebackType | None = None,
) -> None: ...
class PatchedAttribute(ContextManager):
@@ -52,7 +52,7 @@ class MockedHomeDirectory(PatchedItem, TemporaryDirectory):
class CustomSearchPath(PatchedItem, TemporaryDirectory):
isolated_search_path: Any
def __init__(self, isolated: bool = ...) -> None: ...
def __init__(self, isolated: bool = False) -> None: ...
patched_value: Any
def __enter__(self): ...
@property
@@ -63,7 +63,7 @@ class MockedProgram(CustomSearchPath):
program_returncode: Any
program_script: Any
program_signal_file: Any
def __init__(self, name, returncode: int = ..., script: Incomplete | None = ...) -> None: ...
def __init__(self, name, returncode: int = 0, script: Incomplete | None = None) -> None: ...
def __enter__(self): ...
def __exit__(self, *args: object, **kw: object): ...
@@ -72,7 +72,7 @@ class CaptureOutput(ContextManager):
stdout: Any
stderr: Any
patched_attributes: Any
def __init__(self, merged: bool = ..., input: str = ..., enabled: bool = ...) -> None: ...
def __init__(self, merged: bool = False, input: str = "", enabled: bool = True) -> None: ...
def __enter__(self): ...
def get_lines(self): ...
def get_text(self): ...
@@ -84,4 +84,4 @@ class CaptureBuffer(StringIO):
class TestCase(unittest.TestCase):
def __init__(self, *args, **kw) -> None: ...
def setUp(self, log_level=...) -> None: ...
def setUp(self, log_level=10) -> None: ...

View File

@@ -2,16 +2,16 @@ from _typeshed import Incomplete
def compact(text, *args, **kw): ...
def compact_empty_lines(text): ...
def concatenate(items, conjunction: str = ..., serial_comma: bool = ...): ...
def concatenate(items, conjunction: str = "and", serial_comma: bool = False): ...
def dedent(text, *args, **kw): ...
def format(text, *args, **kw): ...
def generate_slug(text, delimiter: str = ...): ...
def generate_slug(text, delimiter: str = "-"): ...
def is_empty_line(text): ...
def join_lines(text): ...
def pluralize(count, singular, plural: Incomplete | None = ...): ...
def pluralize_raw(count, singular, plural: Incomplete | None = ...): ...
def random_string(length=..., characters=...): ...
def split(text, delimiter: str = ...): ...
def pluralize(count, singular, plural: Incomplete | None = None): ...
def pluralize_raw(count, singular, plural: Incomplete | None = None): ...
def random_string(length=(25, 100), characters=...): ...
def split(text, delimiter: str = ","): ...
def split_paragraphs(text): ...
def tokenize(text): ...
def trim_empty_lines(text): ...