mirror of
https://github.com/davidhalter/typeshed.git
synced 2026-09-21 02:33:18 +08:00
Add default values for third-party stubs beginning with 'P' (#9957)
This commit is contained in:
@@ -112,7 +112,7 @@ class WebsocketConnectionError(ValueError): ...
|
||||
|
||||
def error_string(mqtt_errno: int) -> str: ...
|
||||
def connack_string(connack_code: int) -> str: ...
|
||||
def base62(num: int, base: str = ..., padding: int = ...) -> str: ...
|
||||
def base62(num: int, base: str = ..., padding: int = 1) -> str: ...
|
||||
def topic_matches_sub(sub: str, topic: str) -> bool: ...
|
||||
|
||||
class MQTTMessageInfo:
|
||||
@@ -123,7 +123,7 @@ class MQTTMessageInfo:
|
||||
def __next__(self) -> int: ...
|
||||
def next(self) -> int: ...
|
||||
def __getitem__(self, index: int) -> int: ...
|
||||
def wait_for_publish(self, timeout: float | None = ...) -> None: ...
|
||||
def wait_for_publish(self, timeout: float | None = None) -> None: ...
|
||||
def is_published(self) -> bool: ...
|
||||
|
||||
class MQTTMessage:
|
||||
@@ -136,7 +136,7 @@ class MQTTMessage:
|
||||
retain: bool
|
||||
info: MQTTMessageInfo
|
||||
properties: Properties | None
|
||||
def __init__(self, mid: int = ..., topic: bytes | bytearray = ...) -> None: ...
|
||||
def __init__(self, mid: int = 0, topic: bytes | bytearray = b"") -> None: ...
|
||||
def __eq__(self, other: object) -> bool: ...
|
||||
def __ne__(self, other: object) -> bool: ...
|
||||
@property
|
||||
@@ -148,79 +148,84 @@ class Client:
|
||||
suppress_exceptions: bool
|
||||
def __init__(
|
||||
self,
|
||||
client_id: str | None = ...,
|
||||
clean_session: bool | None = ...,
|
||||
userdata: _UserData | None = ...,
|
||||
protocol: int = ...,
|
||||
transport: str = ...,
|
||||
reconnect_on_failure: bool = ...,
|
||||
client_id: str | None = "",
|
||||
clean_session: bool | None = None,
|
||||
userdata: _UserData | None = None,
|
||||
protocol: int = 4,
|
||||
transport: str = "tcp",
|
||||
reconnect_on_failure: bool = True,
|
||||
) -> None: ...
|
||||
def __del__(self) -> None: ...
|
||||
def reinitialise(self, client_id: str = ..., clean_session: bool = ..., userdata: _UserData | None = ...) -> None: ...
|
||||
def ws_set_options(self, path: str = ..., headers: _ExtraHeader | None = ...) -> None: ...
|
||||
def tls_set_context(self, context: _ssl.SSLContext | None = ...) -> None: ...
|
||||
def reinitialise(self, client_id: str = "", clean_session: bool = True, userdata: _UserData | None = None) -> None: ...
|
||||
def ws_set_options(self, path: str = "/mqtt", headers: _ExtraHeader | None = None) -> None: ...
|
||||
def tls_set_context(self, context: _ssl.SSLContext | None = None) -> None: ...
|
||||
def tls_set(
|
||||
self,
|
||||
ca_certs: str | None = ...,
|
||||
certfile: str | None = ...,
|
||||
keyfile: str | None = ...,
|
||||
cert_reqs: _ssl.VerifyMode | None = ...,
|
||||
tls_version: _ssl._SSLMethod | None = ...,
|
||||
ciphers: str | None = ...,
|
||||
keyfile_password: _ssl._PasswordType | None = ...,
|
||||
ca_certs: str | None = None,
|
||||
certfile: str | None = None,
|
||||
keyfile: str | None = None,
|
||||
cert_reqs: _ssl.VerifyMode | None = None,
|
||||
tls_version: _ssl._SSLMethod | None = None,
|
||||
ciphers: str | None = None,
|
||||
keyfile_password: _ssl._PasswordType | None = None,
|
||||
) -> None: ...
|
||||
def tls_insecure_set(self, value: bool) -> None: ...
|
||||
def proxy_set(self, **proxy_args: Any) -> None: ...
|
||||
def enable_logger(self, logger: logging.Logger | None = ...) -> None: ...
|
||||
def enable_logger(self, logger: logging.Logger | None = None) -> None: ...
|
||||
def disable_logger(self) -> None: ...
|
||||
def connect(
|
||||
self,
|
||||
host: str,
|
||||
port: int = ...,
|
||||
keepalive: int = ...,
|
||||
bind_address: str = ...,
|
||||
bind_port: int = ...,
|
||||
clean_start: int = ...,
|
||||
properties: Properties | None = ...,
|
||||
port: int = 1883,
|
||||
keepalive: int = 60,
|
||||
bind_address: str = "",
|
||||
bind_port: int = 0,
|
||||
clean_start: int = 3,
|
||||
properties: Properties | None = None,
|
||||
) -> int: ...
|
||||
def connect_srv(
|
||||
self,
|
||||
domain: str | None = ...,
|
||||
keepalive: int = ...,
|
||||
bind_address: str = ...,
|
||||
clean_start: int = ...,
|
||||
properties: Properties | None = ...,
|
||||
domain: str | None = None,
|
||||
keepalive: int = 60,
|
||||
bind_address: str = "",
|
||||
clean_start: int = 3,
|
||||
properties: Properties | None = None,
|
||||
) -> int: ...
|
||||
def connect_async(
|
||||
self,
|
||||
host: str,
|
||||
port: int = ...,
|
||||
keepalive: int = ...,
|
||||
bind_address: str = ...,
|
||||
bind_port: int = ...,
|
||||
clean_start: int = ...,
|
||||
properties: Properties | None = ...,
|
||||
port: int = 1883,
|
||||
keepalive: int = 60,
|
||||
bind_address: str = "",
|
||||
bind_port: int = 0,
|
||||
clean_start: int = 3,
|
||||
properties: Properties | None = None,
|
||||
) -> None: ...
|
||||
def reconnect_delay_set(self, min_delay: int = ..., max_delay: int = ...) -> None: ...
|
||||
def reconnect_delay_set(self, min_delay: int = 1, max_delay: int = 120) -> None: ...
|
||||
def reconnect(self) -> int: ...
|
||||
def loop(self, timeout: float = ..., max_packets: int = ...) -> int: ...
|
||||
def loop(self, timeout: float = 1.0, max_packets: int = 1) -> int: ...
|
||||
def publish(
|
||||
self, topic: str, payload: _Payload | None = ..., qos: int = ..., retain: bool = ..., properties: Properties | None = ...
|
||||
self,
|
||||
topic: str,
|
||||
payload: _Payload | None = None,
|
||||
qos: int = 0,
|
||||
retain: bool = False,
|
||||
properties: Properties | None = None,
|
||||
) -> MQTTMessageInfo: ...
|
||||
def username_pw_set(self, username: str, password: str | bytes | bytearray | None = ...) -> None: ...
|
||||
def username_pw_set(self, username: str, password: str | bytes | bytearray | None = None) -> None: ...
|
||||
def enable_bridge_mode(self) -> None: ...
|
||||
def is_connected(self) -> bool: ...
|
||||
def disconnect(self, reasoncode: ReasonCodes | None = ..., properties: Properties | None = ...) -> int: ...
|
||||
def disconnect(self, reasoncode: ReasonCodes | None = None, properties: Properties | None = None) -> int: ...
|
||||
def subscribe(
|
||||
self,
|
||||
topic: str | tuple[str, SubscribeOptions] | list[tuple[str, SubscribeOptions]] | list[tuple[str, int]],
|
||||
qos: int = ...,
|
||||
options: SubscribeOptions | None = ...,
|
||||
properties: Properties | None = ...,
|
||||
qos: int = 0,
|
||||
options: SubscribeOptions | None = None,
|
||||
properties: Properties | None = None,
|
||||
) -> tuple[int, int]: ...
|
||||
def unsubscribe(self, topic: str | list[str], properties: Properties | None = ...) -> tuple[int, int]: ...
|
||||
def loop_read(self, max_packets: int = ...) -> int: ...
|
||||
def loop_write(self, max_packets: int = ...) -> int: ...
|
||||
def unsubscribe(self, topic: str | list[str], properties: Properties | None = None) -> tuple[int, int]: ...
|
||||
def loop_read(self, max_packets: int = 1) -> int: ...
|
||||
def loop_write(self, max_packets: int = 1) -> int: ...
|
||||
def want_write(self) -> bool: ...
|
||||
def loop_misc(self) -> int: ...
|
||||
def max_inflight_messages_set(self, inflight: int) -> None: ...
|
||||
@@ -228,13 +233,18 @@ class Client:
|
||||
def message_retry_set(self, retry: Unused) -> None: ...
|
||||
def user_data_set(self, userdata: _UserData) -> None: ...
|
||||
def will_set(
|
||||
self, topic: str, payload: _Payload | None = ..., qos: int = ..., retain: bool = ..., properties: Properties | None = ...
|
||||
self,
|
||||
topic: str,
|
||||
payload: _Payload | None = None,
|
||||
qos: int = 0,
|
||||
retain: bool = False,
|
||||
properties: Properties | None = None,
|
||||
) -> None: ...
|
||||
def will_clear(self) -> None: ...
|
||||
def socket(self) -> _Socket | WebsocketWrapper: ...
|
||||
def loop_forever(self, timeout: float = ..., max_packets: int = ..., retry_first_connection: bool = ...) -> int: ...
|
||||
def loop_forever(self, timeout: float = 1.0, max_packets: int = 1, retry_first_connection: bool = False) -> int: ...
|
||||
def loop_start(self) -> int | None: ...
|
||||
def loop_stop(self, force: bool = ...) -> int | None: ...
|
||||
def loop_stop(self, force: bool = False) -> int | None: ...
|
||||
@property
|
||||
def on_log(self) -> _OnLog | None: ...
|
||||
@on_log.setter
|
||||
|
||||
@@ -33,30 +33,30 @@ class _Proxy(TypedDict):
|
||||
|
||||
def multiple(
|
||||
msgs: Iterable[_Msg],
|
||||
hostname: str = ...,
|
||||
port: int = ...,
|
||||
client_id: str = ...,
|
||||
keepalive: int = ...,
|
||||
will: _Msg | None = ...,
|
||||
auth: _Auth | None = ...,
|
||||
tls: _TLS | None = ...,
|
||||
protocol: int = ...,
|
||||
transport: str = ...,
|
||||
proxy_args: _Proxy | None = ...,
|
||||
hostname: str = "localhost",
|
||||
port: int = 1883,
|
||||
client_id: str = "",
|
||||
keepalive: int = 60,
|
||||
will: _Msg | None = None,
|
||||
auth: _Auth | None = None,
|
||||
tls: _TLS | None = None,
|
||||
protocol: int = 4,
|
||||
transport: str = "tcp",
|
||||
proxy_args: _Proxy | None = None,
|
||||
) -> None: ...
|
||||
def single(
|
||||
topic: str,
|
||||
payload: _Payload | None = ...,
|
||||
qos: int | None = ...,
|
||||
retain: bool | None = ...,
|
||||
hostname: str = ...,
|
||||
port: int = ...,
|
||||
client_id: str = ...,
|
||||
keepalive: int = ...,
|
||||
will: _Msg | None = ...,
|
||||
auth: _Auth | None = ...,
|
||||
tls: _TLS | None = ...,
|
||||
protocol: int = ...,
|
||||
transport: str = ...,
|
||||
proxy_args: _Proxy | None = ...,
|
||||
payload: _Payload | None = None,
|
||||
qos: int | None = 0,
|
||||
retain: bool | None = False,
|
||||
hostname: str = "localhost",
|
||||
port: int = 1883,
|
||||
client_id: str = "",
|
||||
keepalive: int = 60,
|
||||
will: _Msg | None = None,
|
||||
auth: _Auth | None = None,
|
||||
tls: _TLS | None = None,
|
||||
protocol: int = 4,
|
||||
transport: str = "tcp",
|
||||
proxy_args: _Proxy | None = None,
|
||||
) -> None: ...
|
||||
|
||||
@@ -2,7 +2,7 @@ class ReasonCodes:
|
||||
packetType: int
|
||||
names: dict[int, dict[str, list[int]]]
|
||||
value: int
|
||||
def __init__(self, packetType: int, aName: str = ..., identifier: int = ...) -> None: ...
|
||||
def __init__(self, packetType: int, aName: str = "Success", identifier: int = -1) -> None: ...
|
||||
def __getName__(self, packetType: int, identifier: int) -> str: ...
|
||||
def getId(self, name: str) -> int: ...
|
||||
def set(self, name: str) -> None: ...
|
||||
|
||||
@@ -6,34 +6,34 @@ from .publish import _TLS, _Auth, _Msg, _Proxy
|
||||
def callback(
|
||||
callback: Callable[[Client, _UserData, MQTTMessage], None],
|
||||
topics: list[str],
|
||||
qos: int = ...,
|
||||
userdata: _UserData | None = ...,
|
||||
hostname: str = ...,
|
||||
port: int = ...,
|
||||
client_id: str = ...,
|
||||
keepalive: int = ...,
|
||||
will: _Msg | None = ...,
|
||||
auth: _Auth | None = ...,
|
||||
tls: _TLS | None = ...,
|
||||
protocol: int = ...,
|
||||
transport: str = ...,
|
||||
clean_session: bool = ...,
|
||||
proxy_args: _Proxy | None = ...,
|
||||
qos: int = 0,
|
||||
userdata: _UserData | None = None,
|
||||
hostname: str = "localhost",
|
||||
port: int = 1883,
|
||||
client_id: str = "",
|
||||
keepalive: int = 60,
|
||||
will: _Msg | None = None,
|
||||
auth: _Auth | None = None,
|
||||
tls: _TLS | None = None,
|
||||
protocol: int = 4,
|
||||
transport: str = "tcp",
|
||||
clean_session: bool = True,
|
||||
proxy_args: _Proxy | None = None,
|
||||
) -> None: ...
|
||||
def simple(
|
||||
topics: str | list[str],
|
||||
qos: int = ...,
|
||||
msg_count: int = ...,
|
||||
retained: bool = ...,
|
||||
hostname: str = ...,
|
||||
port: int = ...,
|
||||
client_id: str = ...,
|
||||
keepalive: int = ...,
|
||||
will: _Msg | None = ...,
|
||||
auth: _Auth | None = ...,
|
||||
tls: _TLS | None = ...,
|
||||
protocol: int = ...,
|
||||
transport: str = ...,
|
||||
clean_session: bool = ...,
|
||||
proxy_args: _Proxy | None = ...,
|
||||
qos: int = 0,
|
||||
msg_count: int = 1,
|
||||
retained: bool = True,
|
||||
hostname: str = "localhost",
|
||||
port: int = 1883,
|
||||
client_id: str = "",
|
||||
keepalive: int = 60,
|
||||
will: _Msg | None = None,
|
||||
auth: _Auth | None = None,
|
||||
tls: _TLS | None = None,
|
||||
protocol: int = 4,
|
||||
transport: str = "tcp",
|
||||
clean_session: bool = True,
|
||||
proxy_args: _Proxy | None = None,
|
||||
) -> list[MQTTMessage] | MQTTMessage: ...
|
||||
|
||||
@@ -18,7 +18,7 @@ class SubscribeOptions:
|
||||
noLocal: bool
|
||||
retainAsPublished: bool
|
||||
retainHandling: int
|
||||
def __init__(self, qos: int = ..., noLocal: bool = ..., retainAsPublished: bool = ..., retainHandling: int = ...) -> None: ...
|
||||
def __init__(self, qos: int = 0, noLocal: bool = False, retainAsPublished: bool = False, retainHandling: int = 0) -> None: ...
|
||||
def __setattr__(self, name: str, value: Any) -> None: ...
|
||||
def pack(self) -> bytes: ...
|
||||
def unpack(self, buffer: bytes | bytearray) -> int: ...
|
||||
|
||||
Reference in New Issue
Block a user