+
    üÐj!  ã                  ó\  a € 0 t $ R t^ RIHt ^ RIt^ RIHtHtHt	 ^ RI
Ht ^ RIHtHtHt ^ RIHtHt ^ RIHt ^ RIHt  ! R	 R
]4      t]! ]4       ! R R4      4       t]! ]4       ! R R4      4       t]! 4       tR
]R&    ! R R]4      t ! R R]4      t ! R R]4      t ! R R]4      t R# )z
PID file.
)ÚannotationsN)ÚgetpidÚkillÚname)ÚTracebackType)ÚAnyÚOptionalÚType)Ú	InterfaceÚimplementer)ÚLogger)ÚFilePathc                  ób   € ] tR t^tRtR R ltR R ltR R ltR R	 ltR
 R lt	R R lt
RtR# )ÚIPIDFilez-
Manages a file that remembers a process ID.
c               ó   € V ^8„  d   QhRR/# ©é   ÚreturnÚint© )Úformats   "ÚE/usr/lib/python3/dist-packages/twisted/application/runner/_pidfile.pyÚ__annotate__ÚIPIDFile.__annotate__   s   € ÷ 	ñ 	�#ñ 	ó    c                 ó   € R# )zû
Read the process ID stored in this PID file.

@return: The contained process ID.

@raise NoPIDFound: If this PID file does not exist.
@raise EnvironmentError: If this PID file cannot be read.
@raise ValueError: If this PID file's content is invalid.
Nr   r   r   r   ÚreadÚIPIDFile.read   ó   ‚ r   c               ó   € V ^8„  d   QhRR/# ©r   r   ÚNoner   )r   s   "r   r   r   %   s   € ÷ ñ ˜Tñ r   c                 ó   € R# )zv
Store the PID of the current process in this PID file.

@raise EnvironmentError: If this PID file cannot be written.
Nr   r   r   r   ÚwriteRunningPIDÚIPIDFile.writeRunningPID%   r   r   c               ó   € V ^8„  d   QhRR/# r    r   )r   s   "r   r   r   ,   s   € ÷ ñ �Dñ r   c                 ó   € R# )zU
Remove this PID file.

@raise EnvironmentError: If this PID file cannot be removed.
Nr   r   r   r   ÚremoveÚIPIDFile.remove,   r   r   c               ó   € V ^8„  d   QhRR/# ©r   r   Úboolr   )r   s   "r   r   r   3   s   € ÷ ñ �tñ r   c                 ó   € R# )aË  
Determine whether there is a running process corresponding to the PID
in this PID file.

@return: True if this PID file contains a PID and a process with that
    PID is currently running; false otherwise.

@raise EnvironmentError: If this PID file cannot be read.
@raise InvalidPIDFileError: If this PID file's content is invalid.
@raise StalePIDFileError: If this PID file's content refers to a PID
    for which there is no corresponding running process.
Nr   r   r   r   Ú	isRunningÚIPIDFile.isRunning3   r   r   c               ó   € V ^8„  d   QhRR/# )r   r   z
'IPIDFile'r   )r   s   "r   r   r   A   s   € ÷ ñ �zñ r   c                 ó   € R# )zÈ
Enter a context using this PIDFile.

Writes the PID file with the PID of the running process.

@raise AlreadyRunningError: A process corresponding to the PID in this
    PID file is already running.
Nr   r   r   r   Ú	__enter__ÚIPIDFile.__enter__A   r   r   c               ó(   € V ^8„  d   QhRRRRRRRR/# )	r   ÚexcTypeúOptional[Type[BaseException]]ÚexcValueúOptional[BaseException]Ú	tracebackúOptional[TracebackType]r   zOptional[bool]r   )r   s   "r   r   r   K   s0   € ÷ 	ñ 	Ø.ð	à)ð	ð +ð	ð 
ñ		r   c                ó   € R# )z;
Exit a context using this PIDFile.

Removes the PID file.
Nr   )r4   r6   r8   s   &&&r   Ú__exit__ÚIPIDFile.__exit__K   r   r   r   N)Ú__name__Ú
__module__Ú__qualname__Ú__firstlineno__Ú__doc__r   r#   r'   r-   r1   r;   Ú__static_attributes__r   r   r   r   r      s*   † ñõ	õõõõ÷	ñ 	r   r   c                  ó´   € ] tR t^WtRt]! 4       t]R R l4       tR R lt	R R lt
R R	 ltR
 R ltR R ltR R lt]R R l4       tR R ltR R ltRtR# )ÚPIDFilez¿
