HEX
Server: Apache
System: Linux insrv.serversdaddy.com 5.14.0-362.24.2.el9_3.x86_64 #1 SMP PREEMPT_DYNAMIC Sat Mar 30 14:11:54 EDT 2024 x86_64
User: jsaha (1066)
PHP: 8.3.6
Disabled: exec,passthru,shell_exec,system
Upload Files
File: //lib/python3.9/site-packages/__pycache__/magic.cpython-39.opt-1.pyc
a

$pC[� �@s�dZddlZddlmZddlTddlmZdd�ZiZe�ed<dZZ	d	Z
Zd
ZZ
dZZdZZd
ZZdZZdZZdZZdZZdZZdZZdZ Z!dZ"Z#dZ$Z%dZ&Z'dZ(Z)dZ*Z+dZ,Z-dZ.Z/dZ0Z1dZ2Z3dZ4Z5dZ6Z7ed d!�Z8Gd"d#�d#e9�Z:ge:_;e<e:�Z=edj>Z?e=e?_@eAge?_BedjCZDdeD_@e=geD_BedjEZFeGeF_@e=eGgeF_BedjHZIeGeI_@e=eAgeI_BedjJZKeGeK_@e=eLeMgeK_BedjNZOeGeO_@e=geO_BedjPZQeAeQ_@e=eAgeQ_BedjRZSeAeS_@e=eGgeS_BedjTZUeAeU_@e=eGgeU_BedjVZWeAeW_@e=eGgeW_BedjXZYeAeY_@e=eGgeY_BedjZZ[eAe[_@e=ge[_BGd$d%�d%e\�Z]d&d'�Z^e]e?e ��Z_e_�`�e]e?e��Zaea�`�d(d)�Zbd*d+�Zcd,d-�Zdd.d/�ZedS)0z
Python bindings for libmagic
�N)�
namedtuple)�*)�find_librarycCstj�td��S)zc
    Loads the shared library through ctypes and returns a library
    L{ctypes.CDLL} instance
    �magic)�ctypesZcdllZLoadLibraryr�rr�)/usr/lib/python3.9/site-packages/magic.py�_initsr	r������ �@��iiiiii i@i�iiiii i�?�	FileMagic)�	mime_type�encoding�namec@seZdZdS)�	magic_setN)�__name__�
__module__�__qualname__rrrrr8src@s�eZdZdd�Zdd�Zedd��Zedd��Zd	d
�Zdd�Z	d
d�Z
dd�Zdd�Zddd�Z
dd�Zdd�Zdd�Zdd�ZdS)�MagiccCs
||_dS)N)�_magic_t)�self�msrrr�__init__oszMagic.__init__cCst|j�dS)zO
        Closes the magic database and deallocates any resources used.
        N)�_closer�rrrr�closerszMagic.closecCsF|durdSt|t�r|Szt|d�WSty@t|�YS0dS�Nzutf-8)�
isinstance�str�	TypeError)�srrrZ__tostrxs
z
Magic.__tostrcCsF|durdSt|t�r|Szt|d�WSty@t|�YS0dSr#)r$�bytesr&)�brrrZ	__tobytes�s
zMagic.__tobytescCst�t|jt�|���S)z�
        Returns a textual description of the contents of the argument passed
        as a filename or None if an error occurred and the MAGIC_ERROR flag
        is set. A call to errno() will return the numeric error code.
        )r�
_Magic__tostr�_filer�_Magic__tobytes�r�filenamerrr�file�sz
Magic.filecCst�t|j|��S)z�
        Returns a textual description of the contents of the argument passed
        as a file descriptor or None if an error occurred and the MAGIC_ERROR
        flag is set. A call to errno() will return the numeric error code.
        )rr*�_descriptorr)r�fdrrr�
descriptor�szMagic.descriptorcCst�t|j|t|���S)z�
        Returns a textual description of the contents of the argument passed
        as a buffer or None if an error occurred and the MAGIC_ERROR flag
        is set. A call to errno() will return the numeric error code.
        )rr*�_bufferr�len)r�bufrrr�buffer�szMagic.buffercCst�t|j��S)zh
        Returns a textual explanation of the last error or None
        if there was no error.
        )rr*�_errorrr!rrr�error�szMagic.errorcCst|j|�S)a*
        Set flags on the magic object which determine how magic checking
        behaves; a bitwise OR of the flags described in libmagic(3), but
        without the MAGIC_ prefix.

        Returns -1 on systems that don't support utime(2) or utimes(2)
        when PRESERVE_ATIME is set.
        )�	_setflagsr)r�flagsrrr�setflags�s	zMagic.setflagsNcCst|jt�|��S)a	
        Must be called to load entries in the colon separated list of database
        files passed as argument or the default database file if no argument
        before any magic queries can be performed.

        Returns 0 on success and -1 on failure.
        )�_loadrrr,r-rrr�load�sz
