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

@@ -8,10 +8,10 @@ logger: Logger
def process_file(
fh: Reader,
stop_tag: str = ...,
details: bool = ...,
strict: bool = ...,
debug: bool = ...,
truncate_tags: bool = ...,
auto_seek: bool = ...,
stop_tag: str = "UNDEF",
details: bool = True,
strict: bool = False,
debug: bool = False,
truncate_tags: bool = True,
auto_seek: bool = True,
) -> dict[str, Any]: ...

View File

@@ -32,15 +32,15 @@ class ExifHeader:
offset: int,
fake_exif: bool,
strict: bool,
debug: bool = ...,
detailed: bool = ...,
truncate_tags: bool = ...,
debug: bool = False,
detailed: bool = True,
truncate_tags: bool = True,
) -> None: ...
def s2n(self, offset: int, length: int, signed: bool = ...) -> int: ...
def s2n(self, offset: int, length: int, signed: bool = False) -> int: ...
def n2b(self, offset: int, length: int) -> bytes: ...
def list_ifd(self) -> list[int]: ...
def dump_ifd(
self, ifd: int, ifd_name: str, tag_dict: TagDict | None = ..., relative: int = ..., stop_tag: str = ...
self, ifd: int, ifd_name: str, tag_dict: TagDict | None = None, relative: int = 0, stop_tag: str = "UNDEF"
) -> None: ...
def extract_tiff_thumbnail(self, thumb_ifd: int) -> None: ...
def extract_jpeg_thumbnail(self) -> None: ...

View File

@@ -16,9 +16,9 @@ def setup_logger(debug: bool, color: bool) -> None: ...
class Formatter(logging.Formatter):
color: bool
debug: bool
def __init__(self, debug: bool = ..., color: bool = ...) -> None: ...
def __init__(self, debug: bool = False, color: bool = False) -> None: ...
class Handler(logging.StreamHandler[TextIO]):
color: bool
debug: bool
def __init__(self, log_level: logging._Level, debug: bool = ..., color: bool = ...) -> None: ...
def __init__(self, log_level: logging._Level, debug: bool = False, color: bool = False) -> None: ...

View File

@@ -14,7 +14,7 @@ def make_string_uc(seq: str | list[int]) -> str: ...
def get_gps_coords(tags: Mapping[str, Any]) -> tuple[float, float]: ...
class Ratio(Fraction):
def __new__(cls, numerator: int = ..., denominator: int | None = ...) -> Self: ...
def __new__(cls, numerator: int = 0, denominator: int | None = None) -> Self: ...
@property
def num(self) -> int: ...
@property

View File

@@ -51,9 +51,9 @@ def re_fix(reg: str) -> str: ...
def try_match_any(inst: str, patterns: Iterable[str | Pattern[str]]) -> bool: ...
def try_match(request_origin: str, maybe_regex: str | Pattern[str]) -> bool: ...
def get_cors_options(appInstance: flask.Flask | None, *dicts: _Options) -> _Options: ...
def get_app_kwarg_dict(appInstance: flask.Flask | None = ...) -> _Options: ...
def get_app_kwarg_dict(appInstance: flask.Flask | None = None) -> _Options: ...
def flexible_str(obj: object) -> str | None: ...
def serialize_option(options_dict: _Options, key: str, upper: bool = ...) -> None: ...
def serialize_option(options_dict: _Options, key: str, upper: bool = False) -> None: ...
@overload
def ensure_iterable(inst: str) -> list[str]: ... # type: ignore[misc]
@overload

View File

