Ë
    êmxilc  ã                  óº  — d Z ddlmZ ddlZddlZddlZddlZddlZddlZddl	m
Z
mZ ddlmZ ddlmZ ddlmZmZ ddlmZmZmZ dd	lmZ er dd
l	mZmZ ddlmZ ddlmZ ddlmZ ddl m!Z!  ejD                  ejF                  ¬«       dZ$dZ% G d„ de«      Z&dZ' e
e'e&¬«      Z(e(jS                  dde¬«       e(jU                  d¬«      Z+i Z,e-e.e/   ef   Z0d�d„Z1e+ddœ	 	 	 	 	 	 	 džd„Z2ejf                  dœdŸd„Z4dd œd d!„Z5d¡d"„Z6d#dœ	 	 	 	 	 	 	 d¢d$„Z7	 	 	 	 	 	 	 	 	 	 d£d&„Z8d¤d'„Z9 e2 e1d(d)d*¬+«       e1d,d-d.ejf                  ›d/�¬0«       e1d1d2d3d4e:d5¬6«       e1d7d8d9d:¬;«       e1d<d8d=¬>«       e1d?d8d@¬>«       e1dAd8dB¬>«       e1dCd8dD¬>«       e1dEd8dF¬>«      g	dg¬G«      d¥dH„«       Z; e2 e1dId)dJ¬+«       e1d,d-d.ejf                  ›d/�¬0«       e1dKddL¬0«       e1dMdNdOd8dP¬Q«      gdRg¬G«      d¥dS„«       Z< e2 e1dTd)d-dU¬V«       e1dWdXdYdZd)d[¬\«       e1d]d^d_d`dadb¬\«       e1dcddded8df¬Q«       e1dgd7d%d8dh¬Q«       e1d1d2d3d4e:di¬6«       e1d<d8d=¬>«       e1d?d8d@¬>«       e1dAd8dB¬>«       e1dCd8dD¬>«       e1dEd8dF¬>«      g«      d¥dj„«       Z= e2 e1dTd)d-dk¬V«       e1dldmdnddo¬\«       e1dWdXdYdZd)d[¬\«       e1d]d^d_d`dadb¬\«       e1dcdddedpd8df¬q«       e1dgd7d%d8dh¬Q«       e1d1d2d3d4e:di¬6«       e1drdsdtd8du¬Q«       e1dvdwdxd8dy¬Q«       e1d<d8d=¬>«      g
«      d¥dz„«       Z> e2 e1dnd{¬|«       e1d}d~d)d¬€«       e1d�d‚dTdƒd„d…¬†«       e1dWdXdYdZd)d[¬\«       e1d]d^d_d`dadb¬\«       e1dcdddedpd8df¬q«       e1dgd7d%d8dh¬Q«       e1d1d2d3d4e:di¬6«       e1d‡dˆd‰dŠ¬\«       e1d<d8d=¬>«       e1d‹dŒd�e:dŽ¬6«       e1d�d�d‘e:d’¬6«       e1d“d”d9d•d–¬q«      g«      d¥d—„«       Z? G d˜„ d™e@«      ZAd¦dš„ZBd§d›„ZCeDdœk(  r ejŠ                   eC«       «       yy)¨u´   :module: watchdog.watchmedo
:author: yesudeep@google.com (Yesudeep Mangalapilly)
:author: contact@tiger-222.fr (MickaÃ«l Schoentgen)
:synopsis: ``watchmedo`` shell script utility.
é    )ÚannotationsN)ÚArgumentParserÚRawDescriptionHelpFormatter)ÚStringIO)Údedent)ÚTYPE_CHECKINGÚAny)ÚWatchdogShutdownErrorÚ
load_classÚplatform)ÚVERSION_STRING)Ú	NamespaceÚ_SubParsersAction)ÚCallable)ÚFileSystemEventHandler)ÚObserverType)ÚBaseObserver)ÚlevelÚtrickszpython-pathc                  ó:   ‡ — e Zd ZdZddœdˆ fd„Zdd„Zd	d„Zˆ xZS )
ÚHelpFormattera#  A nicer help formatter.

    Help for arguments can be indented and contain new lines.
    It will be de-dented and arguments in the help
    will be separated by a blank line for better readability.

    Source: https://github.com/httpie/httpie/blob/2423f89/httpie/cli/argparser.py#L31
    é   )Úmax_help_positionc               ó.   •— ||d<   t        ‰| �  |i |¤Ž y )Nr   )ÚsuperÚ__init__)Úselfr   ÚargsÚkwargsÚ	__class__s       €úI/home/htdocs/ttos/venv/lib/python3.12/site-packages/watchdog/watchmedo.pyr   zHelpFormatter.__init__0   s    ø€ à&7ˆÐ"Ñ#Ü‰Ñ˜$Ð) &Ó)ó    c                ó4   — dt        | «      j                  › d�S )Nú<ú>)ÚtypeÚ__name__)r   s    r!   Ú__repr__zHelpFormatter.__repr__5   s   € Ø”4˜“:×&Ñ&Ð' qÐ)Ð)r"   c                óZ   — t        |«      j                  «       dz   }|j                  «       S )Nz

)r   ÚstripÚ
splitlines)r   ÚtextÚwidths      r!   Ú_split_lineszHelpFormatter._split_lines8   s&   € Ü�d‹|×!Ñ!Ó# fÑ,ˆØ�‰Ó Ð r"   )r   r	   r   Úintr   r	   ÚreturnÚNone)r0   Ústr)r,   r2   r-   r/   r0   ú	list[str])r'   Ú
__module__Ú__qualname__Ú__doc__r   r(   r.   Ú__classcell__)r    s   @r!   r   r   &   s   ø„ ñð =>÷ *ó
*÷!r"   r   u,  Copyright 2018-2024 MickaÃ«l Schoentgen & contributors
Copyright 2014-2018 Thomas Amland & contributors
Copyright 2012-2014 Google, Inc.
Copyright 2011-2012 Yesudeep Mangalapilly

Licensed under the terms of the Apache license, version 2.0. Please see
LICENSE in the source code for more information.)ÚepilogÚformatter_classz	--versionÚversion)Úactionr:   Útop_command)Údestc                 ó   — t        | «      |fS )z\Convenience function to properly format arguments to pass to the
    command decorator.
    )Úlist)Úname_or_flagsr   s     r!   ÚargumentrA   N   s   € ô �Ó Ð&Ð&r"   )ÚparentÚcmd_aliasesc               ó   ‡ ‡‡— dˆ ˆˆfd„}|S )a
  Decorator to define a new command in a sanity-preserving way.
    The function will be stored in the ``func`` variable when the parser
    parses arguments so that it can be called directly like so::

      >>> args = cli.parse_args()
      >>> args.func(args)

    c                ó’  •— | j                   j                  dd«      }t        | j                  xs d«      }‰	j	                  |‰xs g |t
        ¬«      }|t        |<   |j                  «       }|j                  ddddd	¬
«       |j                  ddddd¬
«       ‰D ])  \  }} |j                  |i |¤Ž |j                  | ¬«       Œ+ | S )NÚ_ú-Ú )ÚaliasesÚdescriptionr9   z-qz--quietÚ	verbosityÚappend_constéÿÿÿÿ)r=   r;   Úconstz-vz	--verboseé   )Úfunc)
r'   Úreplacer   r6   Ú
add_parserr   Úcommand_parsersÚadd_mutually_exclusive_groupÚadd_argumentÚset_defaults)
rP   ÚnameÚdescÚparserÚverbosity_groupr@   r   r   rC   rB   s
          €€€r!   Ú	decoratorzcommand.<locals>.decoratord   sÚ   ø€ Ø�}‰}×$Ñ$ S¨#Ó.ˆÜ�d—l‘lÒ( bÓ)ˆØ×"Ñ" 4°Ò1BÀÐPTÔfsÐ"ÓtˆØ &Œ˜ÑØ ×=Ñ=Ó?ˆØ×$Ñ$ T¨9¸;È~ÐegÐ$ÔhØ×$Ñ$ T¨;¸[ÐQ_ÐghÐ$ÔiØ%)ò 	+Ñ!ˆM˜6ØˆF×Ñ Ð9°&Ò9Ø×Ñ TÐÕ*ð	+ð ˆr"   )rP   r   r0   r   © )r   rB   rC   r[   s   ``` r!   Úcommandr]   U   s   ú€ ÷ð Ðr"   )Ú	separatorc               ó$   — | j                  |«      S )zêSplits a pathname specification separated by an OS-dependent separator.

    :param pathname_spec:
        The pathname specification.
    :param separator:
        (OS Dependent) `:` on Unix and `;` on Windows or user-specified.
    ©Úsplit)Úpathname_specr^   s     r!   Ú
