403Webshell
Server IP : 54.37.205.81  /  Your IP : 216.73.216.76
Web Server : nginx/1.22.1
System : Linux vps-249481fa 6.1.0-50-cloud-amd64 #1 SMP PREEMPT_DYNAMIC Debian 6.1.176-1 (2026-07-02) x86_64
User : debian ( 1000)
PHP Version : 8.2.32
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : OFF  |  Sudo : ON  |  Pkexec : OFF
Directory :  /usr/lib/python3/dist-packages/livereload/__pycache__/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /usr/lib/python3/dist-packages/livereload/__pycache__/watcher.cpython-311.pyc
�

9A_.����dZddlZddlZddlZddlZddlZejjdkrddlZnddlm	Z		ddl
Z
n
#e$rdZ
YnwxYwejd��Z
Gd�de��ZGd�d	e��Zd
�ZdS)z�
    livereload.watcher
    ~~~~~~~~~~~~~~~~~~

    A file watch management for LiveReload Server.

    :copyright: (c) 2013 - 2015 by Hsiaoming Yang
    :license: BSD, see LICENSE for more details.
�N�)�	signature�
livereloadc�d�eZdZdZd�Zd�Zd�Zd�Zdd�Zd	�Z	d
�Z
dd�Zd�Zdd
�Z
dd�Zdd�ZdS)�WatcherzA file watcher registry.c��i|_i|_i|_g|_d|_tj��|_gd�|_dS)N)z.gitz.hgz.svnz.cvs)�_tasks�_task_mtimes�_new_mtimes�_changes�filepath�time�_start�ignored_dirs��selfs �4/usr/lib/python3/dist-packages/livereload/watcher.py�__init__zWatcher.__init__!sP�������������
���
��i�k�k���<�;�;�����c�:�|j�|��dS�N)r�extend)r�argss  r�ignore_dirszWatcher.ignore_dirs3s���� � ��&�&�&�&�&rc�D�|D]}|j�|���dSr)r�remove)rr�as   r�remove_dirs_from_ignorezWatcher.remove_dirs_from_ignore6s5���	(�	(�A���$�$�Q�'�'�'�'�	(�	(rc�N�tj�|��\}}|dvS)zIgnore a given filename or not.)z.pycz.pyoz.oz.swp)�os�path�splitext)r�filename�_�exts    r�ignorezWatcher.ignore:s'����!�!�(�+�+���3��4�4�4rNrc�$�|||id�|j|<dS)a�Add a task to watcher.

        :param path: a filepath or directory path or glob pattern
        :param func: the function to be executed when file changed
        :param delay: Delay sending the reload message. Use 'forever' to
                      not send it. This is useful to compile sass files to
                      css, but reload on changed css files then only.
        :param ignore: A function return True to ignore a certain pattern of
                       filepath.
        )�func�delayr&�mtimesN)r	)rr!r(r)r&s     r�watchz
Watcher.watch?s)������	
�
���D���rc��dS)z�Start the watcher running, calling callback when changes are
        observed. If this returns False, regular polling will be used.F�)r�callbacks  r�startz
Watcher.startQs	���urc�p�|jr|j���Sd|_t��}|jD�]\}|j|}|d|_|�||d��}|�r |d}|d}|r*t|t��r|�	|��|r�t|dd��}|st|dd��}t�d	�
||����tjjd
kr(t#t%j|��d��}n!t#t)|��j��}|dkr"t|t,��r
||����R|����^|rt/|��}nd}|j|fS)zCheck if there are changes. If so, run the given task.

        Returns a tuple of modified filepath and reload delay.
        Nr*r&r(r)�name�__name__�	anonymouszRunning task: {} (delay: {})rr)r�popr
�setr	r
�
is_changed�
isinstance�float�add�getattr�logger�info�format�sys�version_info�major�len�inspect�
getargspecr�
parameters�list�max)	r�delaysr!�item�changedr(r)r1�sig_lens	         r�examinezWatcher.examineVs���
�=�	'��=�$�$�&�&�&���
������K�	�	�D��;�t�$�D� $�X��D���o�o�d�D��N�;�;�G��
��F�|���W�
���&�Z��u�5�5�&��J�J�u�%�%�%��
�"�4���6�6�D��F�&�t�Z��E�E���K�K�6�=�=�d�E�J�J�L�L�L��'�-��1�1�"%�g�&8��&>�&>�q�&A�"B�"B���"%�i��o�o�&@�"A�"A����{�{�z�'�4�'@�'@�{���W�
�
�
�
��������	���K�K�E�E��E��}�e�#�#rc��i|_d}tj�|��r|�||��}nLtj�|��r|�||��}n|�||��}|s|���}|j	�
|j��|S)z�Check if any filepaths have been added, modified, or removed.

        Updates filepath modification times in self._task_mtimes.
        F)rr r!�isfile�is_file_changed�isdir�is_folder_changed�get_changed_glob_files�is_file_removedr
