MMCT TEAM
Server IP : 111.118.215.189  /  Your IP : 216.73.216.185
Web Server : Apache
System : Linux md-in-83.webhostbox.net 4.19.286-203.ELK.el7.x86_64 #1 SMP Wed Jun 14 04:33:55 CDT 2023 x86_64
User : a1673wkz ( 2475)
PHP Version : 8.2.25
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : ON
Directory (0755) :  /lib64/python2.7/site-packages/hgext/inotify/

[  Home  ][  C0mmand  ][  Upload File  ]

Current File : //lib64/python2.7/site-packages/hgext/inotify/linuxserver.pyo
�
Hq�Qc@s:ddlmZddlmZmZmZddlZddlZddlZddl	Z	ddl
Z
ddlZddlZy ddl
Zddl
mZWnek
r��nXd�Zd�Zdefd��YZd	�Zd
ejefd��YZdejefd
��YZdefd��YZdS(i����(t_(tosutiltutilterrorN(twatchercs"���fd���dt�S(spIterate over all subdirectories of this repo.
    Exclude the .hg directory, any nested repos, and ignored dirs.c3s�tj�|�}y�x�tj|�D]}\}}|tjkr%|dkrY|s�dSq�tj||�}�j|�r�q%nx�|t�D]}|Vq�Wq%q%WWn+tk
