Files
intellecton/venv/lib/python3.12/site-packages/watchdog/__pycache__/events.cpython-312.pyc
T

229 lines
22 KiB
Plaintext
Raw Normal View History

Ë
JÀjÃ?ãó&—dZddlmZddlZddlZddlZddlmZm Z ddl
m Z ddl m
Z
e rddlmZdZd Zd
Zd Zd Zd
ZdZed¬«Gd„d««ZGd„de«ZGd„de«ZGd„de«ZGd„de«ZGd„de«ZGd„de«ZGd„d e«ZGd!„d"e«ZGd#„d$e«Z Gd%„d&e«Z!Gd'„d(e«Z"Gd)„d*e«Z#Gd+„d,«Z$Gd-„d.e$«Z%Gd/„d0e$«Z&Gd1„d2e$«Z' d5d3„Z(d6d4„Z)y)7u·:module: watchdog.events
:synopsis: File system events and event handlers.
:author: yesudeep@google.com (Yesudeep Mangalapilly)
:author: contact@tiger-222.fr (Mickaël Schoentgen)
Event Classes
-------------
.. autoclass:: FileSystemEvent
:members:
:show-inheritance:
:inherited-members:
.. autoclass:: FileSystemMovedEvent
:members:
:show-inheritance:
.. autoclass:: FileMovedEvent
:members:
:show-inheritance:
.. autoclass:: DirMovedEvent
:members:
:show-inheritance:
.. autoclass:: FileModifiedEvent
:members:
:show-inheritance:
.. autoclass:: DirModifiedEvent
:members:
:show-inheritance:
.. autoclass:: FileCreatedEvent
:members:
:show-inheritance:
.. autoclass:: FileClosedEvent
:members:
:show-inheritance:
.. autoclass:: FileClosedNoWriteEvent
:members:
:show-inheritance:
.. autoclass:: FileOpenedEvent
:members:
:show-inheritance:
.. autoclass:: DirCreatedEvent
:members:
:show-inheritance:
.. autoclass:: FileDeletedEvent
:members:
:show-inheritance:
.. autoclass:: DirDeletedEvent
:members:
:show-inheritance:
Event Handler Classes
---------------------
.. autoclass:: FileSystemEventHandler
:members:
:show-inheritance:
.. autoclass:: PatternMatchingEventHandler
:members:
:show-inheritance:
.. autoclass:: RegexMatchingEventHandler
:members:
:show-inheritance:
.. autoclass:: LoggingEventHandler
:members:
:show-inheritance:
é)Ú annotationsN)Ú dataclassÚfield)Ú
TYPE_CHECKING)Úmatch_any_paths)Ú GeneratorÚmovedÚdeletedÚcreatedÚmodifiedÚclosedÚclosed_no_writeÚopenedT)Ú unsafe_hashcó„—eZdZUdZded<dZded<edd¬«Zded <edd¬«Zd
ed < ed¬ «Z d
ed
<y)ÚFileSystemEventaImmutable type that represents a file system event that is triggered
when a change occurs on the monitored file system.
All FileSystemEvent objects are required to be immutable and hence
can be used as keys in dictionaries or be added to sets.
ú bytes | strÚsrc_pathÚÚ dest_pathF)ÚdefaultÚinitÚstrÚ
event_typeÚboolÚ is_directory)rÚ is_syntheticN)
Ú__name__Ú
__module__Ú __qualname__Ú__doc__Ú__annotations__rrrrr©óúR/home/antigravity/intellecton/venv/lib/python3.12/site-packages/watchdog/events.pyrrhsQ…ñðÓØ€Iˆ{ÓÙ B¨UÔ3€J�Ó3Ù u°5Ô9€L�$Ó9ðñ
 uÔ-€L�$Ô-r$rcó—eZdZdZeZy)ÚFileSystemMovedEventz@File system event representing any kind of file system movement.N)rrr r!ÚEVENT_TYPE_MOVEDrr#r$r%r'r'~s
