HEX
Server: Apache
System: Linux a16-asgard6.hospedagemuolhost.com.br 5.14.0-570.52.1.el9_6.x86_64 #1 SMP PREEMPT_DYNAMIC Wed Oct 15 06:39:08 EDT 2025 x86_64
User: maoristu4c3dbd03 (1436)
PHP: 8.1.33
Disabled: NONE
Upload Files
File: //lib/python3.9/site-packages/firewall/core/__pycache__/watcher.cpython-39.pyc
a

	�	i��@s*dgZddlmZmZGdd�de�ZdS)�Watcher�)�Gio�GLibc@sdeZdZdd�Zdd�Zdd�Zdd�Zd	d
�Zdd�Zd
d�Z	dd�Z
dd�Zdd�Zdd�Z
dS)rcCs"||_||_i|_i|_g|_dS�N)�	_callback�_timeout�	_monitors�	_timeouts�_blocked)�self�callback�timeout�r�9/usr/lib/python3.9/site-packages/firewall/core/watcher.py�__init__s
zWatcher.__init__cCs:tj�|�}|�tjjd�|j|<|j|�d|j�dS�NZchanged)	r�File�new_for_pathZmonitor_directory�FileMonitorFlags�NONEr�connect�_file_changed_cb)rZ	directory�gfilerrr�
add_watch_dir"s
�
zWatcher.add_watch_dircCs:tj�|�}|�tjjd�|j|<|j|�d|j�dSr)	rrrZmonitor_filerrrrr)r�filenamerrrr�add_watch_file(s
�
zWatcher.add_watch_filecCs
|j��Sr)r�keys)rrrr�get_watches.szWatcher.get_watchescCs
||jvSr�r�rrrrr�	has_watch1szWatcher.has_watchcCs|j|=dSrrrrrr�remove_watch4szWatcher.remove_watchcCs||jvr|j�|�dSr)r
�appendrrrr�block_source7s
zWatcher.block_sourcecCs||jvr|j�|�dSr)r
�removerrrr�unblock_source;s
zWatcher.unblock_sourcecCs0t|j���D]}t�|j|�|j|=qdSr)�listr	rr�
source_removerrrr�clear_timeouts?szWatcher.clear_timeoutscCs ||jvr|�|�|j|=dSr)r
rr	rrrr�_call_callbackDs

zWatcher._call_callbackcCs�|��}||jvr8||jvr4t�|j|�|j|=dS|tjjksh|tjjksh|tjj	ksh|tjj
kr�||jvr�t�|j|�|j|=t�|j|j
|�|j|<dSr)Zget_parse_namer
r	rr'rZFileMonitorEventZCHANGEDZCREATEDZDELETEDZATTRIBUTE_CHANGEDZtimeout_add_secondsrr))rZmonitorZgio_fileZgio_other_fileZeventrrrrrIs&


�
�
�

�zWatcher._file_changed_cbN)�__name__�
__module__�__qualname__rrrrr r!r#r%r(r)rrrrrrsN)�__all__Z
gi.repositoryrr�objectrrrrr�<module>s