| 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/watchdog/utils/__pycache__/ |
Upload File : |
�
:��c�- � �t � d Z ddlZddlZddlmZ G d� d� � Z G d� d� � Z G d� d � � ZdS )
u�
:module: watchdog.utils.dirsnapshot
:synopsis: Directory snapshots and comparison.
:author: yesudeep@google.com (Yesudeep Mangalapilly)
:author: contact@tiger-222.fr (Mickaël Schoentgen)
.. ADMONITION:: Where are the moved events? They 'disappeared'
This implementation does not take partition boundaries
into consideration. It will only work when the directory
tree is entirely on the same file system. More specifically,
any part of the code that depends on inode numbers can
break if partition boundaries are crossed. In these cases,
the snapshot diff will represent file/directory movement as
created and deleted events.
Classes
-------
.. autoclass:: DirectorySnapshot
:members:
:show-inheritance:
.. autoclass:: DirectorySnapshotDiff
:members:
:show-inheritance:
.. autoclass:: EmptyDirectorySnapshot
:members:
:show-inheritance:
� N)�S_ISDIRc �� � e Zd ZdZdd�Zd� Zd� Zed� � � Zed� � � Z ed� � � Z
ed � � � Zed
� � � Zed� � � Z
ed� � � Zed
� � � ZdS )�DirectorySnapshotDiffa�
Compares two directory snapshots and creates an object that represents
the difference between the two snapshots.
:param ref:
The reference directory snapshot.
:type ref:
:class:`DirectorySnapshot`
:param snapshot:
The directory snapshot which will be compared
with the reference snapshot.
:type snapshot:
:class:`DirectorySnapshot`
:param ignore_device:
A boolean indicating whether to ignore the device id or not.
By default, a file may be uniquely identified by a combination of its first
inode and its device id. The problem is that the device id may (or may not)
change between system boots. This problem would cause the DirectorySnapshotDiff
to think a file has been deleted and created again but it would be the
exact same file.
Set to True only if you are sure you will always use the same device.
:type ignore_device:
:class:`bool`
Fc �� ��� �j �j z
}�j �j z
}|rd� }nd� }�j �j z D ]F} |�|� � |�|� � k r*|� |� � |� |� � �Gt � � }t |� � D ]Z}�� |� � } �� | � � }
|
r,|� |� � |� ||
f� � �[t |� � D ]Z}�� |� � } �� | � � }|r,|� |� � |� ||f� � �[t � � }�j �j z D ]�} |�|� � |�|� � k rm�� |� � �� |� � k s,�� |� � �� |� � k r|� |� � ��|D ]r\ }}
�� |� � �� |
� � k s,�� |� � �� |
� � k r|� |� � �s�fd�|D � � | _ �fd�|D � � | _ �fd�|D � � | _
�fd�|D � � | _ t |t | j � � z
� � | _
t |t | j � � z
� � | _ t |t | j
� � z
� � | _ t |t | j � � z
� � | _ d S )Nc �8 � | � |� � d S )Nr ��inode�� directory� full_paths �</usr/lib/python3/dist-packages/watchdog/utils/dirsnapshot.py� get_inodez1DirectorySnapshotDiff.__init__.<locals>.get_inodeW s � � ���y�1�1�!�4�4� c �, � | � |� � S �Nr r
s r
r z1DirectorySnapshotDiff.__init__.<locals>.get_inodeZ s � � ���y�1�1�1r c �>