@@ -11,7 +11,7 @@ LOG: Logger
class CORS:
def __init__(
self,
app: Incomplete | None = ...,
app: Incomplete | None = None,
*,
resources: dict[str, dict[str, Any]] | list[str] | str | None = ...,
origins: str | list[str] | None = ...,

View File

@@ -25,82 +25,82 @@ class Migrate:
alembic_ctx_kwargs: dict[str, Any]
def __init__(
self,
app: flask.Flask | None = ...,
db: SQLAlchemy | None = ...,
directory: str = ...,
command: str = ...,
compare_type: bool = ...,
render_as_batch: bool = ...,
app: flask.Flask | None = None,
db: SQLAlchemy | None = None,
directory: str = "migrations",
command: str = "db",
compare_type: bool = True,
render_as_batch: bool = True,
**kwargs,
) -> None: ...
def init_app(
self,
app: flask.Flask,
db: SQLAlchemy | None = ...,
directory: str | None = ...,
command: str | None = ...,
compare_type: bool | None = ...,
render_as_batch: bool | None = ...,
db: SQLAlchemy | None = None,
directory: str | None = None,
command: str | None = None,
compare_type: bool | None = None,
render_as_batch: bool | None = None,
**kwargs,
) -> None: ...
def configure(self, f: _ConfigureCallback) -> _ConfigureCallback: ...
def call_configure_callbacks(self, config: Config): ...
def get_config(
self, directory: str | None = ..., x_arg: str | Sequence[str] | None = ..., opts: Iterable[str] | None = ...
self, directory: str | None = None, x_arg: str | Sequence[str] | None = None, opts: Iterable[str] | None = None
): ...
def catch_errors(f: Callable[_P, _T]) -> Callable[_P, _T]: ...
def list_templates() -> None: ...
def init(directory: str | None = ..., multidb: bool = ..., template: str | None = ..., package: bool = ...) -> None: ...
def init(directory: str | None = None, multidb: bool = False, template: str | None = None, package: bool = False) -> None: ...
def revision(
directory: str | None = ...,
message: str | None = ...,
autogenerate: bool = ...,
sql: bool = ...,
head: str = ...,
splice: bool = ...,
branch_label: str | None = ...,
version_path: str | None = ...,
rev_id: str | None = ...,
directory: str | None = None,
message: str | None = None,
autogenerate: bool = False,
sql: bool = False,
head: str = "head",
splice: bool = False,
branch_label: str | None = None,
version_path: str | None = None,
rev_id: str | None = None,
) -> None: ...
def migrate(
directory: str | None = ...,
message: str | None = ...,
sql: bool = ...,
head: str = ...,
splice: bool = ...,
branch_label: str | None = ...,
version_path: str | None = ...,
rev_id: str | None = ...,
x_arg: str | Sequence[str] | None = ...,
directory: str | None = None,
message: str | None = None,
sql: bool = False,
head: str = "head",
splice: bool = False,
branch_label: str | None = None,
version_path: str | None = None,
rev_id: str | None = None,
x_arg: str | Sequence[str] | None = None,
) -> None: ...
def edit(directory: str | None = ..., revision: str = ...) -> None: ...
def edit(directory: str | None = None, revision: str = "current") -> None: ...
def merge(
directory: str | None = ...,
revisions: str = ...,
message: str | None = ...,
branch_label: str | None = ...,
rev_id: str | None = ...,
directory: str | None = None,
revisions: str = "",
message: str | None = None,
branch_label: str | None = None,
rev_id: str | None = None,
) -> None: ...
def upgrade(
directory: str | None = ...,
revision: str = ...,
sql: bool = ...,
tag: str | None = ...,
x_arg: str | Sequence[str] | None = ...,
directory: str | None = None,
revision: str = "head",
sql: bool = False,
tag: str | None = None,
x_arg: str | Sequence[str] | None = None,
) -> None: ...
def downgrade(
directory: str | None = ...,
revision: str = ...,
sql: bool = ...,
tag: str | None = ...,
x_arg: str | Sequence[str] | None = ...,
directory: str | None = None,
revision: str = "-1",
sql: bool = False,
tag: str | None = None,
x_arg: str | Sequence[str] | None = None,
) -> None: ...
def show(directory: str | None = ..., revision: str = ...) -> None: ...
def show(directory: str | None = None, revision: str = "head") -> None: ...
def history(
directory: str | None = ..., rev_range: str | None = ..., verbose: bool = ..., indicate_current: bool = ...
directory: str | None = None, rev_range: str | None = None, verbose: bool = False, indicate_current: bool = False
) -> None: ...
def heads(directory: str | None = ..., verbose: bool = ..., resolve_dependencies: bool = ...) -> None: ...
def branches(directory: str | None = ..., verbose: bool = ...) -> None: ...
def current(directory: str | None = ..., verbose: bool = ...) -> None: ...
def stamp(directory: str | None = ..., revision: str = ..., sql: bool = ..., tag: str | None = ...) -> None: ...
def heads(directory: str | None = None, verbose: bool = False, resolve_dependencies: bool = False) -> None: ...
def branches(directory: str | None = None, verbose: bool = False) -> None: ...
def current(directory: str | None = None, verbose: bool = False) -> None: ...
def stamp(directory: str | None = None, revision: str = "head", sql: bool = False, tag: str | None = None) -> None: ...

View File

@@ -14,22 +14,22 @@ before_models_committed: Any
class SignallingSession(Session):
app: Any
def __init__(self, db, autocommit: bool = ..., autoflush: bool = ..., **options) -> None: ...
def get_bind(self, mapper: Incomplete | None = ..., clause: Incomplete | None = ...): ... # type: ignore[override]
def __init__(self, db, autocommit: bool = False, autoflush: bool = True, **options) -> None: ...
def get_bind(self, mapper: Incomplete | None = None, clause: Incomplete | None = None): ... # type: ignore[override]
def get_debug_queries(): ...
_T = TypeVar("_T")
class BaseQuery(Query[_T]):
def get_or_404(self, ident, description: Incomplete | None = ...): ...
def first_or_404(self, description: Incomplete | None = ...): ...
def get_or_404(self, ident, description: Incomplete | None = None): ...
def first_or_404(self, description: Incomplete | None = None): ...
def paginate(
self,
page: Incomplete | None = ...,
per_page: Incomplete | None = ...,
error_out: bool = ...,
max_per_page: Incomplete | None = ...,
page: Incomplete | None = None,
per_page: Incomplete | None = None,
error_out: bool = True,
max_per_page: Incomplete | None = None,
) -> Pagination[_T]: ...
class Pagination(Generic[_T]):
@@ -41,18 +41,18 @@ class Pagination(Generic[_T]):
def __init__(self, query: BaseQuery[_T] | None, page: int, per_page: int, total: int | None, items) -> None: ...
@property
def pages(self) -> int: ...
def prev(self, error_out: bool = ...) -> Pagination[_T]: ...
def prev(self, error_out: bool = False) -> Pagination[_T]: ...
@property
def prev_num(self) -> int | None: ...
@property
def has_prev(self) -> bool: ...
def next(self, error_out: bool = ...) -> Pagination[_T]: ...
def next(self, error_out: bool = False) -> Pagination[_T]: ...
@property
def has_next(self) -> bool: ...
@property
def next_num(self) -> int | None: ...
def iter_pages(
self, left_edge: int = ..., left_current: int = ..., right_current: int = ..., right_edge: int = ...
self, left_edge: int = 2, left_current: int = 2, right_current: int = 5, right_edge: int = 2
) -> Generator[int | None, None, None]: ...
def get_state(app): ...
@@ -65,33 +65,33 @@ class SQLAlchemy:
app: Any
def __init__(
self,
app: Incomplete | None = ...,
use_native_unicode: bool = ...,
session_options: Incomplete | None = ...,
metadata: Incomplete | None = ...,
app: Incomplete | None = None,
use_native_unicode: bool = True,
session_options: Incomplete | None = None,
metadata: Incomplete | None = None,
query_class=...,
model_class=...,
engine_options: Incomplete | None = ...,
engine_options: Incomplete | None = None,
) -> None: ...
@property
def metadata(self): ...
def create_scoped_session(self, options: Incomplete | None = ...): ...
def create_scoped_session(self, options: Incomplete | None = None): ...
def create_session(self, options): ...
def make_declarative_base(self, model, metadata: Incomplete | None = ...): ...
def make_declarative_base(self, model, metadata: Incomplete | None = None): ...
def init_app(self, app): ...
def apply_pool_defaults(self, app, options): ...
def apply_driver_hacks(self, app, sa_url, options): ...
@property
def engine(self): ...
def make_connector(self, app: Incomplete | None = ..., bind: Incomplete | None = ...): ...
def get_engine(self, app: Incomplete | None = ..., bind: Incomplete | None = ...): ...
def make_connector(self, app: Incomplete | None = None, bind: Incomplete | None = None): ...
def get_engine(self, app: Incomplete | None = None, bind: Incomplete | None = None): ...
def create_engine(self, sa_url, engine_opts): ...
def get_app(self, reference_app: Incomplete | None = ...): ...
def get_tables_for_bind(self, bind: Incomplete | None = ...): ...
def get_binds(self, app: Incomplete | None = ...): ...
def create_all(self, bind: str = ..., app: Incomplete | None = ...) -> None: ...
def drop_all(self, bind: str = ..., app: Incomplete | None = ...) -> None: ...
def reflect(self, bind: str = ..., app: Incomplete | None = ...) -> None: ...
def get_app(self, reference_app: Incomplete | None = None): ...
def get_tables_for_bind(self, bind: Incomplete | None = None): ...
def get_binds(self, app: Incomplete | None = None): ...
def create_all(self, bind: str = "__all__", app: Incomplete | None = None) -> None: ...
def drop_all(self, bind: str = "__all__", app: Incomplete | None = None) -> None: ...
def reflect(self, bind: str = "__all__", app: Incomplete | None = None) -> None: ...
def __getattr__(self, name: str) -> Any: ... # exposes dynamically classes of SQLAlchemy
class FSADeprecationWarning(DeprecationWarning): ...

View File

@@ -10,22 +10,22 @@ class _EmojiListReturn(TypedDict):
def emojize(
string: str,
delimiters: tuple[str, str] = ...,
variant: Literal["text_type", "emoji_type", None] = ...,
language: str = ...,
version: float | None = ...,
handle_version: str | Callable[[str, dict[str, str]], str] | None = ...,
delimiters: tuple[str, str] = (":", ":"),
variant: Literal["text_type", "emoji_type", None] = None,
language: str = "en",
version: float | None = None,
handle_version: str | Callable[[str, dict[str, str]], str] | None = None,
) -> str: ...
def demojize(
string: str,
delimiters: tuple[str, str] = ...,
language: str = ...,
version: float | None = ...,
handle_version: str | Callable[[str, dict[str, str]], str] | None = ...,
delimiters: tuple[str, str] = (":", ":"),
language: str = "en",
version: float | None = None,
handle_version: str | Callable[[str, dict[str, str]], str] | None = None,
) -> str: ...
def replace_emoji(string: str, replace: str | Callable[[str, dict[str, str]], str] = ..., version: float = ...) -> str: ...
def replace_emoji(string: str, replace: str | Callable[[str, dict[str, str]], str] = "", version: float = -1) -> str: ...
def emoji_list(string: str) -> list[_EmojiListReturn]: ...
def distinct_emoji_list(string: str) -> list[str]: ...
def emoji_count(string: str, unique: bool = ...) -> int: ...
def emoji_count(string: str, unique: bool = False) -> int: ...
def version(string: str) -> float: ...
def is_emoji(string: str) -> bool: ...

View File

@@ -19,7 +19,7 @@ class Error:
class Visitor(ast.NodeVisitor, Generic[TConfig]):
errors: list[Error]
@overload
def __init__(self, config: None = ...) -> None: ...
def __init__(self, config: None = None) -> None: ...
@overload
def __init__(self, config: TConfig) -> None: ...
@property

View File

@@ -3,6 +3,6 @@ from typing import Any
from ..plugin import Error as Error, TConfig as TConfig, Visitor as Visitor
def assert_error(
visitor_cls: type[Visitor[TConfig]], src: str, expected: type[Error], config: TConfig | None = ..., **kwargs: Any
visitor_cls: type[Visitor[TConfig]], src: str, expected: type[Error], config: TConfig | None = None, **kwargs: Any
) -> None: ...
def assert_not_error(visitor_cls: type[Visitor[TConfig]], src: str, config: TConfig | None = ...) -> None: ...
def assert_not_error(visitor_cls: type[Visitor[TConfig]], src: str, config: TConfig | None = None) -> None: ...

View File

@@ -5,32 +5,32 @@ from .syntax import PDFObject
class Action(ABC):
next: PDFObject | str | None
def __init__(self, next_action: PDFObject | str | None = ...) -> None: ...
def __init__(self, next_action: PDFObject | str | None = None) -> None: ...
@abstractmethod
def serialize(self) -> str: ...
class URIAction(Action):
uri: str
def __init__(self, uri: str, next_action: PDFObject | str | None = ...) -> None: ...
def __init__(self, uri: str, next_action: PDFObject | str | None = None) -> None: ...
def serialize(self) -> str: ...
class NamedAction(Action):
action_name: str
def __init__(self, action_name: str, next_action: PDFObject | str | None = ...) -> None: ...
def __init__(self, action_name: str, next_action: PDFObject | str | None = None) -> None: ...
def serialize(self) -> str: ...
class GoToAction(Action):
dest: Incomplete
def __init__(self, dest, next_action: PDFObject | str | None = ...) -> None: ...
def __init__(self, dest, next_action: PDFObject | str | None = None) -> None: ...
def serialize(self) -> str: ...
class GoToRemoteAction(Action):
file: str
dest: Incomplete
def __init__(self, file: str, dest, next_action: PDFObject | str | None = ...) -> None: ...
def __init__(self, file: str, dest, next_action: PDFObject | str | None = None) -> None: ...
def serialize(self) -> str: ...
class LaunchAction(Action):
file: str
def __init__(self, file: str, next_action: PDFObject | str | None = ...) -> None: ...
def __init__(self, file: str, next_action: PDFObject | str | None = None) -> None: ...
def serialize(self) -> str: ...

View File

@@ -35,19 +35,19 @@ class AnnotationMixin:
width: int,
height: int,
flags: tuple[AnnotationFlag, ...] = ...,
contents: str | None = ...,
dest: Destination | None = ...,
action: Action | None = ...,
color: tuple[int, int, int] | None = ...,
modification_time: datetime | None = ...,
title: str | None = ...,
quad_points: tuple[float, ...] | None = ..., # multiple of 8 floats
border_width: int = ...,
name: AnnotationName | FileAttachmentAnnotationName | None = ...,
ink_list: tuple[int, ...] = ...,
file_spec: str | None = ...,
field_type: str | None = ...,
value: Incomplete | None = ...,
contents: str | None = None,
dest: Destination | None = None,
action: Action | None = None,
color: tuple[int, int, int] | None = None,
modification_time: datetime | None = None,
title: str | None = None,
quad_points: tuple[float, ...] | None = None, # multiple of 8 floats
border_width: int = 0,
name: AnnotationName | FileAttachmentAnnotationName | None = None,
ink_list: tuple[int, ...] = (),
file_spec: str | None = None,
field_type: str | None = None,
value: Incomplete | None = None,
) -> None: ...
class PDFAnnotation(AnnotationMixin, PDFObject): ...
@@ -62,11 +62,11 @@ class PDFEmbeddedFile(PDFContentStream):
self,
basename: str,
contents: bytes,
desc: str = ...,
creation_date: datetime | None = ...,
modification_date: datetime | None = ...,
compress: bool = ...,
checksum: bool = ...,
desc: str = "",
creation_date: datetime | None = None,
modification_date: datetime | None = None,
compress: bool = False,
checksum: bool = False,
) -> None: ...
def globally_enclosed(self) -> bool: ...
def set_globally_enclosed(self, value: bool) -> None: ...

View File

