__init__.pyi 2.4 KB

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