diff --git a/src/typings/netius/__init__.pyi b/src/typings/netius/__init__.pyi new file mode 100644 index 00000000..1f0cc827 --- /dev/null +++ b/src/typings/netius/__init__.pyi @@ -0,0 +1,57 @@ +from . import adapters as adapters, auth as auth, middleware as middleware, pool as pool +from .adapters import fs as fs, mongo as mongo, null as null +from .auth import address as address, allow as allow, base as base, deny as deny, dummy as dummy, memory as memory, passwd as passwd, simple as simple +from .base import agent as agent, async_neo as async_neo, async_old as async_old, asynchronous as asynchronous, client as client, common as common, compat as compat, config as config, conn as conn, container as container, errors as errors, legacy as legacy, log as log, observer as observer, poll as poll, protocol as protocol, request as request, server as server, stream as stream, tls as tls, transport as transport, util as util +from netius.adapters.base import BaseAdapter as BaseAdapter +from netius.adapters.fs import FsAdapter as FsAdapter +from netius.adapters.memory import MemoryAdapter as MemoryAdapter +from netius.adapters.mongo import MongoAdapter as MongoAdapter +from netius.adapters.null import NullAdapter as NullAdapter +from netius.auth.address import AddressAuth as AddressAuth +from netius.auth.allow import AllowAuth as AllowAuth +from netius.auth.base import Auth as Auth +from netius.auth.deny import DenyAuth as DenyAuth +from netius.auth.dummy import DummyAuth as DummyAuth +from netius.auth.memory import MemoryAuth as MemoryAuth +from netius.auth.passwd import PasswdAuth as PasswdAuth +from netius.auth.simple import SimpleAuth as SimpleAuth +from netius.base.agent import Agent as Agent, ClientAgent as ClientAgent, ServerAgent as ServerAgent +from netius.base.async_neo import 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.client import Client as Client, DatagramClient as DatagramClient, StreamClient as StreamClient +from netius.base.common import Base as Base, BaseThread as BaseThread, 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.compat import CompatLoop as CompatLoop, build_datagram as build_datagram, connect_stream as connect_stream, is_asyncio as is_asyncio, is_compat as is_compat +from netius.base.config import conf as conf, conf_ctx as conf_ctx, conf_d as conf_d, conf_prefix as conf_prefix, conf_r as conf_r, conf_s as conf_s, conf_suffix as conf_suffix +from netius.base.conn import Connection as Connection +from netius.base.container import Container as Container, ContainerServer as ContainerServer +from netius.base.errors import AssertionError as AssertionError, DataError as DataError, GeneratorError as GeneratorError, NetiusError as NetiusError, NotImplemented as NotImplemented, ParserError as ParserError, PauseError as PauseError, RuntimeError as RuntimeError, SecurityError as SecurityError, StopError as StopError, WakeupError as WakeupError +from netius.base.log import rotating_handler as rotating_handler, smtp_handler as smtp_handler +from netius.base.observer import Observable as Observable +from netius.base.poll import EpollPoll as EpollPoll, KqueuePoll as KqueuePoll, Poll as Poll, PollPoll as PollPoll, SelectPoll as SelectPoll +from netius.base.protocol import DatagramProtocol as DatagramProtocol, Protocol as Protocol, StreamProtocol as StreamProtocol +from netius.base.request import Request as Request, Response as Response +from netius.base.server import DatagramServer as DatagramServer, Server as Server, StreamServer as StreamServer +from netius.base.stream import Stream as Stream +from netius.base.tls import dnsname_match as dnsname_match, dump_certificate as dump_certificate, fingerprint as fingerprint, match_fingerprint as match_fingerprint, match_hostname as match_hostname +from netius.base.transport import Transport as Transport, TransportDatagram as TransportDatagram, TransportStream as TransportStream +from netius.base.util import camel_to_underscore as camel_to_underscore, verify as verify + +__version__: str +__revision__: str +__date__: str +NAME: str +VERSION: str +IDENTIFIER_SHORT: str +IDENTIFIER_LONG: str +IDENTIFIER: str +TCP_TYPE: int +UDP_TYPE: int +SSL_KEY_PATH: str +SSL_CER_PATH: str +SSL_CA_PATH: None +SSL_DH_PATH: str +OPEN: int +CLOSED: int +PENDING: int +CHUNK_SIZE: int +SILENT: int diff --git a/src/typings/netius/adapters/__init__.pyi b/src/typings/netius/adapters/__init__.pyi new file mode 100644 index 00000000..a115a1d6 --- /dev/null +++ b/src/typings/netius/adapters/__init__.pyi @@ -0,0 +1,6 @@ +from . import base as base, fs as fs, memory as memory, mongo as mongo, null as null +from netius.adapters.base import BaseAdapter as BaseAdapter +from netius.adapters.fs import FsAdapter as FsAdapter +from netius.adapters.memory import MemoryAdapter as MemoryAdapter +from netius.adapters.mongo import MongoAdapter as MongoAdapter +from netius.adapters.null import NullAdapter as NullAdapter diff --git a/src/typings/netius/adapters/base.pyi b/src/typings/netius/adapters/base.pyi new file mode 100644 index 00000000..15ce5038 --- /dev/null +++ b/src/typings/netius/adapters/base.pyi @@ -0,0 +1,17 @@ +import netius as netius +from typing import Any + +class BaseAdapter: + def set(self, value: Any, owner: str = ...) -> None: ... + def get(self, key: str) -> str | netius.legacy.StringIO: ... + def get_file(self, key: str, mode: str = ...) -> netius.legacy.StringIO: ... + def delete(self, key: str, owner: str = ...): ... + def append(self, key:str , value: Any) -> None: ... + def truncate(self, key:str , count: int) -> None: ... + def size(self, key:str ) -> int: ... + def sizes(self, owner: str | None = ...) -> list[int]: ... + def total(self, owner: str | None = ...) -> int: ... + def reserve(self, owner: str = ...) -> None: ... + def count(self, owner: str | None = ...) -> int: ... + def list(self, owner: str | None = ...) -> tuple[()]: ... + def generate(self) -> str: ... diff --git a/src/typings/netius/adapters/fs.pyi b/src/typings/netius/adapters/fs.pyi new file mode 100644 index 00000000..dc8e04e1 --- /dev/null +++ b/src/typings/netius/adapters/fs.pyi @@ -0,0 +1,17 @@ +import netius as netius +import netius.adapters.base +import netius.adapters.base as base +from typing import StrOrBytesPath +from typing import Any + +class FsAdapter(netius.adapters.base.BaseAdapter): + def __init__(self, base_path: str | None = ...) -> None: ... + def set(self, value: Any, owner: str = ...) -> str: ... + def get_file(self, key: str, mode: str = ...) -> netius.legacy.StringIO: ... + def delete(self, key: str, owner: str = ...) -> None: ... + def size(self, key:str ) -> int: ... + def count(self, owner: str | None = ...) -> int: ... + def list(self, owner: str | None = ...) -> list[str]: ... + def _path(self, owner: str | None = ...) -> str: ... + def _ensure(self, owner: str) -> str: ... + def _symlink(self, source: StrOrBytesPath, target: StrOrBytesPath) -> None: ... diff --git a/src/typings/netius/adapters/memory.pyi b/src/typings/netius/adapters/memory.pyi new file mode 100644 index 00000000..45d03412 --- /dev/null +++ b/src/typings/netius/adapters/memory.pyi @@ -0,0 +1,17 @@ +import netius as netius +import netius.adapters.base +import netius.adapters.base as base +from typing import Any + +class MemoryAdapter(netius.adapters.base.BaseAdapter): + def __init__(self) -> None: ... + def set(self, value, owner: str = ...) -> str: ... + def get_file(self, key: str, mode: str = ...) -> netius.legacy.StringIO: ... + def delete(self, key: str, owner: str = ...) -> None: ... + def append(self, key: str, value: Any) -> None: ... + def truncate(self, key: str, count: int) -> None: ... + def size(self, key: str) -> int: ... + def count(self, owner: str | None = ...) -> int: ... + def list(self, owner: str | None = ...) -> tuple[()]: ... + def _ensure(self, owner: str) -> dict: ... + def _build_close(self, file: netius.legacy.StringIO, key: str) -> function: ... diff --git a/src/typings/netius/adapters/mongo.pyi b/src/typings/netius/adapters/mongo.pyi new file mode 100644 index 00000000..872a8e3a --- /dev/null +++ b/src/typings/netius/adapters/mongo.pyi @@ -0,0 +1,6 @@ +import netius.adapters.base +import netius.adapters.base as base + +class MongoAdapter(netius.adapters.base.BaseAdapter): + def set(self, value, owner: str = ...): ... + def get(self, key): ... diff --git a/src/typings/netius/adapters/null.pyi b/src/typings/netius/adapters/null.pyi new file mode 100644 index 00000000..694650d5 --- /dev/null +++ b/src/typings/netius/adapters/null.pyi @@ -0,0 +1,4 @@ +import netius.adapters.base +import netius.adapters.base as base + +class NullAdapter(netius.adapters.base.BaseAdapter): ... diff --git a/src/typings/netius/auth/__init__.pyi b/src/typings/netius/auth/__init__.pyi new file mode 100644 index 00000000..5b644853 --- /dev/null +++ b/src/typings/netius/auth/__init__.pyi @@ -0,0 +1,13 @@ +from . import address as address, allow as allow, base as base, deny as deny, dummy as dummy, memory as memory, passwd as passwd, simple as simple +from netius.auth.address import AddressAuth as AddressAuth +from netius.auth.allow import AllowAuth as AllowAuth +from netius.auth.base import Auth as Auth +from netius.auth.deny import DenyAuth as DenyAuth +from netius.auth.dummy import DummyAuth as DummyAuth +from netius.auth.memory import MemoryAuth as MemoryAuth +from netius.auth.passwd import PasswdAuth as PasswdAuth +from netius.auth.simple import SimpleAuth as SimpleAuth + +__version__: str +__revision__: str +__date__: str diff --git a/src/typings/netius/auth/address.pyi b/src/typings/netius/auth/address.pyi new file mode 100644 index 00000000..c63bc74d --- /dev/null +++ b/src/typings/netius/auth/address.pyi @@ -0,0 +1,11 @@ +import netius.auth.base +import netius.auth.base as base +from typing import Literal + +class AddressAuth(netius.auth.base.Auth): + def __init__(self, allowed: list = ..., *args, **kwargs) -> None: ... + @classmethod + def auth(cls, allowed: list = ..., *args, **kwargs) -> bool: ... + @classmethod + def is_simple(cls) -> Literal[True]: ... + def auth_i(self, *args, **kwargs): ... diff --git a/src/typings/netius/auth/allow.pyi b/src/typings/netius/auth/allow.pyi new file mode 100644 index 00000000..99bfebfb --- /dev/null +++ b/src/typings/netius/auth/allow.pyi @@ -0,0 +1,9 @@ +import netius.auth.base +import netius.auth.base as base +from typing import Literal + +class AllowAuth(netius.auth.base.Auth): + @classmethod + def auth(cls, *args, **kwargs) -> Literal[True]: ... + @classmethod + def is_simple(cls) -> Literal[True]: ... diff --git a/src/typings/netius/auth/base.pyi b/src/typings/netius/auth/base.pyi new file mode 100644 index 00000000..a3415788 --- /dev/null +++ b/src/typings/netius/auth/base.pyi @@ -0,0 +1,24 @@ +import netius as netius +from typing import NoReturn, Any, Unbound, Literal, PathLike + +class Auth: + def __init__(self, *args, **kwargs) -> None: ... + @classmethod + def auth(cls, *args, **kwargs) -> NoReturn: ... + @classmethod + def meta(cls, *args, **kwargs) -> dict: ... + @classmethod + def auth_assert(cls, *args, **kwargs) -> None: ... + @classmethod + def verify(cls, encoded: str, decoded: str) -> bool: ... + @classmethod + def generate(cls, password: str, type: str = ..., salt: str = ...) -> str: ... + @classmethod + def unpack(cls, password) -> tuple[Any | Literal["plain"], bytes | Any | str | None, Any | None, Unbound | Any | None]: ... + @classmethod + def get_file(cls, path: PathLike[str], cache: bool = ..., encoding: str | None = ...) -> (Any | str | bytes): ... + @classmethod + def is_simple(cls) -> Literal[False]: ... + def auth_i(self, *args, **kwargs) -> NoReturn: ... + def auth_assert_i(self, *args, **kwargs) -> None: ... + def is_simple_i(self) -> Literal[False]: ... diff --git a/src/typings/netius/auth/deny.pyi b/src/typings/netius/auth/deny.pyi new file mode 100644 index 00000000..daf93966 --- /dev/null +++ b/src/typings/netius/auth/deny.pyi @@ -0,0 +1,10 @@ +import netius.auth.base +import netius.auth.base as base + +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]: ... diff --git a/src/typings/netius/auth/dummy.pyi b/src/typings/netius/auth/dummy.pyi new file mode 100644 index 00000000..80d2b12f --- /dev/null +++ b/src/typings/netius/auth/dummy.pyi @@ -0,0 +1,11 @@ +import netius.auth.base +import netius.auth.base as base +from typing import Literal + +class DummyAuth(netius.auth.base.Auth): + def __init__(self, value: bool = ..., *args, **kwargs) -> None: ... + @classmethod + def auth(cls, value: bool = ..., *args, **kwargs): ... + @classmethod + def is_simple(cls) -> Literal[True]: ... + def auth_i(self, *args, **kwargs) -> bool: ... diff --git a/src/typings/netius/auth/memory.pyi b/src/typings/netius/auth/memory.pyi new file mode 100644 index 00000000..a7cd5a23 --- /dev/null +++ b/src/typings/netius/auth/memory.pyi @@ -0,0 +1,19 @@ +import netius as netius +import netius.auth.base +import netius.auth.base as base + +from typing import Dict + +class MemoryAuth(netius.auth.base.Auth): + def __init__(self, registry: Dict | None = ..., *args, **kwargs) -> None: ... + @classmethod + def auth( + cls, username: str, password: str, registry: dict | None = ..., *args, **kwargs + ): ... + @classmethod + def meta(cls, username: str, registry: Dict | None = ..., *args, **kwargs) -> Dict: ... + @classmethod + def get_registry(cls): ... + @classmethod + def load_registry(cls): ... + def auth_i(self, username: str, password: str, *args, **kwargs) -> bool: ... diff --git a/src/typings/netius/auth/passwd.pyi b/src/typings/netius/auth/passwd.pyi new file mode 100644 index 00000000..a87f15e5 --- /dev/null +++ b/src/typings/netius/auth/passwd.pyi @@ -0,0 +1,12 @@ +import netius.auth.base +import netius.auth.base as base + +from typing import PathLike, Any, Dict + +class PasswdAuth(netius.auth.base.Auth): + def __init__(self, path: PathLike[str] | None = ..., *args, **kwargs) -> None: ... + @classmethod + 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 auth_i(self, username: str, password: str, *args, **kwargs) -> bool: ... diff --git a/src/typings/netius/auth/simple.pyi b/src/typings/netius/auth/simple.pyi new file mode 100644 index 00000000..a7f4a0a6 --- /dev/null +++ b/src/typings/netius/auth/simple.pyi @@ -0,0 +1,9 @@ +import netius.auth.base +import netius.auth.base as base +from typing import Tuple + +class SimpleAuth(netius.auth.base.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: ... diff --git a/src/typings/netius/base/__init__.pyi b/src/typings/netius/base/__init__.pyi new file mode 100644 index 00000000..b2dfc947 --- /dev/null +++ b/src/typings/netius/base/__init__.pyi @@ -0,0 +1,41 @@ +from . import agent as agent, async_neo as async_neo, async_old as async_old, asynchronous as asynchronous, client as client, common as common, compat as compat, config as config, conn as conn, container as container, errors as errors, legacy as legacy, log as log, observer as observer, poll as poll, protocol as protocol, request as request, server as server, stream as stream, tls as tls, transport as transport, util as util +from netius.base.agent import Agent as Agent, ClientAgent as ClientAgent, ServerAgent as ServerAgent +from netius.base.async_neo import 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.client import Client as Client, DatagramClient as DatagramClient, StreamClient as StreamClient +from netius.base.common import Base as Base, BaseThread as BaseThread, 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.compat import CompatLoop as CompatLoop, build_datagram as build_datagram, connect_stream as connect_stream, is_asyncio as is_asyncio, is_compat as is_compat +from netius.base.config import conf as conf, conf_ctx as conf_ctx, conf_d as conf_d, conf_prefix as conf_prefix, conf_r as conf_r, conf_s as conf_s, conf_suffix as conf_suffix +from netius.base.conn import Connection as Connection +from netius.base.container import Container as Container, ContainerServer as ContainerServer +from netius.base.errors import AssertionError as AssertionError, DataError as DataError, GeneratorError as GeneratorError, NetiusError as NetiusError, NotImplemented as NotImplemented, ParserError as ParserError, PauseError as PauseError, RuntimeError as RuntimeError, SecurityError as SecurityError, StopError as StopError, WakeupError as WakeupError +from netius.base.log import rotating_handler as rotating_handler, smtp_handler as smtp_handler +from netius.base.observer import Observable as Observable +from netius.base.poll import EpollPoll as EpollPoll, KqueuePoll as KqueuePoll, Poll as Poll, PollPoll as PollPoll, SelectPoll as SelectPoll +from netius.base.protocol import DatagramProtocol as DatagramProtocol, Protocol as Protocol, StreamProtocol as StreamProtocol +from netius.base.request import Request as Request, Response as Response +from netius.base.server import DatagramServer as DatagramServer, Server as Server, StreamServer as StreamServer +from netius.base.stream import Stream as Stream +from netius.base.tls import dnsname_match as dnsname_match, dump_certificate as dump_certificate, fingerprint as fingerprint, match_fingerprint as match_fingerprint, match_hostname as match_hostname +from netius.base.transport import Transport as Transport, TransportDatagram as TransportDatagram, TransportStream as TransportStream +from netius.base.util import camel_to_underscore as camel_to_underscore, verify as verify + +__version__: str +__revision__: str +__date__: str +NAME: str +VERSION: str +IDENTIFIER_SHORT: str +IDENTIFIER_LONG: str +IDENTIFIER: str +TCP_TYPE: int +UDP_TYPE: int +SSL_KEY_PATH: str +SSL_CER_PATH: str +SSL_CA_PATH: None +SSL_DH_PATH: str +OPEN: int +CLOSED: int +PENDING: int +CHUNK_SIZE: int +SILENT: int diff --git a/src/typings/netius/base/agent.pyi b/src/typings/netius/base/agent.pyi new file mode 100644 index 00000000..2f52cd36 --- /dev/null +++ b/src/typings/netius/base/agent.pyi @@ -0,0 +1,20 @@ +import netius.base.legacy as legacy +import netius.base.observer +import netius.base.observer as observer +from typing import ClassVar, Any, 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/typings/netius/base/async_neo.pyi b/src/typings/netius/base/async_neo.pyi new file mode 100644 index 00000000..858af754 --- /dev/null +++ b/src/typings/netius/base/async_neo.pyi @@ -0,0 +1,45 @@ +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 ClassVar, Any, Generator, Tuple, Union, Callable, Optional, Type, ModuleType + +class Future(netius.base.async_old.Future): + def __iter__(self) -> Future: ... + def __await__(self) -> Generator[None, None, Any]: ... + +class Future: + def __iter__(self) -> Future: ... + def __await__(self) -> Generator[None, None, 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[bool, Union[Generator, CoroutineWrapper, 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: Optional[float] = ..., future: Any = ...) -> AwaitWrapper: ... +def sleep(*args, **kwargs) -> AwaitWrapper: ... +def wait(*args, **kwargs) -> AwaitWrapper: ... +def coroutine_return(coroutine: CoroutineWrapper) -> AwaitWrapper: ... +def _coroutine_return(coroutine: CoroutineWrapper) -> Generator[Any, None, Any]: ... diff --git a/src/typings/netius/base/async_old.pyi b/src/typings/netius/base/async_old.pyi new file mode 100644 index 00000000..30e9dbce --- /dev/null +++ b/src/typings/netius/base/async_old.pyi @@ -0,0 +1,66 @@ +import netius.base.errors as errors +import netius.base.legacy as legacy +from _typeshed import Incomplete + +__version__: str +__revision__: str +__date__: str + +class Future: + def __init__(self, loop: Incomplete | None = ...) -> None: ... + def __iter__(self): ... + def cleanup(self): ... + def running(self): ... + def done(self): ... + def cancelled(self): ... + def finished(self): ... + def result(self): ... + def exception(self, timeout: Incomplete | None = ...): ... + def partial(self, value): ... + def add_done_callback(self, function): ... + def add_partial_callback(self, function): ... + def add_ready_callback(self, function): ... + def add_closed_callback(self, function): ... + def approve(self, cleanup: bool = ...): ... + def cancel(self, cleanup: bool = ..., force: bool = ...): ... + def set_result(self, result, cleanup: bool = ..., force: bool = ...): ... + def set_exception(self, exception, cleanup: bool = ..., force: bool = ...): ... + def _done_callbacks(self, cleanup: bool = ..., delayed: bool = ...): ... + def _partial_callbacks(self, value, delayed: bool = ...): ... + def _wrap(self, future): ... + def _delay(self, callable): ... + @property + def ready(self): ... + @property + def closed(self): ... + +class Task(Future): + def __init__(self, future: Incomplete | None = ...) -> None: ... + +class Handle: + def __init__(self, callable_t: Incomplete | None = ...) -> None: ... + def cancel(self): ... + +class Executor: + def submit(self, callable, *args, **kwargs): ... + +class ThreadPoolExecutor(Executor): + def __init__(self, owner) -> None: ... + def submit(self, callable, *args, **kwargs): ... +def coroutine(function): ... +def async_test_all(factory: Incomplete | None = ..., close: bool = ...): ... +def async_test(function): ... +def ensure_generator(value): ... +def get_asyncio(): ... +def is_coroutine(callable): ... +def is_coroutine_object(generator): ... +def is_coroutine_native(generator): ... +def is_future(future): ... +def is_neo(): ... +def is_asynclib(): ... +def is_await(): ... +def wakeup(force: bool = ...): ... +def sleep(timeout, compat: bool = ..., future: Incomplete | None = ...): ... +def wait(event, timeout: Incomplete | None = ..., future: Incomplete | None = ...): ... +def notify(event, data: Incomplete | None = ...): ... +def coroutine_return(coroutine): ... diff --git a/src/typings/netius/base/asynchronous.pyi b/src/typings/netius/base/asynchronous.pyi new file mode 100644 index 00000000..78ebec66 --- /dev/null +++ b/src/typings/netius/base/asynchronous.pyi @@ -0,0 +1,9 @@ +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 + +__version__: str +__revision__: str +__date__: str diff --git a/src/typings/netius/base/client.pyi b/src/typings/netius/base/client.pyi new file mode 100644 index 00000000..09a81b47 --- /dev/null +++ b/src/typings/netius/base/client.pyi @@ -0,0 +1,136 @@ +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 ClassVar + +__version__: str +__revision__: str +__date__: str +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 +BUFFER_SIZE: None +GC_TIMEOUT: float + +class Client(netius.base.common.AbstractBase): + _client: ClassVar[None] = ... + def __init__(self, thread: bool = ..., daemon: bool = ..., *args, **kwargs) -> None: ... + @classmethod + def get_client_s(cls, *args, **kwargs): ... + @classmethod + def cleanup_s(cls): ... + def ensure_loop(self, env: bool = ...): ... + def join(self, timeout: Incomplete | None = ...): ... + +class DatagramClient(Client): + def __init__(self, *args, **kwargs) -> None: ... + def boot(self): ... + def cleanup(self): ... + def on_read(self, _socket): ... + def on_write(self, _socket): ... + def on_error(self, _socket): ... + def on_exception(self, exception): ... + def on_expected(self, exception): ... + def on_data(self, connection, data): ... + def keep_gc(self, timeout: float = ..., run: bool = ...): ... + def gc(self, callbacks: bool = ...): ... + def add_request(self, request): ... + def remove_request(self, request): ... + def get_request(self, id): ... + def ensure_socket(self): ... + def ensure_write(self): ... + def remove_write(self): ... + def enable_read(self): ... + def disable_read(self): ... + def send(self, data, address, delay: bool = ..., ensure_loop: bool = ..., callback: Incomplete | None = ...): ... + def _send(self, _socket): ... + def _flush_write(self): ... + +class StreamClient(Client): + def __init__(self, *args, **kwargs) -> None: ... + def cleanup(self): ... + def ticks(self): ... + def info_dict(self, full: bool = ...): ... + def acquire_c(self, host, port, ssl: bool = ..., key_file: Incomplete | None = ..., cer_file: Incomplete | None = ..., validate: bool = ..., callback: Incomplete | None = ...): ... + def release_c(self, connection): ... + def remove_c(self, connection): ... + def validate_c(self, connection, close: bool = ...): ... + def connect(self, host, port, ssl: bool = ..., key_file: Incomplete | None = ..., cer_file: Incomplete | None = ..., ca_file: Incomplete | None = ..., ca_root: bool = ..., ssl_verify: bool = ..., family: socket.AddressFamily = ..., type: socket.SocketKind = ..., ensure_loop: bool = ..., env: bool = ...): ... + def acquire(self, connection): ... + def on_read(self, _socket): ... + def on_write(self, _socket): ... + def on_error(self, _socket): ... + def on_exception(self, exception, connection): ... + def on_expected(self, exception, connection): ... + def on_connect(self, connection): ... + def on_upgrade(self, connection): ... + def on_ssl(self, connection): ... + def on_acquire(self, connection): ... + def on_release(self, connection): ... + def on_data(self, connection, data): ... + def _connectf(self, connection): ... + def _connects(self): ... + def _connect(self, connection): ... + def _ssl_handshake(self, connection): ... diff --git a/src/typings/netius/base/common.pyi b/src/typings/netius/base/common.pyi new file mode 100644 index 00000000..bf04dd59 --- /dev/null +++ b/src/typings/netius/base/common.pyi @@ -0,0 +1,515 @@ +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 socket +import ssl +import threading +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.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 ClassVar + +__version__: str +__revision__: str +__date__: str +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 AbstractBase(netius.base.observer.Observable): + _MAIN: ClassVar[None] = ... + _MAIN_C: ClassVar[None] = ... + def __init__(self, name: Incomplete | None = ..., handlers: Incomplete | None = ..., *args, **kwargs) -> None: ... + @classmethod + def test_poll(cls, preferred: Incomplete | None = ...): ... + @classmethod + def get_loop(cls, compat: bool = ..., asyncio: bool = ...): ... + @classmethod + def get_main(cls, compat: bool = ...): ... + @classmethod + def get_asyncio(cls): ... + @classmethod + def set_main(cls, instance, set_compat: bool = ...): ... + @classmethod + def unset_main(cls, set_compat: bool = ...): ... + @classmethod + def patch_asyncio(cls): ... + @classmethod + def waitpid(cls, pid): ... + def destroy(self): ... + def call_safe(self, callable, args: list = ..., kwargs: dict = ...): ... + def wait_event(self, callable, name: Incomplete | None = ...): ... + def unwait_event(self, callable, name: Incomplete | None = ...): ... + def delay(self, callable, timeout: Incomplete | None = ..., immediately: bool = ..., verify: bool = ..., safe: bool = ...): ... + def delay_s(self, callable, timeout: Incomplete | None = ..., immediately: bool = ..., verify: bool = ..., wakeup: bool = ...): ... + def delay_m(self): ... + def ensure(self, coroutine, args: list = ..., kwargs: dict = ..., thread: Incomplete | None = ..., future: Incomplete | None = ..., immediately: bool = ...): ... + def resolve_hostname(self, hostname, type: str = ...): ... + def run_forever(self): ... + def run_coroutine(self, coroutine, args: list = ..., kwargs: dict = ..., thread: Incomplete | None = ..., close: Incomplete | None = ...): ... + def wakeup(self, force: bool = ...): ... + def sleep(self, timeout, future: Incomplete | None = ...): ... + def wait(self, event, timeout: Incomplete | None = ..., future: Incomplete | None = ...): ... + def notify(self, event, data: Incomplete | None = ...): ... + def load(self, full: bool = ...): ... + def unload(self, full: bool = ...): ... + def boot(self): ... + def welcome(self): ... + def load_logging(self, level: int = ..., format: str = ..., unique: bool = ...): ... + def unload_logging(self, safe: bool = ...): ... + def extra_logging(self, level, formatter): ... + def level_logging(self, level): ... + def load_diag(self, env: bool = ...): ... + def load_middleware(self, suffix: str = ...): ... + def unload_middleware(self): ... + def register_middleware(self, middleware_c, *args, **kwargs): ... + def call_middleware(self, name, *args, **kwargs): ... + def bind_signals(self, signals: tuple = ..., handler: Incomplete | None = ...): ... + def unbind_signals(self, signals: tuple = ...): ... + def bind_env(self): ... + def forever(self, env: bool = ...): ... + def start(self): ... + def stop(self): ... + def pause(self): ... + def resume(self): ... + def close(self): ... + def finish(self): ... + def main(self): ... + def is_main(self): ... + def is_running(self): ... + def is_started(self): ... + def is_stopped(self): ... + def is_paused(self): ... + def is_edge(self): ... + def is_empty(self): ... + def is_sub_read(self, socket): ... + def is_sub_write(self, socket): ... + def is_sub_error(self, socket): ... + def sub_all(self, socket): ... + def unsub_all(self, socket): ... + def sub_read(self, socket): ... + def sub_write(self, socket): ... + def sub_error(self, socket): ... + def unsub_read(self, socket): ... + def unsub_write(self, socket): ... + def unsub_error(self, socket): ... + def cleanup(self, destroy: bool = ...): ... + def loop(self): ... + def block(self): ... + def fork(self, timeout: int = ...): ... + def finalize(self): ... + def ticks(self): ... + def reads(self, reads, state: bool = ...): ... + def writes(self, writes, state: bool = ...): ... + def errors(self, errors, state: bool = ...): ... + def datagram(self, family: socket.AddressFamily = ..., type: socket.SocketKind = ..., local_host: Incomplete | None = ..., local_port: Incomplete | None = ..., remote_host: Incomplete | None = ..., remote_port: Incomplete | None = ..., callback: Incomplete | None = ...): ... + def connect(self, host, port, receive_buffer: Incomplete | None = ..., send_buffer: Incomplete | None = ..., ssl: bool = ..., key_file: Incomplete | None = ..., cer_file: Incomplete | None = ..., ca_file: Incomplete | None = ..., ca_root: bool = ..., ssl_verify: bool = ..., family: socket.AddressFamily = ..., type: socket.SocketKind = ..., callback: Incomplete | None = ..., env: bool = ...): ... + def acquire(self, connection): ... + def pregister(self, pool): ... + def punregister(self, pool): ... + def pcallback(self, event, socket, pool): ... + def nensure(self): ... + def nstart(self): ... + def nstop(self): ... + def tensure(self): ... + def tstart(self): ... + def tstop(self): ... + def texecute(self, callable, args: list = ..., kwargs: dict = ..., callback: Incomplete | None = ...): ... + def files(self): ... + def fopen(self, *args, **kwargs): ... + def fclose(self, *args, **kwargs): ... + def fread(self, *args, **kwargs): ... + def fwrite(self, *args, **kwargs): ... + def fensure(self): ... + def fstart(self): ... + def fstop(self): ... + def on_connection_c(self, connection): ... + def on_connection_d(self, connection): ... + def on_stream_c(self, stream): ... + def on_stream_d(self, stream): ... + def on_fork(self): ... + def on_join(self): ... + def on_child(self, pipe: Incomplete | None = ...): ... + def on_command(self, command): ... + def on_diag(self): ... + def on_start(self): ... + def on_stop(self): ... + def on_pause(self): ... + def on_resume(self): ... + def on_read(self, _socket): ... + def on_write(self, _socket): ... + def on_error(self, _socket): ... + def on_exception(self, exception, connection): ... + def on_expected(self, exception, connection): ... + def on_connect(self, connection): ... + def on_upgrade(self, connection): ... + def on_client_ssl(self, connection): ... + def on_acquire(self, connection): ... + def on_acquire_base(self, connection): ... + def on_release(self, connection): ... + def on_release_base(self, connection): ... + def on_data(self, connection, data): ... + def on_data_base(self, connection, data): ... + def info_dict(self, full: bool = ...): ... + def info_string(self, full: bool = ..., safe: bool = ...): ... + def connections_dict(self, full: bool = ...): ... + def connection_dict(self, id, full: bool = ...): ... + def build_connection(self, socket, address: Incomplete | None = ..., datagram: bool = ..., ssl: bool = ...): ... + def base_connection(self, *args, **kwargs): ... + def new_connection(self, connection): ... + def del_connection(self, connection): ... + def add_callback(self, socket, callback): ... + def remove_callback(self, socket, callback): ... + def load_config(self, path: str = ..., **kwargs): ... + def apply_config(self, path, kwargs): ... + def exec_safe(self, connection, callable, *args, **kwargs): ... + def is_devel(self): ... + def is_debug(self): ... + def is_info(self): ... + def is_warning(self): ... + def is_error(self): ... + def is_critical(self): ... + def debug(self, object): ... + def info(self, object): ... + def warning(self, object): ... + def error(self, object): ... + def critical(self, object): ... + def log_stack(self, method: Incomplete | None = ..., info: bool = ...): ... + def log_info(self, method: Incomplete | None = ...): ... + def log(self, *args, **kwargs): ... + def log_python_3(self, object, level: int = ...): ... + def log_python_2(self, object, level: int = ...): ... + def build_poll(self): ... + def build_future(self, compat: bool = ..., asyncio: bool = ...): ... + def get_id(self, unique: bool = ...): ... + def get_poll(self): ... + def get_poll_name(self): ... + def get_state(self): ... + def set_state(self, state): ... + def get_state_s(self, lower: bool = ...): ... + def get_env(self, name, default: Incomplete | None = ..., cast: Incomplete | None = ..., expand: bool = ...): ... + def expand(self, value, encoding: str = ..., force: bool = ...): ... + def get_protocols(self): ... + def get_adapter(self, name: str = ..., *args, **kwargs): ... + def get_auth(self, name: str = ..., *args, **kwargs): ... + def get_connection(self, socket): ... + def _pending(self, connection): ... + def _notifies(self): ... + def _delays(self): ... + def _generate(self, hashed: bool = ...): ... + def _connect(self, connection): ... + def _connectf(self, connection): ... + def _socket_keepalive(self, _socket, timeout: Incomplete | None = ..., interval: Incomplete | None = ..., count: Incomplete | None = ...): ... + def _ssl_init(self, strict: bool = ..., env: bool = ...): ... + def _ssl_destroy(self): ... + def _ssl_callback(self, socket, hostname, context): ... + def _ssl_ctx(self, values, context: Incomplete | None = ..., secure: int = ..., context_options: list = ...): ... + def _ssl_ctx_base(self, context, secure: int = ..., context_options: list = ...): ... + def _ssl_ctx_protocols(self, context): ... + def _ssl_ctx_alpn(self, context): ... + def _ssl_ctx_npn(self, context): ... + def _ssl_certs(self, context, key_file: Incomplete | None = ..., cer_file: Incomplete | None = ..., ca_file: Incomplete | None = ..., ca_root: bool = ..., verify_mode: ssl.VerifyMode = ..., check_hostname: bool = ...): ... + def _ssl_upgrade(self, _socket, key_file: Incomplete | None = ..., cer_file: Incomplete | None = ..., ca_file: Incomplete | None = ..., ca_root: bool = ..., server: bool = ..., ssl_verify: bool = ..., server_hostname: Incomplete | None = ...): ... + def _ssl_wrap(self, _socket, key_file: Incomplete | None = ..., cer_file: Incomplete | None = ..., ca_file: Incomplete | None = ..., ca_root: bool = ..., server: bool = ..., ssl_verify: bool = ..., server_hostname: Incomplete | None = ...): ... + def _ssl_handshake(self, connection): ... + def _ssl_client_handshake(self, connection): ... + def _expand_destroy(self): ... + def _level(self, level): ... + def _format_delta(self, time_delta, count: int = ...): ... + def _wait_forever(self, sleep: int = ...): ... + @property + def is_parent(self): ... + @property + def is_child(self): ... + @property + def is_forked(self): ... + +class DiagBase(AbstractBase): + def __init__(self, *args, **kwargs) -> None: ... + def reads(self, *args, **kwargs): ... + def writes(self, *args, **kwargs): ... + def errors(self, *args, **kwargs): ... + def info_dict(self, full: bool = ...): ... + +class BaseThread(threading.Thread): + def __init__(self, owner: Incomplete | None = ..., daemon: bool = ..., *args, **kwargs) -> None: ... + def run(self): ... +def new_loop_main(factory: Incomplete | None = ..., _compat: Incomplete | None = ..., **kwargs): ... +def new_loop_asyncio(**kwargs): ... +def new_loop(factory: Incomplete | None = ..., _compat: Incomplete | None = ..., asyncio: Incomplete | None = ..., **kwargs): ... +def ensure_main(factory: Incomplete | None = ..., **kwargs): ... +def ensure_asyncio(**kwargs): ... +def ensure_loop(factory: Incomplete | None = ..., asyncio: Incomplete | None = ..., **kwargs): ... +def get_main(factory: Incomplete | None = ..., ensure: bool = ..., **kwargs): ... +def get_loop(factory: Incomplete | None = ..., ensure: bool = ..., _compat: Incomplete | None = ..., asyncio: Incomplete | None = ..., **kwargs): ... +def get_event_loop(*args, **kwargs): ... +def stop_loop(compat: bool = ..., asyncio: bool = ...): ... +def compat_loop(loop): ... +def get_poll(): ... +def build_future(compat: bool = ..., asyncio: bool = ...): ... +def ensure(coroutine, args: list = ..., kwargs: dict = ..., thread: Incomplete | None = ...): ... +def ensure_pool(coroutine, args: list = ..., kwargs: dict = ...): ... + +class Base(netius.base.observer.Observable): + _MAIN: ClassVar[None] = ... + _MAIN_C: ClassVar[None] = ... + def __init__(self, name: Incomplete | None = ..., handlers: Incomplete | None = ..., *args, **kwargs) -> None: ... + @classmethod + def test_poll(cls, preferred: Incomplete | None = ...): ... + @classmethod + def get_loop(cls, compat: bool = ..., asyncio: bool = ...): ... + @classmethod + def get_main(cls, compat: bool = ...): ... + @classmethod + def get_asyncio(cls): ... + @classmethod + def set_main(cls, instance, set_compat: bool = ...): ... + @classmethod + def unset_main(cls, set_compat: bool = ...): ... + @classmethod + def patch_asyncio(cls): ... + @classmethod + def waitpid(cls, pid): ... + def destroy(self): ... + def call_safe(self, callable, args: list = ..., kwargs: dict = ...): ... + def wait_event(self, callable, name: Incomplete | None = ...): ... + def unwait_event(self, callable, name: Incomplete | None = ...): ... + def delay(self, callable, timeout: Incomplete | None = ..., immediately: bool = ..., verify: bool = ..., safe: bool = ...): ... + def delay_s(self, callable, timeout: Incomplete | None = ..., immediately: bool = ..., verify: bool = ..., wakeup: bool = ...): ... + def delay_m(self): ... + def ensure(self, coroutine, args: list = ..., kwargs: dict = ..., thread: Incomplete | None = ..., future: Incomplete | None = ..., immediately: bool = ...): ... + def resolve_hostname(self, hostname, type: str = ...): ... + def run_forever(self): ... + def run_coroutine(self, coroutine, args: list = ..., kwargs: dict = ..., thread: Incomplete | None = ..., close: Incomplete | None = ...): ... + def wakeup(self, force: bool = ...): ... + def sleep(self, timeout, future: Incomplete | None = ...): ... + def wait(self, event, timeout: Incomplete | None = ..., future: Incomplete | None = ...): ... + def notify(self, event, data: Incomplete | None = ...): ... + def load(self, full: bool = ...): ... + def unload(self, full: bool = ...): ... + def boot(self): ... + def welcome(self): ... + def load_logging(self, level: int = ..., format: str = ..., unique: bool = ...): ... + def unload_logging(self, safe: bool = ...): ... + def extra_logging(self, level, formatter): ... + def level_logging(self, level): ... + def load_diag(self, env: bool = ...): ... + def load_middleware(self, suffix: str = ...): ... + def unload_middleware(self): ... + def register_middleware(self, middleware_c, *args, **kwargs): ... + def call_middleware(self, name, *args, **kwargs): ... + def bind_signals(self, signals: tuple = ..., handler: Incomplete | None = ...): ... + def unbind_signals(self, signals: tuple = ...): ... + def bind_env(self): ... + def forever(self, env: bool = ...): ... + def start(self): ... + def stop(self): ... + def pause(self): ... + def resume(self): ... + def close(self): ... + def finish(self): ... + def main(self): ... + def is_main(self): ... + def is_running(self): ... + def is_started(self): ... + def is_stopped(self): ... + def is_paused(self): ... + def is_edge(self): ... + def is_empty(self): ... + def is_sub_read(self, socket): ... + def is_sub_write(self, socket): ... + def is_sub_error(self, socket): ... + def sub_all(self, socket): ... + def unsub_all(self, socket): ... + def sub_read(self, socket): ... + def sub_write(self, socket): ... + def sub_error(self, socket): ... + def unsub_read(self, socket): ... + def unsub_write(self, socket): ... + def unsub_error(self, socket): ... + def cleanup(self, destroy: bool = ...): ... + def loop(self): ... + def block(self): ... + def fork(self, timeout: int = ...): ... + def finalize(self): ... + def ticks(self): ... + def reads(self, reads, state: bool = ...): ... + def writes(self, writes, state: bool = ...): ... + def errors(self, errors, state: bool = ...): ... + def datagram(self, family: socket.AddressFamily = ..., type: socket.SocketKind = ..., local_host: Incomplete | None = ..., local_port: Incomplete | None = ..., remote_host: Incomplete | None = ..., remote_port: Incomplete | None = ..., callback: Incomplete | None = ...): ... + def connect(self, host, port, receive_buffer: Incomplete | None = ..., send_buffer: Incomplete | None = ..., ssl: bool = ..., key_file: Incomplete | None = ..., cer_file: Incomplete | None = ..., ca_file: Incomplete | None = ..., ca_root: bool = ..., ssl_verify: bool = ..., family: socket.AddressFamily = ..., type: socket.SocketKind = ..., callback: Incomplete | None = ..., env: bool = ...): ... + def acquire(self, connection): ... + def pregister(self, pool): ... + def punregister(self, pool): ... + def pcallback(self, event, socket, pool): ... + def nensure(self): ... + def nstart(self): ... + def nstop(self): ... + def tensure(self): ... + def tstart(self): ... + def tstop(self): ... + def texecute(self, callable, args: list = ..., kwargs: dict = ..., callback: Incomplete | None = ...): ... + def files(self): ... + def fopen(self, *args, **kwargs): ... + def fclose(self, *args, **kwargs): ... + def fread(self, *args, **kwargs): ... + def fwrite(self, *args, **kwargs): ... + def fensure(self): ... + def fstart(self): ... + def fstop(self): ... + def on_connection_c(self, connection): ... + def on_connection_d(self, connection): ... + def on_stream_c(self, stream): ... + def on_stream_d(self, stream): ... + def on_fork(self): ... + def on_join(self): ... + def on_child(self, pipe: Incomplete | None = ...): ... + def on_command(self, command): ... + def on_diag(self): ... + def on_start(self): ... + def on_stop(self): ... + def on_pause(self): ... + def on_resume(self): ... + def on_read(self, _socket): ... + def on_write(self, _socket): ... + def on_error(self, _socket): ... + def on_exception(self, exception, connection): ... + def on_expected(self, exception, connection): ... + def on_connect(self, connection): ... + def on_upgrade(self, connection): ... + def on_client_ssl(self, connection): ... + def on_acquire(self, connection): ... + def on_acquire_base(self, connection): ... + def on_release(self, connection): ... + def on_release_base(self, connection): ... + def on_data(self, connection, data): ... + def on_data_base(self, connection, data): ... + def info_dict(self, full: bool = ...): ... + def info_string(self, full: bool = ..., safe: bool = ...): ... + def connections_dict(self, full: bool = ...): ... + def connection_dict(self, id, full: bool = ...): ... + def build_connection(self, socket, address: Incomplete | None = ..., datagram: bool = ..., ssl: bool = ...): ... + def base_connection(self, *args, **kwargs): ... + def new_connection(self, connection): ... + def del_connection(self, connection): ... + def add_callback(self, socket, callback): ... + def remove_callback(self, socket, callback): ... + def load_config(self, path: str = ..., **kwargs): ... + def apply_config(self, path, kwargs): ... + def exec_safe(self, connection, callable, *args, **kwargs): ... + def is_devel(self): ... + def is_debug(self): ... + def is_info(self): ... + def is_warning(self): ... + def is_error(self): ... + def is_critical(self): ... + def debug(self, object): ... + def info(self, object): ... + def warning(self, object): ... + def error(self, object): ... + def critical(self, object): ... + def log_stack(self, method: Incomplete | None = ..., info: bool = ...): ... + def log_info(self, method: Incomplete | None = ...): ... + def log(self, *args, **kwargs): ... + def log_python_3(self, object, level: int = ...): ... + def log_python_2(self, object, level: int = ...): ... + def build_poll(self): ... + def build_future(self, compat: bool = ..., asyncio: bool = ...): ... + def get_id(self, unique: bool = ...): ... + def get_poll(self): ... + def get_poll_name(self): ... + def get_state(self): ... + def set_state(self, state): ... + def get_state_s(self, lower: bool = ...): ... + def get_env(self, name, default: Incomplete | None = ..., cast: Incomplete | None = ..., expand: bool = ...): ... + def expand(self, value, encoding: str = ..., force: bool = ...): ... + def get_protocols(self): ... + def get_adapter(self, name: str = ..., *args, **kwargs): ... + def get_auth(self, name: str = ..., *args, **kwargs): ... + def get_connection(self, socket): ... + def _pending(self, connection): ... + def _notifies(self): ... + def _delays(self): ... + def _generate(self, hashed: bool = ...): ... + def _connect(self, connection): ... + def _connectf(self, connection): ... + def _socket_keepalive(self, _socket, timeout: Incomplete | None = ..., interval: Incomplete | None = ..., count: Incomplete | None = ...): ... + def _ssl_init(self, strict: bool = ..., env: bool = ...): ... + def _ssl_destroy(self): ... + def _ssl_callback(self, socket, hostname, context): ... + def _ssl_ctx(self, values, context: Incomplete | None = ..., secure: int = ..., context_options: list = ...): ... + def _ssl_ctx_base(self, context, secure: int = ..., context_options: list = ...): ... + def _ssl_ctx_protocols(self, context): ... + def _ssl_ctx_alpn(self, context): ... + def _ssl_ctx_npn(self, context): ... + def _ssl_certs(self, context, key_file: Incomplete | None = ..., cer_file: Incomplete | None = ..., ca_file: Incomplete | None = ..., ca_root: bool = ..., verify_mode: ssl.VerifyMode = ..., check_hostname: bool = ...): ... + def _ssl_upgrade(self, _socket, key_file: Incomplete | None = ..., cer_file: Incomplete | None = ..., ca_file: Incomplete | None = ..., ca_root: bool = ..., server: bool = ..., ssl_verify: bool = ..., server_hostname: Incomplete | None = ...): ... + def _ssl_wrap(self, _socket, key_file: Incomplete | None = ..., cer_file: Incomplete | None = ..., ca_file: Incomplete | None = ..., ca_root: bool = ..., server: bool = ..., ssl_verify: bool = ..., server_hostname: Incomplete | None = ...): ... + def _ssl_handshake(self, connection): ... + def _ssl_client_handshake(self, connection): ... + def _expand_destroy(self): ... + def _level(self, level): ... + def _format_delta(self, time_delta, count: int = ...): ... + def _wait_forever(self, sleep: int = ...): ... + @property + def is_parent(self): ... + @property + def is_child(self): ... + @property + def is_forked(self): ... diff --git a/src/typings/netius/base/compat.pyi b/src/typings/netius/base/compat.pyi new file mode 100644 index 00000000..9e91c905 --- /dev/null +++ b/src/typings/netius/base/compat.pyi @@ -0,0 +1,64 @@ +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 _typeshed import Incomplete + +__version__: str +__revision__: str +__date__: str + +class CompatLoop(asyncio.events.AbstractEventLoop): + def __init__(self, loop) -> None: ... + def __getattr__(self, name): ... + def time(self): ... + def call_soon(self, callback, *args): ... + def call_soon_threadsafe(self, callback, *args): ... + def call_at(self, when, callback, *args): ... + def call_later(self, delay, callback, *args): ... + def create_future(self): ... + def create_task(self, coroutine): ... + def create_server(self, *args, **kwargs): ... + def create_connection(self, *args, **kwargs): ... + def create_datagram_endpoint(self, *args, **kwargs): ... + def getaddrinfo(self, *args, **kwargs): ... + def getnameinfo(self, *args, **kwargs): ... + def run_until_complete(self, future): ... + def run_forever(self): ... + def run_in_executor(self, *args, **kwargs): ... + def stop(self): ... + def close(self): ... + def get_exception_handler(self): ... + def set_exception_handler(self, handler): ... + def default_exception_handler(self, context): ... + def call_exception_handler(self, context): ... + def get_debug(self): ... + def set_debug(self, enabled): ... + def set_default_executor(self, executor): ... + def get_task_factory(self): ... + def set_task_factory(self, factory): ... + def is_running(self): ... + def is_closed(self): ... + def _getaddrinfo(self, host, port, family: int = ..., type: int = ..., proto: int = ..., flags: int = ...): ... + def _getnameinfo(self, sockaddr, flags: int = ...): ... + def _run_in_executor(self, executor, func, *args): ... + def _create_connection(self, protocol_factory, host: Incomplete | None = ..., port: Incomplete | None = ..., ssl: Incomplete | None = ..., family: int = ..., proto: int = ..., flags: int = ..., sock: Incomplete | None = ..., local_addr: Incomplete | None = ..., server_hostname: Incomplete | None = ..., *args, **kwargs): ... + def _create_datagram_endpoint(self, protocol_factory, local_addr: Incomplete | None = ..., remote_addr: Incomplete | None = ..., family: int = ..., proto: int = ..., flags: int = ..., reuse_address: Incomplete | None = ..., reuse_port: Incomplete | None = ..., allow_broadcast: Incomplete | None = ..., sock: Incomplete | None = ..., *args, **kwargs): ... + def _set_current_task(self, task): ... + def _unset_current_task(self): ... + def _call_delay(self, callback, args, timeout: Incomplete | None = ..., immediately: bool = ..., verify: bool = ..., safe: bool = ...): ... + def _sleep(self, timeout, future: Incomplete | None = ...): ... + def _default_handler(self, context): ... + @property + def _thread_id(self): ... +def is_compat(): ... +def is_asyncio(): ... +def build_datagram(*args, **kwargs): ... +def connect_stream(*args, **kwargs): ... +def _build_datagram_native(protocol_factory, family: socket.AddressFamily = ..., type: socket.SocketKind = ..., remote_host: Incomplete | None = ..., remote_port: Incomplete | None = ..., callback: Incomplete | None = ..., loop: Incomplete | None = ..., *args, **kwargs): ... +def _build_datagram_compat(protocol_factory, family: socket.AddressFamily = ..., type: socket.SocketKind = ..., remote_host: Incomplete | None = ..., remote_port: Incomplete | None = ..., callback: Incomplete | None = ..., loop: Incomplete | None = ..., *args, **kwargs): ... +def _connect_stream_native(protocol_factory, host, port, ssl: bool = ..., key_file: Incomplete | None = ..., cer_file: Incomplete | None = ..., ca_file: Incomplete | None = ..., ca_root: bool = ..., ssl_verify: bool = ..., family: socket.AddressFamily = ..., type: socket.SocketKind = ..., callback: Incomplete | None = ..., loop: Incomplete | None = ..., *args, **kwargs): ... +def _connect_stream_compat(protocol_factory, host, port, ssl: bool = ..., key_file: Incomplete | None = ..., cer_file: Incomplete | None = ..., ca_file: Incomplete | None = ..., ca_root: bool = ..., ssl_verify: bool = ..., family: socket.AddressFamily = ..., type: socket.SocketKind = ..., callback: Incomplete | None = ..., loop: Incomplete | None = ..., *args, **kwargs): ... diff --git a/src/typings/netius/base/config.pyi b/src/typings/netius/base/config.pyi new file mode 100644 index 00000000..6b42f643 --- /dev/null +++ b/src/typings/netius/base/config.pyi @@ -0,0 +1,31 @@ +import netius.base.legacy as legacy +from _typeshed import Incomplete + +__version__: str +__revision__: str +__date__: str +FILE_NAME: str +FILE_TEMPLATE: str +HOME_FILE: str +IMPORT_NAMES: tuple +CASTS: dict +ENV_ENCODINGS: tuple +CONFIGS: dict +CONFIG_F: list +HOMES: list +def conf(name, default: Incomplete | None = ..., cast: Incomplete | None = ..., ctx: Incomplete | None = ...): ... +def conf_prefix(prefix, ctx: Incomplete | None = ...): ... +def conf_suffix(suffix, ctx: Incomplete | None = ...): ... +def conf_s(name, value, ctx: Incomplete | None = ...): ... +def conf_r(name, ctx: Incomplete | None = ...): ... +def conf_d(ctx: Incomplete | None = ...): ... +def conf_ctx(): ... +def load(names: tuple = ..., path: Incomplete | None = ..., encoding: str = ..., ctx: Incomplete | None = ...): ... +def load_file(name: str = ..., path: Incomplete | None = ..., encoding: str = ..., ctx: Incomplete | None = ...): ... +def load_env(ctx: Incomplete | None = ...): ... +def get_homes(file_path: str = ..., default: str = ..., encoding: str = ..., force_default: bool = ...): ... +def _cast_r(cast): ... +def _load_includes(base_path, config, encoding: str = ...): ... +def _is_valid(key): ... +def _is_devel(): ... +def _is_secure(): ... diff --git a/src/typings/netius/base/conn.pyi b/src/typings/netius/base/conn.pyi new file mode 100644 index 00000000..d814bcaf --- /dev/null +++ b/src/typings/netius/base/conn.pyi @@ -0,0 +1,121 @@ +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 _typeshed import Incomplete + +__version__: str +__revision__: str +__date__: str +OPEN: int +CLOSED: int +PENDING: int +CHUNK_SIZE: int + +class BaseConnection(netius.base.observer.Observable): + def __init__(self, owner: Incomplete | None = ..., socket: Incomplete | None = ..., address: Incomplete | None = ..., datagram: bool = ..., ssl: bool = ..., max_pending: int = ..., min_pending: int = ...) -> None: ... + def destroy(self): ... + def open(self, connect: bool = ...): ... + def close(self, flush: bool = ..., destroy: bool = ...): ... + def close_flush(self): ... + def upgrade(self, key_file: Incomplete | None = ..., cer_file: Incomplete | None = ..., ca_file: Incomplete | None = ..., server: bool = ...): ... + def set_connecting(self): ... + def set_connected(self): ... + def set_upgraded(self): ... + def set_data(self, data, address: Incomplete | None = ...): ... + def ensure_write(self, flush: bool = ...): ... + def remove_write(self): ... + def enable_read(self): ... + def disable_read(self): ... + def send(self, data, address: Incomplete | None = ..., delay: bool = ..., force: bool = ..., callback: Incomplete | None = ...): ... + def recv(self, size: int = ..., force: bool = ...): ... + def pend(self, data, back: bool = ...): ... + def restore(self, data, back: bool = ...): ... + def run_starter(self): ... + def end_starter(self): ... + def add_starter(self, starter, back: bool = ...): ... + def remove_starter(self, starter): ... + def info_dict(self, full: bool = ...): ... + def ssl_certificate(self, binary: bool = ...): ... + def ssl_verify_host(self, host: Incomplete | None = ...): ... + def ssl_verify_fingerprint(self, fingerprint: Incomplete | None = ...): ... + def ssl_dump_certificate(self, dump: bool = ...): ... + def ssl_protocol(self): ... + def ssl_alpn_protocol(self): ... + def ssl_npn_protocol(self): ... + def is_open(self): ... + def is_closed(self): ... + def is_pending(self): ... + def is_connected(self): ... + def is_connecting(self): ... + def is_upgrading(self): ... + def is_throttleable(self): ... + def is_exhausted(self): ... + def is_restored(self): ... + def is_pending_data(self): ... + def _send(self): ... + def _recv(self, size): ... + def _recv_ssl(self, size): ... + def _recv_restored(self, size): ... + def _shutdown(self, close: bool = ..., force: bool = ..., ignore: bool = ...): ... + def _close_callback(self, connection): ... + def _flush_write(self): ... + +class DiagConnection(BaseConnection): + def __init__(self, *args, **kwargs) -> None: ... + def recv(self, *args, **kwargs): ... + def send(self, data, *args, **kwargs): ... + def info_dict(self, full: bool = ...): ... + def _uptime(self): ... + def _resolve(self, address): ... +is_diag: bool + +class Connection(netius.base.observer.Observable): + def __init__(self, owner: Incomplete | None = ..., socket: Incomplete | None = ..., address: Incomplete | None = ..., datagram: bool = ..., ssl: bool = ..., max_pending: int = ..., min_pending: int = ...) -> None: ... + def destroy(self): ... + def open(self, connect: bool = ...): ... + def close(self, flush: bool = ..., destroy: bool = ...): ... + def close_flush(self): ... + def upgrade(self, key_file: Incomplete | None = ..., cer_file: Incomplete | None = ..., ca_file: Incomplete | None = ..., server: bool = ...): ... + def set_connecting(self): ... + def set_connected(self): ... + def set_upgraded(self): ... + def set_data(self, data, address: Incomplete | None = ...): ... + def ensure_write(self, flush: bool = ...): ... + def remove_write(self): ... + def enable_read(self): ... + def disable_read(self): ... + def send(self, data, address: Incomplete | None = ..., delay: bool = ..., force: bool = ..., callback: Incomplete | None = ...): ... + def recv(self, size: int = ..., force: bool = ...): ... + def pend(self, data, back: bool = ...): ... + def restore(self, data, back: bool = ...): ... + def run_starter(self): ... + def end_starter(self): ... + def add_starter(self, starter, back: bool = ...): ... + def remove_starter(self, starter): ... + def info_dict(self, full: bool = ...): ... + def ssl_certificate(self, binary: bool = ...): ... + def ssl_verify_host(self, host: Incomplete | None = ...): ... + def ssl_verify_fingerprint(self, fingerprint: Incomplete | None = ...): ... + def ssl_dump_certificate(self, dump: bool = ...): ... + def ssl_protocol(self): ... + def ssl_alpn_protocol(self): ... + def ssl_npn_protocol(self): ... + def is_open(self): ... + def is_closed(self): ... + def is_pending(self): ... + def is_connected(self): ... + def is_connecting(self): ... + def is_upgrading(self): ... + def is_throttleable(self): ... + def is_exhausted(self): ... + def is_restored(self): ... + def is_pending_data(self): ... + def _send(self): ... + def _recv(self, size): ... + def _recv_ssl(self, size): ... + def _recv_restored(self, size): ... + def _shutdown(self, close: bool = ..., force: bool = ..., ignore: bool = ...): ... + def _close_callback(self, connection): ... + def _flush_write(self): ... diff --git a/src/typings/netius/base/container.pyi b/src/typings/netius/base/container.pyi new file mode 100644 index 00000000..914b3306 --- /dev/null +++ b/src/typings/netius/base/container.pyi @@ -0,0 +1,97 @@ +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 + +__version__: str +__revision__: str +__date__: str +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): ... + def cleanup(self): ... + def loop(self): ... + def ticks(self): ... + def connections_dict(self, full: bool = ...): ... + def connection_dict(self, id, full: bool = ...): ... + def on_start(self): ... + def on_stop(self): ... + def add_base(self, base): ... + def remove_base(self, base): ... + def start_base(self, base): ... + def start_all(self): ... + def apply_all(self): ... + def apply_base(self, base): ... + def call_all(self, name, *args, **kwargs): ... + def trigger_all(self, name, *args, **kwargs): ... + +class ContainerServer(netius.base.server.StreamServer): + def __init__(self, *args, **kwargs) -> None: ... + def start(self): ... + def stop(self): ... + def cleanup(self): ... + def add_base(self, base): ... diff --git a/src/typings/netius/base/diag.pyi b/src/typings/netius/base/diag.pyi new file mode 100644 index 00000000..3bdd0635 --- /dev/null +++ b/src/typings/netius/base/diag.pyi @@ -0,0 +1,18 @@ +import netius as netius +import netius.mock.appier +import netius.mock.appier as appier +from typing import ClassVar + +__version__: str +__revision__: str +__date__: str +loaded: bool + +class DiagApp(netius.mock.appier.APIApp): + show_logger: ClassVar[None] = ... + set_logger: ClassVar[None] = ... + show_environ: ClassVar[None] = ... + system_info: ClassVar[None] = ... + list_connections: ClassVar[None] = ... + show_connection: ClassVar[None] = ... + def __init__(self, system, *args, **kwargs) -> None: ... diff --git a/src/typings/netius/base/errors.pyi b/src/typings/netius/base/errors.pyi new file mode 100644 index 00000000..4d2a05c0 --- /dev/null +++ b/src/typings/netius/base/errors.pyi @@ -0,0 +1,25 @@ +from _typeshed import Incomplete + +__version__: str +__revision__: str +__date__: str + +class NetiusError(Exception): + def __init__(self, *args, **kwargs) -> None: ... + def get_kwarg(self, name, default: Incomplete | None = ...): ... + @property + def uid(self): ... + +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/typings/netius/base/legacy.pyi b/src/typings/netius/base/legacy.pyi new file mode 100644 index 00000000..8734fe2a --- /dev/null +++ b/src/typings/netius/base/legacy.pyi @@ -0,0 +1,93 @@ +from _typeshed import Incomplete +from typing import ClassVar + +__version__: str +__revision__: str +__date__: str + +class ArgSpec(tuple): + _fields: ClassVar[tuple] = ... + _field_defaults: ClassVar[dict] = ... + __match_args__: ClassVar[tuple] = ... + args: Incomplete + varargs: Incomplete + keywords: Incomplete + defaults: Incomplete + def __init__(self, _cls, args, varargs, keywords, defaults) -> None: ... + @classmethod + def _make(cls, iterable): ... + def _replace(self, **kwds): ... + def _asdict(self): ... + def __getnewargs__(self): ... +def ctx_absolute(*args, **kwds): ... + +urllib2: None +httplib: None +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 +_xrange: None +_execfile: None +_reduce: None +_reload: None +_unichr: None +def with_meta(meta, *bases): ... +def eager(iterable): ... +def iteritems(associative): ... +def iterkeys(associative): ... +def itervalues(associative): ... +def items(associative): ... +def keys(associative): ... +def values(associative): ... +def xrange(start, stop: Incomplete | None = ..., step: int = ...): ... +def range(start, stop: Incomplete | None = ..., step: Incomplete | None = ...): ... +def ord(value): ... +def chr(value): ... +def chri(value): ... +def bytes(value, encoding: str = ..., errors: str = ..., force: bool = ...): ... +def str(value, encoding: str = ..., errors: str = ..., force: bool = ...): ... +def u(value, encoding: str = ..., errors: str = ..., force: bool = ...): ... +def ascii(value, encoding: str = ..., errors: str = ...): ... +def orderable(value): ... +def is_str(value): ... +def is_unicode(value): ... +def is_bytes(value): ... +def is_string(value, all: bool = ...): ... +def is_generator(value): ... +def is_async_generator(value): ... +def is_unittest(name: str = ...): ... +def execfile(path, global_vars, local_vars: Incomplete | None = ..., encoding: str = ...): ... +def walk(path, visit, arg): ... +def getargspec(func): ... +def has_module(name): ... +def new_module(name): ... +def reduce(*args, **kwargs): ... +def reload(*args, **kwargs): ... +def unichr(*args, **kwargs): ... +def urlopen(*args, **kwargs): ... +def build_opener(*args, **kwargs): ... +def urlparse(*args, **kwargs): ... +def urlunparse(*args, **kwargs): ... +def parse_qs(*args, **kwargs): ... +def urlencode(*args, **kwargs): ... +def quote(*args, **kwargs): ... +def quote_plus(*args, **kwargs): ... +def unquote(*args, **kwargs): ... +def unquote_plus(*args, **kwargs): ... +def cmp_to_key(*args, **kwargs): ... +def tobytes(self, *args, **kwargs): ... +def tostring(self, *args, **kwargs): ... +def StringIO(*args, **kwargs): ... +def BytesIO(*args, **kwargs): ... + +class Orderable(tuple): + def __cmp__(self, value): ... + def __lt__(self, value) -> bool: ... diff --git a/src/typings/netius/base/log.pyi b/src/typings/netius/base/log.pyi new file mode 100644 index 00000000..66975981 --- /dev/null +++ b/src/typings/netius/base/log.pyi @@ -0,0 +1,9 @@ +from _typeshed import Incomplete + +__version__: str +__revision__: str +__date__: str +SILENT: int +def rotating_handler(path: str = ..., max_bytes: int = ..., max_log: int = ..., encoding: Incomplete | None = ..., delay: bool = ...): ... +def smtp_handler(host: str = ..., port: int = ..., sender: str = ..., receivers: list = ..., subject: str = ..., username: Incomplete | None = ..., password: Incomplete | None = ..., stls: bool = ...): ... +def in_signature(callable, name): ... diff --git a/src/typings/netius/base/observer.pyi b/src/typings/netius/base/observer.pyi new file mode 100644 index 00000000..e15841ef --- /dev/null +++ b/src/typings/netius/base/observer.pyi @@ -0,0 +1,14 @@ +from _typeshed import Incomplete + +__version__: str +__revision__: str +__date__: str + +class Observable: + def __init__(self, *args, **kwargs) -> None: ... + def build(self): ... + def destroy(self): ... + def bind(self, name, method, oneshot: bool = ...): ... + def unbind(self, name, method: Incomplete | None = ...): ... + def unbind_all(self): ... + def trigger(self, name, *args, **kwargs): ... diff --git a/src/typings/netius/base/poll.pyi b/src/typings/netius/base/poll.pyi new file mode 100644 index 00000000..c937f5cc --- /dev/null +++ b/src/typings/netius/base/poll.pyi @@ -0,0 +1,89 @@ +from _typeshed import Incomplete + +__version__: str +__revision__: str +__date__: str +POLL_TIMEOUT: float + +class Poll: + def __init__(self) -> None: ... + @classmethod + def name(cls): ... + @classmethod + def test(cls): ... + def open(self, timeout: float = ...): ... + def close(self): ... + def poll(self): ... + def poll_owner(self): ... + def is_open(self): ... + def is_edge(self): ... + def is_empty(self): ... + def sub_all(self, socket, owner: Incomplete | None = ...): ... + def unsub_all(self, socket): ... + def is_sub_read(self, socket): ... + def is_sub_write(self, socket): ... + def is_sub_error(self, socket): ... + def sub_read(self, socket, owner: Incomplete | None = ...): ... + def sub_write(self, socket, owner: Incomplete | None = ...): ... + def sub_error(self, socket, owner: Incomplete | None = ...): ... + def unsub_read(self, socket): ... + def unsub_write(self, socket): ... + def unsub_error(self, socket): ... + +class EpollPoll(Poll): + def __init__(self, *args, **kwargs) -> None: ... + @classmethod + def test(cls): ... + def open(self, timeout: float = ...): ... + def close(self): ... + def poll(self): ... + def is_edge(self): ... + def sub_read(self, socket, owner: Incomplete | None = ...): ... + def sub_write(self, socket, owner: Incomplete | None = ...): ... + def sub_error(self, socket, owner: Incomplete | None = ...): ... + def unsub_read(self, socket): ... + def unsub_write(self, socket): ... + def unsub_error(self, socket): ... + +class KqueuePoll(Poll): + def __init__(self, *args, **kwargs) -> None: ... + @classmethod + def test(cls): ... + def open(self, timeout: float = ...): ... + def close(self): ... + def poll(self): ... + def is_edge(self): ... + def sub_read(self, socket, owner: Incomplete | None = ...): ... + def sub_write(self, socket, owner: Incomplete | None = ...): ... + def sub_error(self, socket, owner: Incomplete | None = ...): ... + def unsub_read(self, socket): ... + def unsub_write(self, socket): ... + def unsub_error(self, socket): ... + +class PollPoll(Poll): + def __init__(self, *args, **kwargs) -> None: ... + @classmethod + def test(cls): ... + def open(self, timeout: float = ...): ... + def close(self): ... + def poll(self): ... + def is_edge(self): ... + def sub_read(self, socket, owner: Incomplete | None = ...): ... + def sub_write(self, socket, owner: Incomplete | None = ...): ... + def sub_error(self, socket, owner: Incomplete | None = ...): ... + def unsub_read(self, socket): ... + def unsub_write(self, socket): ... + def unsub_error(self, socket): ... + +class SelectPoll(Poll): + def __init__(self, *args, **kwargs) -> None: ... + def open(self, timeout: float = ...): ... + def close(self): ... + def poll(self): ... + def is_edge(self): ... + def sub_read(self, socket, owner: Incomplete | None = ...): ... + def sub_write(self, socket, owner: Incomplete | None = ...): ... + def sub_error(self, socket, owner: Incomplete | None = ...): ... + def unsub_read(self, socket): ... + def unsub_write(self, socket): ... + def unsub_error(self, socket): ... diff --git a/src/typings/netius/base/protocol.pyi b/src/typings/netius/base/protocol.pyi new file mode 100644 index 00000000..25d004df --- /dev/null +++ b/src/typings/netius/base/protocol.pyi @@ -0,0 +1,60 @@ +import netius.base.legacy as legacy +import netius.base.observer +import netius.base.observer as observer +import netius.base.request as request +from _typeshed import Incomplete + +__version__: str +__revision__: str +__date__: str + +class Protocol(netius.base.observer.Observable): + def __init__(self, owner: Incomplete | None = ...) -> None: ... + def open(self): ... + def close(self): ... + def finish(self): ... + def open_c(self): ... + def close_c(self): ... + def finish_c(self): ... + def info_dict(self, full: bool = ...): ... + def connection_made(self, transport): ... + def connection_lost(self, exception): ... + def transport(self): ... + def loop(self): ... + def loop_set(self, loop): ... + def loop_unset(self): ... + def pause_writing(self): ... + def resume_writing(self): ... + def delay(self, callable, timeout: Incomplete | None = ...): ... + def debug(self, object): ... + def info(self, object): ... + def warning(self, object): ... + def error(self, object): ... + def critical(self, object): ... + def is_pending(self): ... + def is_open(self): ... + def is_closed(self): ... + def is_closing(self): ... + def is_closed_or_closing(self): ... + def is_devel(self): ... + def _close_transport(self, force: bool = ...): ... + def _delay_send(self, data, address: Incomplete | None = ..., callback: Incomplete | None = ...): ... + def _flush_callbacks(self): ... + def _flush_send(self): ... + +class DatagramProtocol(Protocol): + def __init__(self) -> None: ... + def datagram_received(self, data, address): ... + def error_received(self, exception): ... + def on_data(self, address, data): ... + def send(self, data, address, delay: bool = ..., force: bool = ..., callback: Incomplete | None = ...): ... + def send_to(self, data, address, delay: bool = ..., force: bool = ..., callback: Incomplete | None = ...): ... + def add_request(self, request): ... + def remove_request(self, request): ... + def get_request(self, id): ... + +class StreamProtocol(Protocol): + def data_received(self, data): ... + def eof_received(self): ... + def on_data(self, data): ... + def send(self, data, delay: bool = ..., force: bool = ..., callback: Incomplete | None = ...): ... diff --git a/src/typings/netius/base/request.pyi b/src/typings/netius/base/request.pyi new file mode 100644 index 00000000..fbb5ab5d --- /dev/null +++ b/src/typings/netius/base/request.pyi @@ -0,0 +1,20 @@ +import netius.base.errors as errors +from _typeshed import Incomplete +from typing import ClassVar + +__version__: str +__revision__: str +__date__: str +REQUEST_TIMEOUT: float + +class Request: + IDENTIFIER: ClassVar[int] = ... + def __init__(self, timeout: float = ..., callback: Incomplete | None = ...) -> None: ... + @classmethod + def _generate_id(cls): ... + +class Response: + def __init__(self, data, request: Incomplete | None = ...) -> None: ... + def parse(self): ... + def get_request(self): ... + def get_id(self): ... diff --git a/src/typings/netius/base/server.pyi b/src/typings/netius/base/server.pyi new file mode 100644 index 00000000..071a692a --- /dev/null +++ b/src/typings/netius/base/server.pyi @@ -0,0 +1,125 @@ +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.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 + +__version__: str +__revision__: str +__date__: str +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 +BUFFER_SIZE_S: None +BUFFER_SIZE_C: None + +class Server(netius.base.common.AbstractBase): + def __init__(self, *args, **kwargs) -> None: ... + def welcome(self): ... + def cleanup(self): ... + def info_dict(self, full: bool = ...): ... + def serve(self, host: Incomplete | None = ..., port: int = ..., type: int = ..., ipv6: bool = ..., ssl: bool = ..., key_file: Incomplete | None = ..., cer_file: Incomplete | None = ..., ca_file: Incomplete | None = ..., ca_root: bool = ..., ssl_verify: bool = ..., ssl_host: Incomplete | None = ..., ssl_fingerprint: Incomplete | None = ..., ssl_dump: bool = ..., setuid: Incomplete | None = ..., backlog: int = ..., load: bool = ..., start: bool = ..., env: bool = ...): ... + def socket_tcp(self, ssl: bool = ..., key_file: Incomplete | None = ..., cer_file: Incomplete | None = ..., ca_file: Incomplete | None = ..., ca_root: bool = ..., ssl_verify: bool = ..., family: socket.AddressFamily = ..., type: socket.SocketKind = ...): ... + def socket_udp(self, family: socket.AddressFamily = ..., type: socket.SocketKind = ...): ... + def on_serve(self): ... + +class DatagramServer(Server): + def __init__(self, *args, **kwargs) -> None: ... + def reads(self, reads, state: bool = ...): ... + def writes(self, writes, state: bool = ...): ... + def errors(self, errors, state: bool = ...): ... + def serve(self, type: int = ..., *args, **kwargs): ... + def on_read(self, _socket): ... + def on_write(self, _socket): ... + def on_error(self, _socket): ... + def on_exception(self, exception): ... + def on_expected(self, exception): ... + def on_data(self, address, data): ... + def ensure_write(self): ... + def remove_write(self): ... + def enable_read(self): ... + def disable_read(self): ... + def send(self, data, address, delay: bool = ..., callback: Incomplete | None = ...): ... + def _send(self, _socket): ... + def _flush_write(self): ... + +class StreamServer(Server): + def reads(self, reads, state: bool = ...): ... + def writes(self, writes, state: bool = ...): ... + def errors(self, errors, state: bool = ...): ... + def serve(self, type: int = ..., *args, **kwargs): ... + def on_read_s(self, _socket): ... + def on_write_s(self, _socket): ... + def on_error_s(self, _socket): ... + def on_read(self, _socket): ... + def on_write(self, _socket): ... + def on_error(self, _socket): ... + def on_exception(self, exception, connection): ... + def on_exception_s(self, exception): ... + def on_expected(self, exception, connection): ... + def on_expected_s(self, exception): ... + def on_upgrade(self, connection): ... + def on_ssl(self, connection): ... + def on_data(self, connection, data): ... + def on_socket_c(self, socket_c, address): ... + def on_socket_d(self, socket_c): ... + def _ssl_handshake(self, connection): ... diff --git a/src/typings/netius/base/stream.pyi b/src/typings/netius/base/stream.pyi new file mode 100644 index 00000000..4dfb2df5 --- /dev/null +++ b/src/typings/netius/base/stream.pyi @@ -0,0 +1,20 @@ +import netius.base.observer +import netius.base.observer as observer +from _typeshed import Incomplete + +__version__: str +__revision__: str +__date__: str +OPEN: int +CLOSED: int +PENDING: int + +class Stream(netius.base.observer.Observable): + def __init__(self, owner: Incomplete | None = ...) -> None: ... + def reset(self): ... + def open(self): ... + def close(self): ... + def info_dict(self, full: bool = ...): ... + def is_open(self): ... + def is_closed(self): ... + def is_pending(self): ... diff --git a/src/typings/netius/base/tls.pyi b/src/typings/netius/base/tls.pyi new file mode 100644 index 00000000..a3e25c63 --- /dev/null +++ b/src/typings/netius/base/tls.pyi @@ -0,0 +1,12 @@ +import netius.base.config as config +import netius.base.errors as errors +from _typeshed import Incomplete + +__version__: str +__revision__: str +__date__: str +def fingerprint(certificate, hash: str = ...): ... +def match_fingerprint(certificate, exp_fingerprint, hash: str = ...): ... +def match_hostname(certificate, hostname): ... +def dnsname_match(domain, hostname, max_wildcards: int = ...): ... +def dump_certificate(certificate, certificate_binary, name: Incomplete | None = ...): ... diff --git a/src/typings/netius/base/transport.pyi b/src/typings/netius/base/transport.pyi new file mode 100644 index 00000000..715d6a61 --- /dev/null +++ b/src/typings/netius/base/transport.pyi @@ -0,0 +1,43 @@ +import netius.base.errors as errors +import netius.base.observer +import netius.base.observer as observer +from _typeshed import Incomplete + +__version__: str +__revision__: str +__date__: str + +class Transport(netius.base.observer.Observable): + def __init__(self, loop, connection, open: bool = ...) -> None: ... + def open(self): ... + def close(self): ... + def abort(self): ... + def write(self, data): ... + def sendto(self, data, addr: Incomplete | None = ...): ... + def get_extra_info(self, name, default: Incomplete | None = ...): ... + def get_write_buffer_size(self): ... + def get_write_buffer_limits(self): ... + def set_handlers(self): ... + def set_write_buffer_limits(self, high: Incomplete | None = ..., low: Incomplete | None = ...): ... + def set_extra_dict(self): ... + def get_protocol(self): ... + def set_protocol(self, protocol): ... + def is_closing(self): ... + def _on_data(self, connection, data): ... + def _on_close(self, connection): ... + def _set_compat(self, protocol): ... + def _set_binds(self): ... + def _set_protocol(self, protocol, mark: bool = ...): ... + def _buffer_touched(self, connection): ... + def _handle_flow(self): ... + def _cleanup(self): ... + def _call_connection_lost(self, context): ... + def _call_soon(self, callback, *args): ... + +class TransportDatagram(Transport): + def _on_data(self, connection, data): ... + def _on_close(self, connection): ... + +class TransportStream(Transport): + def _on_data(self, connection, data): ... + def _on_close(self, connection): ... diff --git a/src/typings/netius/base/util.pyi b/src/typings/netius/base/util.pyi new file mode 100644 index 00000000..4ae49a00 --- /dev/null +++ b/src/typings/netius/base/util.pyi @@ -0,0 +1,8 @@ +import netius.base.errors as errors +from _typeshed import Incomplete + +__version__: str +__revision__: str +__date__: str +def camel_to_underscore(camel, separator: str = ...): ... +def verify(condition, message: Incomplete | None = ..., exception: Incomplete | None = ...): ... diff --git a/src/typings/netius/clients/__init__.pyi b/src/typings/netius/clients/__init__.pyi new file mode 100644 index 00000000..0e37b2d9 --- /dev/null +++ b/src/typings/netius/clients/__init__.pyi @@ -0,0 +1,17 @@ +from . import apn as apn, dht as dht, dns as dns, http as http, mjpg as mjpg, raw as raw, smtp as smtp, ssdp as ssdp, torrent as torrent, ws as ws +from netius.clients.apn import APNClient as APNClient, APNProtocol as APNProtocol +from netius.clients.dht import DHTClient as DHTClient, DHTRequest as DHTRequest, DHTResponse as DHTResponse +from netius.clients.dns import DNSClient as DNSClient, DNSProtocol as DNSProtocol, DNSRequest as DNSRequest, DNSResponse as DNSResponse +from netius.clients.http import HTTPClient as HTTPClient, HTTPProtocol as HTTPProtocol +from netius.clients.mjpg import MJPGClient as MJPGClient, MJPGProtocol as MJPGProtocol +from netius.clients.raw import RawClient as RawClient, RawProtocol as RawProtocol +from netius.clients.smtp import SMTPClient as SMTPClient, SMTPConnection as SMTPConnection +from netius.clients.ssdp import SSDPClient as SSDPClient, SSDPProtocol as SSDPProtocol +from netius.clients.torrent import TorrentClient as TorrentClient, TorrentConnection as TorrentConnection +from netius.clients.ws import WSClient as WSClient, WSProtocol as WSProtocol + +__version__: str +__revision__: str +__date__: str +CHOKED: int +UNCHOKED: int diff --git a/src/typings/netius/clients/apn.pyi b/src/typings/netius/clients/apn.pyi new file mode 100644 index 00000000..241787de --- /dev/null +++ b/src/typings/netius/clients/apn.pyi @@ -0,0 +1,34 @@ +import netius as netius +import netius.base.agent +import netius.base.protocol +from _typeshed import Incomplete +from typing import ClassVar + +__version__: str +__revision__: str +__date__: str + +class APNProtocol(netius.base.protocol.StreamProtocol): + HOST: ClassVar[str] = ... + PORT: ClassVar[int] = ... + SANDBOX_HOST: ClassVar[str] = ... + SANDBOX_PORT: ClassVar[int] = ... + def __init__(self, *args, **kwargs) -> None: ... + def connection_made(self, transport): ... + def send_notification(self, token, message, sound: str = ..., badge: int = ..., close: bool = ...): ... + def set(self, token, message, sound: str = ..., badge: int = ..., sandbox: bool = ..., key_file: Incomplete | None = ..., cer_file: Incomplete | None = ..., _close: bool = ...): ... + def notify(self, token, loop: Incomplete | None = ..., **kwargs): ... + +class APNClient(netius.base.agent.ClientAgent): + class protocol(netius.base.protocol.StreamProtocol): + HOST: ClassVar[str] = ... + PORT: ClassVar[int] = ... + SANDBOX_HOST: ClassVar[str] = ... + SANDBOX_PORT: ClassVar[int] = ... + def __init__(self, *args, **kwargs) -> None: ... + def connection_made(self, transport): ... + def send_notification(self, token, message, sound: str = ..., badge: int = ..., close: bool = ...): ... + def set(self, token, message, sound: str = ..., badge: int = ..., sandbox: bool = ..., key_file: Incomplete | None = ..., cer_file: Incomplete | None = ..., _close: bool = ...): ... + def notify(self, token, loop: Incomplete | None = ..., **kwargs): ... + @classmethod + def notify_s(cls, token, loop: Incomplete | None = ..., **kwargs): ... diff --git a/src/typings/netius/clients/dht.pyi b/src/typings/netius/clients/dht.pyi new file mode 100644 index 00000000..22d69498 --- /dev/null +++ b/src/typings/netius/clients/dht.pyi @@ -0,0 +1,35 @@ +import netius as netius +import netius.base.client +import netius.base.request +from _typeshed import Incomplete + +__version__: str +__revision__: str +__date__: str + +class DHTRequest(netius.base.request.Request): + def __init__(self, peer_id, host: str = ..., port: int = ..., type: str = ..., callback: Incomplete | None = ..., *args, **kwargs) -> None: ... + @classmethod + def contact(cls, host, port): ... + def request(self): ... + def ping(self): ... + def find_node(self): ... + def get_peers(self): ... + def announce_peer(self): ... + def _get_peer_id(self): ... + +class DHTResponse(netius.base.request.Response): + def __init__(self, data) -> None: ... + def parse(self): ... + def get_id(self): ... + def get_payload(self): ... + def is_error(self): ... + def is_response(self): ... + +class DHTClient(netius.base.client.DatagramClient): + def ping(self, host, port, peer_id, *args, **kwargs): ... + def find_node(self, *args, **kwargs): ... + def get_peers(self, *args, **kwargs): ... + def query(self, host: str = ..., port: int = ..., peer_id: Incomplete | None = ..., type: str = ..., callback: Incomplete | None = ..., *args, **kwargs): ... + def on_data(self, address, data): ... + def on_data_dht(self, address, response): ... diff --git a/src/typings/netius/clients/dns.pyi b/src/typings/netius/clients/dns.pyi new file mode 100644 index 00000000..82fe2dd3 --- /dev/null +++ b/src/typings/netius/clients/dns.pyi @@ -0,0 +1,84 @@ +import netius as netius +import netius.base.agent +import netius.base.protocol +import netius.base.request +from _typeshed import Incomplete +from typing import ClassVar + +__version__: str +__revision__: str +__date__: str +DNS_QUERY: int +DNS_RESPONSE: int +DNS_SQUERY: int +DNS_IQUERY: int +DNS_STATUS: int +DNS_AA: int +DNS_TC: int +DNS_RD: int +DNS_TYPES: dict +DNS_CLASSES: dict +DNS_TYPES_R: dict +DNS_CLASSES_R: dict + +class DNSRequest(netius.base.request.Request): + def __init__(self, name, type: str = ..., cls: str = ..., callback: Incomplete | None = ...) -> None: ... + def request(self): ... + def _query(self, name, type: str = ..., cls: str = ...): ... + def _label(self, value): ... + +class DNSResponse(netius.base.request.Response): + def parse(self): ... + def get_id(self): ... + def parse_qd(self, data, index): ... + def parse_an(self, data, index): ... + def parse_payload(self, data, index, type_s): ... + def parse_a(self, data, index): ... + def parse_aaaa(self, data, index): ... + def parse_mx(self, data, index): ... + def parse_cname(self, data, index): ... + def parse_ns(self, data, index): ... + def parse_ar(self, data, index): ... + def parse_label(self, data, index): ... + def parse_pointer(self, data, index): ... + def parse_ip4(self, data, index): ... + def parse_ip6(self, data, index): ... + def parse_byte(self, data, index): ... + def parse_short(self, data, index): ... + def parse_long(self, data, index): ... + def parse_long_long(self, data, index): ... + +class DNSProtocol(netius.base.protocol.DatagramProtocol): + ns_file_l: ClassVar[None] = ... + @classmethod + def ns_system(cls, type: str = ...): ... + @classmethod + def ns_conf(cls, type: str = ..., force: bool = ...): ... + @classmethod + def ns_file(cls, type: str = ..., force: bool = ...): ... + @classmethod + def ns_google(cls, type: str = ...): ... + @classmethod + def ns_cloudfare(cls, type: str = ...): ... + def query(self, name, type: str = ..., cls: str = ..., ns: Incomplete | None = ..., callback: Incomplete | None = ...): ... + def on_data(self, address, data): ... + def on_data_dns(self, address, response): ... + +class DNSClient(netius.base.agent.ClientAgent): + class protocol(netius.base.protocol.DatagramProtocol): + ns_file_l: ClassVar[None] = ... + @classmethod + def ns_system(cls, type: str = ...): ... + @classmethod + def ns_conf(cls, type: str = ..., force: bool = ...): ... + @classmethod + def ns_file(cls, type: str = ..., force: bool = ...): ... + @classmethod + def ns_google(cls, type: str = ...): ... + @classmethod + def ns_cloudfare(cls, type: str = ...): ... + def query(self, name, type: str = ..., cls: str = ..., ns: Incomplete | None = ..., callback: Incomplete | None = ...): ... + def on_data(self, address, data): ... + def on_data_dns(self, address, response): ... + @classmethod + def query_s(cls, name, type: str = ..., cls_: str = ..., ns: Incomplete | None = ..., callback: Incomplete | None = ..., loop: Incomplete | None = ...): ... diff --git a/src/typings/netius/clients/http.pyi b/src/typings/netius/clients/http.pyi new file mode 100644 index 00000000..9f5cc585 --- /dev/null +++ b/src/typings/netius/clients/http.pyi @@ -0,0 +1,164 @@ +import netius as netius +import netius.base.agent +import netius.base.protocol +from _typeshed import Incomplete +from typing import ClassVar + +__version__: str +__revision__: str +__date__: str +PLAIN_ENCODING: int +CHUNKED_ENCODING: int +GZIP_ENCODING: int +DEFLATE_ENCODING: int +Z_PARTIAL_FLUSH: int + +class HTTPProtocol(netius.base.protocol.StreamProtocol): + BASE_HEADERS: ClassVar[dict] = ... + def __init__(self, method, url, params: Incomplete | None = ..., headers: Incomplete | None = ..., data: Incomplete | None = ..., version: str = ..., encoding: int = ..., encodings: str = ..., safe: bool = ..., request: bool = ..., asynchronous: bool = ..., timeout: Incomplete | None = ..., use_file: bool = ..., callback: Incomplete | None = ..., on_init: Incomplete | None = ..., on_open: Incomplete | None = ..., on_close: Incomplete | None = ..., on_headers: Incomplete | None = ..., on_data: Incomplete | None = ..., on_result: Incomplete | None = ..., *args, **kwargs) -> None: ... + @classmethod + def key_g(cls, url): ... + @classmethod + def decode_gzip(cls, data): ... + @classmethod + def decode_deflate(cls, data): ... + @classmethod + def decode_zlib_file(cls, input, output, buffer_size: int = ..., wbits: int = ...): ... + @classmethod + def decode_gzip_file(cls, input, output, buffer_size: int = ..., wbits: int = ...): ... + @classmethod + def decode_deflate_file(cls, input, output, buffer_size: int = ..., wbits: int = ...): ... + @classmethod + def set_request(cls, parser, buffer, request: Incomplete | None = ...): ... + @classmethod + def set_request_file(cls, parser, input, request: Incomplete | None = ..., output: Incomplete | None = ..., buffer_size: int = ...): ... + @classmethod + def set_error(cls, error, message: Incomplete | None = ..., request: Incomplete | None = ..., force: bool = ...): ... + def open_c(self, *args, **kwargs): ... + def close_c(self, *args, **kwargs): ... + def info_dict(self, full: bool = ...): ... + def connection_made(self, transport): ... + def loop_set(self, loop): ... + def flush(self, force: bool = ..., callback: Incomplete | None = ...): ... + def send_base(self, data, stream: Incomplete | None = ..., final: bool = ..., delay: bool = ..., force: bool = ..., callback: Incomplete | None = ...): ... + def send_plain(self, data, stream: Incomplete | None = ..., final: bool = ..., delay: bool = ..., force: bool = ..., callback: Incomplete | None = ...): ... + def send_chunked(self, data, stream: Incomplete | None = ..., final: bool = ..., delay: bool = ..., force: bool = ..., callback: Incomplete | None = ...): ... + def send_gzip(self, data, stream: Incomplete | None = ..., final: bool = ..., delay: bool = ..., force: bool = ..., callback: Incomplete | None = ..., level: int = ...): ... + def set(self, method, url, params: Incomplete | None = ..., headers: Incomplete | None = ..., data: Incomplete | None = ..., version: str = ..., encoding: int = ..., encodings: str = ..., safe: bool = ..., request: bool = ..., asynchronous: bool = ..., timeout: Incomplete | None = ..., use_file: bool = ..., callback: Incomplete | None = ..., on_init: Incomplete | None = ..., on_open: Incomplete | None = ..., on_close: Incomplete | None = ..., on_headers: Incomplete | None = ..., on_data: Incomplete | None = ..., on_result: Incomplete | None = ...): ... + def set_all(self): ... + def set_static(self): ... + def set_dynamic(self): ... + def run_request(self): ... + def send_request(self, callback: Incomplete | None = ...): ... + def wrap_request(self, use_file: bool = ..., callback: Incomplete | None = ..., on_close: Incomplete | None = ..., on_data: Incomplete | None = ..., on_result: Incomplete | None = ...): ... + def set_headers(self, headers, normalize: bool = ...): ... + def normalize_headers(self): ... + def parse(self, data): ... + def raw_data(self, data): ... + def is_plain(self): ... + def is_chunked(self): ... + def is_gzip(self): ... + def is_deflate(self): ... + def is_compressed(self): ... + def is_uncompressed(self): ... + def is_flushed(self): ... + def is_measurable(self, strict: bool = ...): ... + def on_data(self, data): ... + def _on_data(self): ... + def on_partial(self, data): ... + def on_headers(self): ... + def on_chunk(self, range): ... + def _flush_plain(self, force: bool = ..., callback: Incomplete | None = ...): ... + def _flush_chunked(self, force: bool = ..., callback: Incomplete | None = ...): ... + def _flush_gzip(self, force: bool = ..., callback: Incomplete | None = ...): ... + def _close_gzip(self, safe: bool = ...): ... + def _apply_base(self, headers, replace: bool = ...): ... + def _apply_dynamic(self, headers): ... + def _apply_connection(self, headers, strict: bool = ...): ... + def _headers_normalize(self, headers): ... + +class HTTPClient(netius.base.agent.ClientAgent): + class protocol(netius.base.protocol.StreamProtocol): + BASE_HEADERS: ClassVar[dict] = ... + def __init__(self, method, url, params: Incomplete | None = ..., headers: Incomplete | None = ..., data: Incomplete | None = ..., version: str = ..., encoding: int = ..., encodings: str = ..., safe: bool = ..., request: bool = ..., asynchronous: bool = ..., timeout: Incomplete | None = ..., use_file: bool = ..., callback: Incomplete | None = ..., on_init: Incomplete | None = ..., on_open: Incomplete | None = ..., on_close: Incomplete | None = ..., on_headers: Incomplete | None = ..., on_data: Incomplete | None = ..., on_result: Incomplete | None = ..., *args, **kwargs) -> None: ... + @classmethod + def key_g(cls, url): ... + @classmethod + def decode_gzip(cls, data): ... + @classmethod + def decode_deflate(cls, data): ... + @classmethod + def decode_zlib_file(cls, input, output, buffer_size: int = ..., wbits: int = ...): ... + @classmethod + def decode_gzip_file(cls, input, output, buffer_size: int = ..., wbits: int = ...): ... + @classmethod + def decode_deflate_file(cls, input, output, buffer_size: int = ..., wbits: int = ...): ... + @classmethod + def set_request(cls, parser, buffer, request: Incomplete | None = ...): ... + @classmethod + def set_request_file(cls, parser, input, request: Incomplete | None = ..., output: Incomplete | None = ..., buffer_size: int = ...): ... + @classmethod + def set_error(cls, error, message: Incomplete | None = ..., request: Incomplete | None = ..., force: bool = ...): ... + def open_c(self, *args, **kwargs): ... + def close_c(self, *args, **kwargs): ... + def info_dict(self, full: bool = ...): ... + def connection_made(self, transport): ... + def loop_set(self, loop): ... + def flush(self, force: bool = ..., callback: Incomplete | None = ...): ... + def send_base(self, data, stream: Incomplete | None = ..., final: bool = ..., delay: bool = ..., force: bool = ..., callback: Incomplete | None = ...): ... + def send_plain(self, data, stream: Incomplete | None = ..., final: bool = ..., delay: bool = ..., force: bool = ..., callback: Incomplete | None = ...): ... + def send_chunked(self, data, stream: Incomplete | None = ..., final: bool = ..., delay: bool = ..., force: bool = ..., callback: Incomplete | None = ...): ... + def send_gzip(self, data, stream: Incomplete | None = ..., final: bool = ..., delay: bool = ..., force: bool = ..., callback: Incomplete | None = ..., level: int = ...): ... + def set(self, method, url, params: Incomplete | None = ..., headers: Incomplete | None = ..., data: Incomplete | None = ..., version: str = ..., encoding: int = ..., encodings: str = ..., safe: bool = ..., request: bool = ..., asynchronous: bool = ..., timeout: Incomplete | None = ..., use_file: bool = ..., callback: Incomplete | None = ..., on_init: Incomplete | None = ..., on_open: Incomplete | None = ..., on_close: Incomplete | None = ..., on_headers: Incomplete | None = ..., on_data: Incomplete | None = ..., on_result: Incomplete | None = ...): ... + def set_all(self): ... + def set_static(self): ... + def set_dynamic(self): ... + def run_request(self): ... + def send_request(self, callback: Incomplete | None = ...): ... + def wrap_request(self, use_file: bool = ..., callback: Incomplete | None = ..., on_close: Incomplete | None = ..., on_data: Incomplete | None = ..., on_result: Incomplete | None = ...): ... + def set_headers(self, headers, normalize: bool = ...): ... + def normalize_headers(self): ... + def parse(self, data): ... + def raw_data(self, data): ... + def is_plain(self): ... + def is_chunked(self): ... + def is_gzip(self): ... + def is_deflate(self): ... + def is_compressed(self): ... + def is_uncompressed(self): ... + def is_flushed(self): ... + def is_measurable(self, strict: bool = ...): ... + def on_data(self, data): ... + def _on_data(self): ... + def on_partial(self, data): ... + def on_headers(self): ... + def on_chunk(self, range): ... + def _flush_plain(self, force: bool = ..., callback: Incomplete | None = ...): ... + def _flush_chunked(self, force: bool = ..., callback: Incomplete | None = ...): ... + def _flush_gzip(self, force: bool = ..., callback: Incomplete | None = ...): ... + def _close_gzip(self, safe: bool = ...): ... + def _apply_base(self, headers, replace: bool = ...): ... + def _apply_dynamic(self, headers): ... + def _apply_connection(self, headers, strict: bool = ...): ... + def _headers_normalize(self, headers): ... + def __init__(self, auto_release: bool = ..., *args, **kwargs) -> None: ... + @classmethod + def get_s(cls, url, params: dict = ..., headers: dict = ..., **kwargs): ... + @classmethod + def post_s(cls, url, params: dict = ..., headers: dict = ..., data: Incomplete | None = ..., **kwargs): ... + @classmethod + def put_s(cls, url, params: dict = ..., headers: dict = ..., data: Incomplete | None = ..., **kwargs): ... + @classmethod + def delete_s(cls, url, params: dict = ..., headers: dict = ..., **kwargs): ... + @classmethod + def method_s(cls, method, url, params: dict = ..., headers: dict = ..., data: Incomplete | None = ..., version: str = ..., safe: bool = ..., asynchronous: bool = ..., daemon: bool = ..., timeout: Incomplete | None = ..., ssl_verify: bool = ..., use_file: bool = ..., callback: Incomplete | None = ..., on_init: Incomplete | None = ..., on_open: Incomplete | None = ..., on_close: Incomplete | None = ..., on_headers: Incomplete | None = ..., on_data: Incomplete | None = ..., on_result: Incomplete | None = ..., http_client: Incomplete | None = ..., **kwargs): ... + @classmethod + def to_response(cls, map, raise_e: bool = ...): ... + def cleanup(self): ... + def get(self, url, params: dict = ..., headers: dict = ..., **kwargs): ... + def post(self, url, params: dict = ..., headers: dict = ..., data: Incomplete | None = ..., **kwargs): ... + def put(self, url, params: dict = ..., headers: dict = ..., data: Incomplete | None = ..., **kwargs): ... + def delete(self, url, params: dict = ..., headers: dict = ..., **kwargs): ... + def method(self, method, url, params: Incomplete | None = ..., headers: Incomplete | None = ..., data: Incomplete | None = ..., version: str = ..., encoding: int = ..., encodings: str = ..., safe: bool = ..., request: bool = ..., close: bool = ..., asynchronous: bool = ..., timeout: Incomplete | None = ..., ssl_verify: bool = ..., use_file: bool = ..., callback: Incomplete | None = ..., on_init: Incomplete | None = ..., on_open: Incomplete | None = ..., on_close: Incomplete | None = ..., on_headers: Incomplete | None = ..., on_data: Incomplete | None = ..., on_result: Incomplete | None = ..., loop: Incomplete | None = ..., **kwargs): ... + def _get_loop(self, **kwargs): ... + def _close_loop(self): ... diff --git a/src/typings/netius/clients/mjpg.pyi b/src/typings/netius/clients/mjpg.pyi new file mode 100644 index 00000000..31bc2544 --- /dev/null +++ b/src/typings/netius/clients/mjpg.pyi @@ -0,0 +1,27 @@ +import netius as netius +import netius.clients.http +import netius.clients.http as http +from typing import ClassVar + +__version__: str +__revision__: str +__date__: str + +class MJPGProtocol(netius.clients.http.HTTPProtocol): + MAGIC_JPEG: ClassVar[bytes] = ... + EOI_JPEG: ClassVar[bytes] = ... + def __init__(self, *args, **kwargs) -> None: ... + def add_buffer(self, data): ... + def get_buffer(self, delete: bool = ...): ... + def on_partial(self, data): ... + def on_frame_mjpg(self, data): ... + +class MJPGClient(netius.clients.http.HTTPClient): + class protocol(netius.clients.http.HTTPProtocol): + MAGIC_JPEG: ClassVar[bytes] = ... + EOI_JPEG: ClassVar[bytes] = ... + def __init__(self, *args, **kwargs) -> None: ... + def add_buffer(self, data): ... + def get_buffer(self, delete: bool = ...): ... + def on_partial(self, data): ... + def on_frame_mjpg(self, data): ... diff --git a/src/typings/netius/clients/raw.pyi b/src/typings/netius/clients/raw.pyi new file mode 100644 index 00000000..0223cf45 --- /dev/null +++ b/src/typings/netius/clients/raw.pyi @@ -0,0 +1,17 @@ +import netius as netius +import netius.base.agent +import netius.base.protocol +from _typeshed import Incomplete + +__version__: str +__revision__: str +__date__: str + +class RawProtocol(netius.base.protocol.StreamProtocol): + def send_basic(self): ... + +class RawClient(netius.base.agent.ClientAgent): + class protocol(netius.base.protocol.StreamProtocol): + def send_basic(self): ... + @classmethod + def run_s(cls, host, port: int = ..., loop: Incomplete | None = ..., *args, **kwargs): ... diff --git a/src/typings/netius/clients/smtp.pyi b/src/typings/netius/clients/smtp.pyi new file mode 100644 index 00000000..d29a78d1 --- /dev/null +++ b/src/typings/netius/clients/smtp.pyi @@ -0,0 +1,88 @@ +import netius as netius +import netius.base.client +import netius.base.conn +import netius.clients.dns as dns +from _typeshed import Incomplete +from typing import ClassVar + +__version__: str +__revision__: str +__date__: str +HELO_STATE: int +EHLO_STATE: int +CAPA_STATE: int +STLS_STATE: int +UPGRADE_STATE: int +AUTH_STATE: int +USERNAME_STATE: int +PASSWORD_STATE: int +FROM_STATE: int +TO_STATE: int +DATA_STATE: int +CONTENTS_STATE: int +QUIT_STATE: int +FINAL_STATE: int + +class SMTPConnection(netius.base.conn.BaseConnection): + AUTH_METHODS: ClassVar[tuple] = ... + def __init__(self, host: str = ..., *args, **kwargs) -> None: ... + def open(self, *args, **kwargs): ... + def close(self, *args, **kwargs): ... + def build(self): ... + def destroy(self): ... + def set_smtp(self, froms, tos, contents, username: Incomplete | None = ..., password: Incomplete | None = ...): ... + def set_sequence(self, sequence, safe: bool = ...): ... + def set_message_seq(self, ehlo: bool = ...): ... + def set_message_stls_seq(self, ehlo: bool = ...): ... + def set_capabilities(self, capabilities, force: bool = ...): ... + def next_sequence(self): ... + def parse(self, data): ... + def send_smtp(self, code, message: str = ..., delay: bool = ..., callback: Incomplete | None = ...): ... + def on_line(self, code, message, is_final: bool = ...): ... + def call(self): ... + def skip(self): ... + def helo_t(self): ... + def ehlo_t(self): ... + def capa_t(self): ... + def stls_t(self): ... + def upgrade_t(self): ... + def auth_t(self): ... + def username_t(self): ... + def password_t(self): ... + def mail_t(self): ... + def rcpt_t(self): ... + def data_t(self): ... + def contents_t(self): ... + def quit_t(self): ... + def close_t(self): ... + def pass_t(self): ... + def helo(self, host): ... + def ehlo(self, host): ... + def starttls(self): ... + def auth(self, username, password, method: str = ...): ... + def auth_plain(self, username, password): ... + def auth_login(self, username, password): ... + def login_username(self, username): ... + def login_password(self, password): ... + def mail(self, value): ... + def rcpt(self, value): ... + def data(self): ... + def quit(self): ... + def set_expected(self, expected): ... + def assert_c(self, code): ... + def assert_s(self, expected): ... + def best_auth(self): ... + +class SMTPClient(netius.base.client.StreamClient): + def __init__(self, host: Incomplete | None = ..., auto_close: bool = ..., *args, **kwargs) -> None: ... + @classmethod + def message_s(cls, froms, tos, contents, daemon: bool = ..., host: Incomplete | None = ..., mark: bool = ..., callback: Incomplete | None = ...): ... + def message(self, froms, tos, contents, host: Incomplete | None = ..., port: int = ..., username: Incomplete | None = ..., password: Incomplete | None = ..., ehlo: bool = ..., stls: bool = ..., mark: bool = ..., ensure_loop: bool = ..., callback: Incomplete | None = ...): ... + def on_connect(self, connection): ... + def on_upgrade(self, connection): ... + def on_data(self, connection, data): ... + def on_connection_d(self, connection): ... + def build_connection(self, socket, address, ssl: bool = ...): ... + def mark(self, contents): ... + def date(self, message): ... + def user_agent(self, message): ... diff --git a/src/typings/netius/clients/ssdp.pyi b/src/typings/netius/clients/ssdp.pyi new file mode 100644 index 00000000..1a6860fb --- /dev/null +++ b/src/typings/netius/clients/ssdp.pyi @@ -0,0 +1,25 @@ +import netius as netius +import netius.base.agent +import netius.base.protocol +from _typeshed import Incomplete + +__version__: str +__revision__: str +__date__: str + +class SSDPProtocol(netius.base.protocol.DatagramProtocol): + def on_data(self, address, data): ... + def on_headers_parser(self): ... + def discover(self, target, *args, **kwargs): ... + def method(self, method, target, namespace, mx: int = ..., path: str = ..., params: Incomplete | None = ..., headers: Incomplete | None = ..., data: Incomplete | None = ..., host: str = ..., port: int = ..., version: str = ..., callback: Incomplete | None = ...): ... + +class SSDPClient(netius.base.agent.ClientAgent): + class protocol(netius.base.protocol.DatagramProtocol): + def on_data(self, address, data): ... + def on_headers_parser(self): ... + def discover(self, target, *args, **kwargs): ... + def method(self, method, target, namespace, mx: int = ..., path: str = ..., params: Incomplete | None = ..., headers: Incomplete | None = ..., data: Incomplete | None = ..., host: str = ..., port: int = ..., version: str = ..., callback: Incomplete | None = ...): ... + @classmethod + def discover_s(cls, target, *args, **kwargs): ... + @classmethod + def method_s(cls, method, target, namespace, mx: int = ..., path: str = ..., params: Incomplete | None = ..., headers: Incomplete | None = ..., data: Incomplete | None = ..., host: str = ..., port: int = ..., version: str = ..., callback: Incomplete | None = ..., loop: Incomplete | None = ...): ... diff --git a/src/typings/netius/clients/torrent.pyi b/src/typings/netius/clients/torrent.pyi new file mode 100644 index 00000000..80acc308 --- /dev/null +++ b/src/typings/netius/clients/torrent.pyi @@ -0,0 +1,51 @@ +import netius as netius +import netius.base.client +import netius.base.conn +from _typeshed import Incomplete + +__version__: str +__revision__: str +__date__: str +HANDSHAKE_STATE: int +NORMAL_STATE: int +CHOKED: int +UNCHOKED: int +ALIVE_TIMEOUT: float +SPEED_LIMIT: int +BLOCK_SIZE: int + +class TorrentConnection(netius.base.conn.BaseConnection): + def __init__(self, max_requests: int = ..., *args, **kwargs) -> None: ... + def open(self, *args, **kwargs): ... + def close(self, *args, **kwargs): ... + def on_close(self, connection): ... + def on_handshake(self, protocol, reserved, info_hash, peer_id): ... + def on_message(self, length, type, data): ... + def parse(self, data): ... + def handle(self, type, data): ... + def bitfield_t(self, data): ... + def choke_t(self, data): ... + def unchoke_t(self, data): ... + def piece_t(self, data): ... + def port_t(self, data): ... + def next(self, count: Incomplete | None = ...): ... + def add_request(self, block): ... + def remove_request(self, block): ... + def reset(self): ... + def release(self): ... + def handshake(self): ... + def keep_alive(self): ... + def choke(self): ... + def unchoke(self): ... + def interested(self): ... + def not_interested(self): ... + def have(self, index): ... + def request(self, index, begin: int = ..., length: int = ...): ... + def is_alive(self, timeout: float = ..., schedule: bool = ...): ... + +class TorrentClient(netius.base.client.StreamClient): + def peer(self, task, host, port, ssl: bool = ..., connection: Incomplete | None = ...): ... + def on_connect(self, connection): ... + def on_acquire(self, connection): ... + def on_data(self, connection, data): ... + def build_connection(self, socket, address, ssl: bool = ...): ... diff --git a/src/typings/netius/clients/ws.pyi b/src/typings/netius/clients/ws.pyi new file mode 100644 index 00000000..89ebe797 --- /dev/null +++ b/src/typings/netius/clients/ws.pyi @@ -0,0 +1,46 @@ +import netius as netius +import netius.base.agent +import netius.base.protocol +from _typeshed import Incomplete +from typing import ClassVar + +__version__: str +__revision__: str +__date__: str + +class WSProtocol(netius.base.protocol.StreamProtocol): + MAGIC_VALUE: ClassVar[str] = ... + @classmethod + def _key(cls, size: int = ...): ... + def __init__(self, *args, **kwargs) -> None: ... + def connection_made(self, transport): ... + def on_data(self, data): ... + def on_data_ws(self, data): ... + def on_handshake(self): ... + def connect_ws(self, url, callback: Incomplete | None = ..., loop: Incomplete | None = ...): ... + def send_ws(self, data, callback: Incomplete | None = ...): ... + def receive_ws(self, decoded): ... + def add_buffer(self, data): ... + def get_buffer(self, delete: bool = ...): ... + def do_handshake(self): ... + def validate_key(self): ... + +class WSClient(netius.base.agent.ClientAgent): + class protocol(netius.base.protocol.StreamProtocol): + MAGIC_VALUE: ClassVar[str] = ... + @classmethod + def _key(cls, size: int = ...): ... + def __init__(self, *args, **kwargs) -> None: ... + def connection_made(self, transport): ... + def on_data(self, data): ... + def on_data_ws(self, data): ... + def on_handshake(self): ... + def connect_ws(self, url, callback: Incomplete | None = ..., loop: Incomplete | None = ...): ... + def send_ws(self, data, callback: Incomplete | None = ...): ... + def receive_ws(self, decoded): ... + def add_buffer(self, data): ... + def get_buffer(self, delete: bool = ...): ... + def do_handshake(self): ... + def validate_key(self): ... + @classmethod + def connect_ws_s(cls, url, callback: Incomplete | None = ..., loop: Incomplete | None = ...): ... diff --git a/src/typings/netius/common/__init__.pyi b/src/typings/netius/common/__init__.pyi new file mode 100644 index 00000000..5a946002 --- /dev/null +++ b/src/typings/netius/common/__init__.pyi @@ -0,0 +1,83 @@ +from . import asn as asn, calc as calc, dhcp as dhcp, dkim as dkim, ftp as ftp, geo as geo, http as http, http2 as http2, mime as mime, parser as parser, pop as pop, rsa as rsa, setup as setup, smtp as smtp, socks as socks, stream as stream, structures as structures, style as style, tftp as tftp, tls as tls, torrent as torrent, util as util, ws as ws +from netius.common.asn import asn1_build as asn1_build, asn1_gen as asn1_gen, asn1_length as asn1_length, asn1_parse as asn1_parse +from netius.common.calc import ceil_integer as ceil_integer, egcd as egcd, gcd as gcd, is_prime as is_prime, jacobi as jacobi, jacobi_witness as jacobi_witness, modinv as modinv, prime as prime, random_integer_interval as random_integer_interval, random_primality as random_primality, relatively_prime as relatively_prime +from netius.common.dhcp import AddressPool as AddressPool +from netius.common.dkim import dkim_body as dkim_body, dkim_fold as dkim_fold, dkim_generate as dkim_generate, dkim_headers as dkim_headers, dkim_sign as dkim_sign +from netius.common.ftp import FTPParser as FTPParser +from netius.common.geo import GeoResolver as GeoResolver +from netius.common.http import HTTPParser as HTTPParser, HTTPResponse as HTTPResponse +from netius.common.http2 import HTTP2Parser as HTTP2Parser, HTTP2Stream as HTTP2Stream +from netius.common.mime import mime_register as mime_register, rfc822_join as rfc822_join, rfc822_parse as rfc822_parse +from netius.common.parser import Parser as Parser +from netius.common.pop import POPParser as POPParser +from netius.common.rsa import asn_private_key as asn_private_key, asn_public_key as asn_public_key, assert_private as assert_private, open_pem_data as open_pem_data, open_pem_key as open_pem_key, open_private_key as open_private_key, open_private_key_b64 as open_private_key_b64, open_private_key_data as open_private_key_data, open_public_key as open_public_key, open_public_key_b64 as open_public_key_b64, open_public_key_data as open_public_key_data, pem_limiters as pem_limiters, pem_to_der as pem_to_der, private_to_public as private_to_public, rsa_bits as rsa_bits, rsa_crypt as rsa_crypt, rsa_crypt_s as rsa_crypt_s, rsa_exponents as rsa_exponents, rsa_primes as rsa_primes, rsa_private as rsa_private, rsa_sign as rsa_sign, rsa_verify as rsa_verify, write_pem_key as write_pem_key, write_private_key as write_private_key, write_public_key as write_public_key +from netius.common.setup import ensure_ca as ensure_ca, ensure_setup as ensure_setup +from netius.common.smtp import SMTPParser as SMTPParser +from netius.common.socks import SOCKSParser as SOCKSParser +from netius.common.stream import FileStream as FileStream, FilesStream as FilesStream, Stream as Stream +from netius.common.structures import PriorityDict as PriorityDict, file_iterator as file_iterator +from netius.common.tls import LetsEncryptDict as LetsEncryptDict, TLSContextDict as TLSContextDict +from netius.common.torrent import TorrentParser as TorrentParser, bdecode as bdecode, bencode as bencode, chunk as chunk, dechunk as dechunk, info_hash as info_hash +from netius.common.util import addr_to_ip4 as addr_to_ip4, addr_to_ip6 as addr_to_ip6, assert_ip4 as assert_ip4, bytes_to_integer as bytes_to_integer, chunks as chunks, cstring as cstring, header_down as header_down, header_up as header_up, host as host, hostname as hostname, in_subnet_ip4 as in_subnet_ip4, integer_to_bytes as integer_to_bytes, ip4_to_addr as ip4_to_addr, is_ip4 as is_ip4, is_ip6 as is_ip6, random_integer as random_integer, size_round_unit as size_round_unit, string_to_bits as string_to_bits, verify as verify, verify_equal as verify_equal, verify_many as verify_many, verify_not_equal as verify_not_equal, verify_type as verify_type +from netius.common.ws import assert_ws as assert_ws, decode_ws as decode_ws, encode_ws as encode_ws + +__version__: str +__revision__: str +__date__: str +SUBNET_DHCP: int +ROUTER_DHCP: int +DNS_DHCP: int +NAME_DHCP: int +BROADCAST_DHCP: int +REQUESTED_DHCP: int +LEASE_DHCP: int +DISCOVER_DHCP: int +OFFER_DHCP: int +REQUEST_DHCP: int +DECLINE_DHCP: int +ACK_DHCP: int +NAK_DHCP: int +IDENTIFIER_DHCP: int +RENEWAL_DHCP: int +REBIND_DHCP: int +PROXY_DHCP: int +END_DHCP: int +OPTIONS_DHCP: dict +TYPES_DHCP: dict +VERBS_DHCP: dict +REQUEST: int +RESPONSE: int +PLAIN_ENCODING: int +CHUNKED_ENCODING: int +GZIP_ENCODING: int +DEFLATE_ENCODING: int +HTTP_09: int +HTTP_10: int +HTTP_11: int +VERSIONS_MAP: dict +CODE_STRINGS: dict +DATA: int +HEADERS: int +PRIORITY: int +RST_STREAM: int +SETTINGS: int +PUSH_PROMISE: int +PING: int +GOAWAY: int +WINDOW_UPDATE: int +CONTINUATION: int +HTTP2_WINDOW: int +HTTP2_PREFACE: bytes +HTTP2_TUPLES: tuple +HTTP2_NAMES: dict +HTTP2_SETTINGS: dict +HTTP2_SETTINGS_OPTIMAL: dict +HTTP2_SETTINGS_T: list +HTTP2_SETTINGS_OPTIMAL_T: list +BASE_STYLE: str +RRQ_TFTP: int +WRQ_TFTP: int +DATA_TFTP: int +ACK_TFTP: int +ERROR_TFTP: int +TYPES_TFTP: dict diff --git a/src/typings/netius/common/asn.pyi b/src/typings/netius/common/asn.pyi new file mode 100644 index 00000000..705c38a0 --- /dev/null +++ b/src/typings/netius/common/asn.pyi @@ -0,0 +1,22 @@ +import netius as netius +import netius.common.util as util + +__version__: str +__revision__: str +__date__: str +INTEGER: int +BIT_STRING: int +OCTET_STRING: int +NULL: int +OBJECT_IDENTIFIER: int +SEQUENCE: int +ASN1_OBJECT: list +ASN1_RSA_PUBLIC_KEY: list +ASN1_RSA_PRIVATE_KEY: list +RSAID_PKCS1: bytes +HASHID_SHA1: bytes +HASHID_SHA256: bytes +def asn1_parse(template, data): ... +def asn1_length(length): ... +def asn1_gen(node): ... +def asn1_build(node): ... diff --git a/src/typings/netius/common/calc.pyi b/src/typings/netius/common/calc.pyi new file mode 100644 index 00000000..3ce33865 --- /dev/null +++ b/src/typings/netius/common/calc.pyi @@ -0,0 +1,17 @@ +import netius as netius +import netius.common.util as util + +__version__: str +__revision__: str +__date__: str +def prime(number_bits): ... +def is_prime(number): ... +def relatively_prime(first, second): ... +def gcd(first, second): ... +def egcd(first, second): ... +def modinv(first, second): ... +def random_integer_interval(min_value, max_value): ... +def random_primality(number, k): ... +def jacobi_witness(x, n): ... +def jacobi(a, b): ... +def ceil_integer(value): ... diff --git a/src/typings/netius/common/dhcp.pyi b/src/typings/netius/common/dhcp.pyi new file mode 100644 index 00000000..86a9b2b4 --- /dev/null +++ b/src/typings/netius/common/dhcp.pyi @@ -0,0 +1,40 @@ +import netius as netius +from _typeshed import Incomplete + +__version__: str +__revision__: str +__date__: str +SUBNET_DHCP: int +ROUTER_DHCP: int +DNS_DHCP: int +NAME_DHCP: int +BROADCAST_DHCP: int +REQUESTED_DHCP: int +LEASE_DHCP: int +DISCOVER_DHCP: int +OFFER_DHCP: int +REQUEST_DHCP: int +DECLINE_DHCP: int +ACK_DHCP: int +NAK_DHCP: int +IDENTIFIER_DHCP: int +RENEWAL_DHCP: int +REBIND_DHCP: int +PROXY_DHCP: int +END_DHCP: int +OPTIONS_DHCP: dict +TYPES_DHCP: dict +VERBS_DHCP: dict + +class AddressPool: + def __init__(self, start_addr, end_addr) -> None: ... + @classmethod + def get_next(cls, current): ... + def peek(self): ... + def reserve(self, owner: Incomplete | None = ..., lease: int = ...): ... + def touch(self, addr, lease: int = ...): ... + def exists(self, addr): ... + def assigned(self, owner): ... + def is_valid(self, addr): ... + def is_owner(self, owner, addr): ... + def _populate(self): ... diff --git a/src/typings/netius/common/dkim.pyi b/src/typings/netius/common/dkim.pyi new file mode 100644 index 00000000..c9e36e2c --- /dev/null +++ b/src/typings/netius/common/dkim.pyi @@ -0,0 +1,15 @@ +import netius as netius +import netius.common.asn as asn +import netius.common.mime as mime +import netius.common.rsa as rsa +import netius.common.util as util +from _typeshed import Incomplete + +__version__: str +__revision__: str +__date__: str +def dkim_sign(message, selector, domain, private_key, identity: Incomplete | None = ..., separator: str = ..., creation: Incomplete | None = ...): ... +def dkim_headers(headers): ... +def dkim_body(body): ... +def dkim_fold(header, length: int = ...): ... +def dkim_generate(domain, suffix: Incomplete | None = ..., number_bits: int = ...): ... diff --git a/src/typings/netius/common/ftp.pyi b/src/typings/netius/common/ftp.pyi new file mode 100644 index 00000000..5518f099 --- /dev/null +++ b/src/typings/netius/common/ftp.pyi @@ -0,0 +1,12 @@ +import netius as netius +import netius.common.parser +import netius.common.parser as parser + +__version__: str +__revision__: str +__date__: str + +class FTPParser(netius.common.parser.Parser): + def __init__(self, owner, store: bool = ...) -> None: ... + def parse(self, data): ... + def _parse_line(self, data): ... diff --git a/src/typings/netius/common/geo.pyi b/src/typings/netius/common/geo.pyi new file mode 100644 index 00000000..3f438dff --- /dev/null +++ b/src/typings/netius/common/geo.pyi @@ -0,0 +1,27 @@ +import netius as netius +from typing import ClassVar + +__version__: str +__revision__: str +__date__: str + +class GeoResolver: + DB_NAME: ClassVar[str] = ... + DOWNLOAD_URL: ClassVar[str] = ... + VALID: ClassVar[tuple] = ... + PREFIXES: ClassVar[tuple] = ... + _db: ClassVar[None] = ... + @classmethod + def resolve(cls, address, simplified: bool = ...): ... + @classmethod + def _simplify(cls, result, locale: str = ..., valid: tuple = ...): ... + @classmethod + def _get_db(cls): ... + @classmethod + def _try_all(cls, prefixes: tuple = ...): ... + @classmethod + def _try_db(cls, path: str = ..., download: bool = ...): ... + @classmethod + def _download_db(cls, path: str = ...): ... + @classmethod + def _store_db(cls, contents, path: str = ...): ... diff --git a/src/typings/netius/common/http.pyi b/src/typings/netius/common/http.pyi new file mode 100644 index 00000000..930c0ee9 --- /dev/null +++ b/src/typings/netius/common/http.pyi @@ -0,0 +1,59 @@ +import netius as netius +import netius.common.parser +import netius.common.parser as parser +import netius.common.util as util +from _typeshed import Incomplete +from typing import ClassVar + +__version__: str +__revision__: str +__date__: str +FILE_LIMIT: int +REQUEST: int +RESPONSE: int +LINE_STATE: int +HEADERS_STATE: int +MESSAGE_STATE: int +FINISH_STATE: int +PLAIN_ENCODING: int +CHUNKED_ENCODING: int +GZIP_ENCODING: int +DEFLATE_ENCODING: int +HTTP_09: int +HTTP_10: int +HTTP_11: int +VERSIONS_MAP: dict +CODE_STRINGS: dict + +class HTTPParser(netius.common.parser.Parser): + FIELDS: ClassVar[tuple] = ... + def __init__(self, owner, type: int = ..., store: bool = ..., file_limit: int = ...) -> None: ... + def build(self): ... + def destroy(self): ... + def reset(self, type: int = ..., store: bool = ..., file_limit: int = ...): ... + def clear(self, force: bool = ...): ... + def close(self): ... + def get_path(self, normalize: bool = ...): ... + def get_query(self): ... + def get_message(self): ... + def get_message_f(self): ... + def get_message_b(self, copy: bool = ..., size: int = ...): ... + def get_headers(self): ... + def get_encodings(self): ... + def parse(self, data): ... + def _parse_line(self, data): ... + def _parse_headers(self, data): ... + def _parse_message(self, data): ... + def _parse_normal(self, data): ... + def _parse_chunked(self, data): ... + def _store_data(self, data, memory: bool = ...): ... + def _parse_query(self, query): ... + def _decode_params(self, params): ... + +class HTTPResponse: + def __init__(self, data: Incomplete | None = ..., code: int = ..., status: Incomplete | None = ..., headers: Incomplete | None = ...) -> None: ... + def read(self): ... + def readline(self): ... + def close(self): ... + def getcode(self): ... + def info(self): ... diff --git a/src/typings/netius/common/http2.pyi b/src/typings/netius/common/http2.pyi new file mode 100644 index 00000000..ac06bf1b --- /dev/null +++ b/src/typings/netius/common/http2.pyi @@ -0,0 +1,166 @@ +import netius as netius +import netius.base.stream +import netius.common.http as http +import netius.common.parser +import netius.common.parser as parser +from _typeshed import Incomplete +from typing import ClassVar + +__version__: str +__revision__: str +__date__: str +HEADER_SIZE: int +SETTING_SIZE: int +DATA: int +HEADERS: int +PRIORITY: int +RST_STREAM: int +SETTINGS: int +PUSH_PROMISE: int +PING: int +GOAWAY: int +WINDOW_UPDATE: int +CONTINUATION: int +PROTOCOL_ERROR: int +INTERNAL_ERROR: int +FLOW_CONTROL_ERROR: int +SETTINGS_TIMEOUT: int +STREAM_CLOSED: int +FRAME_SIZE_ERROR: int +REFUSED_STREAM: int +CANCEL: int +COMPRESSION_ERROR: int +CONNECT_ERROR: int +ENHANCE_YOUR_CALM: int +INADEQUATE_SECURITY: int +HTTP_1_1_REQUIRED: int +SETTINGS_HEADER_TABLE_SIZE: int +SETTINGS_ENABLE_PUSH: int +SETTINGS_MAX_CONCURRENT_STREAMS: int +SETTINGS_INITIAL_WINDOW_SIZE: int +SETTINGS_MAX_FRAME_SIZE: int +SETTINGS_MAX_HEADER_LIST_SIZE: int +HTTP_20: int +HEADER_STATE: int +PAYLOAD_STATE: int +FINISH_STATE: int +HTTP2_WINDOW: int +HTTP2_FRAME_SIZE: int +HTTP2_PREFACE: bytes +HTTP2_PSEUDO: tuple +HTTP2_TUPLES: tuple +HTTP2_NAMES: dict +HTTP2_SETTINGS: dict +HTTP2_SETTINGS_OPTIMAL: dict +HTTP2_SETTINGS_T: list +HTTP2_SETTINGS_OPTIMAL_T: list + +class HTTP2Parser(netius.common.parser.Parser): + FIELDS: ClassVar[tuple] = ... + def __init__(self, owner, store: bool = ..., file_limit: int = ...) -> None: ... + def build(self): ... + def destroy(self): ... + def info_dict(self): ... + def info_streams(self): ... + def reset(self, store: bool = ..., file_limit: int = ...): ... + def clear(self, force: bool = ..., save: bool = ...): ... + def close(self): ... + def parse(self, data): ... + def get_type_s(self, type): ... + def assert_header(self): ... + def assert_stream(self, stream): ... + def assert_data(self, stream, end_stream): ... + def assert_headers(self, stream, end_stream): ... + def assert_priority(self, stream, dependency): ... + def assert_rst_stream(self, stream): ... + def assert_settings(self, settings, ack, extended: bool = ...): ... + def assert_push_promise(self, promised_stream): ... + def assert_ping(self): ... + def assert_goaway(self): ... + def assert_window_update(self, stream, increment): ... + def assert_continuation(self, stream): ... + def _parse_header(self, data): ... + def _parse_payload(self, data): ... + def _parse_data(self, data): ... + def _parse_headers(self, data): ... + def _parse_priority(self, data): ... + def _parse_rst_stream(self, data): ... + def _parse_settings(self, data): ... + def _parse_push_promise(self, data): ... + def _parse_ping(self, data): ... + def _parse_goaway(self, data): ... + def _parse_window_update(self, data): ... + def _parse_continuation(self, data): ... + def _has_stream(self, stream): ... + def _get_stream(self, stream: Incomplete | None = ..., default: Incomplete | None = ..., strict: bool = ..., closed_s: bool = ..., unopened_s: bool = ..., exists_s: bool = ...): ... + def _set_stream(self, stream): ... + def _del_stream(self, stream): ... + def _invalid_type(self): ... + @property + def type_s(self): ... + @property + def buffer_size(self): ... + @property + def buffer_data(self): ... + @property + def encoder(self): ... + @property + def decoder(self): ... + +class HTTP2Stream(netius.base.stream.Stream): + def __init__(self, identifier: Incomplete | None = ..., header_b: Incomplete | None = ..., dependency: int = ..., weight: int = ..., exclusive: bool = ..., end_headers: bool = ..., end_stream: bool = ..., end_stream_l: bool = ..., store: bool = ..., file_limit: int = ..., window: int = ..., frame_size: int = ..., *args, **kwargs) -> None: ... + def __getattr__(self, name): ... + def reset(self, store: bool = ..., file_limit: int = ..., window: int = ..., frame_size: int = ...): ... + def open(self): ... + def close(self, flush: bool = ..., destroy: bool = ..., reset: bool = ...): ... + def info_dict(self, full: bool = ...): ... + def available(self): ... + def unavailable(self): ... + def set_encoding(self, encoding): ... + def set_uncompressed(self): ... + def set_plain(self): ... + def set_chunked(self): ... + def set_gzip(self): ... + def set_deflate(self): ... + def is_plain(self): ... + def is_chunked(self): ... + def is_gzip(self): ... + def is_deflate(self): ... + def is_compressed(self): ... + def is_uncompressed(self): ... + def is_flushed(self): ... + def is_measurable(self, strict: bool = ...): ... + def is_exhausted(self): ... + def is_restored(self): ... + def decode_headers(self, force: bool = ..., assert_h: bool = ...): ... + def extend_headers(self, fragment): ... + def extend_data(self, data): ... + def remote_update(self, increment): ... + def local_update(self, increment): ... + def get_path(self, normalize: bool = ...): ... + def get_query(self): ... + def get_message_b(self, copy: bool = ..., size: int = ...): ... + def get_encodings(self): ... + def fragment(self, data): ... + def fragmentable(self, data): ... + def flush(self, *args, **kwargs): ... + def flush_s(self, *args, **kwargs): ... + def send_response(self, *args, **kwargs): ... + def send_header(self, *args, **kwargs): ... + def send_part(self, *args, **kwargs): ... + def send_reset(self, *args, **kwargs): ... + def assert_headers(self): ... + def assert_ready(self): ... + def ctx_request(self, *args, **kwds): ... + def _calculate(self): ... + def _calculate_headers(self): ... + def _build_b(self): ... + def _build_c(self, callback, validate: bool = ...): ... + def _parse_query(self, query): ... + def _decode_params(self, params): ... + @property + def parser(self): ... + @property + def is_ready(self): ... + @property + def is_headers(self): ... diff --git a/src/typings/netius/common/mime.pyi b/src/typings/netius/common/mime.pyi new file mode 100644 index 00000000..a0a6059c --- /dev/null +++ b/src/typings/netius/common/mime.pyi @@ -0,0 +1,23 @@ +import netius as netius +from _typeshed import Incomplete + +__version__: str +__revision__: str +__date__: str +MIME_TYPES: tuple +MIME_REGISTERED: bool + +class Headers(list): + def __getitem__(self, key): ... + def __setitem__(self, key, value) -> None: ... + def __delitem__(self, key) -> None: ... + def __contains__(self, item) -> bool: ... + def item(self, key): ... + def get(self, key, default: Incomplete | None = ...): ... + def set(self, key, value, append: bool = ...): ... + def pop(self, key, default: Incomplete | None = ...): ... + def join(self, separator: str = ...): ... + def _normalize(self, value): ... +def rfc822_parse(message, strip: bool = ...): ... +def rfc822_join(headers, body): ... +def mime_register(): ... diff --git a/src/typings/netius/common/parser.pyi b/src/typings/netius/common/parser.pyi new file mode 100644 index 00000000..fe61200d --- /dev/null +++ b/src/typings/netius/common/parser.pyi @@ -0,0 +1,19 @@ +import netius as netius +import netius.base.observer +from typing import ClassVar + +__version__: str +__revision__: str +__date__: str + +class Parser(netius.base.observer.Observable): + FIELDS: ClassVar[tuple] = ... + def __init__(self, owner) -> None: ... + @classmethod + def mock(cls, owner, state): ... + def build(self): ... + def destroy(self): ... + def get_state(self): ... + def set_state(self, state): ... + def info_dict(self): ... + def parse(self, data): ... diff --git a/src/typings/netius/common/pop.pyi b/src/typings/netius/common/pop.pyi new file mode 100644 index 00000000..867fbb9f --- /dev/null +++ b/src/typings/netius/common/pop.pyi @@ -0,0 +1,12 @@ +import netius as netius +import netius.common.parser +import netius.common.parser as parser + +__version__: str +__revision__: str +__date__: str + +class POPParser(netius.common.parser.Parser): + def __init__(self, owner, store: bool = ...) -> None: ... + def parse(self, data): ... + def _parse_line(self, data): ... diff --git a/src/typings/netius/common/rsa.pyi b/src/typings/netius/common/rsa.pyi new file mode 100644 index 00000000..8da3d5ef --- /dev/null +++ b/src/typings/netius/common/rsa.pyi @@ -0,0 +1,36 @@ +import netius as netius +import netius.common.asn as asn +import netius.common.calc as calc +import netius.common.util as util +from _typeshed import Incomplete + +__version__: str +__revision__: str +__date__: str +PRIVATE_TOKEN: str +PUBLIC_TOKEN: str +def open_pem_key(path, token: str = ...): ... +def open_pem_data(data, token: str = ...): ... +def write_pem_key(path, data, token: str = ..., width: int = ...): ... +def open_private_key(path): ... +def open_private_key_b64(data_b64): ... +def open_private_key_data(data): ... +def open_public_key(path): ... +def open_public_key_b64(data_b64): ... +def open_public_key_data(data): ... +def write_private_key(path, private_key): ... +def write_public_key(path, public_key): ... +def asn_private_key(private_key): ... +def asn_public_key(public_key): ... +def pem_to_der(in_path, out_path, token: str = ...): ... +def pem_limiters(token): ... +def private_to_public(private_key): ... +def assert_private(private_key, number_bits: Incomplete | None = ...): ... +def rsa_private(number_bits): ... +def rsa_primes(number_bits): ... +def rsa_exponents(prime_1, prime_2, number_bits, basic: bool = ...): ... +def rsa_bits(modulus): ... +def rsa_sign(message, private_key): ... +def rsa_verify(signature, public_key): ... +def rsa_crypt_s(message, exponent, modulus): ... +def rsa_crypt(number, exponent, modulus): ... diff --git a/src/typings/netius/common/setup.pyi b/src/typings/netius/common/setup.pyi new file mode 100644 index 00000000..ee638088 --- /dev/null +++ b/src/typings/netius/common/setup.pyi @@ -0,0 +1,12 @@ +__version__: str +__revision__: str +__date__: str +CA_URL: str +COMMON_PATH: str +BASE_PATH: str +EXTRAS_PATH: str +SSL_CA_PATH: str +def ensure_setup(): ... +def ensure_ca(path: str = ...): ... +def _download_ca(path: str = ..., raise_e: bool = ...): ... +def _store_contents(contents, path): ... diff --git a/src/typings/netius/common/smtp.pyi b/src/typings/netius/common/smtp.pyi new file mode 100644 index 00000000..7aa21ea7 --- /dev/null +++ b/src/typings/netius/common/smtp.pyi @@ -0,0 +1,12 @@ +import netius as netius +import netius.common.parser +import netius.common.parser as parser + +__version__: str +__revision__: str +__date__: str + +class SMTPParser(netius.common.parser.Parser): + def __init__(self, owner, store: bool = ...) -> None: ... + def parse(self, data): ... + def _parse_line(self, data): ... diff --git a/src/typings/netius/common/socks.pyi b/src/typings/netius/common/socks.pyi new file mode 100644 index 00000000..291320f8 --- /dev/null +++ b/src/typings/netius/common/socks.pyi @@ -0,0 +1,42 @@ +import netius as netius +import netius.common.parser +import netius.common.parser as parser +import netius.common.util as util + +__version__: str +__revision__: str +__date__: str +IPV4: int +IPV6: int +DOMAIN: int +VERSION_STATE: int +HEADER_STATE: int +USER_ID_STATE: int +DOMAIN_STATE: int +AUTH_COUNT_STATE: int +AUTH_METHODS_STATE: int +HEADER_EXTRA_STATE: int +SIZE_STATE: int +ADDRESS_STATE: int +PORT_STATE: int +FINISH_STATE: int + +class SOCKSParser(netius.common.parser.Parser): + def __init__(self, owner) -> None: ... + def build(self): ... + def destroy(self): ... + def reset(self): ... + def clear(self, force: bool = ...): ... + def parse(self, data): ... + def get_host(self): ... + def get_address(self): ... + def _parse_version(self, data): ... + def _parse_header(self, data): ... + def _parse_user_id(self, data): ... + def _parse_domain(self, data): ... + def _parse_auth_count(self, data): ... + def _parse_auth_methods(self, data): ... + def _parse_header_extra(self, data): ... + def _parse_size(self, data): ... + def _parse_address(self, data): ... + def _parse_port(self, data): ... diff --git a/src/typings/netius/common/stream.pyi b/src/typings/netius/common/stream.pyi new file mode 100644 index 00000000..6f073804 --- /dev/null +++ b/src/typings/netius/common/stream.pyi @@ -0,0 +1,31 @@ +import netius as netius + +__version__: str +__revision__: str +__date__: str + +class Stream: + def open(self, mode: str = ...): ... + def close(self): ... + def seek(self, offset): ... + def read(self, size): ... + def write(self, data): ... + def flish(self): ... + +class FileStream(Stream): + def __init__(self, path, size) -> None: ... + def open(self, mode: str = ..., allocate: bool = ...): ... + def close(self): ... + def seek(self, offset): ... + def read(self, size): ... + def write(self, data): ... + def flush(self): ... + +class FilesStream(Stream): + def __init__(self, dir_path, size, files_m) -> None: ... + def open(self, mode: str = ..., allocate: bool = ...): ... + def close(self): ... + def seek(self, offset): ... + def read(self, size): ... + def write(self, data): ... + def flush(self): ... diff --git a/src/typings/netius/common/structures.pyi b/src/typings/netius/common/structures.pyi new file mode 100644 index 00000000..c9db5015 --- /dev/null +++ b/src/typings/netius/common/structures.pyi @@ -0,0 +1,14 @@ +__version__: str +__revision__: str +__date__: str + +class PriorityDict(dict): + def __init__(self, *args, **kwargs) -> None: ... + def __setitem__(self, key, val) -> None: ... + def smallest(self): ... + def pop_smallest(self): ... + def setdefault(self, key, val): ... + def update(self, *args, **kwargs): ... + def sorted_iter(self): ... + def _rebuild_heap(self): ... +def file_iterator(file_object, chunk_size: int = ...): ... diff --git a/src/typings/netius/common/style.pyi b/src/typings/netius/common/style.pyi new file mode 100644 index 00000000..d00fa6c6 --- /dev/null +++ b/src/typings/netius/common/style.pyi @@ -0,0 +1,4 @@ +__version__: str +__revision__: str +__date__: str +BASE_STYLE: str diff --git a/src/typings/netius/common/tftp.pyi b/src/typings/netius/common/tftp.pyi new file mode 100644 index 00000000..ee0be72e --- /dev/null +++ b/src/typings/netius/common/tftp.pyi @@ -0,0 +1,9 @@ +__version__: str +__revision__: str +__date__: str +RRQ_TFTP: int +WRQ_TFTP: int +DATA_TFTP: int +ACK_TFTP: int +ERROR_TFTP: int +TYPES_TFTP: dict diff --git a/src/typings/netius/common/tls.pyi b/src/typings/netius/common/tls.pyi new file mode 100644 index 00000000..a9fc6076 --- /dev/null +++ b/src/typings/netius/common/tls.pyi @@ -0,0 +1,17 @@ +import netius as netius + +__version__: str +__revision__: str +__date__: str + +class TLSContextDict(dict): + def __init__(self, owner, domains, *args, **kwargs) -> None: ... + def load(self, domains): ... + def has_definition(self, domain): ... + def cer_path(self, domain): ... + def key_path(self, domain): ... + +class LetsEncryptDict(TLSContextDict): + def __init__(self, owner, domains, *args, **kwargs) -> None: ... + def cer_path(self, domain): ... + def key_path(self, domain): ... diff --git a/src/typings/netius/common/torrent.pyi b/src/typings/netius/common/torrent.pyi new file mode 100644 index 00000000..156b7be6 --- /dev/null +++ b/src/typings/netius/common/torrent.pyi @@ -0,0 +1,23 @@ +import netius as netius +import netius.common.parser +import netius.common.parser as parser + +__version__: str +__revision__: str +__date__: str +HANDSHAKE_SIZE: int +TORRENT_TYPES: dict +def info_hash(root): ... +def bencode(root): ... +def bdecode(data): ... +def chunk(item): ... +def dechunk(chunks): ... + +class TorrentParser(netius.common.parser.Parser): + def __init__(self, owner, store: bool = ...) -> None: ... + def build(self): ... + def destroy(self): ... + def parse(self, data): ... + def _join(self, data): ... + def _parse_handshake(self, data): ... + def _parse_message(self, data): ... diff --git a/src/typings/netius/common/util.pyi b/src/typings/netius/common/util.pyi new file mode 100644 index 00000000..81fd20f5 --- /dev/null +++ b/src/typings/netius/common/util.pyi @@ -0,0 +1,35 @@ +import netius as netius +from _typeshed import Incomplete + +__version__: str +__revision__: str +__date__: str +SIZE_UNITS_LIST: tuple +SIZE_UNITS_LIST_S: tuple +SIZE_UNIT_COEFFICIENT: int +DEFAULT_MINIMUM: int +DEFAULT_PLACES: int +_HOST: None +def cstring(value): ... +def chunks(sequence, count): ... +def header_down(name): ... +def header_up(name): ... +def is_ip4(address): ... +def is_ip6(address): ... +def assert_ip4(address, allowed, default: bool = ...): ... +def in_subnet_ip4(address, subnet): ... +def addr_to_ip4(number): ... +def addr_to_ip6(number): ... +def ip4_to_addr(value): ... +def string_to_bits(value): ... +def integer_to_bytes(number, length: int = ...): ... +def bytes_to_integer(bytes): ... +def random_integer(number_bits): ... +def host(default: str = ...): ... +def hostname(): ... +def size_round_unit(size_value, minimum: int = ..., places: int = ..., reduce: bool = ..., space: bool = ..., justify: bool = ..., simplified: bool = ..., depth: int = ...): ... +def verify(condition, message: Incomplete | None = ..., exception: Incomplete | None = ...): ... +def verify_equal(first, second, message: Incomplete | None = ..., exception: Incomplete | None = ...): ... +def verify_not_equal(first, second, message: Incomplete | None = ..., exception: Incomplete | None = ...): ... +def verify_type(value, types, null: bool = ..., message: Incomplete | None = ..., exception: Incomplete | None = ..., **kwargs): ... +def verify_many(sequence, message: Incomplete | None = ..., exception: Incomplete | None = ...): ... diff --git a/src/typings/netius/common/ws.pyi b/src/typings/netius/common/ws.pyi new file mode 100644 index 00000000..3fbe634d --- /dev/null +++ b/src/typings/netius/common/ws.pyi @@ -0,0 +1,8 @@ +import netius as netius + +__version__: str +__revision__: str +__date__: str +def encode_ws(data, final: bool = ..., opcode: int = ..., mask: bool = ...): ... +def decode_ws(data): ... +def assert_ws(data_l, size): ... diff --git a/src/typings/netius/examples/__init__.pyi b/src/typings/netius/examples/__init__.pyi new file mode 100644 index 00000000..0c932ff0 --- /dev/null +++ b/src/typings/netius/examples/__init__.pyi @@ -0,0 +1,7 @@ +from . import http as http, upnp as upnp +from netius.examples.http import http_callback as http_callback, http_static as http_static +from netius.examples.upnp import upnp_map as upnp_map + +__version__: str +__revision__: str +__date__: str diff --git a/src/typings/netius/examples/http.pyi b/src/typings/netius/examples/http.pyi new file mode 100644 index 00000000..a3bf905c --- /dev/null +++ b/src/typings/netius/examples/http.pyi @@ -0,0 +1,7 @@ +import netius as netius + +__version__: str +__revision__: str +__date__: str +def http_static(): ... +def http_callback(): ... diff --git a/src/typings/netius/examples/upnp.pyi b/src/typings/netius/examples/upnp.pyi new file mode 100644 index 00000000..9503f720 --- /dev/null +++ b/src/typings/netius/examples/upnp.pyi @@ -0,0 +1,6 @@ +import netius as netius + +__version__: str +__revision__: str +__date__: str +def upnp_map(ext_port, int_port, host, protocol: str = ..., description: str = ...): ... diff --git a/src/typings/netius/extra/__init__.pyi b/src/typings/netius/extra/__init__.pyi new file mode 100644 index 00000000..9c983058 --- /dev/null +++ b/src/typings/netius/extra/__init__.pyi @@ -0,0 +1,14 @@ +from . import desktop as desktop, dhcp_s as dhcp_s, file as file, filea as filea, hello as hello, hello_w as hello_w, proxy_d as proxy_d, proxy_f as proxy_f, proxy_r as proxy_r, smtp_r as smtp_r +from netius.extra.desktop import DesktopServer as DesktopServer +from netius.extra.dhcp_s import DHCPServerS as DHCPServerS +from netius.extra.file import FileServer as FileServer +from netius.extra.filea import FileAsyncServer as FileAsyncServer +from netius.extra.hello import HelloServer as HelloServer +from netius.extra.proxy_d import DockerProxyServer as DockerProxyServer +from netius.extra.proxy_f import ForwardProxyServer as ForwardProxyServer +from netius.extra.proxy_r import ReverseProxyServer as ReverseProxyServer +from netius.extra.smtp_r import RelaySMTPServer as RelaySMTPServer + +__version__: str +__revision__: str +__date__: str diff --git a/src/typings/netius/extra/desktop.pyi b/src/typings/netius/extra/desktop.pyi new file mode 100644 index 00000000..6a7f19ce --- /dev/null +++ b/src/typings/netius/extra/desktop.pyi @@ -0,0 +1,11 @@ +import netius as netius +import netius.servers.mjpg + +__version__: str +__revision__: str +__date__: str +PIL: None + +class DesktopServer(netius.servers.mjpg.MJPGServer): + def get_delay(self, connection): ... + def get_image(self, connection): ... diff --git a/src/typings/netius/extra/dhcp_s.pyi b/src/typings/netius/extra/dhcp_s.pyi new file mode 100644 index 00000000..bb0c1c69 --- /dev/null +++ b/src/typings/netius/extra/dhcp_s.pyi @@ -0,0 +1,16 @@ +import netius as netius +import netius.servers.dhcp +from _typeshed import Incomplete + +__version__: str +__revision__: str +__date__: str + +class DHCPServerS(netius.servers.dhcp.DHCPServer): + def __init__(self, pool: Incomplete | None = ..., options: dict = ..., *args, **kwargs) -> None: ... + def get_type(self, request): ... + def get_options(self, request): ... + def get_yiaddr(self, request): ... + def _build(self, options): ... + def _reserve(self, request): ... + def _confirm(self, request): ... diff --git a/src/typings/netius/extra/file.pyi b/src/typings/netius/extra/file.pyi new file mode 100644 index 00000000..461867e6 --- /dev/null +++ b/src/typings/netius/extra/file.pyi @@ -0,0 +1,43 @@ +import netius as netius +import netius.servers.http2 +from _typeshed import Incomplete + +__version__: str +__revision__: str +__date__: str +BUFFER_SIZE: int +FOLDER_SVG: str +FILE_SVG: str +EMPTY_GIF: str + +class FileServer(netius.servers.http2.HTTP2Server): + def __init__(self, base_path: str = ..., style_urls: list = ..., index_files: list = ..., path_regex: list = ..., list_dirs: bool = ..., list_engine: str = ..., cors: bool = ..., cache: int = ..., *args, **kwargs) -> None: ... + @classmethod + def _sorter_build(cls, name: Incomplete | None = ...): ... + @classmethod + def _items_normalize(cls, items, path, pad: bool = ..., space: bool = ..., simplified: bool = ...): ... + @classmethod + def _gen_dir(cls, engine, path, path_v, query_m, style: bool = ..., style_urls: list = ..., **kwargs): ... + @classmethod + def _gen_dir_base(cls, path, path_v, query_m, style: bool = ..., style_urls: list = ..., **kwargs): ... + @classmethod + def _gen_dir_apache(cls, path, path_v, query_m, **kwargs): ... + @classmethod + def _gen_dir_legacy(cls, path, path_v, query_m, **kwargs): ... + def on_connection_d(self, connection): ... + def on_stream_d(self, stream): ... + def on_serve(self): ... + def on_data_http(self, connection, parser): ... + def on_dir_file(self, connection, parser, path, style: bool = ...): ... + def on_normal_file(self, connection, parser, path): ... + def on_no_file(self, connection): ... + def on_exception_file(self, connection, exception): ... + def on_not_modified(self, connection, path): ... + def _next_queue(self, connection): ... + def _file_send(self, connection): ... + def _file_finish(self, connection): ... + def _file_close(self, connection): ... + def _file_check_close(self, connection): ... + def _resolve(self, path): ... + def _build_regex(self): ... + def _resolve_regex(self, path): ... diff --git a/src/typings/netius/extra/filea.pyi b/src/typings/netius/extra/filea.pyi new file mode 100644 index 00000000..31cb46d4 --- /dev/null +++ b/src/typings/netius/extra/filea.pyi @@ -0,0 +1,12 @@ +import netius.extra.file +import netius.extra.file as _file + +__version__: str +__revision__: str +__date__: str +BUFFER_SIZE: int + +class FileAsyncServer(netius.extra.file.FileServer): + def on_connection_d(self, connection): ... + def on_stream_d(self, stream): ... + def _file_send(self, connection): ... diff --git a/src/typings/netius/extra/hello.pyi b/src/typings/netius/extra/hello.pyi new file mode 100644 index 00000000..7199a60e --- /dev/null +++ b/src/typings/netius/extra/hello.pyi @@ -0,0 +1,13 @@ +import netius as netius +import netius.servers.http2 + +__version__: str +__revision__: str +__date__: str + +class HelloServer(netius.servers.http2.HTTP2Server): + def __init__(self, message: str = ..., *args, **kwargs) -> None: ... + def on_serve(self): ... + def on_data_http(self, connection, parser): ... + def _hello_close(self, connection): ... + def _hello_keep(self, connection): ... diff --git a/src/typings/netius/extra/hello_w.pyi b/src/typings/netius/extra/hello_w.pyi new file mode 100644 index 00000000..6cac633d --- /dev/null +++ b/src/typings/netius/extra/hello_w.pyi @@ -0,0 +1,6 @@ +import netius as netius + +__version__: str +__revision__: str +__date__: str +def app(environ, start_response): ... diff --git a/src/typings/netius/extra/proxy_d.pyi b/src/typings/netius/extra/proxy_d.pyi new file mode 100644 index 00000000..04b36bda --- /dev/null +++ b/src/typings/netius/extra/proxy_d.pyi @@ -0,0 +1,21 @@ +import netius as netius +import netius.extra.proxy_r +import netius.extra.proxy_r as proxy_r + +__version__: str +__revision__: str +__date__: str + +class DockerProxyServer(netius.extra.proxy_r.ReverseProxyServer): + def __init__(self, host_suffixes: list = ..., *args, **kwargs) -> None: ... + def on_serve(self): ... + def _build_docker(self): ... + def _build_regex(self, token: str = ..., sort: bool = ...): ... + def _build_hosts(self, alias: bool = ...): ... + def _build_alias(self): ... + def _build_passwords(self): ... + def _build_redirect(self): ... + def _build_error_urls(self): ... + def _build_redirect_ssl(self, alias: bool = ...): ... + def _build_suffixes(self, alias: bool = ..., redirect: bool = ...): ... + def _valid_url(self, value): ... diff --git a/src/typings/netius/extra/proxy_f.pyi b/src/typings/netius/extra/proxy_f.pyi new file mode 100644 index 00000000..60c69548 --- /dev/null +++ b/src/typings/netius/extra/proxy_f.pyi @@ -0,0 +1,11 @@ +import netius as netius +import netius.servers.proxy + +__version__: str +__revision__: str +__date__: str + +class ForwardProxyServer(netius.servers.proxy.ProxyServer): + def __init__(self, config: str = ..., rules: dict = ..., *args, **kwargs) -> None: ... + def on_headers(self, connection, parser): ... + def compile(self): ... diff --git a/src/typings/netius/extra/proxy_r.pyi b/src/typings/netius/extra/proxy_r.pyi new file mode 100644 index 00000000..367055b1 --- /dev/null +++ b/src/typings/netius/extra/proxy_r.pyi @@ -0,0 +1,45 @@ +import netius as netius +import netius.servers.proxy +from _typeshed import Incomplete + +__version__: str +__revision__: str +__date__: str +DEFAULT_NAME: str + +class ReverseProxyServer(netius.servers.proxy.ProxyServer): + def __init__(self, config: str = ..., regex: dict = ..., hosts: dict = ..., alias: dict = ..., auth: dict = ..., auth_regex: dict = ..., redirect: dict = ..., redirect_regex: dict = ..., error_urls: dict = ..., forward: Incomplete | None = ..., strategy: str = ..., reuse: bool = ..., sts: int = ..., resolve: bool = ..., resolve_t: float = ..., host_f: bool = ..., echo: bool = ..., *args, **kwargs) -> None: ... + def info_dict(self, full: bool = ...): ... + def proxy_r_dict(self): ... + def on_diag(self): ... + def on_start(self): ... + def on_serve(self): ... + def on_headers(self, connection, parser): ... + def rules(self, url, parser): ... + def rules_regex(self, url, parser): ... + def rules_host(self, url, parser): ... + def rules_forward(self, url, parser): ... + def balancer(self, values): ... + def balancer_robin(self, values): ... + def balancer_smart(self, values): ... + def acquirer(self, state): ... + def acquirer_robin(self, state): ... + def acquirer_smart(self, state): ... + def releaser(self, state): ... + def releaser_robin(self, state): ... + def releaser_smart(self, state): ... + def dns_start(self, timeout: float = ...): ... + def dns_tick(self, timeout: float = ...): ... + def dns_callback(self, host, hostname, parsed, index: int = ..., resolved: list = ...): ... + def _on_prx_message(self, client, parser, message): ... + def _on_prx_close(self, client, _connection): ... + def _apply_all(self, parser, connection, headers, upper: bool = ..., normalize: bool = ..., replace: bool = ...): ... + def _apply_headers(self, parser, connection, parser_prx, headers, upper: bool = ...): ... + def _set_strategy(self): ... + def _resolve_regex(self, value, regexes, default: Incomplete | None = ...): ... + def _echo(self, sort: bool = ...): ... + def _echo_regex(self, sort: bool = ...): ... + def _echo_hosts(self, sort: bool = ...): ... + def _echo_alias(self, sort: bool = ...): ... + def _echo_redirect(self, sort: bool = ...): ... + def _echo_error_urls(self, sort: bool = ...): ... diff --git a/src/typings/netius/extra/smtp_r.pyi b/src/typings/netius/extra/smtp_r.pyi new file mode 100644 index 00000000..f03fa3b6 --- /dev/null +++ b/src/typings/netius/extra/smtp_r.pyi @@ -0,0 +1,18 @@ +import netius as netius +import netius.servers.smtp +from _typeshed import Incomplete + +__version__: str +__revision__: str +__date__: str + +class RelaySMTPServer(netius.servers.smtp.SMTPServer): + def __init__(self, *args, **kwargs) -> None: ... + def on_serve(self): ... + def on_header_smtp(self, connection, from_l, to_l): ... + def on_data_smtp(self, connection, data): ... + def on_message_smtp(self, connection): ... + def relay(self, connection, froms, tos, contents): ... + def date(self): ... + def message_id(self, connection, email: str = ...): ... + def dkim_contents(self, contents, email: str = ..., creation: Incomplete | None = ...): ... diff --git a/src/typings/netius/middleware/__init__.pyi b/src/typings/netius/middleware/__init__.pyi new file mode 100644 index 00000000..07c9fd67 --- /dev/null +++ b/src/typings/netius/middleware/__init__.pyi @@ -0,0 +1,11 @@ +from . import annoyer as annoyer, base as base, blacklist as blacklist, dummy as dummy, flood as flood, proxy as proxy +from netius.middleware.annoyer import AnnoyerMiddleware as AnnoyerMiddleware +from netius.middleware.base import Middleware as Middleware +from netius.middleware.blacklist import BlacklistMiddleware as BlacklistMiddleware +from netius.middleware.dummy import DummyMiddleware as DummyMiddleware +from netius.middleware.flood import FloodMiddleware as FloodMiddleware +from netius.middleware.proxy import ProxyMiddleware as ProxyMiddleware + +__version__: str +__revision__: str +__date__: str diff --git a/src/typings/netius/middleware/annoyer.pyi b/src/typings/netius/middleware/annoyer.pyi new file mode 100644 index 00000000..610b4bcb --- /dev/null +++ b/src/typings/netius/middleware/annoyer.pyi @@ -0,0 +1,13 @@ +import netius as netius +import netius.middleware.base +from netius.middleware.base import Middleware as Middleware + +__version__: str +__revision__: str +__date__: str + +class AnnoyerMiddleware(netius.middleware.base.Middleware): + def __init__(self, owner, period: float = ...) -> None: ... + def start(self): ... + def stop(self): ... + def _run(self): ... diff --git a/src/typings/netius/middleware/base.pyi b/src/typings/netius/middleware/base.pyi new file mode 100644 index 00000000..bde6d9d6 --- /dev/null +++ b/src/typings/netius/middleware/base.pyi @@ -0,0 +1,8 @@ +__version__: str +__revision__: str +__date__: str + +class Middleware: + def __init__(self, owner) -> None: ... + def start(self): ... + def stop(self): ... diff --git a/src/typings/netius/middleware/blacklist.pyi b/src/typings/netius/middleware/blacklist.pyi new file mode 100644 index 00000000..5d233d59 --- /dev/null +++ b/src/typings/netius/middleware/blacklist.pyi @@ -0,0 +1,14 @@ +import netius as netius +import netius.middleware.base +from _typeshed import Incomplete +from netius.middleware.base import Middleware as Middleware + +__version__: str +__revision__: str +__date__: str + +class BlacklistMiddleware(netius.middleware.base.Middleware): + def __init__(self, owner, blacklist: Incomplete | None = ..., whitelist: Incomplete | None = ...) -> None: ... + def start(self): ... + def stop(self): ... + def on_connection_c(self, owner, connection): ... diff --git a/src/typings/netius/middleware/dummy.pyi b/src/typings/netius/middleware/dummy.pyi new file mode 100644 index 00000000..640da15f --- /dev/null +++ b/src/typings/netius/middleware/dummy.pyi @@ -0,0 +1,11 @@ +import netius.middleware.base +from netius.middleware.base import Middleware as Middleware + +__version__: str +__revision__: str +__date__: str + +class DummyMiddleware(netius.middleware.base.Middleware): + def start(self): ... + def stop(self): ... + def on_connection_c(self, owner, connection): ... diff --git a/src/typings/netius/middleware/flood.pyi b/src/typings/netius/middleware/flood.pyi new file mode 100644 index 00000000..7096338d --- /dev/null +++ b/src/typings/netius/middleware/flood.pyi @@ -0,0 +1,15 @@ +import netius as netius +import netius.middleware.base +from _typeshed import Incomplete +from netius.middleware.base import Middleware as Middleware + +__version__: str +__revision__: str +__date__: str + +class FloodMiddleware(netius.middleware.base.Middleware): + def __init__(self, owner, conns_per_min: int = ..., whitelist: Incomplete | None = ...) -> None: ... + def start(self): ... + def stop(self): ... + def on_connection_c(self, owner, connection): ... + def _update_flood(self, host): ... diff --git a/src/typings/netius/middleware/proxy.pyi b/src/typings/netius/middleware/proxy.pyi new file mode 100644 index 00000000..ed020161 --- /dev/null +++ b/src/typings/netius/middleware/proxy.pyi @@ -0,0 +1,29 @@ +import netius as netius +import netius.middleware.base +from netius.middleware.base import Middleware as Middleware +from typing import ClassVar + +__version__: str +__revision__: str +__date__: str + +class ProxyMiddleware(netius.middleware.base.Middleware): + MAX_LENGTH: ClassVar[int] = ... + HEADER_LENGTH_V2: ClassVar[int] = ... + HEADER_MAGIC_V2: ClassVar[bytes] = ... + TYPE_LOCAL_V2: ClassVar[int] = ... + TYPE_PROXY_V2: ClassVar[int] = ... + AF_UNSPEC_v2: ClassVar[int] = ... + AF_INET_v2: ClassVar[int] = ... + AF_INET6_v2: ClassVar[int] = ... + AF_UNIX_v2: ClassVar[int] = ... + PROTO_UNSPEC_v2: ClassVar[int] = ... + PROTO_STREAM_v2: ClassVar[int] = ... + PROTO_DGRAM_v2: ClassVar[int] = ... + def __init__(self, owner, version: int = ...) -> None: ... + def start(self): ... + def stop(self): ... + def on_connection_c(self, owner, connection): ... + def _proxy_handshake_v1(self, connection): ... + def _proxy_handshake_v2(self, connection): ... + def _read_safe(self, connection, buffer, count): ... diff --git a/src/typings/netius/mock/__init__.pyi b/src/typings/netius/mock/__init__.pyi new file mode 100644 index 00000000..25cd3c03 --- /dev/null +++ b/src/typings/netius/mock/__init__.pyi @@ -0,0 +1,5 @@ +from . import appier as appier + +__version__: str +__revision__: str +__date__: str diff --git a/src/typings/netius/mock/appier.pyi b/src/typings/netius/mock/appier.pyi new file mode 100644 index 00000000..db2c42bd --- /dev/null +++ b/src/typings/netius/mock/appier.pyi @@ -0,0 +1,6 @@ +__version__: str +__revision__: str +__date__: str + +class APIApp: ... +def route(*args, **kwargs): ... diff --git a/src/typings/netius/pool/__init__.pyi b/src/typings/netius/pool/__init__.pyi new file mode 100644 index 00000000..8bc076b6 --- /dev/null +++ b/src/typings/netius/pool/__init__.pyi @@ -0,0 +1,9 @@ +from . import common as common, file as file, notify as notify, task as task +from netius.pool.common import EventFile as EventFile, EventPool as EventPool, SocketEventFile as SocketEventFile, Thread as Thread, ThreadPool as ThreadPool, UnixEventFile as UnixEventFile +from netius.pool.file import FilePool as FilePool, FileThread as FileThread +from netius.pool.notify import NotifyPool as NotifyPool +from netius.pool.task import TaskPool as TaskPool, TaskThread as TaskThread + +__version__: str +__revision__: str +__date__: str diff --git a/src/typings/netius/pool/common.pyi b/src/typings/netius/pool/common.pyi new file mode 100644 index 00000000..e4b793d0 --- /dev/null +++ b/src/typings/netius/pool/common.pyi @@ -0,0 +1,77 @@ +import netius as netius +import threading +from _typeshed import Incomplete +from typing import ClassVar + +__version__: str +__revision__: str +__date__: str +CALLABLE_WORK: int + +class Thread(threading.Thread): + def __init__(self, identifier, owner: Incomplete | None = ..., *args, **kwargs) -> None: ... + def available(self): ... + def stop(self): ... + def run(self): ... + def tick(self): ... + def execute(self, work): ... + +class ThreadPool: + def __init__(self, base: type[Thread] = ..., count: int = ...) -> None: ... + def start(self): ... + def stop(self, join: bool = ...): ... + def build(self): ... + def peek(self): ... + def pop(self, lock: bool = ...): ... + def push(self, work, lock: bool = ...): ... + def push_callable(self, callable): ... + +class EventPool(ThreadPool): + def __init__(self, base: type[Thread] = ..., count: int = ...) -> None: ... + def stop(self, join: bool = ...): ... + def push_event(self, event): ... + def pop_event(self): ... + def pop_all(self, denotify: bool = ...): ... + def notify(self): ... + def denotify(self): ... + def eventfd(self): ... + +class EventFile: + def __init__(self, *args, **kwargs) -> None: ... + def close(self): ... + def fileno(self): ... + def rfileno(self): ... + def wfileno(self): ... + def notify(self): ... + def denotify(self): ... + +class UnixEventFile(EventFile): + _LIBC: ClassVar[None] = ... + def __init__(self, *args, **kwargs) -> None: ... + @classmethod + def available(cls): ... + @classmethod + def libc(cls): ... + def close(self): ... + def notify(self): ... + def denotify(self): ... + def _read(self, length: int = ...): ... + def _write(self, value): ... + +class PipeEventFile(EventFile): + def __init__(self, *args, **kwargs) -> None: ... + @classmethod + def available(cls): ... + def close(self): ... + def notify(self): ... + def denotify(self): ... + def _read(self, length: int = ...): ... + def _write(self, data): ... + +class SocketEventFile(EventFile): + def __init__(self, *args, **kwargs) -> None: ... + def close(self): ... + def notify(self): ... + def denotify(self): ... + def _read(self, length: int = ...): ... + def _write(self, data): ... diff --git a/src/typings/netius/pool/file.pyi b/src/typings/netius/pool/file.pyi new file mode 100644 index 00000000..45ca93a9 --- /dev/null +++ b/src/typings/netius/pool/file.pyi @@ -0,0 +1,29 @@ +import netius as netius +import netius.pool.common +import netius.pool.common as common +from _typeshed import Incomplete + +__version__: str +__revision__: str +__date__: str +FILE_WORK: int +ERROR_ACTION: int +OPEN_ACTION: int +CLOSE_ACTION: int +READ_ACTION: int +WRITE_ACTION: int + +class FileThread(netius.pool.common.Thread): + def execute(self, work): ... + def open(self, path, mode, data): ... + def close(self, file, data): ... + def read(self, file, count, data): ... + def write(self, file, buffer, data): ... + def _execute(self, work): ... + +class FilePool(netius.pool.common.EventPool): + def __init__(self, base: type[FileThread] = ..., count: int = ...) -> None: ... + def open(self, path, mode: str = ..., data: Incomplete | None = ...): ... + def close(self, file, data: Incomplete | None = ...): ... + def read(self, file, count: int = ..., data: Incomplete | None = ...): ... + def write(self, file, buffer, data: Incomplete | None = ...): ... diff --git a/src/typings/netius/pool/notify.pyi b/src/typings/netius/pool/notify.pyi new file mode 100644 index 00000000..e6b680e4 --- /dev/null +++ b/src/typings/netius/pool/notify.pyi @@ -0,0 +1,9 @@ +import netius.pool.common +import netius.pool.common as common + +__version__: str +__revision__: str +__date__: str + +class NotifyPool(netius.pool.common.EventPool): + def __init__(self) -> None: ... diff --git a/src/typings/netius/pool/task.pyi b/src/typings/netius/pool/task.pyi new file mode 100644 index 00000000..5ffaa981 --- /dev/null +++ b/src/typings/netius/pool/task.pyi @@ -0,0 +1,16 @@ +import netius as netius +import netius.pool.common +import netius.pool.common as common +from _typeshed import Incomplete + +__version__: str +__revision__: str +__date__: str +TASK_WORK: int + +class TaskThread(netius.pool.common.Thread): + def execute(self, work): ... + +class TaskPool(netius.pool.common.EventPool): + def __init__(self, base: type[TaskThread] = ..., count: int = ...) -> None: ... + def execute(self, callable, args: list = ..., kwargs: dict = ..., callback: Incomplete | None = ...): ... diff --git a/src/typings/netius/servers/__init__.pyi b/src/typings/netius/servers/__init__.pyi new file mode 100644 index 00000000..957aaea1 --- /dev/null +++ b/src/typings/netius/servers/__init__.pyi @@ -0,0 +1,21 @@ +from . import dhcp as dhcp, echo as echo, echo_ws as echo_ws, ftp as ftp, http as http, http2 as http2, mjpg as mjpg, pop as pop, proxy as proxy, smtp as smtp, socks as socks, tftp as tftp, torrent as torrent, ws as ws, wsgi as wsgi +from netius.servers.dhcp import DHCPRequest as DHCPRequest, DHCPServer as DHCPServer +from netius.servers.echo import EchoServer as EchoServer +from netius.servers.echo_ws import EchoWSServer as EchoWSServer +from netius.servers.ftp import FTPConnection as FTPConnection, FTPServer as FTPServer +from netius.servers.http import HTTPConnection as HTTPConnection, HTTPServer as HTTPServer +from netius.servers.http2 import HTTP2Server as HTTP2Server +from netius.servers.mjpg import MJPGServer as MJPGServer +from netius.servers.pop import POPConnection as POPConnection, POPServer as POPServer +from netius.servers.proxy import ProxyConnection as ProxyConnection, ProxyServer as ProxyServer +from netius.servers.smtp import SMTPConnection as SMTPConnection, SMTPServer as SMTPServer +from netius.servers.socks import SOCKSConnection as SOCKSConnection, SOCKSServer as SOCKSServer +from netius.servers.tftp import TFTPRequest as TFTPRequest, TFTPServer as TFTPServer +from netius.servers.torrent import Pieces as Pieces, TorrentServer as TorrentServer, TorrentTask as TorrentTask +from netius.servers.ws import WSConnection as WSConnection, WSServer as WSServer +from netius.servers.wsgi import WSGIServer as WSGIServer + +__version__: str +__revision__: str +__date__: str +TERMINATION_SIZE: int diff --git a/src/typings/netius/servers/dhcp.pyi b/src/typings/netius/servers/dhcp.pyi new file mode 100644 index 00000000..adf04634 --- /dev/null +++ b/src/typings/netius/servers/dhcp.pyi @@ -0,0 +1,73 @@ +import netius as netius +import netius.base.server +from typing import ClassVar + +__version__: str +__revision__: str +__date__: str + +class DHCPRequest: + options_m: ClassVar[None] = ... + options_l: ClassVar[None] = ... + def __init__(self, data) -> None: ... + @classmethod + def generate(cls): ... + def get_info(self): ... + def print_info(self): ... + def parse(self): ... + def unpack_options(self): ... + def get_requested(self): ... + def get_type(self): ... + def get_type_s(self): ... + def get_mac(self): ... + def response(self, yiaddr, options: dict = ...): ... + @classmethod + def _str(cls, data): ... + @classmethod + def _pack_m(cls, sequence, format): ... + @classmethod + def _option_subnet(cls, subnet: str = ...): ... + @classmethod + def _option_router(cls, routers: list = ...): ... + @classmethod + def _option_dns(cls, servers: list = ...): ... + @classmethod + def _option_name(cls, name: str = ...): ... + @classmethod + def _option_broadcast(cls, broadcast: str = ...): ... + @classmethod + def _option_requested(cls, ip: str = ...): ... + @classmethod + def _option_lease(cls, time: int = ...): ... + @classmethod + def _option_discover(cls): ... + @classmethod + def _option_offer(cls): ... + @classmethod + def _option_request(cls): ... + @classmethod + def _option_decline(cls): ... + @classmethod + def _option_ack(cls): ... + @classmethod + def _option_nak(cls): ... + @classmethod + def _option_identifier(cls, identifier: str = ...): ... + @classmethod + def _option_renewal(cls, time: int = ...): ... + @classmethod + def _option_rebind(cls, time: int = ...): ... + @classmethod + def _option_proxy(cls, url: str = ...): ... + @classmethod + def _option_end(cls): ... + +class DHCPServer(netius.base.server.DatagramServer): + def serve(self, port: int = ..., type: int = ..., *args, **kwargs): ... + def on_data(self, address, data): ... + def on_data_dhcp(self, address, request): ... + def get_verb(self, type_r): ... + def send_dhcp(self, data, *args, **kwargs): ... + def get_type(self, request): ... + def get_options(self, request): ... + def get_yiaddr(self, request): ... diff --git a/src/typings/netius/servers/echo.pyi b/src/typings/netius/servers/echo.pyi new file mode 100644 index 00000000..b3d00dc7 --- /dev/null +++ b/src/typings/netius/servers/echo.pyi @@ -0,0 +1,12 @@ +import netius as netius +import netius.base.agent +import netius.base.protocol + +__version__: str +__revision__: str +__date__: str + +class EchoProtocol(netius.base.protocol.StreamProtocol): ... + +class EchoServer(netius.base.agent.ServerAgent): + class protocol(netius.base.protocol.StreamProtocol): ... diff --git a/src/typings/netius/servers/echo_ws.pyi b/src/typings/netius/servers/echo_ws.pyi new file mode 100644 index 00000000..3fe84799 --- /dev/null +++ b/src/typings/netius/servers/echo_ws.pyi @@ -0,0 +1,9 @@ +import netius.servers.ws +import netius.servers.ws as ws + +__version__: str +__revision__: str +__date__: str + +class EchoWSServer(netius.servers.ws.WSServer): + def on_data_ws(self, connection, data): ... diff --git a/src/typings/netius/servers/ftp.pyi b/src/typings/netius/servers/ftp.pyi new file mode 100644 index 00000000..7f647a74 --- /dev/null +++ b/src/typings/netius/servers/ftp.pyi @@ -0,0 +1,81 @@ +import netius as netius +import netius.base.conn +import netius.base.container +import netius.base.server +from _typeshed import Incomplete + +__version__: str +__revision__: str +__date__: str +BUFFER_SIZE: int +CAPABILITIES: tuple +PERMISSIONS: dict +TYPES: dict + +class FTPConnection(netius.base.conn.BaseConnection): + def __init__(self, base_path: str = ..., host: str = ..., mode: str = ..., *args, **kwargs) -> None: ... + def open(self, *args, **kwargs): ... + def close(self, *args, **kwargs): ... + def parse(self, data): ... + def send_ftp(self, code, message: str = ..., lines: tuple = ..., simple: bool = ..., delay: bool = ..., callback: Incomplete | None = ...): ... + def send_ftp_base(self, code, message: str = ..., delay: bool = ..., callback: Incomplete | None = ...): ... + def send_ftp_lines(self, code, message: str = ..., lines: tuple = ..., simple: bool = ..., delay: bool = ..., callback: Incomplete | None = ...): ... + def ready(self): ... + def ok(self): ... + def not_ok(self): ... + def flush_ftp(self): ... + def data_ftp(self, data): ... + def closed_ftp(self): ... + def flush_list(self): ... + def flush_retr(self): ... + def flush_stor(self): ... + def on_flush_list(self, connection): ... + def on_flush_retr(self, connection): ... + def on_line(self, code, message, is_final: bool = ...): ... + def on_user(self, message): ... + def on_syst(self, message): ... + def on_feat(self, message): ... + def on_opts(self, message): ... + def on_pwd(self, message): ... + def on_type(self, message): ... + def on_pasv(self, message): ... + def on_port(self, message): ... + def on_dele(self, message): ... + def on_mkd(self, message): ... + def on_rmd(self, message): ... + def on_rnfr(self, message): ... + def on_rnto(self, message): ... + def on_cdup(self, message): ... + def on_cwd(self, message): ... + def on_size(self, message): ... + def on_mdtm(self, message): ... + def on_noop(self, message): ... + def on_quit(self, message): ... + def on_list(self, message): ... + def on_retr(self, message): ... + def on_stor(self, message): ... + def _file_send(self, connection): ... + def _file_finish(self, connection): ... + def _data_open(self): ... + def _data_close(self): ... + def _list(self): ... + def _to_unix(self, mode): ... + def _get_path(self, extra: Incomplete | None = ...): ... + +class FTPDataServer(netius.base.server.StreamServer): + def __init__(self, connection, container, *args, **kwargs) -> None: ... + def on_connection_c(self, connection): ... + def on_connection_d(self, connection): ... + def on_data(self, connection, data): ... + def send_ftp(self, data, delay: bool = ..., force: bool = ..., callback: Incomplete | None = ...): ... + def flush_ftp(self): ... + def close_ftp(self): ... + +class FTPServer(netius.base.container.ContainerServer): + def __init__(self, base_path: str = ..., auth_s: str = ..., *args, **kwargs) -> None: ... + def serve(self, host: str = ..., port: int = ..., *args, **kwargs): ... + def on_connection_c(self, connection): ... + def on_data(self, connection, data): ... + def on_serve(self): ... + def build_connection(self, socket, address, ssl: bool = ...): ... + def on_line_ftp(self, connection, code, message): ... diff --git a/src/typings/netius/servers/http.pyi b/src/typings/netius/servers/http.pyi new file mode 100644 index 00000000..938d48a9 --- /dev/null +++ b/src/typings/netius/servers/http.pyi @@ -0,0 +1,99 @@ +import netius as netius +import netius.base.conn +import netius.base.server +from _typeshed import Incomplete +from typing import ClassVar + +__version__: str +__revision__: str +__date__: str +PLAIN_ENCODING: int +CHUNKED_ENCODING: int +GZIP_ENCODING: int +DEFLATE_ENCODING: int +Z_PARTIAL_FLUSH: int +ENCODING_MAP: dict + +class HTTPConnection(netius.base.conn.BaseConnection): + def __init__(self, encoding: int = ..., *args, **kwargs) -> None: ... + def open(self, *args, **kwargs): ... + def close(self, *args, **kwargs): ... + def info_dict(self, full: bool = ...): ... + def flush(self, stream: Incomplete | None = ..., callback: Incomplete | None = ...): ... + def flush_s(self, stream: Incomplete | None = ..., callback: Incomplete | None = ...): ... + def send_base(self, data, stream: Incomplete | None = ..., final: bool = ..., delay: bool = ..., callback: Incomplete | None = ...): ... + def send_plain(self, data, stream: Incomplete | None = ..., final: bool = ..., delay: bool = ..., callback: Incomplete | None = ...): ... + def send_chunked(self, data, stream: Incomplete | None = ..., final: bool = ..., delay: bool = ..., callback: Incomplete | None = ...): ... + def send_gzip(self, data, stream: Incomplete | None = ..., final: bool = ..., delay: bool = ..., callback: Incomplete | None = ..., level: int = ...): ... + def send_response(self, data: Incomplete | None = ..., headers: Incomplete | None = ..., version: Incomplete | None = ..., code: int = ..., code_s: Incomplete | None = ..., apply: bool = ..., stream: Incomplete | None = ..., final: bool = ..., flush: bool = ..., delay: bool = ..., callback: Incomplete | None = ...): ... + def send_header(self, headers: Incomplete | None = ..., version: Incomplete | None = ..., code: int = ..., code_s: Incomplete | None = ..., stream: Incomplete | None = ..., final: bool = ..., delay: bool = ..., callback: Incomplete | None = ...): ... + def send_part(self, data, stream: Incomplete | None = ..., final: bool = ..., flush: bool = ..., delay: bool = ..., callback: Incomplete | None = ...): ... + def parse(self, data): ... + def resolve_encoding(self, parser): ... + def set_encoding(self, encoding): ... + def set_uncompressed(self): ... + def set_plain(self): ... + def set_chunked(self): ... + def set_gzip(self): ... + def set_deflate(self): ... + def is_plain(self): ... + def is_chunked(self): ... + def is_gzip(self): ... + def is_deflate(self): ... + def is_compressed(self): ... + def is_uncompressed(self): ... + def is_flushed(self): ... + def is_measurable(self, strict: bool = ...): ... + def on_data(self): ... + def ctx_request(self, *args, **kwds): ... + def _flush_plain(self, stream: Incomplete | None = ..., callback: Incomplete | None = ...): ... + def _flush_chunked(self, stream: Incomplete | None = ..., callback: Incomplete | None = ...): ... + def _flush_gzip(self, stream: Incomplete | None = ..., callback: Incomplete | None = ...): ... + def _get_gzip(self, stream, level: int = ..., ensure: bool = ...): ... + def _set_gzip(self, stream, gzip): ... + def _unset_gzip(self, stream): ... + def _close_gzip(self, safe: bool = ...): ... + @property + def connection_ctx(self): ... + @property + def parser_ctx(self): ... + +class HTTPServer(netius.base.server.StreamServer): + BASE_HEADERS: ClassVar[dict] = ... + def __init__(self, encoding: str = ..., common_log: Incomplete | None = ..., *args, **kwargs) -> None: ... + @classmethod + def build_data(cls, text, url: Incomplete | None = ..., trace: bool = ..., style: bool = ..., style_urls: list = ..., encode: bool = ..., encoding: str = ...): ... + @classmethod + def build_text(cls, text, trace: bool = ..., style: bool = ..., style_urls: list = ..., encode: bool = ..., encoding: str = ...): ... + @classmethod + def build_iframe(cls, text, url, style: bool = ..., style_urls: list = ..., encode: bool = ..., encoding: str = ...): ... + @classmethod + def _gen_text(cls, text, trace: bool = ..., style: bool = ..., style_urls: list = ...): ... + @classmethod + def _gen_iframe(cls, text, url, style: bool = ..., style_urls: list = ...): ... + @classmethod + def _gen_header(cls, title, meta: bool = ..., style: bool = ..., style_urls: list = ...): ... + @classmethod + def _gen_footer(cls): ... + @classmethod + def _gen_style(cls): ... + def cleanup(self): ... + def info_dict(self, full: bool = ...): ... + def on_data(self, connection, data): ... + def on_serve(self): ... + def build_connection(self, socket, address, ssl: bool = ...): ... + def on_data_http(self, connection, parser): ... + def on_send_http(self, connection, parser, headers: Incomplete | None = ..., version: Incomplete | None = ..., code: int = ..., code_s: Incomplete | None = ...): ... + def on_flush_http(self, connection, parser, encoding: Incomplete | None = ...): ... + def authorize(self, connection, parser, auth: Incomplete | None = ..., **kwargs): ... + def _apply_all(self, parser, connection, headers, upper: bool = ..., normalize: bool = ..., replace: bool = ...): ... + def _apply_base(self, headers, replace: bool = ...): ... + def _apply_parser(self, parser, headers, replace: bool = ...): ... + def _apply_connection(self, connection, headers, strict: bool = ...): ... + def _headers_upper(self, headers): ... + def _headers_normalize(self, headers): ... + def _authorization(self, parser): ... + def _write_common(self, message, encoding: str = ...): ... + def _log_request(self, connection, parser, *args, **kwargs): ... + def _log_request_basic(self, connection, parser, output: Incomplete | None = ...): ... + def _log_request_common(self, connection, parser, headers: Incomplete | None = ..., version: Incomplete | None = ..., code: int = ..., code_s: Incomplete | None = ..., size_s: Incomplete | None = ..., username: str = ..., output: Incomplete | None = ...): ... diff --git a/src/typings/netius/servers/http2.pyi b/src/typings/netius/servers/http2.pyi new file mode 100644 index 00000000..526e45d2 --- /dev/null +++ b/src/typings/netius/servers/http2.pyi @@ -0,0 +1,109 @@ +import netius as netius +import netius.servers.http +import netius.servers.http as http +from _typeshed import Incomplete + +__version__: str +__revision__: str +__date__: str + +class HTTP2Connection(netius.servers.http.HTTPConnection): + def __init__(self, legacy: bool = ..., window: int = ..., settings: dict = ..., settings_r: dict = ..., *args, **kwargs) -> None: ... + def open(self, *args, **kwargs): ... + def info_dict(self, full: bool = ...): ... + def flush_s(self, stream: Incomplete | None = ..., callback: Incomplete | None = ...): ... + def set_h2(self): ... + def parse(self, data): ... + def parse_preface(self, data): ... + def send_plain(self, data, stream: Incomplete | None = ..., final: bool = ..., delay: bool = ..., callback: Incomplete | None = ...): ... + def send_chunked(self, data, stream: Incomplete | None = ..., final: bool = ..., delay: bool = ..., callback: Incomplete | None = ...): ... + def send_fragmented(self, data, stream: Incomplete | None = ..., final: bool = ..., delay: bool = ..., callback: Incomplete | None = ...): ... + def send_response(self, data: Incomplete | None = ..., headers: Incomplete | None = ..., version: Incomplete | None = ..., code: int = ..., code_s: Incomplete | None = ..., apply: bool = ..., stream: Incomplete | None = ..., final: bool = ..., flush: bool = ..., delay: bool = ..., callback: Incomplete | None = ...): ... + def send_header(self, headers: Incomplete | None = ..., version: Incomplete | None = ..., code: int = ..., code_s: Incomplete | None = ..., stream: Incomplete | None = ..., final: bool = ..., delay: bool = ..., callback: Incomplete | None = ...): ... + def send_part(self, data, stream: Incomplete | None = ..., final: bool = ..., flush: bool = ..., delay: bool = ..., callback: Incomplete | None = ...): ... + def send_frame(self, type: int = ..., flags: int = ..., payload: bytes = ..., stream: int = ..., delay: bool = ..., callback: Incomplete | None = ...): ... + def send_data(self, data: bytes = ..., end_stream: bool = ..., stream: Incomplete | None = ..., delay: bool = ..., callback: Incomplete | None = ...): ... + def send_headers(self, headers: list = ..., end_stream: bool = ..., end_headers: bool = ..., stream: Incomplete | None = ..., delay: bool = ..., callback: Incomplete | None = ...): ... + def send_rst_stream(self, error_code: int = ..., stream: Incomplete | None = ..., delay: bool = ..., callback: Incomplete | None = ...): ... + def send_settings(self, settings: tuple = ..., ack: bool = ..., delay: bool = ..., callback: Incomplete | None = ...): ... + def send_ping(self, opaque: bytes = ..., ack: bool = ..., delay: bool = ..., callback: Incomplete | None = ...): ... + def send_goaway(self, last_stream: int = ..., error_code: int = ..., message: str = ..., close: bool = ..., delay: bool = ..., callback: Incomplete | None = ...): ... + def send_window_update(self, increment: int = ..., stream: Incomplete | None = ..., delay: bool = ..., callback: Incomplete | None = ...): ... + def send_delta(self): ... + def delay_frame(self, *args, **kwargs): ... + def flush_frames(self, all: bool = ...): ... + def flush_available(self): ... + def set_settings(self, settings): ... + def close_stream(self, stream, final: bool = ..., flush: bool = ..., reset: bool = ...): ... + def available_stream(self, stream, length, strict: bool = ...): ... + def fragment_stream(self, stream, data): ... + def fragmentable_stream(self, stream, data): ... + def open_stream(self, stream): ... + def try_available(self, stream, strict: bool = ...): ... + def try_unavailable(self, stream, strict: bool = ...): ... + def increment_remote(self, stream, increment, all: bool = ...): ... + def increment_local(self, stream, increment): ... + def error_connection(self, last_stream: int = ..., error_code: int = ..., message: str = ..., close: bool = ..., callback: Incomplete | None = ...): ... + def error_stream(self, stream, last_stream: int = ..., error_code: int = ..., message: str = ..., close: bool = ..., callback: Incomplete | None = ...): ... + def on_header(self, header): ... + def on_payload(self): ... + def on_frame(self): ... + def on_data_h2(self, stream, contents): ... + def on_headers_h2(self, stream): ... + def on_rst_stream(self, stream, error_code): ... + def on_settings(self, settings, ack): ... + def on_ping(self, opaque, ack): ... + def on_goaway(self, last_stream, error_code, extra): ... + def on_window_update(self, stream, increment): ... + def on_continuation(self, stream): ... + def is_throttleable(self): ... + def _build_c(self, callback, stream, data_l): ... + def _flush_plain(self, stream: Incomplete | None = ..., callback: Incomplete | None = ...): ... + def _flush_chunked(self, stream: Incomplete | None = ..., callback: Incomplete | None = ...): ... + @property + def connection_ctx(self): ... + @property + def parser_ctx(self): ... + +class HTTP2Server(netius.servers.http.HTTPServer): + def __init__(self, legacy: bool = ..., safe: bool = ..., settings: dict = ..., *args, **kwargs) -> None: ... + @classmethod + def _has_hpack(cls): ... + @classmethod + def _has_alpn(cls): ... + @classmethod + def _has_npn(cls): ... + def info_dict(self, full: bool = ...): ... + def get_protocols(self): ... + def build_connection(self, socket, address, ssl: bool = ...): ... + def on_exception(self, exception, connection): ... + def on_ssl(self, connection): ... + def on_serve(self): ... + def on_preface_http2(self, connection, parser): ... + def on_header_http2(self, connection, parser, header): ... + def on_payload_http2(self, connection, parser): ... + def on_frame_http2(self, connection, parser): ... + def on_data_http2(self, connection, parser, stream, contents): ... + def on_headers_http2(self, connection, parser, stream): ... + def on_rst_stream_http2(self, connection, parser, stream, error_code): ... + def on_settings_http2(self, connection, parser, settings, ack): ... + def on_ping_http2(self, connection, parser, opaque, ack): ... + def on_goaway_http2(self, connection, parser, last_stream, error_code, extra): ... + def on_window_update_http2(self, connection, parser, stream, increment): ... + def on_continuation_http2(self, connection, parser, stream): ... + def on_send_http2(self, connection, parser, type, flags, payload, stream): ... + def _has_h2(self): ... + def _has_all_h2(self): ... + def _handle_exception(self, exception, connection): ... + def _log_frame(self, connection, parser): ... + def _log_error(self, error_code, extra): ... + def _log_send(self, connection, parser, type, flags, payload, stream): ... + def _log_window(self, parser, stream, remote: bool = ...): ... + def _log_frame_details(self, parser, type_s, flags, payload, stream, out): ... + def _log_frame_flags(self, type_s, *args): ... + def _log_frame_data(self, parser, flags, payload, stream, out): ... + def _log_frame_headers(self, parser, flags, payload, stream, out): ... + def _log_frame_rst_stream(self, parser, flags, payload, stream, out): ... + def _log_frame_goaway(self, parser, flags, payload, stream, out): ... + def _log_frame_window_update(self, parser, flags, payload, stream, out): ... + def _flags_l(self, flags, definition): ... diff --git a/src/typings/netius/servers/mjpg.pyi b/src/typings/netius/servers/mjpg.pyi new file mode 100644 index 00000000..066260d7 --- /dev/null +++ b/src/typings/netius/servers/mjpg.pyi @@ -0,0 +1,15 @@ +import netius as netius +import netius.servers.http2 +import netius.servers.http2 as http2 + +__version__: str +__revision__: str +__date__: str +BOUNDARY: str + +class MJPGServer(netius.servers.http2.HTTP2Server): + def __init__(self, boundary: str = ..., *args, **kwargs) -> None: ... + def on_data_http(self, connection, parser): ... + def on_send_mjpg(self, connection): ... + def get_delay(self, connection): ... + def get_image(self, connection): ... diff --git a/src/typings/netius/servers/pop.pyi b/src/typings/netius/servers/pop.pyi new file mode 100644 index 00000000..ae76fe71 --- /dev/null +++ b/src/typings/netius/servers/pop.pyi @@ -0,0 +1,63 @@ +import netius as netius +import netius.base.conn +import netius.base.server +from _typeshed import Incomplete + +__version__: str +__revision__: str +__date__: str +INITIAL_STATE: int +HELO_STATE: int +AUTH_STATE: int +SESSION_STATE: int +CHUNK_SIZE: int +CAPABILITIES: tuple +AUTH_METHODS: tuple + +class POPConnection(netius.base.conn.BaseConnection): + def __init__(self, host: str = ..., *args, **kwargs) -> None: ... + def open(self, *args, **kwargs): ... + def close(self, *args, **kwargs): ... + def parse(self, data): ... + def send_pop(self, message: str = ..., lines: tuple = ..., status: str = ..., delay: bool = ..., callback: Incomplete | None = ...): ... + def ready(self): ... + def starttls(self): ... + def capa(self): ... + def auth(self): ... + def accept(self): ... + def stat(self): ... + def list(self): ... + def uidl(self): ... + def retr(self, index): ... + def dele(self, index): ... + def bye(self): ... + def ok(self): ... + def not_implemented(self): ... + def on_line(self, code, message): ... + def on_stls(self, message): ... + def on_capa(self, message): ... + def on_auth(self, message): ... + def on_stat(self, message): ... + def on_list(self, message): ... + def on_uidl(self, message): ... + def on_retr(self, message): ... + def on_dele(self, message): ... + def on_quit(self, message): ... + def on_user(self, token): ... + def assert_s(self, expected): ... + +class POPServer(netius.base.server.StreamServer): + def __init__(self, adapter_s: str = ..., auth_s: str = ..., *args, **kwargs) -> None: ... + def serve(self, host: str = ..., port: int = ..., *args, **kwargs): ... + def on_connection_c(self, connection): ... + def on_connection_d(self, connection): ... + def on_data(self, connection, data): ... + def on_serve(self): ... + def build_connection(self, socket, address, ssl: bool = ...): ... + def on_line_pop(self, connection, code, message): ... + def on_auth_pop(self, connection, username, password): ... + def on_stat_pop(self, connection): ... + def on_list_pop(self, connection): ... + def on_uidl_pop(self, connection): ... + def on_retr_pop(self, connection, index): ... + def on_dele_pop(self, connection, index): ... diff --git a/src/typings/netius/servers/proxy.pyi b/src/typings/netius/servers/proxy.pyi new file mode 100644 index 00000000..aa7f4e98 --- /dev/null +++ b/src/typings/netius/servers/proxy.pyi @@ -0,0 +1,56 @@ +import netius as netius +import netius.servers.http as http +import netius.servers.http2 +import netius.servers.http2 as http2 + +__version__: str +__revision__: str +__date__: str +BUFFER_RATIO: float +MIN_RATIO: float +MAX_PENDING: int + +class ProxyConnection(netius.servers.http2.HTTP2Connection): + def open(self, *args, **kwargs): ... + def resolve_encoding(self, parser): ... + def set_h2(self): ... + def on_headers(self): ... + def on_partial(self, data): ... + def on_available(self): ... + def on_unavailable(self): ... + +class ProxyServer(netius.servers.http2.HTTP2Server): + def __init__(self, dynamic: bool = ..., throttle: bool = ..., trust_origin: bool = ..., max_pending: int = ..., *args, **kwargs) -> None: ... + def start(self): ... + def stop(self): ... + def cleanup(self): ... + def info_dict(self, full: bool = ...): ... + def connections_dict(self, full: bool = ..., parent: bool = ...): ... + def connection_dict(self, id, full: bool = ...): ... + def on_data(self, connection, data): ... + def on_connection_d(self, connection): ... + def on_stream_d(self, stream): ... + def on_serve(self): ... + def on_data_http(self, connection, parser): ... + def on_headers(self, connection, parser): ... + def on_partial(self, connection, parser, data): ... + def on_available(self, connection, parser): ... + def on_unavailable(self, connection, parser): ... + def build_connection(self, socket, address, ssl: bool = ...): ... + def _throttle(self, _connection): ... + def _prx_close(self, connection): ... + def _prx_keep(self, connection): ... + def _prx_throttle(self, connection): ... + def _raw_throttle(self, connection): ... + def _on_prx_headers(self, client, parser, headers): ... + def _on_prx_message(self, client, parser, message): ... + def _on_prx_partial(self, client, parser, data): ... + def _on_prx_connect(self, client, _connection): ... + def _on_prx_acquire(self, client, _connection): ... + def _on_prx_close(self, client, _connection): ... + def _on_prx_error(self, client, _connection, error): ... + def _on_raw_connect(self, client, _connection): ... + def _on_raw_data(self, client, _connection, data): ... + def _on_raw_close(self, client, _connection): ... + def _apply_headers(self, parser, connection, parser_prx, headers, upper: bool = ...): ... + def _apply_via(self, parser_prx, headers): ... diff --git a/src/typings/netius/servers/smtp.pyi b/src/typings/netius/servers/smtp.pyi new file mode 100644 index 00000000..b3aea996 --- /dev/null +++ b/src/typings/netius/servers/smtp.pyi @@ -0,0 +1,70 @@ +import netius as netius +import netius.base.conn +import netius.base.server +from _typeshed import Incomplete + +__version__: str +__revision__: str +__date__: str +INITIAL_STATE: int +HELO_STATE: int +HEADER_STATE: int +DATA_STATE: int +USERNAME_STATE: int +PASSWORD_STATE: int +TERMINATION_SIZE: int +CAPABILITIES: tuple + +class SMTPConnection(netius.base.conn.BaseConnection): + def __init__(self, host: str = ..., *args, **kwargs) -> None: ... + def open(self, *args, **kwargs): ... + def close(self, *args, **kwargs): ... + def parse(self, data): ... + def send_smtp(self, code, message: str = ..., lines: tuple = ..., delay: bool = ..., callback: Incomplete | None = ...): ... + def send_smtp_base(self, code, message: str = ..., delay: bool = ..., callback: Incomplete | None = ...): ... + def send_smtp_lines(self, code, message: str = ..., lines: tuple = ..., delay: bool = ..., callback: Incomplete | None = ...): ... + def ready(self): ... + def helo(self, host): ... + def ehlo(self, host): ... + def starttls(self): ... + def auth(self, method, data): ... + def auth_plain(self, data): ... + def auth_login(self, data): ... + def data(self): ... + def queued(self, index: int = ...): ... + def bye(self): ... + def ok(self): ... + def not_implemented(self): ... + def on_username(self, data): ... + def on_password(self, data): ... + def on_raw_data(self, data): ... + def on_line(self, code, message, is_final: bool = ...): ... + def on_helo(self, message): ... + def on_ehlo(self, message): ... + def on_starttls(self, message): ... + def on_auth(self, message): ... + def on_mail(self, message): ... + def on_rcpt(self, message): ... + def on_data(self, message): ... + def on_quit(self, message): ... + def assert_s(self, expected): ... + def to_s(self): ... + def received_s(self, for_s: bool = ...): ... + +class SMTPServer(netius.base.server.StreamServer): + def __init__(self, adapter_s: str = ..., auth_s: str = ..., locals: tuple = ..., *args, **kwargs) -> None: ... + def serve(self, host: str = ..., port: int = ..., *args, **kwargs): ... + def on_connection_c(self, connection): ... + def on_data(self, connection, data): ... + def on_serve(self): ... + def build_connection(self, socket, address, ssl: bool = ...): ... + def on_line_smtp(self, connection, code, message): ... + def on_auth_smtp(self, connection, username, password): ... + def on_header_smtp(self, connection, from_l, to_l): ... + def on_data_smtp(self, connection, data): ... + def on_message_smtp(self, connection): ... + def _locals(self, sequence, prefix: str = ...): ... + def _remotes(self, sequence, prefix: str = ...): ... + def _emails(self, sequence, prefix: str = ...): ... + def _users(self, emails): ... + def _is_local(self, email): ... diff --git a/src/typings/netius/servers/socks.pyi b/src/typings/netius/servers/socks.pyi new file mode 100644 index 00000000..ecf14946 --- /dev/null +++ b/src/typings/netius/servers/socks.pyi @@ -0,0 +1,42 @@ +import netius as netius +import netius.base.agent +import netius.base.conn +from _typeshed import Incomplete + +__version__: str +__revision__: str +__date__: str +GRANTED: int +REJECTED: int +FAILED_CLIENT: int +FAILED_AUTH: int +GRANTED_EXTRA: int +BUFFER_RATIO: float +MIN_RATIO: float +MAX_PENDING: int + +class SOCKSConnection(netius.base.conn.BaseConnection): + def __init__(self, *args, **kwargs) -> None: ... + def open(self, *args, **kwargs): ... + def close(self, *args, **kwargs): ... + def send_response(self, status: int = ...): ... + def send_response_extra(self, status: int = ...): ... + def send_auth(self, version: Incomplete | None = ..., method: int = ...): ... + def get_version(self): ... + def parse(self, data): ... + def on_data(self): ... + def on_auth(self): ... + +class SOCKSServer(netius.base.agent.ServerAgent): + def __init__(self, rules: dict = ..., throttle: bool = ..., max_pending: int = ..., *args, **kwargs) -> None: ... + def cleanup(self): ... + def on_data(self, connection, data): ... + def on_data_socks(self, connection, parser): ... + def on_auth_socks(self, connection, parser): ... + def on_connection_d(self, connection): ... + def build_connection(self, socket, address, ssl: bool = ...): ... + def _throttle(self, _connection): ... + def _raw_throttle(self, connection): ... + def _on_raw_connect(self, client, _connection): ... + def _on_raw_data(self, client, _connection, data): ... + def _on_raw_close(self, client, _connection): ... diff --git a/src/typings/netius/servers/tftp.pyi b/src/typings/netius/servers/tftp.pyi new file mode 100644 index 00000000..23b5a58f --- /dev/null +++ b/src/typings/netius/servers/tftp.pyi @@ -0,0 +1,53 @@ +import netius as netius +import netius.base.server +from _typeshed import Incomplete +from typing import ClassVar + +__version__: str +__revision__: str +__date__: str + +class TFTPSession: + def __init__(self, owner, name: Incomplete | None = ..., mode: Incomplete | None = ...) -> None: ... + def close(self): ... + def reset(self): ... + def next(self, size: int = ..., increment: bool = ...): ... + def ack(self, size: int = ..., increment: bool = ...): ... + def increment(self): ... + def get_info(self): ... + def print_info(self): ... + def _get_file(self, allow_absolute: bool = ...): ... + +class TFTPRequest: + parsers_m: ClassVar[None] = ... + parsers_l: ClassVar[None] = ... + def __init__(self, data, session) -> None: ... + @classmethod + def generate(cls): ... + def get_info(self): ... + def print_info(self): ... + def parse(self): ... + def get_type(self): ... + def get_type_s(self): ... + def response(self, options: dict = ...): ... + @classmethod + def _parse_rrq(cls, self): ... + @classmethod + def _parse_wrq(cls, self): ... + @classmethod + def _parse_data(cls, self): ... + @classmethod + def _parse_ack(cls, self): ... + @classmethod + def _parse_error(cls, self): ... + @classmethod + def _str(cls, data): ... + +class TFTPServer(netius.base.server.DatagramServer): + ALLOWED_OPERATIONS: ClassVar[tuple] = ... + def __init__(self, base_path: str = ..., *args, **kwargs) -> None: ... + def serve(self, port: int = ..., *args, **kwargs): ... + def on_data(self, address, data): ... + def on_serve(self): ... + def on_data_tftp(self, address, request): ... + def on_error_tftp(self, address, exception): ... diff --git a/src/typings/netius/servers/torrent.pyi b/src/typings/netius/servers/torrent.pyi new file mode 100644 index 00000000..7843fb32 --- /dev/null +++ b/src/typings/netius/servers/torrent.pyi @@ -0,0 +1,98 @@ +import netius as netius +import netius.base.container +import netius.base.observer +from _typeshed import Incomplete + +__version__: str +__revision__: str +__date__: str +REFRESH_TIME: float +ID_STRING: str +BLOCK_SIZE: int +THRESHOLD_END: int +MAX_MISSING: int +PEER_PATHS: tuple + +class Pieces(netius.base.observer.Observable): + def __init__(self, length, number_pieces, number_blocks) -> None: ... + def piece(self, index): ... + def piece_blocks(self, index): ... + def piece_size(self, index): ... + def block(self, index, begin): ... + def block_size(self, index, begin): ... + def pop_block(self, bitfield, mark: bool = ...): ... + def push_block(self, index, begin): ... + def mark_piece(self, index, value: bool = ...): ... + def mark_block(self, index, begin, value: bool = ...): ... + def update_block(self, index, mark: bool = ...): ... + def update_piece(self, index): ... + def _and(self, first, second): ... + @property + def total_pieces(self): ... + @property + def marked_pieces(self): ... + @property + def missing_pieces(self): ... + @property + def total_blocks(self): ... + @property + def marked_blocks(self): ... + @property + def missing_blocks(self): ... + +class TorrentTask(netius.base.observer.Observable): + def __init__(self, owner, target_path, torrent_path: Incomplete | None = ..., info_hash: Incomplete | None = ...) -> None: ... + def load(self): ... + def unload(self): ... + def on_close(self, connection): ... + def ticks(self): ... + def refresh(self): ... + def on_choked(self, connection): ... + def on_unchoked(self, connection): ... + def on_block(self, pieces, index, begin): ... + def on_piece(self, pieces, index): ... + def on_complete(self, pieces): ... + def on_dht(self, response): ... + def on_tracker(self, client, parser, result): ... + def load_info(self, torrent_path): ... + def load_file(self): ... + def load_single(self): ... + def load_multiple(self): ... + def unload_file(self): ... + def load_pieces(self): ... + def unload_pieces(self): ... + def pieces_tracker(self): ... + def set_data(self, data, index, begin): ... + def write_data(self, data, offset): ... + def set_dht(self, peer_t, port): ... + def peers_dht(self): ... + def peers_tracker(self): ... + def peers_file(self): ... + def connect_peers(self): ... + def disconnect_peers(self): ... + def connect_peer(self, peer): ... + def info_string(self): ... + def left(self): ... + def speed(self): ... + def speed_s(self): ... + def percent(self): ... + def pop_block(self, bitfield): ... + def push_block(self, index, begin): ... + def verify_piece(self, index): ... + def confirm_piece(self, index): ... + def refute_piece(self, index): ... + def extend_peers(self, peers): ... + def add_peer(self, peer): ... + def remove_peer(self, peer): ... + def _is_single(self): ... + def _verify_piece(self, index, file): ... + +class TorrentServer(netius.base.container.ContainerServer): + def __init__(self, *args, **kwargs) -> None: ... + def cleanup(self): ... + def ticks(self): ... + def download(self, target_path, torrent_path: Incomplete | None = ..., info_hash: Incomplete | None = ..., close: bool = ...): ... + def add_task(self, task): ... + def remove_task(self, task): ... + def cleanup_tasks(self): ... + def _generate_id(self): ... diff --git a/src/typings/netius/servers/ws.pyi b/src/typings/netius/servers/ws.pyi new file mode 100644 index 00000000..f897974f --- /dev/null +++ b/src/typings/netius/servers/ws.pyi @@ -0,0 +1,26 @@ +import netius as netius +import netius.base.conn +import netius.base.server +from typing import ClassVar + +__version__: str +__revision__: str +__date__: str + +class WSConnection(netius.base.conn.BaseConnection): + def __init__(self, *args, **kwargs) -> None: ... + def send_ws(self, data): ... + def recv_ws(self, size: int = ...): ... + def add_buffer(self, data): ... + def get_buffer(self, delete: bool = ...): ... + def do_handshake(self): ... + def accept_key(self): ... + +class WSServer(netius.base.server.StreamServer): + MAGIC_VALUE: ClassVar[str] = ... + def on_data(self, connection, data): ... + def build_connection(self, socket, address, ssl: bool = ...): ... + def send_ws(self, connection, data): ... + def on_data_ws(self, connection, data): ... + def on_handshake(self, connection): ... + def _handshake_response(self, accept_key): ... diff --git a/src/typings/netius/servers/wsgi.pyi b/src/typings/netius/servers/wsgi.pyi new file mode 100644 index 00000000..198583fd --- /dev/null +++ b/src/typings/netius/servers/wsgi.pyi @@ -0,0 +1,29 @@ +import netius as netius +import netius.servers.http as http +import netius.servers.http2 +import netius.servers.http2 as http2 + +__version__: str +__revision__: str +__date__: str +SERVER_SOFTWARE: str +COMPRESSED_LIMIT: int + +class WSGIServer(netius.servers.http2.HTTP2Server): + def __init__(self, app, mount: str = ..., decode: bool = ..., compressed_limit: int = ..., *args, **kwargs) -> None: ... + def on_connection_d(self, connection): ... + def on_serve(self): ... + def on_data_http(self, connection, parser): ... + def on_environ(self, connection, environ): ... + def _next_queue(self, connection): ... + def _start_response(self, connection, status, headers): ... + def _send_part(self, connection): ... + def _final(self, connection): ... + def _close(self, connection): ... + def _release(self, connection): ... + def _release_future(self, connection): ... + def _release_iterator(self, connection): ... + def _release_environ(self, connection): ... + def _release_parser(self, connection): ... + def _release_queue(self, connection): ... + def _decode(self, value): ... diff --git a/src/typings/netius/sh/__init__.pyi b/src/typings/netius/sh/__init__.pyi new file mode 100644 index 00000000..f90e5c3f --- /dev/null +++ b/src/typings/netius/sh/__init__.pyi @@ -0,0 +1,5 @@ +from . import base as base, dkim as dkim, rsa as rsa, smtp as smtp + +__version__: str +__revision__: str +__date__: str diff --git a/src/typings/netius/sh/auth.pyi b/src/typings/netius/sh/auth.pyi new file mode 100644 index 00000000..888cc519 --- /dev/null +++ b/src/typings/netius/sh/auth.pyi @@ -0,0 +1,7 @@ +import netius as netius +import netius.sh.base as base + +__version__: str +__revision__: str +__date__: str +def generate(password, type: str = ..., salt: str = ...): ... diff --git a/src/typings/netius/sh/base.pyi b/src/typings/netius/sh/base.pyi new file mode 100644 index 00000000..0891437d --- /dev/null +++ b/src/typings/netius/sh/base.pyi @@ -0,0 +1,4 @@ +__version__: str +__revision__: str +__date__: str +def sh_call(globals: dict = ..., locals: dict = ...): ... diff --git a/src/typings/netius/sh/dkim.pyi b/src/typings/netius/sh/dkim.pyi new file mode 100644 index 00000000..fc75eed5 --- /dev/null +++ b/src/typings/netius/sh/dkim.pyi @@ -0,0 +1,9 @@ +import netius as netius +import netius.sh.base as base +from _typeshed import Incomplete + +__version__: str +__revision__: str +__date__: str +def generate(domain, suffix: Incomplete | None = ..., number_bits: int = ...): ... +def sign(email_path, key_path, selector, domain): ... diff --git a/src/typings/netius/sh/rsa.pyi b/src/typings/netius/sh/rsa.pyi new file mode 100644 index 00000000..5dc51846 --- /dev/null +++ b/src/typings/netius/sh/rsa.pyi @@ -0,0 +1,9 @@ +import netius as netius +import netius.sh.base as base + +__version__: str +__revision__: str +__date__: str +def read_private(path): ... +def read_public(path): ... +def private_to_public(private_path, public_path): ... diff --git a/src/typings/netius/sh/smtp.pyi b/src/typings/netius/sh/smtp.pyi new file mode 100644 index 00000000..fcfac97e --- /dev/null +++ b/src/typings/netius/sh/smtp.pyi @@ -0,0 +1,8 @@ +import netius as netius +import netius.sh.base as base +from _typeshed import Incomplete + +__version__: str +__revision__: str +__date__: str +def send(path, sender, receiver, host: Incomplete | None = ..., port: int = ..., username: Incomplete | None = ..., password: Incomplete | None = ..., stls: bool = ...): ...