@@ -38,7 +38,7 @@ class _DeviceRGBBase(NamedTuple):
class DeviceRGB(_DeviceRGBBase):
OPERATOR: ClassVar[str]
def __new__(cls, r: Number, g: Number, b: Number, a: Number | None = ...) -> Self: ...
def __new__(cls, r: Number, g: Number, b: Number, a: Number | None = None) -> Self: ...
@property
def colors(self) -> tuple[Number, Number, Number]: ...
def serialize(self) -> str: ...
@@ -49,7 +49,7 @@ class _DeviceGrayBase(NamedTuple):
class DeviceGray(_DeviceGrayBase):
OPERATOR: ClassVar[str]
def __new__(cls, g: Number, a: Number | None = ...) -> Self: ...
def __new__(cls, g: Number, a: Number | None = None) -> Self: ...
@property
def colors(self) -> tuple[Number]: ...
def serialize(self) -> str: ...
@@ -63,14 +63,14 @@ class _DeviceCMYKBase(NamedTuple):
class DeviceCMYK(_DeviceCMYKBase):
OPERATOR: ClassVar[str]
def __new__(cls, c: Number, m: Number, y: Number, k: Number, a: Number | None = ...) -> Self: ...
def __new__(cls, c: Number, m: Number, y: Number, k: Number, a: Number | None = None) -> Self: ...
@property
def colors(self) -> tuple[Number, Number, Number, Number]: ...
def serialize(self) -> str: ...
def rgb8(r, g, b, a: Incomplete | None = ...) -> DeviceRGB: ...
def gray8(g, a: Incomplete | None = ...) -> DeviceGray: ...
def cmyk8(c, m, y, k, a: Incomplete | None = ...) -> DeviceCMYK: ...
def rgb8(r, g, b, a: Incomplete | None = None) -> DeviceRGB: ...
def gray8(g, a: Incomplete | None = None) -> DeviceGray: ...
def cmyk8(c, m, y, k, a: Incomplete | None = None) -> DeviceCMYK: ...
def color_from_hex_string(hexstr) -> DeviceRGB: ...
def color_from_rgb_string(rgbstr) -> DeviceRGB: ...
@@ -102,18 +102,18 @@ class Transform(NamedTuple):
@classmethod
def translation(cls, x, y): ...
@classmethod
def scaling(cls, x, y: Incomplete | None = ...): ...
def scaling(cls, x, y: Incomplete | None = None): ...
@classmethod
def rotation(cls, theta): ...
@classmethod
def rotation_d(cls, theta_d): ...
@classmethod
def shearing(cls, x, y: Incomplete | None = ...): ...
def shearing(cls, x, y: Incomplete | None = None): ...
def translate(self, x, y): ...
def scale(self, x, y: Incomplete | None = ...): ...
def scale(self, x, y: Incomplete | None = None): ...
def rotate(self, theta): ...
def rotate_d(self, theta_d): ...
def shear(self, x, y: Incomplete | None = ...): ...
def shear(self, x, y: Incomplete | None = None): ...
def about(self, x, y): ...
def __mul__(self, other): ...
def __rmul__(self, other): ...
@@ -316,12 +316,12 @@ class Close(NamedTuple):
class DrawingContext:
def __init__(self) -> None: ...
def add_item(self, item, _copy: bool = ...) -> None: ...
def add_item(self, item, _copy: bool = True) -> None: ...
def render(self, gsd_registry, first_point, scale, height, starting_style): ...
def render_debug(self, gsd_registry, first_point, scale, height, starting_style, debug_stream): ...
class PaintedPath:
def __init__(self, x: int = ..., y: int = ...) -> None: ...
def __init__(self, x: int = 0, y: int = 0) -> None: ...
def __deepcopy__(self, memo) -> Self: ...
@property
def style(self): ...
@@ -343,9 +343,9 @@ class PaintedPath:
def clipping_path(self, new_clipath) -> None: ...
@contextmanager
def transform_group(self, transform) -> Iterator[Self]: ...
def add_path_element(self, item, _copy: bool = ...) -> None: ...
def add_path_element(self, item, _copy: bool = True) -> None: ...
def remove_last_path_element(self) -> None: ...
def rectangle(self, x, y, w, h, rx: int = ..., ry: int = ...) -> Self: ...
def rectangle(self, x, y, w, h, rx: int = 0, ry: int = 0) -> Self: ...
def circle(self, cx, cy, r) -> Self: ...
def ellipse(self, cx, cy, rx, ry) -> Self: ...
def move_to(self, x, y) -> Self: ...
@@ -364,15 +364,15 @@ class PaintedPath:
def arc_relative(self, rx, ry, rotation, large_arc, positive_sweep, dx, dy) -> Self: ...
def close(self) -> None: ...
def render(
self, gsd_registry, style, last_item, initial_point, debug_stream: Incomplete | None = ..., pfx: Incomplete | None = ...
self, gsd_registry, style, last_item, initial_point, debug_stream: Incomplete | None = None, pfx: Incomplete | None = None
): ...
def render_debug(self, gsd_registry, style, last_item, initial_point, debug_stream, pfx): ...
class ClippingPath(PaintedPath):
paint_rule: Incomplete
def __init__(self, x: int = ..., y: int = ...) -> None: ...
def __init__(self, x: int = 0, y: int = 0) -> None: ...
def render(
self, gsd_registry, style, last_item, initial_point, debug_stream: Incomplete | None = ..., pfx: Incomplete | None = ...
self, gsd_registry, style, last_item, initial_point, debug_stream: Incomplete | None = None, pfx: Incomplete | None = None
): ...
def render_debug(self, gsd_registry, style, last_item, initial_point, debug_stream, pfx): ...
@@ -389,7 +389,7 @@ class GraphicsContext:
def clipping_path(self) -> ClippingPath | None: ...
@clipping_path.setter
def clipping_path(self, new_clipath) -> None: ...
def add_item(self, item, _copy: bool = ...) -> None: ...
def add_item(self, item, _copy: bool = True) -> None: ...
def remove_last_item(self) -> None: ...
def merge(self, other_context) -> None: ...
def build_render_list(
@@ -398,9 +398,9 @@ class GraphicsContext:
style,
last_item,
initial_point,
debug_stream: Incomplete | None = ...,
pfx: Incomplete | None = ...,
_push_stack: bool = ...,
debug_stream: Incomplete | None = None,
pfx: Incomplete | None = None,
_push_stack: bool = True,
): ...
def render(
self,
@@ -408,10 +408,10 @@ class GraphicsContext:
style: DrawingContext,
last_item,
initial_point,
debug_stream: Incomplete | None = ...,
pfx: Incomplete | None = ...,
_push_stack: bool = ...,
debug_stream: Incomplete | None = None,
pfx: Incomplete | None = None,
_push_stack: bool = True,
): ...
def render_debug(
self, gsd_registry, style: DrawingContext, last_item, initial_point, debug_stream, pfx, _push_stack: bool = ...
self, gsd_registry, style: DrawingContext, last_item, initial_point, debug_stream, pfx, _push_stack: bool = True
): ...

View File

@@ -6,7 +6,7 @@ class FPDFPageFormatException(FPDFException):
argument: Any
unknown: Any
one: Any
def __init__(self, argument, unknown: bool = ..., one: bool = ...) -> None: ...
def __init__(self, argument, unknown: bool = False, one: bool = False) -> None: ...
class FPDFUnicodeEncodingException(FPDFException):
def __init__(self, text_index, character, font_name) -> None: ...

View File

