diff --git a/av/enum.pyi b/av/enum.pyi index a4fe92e51..026a176b3 100644 --- a/av/enum.pyi +++ b/av/enum.pyi @@ -24,9 +24,10 @@ class EnumType(type): ) -> int | None: ... class EnumItem: - name: str - value: int - + @property + def name(self) -> str: ... + @property + def value(self) -> int: ... def __int__(self) -> int: ... def __hash__(self) -> int: ... def __reduce__( diff --git a/av/error.pyi b/av/error.pyi index 088f78d45..4c41f35e7 100644 --- a/av/error.pyi +++ b/av/error.pyi @@ -1,4 +1,5 @@ import builtins +from enum import Enum from .enum import EnumItem @@ -15,41 +16,43 @@ def err_check(res: int, filename: str | None = None) -> int: ... BUFFER_TOO_SMALL: EnumItem -class ErrorType(EnumItem): - BSF_NOT_FOUND: int - BUG: int - BUFFER_TOO_SMALL: int - DECODER_NOT_FOUND: int - DEMUXER_NOT_FOUND: int - ENCODER_NOT_FOUND: int - EOF: int - EXIT: int - EXTERNAL: int - FILTER_NOT_FOUND: int - INVALIDDATA: int - MUXER_NOT_FOUND: int - OPTION_NOT_FOUND: int - PATCHWELCOME: int - PROTOCOL_NOT_FOUND: int - UNKNOWN: int - EXPERIMENTAL: int - INPUT_CHANGED: int - OUTPUT_CHANGED: int - HTTP_BAD_REQUEST: int - HTTP_UNAUTHORIZED: int - HTTP_FORBIDDEN: int - HTTP_NOT_FOUND: int - HTTP_OTHER_4XX: int - HTTP_SERVER_ERROR: int - PYAV_CALLBACK: int +class ErrorType(EnumItem, Enum): + BSF_NOT_FOUND: EnumItem + BUG: EnumItem + BUFFER_TOO_SMALL: EnumItem + DECODER_NOT_FOUND: EnumItem + DEMUXER_NOT_FOUND: EnumItem + ENCODER_NOT_FOUND: EnumItem + EOF: EnumItem + EXIT: EnumItem + EXTERNAL: EnumItem + FILTER_NOT_FOUND: EnumItem + INVALIDDATA: EnumItem + MUXER_NOT_FOUND: EnumItem + OPTION_NOT_FOUND: EnumItem + PATCHWELCOME: EnumItem + PROTOCOL_NOT_FOUND: EnumItem + UNKNOWN: EnumItem + EXPERIMENTAL: EnumItem + INPUT_CHANGED: EnumItem + OUTPUT_CHANGED: EnumItem + HTTP_BAD_REQUEST: EnumItem + HTTP_UNAUTHORIZED: EnumItem + HTTP_FORBIDDEN: EnumItem + HTTP_NOT_FOUND: EnumItem + HTTP_OTHER_4XX: EnumItem + HTTP_SERVER_ERROR: EnumItem + PYAV_CALLBACK: EnumItem - tag: bytes + @property + def tag(self) -> bytes: ... class FFmpegError(Exception): errno: int strerror: str filename: str log: tuple[int, tuple[int, str, str] | None] + type: ErrorType def __init__( self,