„ÙJà!�Jr$r'có—eZdZdZeZy)ÚFileDeletedEventz@File system event representing file deletion on the file system.N)rrr r!ÚEVENT_TYPE_DELETEDrr#r$r%r*r*‡ó
„ÙJà#�Jr$r*có—eZdZdZeZy)ÚFileModifiedEventzDFile system event representing file modification on the file system.N)rrr r!ÚEVENT_TYPE_MODIFIEDrr#r$r%r.r.�s
„ÙNà$�Jr$r.có—eZdZdZeZy)ÚFileCreatedEventz@File system event representing file creation on the file system.N)rrr r!ÚEVENT_TYPE_CREATEDrr#r$r%r1r1“r,r$r1có—eZdZdZy)ÚFileMovedEventz@File system event representing file movement on the file system.N)rrr r!r#r$r%r4r4™s„ÚJr$r4có—eZdZdZeZy)ÚFileClosedEventú=File system event representing file close on the file system.N)rrr r!ÚEVENT_TYPE_CLOSEDrr#r$r%r6r6�ó
„ÙGà"�Jr$r6có—eZdZdZeZy)ÚFileClosedNoWriteEventzKFile system event representing an unmodified file close on the file system.N)rrr r!ÚEVENT_TYPE_CLOSED_NO_WRITErr#r$r%r;r;£s
„ÙUà+�Jr$r;có—eZdZdZeZy)ÚFileOpenedEventr7N)rrr r!ÚEVENT_TYPE_OPENEDrr#r$r%r>r>©r9r$r>có—eZdZdZeZdZy)ÚDirDeletedEventzEFile system event representing directory deletion on the file system.TN)rrr r!r+rrr#r$r%rArA²ó„ÙOà#€JØ�Lr$rAcó—eZdZdZeZdZy)ÚDirModifiedEventzIFile system event representing directory modification on the file system.TN)rrr r!r/rrr#r$r%rDrD¹s„ÙSà$€JØ�Lr$rDcó—eZdZdZeZdZy)ÚDirCreatedEventzEFile system event representing directory creation on the file system.TN)rrr r!r2rrr#r$r%rFrFÀrBr$rFcó—eZdZdZdZy)Ú
DirMovedEventzEFile system event representing directory movement on the file system.TN)rrr r!rr#r$r%rHrHÇs
„ÙOà�Lr$rHcóX—eZdZdZd d„Zd d„Zd
d„Zdd„Zdd„Zdd„Z dd„Z
dd „Z dd
„Z y )ÚFileSystemEventHandlerzBBase file system event handler that you can override methods from.cód—|j|«t|d|j›�«|«y)úÈDispatches events to the appropriate methods.
:param event:
The event object representing the file system event.
:type event:
:class:`FileSystemEvent`
Úon_N)Ú on_any_eventÚgetattrr©ÚselfÚevents r%ÚdispatchzFileSystemEventHandler.dispatchÐs1€ð
×ј%Ô Ø/Œ�˜˜E×,Ñ,Ð-Ð.Ó/°Õ6r$có—y)z³Catch-all event handler.
:param event:
The event object representing the file system event.
:type event:
:class:`FileSystemEvent`
Nr#rPs r%rNz#FileSystemEventHandler.on_any_eventÛó�r$có—y)záCalled when a file or a directory is moved or renamed.
:param event:
Event representing file/directory movement.
:type event:
:class:`DirMovedEvent` or :class:`FileMovedEvent`
Nr#rPs r%Úon_movedzFileSystemEventHandler.on_movedärUr$có—y)zÚCalled when a file or directory is created.
:param event:
Event representing file/directory creation.
:type event:
:class:`DirCreatedEvent` or :class:`FileCreatedEvent`
Nr#rPs r%Ú
on_createdz!FileSystemEventHandler.on_createdírUr$có—y)zÚCalled when a file or directory is deleted.
:param event:
Event representing file/directory deletion.
:type event:
:class:`DirDeletedEvent` or :class:`FileDeletedEvent`
Nr#rPs r%Ú
on_deletedz!FileSystemEventHandler.on_deletedörUr$có—y)záCalled when a file or directory is modified.
:param event:
Event representing file/directory modification.
:type event:
:class:`DirModifiedEvent` or :class:`FileModifiedEvent`
Nr#rPs r%Ú on_modifiedz"FileSystemEventHandler.on_modifiedÿrUr$có—y)z·Called when a file opened for writing is closed.
:param event:
Event representing file closing.
:type event:
:class:`FileClosedEvent`
Nr#rPs r%Ú on_closedz FileSystemEventHandler.on_closedrUr$có—y)z¾Called when a file opened for reading is closed.
:param event:
Event representing file closing.
:type event:
:class:`FileClosedNoWriteEvent`
Nr#rPs r%Úon_closed_no_writez)FileSystemEventHandler.on_closed_no_writerUr$có—y)z¤Called when a file is opened.
:param event:
Event representing file opening.
:type event:
:class:`FileOpenedEvent`
Nr#rPs r%Ú on_openedz FileSystemEventHandler.on_openedrUr$N©rRrÚreturnÚNone©rRzDirMovedEvent | FileMovedEventrerf©rRz"DirCreatedEvent | FileCreatedEventrerf©rRz"DirDeletedEvent | FileDeletedEventrerf©rRz$DirModifiedEvent | FileModifiedEventrerf©rRr6rerf©rRr;rerf©rRr>rerf)
rrr r!rSrNrWrYr[r]r_rarcr#r$r%rJrJÍs2„ÙLó 7ó ó ó ó ó ó ó ô r$rJcó’‡—eZdZdZdddddœ d ˆfd„Zed d„«Zed d„«Zed
d„«Zed
d „«Z dˆfd
„ Z
ˆxZ S)ÚPatternMatchingEventHandlerzÆMatches given patterns with file paths associated with occurring events.
Uses pathlib's `PurePath.match()` method. `patterns` and `ignore_patterns`
are expected to be a list of strings.
NF)ÚpatternsÚignore_patternsÚignore_directoriesÚcase_sensitivecóZ•—t‰|�«||_||_||_||_y©N)ÚsuperÚ__init__Ú _patternsÚ_ignore_patternsÚ_ignore_directoriesÚ_case_sensitive)rQrprqrrrsÚ __class__s €r%rwz$PatternMatchingEventHandler.__init__*s/ø€ô ‰ÑÔà!ˆŒØ /ˆÔØ#5ˆÔ Ø-ˆÕr$có—|jS)zD(Read-only)
Patterns to allow matching event paths.
)rx©rQs r%rpz$PatternMatchingEventHandler.patterns9s€ð
�~‰~Ðr$có—|jS)zE(Read-only)
Patterns to ignore matching event paths.
)ryr~s r%rqz+PatternMatchingEventHandler.ignore_patterns@s€ð
×$Ñ$Ð$r$có—|jS©z\(Read-only)
``True`` if directories should be ignored; ``False`` otherwise.
©rzr~s r%rrz.PatternMatchingEventHandler.ignore_directoriesGó€ð
×'Ñ'Ð'r$có—|jS©zu(Read-only)
``True`` if path names should be matched sensitive to case; ``False``
otherwise.
©r{r~s r%rsz*PatternMatchingEventHandler.case_sensitiveNó€ð ×#Ñ#Ð#r$cóž•—|jr
|jryg}t|d«r.|jt j
|j ««|jr.|jt j
|j««t||j|j|j¬«rt‰|�5|«yy)rLNr)Úincluded_patternsÚexcluded_patternsrs)rrrÚhasattrÚappendÚosÚfsdecoderrrrprqrsrvrS©rQrRÚpathsr|s €r%rSz$PatternMatchingEventHandler.dispatchVs™ø€ð × "Ò " u×'9Ò'9Ø àˆÜ �5˜+Ô &Ø �L‰LœŸ™ U§_¡_Ó5Ô 6Ø �>Š>Ø �L‰LœŸ™ U§^¡^Ó4Ô 5ä Ø Ø"Ÿm™mØ"×2Ñ2Ø×.Ñ.õ 
ô
‰GÑ ˜UÕ #ð