path_splitrc   t   s   € ð ×Ñ˜yÓ)Ð)r"   )Úindexc               ó^   — | ddd…   D ]"  }t         j                  j                  ||«       Œ$ y)zòAdds specified paths at specified index into the sys.path list.

    :param paths:
        A list of paths to add to the sys.path
    :param index:
        (Default 0) The index in the sys.path list where the paths will be
        added.
    NrM   )ÚsysÚpathÚinsert)Ú	pathnamesrd   Úpathnames      r!   Úadd_to_sys_pathrk      s-   € ð ™d ˜d‘Oò )ˆÜ�‰�‰˜˜xÕ(ñ)r"   c                óŒ   — ddl }t        | d«      5 }|j                  |j                  «       «      cddd«       S # 1 sw Y   yxY w)zÌLoads the YAML configuration from the specified file.

    :param tricks_file_path:
        The path to the tricks configuration file.
    :returns:
        A dictionary of configuration information.
    r   NÚrb)ÚyamlÚopenÚ	safe_loadÚread)Útricks_file_pathnamern   Úfs      r!   Úload_configrt   Œ   s;   € ó ä	Ð" DÓ	)ð (¨QØ�~‰~˜aŸf™f›hÓ'÷(÷ (ò (ús	   ‘:ºAú;c               ó^   — | j                  |«      }|j                  |«      }|dgk(  rg }||fS )z^Parses pattern argument specs and returns a two-tuple of
    (patterns, ignore_patterns).
    rH   r`   )Úpatterns_specÚignore_patterns_specr^   ÚpatternsÚignore_patternss        r!   Úparse_patternsr{   š   s>   € ð ×"Ñ" 9Ó-€HØ*×0Ñ0°Ó;€OØ˜2˜$ÒØˆØ�_Ð$Ð$r"   Ú	recursivec               óú   — t        |«      D ]  }| j                  |||¬«       Œ | j                  «        	 	 t        j                  d«       Œ# t
        $ r | j                  «        Y nw xY w| j                  «        y)ag  Single observer thread with a scheduled path and event handler.

    :param observer:
        The observer thread.
    :param event_handler:
        Event handler which will be called in response to file system events.
    :param pathnames:
        A list of pathnames to monitor.
    :param recursive:
        ``True`` if recursive; ``False`` otherwise.
    ©r|   rO   N)ÚsetÚscheduleÚstartÚtimeÚsleepr
   ÚstopÚjoin)ÚobserverÚevent_handlerri   r|   rj   s        r!   Úobserve_withrˆ   §   sq   € ô$ ˜	“Nò HˆØ×Ñ˜-¨¸YÐÕGðHà‡N�NÔðØÜ�J‰J�qŒMð øä ò Ø�‰Žðúà‡M�M…Os   ¶A ÁA)Á(A)c               ó²   — |D ]R  }|j                  «       D ]=  \  }}t        |«      } |di |¤Ž}t        |dd«      xs |}	| j                  ||	|¬«       Œ? ŒT y)aj  Schedules tricks with the specified observer and for the given watch
    path.

    :param observer:
        The observer thread into which to schedule the trick and watch.
    :param tricks:
        A list of tricks.
    :param pathname:
        A path name which should be watched.
    :param recursive:
        ``True`` if recursive; ``False`` otherwise.
    Úsource_directoryNr~   r\   )Úitemsr   Úgetattrr€   )
r†   r   rj   r|   ÚtrickrW   ÚvalueÚ	trick_clsÚhandlerÚtrick_pathnames
             r!   Úschedule_tricksr’   Ä   sp   € ð ò LˆØ Ÿ;™;›=ò 	L‰KˆD�%Ü" 4Ó(ˆIÙÑ( %Ñ(ˆGÜ$ WÐ.@À$ÓGÒSÈ8ˆNØ×Ñ˜g ~ÀÐÕKñ		LñLr"   ÚfilesÚ*zperform tricks from given file)ÚnargsÚhelpz--python-pathú.zPaths separated by z to add to the Python path.)Údefaultr–   z
--intervalz	--timeoutÚtimeoutg      ð?z?Use this as the polling interval/blocking timeout (in seconds).)r=   r˜   r&   r–   z--recursiveÚ
store_trueTz-Recursively monitor paths (defaults to True).)r;   r˜   r–   z--debug-force-pollingz[debug] Forces polling.)r;   r–   z--debug-force-kqueuez[debug] Forces BSD kqueue(2).z--debug-force-winapiz[debug] Forces Windows API.z--debug-force-fseventsz[debug] Forces macOS FSEvents.z--debug-force-inotifyz [debug] Forces Linux inotify(7).)rC   c                óü  — | j                   r	ddlm} |}n|| j                  r	ddlm} |}ngt        s| j                  st        rt        j                  «       r	ddl
m} |}n2| j                  r	ddlm} |}n| j                  r	ddlm} |}nddlm} |}t)        t+        | j,                  «      «       g }| j.                  D �],  }	 || j0                  ¬«      }
t2        j4                  j7                  |	«      s<t9        t:        j<                  t3        j>                  t:        j<                  «      |	«      ‚tA        |	«      }	 |tB           }tF        |v rt)        |tF           «       t2        j4                  jI                  |	«      xs1 t2        j4                  jK                  t3        jL                  «       «      }tO        |
||| jP                  ¬«       |
jS                  «        |jU                  |
«       �Œ/ 	 	 tW        jX                  d«       Œ# tD        $ r}d	tB        ›d
|	›d�}tE        |«      |‚d}~ww xY w# tZ        $ r* |D ]"  }|j]                  «        |j_                  «        Œ$ Y nw xY w|D ]  }|ja                  «        Œ y)z;Command to execute tricks from a tricks configuration file.r   ©ÚPollingObserver©ÚKqueueObserver©ÚWindowsApiObserver©ÚInotifyObserver©ÚFSEventsObserver©ÚObserver©r™   zNo z key specified in r—   Nr~   rO   )1Údebug_force_pollingÚwatchdog.observers.pollingr�   Údebug_force_kqueueÚwatchdog.observers.kqueuerŸ   r   Údebug_force_winapir   Ú
is_windowsÚ)watchdog.observers.read_directory_changesr¡   Údebug_force_inotifyÚwatchdog.observers.inotifyr£   Údebug_force_fseventsÚwatchdog.observers.fseventsr¥   Úwatchdog.observersr§   rk   rc   Úpython_pathr“   r™   Úosrg   ÚexistsÚOSErrorÚerrnoÚENOENTÚstrerrorrt   ÚCONFIG_KEY_TRICKSÚKeyErrorÚCONFIG_KEY_PYTHON_PATHÚdirnameÚrelpathÚgetcwdr’   r|   r�   Úappendr‚   rƒ   r
   Úunschedule_allr„   r…   )r   r�   Úobserver_clsrŸ   r¡   r£   r¥   r§   Ú	observersÚtricks_filer†   Úconfigr   ÚeÚerrorÚdir_pathÚos                    r!   Útricks_fromrÌ   Ù   sý  € ðb ×ÒÝ>à&‰Ø	×	 Ò	 Ý<à%‰Ý × 7Ò 7½]Ìx×ObÑObÔOdÝPà)‰Ø	×	!Ò	!Ý>à&‰Ø	×	"Ò	"Ý@à'‰õ 	0àˆä”J˜t×/Ñ/Ó0Ô1Ø€IØ—z‘zó #ˆÙ¨¯©Ô5ˆä�w‰w�~‰~˜kÔ*Üœ%Ÿ,™,¬¯©´E·L±LÓ(AÀ;ÓOÐOä˜[Ó)ˆð	)ØÔ-Ñ.ˆFô
 " VÑ+Ü˜FÔ#9Ñ:Ô;ä—7‘7—?‘? ;Ó/ÒO´2·7±7·?±?Ä2Ç9Á9Ã;Ó3OˆÜ˜ &¨(¸d¿n¹nÕMØ�‰ÔØ×Ñ˜Ö"ð)#ð,ØÜ�J‰J�qŒMð øô ò 	)ØÔ+Ð.Ð.@ÀÀÈqÐQˆEÜ˜5“/ qÐ(ûð	)ûô !ò Øò 	ˆAØ×ÑÔØ�F‰F�Hò	ðúð ò ˆØ	�‰�ñs*   Ä<	HÇ/H0 È	H-ÈH(È(H-È00I#É"I#Útrick_pathsz5Dotted paths for all the tricks you want to generate.z--append-to-filez€
                   Appends the generated tricks YAML to a file.
                   If not specified, prints to standard output.z-az--append-onlyÚappend_onlyz’
                   If --append-to-file is not specified, produces output for
                   appending instead of a complete tricks YAML file.)r=   r;   r–   zgenerate-tricks-yamlc                ó®  — ddl }t        | j                  «      }t        |«       t	        «       }| j
                  D ],  }t        |«      }|j                  |j                  «       «       Œ. |j                  «       }|j                  «        |j                  t        |i«      }|t        › d�z  }| j                  €1| j                  s||z   }t         j"                  j                  |«       yt$        j&                  j)                  | j                  «      s||z   }t+        | j                  dd¬«      5 }|j                  |«       ddd«       y# 1 sw Y   yxY w)zLCommand to generate Yaml configuration for tricks named on the command line.r   Nz:
Úazutf-8)Úencoding)rn   rc   rµ   rk   r   rÍ   r   ÚwriteÚgenerate_yamlÚgetvalueÚcloseÚdumpr¾   r¼   Úappend_to_filerÎ   rf   Ústdoutr¶   rg   r·   ro   )	r   rn   Úpython_pathsÚoutputÚ
trick_pathr�   ÚcontentÚheaderÚfiles	            r!   Útricks_generate_yamlrß   H  s  € óB ä˜d×.Ñ.Ó/€LÜ�LÔ!Ü‹Z€Fà×&Ñ&ò 0ˆ
Ü˜zÓ*ˆ	Ø�‰�Y×,Ñ,Ó.Õ/ð0ð �o‰oÓ€GØ
‡L�L„Nà�Y‰YÔ.°Ð=Ó>€FØ
Ô"Ð# 3Ð'Ñ'€FØ×ÑÐ"à×ÒØ˜wÑ&ˆGÜ�
‰
×Ñ˜Õ!ä�w‰w�~‰~˜d×1Ñ1Ô2Ø˜wÑ&ˆGÜ�$×%Ñ% s°WÔ=ð 	 ÀØ�J‰J�wÔ÷	 ÷ 	 ñ 	 ús   Ä0EÅEÚdirectoriesz%Directories to watch. (default: '.').)r•   r˜   r–   z-pz	--patternz
--patternsry   z9Matches event paths with these patterns (separated by ;).)r=   r˜   r–   z-iz--ignore-patternz--ignore-patternsrz   rH   z9Ignores event paths with these patterns (separated by ;).z-Dz--ignore-directoriesÚignore_directorieszIgnores events for directories.z-Rz%Monitors the directories recursively.z2Use this as the polling interval/blocking timeout.c                ó  — ddl m} t        | j                  | j                  «      \  }} |||| j
                  ¬«      }| j                  r	ddlm} |}n|| j                  r	ddl
m} |}ngt        s| j                  st        rt        j                  «       r	ddlm} |}n2| j$                  r	ddlm}	 |	}n| j*                  r	ddlm}
 |
}ndd	lm} |} || j4                  ¬
«      }t7        ||| j8                  | j:                  ¬«       y)z1Command to log file system events to the console.r   )ÚLoggerTrick)ry   rz   rá   rœ   rž   r    r¢   r¤   r¦   r¨   r~   N)Úwatchdog.tricksrã   r{   ry   rz   rá   r©   rª   r�   r«   r¬   rŸ   r   r­   r   r®   r¯   r¡   r°   r±   r£   r²   r³   r¥   r´   r§   r™   rˆ   rà   r|   )r   rã   ry   rz   r�   r�   rÄ   rŸ   r¡   r£   r¥   r§   r†   s                r!   Úlogrå   „  sÒ   € õN ,ä .¨t¯}©}¸d×>RÑ>RÓ SÑ€HˆoÙØØ'Ø×2Ñ2ô€Gð ×ÒÝ>à&‰Ø	×	 Ò	 Ý<à%‰Ý × 7Ò 7½]Ìx×ObÑObÔOdÝPà)‰Ø	×	!Ò	!Ý>à&‰Ø	×	"Ò	"Ý@à'‰õ 	0àˆá D§L¡LÔ1€HÜ�˜7 D×$4Ñ$4ÀÇÁÖOr"   zDirectories to watch.z-cz	--commandr]   am  
    Shell command executed in response to matching events.
    These interpolation variables are available to your command string:

        ${watch_src_path}   - event source path
        ${watch_dest_path}  - event destination path (for moved events)
        ${watch_event_type} - event type
        ${watch_object}     - 'file' or 'directory'

    Note:
        Please ensure you do not use double quotes (") to quote
        your command string. That will force your shell to
        interpolate before the command is processed by this
        command.

    Example:

        --command='echo "${watch_src_path}"'
    F)r=   r˜   r;   r–   z-wz--waitÚwait_for_processzDWait for process to finish to avoid multiple simultaneous instances.z-Wz--dropÚdrop_during_processzhIgnore events that occur while command is still being executed to avoid multiple simultaneous instances.c                óŽ  — ddl m} | j                  sd| _        | j                  r	ddlm} |}nddlm} |}t        | j                  | j                  «      \  }} || j                  ||| j                  | j                  | j                  ¬«      } || j                  ¬«      }t        ||| j                   | j"                  ¬«       y)	zDCommand to execute shell commands in response to file system events.r   )ÚShellCommandTrickNrœ   r¦   )ry   rz   rá   ræ   rç   r¨   r~   )rä   ré   r]   r©   rª   r�   r´   r§   r{   ry   rz   rá   ræ   rç   r™   rˆ   rà   r|   )	r   ré   r�   rÄ   r§   ry   rz   r�   r†   s	            r!   Úshell_commandrê   ô  s¦   € õn 2à�<Š<ØˆŒð ×ÒÝ>à&‰å/àˆä .¨t¯}©}¸d×>RÑ>RÓ SÑ€HˆoÙØ�‰ØØ'Ø×2Ñ2Ø×.Ñ.Ø ×4Ñ4ô€Gñ  D§L¡LÔ1€HÜ�˜7 D×$4Ñ$4ÀÇÁÖOr"   z,Long-running command to run in a subprocess.)r–   Úcommand_argsÚargz€
    Command arguments.

    Note: Use -- before the command arguments, otherwise watchmedo will
    try to interpret them.
    )Úmetavarr•   r–   z-dz--directoryÚ	DIRECTORYrÂ   zLDirectory to watch. Use another -d or --directory option for each directory.)r=   rí   r;   r–   z--signalÚsignalÚSIGINTz6Stop the subprocess with this signal (default SIGINT).z--kill-afterÚ
kill_afterg      $@zYWhen stopping, kill the subprocess after the specified timeout in seconds (default 10.0).z--debounce-intervalÚdebounce_intervalg        zwAfter a file change, Wait until the specified interval (in seconds) passes with no file changes, and only then restart.z--no-restart-on-command-exitÚrestart_on_command_exitÚstore_falsez.Don't auto-restart the command after it exits.c           
     óÄ  ‡‡— | j                   r	ddlm} |}nddlm} |}ddlŠddlm} | j                  sdg| _        | j
                  j                  d«      rt        ‰| j
                  «      nt        | j
                  «      }‰j                  ‰j                  hŠt        ‰d«      r‰j                  ‰j                   «       dˆˆfd	„}‰D ]  }‰j                  ||«       Œ t#        | j$                  | j&                  «      \  }}	| j(                  g}
|
j+                  | j,                  «        ||
||	| j.                  || j0                  | j2                  | j4                  ¬
«      }|j7                  «         || j8                  ¬«      }	 t;        ||| j                  | j<                  ¬«       |jA                  «        y# t>        $ r Y Œw xY w# |jA                  «        w xY w)zLCommand to start a long-running subprocess and restart it on matched events.r   rœ   r¦   N)ÚAutoRestartTrickr—   ÚSIGÚSIGHUPc                óV   •— ‰D ]  }‰j                  |‰j                  «       Œ  t        ‚)N)rï   ÚSIG_IGNr
   )Ú_signumÚ_frameÚsignumrï   Útermination_signalss      €€r!   Úhandler_termination_signalz0auto_restart.<locals>.handler_termination_signalà  s*   ø€ à)ò 	2ˆFØ�M‰M˜& &§.¡.Õ1ð	2ä#Ð#r"   )ry   rz   rá   Ústop_signalrñ   Údebounce_interval_secondsró   r¨   r~   )rû   zsignal._SIGNUMrü   Úobjectr0   r1   )!r©   rª   r�   r´   r§   rï   rä   rö   rà   Ú
startswithrŒ   r/   ÚSIGTERMrð   ÚhasattrÚaddrø   r{   ry   rz   r]   Úextendrë   rá   rñ   rò   ró   r�   r™   rˆ   r|   r
   r„   )r   r�   rÄ   r§   rö   r   rÿ   rý   ry   rz   r]   r�   r†   rï   rþ   s                @@r!   Úauto_restartr  g  s“  ù€ ð~ ×ÒÝ>à&‰å/àˆãå0à×ÒØ˜5ˆÔð 37·+±+×2HÑ2HÈÔ2O”'˜& $§+¡+Ô.ÔUXÐY]×YdÑYdÓUe€Kð "Ÿ>™>¨6¯=©=Ð9Ðäˆv�xÔ Ø×Ñ §¡Ô.ö$ð &ò :ˆØ�‰�fÐ8Õ9ð:ô !/¨t¯}©}¸d×>RÑ>RÓ SÑ€HˆoØ�|‰|ˆn€GØ‡N�N�4×$Ñ$Ô%ÙØØØ'Ø×2Ñ2ØØ—?‘?Ø"&×"8Ñ"8Ø $× <Ñ <ô	€Gð ‡M�M„OÙ D§L¡LÔ1€HðÜ�X˜w¨×(8Ñ(8ÀDÇNÁNÕSð 	�‰�øô !ò Ùðûð 	�‰�ús$   Æ
#F> Æ>	G
ÇG Ç	G
Ç
G ÇGc                  ó   — e Zd Zy)ÚLogLevelErrorN)r'   r4   r5   r\   r"   r!   r
  r
     s   „ Ør"   r
  c                ó�   — t        | j                  xs g «      }|dk  rd}t        |«      ‚|dkD  rd}t        |«      ‚g d¢d|z      S )NrM   z&-q/--quiet may be specified only once.é   z,-v/--verbose may be specified up to 2 times.)ÚERRORÚWARNINGÚINFOÚDEBUGrO   )ÚsumrK   r
  )r   rK   rÉ   s      r!   Ú_get_log_level_from_argsr    sR   € Ü�D—N‘NÒ( bÓ)€IØ�2‚~Ø8ˆÜ˜EÓ"Ð"Ø�1‚}Ø>ˆÜ˜EÓ"Ð"Ú0°°Y±Ñ?Ð?r"   c                 óÔ  — t         j                  «       } | j                  €t         j                  «        y	 t	        | «      }t        j                  d«      j                  |«       	 | j                  | «       y# t
        $ rV}t        d|j                  d   › �t        j                  ¬«       t        | j                     j                  «        Y d}~yd}~ww xY w# t        $ r Y yw xY w)zEntry-point function.NrO   zError: r   )rÞ   Úwatchdogé‚   )ÚcliÚ
parse_argsr<   Ú
print_helpr  r
  Úprintr   rf   ÚstderrrS   ÚloggingÚ	getLoggerÚsetLevelrP   ÚKeyboardInterrupt)r   Ú	log_levelÚexcs      r!   Úmainr!    sÂ   € ä�>‰>Ó€DØ×ÑÐÜ�‰ÔØðÜ,¨TÓ2ˆ	ô
 ×Ñ�jÓ!×*Ñ*¨9Ô5ðØ�	‰	�$Œð øô ò Ü�˜Ÿ™ ™�}Ð%¬C¯J©JÕ7Ü˜×(Ñ(Ñ)×4Ñ4Ô6Üûðûô ò Ùðús*   ·A9 Á'C Á9	CÂACÃCÃ	C'Ã&C'Ú__main__)r@   r2   r   r	   r0   ÚArgument)r   zlist[Argument]rB   z!_SubParsersAction[ArgumentParser]rC   zlist[str] | Noner0   r   )rb   r2   r^   r2   r0   r3   )ri   r3   rd   r/   r0   r1   )rr   r2   r0   Údict)rw   r2   rx   r2   r^   r2   r0   ztuple[list[str], list[str]])
r†   r   r‡   r   ri   r3   r|   Úboolr0   r1   )
r†   r   r   z
list[dict]rj   r2   r|   r%  r0   r1   )r   r   r0   r1   )r   r   r0   r2   )r0   r/   )Fr6   Ú
__future__r   r¹   r  r¶   Úos.pathrf   r‚   Úargparser   r   Úior   Útextwrapr   Útypingr   r	   Úwatchdog.utilsr
   r   r   Úwatchdog.versionr   r   r   r   Úwatchdog.eventsr   r´   r   Úwatchdog.observers.apir   ÚbasicConfigr  r¼   r¾   r   r8   r  rU   Úadd_subparsersÚ
subparsersrS   Útupler?   r2   r#  rA   r]   Úpathseprc   rk   rt   r{   rˆ   r’   ÚfloatrÌ   rß   rå   rê   r  Ú	Exceptionr
  r  r!  r'   Úexitr\   r"   r!   ú<module>r8     sÀ  ðñõ #ã Û Û 	Û Û 
Û ß @Ý Ý ß %ç FÑ FÝ +áß5Ýå6Ý/Ý3ð €× Ñ ˜'Ÿ,™,Õ 'àÐ Ø&Ð ô!Ð/ô !ð.
4€ñ ˜F°MÔB€Ø × Ñ � Y¸Ð Ô GØ×Ñ ]ÐÓ3€
Ø€à��c‘˜C�Ñ €ó'ð 1;Ø$(ñ	Ø
ðð .ðð "ð	ð
 óð> 8:·z±zõ *ð ;<õ 
)ó(ð HKñ
%Øð
%Ø.1ð
%ØADð
%à ó
%ðØðà)ðð ðð
 ðð 
óó:Lñ* 	á� Ð*JÔKÙØØØ& r§z¡z nÐ4OÐPô	
ñ
 	ØØØØØØRô	
ñ 	ØØØØ@ô		
ñ 	Ð(°ÐD]Ô^ÙØ"ØØ0ô	
ñ
 	Ø"ØØ.ô	
ñ
 	Ø$ØØ1ô	
ñ
 	Ø#ØØ3ô	
ðK*ðV �
ôY-ò\>ó]-ð\>ñB 	áØØØHô	
ñ
 	ØØØ& r§z¡z nÐ4OÐPô	
ñ
 	ØØðCô	
ñ 	ØØØØðHô	
ð%ð8 (Ð(ô;ò> ó?ð> ñ: 	áØØØØ8ô		
ñ 	ØØØØØØLô	
ñ 	ØØØØ"ØØLô	
ñ 	ØØ"Ø%ØØ2ô	
ñ 	ØØØØØ8ô	
ñ 	ØØØØØØEô	
ñ 	Ð(°ÐD]Ô^ÙØ"ØØ0ô	
ñ
 	Ø"ØØ.ô	
ñ
 	Ø$ØØ1ô	
ñ
 	Ø#ØØ3ô	
ð{BóDòJ(PóKDðJ(PñV 	á� c°3Ð=TÔUÙØØØØðô	
ñ2 	ØØØØØØLô	
ñ 	ØØØØ"ØØLô	
ñ 	ØØ"Ø%ØØØ2ô	
ñ 	ØØØØØ8ô	
ñ 	ØØØØØØEô	
ñ 	ØØØ#ØØWô	
ñ 	ØØØ&ØðBô	
ñ 	Ð(°ÐD]Ô^ðcRóTòjPókTðjPñ< 	á�Ð!OÔPÙØØØðô	
	
ñ 	ØØØØØØ_ô	
ñ 	ØØØØØØLô	
ñ 	ØØØØ"ØØLô	
ñ 	ØØ"Ø%ØØØ2ô	
ñ 	ØØØØØ8ô	
ñ 	ØØØØØØEô	
ñ 	ØØØØIô		
ñ 	Ð(°ÐD]Ô^ÙØØØØØlô	
ñ 	Ø!Ø$ØØðKô	
ñ 	Ø*Ø*ØØ ØAô	
ðeYó[òx:óy[ðx:ôz	�Iô 	ó@óð. ˆzÒØ€C‡H�H‰T‹VÕð r"   