Concrete implementation of L{IPIDFile}.

This implementation is presently not supported on non-POSIX platforms.
Specifically, calling L{PIDFile.isRunning} will raise
L{NotImplementedError}.
c               ó    € V ^8„  d   QhRRRR/# )r   Úpidr   r   Úbytesr   )r   s   "r   r   ÚPIDFile.__annotate__d   s   € ÷ (ñ (�Sð (˜Uñ (r   c                ó:   € \        V 4       R2P                  4       # )z`
Format a PID file's content.

@param pid: A process ID.

@return: Formatted PID file contents.
Ú
)r   Úencode©rF   s   &r   Ú_formatÚPIDFile._formatc   s   € ô �c“(�˜2ˆ×%Ñ%Ó'Ð'r   c               ó    € V ^8„  d   QhRRRR/# )r   ÚfilePathzFilePath[Any]r   r!   r   )r   s   "r   r   rH   n   s   € ÷ !ñ ! ð !°4ñ !r   c                ó   € Wn         R# )z4
@param filePath: The path to the PID file on disk.
N©rP   )ÚselfrP   s   &&r   Ú__init__ÚPIDFile.__init__n   s	   € ð !Žr   c               ó   € V ^8„  d   QhRR/# r   r   )r   s   "r   r   rH   t   s   € ÷ ñ �cñ r   c                	óf  € R p V P                   P                  4       ;_uu_ 4       pV F  p M	  RRR4        \        T4      #   + '       g   i     L; i  \         d1   pTP                  \        P                  8X  d   \        R4      hh Rp?ii ; i  \         d    \        RT: 24      hi ; i)r   NúPID file does not existz#non-integer PID value in PID file: )	rP   ÚopenÚOSErrorÚerrnoÚENOENTÚ
NoPIDFoundr   Ú
ValueErrorÚInvalidPIDFileError)rS   Ú	pidStringÚfhÚes   &   r   r   ÚPIDFile.readt   s¢   € Øˆ	ð	Ø—‘×#Ñ#×%Ô%¨Û!#�IÙñ "$÷ &ð	Ü�y“>Ð!÷ &×%ûô ô 	Ø�w‰wœ%Ÿ,™,Ô&Ü Ð!:Ó;Ð;Øûð	ûô ô 	Ü%Ø5°i±]ÐCóð ð	ús>   „"A ¦
A°A ¹
B ÁA	ÁA ÁA ÁBÁ"+BÂBÂB0c               ó    € V ^8„  d   QhRRRR/# ©r   rF   r   r   r!   r   )r   s   "r   r   rH   †   s   € ÷ 8ñ 8˜#ð 8 $ñ 8r   c                ó\   € V P                   P                  V P                  VR7      4       R# )zz
Store a PID in this PID file.

@param pid: A PID to store.

@raise EnvironmentError: If this PID file cannot be written.
rL   N)rP   Ú
setContentrM   ©rS   rF   s   &&r   Ú_writeÚPIDFile._write†   s!   € ð 	�‰× Ñ  §¡°# Ó!6Ö7r   c               ó   € V ^8„  d   QhRR/# r    r   )r   s   "r   r   rH   �   s   € ÷ ñ  ñ r   c                	ó8   € V P                  \        4       4       R # ©N)ri   r   ©rS   s   &r   r#   ÚPIDFile.writeRunningPID�   s   € Ø�‰”F“HÖr   c               ó   € V ^8„  d   QhRR/# r    r   )r   s   "r   r   rH   “   s   € ÷ ñ ˜ñ r   c                	ó:   € V P                   P                  4        R # rm   )rP   r'   rn   s   &r   r'   ÚPIDFile.remove“   s   € Ø�‰×ÑÖr   c               ó   € V ^8„  d   QhRR/# r*   r   )r   s   "r   r   rH   –   s   € ÷ 	Xñ 	X˜4ñ 	Xr   c                	ó¤   €  V P                  4       p\        R8X  d   T P                  T4      # \	        R\         24      h  \         d     R # i ; i)FÚposixz isRunning is not implemented on )r   r]   ÚSYSTEM_NAMEÚ_pidIsRunningPOSIXÚNotImplementedErrorrh   s   & r   r-   ÚPIDFile.isRunning–   sT   € ð	Ø—)‘)“+ˆCô ˜'Ô!Ø×*Ñ*¨3Ó/Ð/ä%Ð(HÌÈÐ&VÓWÐWøô ô 	Úð	ús   ‚A  Á AÁAc               ó    € V ^8„  d   QhRRRR/# )r   rF   r   r   r+   r   )r   s   "r   r   rH   ¢   s   € ÷ ñ  ð ¨ñ r   c                óæ   €  \        V ^ 4       R#   \         dV   pTP                  \        P                  8X  d   \	        R4      hTP                  \        P
                  8X  d    Rp?R# h Rp?ii ; i)aá  