r$)rpúlist[str] | Nonerqr‘rrrrsr)rer‘©rerrd) rrr r!rwÚpropertyrprqrrrsrSÚ
__classcell__©r|s@r%roro$s�ø„ñð&*Ø,0Ø#(Ø$ñ
.ð#ð
.ð*ð
.ð
!ð
.ð õ
.ðòóðð ò%óð%ð ò(óð(ð ò$óð$÷$ñ$r$rocó’‡—eZdZdZdddddœ d ˆfd„Zed d„«Zed d„«Zed
d„«Zed
d „«Z dˆfd
„ Z
ˆxZ S)ÚRegexMatchingEventHandlerzfMatches given regexes with file paths associated with occurring events.
Uses the `re` module.
NF)ÚregexesÚignore_regexesrrrscó"•—t‰|�«|€dg}nt|t«r|g}|€g}|rQ|D�cgc]}t j
|«‘Œc}|_|D�cgc]}t j
|«‘Œc}|_nn|D�cgc]&}t j
|tj«‘Œ(c}|_|D�cgc]&}t j
|tj«‘Œ(c}|_||_ ||_
ycc}wcc}wcc}wcc}w)Nz.*) rvrwÚ
isinstancerÚreÚcompileÚ_regexesÚ_ignore_regexesÚ
IGNORECASErzr{)rQr˜r™rrrsÚrr|s €r%rwz"RegexMatchingEventHandler.__init__usÑø€ô ‰ÑÔà ˆ?Ø�g‰GÜ
˜¤Ô
%Ø�iˆGØ Ð !؈NÙ Ø4;Ö<¨qœRŸZ™Z¨�]Ò<ˆDŒMØ;IÖ#J°a¤B§J¡J¨q¥MÒ#JˆDÕ àCJÖK¸aœRŸZ™Z¨¬2¯=©=Õ9ÒKˆDŒMØJXÖ#YÀQ¤B§J¡J¨q´"·-±-Õ$@Ò#YˆDÔ Ø#5ˆÔ Ø-ˆÕùò
=ùÚ#JùâKùÚ#Ys³C=ÁDÂ+DÂ;+D có—|jS)zC(Read-only)
Regexes to allow matching event paths.
)ržr~s r%r˜z!RegexMatchingEventHandler.regexesŽs€ð
�}‰}Ðr$có—|jS)zD(Read-only)
Regexes to ignore matching event paths.
)rŸr~s r%r™z(RegexMatchingEventHandler.ignore_regexes•s€ð
×#Ñ#Ð#r$có—|jSr�r‚r~s r%rrz,RegexMatchingEventHandler.ignore_directoriesœrƒr$có—|jSr…r†r~s r%rsz(RegexMatchingEventHandler.case_sensitive£r‡r$cóÀ•‡—|jr
|jrygŠt|d«r.‰jt j
|j ««|jr.‰jt j
|j««tˆfd„|jD««rytˆfd„|jD««rt‰|�1|«yy)rLNrc3óN•K—|]}‰D]}|j|«–—ŒŒy­wru©Úmatch©Ú.0r¡Úpr�s €r%ú <genexpr>z5RegexMatchingEventHandler.dispatch.<locals>.<genexpr>¼s%øèø€ÒF˜aÀÒF¸1ˆq�w‰w�q�zÐFˆzÑFùóƒ"%c3óN•K—|]}‰D]}|j|«–—ŒŒy­wrur¨rªs €r%r­z5RegexMatchingEventHandler.dispatch.<locals>.<genexpr>¿s%øèø€Ò?˜a¸Ò?°Aˆq�w‰w�q�zÐ?ˆzÑ?ùr®)
rrrr‹rŒr�rŽrrÚanyr™r˜rvrSr�s @€r%rSz"RegexMatchingEventHandler.dispatch«s�ù€ð × "Ò " u×'9Ò'9Ø àˆÜ �5˜+Ô &Ø �L‰LœŸ™ U§_¡_Ó5Ô 6Ø �>Š>Ø �L‰LœŸ™ U§^¡^Ó4Ô 5ä ÓF 4×#6Ñ#6ÔFÔ FØ ä Ó? 4§<¡<Ô?Ô ?Ü ‰GÑ ˜UÕ #ð @r$)r˜r‘r™r‘rrrrsr)rezlist[re.Pattern[str]]r’rd) rrr r!rwr“r˜r™rrrsrSr”r•s@r%r—r—ps�ø„ñð%)Ø+/Ø#(Ø$ñ
.ð"ð.ð)ð .ð