r�}|j	tj
kr��q�nX|VdS(Ns.hg(tservertjoinRtlistdirtstattS_IFDIRt_ignoretFalsetOSErrorterrnotwalk_ignored_errors(tdirnamettoptfullpathtnametkindtdtsubdirterr(tabsroottdirstatetwalkit(s?/usr/lib64/python2.7/site-packages/hgext/inotify/linuxserver.pyRs 
t(tTrue(RR((RRRs?/usr/lib64/python2.7/site-packages/hgext/inotify/linuxserver.pytwalkrepodirsscCs\d}yttj|��}Wn@tk
ra}|jtjkrI�ntjtd���nX|jtd�|�|jtd��|jtd��t	t
t||���}|jtd�|�t|d�}x"|||dkr|d	9}q�W|jtd
�||f�|jtd�||f�tjtd�|��dS(
Ns%/proc/sys/fs/inotify/max_user_watchess,this system does not seem to support inotifysF*** the current per-user limit on the number of inotify watches is %s
sF*** this limit is too low to watch every directory in this repository
s*** counting directories: s	found %d
ig�������?is4*** to raise the limit from %d to %d (run as root):
s***  echo %d > %s
s3cannot watch %s until inotify watch limit is raised(
tintRtreadfiletIOErrorR
tENOENTtAbortRtwarntlentlistRtmin(tuiRtrootabstpathtlimitRtndirstnewlimit((s?/usr/lib64/python2.7/site-packages/hgext/inotify/linuxserver.pyt_explain_watch_limit,s*tpollablecBsneZdZejZiZej�Zd�Zd�Z	d�Z
d�Zd�Zd�Z
ed��ZRS(s
    Interface to support polling.
    The file descriptor returned by fileno() is registered to a polling
    object.
    Usage:
        Every tick, check if an event has happened since the last tick:
        * If yes, call handle_events
        * If no, call handle_timeout
    cCs
t�dS(N(tNotImplementedError(tself((s?/usr/lib64/python2.7/site-packages/hgext/inotify/linuxserver.pytfilenoSscCs
t�dS(N(R.(R/tevents((s?/usr/lib64/python2.7/site-packages/hgext/inotify/linuxserver.pyt
handle_eventsVscCs
t�dS(N(R.(R/((s?/usr/lib64/python2.7/site-packages/hgext/inotify/linuxserver.pythandle_timeoutYscCs
t�dS(N(R.(R/((s?/usr/lib64/python2.7/site-packages/hgext/inotify/linuxserver.pytshutdown\scCsE|j�}tjj|tj�|tj|<t|_||_dS(N(	R0R-tpolltregistertpoll_eventst	instancesRt
registeredttimeout(R/R:tfd((s?/usr/lib64/python2.7/site-packages/hgext/inotify/linuxserver.pyR6_s

	cCstjj|�t|_dS(N(R-R5t
unregisterRR9(R/((s?/usr/lib64/python2.7/site-packages/hgext/inotify/linuxserver.pyR<hsc	CsEx>tr@d}d}xT|jj�D]C}|jdk	r%|dksU|j|kr%|j|}}q%q%Wy|jj|�}Wn5tjk
r�}|jdt	j
kr�qn�nX|r*i}x-|D]%\}}|j|g�j|�q�WxD|j
�D] \}}|j|j|�qWq|r|j�qqWdS(Ni(RtNoneR8t
itervaluesR:R5tselectRtargsR
tEINTRt
setdefaulttappendt	iteritemsthandle_polleventsR3(	tclsR:ttimeobjtobjR1Rtby_fdR;tevent((s?/usr/lib64/python2.7/site-packages/hgext/inotify/linuxserver.pytrunls*	(t__name__t
__module__t__doc__R?tPOLLINR7R8R5R0R2R3R4R6R<tclassmethodRK(((s?/usr/lib64/python2.7/site-packages/hgext/inotify/linuxserver.pyR-Es									cs�fd�}|S(s8
    Decorator to help handle events in repowatcher
    cs"��fd�}�j|_|S(NcsY�dkr2||jkr2|j|dkr2dS�|j|<d|_�||�dS(Ntmtcmi�(t	lasteventR:(R/twpath(tcodetf(s?/usr/lib64/python2.7/site-packages/hgext/inotify/linuxserver.pytwrapper�s
	(t	func_name(RVRW(RU(RVs?/usr/lib64/python2.7/site-packages/hgext/inotify/linuxserver.pyt	decorator�s	((RURY((RUs?/usr/lib64/python2.7/site-packages/hgext/inotify/linuxserver.pyteventaction�strepowatchercBseZdZejejBejBejBejBej	Bej
BejBejBej
BdBZd�Zd�Zd�Zd�Zdd�Zed�d	��Zed
�d��Zed�d
��Zd�Zd�Zd�Zd�Zd�Zdd�Zd�Zd�Z d�Z!RS(s 
    Watches inotify events
    icCs�tjj||||�i|_t|_ytj�|_Wn/tk
ro}tj	t
d�|j��nXtj|j�|_|jj
|_
|jdd�|j�|j�dS(Ns!inotify service not available: %sR:(RR[t__init__RSRtdirtyRRRR!Rtstrerrort	thresholdR0R6R=R3tscan(R/R&RtrootR((s?/usr/lib64/python2.7/site-packages/hgext/inotify/linuxserver.pyR\�s		
cCsh|j}tj�}||_|dkr.dS||}|dkrLd|S|dkr`d|Sd|S(Ntstartis+%.3fi2s+%.2fs+%.1f(t
last_eventttimeR=(R/tlasttnowtdelta((s?/usr/lib64/python2.7/site-packages/hgext/inotify/linuxserver.pyt
event_time�s		
cCs�|s
dS|jj|�dkr�|jjrR|jjtd�||j�ny|jj||�Wq�t	k
r�}|j
t
jt
jfkr�dS|j
t
j
kr��nt|j|j|j�q�XndS(Nswatching %r
(RR(R=R&t	debugflagtnoteRt	prefixlentaddRR
R tENOTDIRtENOSPCR,Rtwprefix(R/R(tmaskR((s?/usr/lib64/python2.7/site-packages/hgext/inotify/linuxserver.pyt	add_watch�s$cCs;|jjtd�|j�|j|jdtj�dS(Nswatching directories under %r
s.hg(R&RjRRoRqtinotifyt	IN_DELETE(R/((s?/usr/lib64/python2.7/site-packages/hgext/inotify/linuxserver.pytsetup�sRcCs�|jjj�}|jtj|j|�|j�x�tj|j|j|�D]�\}}}x-|D]%}|jtj||�|j�qfW||j	}xI|D]A}tj||�}	|j
|	|j|	��|j|	d�q�WqPW|}
|
r|
ddkr|
d7}
nx�|j�D]r\}	}|	j|
�sCq"ny|j|	�}Wn+tk
r�|d}
|j|	|
�q"X|j
|	|�q"W|jd�|jd�dS(Ni����t/it!tr(Rt_maptcopyRqRRRoRptwalkRkt
updatefiletgetstattpopR=RDt
startswithRRt
deletefilet
check_deleted(R/ttopdirtdsRatdirstfilesRtwroottfntwfntwtopdirtstatetsttstatus((s?/usr/lib64/python2.7/site-packages/hgext/inotify/linuxserver.pyR`�s2"
#





tccCs}|dkr|j�nyL|j|�}tj|d�sQtj|d�rd|j||�nWntk
rxnXdS(Ns	.hgignorei(tupdate_hgignoreRtS_ISREGtS_ISLNKR{R(R/RTR�((s?/usr/lib64/python2.7/site-packages/hgext/inotify/linuxserver.pytcreated�s
&
RQcCs�|dkr|j�nyO|j|�}tj|d�rg|j|dkrg|j||�qgnWntk
r{nXdS(Ns	.hgignoreitlmn(R�RR�RR{R(R/RTR�((s?/usr/lib64/python2.7/site-packages/hgext/inotify/linuxserver.pytmodifieds

RcCsG|dkr|j�n|jd�r,dS|j||j|�dS(Ns	.hgignores.hg/(R�R~RR(R/RT((s?/usr/lib64/python2.7/site-packages/hgext/inotify/linuxserver.pytdeleteds

cCsf|jjr5|jjtd�|j�|f�n|jtj@rU|j|�n
|j	|�dS(Ns%s event: created %s
(
R&RiRjRRhRpRrtIN_ISDIRR`R�(R/RTtevt((s?/usr/lib64/python2.7/site-packages/hgext/inotify/linuxserver.pytprocess_createscCs�|jjr5|jjtd�|j�|f�n|jtj@r�|jj	|�}g|j
d�D]\}}|^qg}x|D]}|j|d�q�W|j|�n
|j
|�dS(Ns%s event: deleted %s
t?(R&RiRjRRhRpRrR�ttreetdirRzRR`R�(R/RTR�R�R�tignorettodeleteR�((s?/usr/lib64/python2.7/site-packages/hgext/inotify/linuxserver.pytprocess_delete!s(
cCsY|jjr5|jjtd�|j�|f�n|jtj@sU|j|�ndS(Ns%s event: modified %s
(	R&RiRjRRhRpRrR�R�(R/RTR�((s?/usr/lib64/python2.7/site-packages/hgext/inotify/linuxserver.pytprocess_modify/s
cCs.|jjtd�|j�tjd�dS(Ns'filesystem containing %s was unmounted
i(R&R"RRtsystexit(R/R�((s?/usr/lib64/python2.7/site-packages/hgext/inotify/linuxserver.pytprocess_unmount7scCs�|jjr>|jjtd�|j�|jj�f�n|j�s�|jr�|jjr�|jjtd�|j��n|j�d|_	q�n
|j
�dS(Ns%s readable: %d bytes
s%s below threshold - unhooking
i�(R&RiRjRRhR_treadableR9R<R:tread_events(R/R1((s?/usr/lib64/python2.7/site-packages/hgext/inotify/linuxserver.pyRE<s 	
cCs�|jj|�}|jjrM|jjtd�|j�t|�f�nxt|D]l}|j|j	d krvqTn|j|j
}|jd�r�|jt
j@r�qTn|dkr	|jt
j@r�|jj�t|_|j�q�|jt
j@r�t|_q�qT|jrqTn|jt
j@r;|j||�qT|jt
jt
jB@re|j||�qT|jt
jt
jBt
jB@r�|j||�qT|jt
jt
jB@rT|j ||�qTqTW|j!j"�dS(Ns%s reading %d events
i����s.hg/s	.hg/wlock(#RtreadR&RiRjRRhR#RRoRkR~RpRrR�RsRt
invalidateRR]R`t	IN_CREATERt
IN_UNMOUNTR�t	IN_MODIFYt	IN_ATTRIBR�tIN_DELETE_SELFt
IN_MOVED_FROMR�tIN_MOVED_TOR�RStclear(R/tbufsizeR1R�RT((s?/usr/lib64/python2.7/site-packages/hgext/inotify/linuxserver.pyR�Js:

	
	cCst|jsg|jjrG|jjtd�|j�|jj�f�n|jd�|j	dd�nd|_dS(Ns*%s hooking back up with %d bytes readable
iR:(R9R&RiRjRRhR_R�R�R6R=R:(R/((s?/usr/lib64/python2.7/site-packages/hgext/inotify/linuxserver.pyR3ss	 
cCs|jj�dS(N(Rtclose(R/((s?/usr/lib64/python2.7/site-packages/hgext/inotify/linuxserver.pyR4}scst�fd��jD��S(sm
        Returns a sorted list of relatives paths currently watched,
        for debugging purposes.
        c3s |]}|d�jVqdS(iN(Rk(t.0ttuple(R/(s?/usr/lib64/python2.7/site-packages/hgext/inotify/linuxserver.pys	<genexpr>�s(tsortedR(R/((R/s?/usr/lib64/python2.7/site-packages/hgext/inotify/linuxserver.pytdebug�sN("RLRMRNRrR�R�RsR�R�R�R�tIN_MOVE_SELFt
IN_ONLYDIRR�RpR\RhRqRtR`RZR�R�R�R�R�R�R�RER=R�R3R4R�(((s?/usr/lib64/python2.7/site-packages/hgext/inotify/linuxserver.pyR[�s(E						
				)	
	tsocketlistenercBs;eZdZd�Zd�Zd�Zd�Zd�ZRS(s@
    Listens for client queries on unix socket inotify.sock
    cCs0tjj|||||�|jd|�dS(NR:(RR�R\R6(R/R&RaR[R:((s?/usr/lib64/python2.7/site-packages/hgext/inotify/linuxserver.pyR\�scCs
tj�dS(N(RtTimeoutException(R/((s?/usr/lib64/python2.7/site-packages/hgext/inotify/linuxserver.pyR3�scCsx|D]}|j�qWdS(N(taccept_connection(R/R1te((s?/usr/lib64/python2.7/site-packages/hgext/inotify/linuxserver.pyRE�s
cCs|jj�|jj�dS(N(tsockR�tcleanup(R/((s?/usr/lib64/python2.7/site-packages/hgext/inotify/linuxserver.pyR4�s
cCs/|jjr|jj�ntjj||�S(N(R[R:R3RR�tanswer_stat_query(R/tcs((s?/usr/lib64/python2.7/site-packages/hgext/inotify/linuxserver.pyR��s(RLRMRNR\R3RER4R�(((s?/usr/lib64/python2.7/site-packages/hgext/inotify/linuxserver.pyR��s				tmastercBs&eZdd�Zd�Zd�ZRS(cCs=||_t|||�|_t|||j|�|_dS(N(R&R[R�(R/R&RRaR:((s?/usr/lib64/python2.7/site-packages/hgext/inotify/linuxserver.pyR\�s	cCsCx<tjj�D]+}y|j�Wqtjk
r:qXqWdS(N(R-R8R>R4RtSignalInterrupt(R/RH((s?/usr/lib64/python2.7/site-packages/hgext/inotify/linuxserver.pyR4�s
cCsP|jj�|jjtd��tjd�rBtjd�nt	j
�dS(Nsfinished setup
tTIME_STARTUPi(R[RtR&RjRtostgetenvR�R�R-RK(R/((s?/usr/lib64/python2.7/site-packages/hgext/inotify/linuxserver.pyRK�s

N(RLRMR=R\R4RK(((s?/usr/lib64/python2.7/site-packages/hgext/inotify/linuxserver.pyR��s	(tmercurial.i18nRt	mercurialRRRRR
R�R?RR�RdtlinuxRrRtImportErrorRR,tobjectR-RZR[R�R�(((s?/usr/lib64/python2.7/site-packages/hgext/inotify/linuxserver.pyt<module>	sH
		A	�

MMCT - 2023