Файловый менеджер - Редактировать - /opt/imh-python/lib/python3.9/site-packages/twisted/internet/__pycache__/inotify.cpython-39.pyc
Ðазад
a k�h<8 � @ s| d Z ddlZddlZddlmZ ddlmZ ddlmZm Z dZ dZdZd Z d ZdZdZd ZdZdZdZdZdZdZdZdZdZdZdZdZe eB ZeeB ZeeB Z eeB eB eB eB eB eB eB eB Z!e dfedfedfe dfedfedfed fed!fed"fed#fed$fed%fed&fed'fed(fed)fed*fed+fed,fed-fgZ"d.d/� Z#G d0d1� d1�Z$G d2d3� d3e�Z%ej&Z&g d4�Z'dS )5a This module provides support for Twisted to linux inotify API. In order to use this support, simply do the following (and start a reactor at some point):: from twisted.internet import inotify from twisted.python import filepath def notify(ignored, filepath, mask): """ For historical reasons, an opaque handle is passed as first parameter. This object should never be used. @param filepath: FilePath on which the event happened. @param mask: inotify event as hexadecimal masks """ print("event %s on %s" % ( ', '.join(inotify.humanReadableMask(mask)), filepath)) notifier = inotify.INotify() notifier.startReading() notifier.watch(filepath.FilePath("/some/directory"), callbacks=[notify]) notifier.watch(filepath.FilePath(b"/some/directory2"), callbacks=[notify]) Note that in the above example, a L{FilePath} which is a L{bytes} path name or L{str} path name may be used. However, no matter what type of L{FilePath} is passed to this module, internally the L{FilePath} is converted to L{bytes} according to L{sys.getfilesystemencoding}. For any L{FilePath} returned by this module, the caller is responsible for converting from a L{bytes} path name to a L{str} path name. @since: 10.1 � N)�fdesc)�FileDescriptor)�_inotify�log� � � � � � �@ � � i i i i i @ i � i i i i @l �access�modify�attribZclose_writeZ close_nowrite�openZ moved_fromZmoved_to�create�deleteZdelete_selfZ move_selfZunmountZqueue_overflowZignoredZonly_dirZdont_followZmask_add�is_dirZone_shotc C s( g }t D ]\}}|| @ r|�|� q|S )zh Auxiliary function that converts a hexadecimal mask into a series of human readable flags. )�_FLAG_TO_HUMAN�append)�mask�s�k�v� r ��/root/rpmbuild/BUILDROOT/imh-python39-modules-3.9.7-92.el8.x86_64/opt/imh-python/lib/python3.9/site-packages/twisted/internet/inotify.py�humanReadableMaskq s r c @ s( e Zd ZdZeddfdd�Zdd� ZdS )�_Watcha� Watch object that represents a Watch point in the filesystem. The user should let INotify to create these objects @ivar path: The path over which this watch point is monitoring @ivar mask: The events monitored by this watchpoint @ivar autoAdd: Flag that determines whether this watch point should automatically add created subdirectories @ivar callbacks: L{list} of callback functions that will be called when an event occurs on this watch. FNc C s, |� � | _|| _|| _|d u r"g }|| _d S )N)�asBytesMode�pathr �autoAdd� callbacks)�selfr! r r"