@@ -64,7 +64,7 @@ class SubsetMap:
def pick(self, unicode: int) -> int: ...
def dict(self) -> dict[int, int]: ...
def get_page_format(format: _Format | tuple[float, float], k: float | None = ...) -> tuple[float, float]: ...
def get_page_format(format: _Format | tuple[float, float], k: float | None = None) -> tuple[float, float]: ...
# TODO: TypedDicts
_Font: TypeAlias = dict[str, Any]
@@ -143,10 +143,10 @@ class FPDF:
def __init__(
self,
orientation: _Orientation = ...,
unit: _Unit | float = ...,
format: _Format | tuple[float, float] = ...,
font_cache_dir: Literal["DEPRECATED"] = ...,
orientation: _Orientation = "portrait",
unit: _Unit | float = "mm",
format: _Format | tuple[float, float] = "A4",
font_cache_dir: Literal["DEPRECATED"] = "DEPRECATED",
) -> None: ...
# The following definition crashes stubtest 0.991, but seems to be fixed
# in later versions.
@@ -171,7 +171,7 @@ class FPDF:
@property
def pages_count(self) -> int: ...
def set_margin(self, margin: float) -> None: ...
def set_margins(self, left: float, top: float, right: float = ...) -> None: ...
def set_margins(self, left: float, top: float, right: float = -1) -> None: ...
def set_left_margin(self, margin: float) -> None: ...
def set_top_margin(self, margin: float) -> None: ...
r_margin: float
@@ -179,7 +179,7 @@ class FPDF:
auto_page_break: bool
b_margin: float
page_break_trigger: float
def set_auto_page_break(self, auto: bool, margin: float = ...) -> None: ...
def set_auto_page_break(self, auto: bool, margin: float = 0) -> None: ...
@property
def default_page_dimensions(self) -> tuple[float, float]: ...
zoom_mode: Literal["fullpage", "fullwidth", "real", "default"] | float
@@ -187,7 +187,7 @@ class FPDF:
def set_display_mode(
self,
zoom: Literal["fullpage", "fullwidth", "real", "default"] | float,
layout: Literal["single", "continuous", "two", "default"] = ...,
layout: Literal["single", "continuous", "two", "default"] = "continuous",
) -> None: ...
def set_compression(self, compress: bool) -> None: ...
title: str
@@ -208,56 +208,62 @@ class FPDF:
def set_xmp_metadata(self, xmp_metadata: str) -> None: ...
def set_doc_option(self, opt: str, value: str) -> None: ...
def set_image_filter(self, image_filter: str) -> None: ...
def alias_nb_pages(self, alias: str = ...) -> None: ...
def alias_nb_pages(self, alias: str = "{nb}") -> None: ...
def add_page(
self,
orientation: _Orientation = ...,
format: _Format | tuple[float, float] = ...,
same: bool = ...,
duration: int = ...,
transition: Incomplete | None = ...,
orientation: _Orientation = "",
format: _Format | tuple[float, float] = "",
same: bool = False,
duration: int = 0,
transition: Incomplete | None = None,
) -> None: ...
def header(self) -> None: ...
def footer(self) -> None: ...
def page_no(self) -> int: ...
def set_draw_color(self, r: int, g: int = ..., b: int = ...) -> None: ...
def set_fill_color(self, r: int, g: int = ..., b: int = ...) -> None: ...
def set_text_color(self, r: int, g: int = ..., b: int = ...) -> None: ...
def get_string_width(self, s: str, normalized: bool = ..., markdown: bool = ...) -> float: ...
def set_draw_color(self, r: int, g: int = -1, b: int = -1) -> None: ...
def set_fill_color(self, r: int, g: int = -1, b: int = -1) -> None: ...
def set_text_color(self, r: int, g: int = -1, b: int = -1) -> None: ...
def get_string_width(self, s: str, normalized: bool = False, markdown: bool = False) -> float: ...
def set_line_width(self, width: float) -> None: ...
def set_page_background(self, background) -> None: ...
def drawing_context(self, debug_stream: Incomplete | None = ...) -> _GeneratorContextManager[DrawingContext]: ...
def drawing_context(self, debug_stream: Incomplete | None = None) -> _GeneratorContextManager[DrawingContext]: ...
def new_path(
self, x: float = ..., y: float = ..., paint_rule: PathPaintRule = ..., debug_stream: Incomplete | None = ...
self, x: float = 0, y: float = 0, paint_rule: PathPaintRule = ..., debug_stream: Incomplete | None = None
) -> _GeneratorContextManager[PaintedPath]: ...
def draw_path(self, path: PaintedPath, debug_stream: Incomplete | None = ...) -> None: ...
def set_dash_pattern(self, dash: float = ..., gap: float = ..., phase: float = ...) -> None: ...
def draw_path(self, path: PaintedPath, debug_stream: Incomplete | None = None) -> None: ...
def set_dash_pattern(self, dash: float = 0, gap: float = 0, phase: float = 0) -> None: ...
def line(self, x1: float, y1: float, x2: float, y2: float) -> None: ...
def polyline(
self, point_list: list[tuple[float, float]], fill: bool = ..., polygon: bool = ..., style: RenderStyle | str | None = ...
self,
point_list: list[tuple[float, float]],
fill: bool = False,
polygon: bool = False,
style: RenderStyle | str | None = None,
) -> None: ...
def polygon(self, point_list: list[tuple[float, float]], fill: bool = ..., style: RenderStyle | str | None = ...) -> None: ...
def dashed_line(self, x1, y1, x2, y2, dash_length: int = ..., space_length: int = ...) -> None: ...
def polygon(
self, point_list: list[tuple[float, float]], fill: bool = False, style: RenderStyle | str | None = None
) -> None: ...
def dashed_line(self, x1, y1, x2, y2, dash_length: int = 1, space_length: int = 1) -> None: ...
def rect(
self,
x: float,
y: float,
w: float,
h: float,
style: RenderStyle | str | None = ...,
round_corners: tuple[str, ...] | tuple[Corner, ...] | bool = ...,
corner_radius: float = ...,
style: RenderStyle | str | None = None,
round_corners: tuple[str, ...] | tuple[Corner, ...] | bool = False,
corner_radius: float = 0,
) -> None: ...
def ellipse(self, x: float, y: float, w: float, h: float, style: RenderStyle | str | None = ...) -> None: ...
def circle(self, x: float, y: float, r, style: RenderStyle | str | None = ...) -> None: ...
def ellipse(self, x: float, y: float, w: float, h: float, style: RenderStyle | str | None = None) -> None: ...
def circle(self, x: float, y: float, r, style: RenderStyle | str | None = None) -> None: ...
def regular_polygon(
self,
x: float,
y: float,
numSides: int,
polyWidth: float,
rotateDegrees: float = ...,
style: RenderStyle | str | None = ...,
rotateDegrees: float = 0,
style: RenderStyle | str | None = None,
): ...
def star(
self,
@@ -266,8 +272,8 @@ class FPDF:
r_in: float,
r_out: float,
corners: int,
rotate_degrees: float = ...,
style: RenderStyle | str | None = ...,
rotate_degrees: float = 0,
style: RenderStyle | str | None = None,
): ...
def arc(
self,
@@ -276,12 +282,12 @@ class FPDF:
a: float,
start_angle: float,
end_angle: float,
b: float | None = ...,
inclination: float = ...,
clockwise: bool = ...,
start_from_center: bool = ...,
end_at_center: bool = ...,
style: RenderStyle | str | None = ...,
b: float | None = None,
inclination: float = 0,
clockwise: bool = False,
start_from_center: bool = False,
end_at_center: bool = False,
style: RenderStyle | str | None = None,
) -> None: ...
def solid_arc(
self,
@@ -290,10 +296,10 @@ class FPDF:
a: float,
start_angle: float,
end_angle: float,
b: float | None = ...,
inclination: float = ...,
clockwise: bool = ...,
style: RenderStyle | str | None = ...,
b: float | None = None,
inclination: float = 0,
clockwise: bool = False,
style: RenderStyle | str | None = None,
) -> None: ...
def add_font(
self,
@@ -302,21 +308,21 @@ class FPDF:
fname: str | PurePath | None = None,
uni: bool | Literal["DEPRECATED"] = "DEPRECATED",
) -> None: ...
def set_font(self, family: str | None = ..., style: _FontStyles = ..., size: int = ...) -> None: ...
def set_font(self, family: str | None = None, style: _FontStyles = "", size: int = 0) -> None: ...
def set_font_size(self, size: float) -> None: ...
def set_char_spacing(self, spacing: float) -> None: ...
def set_stretching(self, stretching: float) -> None: ...
def add_link(self, y: float = 0, x: float = 0, page: int = -1, zoom: float | Literal["null"] = "null") -> int: ...
def set_link(self, link, y: float = 0, x: float = 0, page: int = -1, zoom: float | Literal["null"] = "null") -> None: ...
def link(
self, x: float, y: float, w: float, h: float, link: str | int, alt_text: str | None = ..., border_width: int = ...
self, x: float, y: float, w: float, h: float, link: str | int, alt_text: str | None = None, border_width: int = 0
) -> AnnotationDict: ...
def embed_file(
self,
file_path: StrPath | None = ...,
bytes: bytes | None = ...,
basename: str | None = ...,
modification_date: datetime.datetime | None = ...,
file_path: StrPath | None = None,
bytes: bytes | None = None,
basename: str | None = None,
modification_date: datetime.datetime | None = None,
*,
creation_date: datetime.datetime | None = ...,
desc: str = ...,
@@ -328,9 +334,9 @@ class FPDF:
file_path: StrPath,
x: float,
y: float,
w: float = ...,
h: float = ...,
name: FileAttachmentAnnotationName | str | None = ...,
w: float = 1,
h: float = 1,
name: FileAttachmentAnnotationName | str | None = None,
flags: Iterable[AnnotationFlag | str] = ...,
*,
bytes: bytes | None = ...,
@@ -346,19 +352,19 @@ class FPDF:
x: float,
y: float,
text: str,
w: float = ...,
h: float = ...,
name: AnnotationName | str | None = ...,
w: float = 1,
h: float = 1,
name: AnnotationName | str | None = None,
flags: tuple[AnnotationFlag, ...] | tuple[str, ...] = ...,
) -> None: ...
def add_action(self, action, x: float, y: float, w: float, h: float) -> None: ...
def highlight(
self,
text: str,
title: str = ...,
type: TextMarkupType | str = ...,
color: tuple[float, float, float] = ...,
modification_time: datetime.datetime | None = ...,
title: str = "",
type: TextMarkupType | str = "Highlight",
color: tuple[float, float, float] = (1, 1, 0),
modification_time: datetime.datetime | None = None,
) -> _GeneratorContextManager[None]: ...
add_highlight = highlight
def add_text_markup_annotation(
@@ -366,51 +372,51 @@ class FPDF:
type: str,
text: str,
quad_points: Sequence[int],
title: str = ...,
color: tuple[float, float, float] = ...,
modification_time: datetime.datetime | None = ...,
page: int | None = ...,
title: str = "",
color: tuple[float, float, float] = (1, 1, 0),
modification_time: datetime.datetime | None = None,
page: int | None = None,
) -> AnnotationDict: ...
def ink_annotation(
self,
coords: Iterable[Incomplete],
contents: str = ...,
title: str = ...,
color: Sequence[float] = ...,
border_width: int = ...,
contents: str = "",
title: str = "",
color: Sequence[float] = (1, 1, 0),
border_width: int = 1,
) -> AnnotationDict: ...
def text(self, x: float, y: float, txt: str = ...) -> None: ...
def rotate(self, angle: float, x: float | None = ..., y: float | None = ...) -> None: ...
def rotation(self, angle: float, x: float | None = ..., y: float | None = ...) -> _GeneratorContextManager[None]: ...
def text(self, x: float, y: float, txt: str = "") -> None: ...
def rotate(self, angle: float, x: float | None = None, y: float | None = None) -> None: ...
def rotation(self, angle: float, x: float | None = None, y: float | None = None) -> _GeneratorContextManager[None]: ...
def skew(
self, ax: float = 0, ay: float = 0, x: float | None = None, y: float | None = None
) -> _GeneratorContextManager[None]: ...
def local_context(
self,
font_family: Incomplete | None = ...,
font_style: Incomplete | None = ...,
font_size: Incomplete | None = ...,
line_width: Incomplete | None = ...,
draw_color: Incomplete | None = ...,
fill_color: Incomplete | None = ...,
text_color: Incomplete | None = ...,
dash_pattern: Incomplete | None = ...,
font_family: Incomplete | None = None,
font_style: Incomplete | None = None,
font_size: Incomplete | None = None,
line_width: Incomplete | None = None,
draw_color: Incomplete | None = None,
fill_color: Incomplete | None = None,
text_color: Incomplete | None = None,
dash_pattern: Incomplete | None = None,
**kwargs,
) -> _GeneratorContextManager[None]: ...
@property
def accept_page_break(self) -> bool: ...
def cell(
self,
w: float | None = ...,
h: float | None = ...,
txt: str = ...,
border: bool | Literal[0, 1] | str = ...,
ln: int | Literal["DEPRECATED"] = ...,
w: float | None = None,
h: float | None = None,
txt: str = "",
border: bool | Literal[0, 1] | str = 0,
ln: int | Literal["DEPRECATED"] = "DEPRECATED",
align: str | Align = ...,
fill: bool = ...,
link: str = ...,
center: bool | Literal["DEPRECATED"] = ...,
markdown: bool = ...,
fill: bool = False,
link: str = "",
center: bool | Literal["DEPRECATED"] = "DEPRECATED",
markdown: bool = False,
new_x: XPos | str = ...,
new_y: YPos | str = ...,
) -> bool: ...
@@ -418,21 +424,21 @@ class FPDF:
def multi_cell(
self,
w: float,
h: float | None = ...,
txt: str = ...,
border: bool | Literal[0, 1] | str = ...,
h: float | None = None,
txt: str = "",
border: bool | Literal[0, 1] | str = 0,
align: str | Align = ...,
fill: bool = ...,
split_only: bool = ...,
link: str | int = ...,
ln: int | Literal["DEPRECATED"] = ...,
max_line_height: float | None = ...,
markdown: bool = ...,
print_sh: bool = ...,
fill: bool = False,
split_only: bool = False,
link: str | int = "",
ln: int | Literal["DEPRECATED"] = "DEPRECATED",
max_line_height: float | None = None,
markdown: bool = False,
print_sh: bool = False,
new_x: XPos | str = ...,
new_y: YPos | str = ...,
): ...
def write(self, h: float | None = ..., txt: str = ..., link: str = ..., print_sh: bool = ...) -> None: ...
def write(self, h: float | None = None, txt: str = "", link: str = "", print_sh: bool = False) -> None: ...
def image(
self,
name: str | Image.Image | BytesIO | StrPath,
@@ -446,57 +452,57 @@ class FPDF:
alt_text: str | None = None,
dims: tuple[float, float] | None = None,
) -> _Image: ...
def ln(self, h: float | None = ...) -> None: ...
def ln(self, h: float | None = None) -> None: ...
def get_x(self) -> float: ...
def set_x(self, x: float) -> None: ...
def get_y(self) -> float: ...
def set_y(self, y: float) -> None: ...
def set_xy(self, x: float, y: float) -> None: ...
@overload
def output(self, name: Literal[""] = ...) -> bytearray: ... # type: ignore[misc]
def output(self, name: Literal[""] = "") -> bytearray: ... # type: ignore[misc]
@overload
def output(self, name: str) -> None: ...
def normalize_text(self, txt: str) -> str: ...
def sign_pkcs12(
self,
pkcs_filepath: str,
password: bytes | None = ...,
hashalgo: str = ...,
contact_info: str | None = ...,
location: str | None = ...,
signing_time: datetime.datetime | None = ...,
reason: str | None = ...,
password: bytes | None = None,
hashalgo: str = "sha256",
contact_info: str | None = None,
location: str | None = None,
signing_time: datetime.datetime | None = None,
reason: str | None = None,
flags: tuple[AnnotationFlag, ...] = ...,
) -> None: ...
def sign(
self,
key,
cert,
extra_certs: Sequence[Incomplete] = ...,
hashalgo: str = ...,
contact_info: str | None = ...,
location: str | None = ...,
signing_time: datetime.datetime | None = ...,
reason: str | None = ...,
extra_certs: Sequence[Incomplete] = (),
hashalgo: str = "sha256",
contact_info: str | None = None,
location: str | None = None,
signing_time: datetime.datetime | None = None,
reason: str | None = None,
flags: tuple[AnnotationFlag, ...] = ...,
) -> None: ...
def file_id(self) -> str: ...
def interleaved2of5(self, txt, x: float, y: float, w: float = ..., h: float = ...) -> None: ...
def code39(self, txt, x: float, y: float, w: float = ..., h: float = ...) -> None: ...
def interleaved2of5(self, txt, x: float, y: float, w: float = 1, h: float = 10) -> None: ...
def code39(self, txt, x: float, y: float, w: float = 1.5, h: float = 5) -> None: ...
def rect_clip(self, x: float, y: float, w: float, h: float) -> _GeneratorContextManager[None]: ...
def elliptic_clip(self, x: float, y: float, w: float, h: float) -> _GeneratorContextManager[None]: ...
def round_clip(self, x: float, y: float, r: float) -> _GeneratorContextManager[None]: ...
def unbreakable(self) -> _GeneratorContextManager[FPDFRecorder]: ...
def offset_rendering(self) -> _GeneratorContextManager[FPDFRecorder]: ...
def insert_toc_placeholder(self, render_toc_function, pages: int = ...) -> None: ...
def insert_toc_placeholder(self, render_toc_function, pages: int = 1) -> None: ...
def set_section_title_styles(
self,
level0: TitleStyle,
level1: TitleStyle | None = ...,
level2: TitleStyle | None = ...,
level3: TitleStyle | None = ...,
level4: TitleStyle | None = ...,
level5: TitleStyle | None = ...,
level6: TitleStyle | None = ...,
level1: TitleStyle | None = None,
level2: TitleStyle | None = None,
level3: TitleStyle | None = None,
level4: TitleStyle | None = None,
level5: TitleStyle | None = None,
level6: TitleStyle | None = None,
) -> None: ...
def start_section(self, name: str, level: int = 0, strict: bool = True) -> None: ...