�update)rr!r&rIs    rr6zWatcher.is_changeds���
�����
�7�>�>�$���	@��*�*�4��8�8�G�G�
�W�]�]�4�
 �
 �	@��,�,�T�6�:�:�G�G��1�1�$��?�?�G��	-��*�*�,�,�G��� � ��!1�2�2�2��rc��t|j��t|j��z
}|sdS|D]#}|j�|��||_�$dS)z�Check if any filepaths have been removed since last check.

        Deletes removed paths from self._task_mtimes.
        Sets self.filepath to one of the removed paths.
        FT)r5r
rr4r
)r�
removed_pathsr!s   rrRzWatcher.is_file_removed�sg���D�-�.�.��T�5E�1F�1F�F�
��	��5�!�	!�	!�D���!�!�$�'�'�'�!�D�M�M��trc�x�tj�|��sdS|�|��rdS|r
||��rdStj�|��}||jvr||j|<||_||jkS|j||kr||j|<||_dS||j|<dS)z�Check if filepath has been added or modified since last check.

        Updates filepath modification times in self._new_mtimes.
        Sets self.filepath to changed path.
        FT)	r r!rMr&�getmtimer
rr
r)rr!r&�mtimes    rrNzWatcher.is_file_changed�s����w�~�~�d�#�#�	��5��;�;�t���	��5��	�f�f�T�l�l�	��5��� � ��&�&���t�(�(�(�%*�D��T�"� �D�M��4�;�&�&���T�"�e�+�+�%*�D��T�"� �D�M��4�!&������urc��tj|d���D]f\}}}|jD]}||vr|�|���|D]:}|�tj�||��|��rdS�;�gdS)z2Check if directory path has any changed filepaths.T)�followlinksF)r �walkrrrNr!�join)rr!r&�root�dirs�files�d�fs        rrPzWatcher.is_folder_changed�s���!#���4�!@�!@�!@�	 �	 ��D�$���&�
#�
#����9�9��K�K��N�N�N���
 �
 ���'�'�����T�1�(=�(=�v�F�F� ��4�4�4� �
 ��urc�����tjddkr-tjddkrtj|d���}ntj|��}��fd�|D��}|S)z-Check if glob path has any changed filepaths.rr��T)�	recursivec�@��g|]}��|����|��Sr-)rN)�.0rar&rs  ��r�
<listcomp>z2Watcher.get_changed_glob_files.<locals>.<listcomp>�s.���M�M�M�q�T�-A�-A�!�V�-L�-L�M��M�M�Mr)r>r?�glob)rr!r&r_�
changed_filess` `  rrQzWatcher.get_changed_glob_files�sn������A���"�"�s�'7��':�Q�'>�'>��I�d�d�3�3�3�E�E��I�d�O�O�E�M�M�M�M�M�E�M�M�M�
��r)NrNr)r2�
__module__�__qualname__�__doc__rrrr&r+r/rKr6rRrNrPrQr-rrrrs�������"�"�<�<�<�$'�'�'�(�(�(�5�5�5�

�
�
�
�$���
'$�'$�'$�R����*���"����<
�
�
�
������rrc�(�eZdZd�Zdd�Zd�Zd�ZdS)�INotifyWatcherc��t�|��tj��|_d|_d|_dSr)rr�	pyinotify�WatchManager�wm�notifierr.rs rrzINotifyWatcher.__init__�s8����������(�*�*�����
���
�
�
rNc���tjtjztjz}|j�||ddd���t�|||||��dS)NT)�rec�do_glob�auto_add)rq�	IN_CREATE�	IN_DELETE�	IN_MODIFYrs�	add_watchrr+)rr!r(r)r&�flags      rr+zINotifyWatcher.watch�s[���"�Y�%8�8�9�;N�N������$��$��t��L�L�L��
�
�d�D�$��v�6�6�6�6�6rc�.�|���dSr)r.)r�events  r�
inotify_eventzINotifyWatcher.inotify_event�s���
�
�����rc��|jsT||_ddlm}t	j|j|j���|j	���|_|��dS)Nr)�ioloop)�default_proc_funT)
rtr.�tornador�rq�TornadoAsyncNotifierrs�IOLoop�instancer�)rr.r�s   rr/zINotifyWatcher.start�sk���}�	�$�D�M�&�&�&�&�&�&�%�:�����/�/�1�1�!%�!3����D�M�
�H�J�J�J��tr)NNN)r2rkrlrr+r�r/r-rrroro�sU���������7�7�7�7�
���
�
�
�
�
rroc�V�t�ttd��stStS)Nr�)rq�hasattrrror-rr�get_watcher_classr��s#�����	�3I� J� J�����r)rmri�loggingr rr>r?r@rBrrq�ImportError�	getLoggerr;�objectrror�r-rr�<module>r�s.������������	�	�	�	�����
�
�
�
����A����N�N�N�N�!�!�!�!�!�!�������������I�I�I�����
��	�<�	(�	(��w�w�w�w�w�f�w�w�w�t�����W����:����s�8�A�A

Youez - 2016 - github.com/yon3zu
LinuXploit