Magic.loadcCst|jt�|��S)aD
        Compile entries in the colon separated list of database files
        passed as argument or the default database file if no argument.
        The compiled files created are named from the basename(1) of each file
        argument with ".mgc" appended to it.

        Returns 0 on success and -1 on failure.
        )�_compilerrr,�rZdbsrrr�compile�s	z
Magic.compilecCst|jt�|��S�z�
        Check the validity of entries in the colon separated list of
        database files passed as argument or the default database file
        if no argument.

        Returns 0 on success and -1 on failure.
        )�_checkrrr,r?rrr�check�szMagic.checkcCst|jt�|��SrA)�_listrrr,r?rrr�list�sz
Magic.listcCs
t|j�S)a
        Returns a numeric error code. If return value is 0, an internal
        magic error occurred. If return value is non-zero, the value is
        an OS error code. Use the errno module or os.strerror() can be used
        to provide detailed error information.
        )�_errnorr!rrr�errno�szMagic.errno)N)rrrrr"�staticmethodr*r,r/r2r6r8r;r=r@rCrErGrrrrrns 







rcCstt|��S)zd
    Returns a magic object on success and None on failure.
    Flags argument as for setflags.
    )r�_open)r:rrr�open�srJcCsDz|�d�\}}Wnty,t|��Yn0t|||�dd�d�S)Nz; zcharset=�)rrr)�split�
ValueErrorr�replace)Z
mime_detectedZ
type_detectedrZ
mime_encodingrrr�_create_filemagic�s
�rOcCstt�|�t�|��S)zdDetect mime type, encoding and file type from a filename

    Returns a `FileMagic` namedtuple.
    )rO�
mime_magicr/�
none_magic)r.rrr�detect_from_filenames
�rRcCs|��}tt�|�t�|��S)zjDetect mime type, encoding and file type from file-like object

    Returns a `FileMagic` namedtuple.
    )�filenorOrPr2rQ)ZfobjZfile_descriptorrrr�detect_from_fobjs
�rTcCstt�|�t�|��S)z_Detect mime type, encoding and file type from bytes

    Returns a `FileMagic` namedtuple.
    )rOrPr6rQ)Zbyte_contentrrr�detect_from_contents
�rU)f�__doc__r�collectionsrZctypes.utilrr	Z
_librariesZ
MAGIC_NONEZNONEZMAGIC_DEBUG�DEBUGZ
MAGIC_SYMLINKZSYMLINKZMAGIC_COMPRESSZCOMPRESSZ
MAGIC_DEVICESZDEVICESZMAGIC_MIME_TYPEZ	MIME_TYPEZMAGIC_CONTINUEZCONTINUEZMAGIC_CHECKZCHECKZMAGIC_PRESERVE_ATIMEZPRESERVE_ATIMEZ	MAGIC_RAWZRAWZMAGIC_ERRORZERRORZMAGIC_MIME_ENCODINGZ
MIME_ENCODINGZ
MAGIC_MIMEZMIMEZMAGIC_APPLEZAPPLEZMAGIC_NO_CHECK_COMPRESSZNO_CHECK_COMPRESSZMAGIC_NO_CHECK_TARZNO_CHECK_TARZMAGIC_NO_CHECK_SOFTZ
NO_CHECK_SOFTZMAGIC_NO_CHECK_APPTYPEZNO_CHECK_APPTYPEZMAGIC_NO_CHECK_ELFZNO_CHECK_ELFZMAGIC_NO_CHECK_TEXTZ
NO_CHECK_TEXTZMAGIC_NO_CHECK_CDFZNO_CHECK_CDFZMAGIC_NO_CHECK_TOKENSZNO_CHECK_TOKENSZMAGIC_NO_CHECK_ENCODINGZNO_CHECK_ENCODINGZMAGIC_NO_CHECK_BUILTINZNO_CHECK_BUILTINrZ	StructurerZ_fields_ZPOINTERZmagic_tZ
magic_openrIZrestypeZc_int�argtypesZmagic_closer Z
magic_filer+Zc_char_pZmagic_descriptorr0Zmagic_bufferr3Zc_void_pZc_size_tZmagic_errorr7Zmagic_setflagsr9Z
magic_loadr<Z
magic_compiler>Zmagic_checkrBZ
magic_listrDZmagic_errnorF�objectrrJrPr=rQrOrRrTrUrrrr�<module>s�




















}