View File

@@ -22,7 +22,7 @@ TRAILING_SPACE: Pattern[str]
COLOR_DICT: Final[dict[str, str]]
def px2mm(px: float) -> float: ...
def color_as_decimal(color: str | None = ...) -> tuple[int, int, int] | None: ...
def color_as_decimal(color: str | None = "#000000") -> tuple[int, int, int] | None: ...
class HTML2FPDF(HTMLParser):
HTML_UNCLOSED_TAGS: ClassVar[tuple[str, ...]]
@@ -65,7 +65,7 @@ class HTML2FPDF(HTMLParser):
li_tag_indent: int = 5,
dd_tag_indent: int = 10,
table_line_separators: bool = False,
ul_bullet_char: str = ...,
ul_bullet_char: str = "\x95",
heading_sizes: Incomplete | None = None,
warn_on_tags_not_matching: bool = True,
**_: Unused,
@@ -83,9 +83,9 @@ class HTML2FPDF(HTMLParser):
tbody: Incomplete
def handle_endtag(self, tag) -> None: ...
h: Incomplete
def set_font(self, face: Incomplete | None = ..., size: Incomplete | None = ...) -> None: ...
def set_style(self, tag: Incomplete | None = ..., enable: bool = ...) -> None: ...
def set_text_color(self, r: Incomplete | None = ..., g: int = ..., b: int = ...) -> None: ...
def set_font(self, face: Incomplete | None = None, size: Incomplete | None = None) -> None: ...
def set_style(self, tag: Incomplete | None = None, enable: bool = False) -> None: ...
def set_text_color(self, r: Incomplete | None = None, g: int = 0, b: int = 0) -> None: ...
def put_link(self, txt) -> None: ...
def render_toc(self, pdf, outline) -> None: ...
def error(self, message: str) -> None: ...

View File

@@ -12,4 +12,4 @@ SUPPORTED_IMAGE_FILTERS: tuple[_ImageFilter, ...]
def load_image(filename): ...
# Returned dict could be typed as a TypedDict.
def get_img_info(img, image_filter: _ImageFilter = ..., dims: Incomplete | None = ...) -> dict[str, Any]: ...
def get_img_info(img, image_filter: _ImageFilter = "AUTO", dims: Incomplete | None = None) -> dict[str, Any]: ...

View File

@@ -53,8 +53,8 @@ class Fragment:
def string(self): ...
def trim(self, index: int): ...
def __eq__(self, other: Fragment) -> bool: ... # type: ignore[override]
def get_width(self, start: int = ..., end: int | None = ..., chars: str | None = ..., initial_cs: bool = ...): ...
def get_character_width(self, character: str, print_sh: bool = ..., initial_cs: bool = ...): ...
def get_width(self, start: int = 0, end: int | None = None, chars: str | None = None, initial_cs: bool = True): ...
def get_character_width(self, character: str, print_sh: bool = False, initial_cs: bool = True): ...
class TextLine(NamedTuple):
fragments: tuple[Incomplete, ...]
@@ -90,7 +90,7 @@ class CurrentLine:
number_of_spaces: int
space_break_hint: Incomplete
hyphen_break_hint: Incomplete
def __init__(self, print_sh: bool = ...) -> None: ...
def __init__(self, print_sh: bool = False) -> None: ...
def add_character(
self,
character: str,
@@ -101,7 +101,7 @@ class CurrentLine:
original_character_index: int,
url: str | None = None,
): ...
def manual_break(self, justify: bool = ..., trailing_nl: bool = ...): ...
def manual_break(self, justify: bool = False, trailing_nl: bool = False): ...
def automatic_break_possible(self): ...
def automatic_break(self, justify: bool): ...
@@ -112,5 +112,5 @@ class MultiLineBreak:
fragment_index: int
character_index: int
idx_last_forced_break: Incomplete
def __init__(self, styled_text_fragments: Sequence[Fragment], justify: bool = ..., print_sh: bool = ...) -> None: ...
def get_line_of_given_width(self, maximum_width: float, wordsplit: bool = ...): ...
def __init__(self, styled_text_fragments: Sequence[Fragment], justify: bool = False, print_sh: bool = False) -> None: ...
def get_line_of_given_width(self, maximum_width: float, wordsplit: bool = True): ...