POSIX implementation for running process check.

Determine whether there is a running process corresponding to the given
PID.

@param pid: The PID to check.

@return: True if the given PID is currently running; false otherwise.

@raise EnvironmentError: If this PID file cannot be read.
@raise InvalidPIDFileError: If this PID file's content is invalid.
@raise StalePIDFileError: If this PID file's content refers to a PID
    for which there is no corresponding running process.
Tz'PID file refers to non-existing processN)r   rZ   r[   ÚESRCHÚStalePIDFileErrorÚEPERM)rF   rb   s   & r   rw   ÚPIDFile._pidIsRunningPOSIX¡   sY   € ð"
	Ü��aŒLñ øô ô 	Ø�w‰wœ%Ÿ+™+Ô%Ü'Ð(QÓRÐRØ—‘œEŸK™KÔ'Ýàûð	ús   ‚ �A0›A	A+Á*A+Á+A0c               ó   € V ^8„  d   QhRR/# )r   r   z	'PIDFile'r   )r   s   "r   r   rH   ¾   s   € ÷ ñ ˜9ñ r   c                	óÂ   €  V P                  4       '       d   \        4       h V P                  4        V #   \         d    T P                  P	                  R 4        L:i ; i)z&Replacing stale PID file: {log_source})r-   ÚAlreadyRunningErrorr}   Ú_logÚinfor#   rn   s   &r   r1   ÚPIDFile.__enter__¾   sZ   € ð	EØ�~‰~×ÒÜ)Ó+Ð+ð  ð 	×ÑÔØˆøô !ô 	EØ�I‰I�N‰NÐCÖDð	Eús   ‚5 ˜
5 µ&AÁAc               ó(   € V ^8„  d   QhRRRRRRRR/# ©	r   r4   r5   r6   r7   r8   r9   r   r!   r   )r   s   "r   r   rH   Ç   s2   € ÷ ñ à.ðð *ðð +ð	ð
 
ñr   c                	ó&   € V P                  4        R # rm   )r'   ©rS   r4   r6   r8   s   &&&&r   r;   ÚPIDFile.__exit__Ç   s   € ð 	�‰ŒÙr   rR   N)r=   r>   r?   r@   rA   r   rƒ   ÚstaticmethodrM   rT   r   ri   r#   r'   r-   rw   r1   r;   rB   r   r   r   rD   rD   W   sd   † ññ ‹8€Dàô(ó ð(õ!õõ$8õõõ	Xð ôó ðõ8÷ñ r   rD   c                  óz   € ] tR t^ÑtRtR R ltR R ltR R ltR R	 ltR
 R lt	R R lt
R R ltR R ltRtR# )ÚNonePIDFilez”
PID file implementation that does nothing.

This is meant to be used as a "active None" object in place of a PID file
when no PID file is desired.
c               ó   € V ^8„  d   QhRR/# r    r   )r   s   "r   r   ÚNonePIDFile.__annotate__Ú   s   € ÷ ñ ˜$ñ r   c                	ó   € R # rm   r   rn   s   &r   rT   ÚNonePIDFile.__init__Ú   s   € Ùr   c               ó   € V ^8„  d   QhRR/# r   r   )r   s   "r   r   r�   Ý   s   € ÷ 4ñ 4�cñ 4r   c                	ó   € \        R 4      h)rX   )r]   rn   s   &r   r   ÚNonePIDFile.readÝ   s   € ÜÐ2Ó3Ð3r   c               ó    € V ^8„  d   QhRRRR/# re   r   )r   s   "r   r   r�   à   s   € ÷ 
>ñ 
>˜#ð 
> $ñ 
>r   c                ó6   € \        \        P                  R4      h)z¼
Store a PID in this PID file.

