Файловый менеджер - Редактировать - /home/digitalm/venv/lib/python3.7/site-packages/watchdog/observers/__pycache__/inotify.cpython-37.pyc
Назад
B �P�gG% � @ s� d Z ddlmZ ddlZddlZddlZddlmZ ddlm Z m Z mZmZm Z mZmZmZmZmZmZmZmZ ddlmZmZmZmZ ddlmZ e�e�ZG d d � d e�Z G dd� de �Z!G d d� de�Z"dS )a~ :module: watchdog.observers.inotify :synopsis: ``inotify(7)`` based emitter implementation. :author: Sebastien Martini <seb@dbzteam.org> :author: Luke McCarthy <luke@iogopro.co.uk> :author: yesudeep@google.com (Yesudeep Mangalapilly) :author: Tim Cuthbertson <tim+github@gfxmonk.net> :platforms: Linux 2.6.13+. .. ADMONITION:: About system requirements Recommended minimum kernel version: 2.6.25. Quote from the inotify(7) man page: "Inotify was merged into the 2.6.13 Linux kernel. The required library interfaces were added to glibc in version 2.4. (IN_DONT_FOLLOW, IN_MASK_ADD, and IN_ONLYDIR were only added in version 2.5.)" Therefore, you must ensure the system is running at least these versions appropriate libraries and the kernel. .. ADMONITION:: About recursiveness, event order, and event coalescing Quote from the inotify(7) man page: If successive output inotify events produced on the inotify file descriptor are identical (same wd, mask, cookie, and name) then they are coalesced into a single event if the older event has not yet been read (but see BUGS). The events returned by reading from an inotify file descriptor form an ordered queue. Thus, for example, it is guaranteed that when renaming from one directory to another, events will be produced in the correct order on the inotify file descriptor. ... Inotify monitoring of directories is not recursive: to monitor subdirectories under a directory, additional watches must be created. This emitter implementation therefore automatically adds watches for sub-directories if running in recursive mode. Some extremely useful articles and documentation: .. _inotify FAQ: http://inotify.aiken.cz/?section=inotify&page=faq&lang=en .. _intro to inotify: http://www.linuxjournal.com/article/8478 � )�annotationsN)�Type) �DirCreatedEvent�DirDeletedEvent�DirModifiedEvent� DirMovedEvent�FileClosedEvent�FileCreatedEvent�FileDeletedEvent�FileModifiedEvent�FileMovedEvent�FileOpenedEvent�FileSystemEvent�generate_sub_created_events�generate_sub_moved_events)�DEFAULT_EMITTER_TIMEOUT�DEFAULT_OBSERVER_TIMEOUT�BaseObserver�EventEmitter� )� InotifyBufferc sF e Zd ZdZef� fdd� Zdd� Zdd� Zd d d �Zdd� Z � Z S )�InotifyEmitterar inotify(7)-based event emitter. :param event_queue: The event queue to fill with events. :param watch: A watch object representing the directory to monitor. :type watch: :class:`watchdog.observers.api.ObservedWatch` :param timeout: Read events blocking timeout (in seconds). :type timeout: ``float`` c s$ t � �|||� t�� | _d | _d S )N)�super�__init__� threading�Lock�_lock�_inotify)�self�event_queue�watch�timeout)� __class__� �P/home/digitalm-up/venv/lib/python3.7/site-packages/watchdog/observers/inotify.pyr p s zInotifyEmitter.__init__c C s"