View File

@@ -22,7 +22,7 @@ class OutlineItemDictionary(PDFObject):
count: int
dest: Destination | None
struct_elem: StructElem | None
def __init__(self, title: str, dest: Destination | None = ..., struct_elem: StructElem | None = ...) -> None: ...
def __init__(self, title: str, dest: Destination | None = None, struct_elem: StructElem | None = None) -> None: ...
class OutlineDictionary(PDFObject):
type: str

View File

@@ -31,7 +31,12 @@ class PDFFont(PDFObject):
font_descriptor: Incomplete | None
c_i_d_to_g_i_d_map: Incomplete | None
def __init__(
self, subtype: str, base_font: str, encoding: str | None = ..., d_w: Incomplete | None = ..., w: Incomplete | None = ...
self,
subtype: str,
base_font: str,
encoding: str | None = None,
d_w: Incomplete | None = None,
w: Incomplete | None = None,
) -> None: ...
class PDFFontDescriptor(PDFObject):
@@ -94,10 +99,10 @@ class PDFCatalog(PDFObject):
struct_tree_root: Incomplete | None
def __init__(
self,
lang: str | None = ...,
page_layout: Incomplete | None = ...,
page_mode: Incomplete | None = ...,
viewer_preferences: Incomplete | None = ...,
lang: str | None = None,
page_layout: Incomplete | None = None,
page_mode: Incomplete | None = None,
viewer_preferences: Incomplete | None = None,
) -> None: ...
class PDFResources(PDFObject):
@@ -135,9 +140,9 @@ class PDFXObject(PDFContentStream):
height,
color_space,
bits_per_component,
img_filter: str | None = ...,
decode: Incomplete | None = ...,
decode_parms: Incomplete | None = ...,
img_filter: str | None = None,
decode: Incomplete | None = None,
decode_parms: Incomplete | None = None,
) -> None: ...
class PDFPage(PDFObject):

View File

@@ -9,12 +9,12 @@ class ViewerPreferences:
display_doc_title: bool
def __init__(
self,
hide_toolbar: bool = ...,
hide_menubar: bool = ...,
hide_window_u_i: bool = ...,
fit_window: bool = ...,
center_window: bool = ...,
display_doc_title: bool = ...,
hide_toolbar: bool = False,
hide_menubar: bool = False,
hide_window_u_i: bool = False,
fit_window: bool = False,
center_window: bool = False,
display_doc_title: bool = False,
non_full_screen_page_mode: PageMode | str = ...,
) -> None: ...
@property

View File

@@ -3,7 +3,7 @@ from typing import Any
class FPDFRecorder:
pdf: Any
accept_page_break: bool
def __init__(self, pdf, accept_page_break: bool = ...) -> None: ...
def __init__(self, pdf, accept_page_break: bool = True) -> None: ...
def __getattr__(self, name: str): ...
def rewind(self) -> None: ...
def replay(self) -> None: ...

View File

@@ -12,10 +12,10 @@ class Signature:
contents: str
def __init__(
self,
contact_info: Incomplete | None = ...,
location: Incomplete | None = ...,
m: Incomplete | None = ...,
reason: Incomplete | None = ...,
contact_info: Incomplete | None = None,
location: Incomplete | None = None,
m: Incomplete | None = None,
reason: Incomplete | None = None,
) -> None: ...
def serialize(self): ...

View File

@@ -29,9 +29,9 @@ class StructElem(PDFObject):
struct_type: str,
parent: PDFObject,
kids: Iterable[int] | Iterable[StructElem],
page_number: int | None = ...,
title: str | None = ...,
alt: str | None = ...,
page_number: int | None = None,
title: str | None = None,
alt: str | None = None,
) -> None: ...
def page_number(self) -> int | None: ...
@@ -41,7 +41,7 @@ class StructureTreeBuilder:
struct_elem_per_mc: Incomplete
def __init__(self) -> None: ...
def add_marked_content(
self, page_number: int, struct_type: str, mcid: int | None = ..., title: str | None = ..., alt_text: str | None = ...
self, page_number: int, struct_type: str, mcid: int | None = None, title: str | None = None, alt_text: str | None = None
) -> tuple[Incomplete, Incomplete]: ...
def next_mcid_for_page(self, page_number: int) -> int: ...
def empty(self) -> bool: ...

View File

@@ -20,8 +20,8 @@ relative_length_units: set[str]
absolute_length_units: dict[str, int]
angle_units: dict[str, float]
def resolve_length(length_str, default_unit: str = ...): ...
def resolve_angle(angle_str, default_unit: str = ...): ...
def resolve_length(length_str, default_unit: str = "pt"): ...
def resolve_angle(angle_str, default_unit: str = "deg"): ...
def xmlns(space, name): ...
def xmlns_lookup(space, *names): ...
@@ -68,7 +68,7 @@ def svg_path_converter(pdf_path: PaintedPath, svg_path: str) -> None: ...
class SVGObject:
@classmethod
def from_file(cls, filename, *args, encoding: str = ..., **kwargs): ...
def from_file(cls, filename, *args, encoding: str = "utf-8", **kwargs): ...
cross_references: Incomplete
def __init__(self, svg_text) -> None: ...
preserve_ar: Incomplete
@@ -78,12 +78,14 @@ class SVGObject:
def extract_shape_info(self, root_tag) -> None: ...
base_group: Incomplete
def convert_graphics(self, root_tag) -> None: ...
def transform_to_page_viewport(self, pdf, align_viewbox: bool = ...): ...
def transform_to_rect_viewport(self, scale, width, height, align_viewbox: bool = ..., ignore_svg_top_attrs: bool = ...): ...
def transform_to_page_viewport(self, pdf, align_viewbox: bool = True): ...
def transform_to_rect_viewport(
self, scale, width, height, align_viewbox: bool = True, ignore_svg_top_attrs: bool = False
): ...
def draw_to_page(
self, pdf, x: Incomplete | None = ..., y: Incomplete | None = ..., debug_stream: Incomplete | None = ...
self, pdf, x: Incomplete | None = None, y: Incomplete | None = None, debug_stream: Incomplete | None = None
) -> None: ...
def handle_defs(self, defs) -> None: ...
def build_xref(self, xref): ...
def build_group(self, group, pdf_group: Incomplete | None = ...): ...
def build_group(self, group, pdf_group: Incomplete | None = None): ...
def build_path(self, path): ...

View File

@@ -11,11 +11,11 @@ _T = TypeVar("_T")
def clear_empty_fields(d): ...
def create_dictionary_string(
dict_,
open_dict: str = ...,
close_dict: str = ...,
field_join: str = ...,
key_value_join: str = ...,
has_empty_fields: bool = ...,
open_dict: str = "<<",
close_dict: str = ">>",
field_join: str = "\n",
key_value_join: str = " ",
has_empty_fields: bool = False,
): ...
def create_list_string(list_): ...
def iobj_ref(n): ...
@@ -37,13 +37,13 @@ class PDFObject:
def id(self, n: int) -> None: ...
@property
def ref(self) -> str: ...
def serialize(self, obj_dict: Incomplete | None = ..., _security_handler: StandardSecurityHandler | None = None) -> str: ...
def serialize(self, obj_dict: Incomplete | None = None, _security_handler: StandardSecurityHandler | None = None) -> str: ...
def content_stream(self) -> bytes: ...
class PDFContentStream(PDFObject):
filter: Name | None
length: int
def __init__(self, contents: bytes, compress: bool = ...) -> None: ...
def __init__(self, contents: bytes, compress: bool = False) -> None: ...
def encrypt(self, security_handler: StandardSecurityHandler) -> None: ...
def build_obj_dict(key_values: SupportsItems[str, Incomplete]) -> dict[str, str]: ...
@@ -66,5 +66,5 @@ class DestinationXYZ(Destination):
left: float
zoom: float | Literal["null"]
page_ref: Incomplete | None
def __init__(self, page: int, top: float, left: float = ..., zoom: float | Literal["null"] = ...) -> None: ...
def __init__(self, page: int, top: float, left: float = 0, zoom: float | Literal["null"] = "null") -> None: ...
def serialize(self) -> str: ...

View File

@@ -10,31 +10,31 @@ class FlexTemplate:
splitting_pdf: Any
handlers: Any
texts: Any
def __init__(self, pdf, elements: Incomplete | None = ...) -> None: ...
def __init__(self, pdf, elements: Incomplete | None = None) -> None: ...
elements: Any
keys: Any
def load_elements(self, elements) -> None: ...
def parse_csv(self, infile, delimiter: str = ..., decimal_sep: str = ..., encoding: Incomplete | None = ...): ...
def parse_csv(self, infile, delimiter: str = ",", decimal_sep: str = ".", encoding: Incomplete | None = None): ...
def __setitem__(self, name, value) -> None: ...
set: Any
def __contains__(self, name): ...
def __getitem__(self, name): ...
def split_multicell(self, text, element_name): ...
def render(self, offsetx: float = ..., offsety: float = ..., rotate: float = ..., scale: float = ...): ...
def render(self, offsetx: float = 0.0, offsety: float = 0.0, rotate: float = 0.0, scale: float = 1.0): ...
class Template(FlexTemplate):
def __init__(
self,
infile: Incomplete | None = ...,
elements: Incomplete | None = ...,
format: str = ...,
orientation: str = ...,
unit: str = ...,
title: str = ...,
author: str = ...,
subject: str = ...,
creator: str = ...,
keywords: str = ...,
infile: Incomplete | None = None,
elements: Incomplete | None = None,
format: str = "A4",
orientation: str = "portrait",
unit: str = "mm",
title: str = "",
author: str = "",
subject: str = "",
creator: str = "",
keywords: str = "",
) -> None: ...
def add_page(self) -> None: ...
def render(self, outfile: Incomplete | None = ..., dest: Incomplete | None = ...) -> None: ... # type: ignore[override]
def render(self, outfile: Incomplete | None = None, dest: Incomplete | None = None) -> None: ... # type: ignore[override]