@param pid: A PID to store.

@raise EnvironmentError: If this PID file cannot be written.

@note: This implementation always raises an L{EnvironmentError}.
zOperation not permitted)rZ   r[   r~   rh   s   &&r   ri   ÚNonePIDFile._writeà   s   € ô ”e—k‘kÐ#<Ó=Ð=r   c               ó   € V ^8„  d   QhRR/# r    r   )r   s   "r   r   r�   ì   s   € ÷ ñ  ñ r   c                	ó(   € V P                  ^ 4       R# )é    N)ri   rn   s   &r   r#   ÚNonePIDFile.writeRunningPIDì   s   € Ø�‰�AŽr   c               ó   € V ^8„  d   QhRR/# r    r   )r   s   "r   r   r�   ï   s   € ÷ Añ A˜ñ Ar   c                	ó6   € \        \        P                  R 4      h)zNo such file or directory)rZ   r[   r\   rn   s   &r   r'   ÚNonePIDFile.removeï   s   € Ü”e—l‘lÐ$?Ó@Ð@r   c               ó   € V ^8„  d   QhRR/# r*   r   )r   s   "r   r   r�   ò   s   € ÷ ñ ˜4ñ r   c                	ó   € R # )Fr   rn   s   &r   r-   ÚNonePIDFile.isRunningò   s   € Ùr   c               ó   € V ^8„  d   QhRR/# )r   r   z'NonePIDFile'r   )r   s   "r   r   r�   õ   s   € ÷ ñ ˜=ñ r   c                	ó   € V # rm   r   rn   s   &r   r1   ÚNonePIDFile.__enter__õ   s   € Øˆr   c               ó(   € V ^8„  d   QhRRRRRRRR/# r‡   r   )r   s   "r   r   r�   ø   s2   € ÷ ñ à.ðð *ðð +ð	ð
 
ñr   c                	ó   € R # rm   r   r‰   s   &&&&r   r;   ÚNonePIDFile.__exit__ø   s   € ñ r   r   N)r=   r>   r?   r@   rA   rT   r   ri   r#   r'   r-   r1   r;   rB   r   r   r   r�   r�   Ñ   s5   † ñõõ4õ
>õõAõõ÷ñ r   r�   ÚnonePIDFilec                  ó   € ] tR tRtRtRtR# )r‚   i  z
Process is already running.
r   N©r=   r>   r?   r@   rA   rB   r   r   r   r‚   r‚     ó   † õr   r‚   c                  ó   € ] tR tRtRtRtR# )r_   i
  z 
PID file contents are invalid.
r   Nrª   r   r   r   r_   r_   
  r«   r   r_   c                  ó   € ] tR tRtRtRtR# )r}   i  zO
PID file contents are valid, but there is no process with the referenced
PID.
r   Nrª   r   r   r   r}   r}     s   † õr   r}   c                  ó   € ] tR tRtRtRtR# )r]   i  z
No PID found in PID file.
r   Nrª   r   r   r   r]   r]     r«   r   r]   )!Ú__conditional_annotations__rA   Ú
__future__r   r[   Úosr   r   r   rv   Útypesr   Útypingr   r   r	   Úzope.interfacer
   r   Útwisted.loggerr   Útwisted.python.filepathr   r   rD   r�   r¨   Ú__annotations__Ú	Exceptionr‚   r_   r}   r]   )r¯   s   @r   Ú<module>r¹      s·   øðô
õ #ã ß 0Ñ 0Ý ß &Ñ &ç 1å !Ý ,ô?ˆyô ?ñD ˆXÓ÷vð vó ðvñr ˆXÓ÷,ð ,ó ð,ñ^ $›€ˆXÓ %ô˜)ô ô˜)ô ô˜	ô ô�ö r   