diff --git a/src/netius/auth/address.pyi b/src/netius/auth/address.pyi index 79f5fcab..047d7924 100644 --- a/src/netius/auth/address.pyi +++ b/src/netius/auth/address.pyi @@ -1,6 +1,8 @@ +from typing import Sequence + from netius import Auth class AddressAuth(Auth): - def __init__(self, allowed: list[str] = ..., *args, **kwargs) -> None: ... + def __init__(self, allowed: Sequence[str] = ..., *args, **kwargs) -> None: ... @classmethod - def auth(cls, allowed: list[str] = ..., *args, **kwargs) -> bool: ... + def auth(cls, allowed: Sequence[str] = ..., *args, **kwargs) -> bool: ... diff --git a/src/netius/auth/base.pyi b/src/netius/auth/base.pyi index 5659fae8..32dbaf60 100644 --- a/src/netius/auth/base.pyi +++ b/src/netius/auth/base.pyi @@ -1,6 +1,6 @@ from typing import Any, Literal, NoReturn, PathLike -HashType = Literal["plain", "md5", "sha1", "sha256", "sha512"] +HashType = Literal["plain", "md5", "sha1", "sha256", "sha512"] class Auth: def __init__(self, *args, **kwargs) -> None: ... @@ -17,7 +17,9 @@ class Auth: @classmethod def unpack(cls, password) -> tuple[HashType, str | None, str, str | None]: ... @classmethod - def get_file(cls, path: PathLike[str], cache: bool = ..., encoding: str | None = ...) -> str | bytes: ... + def get_file( + cls, path: PathLike[str], cache: bool = ..., encoding: str | None = ... + ) -> str | bytes: ... @classmethod def is_simple(cls) -> bool: ... def auth_i(self, *args, **kwargs) -> bool: ... diff --git a/src/netius/auth/deny.pyi b/src/netius/auth/deny.pyi index daf93966..5670d4e5 100644 --- a/src/netius/auth/deny.pyi +++ b/src/netius/auth/deny.pyi @@ -1,10 +1,4 @@ -import netius.auth.base -import netius.auth.base as base +from netius import Auth -from typing import Literal - -class DenyAuth(netius.auth.base.Auth): - @classmethod - def auth(cls, *args, **kwargs) -> Literal[False]: ... - @classmethod - def is_simple(cls) -> Literal[True]: ... +class DenyAuth(Auth): + pass diff --git a/src/netius/auth/dummy.pyi b/src/netius/auth/dummy.pyi index d84fba13..3122d000 100644 --- a/src/netius/auth/dummy.pyi +++ b/src/netius/auth/dummy.pyi @@ -1,12 +1,6 @@ -import netius.auth.base -import netius.auth.base as base +from netius import Auth -from typing import Literal - -class DummyAuth(netius.auth.base.Auth): +class DummyAuth(Auth): def __init__(self, value: bool = ..., *args, **kwargs) -> None: ... @classmethod def auth(cls, value: bool = ..., *args, **kwargs) -> bool: ... - @classmethod - def is_simple(cls) -> Literal[True]: ... - def auth_i(self, *args, **kwargs) -> bool: ... diff --git a/src/netius/auth/memory.pyi b/src/netius/auth/memory.pyi index f00fd1aa..29efe893 100644 --- a/src/netius/auth/memory.pyi +++ b/src/netius/auth/memory.pyi @@ -1,17 +1,25 @@ -import netius as netius -import netius.auth.base -import netius.auth.base as base +from typing import Any -from typing import Dict +from netius import Auth -class MemoryAuth(netius.auth.base.Auth): - def __init__(self, registry: Dict | None = ..., *args, **kwargs) -> None: ... +class MemoryAuth(Auth): + def __init__( + self, registry: dict[str, Any] | None = ..., *args, **kwargs + ) -> None: ... @classmethod - def auth(cls, username: str, password: str, registry: dict | None = ..., *args, **kwargs) -> bool: ... + def auth( + cls, + username: str, + password: str, + registry: dict[str, Any] | None = ..., + *args, + **kwargs + ) -> bool: ... @classmethod - def meta(cls, username: str, registry: Dict | None = ..., *args, **kwargs) -> Dict: ... + def meta( + cls, username: str, registry: dict[str, Any] | None = ..., *args, **kwargs + ) -> dict[str, Any]: ... @classmethod - def get_registry(cls) -> Dict: ... + def get_registry(cls) -> dict[str, Any]: ... @classmethod - def load_registry(cls) -> Dict: ... - def auth_i(self, username: str, password: str, *args, **kwargs) -> bool: ... + def load_registry(cls) -> dict[str, Any]: ... diff --git a/src/netius/auth/passwd.pyi b/src/netius/auth/passwd.pyi index a87f15e5..d93b898d 100644 --- a/src/netius/auth/passwd.pyi +++ b/src/netius/auth/passwd.pyi @@ -1,12 +1,13 @@ -import netius.auth.base -import netius.auth.base as base +from typing import PathLike -from typing import PathLike, Any, Dict +from netius import Auth -class PasswdAuth(netius.auth.base.Auth): +class PasswdAuth(Auth): def __init__(self, path: PathLike[str] | None = ..., *args, **kwargs) -> None: ... @classmethod - def auth(cls, username: str, password: str, path: str = ..., *args, **kwargs) -> bool: ... + def auth( + cls, username: str, password: str, path: str = ..., *args, **kwargs + ) -> bool: ... @classmethod - def get_passwd(cls, path: PathLike[str], cache: bool = ...) -> (Any | Dict): ... + def get_passwd(cls, path: PathLike[str], cache: bool = ...) -> dict[str, str]: ... def auth_i(self, username: str, password: str, *args, **kwargs) -> bool: ... diff --git a/src/netius/auth/simple.pyi b/src/netius/auth/simple.pyi index b3692450..08e07c08 100644 --- a/src/netius/auth/simple.pyi +++ b/src/netius/auth/simple.pyi @@ -1,10 +1,18 @@ -import netius.auth.base -import netius.auth.base as base +from typing import Sequence -from typing import Tuple +from netius import Auth -class SimpleAuth(netius.auth.base.Auth): - def __init__(self, username: str | None = ..., password: str | None = ..., *args, **kwargs) -> None: ... +class SimpleAuth(Auth): + def __init__( + self, username: str | None = ..., password: str | None = ..., *args, **kwargs + ) -> None: ... @classmethod - def auth(cls, username: str, password: str, target: Tuple[str:str] | None = ..., *args, **kwargs) -> bool: ... - def auth_i(self, username:str , password: str, *args, **kwargs) -> bool: ... + def auth( + cls, + username: str, + password: str, + target: Sequence[str, str] | None = ..., + *args, + **kwargs + ) -> bool: ... + def auth_i(self, username: str, password: str, *args, **kwargs) -> bool: ... diff --git a/src/netius/base/agent.pyi b/src/netius/base/agent.pyi deleted file mode 100644 index df78e6cb..00000000 --- a/src/netius/base/agent.pyi +++ /dev/null @@ -1,20 +0,0 @@ -import netius.base.legacy as legacy -import netius.base.observer -import netius.base.observer as observer - -from typing import Any, ClassVar, Self - -class Agent(netius.base.observer.Observable): - @classmethod - def cleanup_s(cls) -> None: ... - def cleanup(self, destroy: bool = ...) -> None: ... - def destroy(self) -> None: ... - -class ClientAgent(Agent): - _clients: ClassVar[dict] = ... - @classmethod - def cleanup_s(cls) -> None: ... - @classmethod - def get_client_s(cls, *args, **kwargs) -> Self@ClientAgent: ... - -class ServerAgent(Agent): ... diff --git a/src/netius/base/async_neo.pyi b/src/netius/base/async_neo.pyi deleted file mode 100644 index deb29348..00000000 --- a/src/netius/base/async_neo.pyi +++ /dev/null @@ -1,43 +0,0 @@ -import netius.base.async_old -import netius.base.async_old as async_old -import netius.base.errors as errors -import netius.base.legacy as legacy - -from typing import Any, Callable, ClassVar, Generator, Literal, ModuleType, Optional, Self, Tuple, Type, Union - -class Future(netius.base.async_old.Future): - def __iter__(self) -> Future: ... - def __await__(self) -> Generator[Self@Future, Any, Any]: ... - -class AwaitWrapper: - _is_generator: ClassVar[bool] = ... - def __init__(self, generator: Generator, generate: bool = ...) -> None: ... - def __await__(self) -> (Generator[Any, Any, Any | None] | Generator[None, Any, Generator[Any, Any, None] | Any]): ... - def __iter__(self) -> AwaitWrapper: ... - def __next__(self) -> Any: ... - def next(self) -> Any: ... - def generate(self, value: Any) -> Generator[Any, Any, None]: ... - def _await_generator(self) -> Generator[Any, Any, Any | None]: ... - def _await_basic(self) -> Generator[None, Any, Generator[Any, Any, None] | Any]: ... - -class CoroutineWrapper: - def __init__(self, coroutine: Generator) -> None: ... - def __iter__(self) -> CoroutineWrapper: ... - def __next__(self) -> Any: ... - def next(self) -> Any: ... - def restore(self, value: Any) -> None: ... - -def coroutine(function: Callable) -> Callable: ... - -def ensure_generator(value: Any) -> (tuple[Literal[True], Any] | tuple[Literal[True], CoroutineWrapper] | tuple[Literal[False], Any]): ... -def get_asyncio() -> Optional[Type[ModuleType]]: ... -def is_coroutine(callable: Callable) -> bool: ... -def is_coroutine_object(generator: Any) -> bool: ... -def is_coroutine_native(generator: Any) -> bool: ... -def is_future(future: Any) -> bool: ... -def _sleep(timeout: float, compat: bool = ...) -> Generator: ... -def _wait(event: Any, timeout: Any | None = None, future: Any | None = None) -> Generator: ... -def sleep(*args, **kwargs) -> AwaitWrapper: ... -def wait(*args, **kwargs) -> AwaitWrapper: ... -def coroutine_return(coroutine: CoroutineWrapper) -> AwaitWrapper: ... -def _coroutine_return(coroutine: CoroutineWrapper) -> Generator[Any, Any, Any]: ... diff --git a/src/netius/base/async_old.pyi b/src/netius/base/async_old.pyi deleted file mode 100644 index e8560aaf..00000000 --- a/src/netius/base/async_old.pyi +++ /dev/null @@ -1,68 +0,0 @@ -import netius.base.errors as errors -import netius.base.legacy as legacy - -from typing import Any, Callable, Generator, Optional, NoReturn, Type, Tuple - -class Future: - def __init__(self, loop: Any | None = None) -> None: ... - def __iter__(self) -> Generator[Type[Future], Any, None]: ... - def cleanup(self) -> None: ... - def running(self) -> bool: ... - def done(self) -> bool: ... - def cancelled(self) -> bool: ... - def finished(self) -> bool: ... - def result(self) -> (Any | None): ... - def exception(self, timeout: Optional[float] = ...) -> (Any | None): ... - def partial(self, value: Any) -> None: ... - def add_done_callback(self, function: Callable[..., Any]) -> None: ... - def add_partial_callback(self, function: Callable[..., Any]) -> None: ... - def add_ready_callback(self, function: Callable[..., Any]) -> None: ... - def add_closed_callback(self, function: Callable[..., Any]) -> None: ... - def approve(self, cleanup: bool = ...) -> None: ... - def cancel(self, cleanup: bool = ..., force: bool = ...) -> bool: ... - def set_result(self, result: Any, cleanup: bool = ..., force: bool = ...) -> None: ... - def set_exception(self, exception: Any, cleanup: bool = ..., force: bool = ...) -> None: ... - def _done_callbacks(self, cleanup: bool = ..., delayed: bool = ...) -> None: ... - def _partial_callbacks(self, value: Any, delayed: bool = ...) -> None: ... - def _wrap(self, future: Any) -> None: ... - def _delay(self, callable: Callable[..., Any]) -> None: ... - @property - def ready(self) -> bool: ... - @property - def closed(self) -> bool: ... - def _done_callbacks(self, cleanup: bool = True, delayed: bool = True) -> (Any | None): ... - def _partial_callbacks(self, value: Any, delayed: bool = True) -> (Any | None): ... - def _wrap(self, future: Any) -> None: ... - def _delay(self, callable: Any) -> Any: ... - -class Task(Future): - def __init__(self, future: Any = ...) -> None: ... - -class Handle: - def __init__(self, callable_t: Any = ...) -> None: ... - def cancel(self) -> None: ... - -class Executor: - def submit(self, callable: Callable[..., Any], *args: Any, **kwargs: Any) -> NoReturn: ... - -class ThreadPoolExecutor(Executor): - def __init__(self, owner: Any) -> None: ... - def submit(self, callable: Callable[..., Any], *args: Any, **kwargs: Any) -> Any: ... - -def coroutine(function: Callable[..., Any]) -> Callable[..., Any]: ... -def async_test_all(factory: Any = ..., close: bool = True) -> Callable[..., Any]: ... -def async_test(function: Callable[..., Any]) -> Callable[..., Any]: ... -def ensure_generator(value: Any) -> Tuple[bool, Any]: ... -def get_asyncio() -> Any: ... -def is_coroutine(callable: Callable[..., Any]) -> bool: ... -def is_coroutine_object(generator: Any) -> bool: ... -def is_coroutine_native(generator: Any) -> bool: ... -def is_future(future: Any) -> bool: ... -def is_neo() -> bool: ... -def is_asynclib() -> bool: ... -def is_await() -> bool: ... -def wakeup(force: bool = False) -> Any: ... -def sleep(timeout: Any, compat: bool = True, future: Any = ...) -> Generator[Any, Any, None]: ... -def wait(event: Any, timeout: Any | None = None, future: Any = ...) -> Generator[Any, Any, None]: ... -def notify(event: Any, data: Any | None = None) -> Any: ... -def coroutine_return(coroutine: Any) -> Generator[Any, Any, None]: ... diff --git a/src/netius/base/asynchronous.pyi b/src/netius/base/asynchronous.pyi deleted file mode 100644 index fd3522ff..00000000 --- a/src/netius/base/asynchronous.pyi +++ /dev/null @@ -1,31 +0,0 @@ -import netius.base.async_old as async_old -import netius.base.errors as errors -import netius.base.legacy as legacy -from netius.base.async_neo import ( - AwaitWrapper as AwaitWrapper, - CoroutineWrapper as CoroutineWrapper, - Future as Future, - coroutine as coroutine, - coroutine_return as coroutine_return, - ensure_generator as ensure_generator, - get_asyncio as get_asyncio, - is_coroutine as is_coroutine, - is_coroutine_native as is_coroutine_native, - is_coroutine_object as is_coroutine_object, - is_future as is_future, - sleep as sleep, - wait as wait, -) -from netius.base.async_old import ( - Executor as Executor, - Handle as Handle, - Task as Task, - ThreadPoolExecutor as ThreadPoolExecutor, - async_test as async_test, - async_test_all as async_test_all, - is_asynclib as is_asynclib, - is_await as is_await, - is_neo as is_neo, - notify as notify, - wakeup as wakeup, -) diff --git a/src/netius/base/client.pyi b/src/netius/base/client.pyi deleted file mode 100644 index fa7d6bd1..00000000 --- a/src/netius/base/client.pyi +++ /dev/null @@ -1,164 +0,0 @@ -import netius as netius -import netius.base.async_old as async_old -import netius.base.asynchronous as asynchronous -import netius.base.common -import netius.base.compat as compat -import netius.base.config as config -import netius.base.errors as errors -import netius.base.legacy as legacy -import netius.base.log as log -import netius.base.observer as observer -import netius.base.request as request -import netius.base.tls as tls -import netius.base.util as util -import netius.middleware as middleware -import socket -from _typeshed import Incomplete -from netius.base.async_neo import ( - AwaitWrapper as AwaitWrapper, - CoroutineWrapper as CoroutineWrapper, - Future as Future, - coroutine as coroutine, - coroutine_return as coroutine_return, - ensure_generator as ensure_generator, - get_asyncio as get_asyncio, - is_coroutine as is_coroutine, - is_coroutine_native as is_coroutine_native, - is_coroutine_object as is_coroutine_object, - is_future as is_future, - sleep as sleep, - wait as wait, -) -from netius.base.async_old import ( - Executor as Executor, - Handle as Handle, - Task as Task, - ThreadPoolExecutor as ThreadPoolExecutor, - async_test as async_test, - async_test_all as async_test_all, - is_asynclib as is_asynclib, - is_await as is_await, - is_neo as is_neo, - notify as notify, - wakeup as wakeup, -) -from netius.base.common import ( - AbstractBase as AbstractBase, - Base as Base, - BaseThread as BaseThread, - DiagBase as DiagBase, - build_future as build_future, - compat_loop as compat_loop, - ensure as ensure, - ensure_asyncio as ensure_asyncio, - ensure_loop as ensure_loop, - ensure_main as ensure_main, - ensure_pool as ensure_pool, - get_event_loop as get_event_loop, - get_loop as get_loop, - get_main as get_main, - get_poll as get_poll, - new_loop as new_loop, - new_loop_asyncio as new_loop_asyncio, - new_loop_main as new_loop_main, - stop_loop as stop_loop, -) -from netius.base.conn import ( - BaseConnection as BaseConnection, - Connection as Connection, - DiagConnection as DiagConnection, -) -from netius.base.poll import ( - EpollPoll as EpollPoll, - KqueuePoll as KqueuePoll, - Poll as Poll, - PollPoll as PollPoll, - SelectPoll as SelectPoll, -) -from typing import Any, Self - -BUFFER_SIZE: None -GC_TIMEOUT: float - -class Client(netius.base.common.AbstractBase): - def __init__(self, thread: bool = ..., daemon: bool = ..., *args, **kwargs) -> None: ... - @classmethod - def get_client_s(cls, *args, **kwargs) -> Self@Client: ... - @classmethod - def cleanup_s(cls) -> None: ... - def ensure_loop(self, env: bool = ...) -> None: ... - def join(self, timeout: Any | None = ...) -> None: ... - -class DatagramClient(Client): - def __init__(self, *args, **kwargs) -> None: ... - def boot(self) -> None: ... - def cleanup(self) -> None: ... - def on_read(self, _socket: Any) -> None: ... - def on_write(self, _socket: Any) -> None: ... - def on_error(self, _socket: Any) -> None: ... - def on_exception(self, exception: Any) -> None: ... - def on_expected(self, exception: Any) -> None: ... - def on_data(self, connection: Any, data: Any) -> None: ... - def keep_gc(self, timeout: float = ..., run: bool = ...) -> None: ... - def gc(self, callbacks: bool = ...) -> None: ... - def add_request(self, request: Any) -> None: ... - def remove_request(self, request: Any) -> None: ... - def get_request(self, id: Any) -> Any: ... - def ensure_socket(self) -> None: ... - def ensure_write(self) -> None: ... - def remove_write(self) -> None: ... - def enable_read(self) -> None: ... - def disable_read(self) -> None: ... - def send(self, data: Any, address: Any, delay: bool = ..., ensure_loop: bool = ..., callback: Any | None = ...) -> None : ... - def _send(self, _socket: Any) -> None: ... - def _flush_write(self) -> None: ... - -class StreamClient(Client): - def __init__(self, *args, **kwargs) -> None: ... - def cleanup(self) -> None: ... - def ticks(self) -> None: ... - def info_dict(self, full: bool = ...) -> None: ... - def acquire_c( - self, - host: Any, - port: Any, - ssl: bool = False, - key_file: Any | None = None, - cer_file: Any | None = None, - validate: bool = False, - callback: Any | None = None - ) -> Any : ... - def release_c(self, connection: Any) -> None: ... - def remove_c(self, connection: Any) -> None: ... - def validate_c(self, connection: Any, close: bool = ...) -> Any: ... - def connect( - self, - host: Any, - port: Any, - ssl: bool = ..., - key_file: Any | None = ..., - cer_file: Any | None = ..., - ca_file: Any | None = ..., - ca_root: bool = ..., - ssl_verify: bool = ..., - family: Any = ..., - type: Any = ..., - ensure_loop: bool = ..., - env: bool = ... - ) -> Any: ... - def acquire(self, connection: Any) -> None: ... - def on_read(self, _socket: Any) -> None: ... - def on_write(self, _socket: Any) -> None: ... - def on_error(self, _socket: Any) -> None: ... - def on_exception(self, exception: Any, connection: Any) -> None: ... - def on_expected(self, exception: Any, connection: Any) -> None: ... - def on_connect(self, connection: Any) -> None: ... - def on_upgrade(self, connection: Any) -> None: ... - def on_ssl(self, connection: Any) -> None: ... - def on_acquire(self, connection: Any) -> None: ... - def on_release(self, connection: Any) -> None: ... - def on_data(self, connection: Any, data: Any) -> None: ... - def _connectf(self, connection: Any) -> None: ... - def _connects(self) -> None: ... - def _connect(self, connection: Any) -> None: ... - def _ssl_handshake(self, connection: Any) -> None: ... diff --git a/src/netius/base/common.pyi b/src/netius/base/common.pyi deleted file mode 100644 index 803dc3a9..00000000 --- a/src/netius/base/common.pyi +++ /dev/null @@ -1,451 +0,0 @@ -import netius as netius -import netius.base.async_old as async_old -import netius.base.asynchronous as asynchronous -import netius.base.compat as compat -import netius.base.config as config -import netius.base.errors as errors -import netius.base.legacy as legacy -import netius.base.log as log -import netius.base.observer -import netius.base.observer as observer -import netius.base.tls as tls -import netius.base.util as util -import netius.middleware as middleware -import signal -import socket -import ssl -import threading -from netius.base.async_neo import ( - AwaitWrapper as AwaitWrapper, - CoroutineWrapper as CoroutineWrapper, - Future as Future, - coroutine as coroutine, - coroutine_return as coroutine_return, - ensure_generator as ensure_generator, - get_asyncio as get_asyncio, - is_coroutine as is_coroutine, - is_coroutine_native as is_coroutine_native, - is_coroutine_object as is_coroutine_object, - is_future as is_future, - sleep as sleep, - wait as wait, -) -from netius.base.async_old import ( - Executor as Executor, - Handle as Handle, - Task as Task, - ThreadPoolExecutor as ThreadPoolExecutor, - async_test as async_test, - async_test_all as async_test_all, - is_asynclib as is_asynclib, - is_await as is_await, - is_neo as is_neo, - notify as notify, - wakeup as wakeup, -) -from netius.base.conn import ( - BaseConnection as BaseConnection, - Connection as Connection, - DiagConnection as DiagConnection, -) -from netius.base.poll import ( - EpollPoll as EpollPoll, - KqueuePoll as KqueuePoll, - Poll as Poll, - PollPoll as PollPoll, - SelectPoll as SelectPoll, -) - -from typing import Any, ClassVar, LiteralString - -NAME: str -VERSION: str -PLATFORM: str -IDENTIFIER_TINY: str -IDENTIFIER_SHORT: str -IDENTIFIER_LONG: str -WSAEWOULDBLOCK: int -WSAECONNABORTED: int -WSAECONNRESET: int -SSL_ERROR_CERT_ALREADY_IN_HASH_TABLE: int -POOL_ORDER: list[Poll] -SILENT_ERRORS: list[int] -VALID_ERRORS: list[int] -SSL_SILENT_ERRORS: list[int] -SSL_VALID_ERRORS: list[int] -SSL_ERROR_NAMES: list[str] -SSL_VALID_REASONS: tuple[str] -TCP_TYPE: int -UDP_TYPE: int -STATE_STOP: int -STATE_START: int -STATE_PAUSE: int -STATE_CONFIG: int -STATE_POLL: int -STATE_TICK: int -STATE_READ: int -STATE_WRITE: int -STATE_ERRROR: int -STATE_STRINGS: tuple[str] -KEEPALIVE_TIMEOUT: int -KEEPALIVE_INTERVAL: int -KEEPALIVE_COUNT: int -ALLOW_BLOCK: bool -LOG_FORMAT: str -BASE_PATH: str -EXTRAS_PATH: str -SSL_KEY_PATH: str -SSL_CER_PATH: str -SSL_CA_PATH: str -SSL_DH_PATH: str - -class AbstractBase(netius.base.observer.Observable): - def __init__( - self, - name: Any | None = ..., - handlers: Any | None = ..., - *args, - **kwargs - ) -> None: ... - @classmethod - def test_poll(cls, preferred: Any | None = ...) -> (type[EpollPoll] | type[KqueuePoll] | type[PollPoll] | type[SelectPoll]) -> None: ... - @classmethod - def get_loop(cls, compat: bool = ..., asyncio: bool = ...) -> (Any | None) -> None: ... - @classmethod - def get_main(cls, compat: bool = ...) -> (Any | None) -> None: ... - @classmethod - def get_asyncio(cls) -> (Any | None) -> None: ... - @classmethod - def set_main(cls, instance, set_compat: bool = ...) -> None: ... - @classmethod - def unset_main(cls, set_compat: bool = ...) -> None: ... - @classmethod - def patch_asyncio(cls) -> None: ... - @classmethod - def waitpid(cls, pid: Any) -> None: ... - def destroy(self) -> None: ... - def call_safe(self, callable, args, kwargs) -> None : ... - def wait_event(self, callable, name: Any | None = ...) -> None : ... - def unwait_event(self, callable, name: Any | None = ...) -> None : ... - def delay( - self, - callable: Any, - timeout: Any | None = ..., - immediately: bool = ..., - verify: bool = ..., - safe: bool = ... - ) -> (Any | None) : ... - def delay_s( - self, - callable: Any, - timeout: Any | None = ..., - immediately: bool = ..., - verify: bool = ..., - wakeup: bool = ... - ) -> None : ... - def delay_m(self) -> None: ... - def ensure( - self, - coroutine: Any, - args, - kwargs, - thread: Any | None = ..., - future: Any | None = ..., - immediately: bool = ... - ) -> (Any | Future) -> None: ... - def resolve_hostname(self, hostname: Any, type: str = ...) -> Future: ... - def run_forever(self) -> None: ... - def run_coroutine(self, coroutine: Any, args, kwargs, thread: Any | None = ..., close: Any | None = ...) -> (Any | None) -> None: ... - def wakeup(self, force: bool = ...) -> None: ... - def sleep(self, timeout: Any, future: Any | None = ...) -> (Any | Future) -> None: ... - def wait(self, event: Any, timeout: Any | None = ..., future: Any | None = ...) -> (Any | Future) -> None: ... - def notify(self, event, data: Any | None = ...) -> None: ... - def load(self, full: bool = ...) -> None: ... - def unload(self, full: bool = ...) -> None: ... - def boot(self) -> None: ... - def welcome(self) -> None: ... - def load_logging(self, level: int = ..., format: str = ..., unique: bool = ...) -> None: ... - def unload_logging(self, safe: bool = ...) -> None: ... - def extra_logging(self, level: Any, formatter: Any) -> None: ... - def level_logging(self, level: Any) -> None: ... - def load_diag(self, env: bool = ...) -> None: ... - def load_middleware(self, suffix: str = ...) -> None: ... - def unload_middleware(self) -> None: ... - def register_middleware(self, middleware_c: Any, *args, **kwargs) -> None: ... - def call_middleware(self, name, *args, **kwargs) -> None: ... - def bind_signals(self, signals: Any = (signal.SIGINT, signal.SIGTERM, signal.SIGHUP if hasattr(signal, "SIGHUP") else None, signal.SIGQUIT if hasattr(signal, "SIGQUIT") else None), handler: Any | None = ...) -> None: ... - def unbind_signals(self, signals: Any = (signal.SIGINT, signal.SIGTERM, signal.SIGHUP if hasattr(signal, "SIGHUP") else None, signal.SIGQUIT if hasattr(signal, "SIGQUIT") else None)) -> None: ... - def bind_env(self) -> None: ... - def forever(self, env: bool = ...) -> None: ... - def start(self) -> None: ... - def stop(self) -> None: ... - def pause(self) -> None: ... - def resume(self) -> None: ... - def close(self) -> None: ... - def finish(self) -> None: ... - def main(self) -> None: ... - def is_main(self) -> bool: ... - def is_running(self) -> bool: ... - def is_started(self) -> bool: ... - def is_stopped(self) -> bool: ... - def is_paused(self) -> bool: ... - def is_edge(self) -> bool: ... - def is_empty(self) -> bool: ... - def is_sub_read(self, socket: Any) -> bool: ... - def is_sub_write(self, socket: Any) -> bool: ... - def is_sub_error(self, socket: Any) -> bool: ... - def sub_all(self, socket: Any) -> None: ... - def unsub_all(self, socket: Any) -> None: ... - def sub_read(self, socket: Any) -> None: ... - def sub_write(self, socket: Any) -> None: ... - def sub_error(self, socket: Any) -> None: ... - def unsub_read(self, socket: Any) -> None: ... - def unsub_write(self, socket: Any) -> None: ... - def unsub_error(self, socket: Any) -> None: ... - def cleanup(self, destroy: bool = ...) -> None: ... - def loop(self) -> None: ... - def block(self) -> None: ... - def fork(self, timeout: int = ...) -> None: ... - def finalize(self) -> None: ... - def ticks(self) -> None: ... - def reads(self, reads: Any, state: bool = ...) -> None: ... - def writes(self, writes: Any, state: bool = ...) -> None: ... - def errors(self, errors: Any, state: bool = ...) -> None: ... - def datagram( - self, - family: Any = ..., - type: Any = ..., - local_host: Any | None = ..., - local_port: Any | None = ..., - remote_host: Any | None = ..., - remote_port: Any | None = ..., - callback: Any | None = ... - ) -> Connection: ... - def connect( - self, - host: Any, - port: Any, - receive_buffer: Any | None = ..., - send_buffer: Any | None = ..., - ssl: bool = ..., - key_file: Any | None = ..., - cer_file: Any | None = ..., - ca_file: Any | None = ..., - ca_root: bool = ..., - ssl_verify: bool = ..., - family: Any = ..., - type: Any = ..., - callback: Any | None = ..., - env: bool = ... - ) -> Any: ... - def acquire(self, connection: Any) -> None: ... - def pregister(self, pool: Any) -> None: ... - def punregister(self, pool: Any) -> None: ... - def pcallback(self, event: Any, socket: Any, pool: Any) -> None: ... - def nensure(self) -> None: ... - def nstart(self) -> None: ... - def nstop(self) -> None: ... - def tensure(self) -> None: ... - def tstart(self) -> None: ... - def tstop(self) -> None: ... - def texecute( - self, - callable: Any, - args: ..., - kwargs: ..., - callback: Any | None = ..., - ) -> None: ... - def files(self) -> None: ... - def fopen(self, *args, **kwargs) -> None: ... - def fclose(self, *args, **kwargs) -> None: ... - def fread(self, *args, **kwargs) -> None: ... - def fwrite(self, *args, **kwargs) -> None: ... - def fensure(self) -> None: ... - def fstart(self) -> None: ... - def fstop(self) -> None: ... - def on_connection_c(self, connection: Any) -> None: ... - def on_connection_d(self, connection: Any) -> None: ... - def on_stream_c(self, stream: Any) -> None: ... - def on_stream_d(self, stream: Any) -> None: ... - def on_fork(self) -> None: ... - def on_join(self) -> None: ... - def on_child(self, pipe: Any | None = ...) -> None: ... - def on_command(self, command: Any) -> None: ... - def on_diag(self) -> None: ... - def on_start(self) -> None: ... - def on_stop(self) -> None: ... - def on_pause(self) -> None: ... - def on_resume(self) -> None: ... - def on_read(self, _socket: Any) -> None: ... - def on_write(self, _socket: Any) -> None: ... - def on_error(self, _socket: Any) -> None: ... - def on_exception(self, exception: Any, connection: Any) -> None: ... - def on_expected(self, exception: Any, connection: Any) -> None: ... - def on_connect(self, connection: Any) -> None: ... - def on_upgrade(self, connection: Any) -> None: ... - def on_client_ssl(self, connection: Any) -> None: ... - def on_acquire(self, connection: Any) -> None: ... - def on_acquire_base(self, connection: Any) -> None: ... - def on_release(self, connection: Any) -> None: ... - def on_release_base(self, connection: Any) -> None: ... - def on_data(self, connection: Any, data: Any) -> None: ... - def on_data_base(self, connection: Any, data: Any) -> None: ... - def info_dict(self, full: bool = ...) -> None: ... - def info_string(self, full: bool = ..., safe: bool = ...) -> None: ... - def connections_dict(self, full: bool = ...) -> None: ... - def connection_dict(self, id, full: bool = ...) -> None: ... - def build_connection( - self, - socket: Any, - address: Any | None = ..., - datagram: bool = ..., - ssl: bool = ... - ) -> Connection: ... - def base_connection(self, *args, **kwargs) -> base_connection: ... - def new_connection(self, connection: Connection) -> None: ... - def del_connection(self, connection: Connection) -> None: ... - def add_callback(self, socket: Any, callback: Any) -> None: ... - def remove_callback(self, socket: Any, callback: Any) -> None: ... - def load_config(self, path: str = ..., **kwargs) -> None: ... - def apply_config(self, path: str, kwargs) -> dict: ... - def exec_safe(self, connection: Connection, callable: Any, *args, **kwargs) -> Any: ... - def is_devel(self) -> bool: ... - def is_debug(self) -> bool: ... - def is_info(self) -> bool: ... - def is_warning(self) -> bool: ... - def is_error(self) -> bool: ... - def is_critical(self) -> bool: ... - def debug(self, object: Any) -> None: ... - def info(self, object: Any) -> None: ... - def warning(self, object: Any) -> None: ... - def error(self, object: Any) -> None: ... - def critical(self, object: Any) -> None: ... - def log_stack(self, method: Any | None = ..., info: bool = ...) -> None: ... - def log_info(self, method: Any | None = ...) -> None: ... - def log(self, *args, **kwargs) -> None: ... - def log_python_3(self, object: Any, level: int = ...) -> None: ... - def log_python_2(self, object: Any, level: int = ...) -> None: ... - def build_poll(self) -> (Any | EpollPoll | KqueuePoll | PollPoll | SelectPoll): ... - def build_future(self, compat: bool = ..., asyncio: bool = ...) -> Future: ... - def get_id(self, unique: bool = ...) -> Any: ... - def get_poll(self) -> (Any | EpollPoll | KqueuePoll | PollPoll | SelectPoll): ... - def get_poll_name(self) -> str: ... - def get_state(self) -> Any: ... - def set_state(self, state: int) -> None: ... - def get_state_s(self, lower: bool = ...) -> Any: ... - def get_env( - self, - name: Any, - default: Any | None = ..., - cast: Any | None = ..., - expand: bool = ... - ) -> (Any | str | None): ... - def expand(self, value: Any, encoding: str = ..., force: bool = ...) -> None: ... - def get_protocols(self) -> None: ... - def get_adapter(self, name: str = ..., *args, **kwargs) -> Any: ... - def get_auth(self, name: str = ..., *args, **kwargs) -> Any: ... - def get_connection(self, socket: Any) -> Connection: ... - def _pending(self, connection: Connection) -> Any: ... - def _notifies(self) -> int: ... - def _delays(self) -> None: ... - def _generate(self, hashed: bool = ...) -> str: ... - def _connect(self, connection: Connection) -> None: ... - def _connectf(self, connection: Connection) -> None: ... - def _socket_keepalive( - self, - _socket: Any, - timeout: Any | None = ..., - interval: Any | None = ..., - count: Any | None = ... - ) -> None: ... - def _ssl_init(self, strict: bool = ..., env: bool = ...) -> None: ... - def _ssl_destroy(self) -> None: ... - def _ssl_callback(self, socket: Any, hostname: Any, context: Any) -> None: ... - def _ssl_ctx( - self, - values, - context: Any | None = ..., - secure: int = ..., - context_options: list = ..., - ) -> Any: ... - def _ssl_ctx_base(self, context: Any, secure: int = ..., context_options: list = ...) -> None: ... - def _ssl_ctx_protocols(self, context: Any) -> None: ... - def _ssl_ctx_alpn(self, context: Any) -> None: ... - def _ssl_ctx_npn(self, context: Any) -> None: ... - def _ssl_certs( - self, - context: Any, - key_file: Any | None = ..., - cer_file: Any | None = ..., - ca_file: Any | None = ..., - ca_root: bool = False, - verify_mode: Any = ..., - check_hostname: bool = ... - ) -> None: ... - def _ssl_upgrade( - self, - _socket: Any, - key_file: Any | None = ..., - cer_file: Any | None = ..., - ca_file: Any | None = ..., - ca_root: bool = ..., - server: bool = ..., - ssl_verify: bool = ..., - server_hostname: Any | None = ..., - ) -> Any: ... - def _ssl_wrap( - self, - _socket: Any, - key_file: Any | None = ..., - cer_file: Any | None = ..., - ca_file: Any | None = ..., - ca_root: bool = ..., - server: bool = ..., - ssl_verify: bool = ..., - server_hostname: Any | None = ... - ) -> Any: ... - def _ssl_handshake(self, connection: Connection) -> None: ... - def _ssl_client_handshake(self, connection: Connection) -> None: ... - def _expand_destroy(self) -> None: ... - def _level(self, level: Any) -> (Any | int): ... - def _format_delta(self, time_delta, count: int = ...) -> (LiteralString | Any): ... - def _wait_forever(self, sleep: int = ...) -> None: ... - @property - def is_parent(self) -> bool: ... - @property - def is_child(self) -> bool: ... - @property - def is_forked(self) -> bool: ... - -class DiagBase(AbstractBase): - def __init__(self, *args, **kwargs) -> None: ... - def reads(self, *args, **kwargs) -> None: ... - def writes(self, *args, **kwargs) -> None: ... - def errors(self, *args, **kwargs) -> None: ... - def info_dict(self, full: bool = ...) -> dict[str, int]: ... - -class BaseThread(threading.Thread): - def __init__(self, owner: Any | None = ..., daemon: bool = ..., *args, **kwargs) -> None: ... - def run(self) -> None: ... - -def new_loop_main(factory: Any | None = ..., _compat: Any | None = ..., **kwargs) -> (CompatLoop | Any | AbstractBase | DiagBase): ... -def new_loop_asyncio(**kwargs) -> (Any | None): ... -def new_loop(factory: Any | None = ..., _compat: Any | None = ..., asyncio: Any | None = ..., **kwargs) -> (Any | CompatLoop | AbstractBase | DiagBase | None): ... -def ensure_main(factory: Any | None = ..., **kwargs) -> None: ... -def ensure_asyncio(**kwargs) -> None: ... -def ensure_loop(factory: Any | None = ..., asyncio: Any | None = ..., **kwargs) -> None: ... -def get_main(factory: Any | None = ..., ensure: bool = ..., **kwargs) -> (Any | None): ... -def get_loop( - factory: Any | None = ..., - ensure: bool = ..., - _compat: Any | None = ..., - asyncio: Any | None = ..., - **kwargs: Any -) -> (Any | None): ... -def get_event_loop(*args, **kwargs) -> (Any | None): ... -def stop_loop(compat: bool = ..., asyncio: bool = ...) -> None: ... -def compat_loop(loop: Any) -> Any: ... -def get_poll() -> Any: ... -def build_future(compat: bool = ..., asyncio: bool = ...) -> (Any | None): ... -def ensure(coroutine: Any, args, kwargs, thread: Any | None = ...) -> Any: ... -def ensure_pool(coroutine: Any, args, kwargs) -> Any: ... diff --git a/src/netius/base/compat.pyi b/src/netius/base/compat.pyi deleted file mode 100644 index 67bff7c1..00000000 --- a/src/netius/base/compat.pyi +++ /dev/null @@ -1,158 +0,0 @@ -import asyncio.events -import netius.base.asynchronous as asynchronous -import netius.base.config as config -import netius.base.errors as errors -import netius.base.legacy as legacy -import netius.base.transport as transport -import socket - -from typing import Any, Generator, NoReturn - -class CompatLoop(asyncio.events.AbstractEventLoop): - def __init__(self, loop: Any) -> None: ... - def __getattr__(self, name: str) -> Any: ... - def time(self) -> float: ... - def call_soon(self, callback: Any, *args) -> asynchronous.Handle: ... - def call_soon_threadsafe(self, callback: Any, *args) -> asynchronous.Handle: ... - def call_at(self, when, callback: Any, *args) -> asynchronous.Handle: ... - def call_later(self, delay, callback: Any, *args) -> asynchronous.Handle: ... - def create_future(self) -> asynchronous.Future: ... - def create_task(self, coroutine: Any) -> (asynchronous.Task | Any): ... - def create_server(self, *args, **kwargs) -> asynchronous.AwaitWrapper: ... - def create_connection(self, *args, **kwargs) -> asynchronous.AwaitWrapper: ... - def create_datagram_endpoint(self, *args, **kwargs) -> asynchronous.AwaitWrapper: ... - def getaddrinfo(self, *args, **kwargs) -> asynchronous.AwaitWrapper: ... - def getnameinfo(self, *args, **kwargs) -> asynchronous.AwaitWrapper: ... - def run_until_complete(self, future: Any) -> Any: ... - def run_forever(self) -> Any: ... - def run_in_executor(self, *args, **kwargs) -> asynchronous.AwaitWrapper: ... - def stop(self) -> None: ... - def close(self) -> None: ... - def get_exception_handler(self) -> Any: ... - def set_exception_handler(self, handler: Any) -> None: ... - def default_exception_handler(self, context: dict) -> Any: ... - def call_exception_handler(self, context: dict) -> (Any | None): ... - def get_debug(self) -> Any: ... - def set_debug(self, enabled: Any) -> None: ... - def set_default_executor(self, executor: asynchronous.Executor) -> None: ... - def get_task_factory(self): ... - def set_task_factory(self, factory: asynchronous.Task) -> None: ... - def is_running(self) -> bool: ... - def is_closed(self) -> bool: ... - def _getaddrinfo( - self, - host: Any, - port: Any, - family: int = ..., - type: int = ..., - proto: int = ..., - flags: int = ... - ) -> Generator[Any, Any, None]: ... - def _getnameinfo(self, sockaddr: Any, flags: int = ...) -> NoReturn: ... - def _run_in_executor(self, executor: asynchronous.Executor, func, *args) -> Generator[Any, Any, None] ... - def _create_connection( - self, - protocol_factory: Any, - host: Any | None = ..., - port: Any | None = ..., - ssl: Any | None = ..., - family: int = ..., - proto: int = ..., - flags: int = ..., - sock: Any | None = ..., - local_addr: Any | None = ..., - server_hostname: Any | None = ..., - *args, - **kwargs - ) -> Generator[Any, Any, None]: ... - def _create_datagram_endpoint( - self, - protocol_factory: Any, - local_addr: Any | None = ..., - remote_addr: Any | None = ..., - family: int = ..., - proto: int = ..., - flags: int = ..., - reuse_address: Any | None = ..., - reuse_port: Any | None = ..., - allow_broadcast: Any | None = ..., - sock: Any | None = ..., - *args: Any, - **kwargs: Any - ) -> Generator[Any, Any, None]: ... - def _set_current_task(self, task: asynchronous.Task) -> None: ... - def _unset_current_task(self) -> None: ... - def _call_delay( - self, - callback, - args, - timeout: Any | None = ..., - immediately: bool = ..., - verify: bool = ..., - safe: bool = ..., - ) -> asynchronous.Handle: ... - def _sleep(self, timeout, future: asynchronous.Future | None = ...) -> asynchronous.Future: ... - def _default_handler(self, context: dict) -> None: ... - @property - def _thread_id(self) -> int: ... - -def is_compat() -> bool: ... -def is_asyncio() -> bool: ... -def build_datagram(*args, **kwargs) -> (Any | None) : ... -def connect_stream(*args, **kwargs) -> (Any | None) : ... -def _build_datagram_native( - protocol_factory: ..., - family: socket.AddressFamily = ..., - type: socket.SocketKind = ..., - remote_host: Any | None = ..., - remote_port: Any | None = ..., - callback: Any | None = ..., - loop: Any | None = ..., - *args, - **kwargs -) -> (Any | None): ... -def _build_datagram_compat( - protocol_factory: Any, - family: socket.AddressFamily = ..., - type: socket.SocketKind = ..., - remote_host: Any | None = ..., - remote_port: Any | None = ..., - callback: Any | None = ..., - loop: Any | None = ..., - *args, - **kwargs -) -> (Any | None): ... -def _connect_stream_native( - protocol_factory: Any, - host: Any, - port: Any, - ssl: bool = ..., - key_file: Any | None = ..., - cer_file: Any | None = ..., - ca_file: Any | None = ..., - ca_root: bool = ..., - ssl_verify: bool = ..., - family: socket.AddressFamily = ..., - type: socket.SocketKind = ..., - callback: Any | None = ..., - loop: Any | None = ..., - *args, - **kwargs -) -> (Any | None): ... -def _connect_stream_compat( - protocol_factory: Any, - host: Any, - port: Any, - ssl: bool = ..., - key_file: Any | None = ..., - cer_file: Any | None = ..., - ca_file: Any | None = ..., - ca_root: bool = ..., - ssl_verify: bool = ..., - family: socket.AddressFamily = ..., - type: socket.SocketKind = ..., - callback: Any | None = ..., - loop: Any | None = ..., - *args: Any, - **kwargs: Any -) -> (Any | None): ... diff --git a/src/netius/base/config.pyi b/src/netius/base/config.pyi deleted file mode 100644 index c65cb183..00000000 --- a/src/netius/base/config.pyi +++ /dev/null @@ -1,54 +0,0 @@ -import netius.base.legacy as legacy - -from typing import Any - -FILE_NAME: str -FILE_TEMPLATE: str -HOME_FILE: str -IMPORT_NAMES: tuple[str] -CASTS: dict -ENV_ENCODINGS: tuple[str] -CONFIGS: dict -CONFIG_F: list -HOMES: list - -def conf( - name: Any, - default: Any | None = None, - cast: Any | None = None, - ctx: Any | None = None -) -> Any: ... -def conf_prefix(prefix, ctx: dict | None = ...) -> dict: ... -def conf_suffix(suffix, ctx: dict | None = ...) -> dict: ... -def conf_s(name, value, ctx: dict | None = ...) -> None: ... -def conf_r(name, ctx: dict | None = ...) -> None: ... -def conf_d(ctx: dict | None = ...) -> (Any | None): ... -def conf_ctx() -> dict[str, dict]: ... -def load( - names: tuple[str] = ..., - path: str | None = ..., - encoding: str = ..., - ctx: dict | None = ... -) -> None: ... -def load_file( - name: str = ..., - path: str | None = ..., - encoding: str = ..., - ctx: dict | None = ... -) -> None: ... -def load_env(ctx: dict | None = ...) -> None: ... -def get_homes( - file_path: str = ..., - default: str = ..., - encoding: str = ..., - force_default: bool = ... -) -> list[str]: ... -def _cast_r(cast: Any) -> (Any | None): ... -def _load_includes( - base_path: str, - config: dict, - encoding: str = ... -) -> None: ... -def _is_valid(key: str) -> bool: ... -def _is_devel() -> bool: ... -def _is_secure() -> bool: ... diff --git a/src/netius/base/conn.pyi b/src/netius/base/conn.pyi deleted file mode 100644 index e014eb1c..00000000 --- a/src/netius/base/conn.pyi +++ /dev/null @@ -1,80 +0,0 @@ -import netius.base.config as config -import netius.base.legacy as legacy -import netius.base.observer -import netius.base.observer as observer -import netius.base.tls as tls - -from typing import Any, Literal - -OPEN: int -CLOSED: int -PENDING: int -CHUNK_SIZE: int - -class BaseConnection(netius.base.observer.Observable): - def __init__( - self, - owner: Any | None = ..., - socket: Any | None = ..., - address: Any | None = ..., - datagram: bool = ..., - ssl: bool = ..., - max_pending: int = ..., - min_pending: int = ..., - ) -> None: ... - def destroy(self) -> None: ... - def open(self, connect: bool = ...) -> None: ... - def close(self, flush: bool = ..., destroy: bool = ...) -> None: ... - def close_flush(self) -> None: ... - def upgrade(self, key_file: Any | None = ..., cer_file: Any | None = ..., ca_file: Any | None = ..., server: bool = ...) -> None: ... - def set_connecting(self) -> None: ... - def set_connected(self) -> None: ... - def set_upgraded(self) -> None: ... - def set_data(self, data: Any, address: Any | None = ...) -> None: ... - def ensure_write(self, flush: bool = ...) -> (Any | None): ... - def remove_write(self) -> None: ... - def enable_read(self) -> None: ... - def disable_read(self) -> None: ... - def send(self, data: Any, address: Any | None = ..., delay: bool = ..., force: bool = ..., callback: Any | None = ...) -> int: ... - def recv(self, size: int = ..., force: bool = ...) -> (Any | Literal[b""]): ... - def pend(self, data: Any, back: bool = ...) -> None: ... - def restore(self, data: Any, back: bool = ...) -> None: ... - def run_starter(self) -> bool: ... - def end_starter(self) -> None: ... - def add_starter(self, starter: Any, back: bool = ...) -> None: ... - def remove_starter(self, starter: Any) -> None: ... - def info_dict(self, full: bool = ...) -> dict[str, Any | None]: ... - def ssl_certificate(self, binary: bool = ...) -> (Any | None): ... - def ssl_verify_host(self, host: Any | None = ...) -> None: ... - def ssl_verify_fingerprint(self, fingerprint: Any | None = ...) -> None: ... - def ssl_dump_certificate(self, dump: bool = ...) -> None: ... - def ssl_protocol(self) -> (Any | None): ... - def ssl_alpn_protocol(self) -> (Any | None): ... - def ssl_npn_protocol(self) -> (Any | None): ... - def is_open(self) -> bool: ... - def is_closed(self) -> bool: ... - def is_pending(self) -> bool: ... - def is_connected(self) -> bool: ... - def is_connecting(self) -> bool: ... - def is_upgrading(self) -> bool: ... - def is_throttleable(self) -> bool: ... - def is_exhausted(self) -> bool: ... - def is_restored(self) -> bool: ... - def is_pending_data(self) -> bool: ... - def _send(self) -> None: ... - def _recv(self, size: Any) -> Any: ... - def _recv_ssl(self, size: Any) -> (Any | bytes): ... - def _recv_restored(self, size: Any) -> (Any | Literal[b""]): ... - def _shutdown(self, close: bool = ..., force: bool = ..., ignore: bool = ...) -> None: ... - def _close_callback(self, connection: Any) -> None: ... - def _flush_write(self) -> None: ... - -class DiagConnection(BaseConnection): - def __init__(self, *args, **kwargs) -> None: ... - def recv(self, *args, **kwargs) -> (Any | Literal[b""]): ... - def send(self, data, *args, **kwargs) -> int: ... - def info_dict(self, full: bool = ...) -> dict[str, Any | None]: ... - def _uptime(self) -> Any: ... - def _resolve(self, address) -> (Any | None): ... - -is_diag: bool diff --git a/src/netius/base/container.pyi b/src/netius/base/container.pyi deleted file mode 100644 index e468719e..00000000 --- a/src/netius/base/container.pyi +++ /dev/null @@ -1,152 +0,0 @@ -import netius as netius -import netius.base.async_old as async_old -import netius.base.asynchronous as asynchronous -import netius.base.common -import netius.base.compat as compat -import netius.base.config as config -import netius.base.errors as errors -import netius.base.legacy as legacy -import netius.base.log as log -import netius.base.observer as observer -import netius.base.server -import netius.base.server as server -import netius.base.tls as tls -import netius.base.util as util -import netius.middleware as middleware -from netius.base.async_neo import ( - AwaitWrapper as AwaitWrapper, - CoroutineWrapper as CoroutineWrapper, - Future as Future, - coroutine as coroutine, - coroutine_return as coroutine_return, - ensure_generator as ensure_generator, - get_asyncio as get_asyncio, - is_coroutine as is_coroutine, - is_coroutine_native as is_coroutine_native, - is_coroutine_object as is_coroutine_object, - is_future as is_future, - sleep as sleep, - wait as wait, -) -from netius.base.async_old import ( - Executor as Executor, - Handle as Handle, - Task as Task, - ThreadPoolExecutor as ThreadPoolExecutor, - async_test as async_test, - async_test_all as async_test_all, - is_asynclib as is_asynclib, - is_await as is_await, - is_neo as is_neo, - notify as notify, - wakeup as wakeup, -) -from netius.base.common import ( - AbstractBase as AbstractBase, - Base as Base, - BaseThread as BaseThread, - DiagBase as DiagBase, - build_future as build_future, - compat_loop as compat_loop, - ensure as ensure, - ensure_asyncio as ensure_asyncio, - ensure_loop as ensure_loop, - ensure_main as ensure_main, - ensure_pool as ensure_pool, - get_event_loop as get_event_loop, - get_loop as get_loop, - get_main as get_main, - get_poll as get_poll, - new_loop as new_loop, - new_loop_asyncio as new_loop_asyncio, - new_loop_main as new_loop_main, - stop_loop as stop_loop, -) -from netius.base.conn import ( - BaseConnection as BaseConnection, - Connection as Connection, - DiagConnection as DiagConnection, -) -from netius.base.poll import ( - EpollPoll as EpollPoll, - KqueuePoll as KqueuePoll, - Poll as Poll, - PollPoll as PollPoll, - SelectPoll as SelectPoll, -) - -from typing import Any - -OPEN: int -CLOSED: int -PENDING: int -CHUNK_SIZE: int -is_diag: bool -POLL_TIMEOUT: float -NAME: str -VERSION: str -PLATFORM: str -IDENTIFIER_TINY: str -IDENTIFIER_SHORT: str -IDENTIFIER_LONG: str -IDENTIFIER: str -WSAEWOULDBLOCK: int -WSAECONNABORTED: int -WSAECONNRESET: int -SSL_ERROR_CERT_ALREADY_IN_HASH_TABLE: int -POLL_ORDER: tuple -SILENT_ERRORS: tuple -VALID_ERRORS: tuple -SSL_SILENT_ERRORS: tuple -SSL_VALID_ERRORS: tuple -SSL_ERROR_NAMES: dict -SSL_VALID_REASONS: tuple -TCP_TYPE: int -UDP_TYPE: int -STATE_STOP: int -STATE_START: int -STATE_PAUSE: int -STATE_CONFIG: int -STATE_POLL: int -STATE_TICK: int -STATE_READ: int -STATE_WRITE: int -STATE_ERRROR: int -STATE_STRINGS: tuple -KEEPALIVE_TIMEOUT: int -KEEPALIVE_INTERVAL: int -KEEPALIVE_COUNT: int -ALLOW_BLOCK: bool -LOG_FORMAT: str -BASE_PATH: str -EXTRAS_PATH: str -SSL_KEY_PATH: str -SSL_CER_PATH: str -SSL_CA_PATH: None -SSL_DH_PATH: str - -class Container(netius.base.common.AbstractBase): - def __init__(self, *args, **kwargs) -> None: ... - def start(self, owner: Any) -> None: ... - def cleanup(self) -> None: ... - def loop(self) -> None: ... - def ticks(self) -> None: ... - def connections_dict(self, full: bool = ...) -> dict: ... - def connection_dict(self, id, full: bool = ...) -> dict | None: ... - def on_start(self) -> None: ... - def on_stop(self) -> None: ... - def add_base(self, base: Any) -> None: ... - def remove_base(self, base: Any) -> None: ... - def start_base(self, base: Any): ... - def start_all(self) -> None: ... - def apply_all(self) -> None: ... - def apply_base(self, base: Any) -> None: ... - def call_all(self, name: str, *args, **kwargs) -> None: ... - def trigger_all(self, name: str, *args, **kwargs) -> None: ... - -class ContainerServer(netius.base.server.StreamServer): - def __init__(self, *args, **kwargs) -> None: ... - def start(self) -> None: ... - def stop(self) -> None: ... - def cleanup(self) -> None: ... - def add_base(self, base: str) -> None: ... diff --git a/src/netius/base/diag.pyi b/src/netius/base/diag.pyi deleted file mode 100644 index 6182cfe2..00000000 --- a/src/netius/base/diag.pyi +++ /dev/null @@ -1,9 +0,0 @@ -import netius as netius -import netius.mock.appier -import netius.mock.appier as appier - -loaded: bool - -class DiagApp(netius.mock.appier.APIApp): - - def __init__(self, system, *args, **kwargs) -> None: ... diff --git a/src/netius/base/errors.pyi b/src/netius/base/errors.pyi deleted file mode 100644 index 689b2f12..00000000 --- a/src/netius/base/errors.pyi +++ /dev/null @@ -1,22 +0,0 @@ -from uuid import UUID -from typing import Any - -class NetiusError(Exception): - def __init__(self, *args, **kwargs) -> None: ... - def get_kwarg(self, name: str, default: Any | None = ...): ... - @property - def uid(self) -> UUID: ... - -class RuntimeError(NetiusError): ... -class StopError(RuntimeError): ... -class PauseError(RuntimeError): ... -class WakeupError(RuntimeError): ... -class DataError(RuntimeError): ... - -class ParserError(RuntimeError): - def __init__(self, *args, **kwargs) -> None: ... - -class GeneratorError(RuntimeError): ... -class SecurityError(RuntimeError): ... -class NotImplemented(RuntimeError): ... -class AssertionError(RuntimeError): ... diff --git a/src/netius/base/legacy.pyi b/src/netius/base/legacy.pyi deleted file mode 100644 index 60d89f4b..00000000 --- a/src/netius/base/legacy.pyi +++ /dev/null @@ -1,68 +0,0 @@ -from legacy import ArgSpec - -from typing import Any, AnyStr, Iterable, Literal, LiteralString, OpenerDirector, ParseResult, ModuleType - -PYTHON_3: bool -PYTHON_35: bool -PYTHON_36: bool -PYTHON_39: bool -PYTHON_ASYNC: bool -PYTHON_ASYNC_GEN: bool -PYTHON_V: int -OLD_UNICODE: None -STRINGS: tuple -ALL_STRINGS: tuple -INTEGERS: tuple - -def with_meta(meta: Any, *bases: Any) -> None: ... -def eager(iterable: Iterable[Any]) -> list: ... -def iteritems(associative: dict) -> Iterable[tuple]: ... -def iterkeys(associative: dict) -> Iterable: ... -def itervalues(associative: dict) -> Iterable: ... -def items(associative: dict) -> list[tuple]: ... -def keys(associative: dict) -> list: ... -def values(associative: dict) -> list: ... -def xrange(start: int, stop: int = ..., step: int = ...) -> Iterable[int]: ... -def range(start: int, stop: int = ..., step: int = ...) -> list[int]: ... -def ord(value: str) -> int: ... -def chr(value: int) -> str: ... -def chri(value: int) -> str: ... -def bytes(value: Any, encoding: str = ..., errors: str = ..., force: bool = ...) -> bytes: ... -def str(value: Any, encoding: str = ..., errors: str = ..., force: bool = ...) -> str: ... -def u(value: Any, encoding: str = ..., errors: str = ..., force: bool = ...) -> str: ... -def ascii(value: Any, encoding: str = ..., errors: str = ...) -> str: ... -def orderable(value: Any) -> Orderable: ... -def is_str(value: Any) -> bool: ... -def is_unicode(value: Any) -> bool: ... -def is_bytes(value: Any) -> bool: ... -def is_string(value: Any, all: bool = ...) -> bool: ... -def is_generator(value: Any) -> bool: ... -def is_async_generator(value: Any) -> bool: ... -def is_unittest(name: str = ...) -> bool: ... -def execfile(path: str, global_vars: dict, local_vars: dict = ..., encoding: str = ...) -> None: ... -def walk(path: str, visit: Any, arg: Any) -> None: ... -def getargspec(func: Any) -> ArgSpec: ... -def has_module(name: str) -> bool: ... -def new_module(name: str) -> (ModuleType | Any): ... -def reduce(*args, **kwargs) -> (Any | object): ... -def reload(*args, **kwargs) -> ModuleType: ... -def unichr(*args, **kwargs) -> str: ... -def urlopen(*args, **kwargs) -> (Any | None): ... -def build_opener(*args, **kwargs) -> OpenerDirector: ... -def urlparse(*args, **kwargs) -> (Any | ParseResult): ... -def urlunparse(*args, **kwargs) -> (bytes | Any | LiteralString | Literal['']): ... -def parse_qs(*args, **kwargs) -> dict[AnyStr@parse_qs, list[AnyStr@parse_qs]]: ... -def urlencode(*args, **kwargs) -> str: ... -def quote(*args, **kwargs) -> str: ... -def quote_plus(*args, **kwargs) -> str: ... -def unquote(*args, **kwargs) -> str: ... -def unquote_plus(*args, **kwargs) -> str: ... -def cmp_to_key(*args, **kwargs) -> dict: ... -def tobytes(self, *args, **kwargs) -> bytes: ... -def tostring(self, *args, **kwargs) -> str: ... -def StringIO(*args, **kwargs) -> StringIO: ... -def BytesIO(*args, **kwargs) -> BytesIO: ... - -class Orderable(tuple): - def __cmp__(self, value: tuple) -> int: ... - def __lt__(self, value: tuple) -> bool: ... diff --git a/src/netius/base/log.pyi b/src/netius/base/log.pyi deleted file mode 100644 index 83729e70..00000000 --- a/src/netius/base/log.pyi +++ /dev/null @@ -1,25 +0,0 @@ -from logging.handlers import RotatingFileHandler, SMTPHandler - -SILENT: int - -def rotating_handler( - path: str = ..., - max_bytes: int = ..., - max_log: int = ..., - encoding: str | None = ..., - delay: bool = ... -) -> RotatingFileHandler: ... -def smtp_handler( - host: str = ..., - port: int = ..., - sender: str = ..., - receivers: list[str] = [], - subject: str = ..., - username: str | None = ..., - password: str | None = ..., - stls: bool = ... -) -> SMTPHandler: ... -def in_signature( - callable: object, - name: str -) -> bool: ... diff --git a/src/netius/base/observer.pyi b/src/netius/base/observer.pyi deleted file mode 100644 index 85c9579f..00000000 --- a/src/netius/base/observer.pyi +++ /dev/null @@ -1,8 +0,0 @@ -class Observable: - def __init__(self, *args, **kwargs) -> None: ... - def build(self) -> None: ... - def destroy(self) -> None: ... - def bind(self, name: str, method: str, oneshot: bool = ...) -> None: ... - def unbind(self, name: str, method: str | None = ...) -> None: ... - def unbind_all(self) -> None: ... - def trigger(self, name: str, *args, **kwargs) -> None: ... diff --git a/src/netius/base/poll.pyi b/src/netius/base/poll.pyi deleted file mode 100644 index a792709e..00000000 --- a/src/netius/base/poll.pyi +++ /dev/null @@ -1,86 +0,0 @@ -from typing import Any - -POLL_TIMEOUT: float - -class Poll: - def __init__(self) -> None: ... - @classmethod - def name(cls) -> str: ... - @classmethod - def test(cls) -> bool: ... - def open(self, timeout: float = ...) -> None: ... - def close(self) -> None: ... - def poll(self) -> tuple[list, list, list]: ... - def poll_owner(self) -> dict: ... - def is_open(self) -> bool: ... - def is_edge(self) -> bool: ... - def is_empty(self) -> bool: ... - def sub_all(self, socket, owner: Any | None = ...) -> None: ... - def unsub_all(self, socket) -> None: ... - def is_sub_read(self, socket) -> bool: ... - def is_sub_write(self, socket) -> bool: ... - def is_sub_error(self, socket) -> bool: ... - def sub_read(self, socket, owner: Any | None = ...) -> None: ... - def sub_write(self, socket, owner: Any | None = ...) -> None: ... - def sub_error(self, socket, owner: Any | None = ...) -> None: ... - def unsub_read(self, socket) -> None: ... - def unsub_write(self, socket) -> None: ... - def unsub_error(self, socket) -> None: ... - -class EpollPoll(Poll): - def __init__(self, *args, **kwargs) -> None: ... - @classmethod - def test(cls) -> bool: ... - def open(self, timeout: float = ...) -> None: ... - def close(self) -> None: ... - def poll(self) -> tuple[list, list, list]: ... - def is_edge(self) -> bool: ... - def sub_read(self, socket, owner: Any | None = ...) -> None: ... - def sub_write(self, socket, owner: Any | None = ...) -> None: ... - def sub_error(self, socket, owner: Any | None = ...) -> None: ... - def unsub_read(self, socket) -> None: ... - def unsub_write(self, socket) -> None: ... - def unsub_error(self, socket) -> None: ... - -class KqueuePoll(Poll): - def __init__(self, *args, **kwargs) -> None: ... - @classmethod - def test(cls) -> bool: ... - def open(self, timeout: float = ...) -> None: ... - def close(self) -> None: ... - def poll(self) -> tuple[list, list, list]: ... - def is_edge(self) -> bool: ... - def sub_read(self, socket, owner: Any | None = ...) -> None: ... - def sub_write(self, socket, owner: Any | None = ...) -> None: ... - def sub_error(self, socket, owner: Any | None = ...) -> None: ... - def unsub_read(self, socket) -> None: ... - def unsub_write(self, socket) -> None: ... - def unsub_error(self, socket) -> None: ... - -class PollPoll(Poll): - def __init__(self, *args, **kwargs) -> None: ... - @classmethod - def test(cls) -> bool: ... - def open(self, timeout: float = ...) -> None: ... - def close(self) -> None: ... - def poll(self) -> tuple[list, list, list]: ... - def is_edge(self) -> bool: ... - def sub_read(self, socket, owner: Any | None = ...) -> None: ... - def sub_write(self, socket, owner: Any | None = ...) -> None: ... - def sub_error(self, socket, owner: Any | None = ...) -> None: ... - def unsub_read(self, socket) -> None: ... - def unsub_write(self, socket) -> None: ... - def unsub_error(self, socket) -> None: ... - -class SelectPoll(Poll): - def __init__(self, *args, **kwargs) -> None: ... - def open(self, timeout: float = ...) -> None: ... - def close(self) -> None: ... - def poll(self) -> tuple[list, list, list]: ... - def is_edge(self) -> bool: ... - def sub_read(self, socket, owner: Any | None = ...) -> None: ... - def sub_write(self, socket, owner: Any | None = ...) -> None: ... - def sub_error(self, socket, owner: Any | None = ...) -> None: ... - def unsub_read(self, socket) -> None: ... - def unsub_write(self, socket) -> None: ... - def unsub_error(self, socket) -> None: ...