View File

@@ -37,7 +37,7 @@ class GlitterTransition(Transition):
class FlyTransition(Transition):
dimension: Literal["H", "V"]
direction: Literal[0, 270] | None
def __init__(self, dimension: Literal["H", "V"], direction: Literal[0, 270] | None = ...) -> None: ...
def __init__(self, dimension: Literal["H", "V"], direction: Literal[0, 270] | None = None) -> None: ...
def serialize(self) -> str: ...
class PushTransition(Transition):

View File

@@ -6,7 +6,7 @@ from typing_extensions import Literal, TypeAlias
_Unit: TypeAlias = Literal["pt", "mm", "cm", "in"]
def buffer_subst(buffer: bytearray, placeholder: str, value: str) -> bytearray: ...
def format_date(date: datetime.datetime, with_tz: bool = ...) -> str: ...
def format_date(date: datetime.datetime, with_tz: bool = False) -> str: ...
def enclose_in_parens(s: str) -> str: ...
def escape_parens(s): ...
def b(s): ...

View File

@@ -37,14 +37,14 @@ class InfosetFilter:
replaceCache: Any
def __init__(
self,
dropXmlnsLocalName: bool = ...,
dropXmlnsAttrNs: bool = ...,
preventDoubleDashComments: bool = ...,
preventDashAtCommentEnd: bool = ...,
replaceFormFeedCharacters: bool = ...,
preventSingleQuotePubid: bool = ...,
dropXmlnsLocalName: bool = False,
dropXmlnsAttrNs: bool = False,
preventDoubleDashComments: bool = False,
preventDashAtCommentEnd: bool = False,
replaceFormFeedCharacters: bool = True,
preventSingleQuotePubid: bool = False,
) -> None: ...
def coerceAttribute(self, name, namespace: Incomplete | None = ...): ...
def coerceAttribute(self, name, namespace: Incomplete | None = None): ...
def coerceElement(self, name): ...
def coerceComment(self, data): ...
def coerceCharacters(self, data): ...

View File

@@ -38,10 +38,10 @@ class HTMLUnicodeInputStream:
def openStream(self, source): ...
def position(self): ...
def char(self): ...
def readChunk(self, chunkSize: Incomplete | None = ...): ...
def readChunk(self, chunkSize: Incomplete | None = None): ...
def characterErrorsUCS4(self, data) -> None: ...
def characterErrorsUCS2(self, data) -> None: ...
def charsUntil(self, characters, opposite: bool = ...): ...
def charsUntil(self, characters, opposite: bool = False): ...
def unget(self, char) -> None: ...
class HTMLBinaryInputStream(HTMLUnicodeInputStream):
@@ -57,17 +57,17 @@ class HTMLBinaryInputStream(HTMLUnicodeInputStream):
def __init__(
self,
source,
override_encoding: Incomplete | None = ...,
transport_encoding: Incomplete | None = ...,
same_origin_parent_encoding: Incomplete | None = ...,
likely_encoding: Incomplete | None = ...,
default_encoding: str = ...,
useChardet: bool = ...,
override_encoding: Incomplete | None = None,
transport_encoding: Incomplete | None = None,
same_origin_parent_encoding: Incomplete | None = None,
likely_encoding: Incomplete | None = None,
default_encoding: str = "windows-1252",
useChardet: bool = True,
) -> None: ...
dataStream: Any
def reset(self) -> None: ...
def openStream(self, source): ...
def determineEncoding(self, chardet: bool = ...): ...
def determineEncoding(self, chardet: bool = True): ...
def changeEncoding(self, newEncoding) -> None: ...
def detectBOM(self): ...
def detectEncodingMeta(self): ...

View File

@@ -12,11 +12,11 @@ class HTMLTokenizer:
state: Any
escape: bool
currentToken: Any
def __init__(self, stream, parser: Incomplete | None = ..., **kwargs) -> None: ...
def __init__(self, stream, parser: Incomplete | None = None, **kwargs) -> None: ...
tokenQueue: Any
def __iter__(self): ...
def consumeNumberEntity(self, isHex): ...
def consumeEntity(self, allowedChar: Incomplete | None = ..., fromAttribute: bool = ...) -> None: ...
def consumeEntity(self, allowedChar: Incomplete | None = None, fromAttribute: bool = False) -> None: ...
def processEntityInAttribute(self, allowedChar) -> None: ...
def emitCurrentToken(self) -> None: ...
def dataState(self): ...

View File

@@ -4,7 +4,7 @@ from collections.abc import Mapping
from typing import Any
class Trie(Mapping[Any, Any], metaclass=ABCMeta):
def keys(self, prefix: Incomplete | None = ...): ...
def keys(self, prefix: Incomplete | None = None): ...
def has_keys_with_prefix(self, prefix): ...
def longest_prefix(self, prefix): ...
def longest_prefix_item(self, prefix): ...

View File

@@ -8,5 +8,5 @@ class Trie(ABCTrie):
def __len__(self) -> int: ...
def __iter__(self): ...
def __getitem__(self, key): ...
def keys(self, prefix: Incomplete | None = ...): ...
def keys(self, prefix: Incomplete | None = None): ...
def has_keys_with_prefix(self, prefix): ...

View File

@@ -6,9 +6,9 @@ supports_lone_surrogates: bool
class MethodDispatcher(dict[Any, Any]):
default: Any
def __init__(self, items=...) -> None: ...
def __init__(self, items=()) -> None: ...
def __getitem__(self, key): ...
def __get__(self, instance, owner: Incomplete | None = ...): ...
def __get__(self, instance, owner: Incomplete | None = None): ...
class BoundMethodDispatcher(Mapping[Any, Any]):
instance: Any

View File

@@ -4,5 +4,5 @@ from . import base
class Filter(base.Filter):
require_matching_tags: Any
def __init__(self, source, require_matching_tags: bool = ...) -> None: ...
def __init__(self, source, require_matching_tags: bool = True) -> None: ...
def __iter__(self): ...

View File

@@ -6,15 +6,15 @@ from xml.etree.ElementTree import Element
@overload
def parse(
doc: str | bytes | SupportsRead[str] | SupportsRead[bytes],
treebuilder: Literal["etree"] = ...,
namespaceHTMLElements: bool = ...,
treebuilder: Literal["etree"] = "etree",
namespaceHTMLElements: bool = True,
**kwargs,
) -> Element: ...
@overload
def parse(
doc: str | bytes | SupportsRead[str] | SupportsRead[bytes], treebuilder: str, namespaceHTMLElements: bool = ..., **kwargs
doc: str | bytes | SupportsRead[str] | SupportsRead[bytes], treebuilder: str, namespaceHTMLElements: bool = True, **kwargs
): ...
def parseFragment(doc, container: str = ..., treebuilder: str = ..., namespaceHTMLElements: bool = ..., **kwargs): ...
def parseFragment(doc, container: str = "div", treebuilder: str = "etree", namespaceHTMLElements: bool = True, **kwargs): ...
def method_decorator_metaclass(function): ...
class HTMLParser:
@@ -23,7 +23,7 @@ class HTMLParser:
errors: Any
phases: Any
def __init__(
self, tree: Incomplete | None = ..., strict: bool = ..., namespaceHTMLElements: bool = ..., debug: bool = ...
self, tree: Incomplete | None = None, strict: bool = False, namespaceHTMLElements: bool = True, debug: bool = False
) -> None: ...
firstStartTag: bool
log: Any
@@ -41,7 +41,7 @@ class HTMLParser:
def mainLoop(self) -> None: ...
def parse(self, stream, scripting: bool = ..., **kwargs): ...
def parseFragment(self, stream, *args, **kwargs): ...
def parseError(self, errorcode: str = ..., datavars: Incomplete | None = ...) -> None: ...
def parseError(self, errorcode: str = "XXX-undefined-error", datavars: Incomplete | None = None) -> None: ...
def adjustMathMLAttributes(self, token) -> None: ...
def adjustSVGAttributes(self, token) -> None: ...
def adjustForeignAttributes(self, token) -> None: ...
@@ -52,6 +52,6 @@ class HTMLParser:
def getPhases(debug): ...
def adjust_attributes(token, replacements) -> None: ...
def impliedTagToken(name, type: str = ..., attributes: Incomplete | None = ..., selfClosing: bool = ...): ...
def impliedTagToken(name, type: str = "EndTag", attributes: Incomplete | None = None, selfClosing: bool = False): ...
class ParseError(Exception): ...

View File

@@ -3,7 +3,7 @@ from typing import Any, overload
def htmlentityreplace_errors(exc: Exception) -> tuple[str | bytes, int]: ...
@overload
def serialize(input, tree: str = ..., encoding: None = ..., **serializer_opts) -> str: ...
def serialize(input, tree: str = "etree", encoding: None = None, **serializer_opts) -> str: ...
@overload
def serialize(input, tree: str, encoding: str, **serializer_opts) -> bytes: ...
@overload
@@ -31,8 +31,8 @@ class HTMLSerializer:
def encode(self, string): ...
def encodeStrict(self, string): ...
encoding: Any
def serialize(self, treewalker, encoding: Incomplete | None = ...) -> None: ...
def render(self, treewalker, encoding: Incomplete | None = ...): ...
def serializeError(self, data: str = ...) -> None: ...
def serialize(self, treewalker, encoding: Incomplete | None = None) -> None: ...
def render(self, treewalker, encoding: Incomplete | None = None): ...
def serializeError(self, data: str = "XXX ERROR MESSAGE NEEDED") -> None: ...
class SerializeError(Exception): ...

View File

@@ -3,4 +3,4 @@ from typing import Any
treeBuilderCache: Any
def getTreeBuilder(treeType, implementation: Incomplete | None = ..., **kwargs): ...
def getTreeBuilder(treeType, implementation: Incomplete | None = None, **kwargs): ...

