__init__.pyi 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687
  1. import ctypes.util
  2. import threading
  3. from typing import Any, Text, Optional, Union
  4. from os import PathLike
  5. class MagicException(Exception):
  6. message: Any = ...
  7. def __init__(self, message: Any) -> None: ...
  8. class Magic:
  9. flags: int = ...
  10. cookie: Any = ...
  11. lock: threading.Lock = ...
  12. def __init__(self, mime: bool = ..., magic_file: Optional[Any] = ..., mime_encoding: bool = ..., keep_going: bool = ..., uncompress: bool = ..., raw: bool = ...) -> None: ...
  13. def from_buffer(self, buf: Union[bytes, str]) -> Text: ...
  14. def from_file(self, filename: Union[bytes, str, PathLike]) -> Text: ...
  15. def from_descriptor(self, fd: int, mime: bool = ...) -> Text: ...
  16. def setparam(self, param: Any, val: Any): ...
  17. def getparam(self, param: Any): ...
  18. def __del__(self) -> None: ...
  19. def from_file(filename: Union[bytes, str, PathLike], mime: bool = ...) -> Text: ...
  20. def from_buffer(buffer: Union[bytes, str], mime: bool = ...) -> Text: ...
  21. def from_descriptor(fd: int, mime: bool = ...) -> Text: ...
  22. libmagic: Any
  23. dll: Any
  24. windows_dlls: Any
  25. platform_to_lib: Any
  26. platform: Any
  27. magic_t = ctypes.c_void_p
  28. def errorcheck_null(result: Any, func: Any, args: Any): ...
  29. def errorcheck_negative_one(result: Any, func: Any, args: Any): ...
  30. def maybe_decode(s: Union[bytes, str]) -> str: ...
  31. def coerce_filename(filename: Any): ...
  32. magic_open: Any
  33. magic_close: Any
  34. magic_error: Any
  35. magic_errno: Any
  36. def magic_file(cookie: Any, filename: Any): ...
  37. def magic_buffer(cookie: Any, buf: Any): ...
  38. def magic_descriptor(cookie: Any, fd: int): ...
  39. def magic_load(cookie: Any, filename: Any): ...
  40. magic_setflags: Any
  41. magic_check: Any
  42. magic_compile: Any
  43. def magic_setparam(cookie: Any, param: Any, val: Any): ...
  44. def magic_getparam(cookie: Any, param: Any): ...
  45. magic_version: Any
  46. def version(): ...
  47. MAGIC_NONE: int
  48. MAGIC_DEBUG: int
  49. MAGIC_SYMLINK: int
  50. MAGIC_COMPRESS: int
  51. MAGIC_DEVICES: int
  52. MAGIC_MIME_TYPE: int
  53. MAGIC_MIME_ENCODING: int
  54. MAGIC_MIME: int
  55. MAGIC_CONTINUE: int
  56. MAGIC_CHECK: int
  57. MAGIC_PRESERVE_ATIME: int
  58. MAGIC_RAW: int
  59. MAGIC_ERROR: int
  60. MAGIC_NO_CHECK_COMPRESS: int
  61. MAGIC_NO_CHECK_TAR: int
  62. MAGIC_NO_CHECK_SOFT: int
  63. MAGIC_NO_CHECK_APPTYPE: int
  64. MAGIC_NO_CHECK_ELF: int
  65. MAGIC_NO_CHECK_ASCII: int
  66. MAGIC_NO_CHECK_TROFF: int
  67. MAGIC_NO_CHECK_FORTRAN: int
  68. MAGIC_NO_CHECK_TOKENS: int
  69. MAGIC_PARAM_INDIR_MAX: int
  70. MAGIC_PARAM_NAME_MAX: int
  71. MAGIC_PARAM_ELF_PHNUM_MAX: int
  72. MAGIC_PARAM_ELF_SHNUM_MAX: int
  73. MAGIC_PARAM_ELF_NOTES_MAX: int
  74. MAGIC_PARAM_REGEX_MAX: int
  75. MAGIC_PARAM_BYTES_MAX: int