o
    m^@[þ  ã                   @   sØ   d dl Z d dlZd dlZe  e¡ZejjZ	G dd„ de
ƒZdd„ Zdd„ Zdd	„ Ze	jZg e_ee_e	jZejejejge_ee_e	jZejejge_ee_ee	d
dƒdur[e	jZdS ee	ddƒdurhe	jZdS edƒ‚)é    Nc                       s   e Zd Z‡ fdd„Z‡  ZS )ÚInotifyErrorc                    s<   t  ¡ | _|d| jf 7 }tt| ƒj|g|¢R i |¤Ž d S )Nz ERRNO=(%d))ÚctypesZ	get_errnoÚerrnoÚsuperr   Ú__init__)ÚselfÚmessageÚargsÚkwargs©Ú	__class__© ú1usr/lib/python3.10/site-packages/inotify/calls.pyr      s   
"zInotifyError.__init__)Ú__name__Ú
__module__Ú__qualname__r   Ú__classcell__r   r   r   r   r      s    r   c                 C   s   | dkrt d| f ƒ‚| S )Nr   z&Call failed (should return zero): (%d)©r   ©Úresultr   r   r   Ú_check_zero   ó
   ÿr   c                 C   ó   | dkrt d| f ƒ‚| S )Nr   z)Call failed (should return nonzero): (%d)r   r   r   r   r   Ú_check_nonzero   r   r   c                 C   r   )Néÿÿÿÿz$Call failed (should not be -1): (%d)r   r   r   r   r   Ú_check_nonnegative    r   r   r   Úerrz'errno' not found in library)Úloggingr   Zinotify.libraryÚinotifyÚ	getLoggerr   Z_LOGGERZlibraryÚinstanceZ_LIBÚ	Exceptionr   r   r   r   Zinotify_initÚargtypesÚrestypeZinotify_add_watchÚc_intÚc_char_pZc_uint32Zinotify_rm_watchÚgetattrr   r   ÚEnvironmentErrorr   r   r   r   Ú<module>   s4    
ý