View File

@@ -12,7 +12,7 @@ class Node:
childNodes: Any
def __init__(self, name) -> None: ...
def appendChild(self, node) -> None: ...
def insertText(self, data, insertBefore: Incomplete | None = ...) -> None: ...
def insertText(self, data, insertBefore: Incomplete | None = None) -> None: ...
def insertBefore(self, node, refNode) -> None: ...
def removeChild(self, node) -> None: ...
def reparentChildren(self, newParent) -> None: ...
@@ -38,19 +38,19 @@ class TreeBuilder:
insertFromTable: bool
document: Any
def reset(self) -> None: ...
def elementInScope(self, target, variant: Incomplete | None = ...): ...
def elementInScope(self, target, variant: Incomplete | None = None): ...
def reconstructActiveFormattingElements(self) -> None: ...
def clearActiveFormattingElements(self) -> None: ...
def elementInActiveFormattingElements(self, name): ...
def insertRoot(self, token) -> None: ...
def insertDoctype(self, token) -> None: ...
def insertComment(self, token, parent: Incomplete | None = ...) -> None: ...
def insertComment(self, token, parent: Incomplete | None = None) -> None: ...
def createElement(self, token): ...
def insertElementNormal(self, token): ...
def insertElementTable(self, token): ...
def insertText(self, data, parent: Incomplete | None = ...) -> None: ...
def insertText(self, data, parent: Incomplete | None = None) -> None: ...
def getTableMisnestedNodePosition(self): ...
def generateImpliedEndTags(self, exclude: Incomplete | None = ...) -> None: ...
def generateImpliedEndTags(self, exclude: Incomplete | None = None) -> None: ...
def getDocument(self): ...
def getFragment(self): ...
def testSerializer(self, node) -> None: ...

View File

@@ -2,6 +2,6 @@ from typing import Any
tag_regexp: Any
def getETreeBuilder(ElementTreeImplementation, fullTree: bool = ...): ...
def getETreeBuilder(ElementTreeImplementation, fullTree: bool = False): ...
getETreeModule: Any

View File

@@ -30,7 +30,7 @@ class TreeBuilder(base.TreeBuilder):
fragmentClass: Any
implementation: Any
namespaceHTMLElements: Any
def __init__(self, namespaceHTMLElements, fullTree: bool = ...): ...
def __init__(self, namespaceHTMLElements, fullTree: bool = False): ...
insertComment: Any
initial_comments: Any
doctype: Any
@@ -39,7 +39,7 @@ class TreeBuilder(base.TreeBuilder):
def getDocument(self): ...
def getFragment(self): ...
def insertDoctype(self, token) -> None: ...
def insertCommentInitial(self, data, parent: Incomplete | None = ...) -> None: ...
def insertCommentMain(self, data, parent: Incomplete | None = ...) -> None: ...
def insertCommentInitial(self, data, parent: Incomplete | None = None) -> None: ...
def insertCommentMain(self, data, parent: Incomplete | None = None) -> None: ...
document: Any
def insertRoot(self, token) -> None: ...

View File

@@ -1,4 +1,4 @@
from _typeshed import Incomplete
def getTreeWalker(treeType, implementation: Incomplete | None = ..., **kwargs): ...
def getTreeWalker(treeType, implementation: Incomplete | None = None, **kwargs): ...
def pprint(walker): ...

View File

@@ -14,12 +14,12 @@ class TreeWalker:
def __init__(self, tree) -> None: ...
def __iter__(self): ...
def error(self, msg): ...
def emptyTag(self, namespace, name, attrs, hasChildren: bool = ...) -> None: ...
def emptyTag(self, namespace, name, attrs, hasChildren: bool = False) -> None: ...
def startTag(self, namespace, name, attrs): ...
def endTag(self, namespace, name): ...
def text(self, data) -> None: ...
def comment(self, data): ...
def doctype(self, name, publicId: Incomplete | None = ..., systemId: Incomplete | None = ...): ...
def doctype(self, name, publicId: Incomplete | None = None, systemId: Incomplete | None = None): ...
def entity(self, name): ...
def unknown(self, nodeType): ...

View File

@@ -41,7 +41,7 @@ class DigestAuthentication(Authentication):
challenge: Any
A1: Any
def __init__(self, credentials, host, request_uri, headers, response, content, http) -> None: ...
def request(self, method, request_uri, headers, content, cnonce: Incomplete | None = ...): ...
def request(self, method, request_uri, headers, content, cnonce: Incomplete | None = None): ...
def response(self, response, content): ...
class HmacDigestAuthentication(Authentication):
@@ -74,7 +74,7 @@ class FileCache:
class Credentials:
credentials: Any
def __init__(self) -> None: ...
def add(self, name, password, domain: str = ...) -> None: ...
def add(self, name, password, domain: str = "") -> None: ...
def clear(self) -> None: ...
def iter(self, domain) -> Generator[tuple[str, str], None, None]: ...
@@ -91,10 +91,10 @@ class ProxyInfo:
proxy_type,
proxy_host,
proxy_port,
proxy_rdns: bool = ...,
proxy_user: Incomplete | None = ...,
proxy_pass: Incomplete | None = ...,
proxy_headers: Incomplete | None = ...,
proxy_rdns: bool = True,
proxy_user: Incomplete | None = None,
proxy_pass: Incomplete | None = None,
proxy_headers: Incomplete | None = None,
) -> None: ...
def astuple(self): ...
def isgood(self): ...
@@ -104,7 +104,7 @@ class ProxyInfo:
class HTTPConnectionWithTimeout(http.client.HTTPConnection):
proxy_info: Any
def __init__(
self, host, port: Incomplete | None = ..., timeout: Incomplete | None = ..., proxy_info: Incomplete | None = ...
self, host, port: Incomplete | None = None, timeout: Incomplete | None = None, proxy_info: Incomplete | None = None
) -> None: ...
sock: Any
def connect(self) -> None: ...
@@ -119,16 +119,16 @@ class HTTPSConnectionWithTimeout(http.client.HTTPSConnection):
def __init__(
self,
host,
port: Incomplete | None = ...,
key_file: Incomplete | None = ...,
cert_file: Incomplete | None = ...,
timeout: Incomplete | None = ...,
proxy_info: Incomplete | None = ...,
ca_certs: Incomplete | None = ...,
disable_ssl_certificate_validation: bool = ...,
tls_maximum_version: Incomplete | None = ...,
tls_minimum_version: Incomplete | None = ...,
key_password: Incomplete | None = ...,
port: Incomplete | None = None,
key_file: Incomplete | None = None,
cert_file: Incomplete | None = None,
timeout: Incomplete | None = None,
proxy_info: Incomplete | None = None,
ca_certs: Incomplete | None = None,
disable_ssl_certificate_validation: bool = False,
tls_maximum_version: Incomplete | None = None,
tls_minimum_version: Incomplete | None = None,
key_password: Incomplete | None = None,
) -> None: ...
sock: Any
def connect(self) -> None: ...
@@ -155,26 +155,26 @@ class Http:
forward_authorization_headers: bool
def __init__(
self,
cache: Incomplete | None = ...,
timeout: Incomplete | None = ...,
cache: Incomplete | None = None,
timeout: Incomplete | None = None,
proxy_info=...,
ca_certs: Incomplete | None = ...,
disable_ssl_certificate_validation: bool = ...,
tls_maximum_version: Incomplete | None = ...,
tls_minimum_version: Incomplete | None = ...,
ca_certs: Incomplete | None = None,
disable_ssl_certificate_validation: bool = False,
tls_maximum_version: Incomplete | None = None,
tls_minimum_version: Incomplete | None = None,
) -> None: ...
def close(self) -> None: ...
def add_credentials(self, name, password, domain: str = ...) -> None: ...
def add_certificate(self, key, cert, domain, password: Incomplete | None = ...) -> None: ...
def add_credentials(self, name, password, domain: str = "") -> None: ...
def add_certificate(self, key, cert, domain, password: Incomplete | None = None) -> None: ...
def clear_credentials(self) -> None: ...
def request(
self,
uri,
method: str = ...,
body: Incomplete | None = ...,
headers: Incomplete | None = ...,
redirections=...,
connection_type: Incomplete | None = ...,
method: str = "GET",
body: Incomplete | None = None,
headers: Incomplete | None = None,
redirections=5,
connection_type: Incomplete | None = None,
): ...
class Response(dict[str, Any]):

View File

@@ -14,27 +14,27 @@ class Socks4Error(ProxyError): ...
class HTTPError(ProxyError): ...
def setdefaultproxy(
proxytype: Incomplete | None = ...,
addr: Incomplete | None = ...,
port: Incomplete | None = ...,
rdns: bool = ...,
username: Incomplete | None = ...,
password: Incomplete | None = ...,
proxytype: Incomplete | None = None,
addr: Incomplete | None = None,
port: Incomplete | None = None,
rdns: bool = True,
username: Incomplete | None = None,
password: Incomplete | None = None,
) -> None: ...
def wrapmodule(module) -> None: ...
class socksocket(socket.socket):
def __init__(self, family=..., type=..., proto: int = ..., _sock: Incomplete | None = ...) -> None: ...
def __init__(self, family=..., type=..., proto: int = 0, _sock: Incomplete | None = None) -> None: ...
def sendall(self, content, *args): ...
def setproxy(
self,
proxytype: Incomplete | None = ...,
addr: Incomplete | None = ...,
port: Incomplete | None = ...,
rdns: bool = ...,
username: Incomplete | None = ...,
password: Incomplete | None = ...,
headers: Incomplete | None = ...,
proxytype: Incomplete | None = None,
addr: Incomplete | None = None,
port: Incomplete | None = None,
rdns: bool = True,
username: Incomplete | None = None,
password: Incomplete | None = None,
headers: Incomplete | None = None,
) -> None: ...
def getproxysockname(self): ...
def getproxypeername(self): ...

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): ...