KGRKJGETMRETU895U-589TY5MIGM5JGB5SDFESFREWTGR54TY
Server : Apache
System : Linux cs317.bluehost.com 4.19.286-203.ELK.el7.x86_64 #1 SMP Wed Jun 14 04:33:55 CDT 2023 x86_64
User : andertr9 ( 1047)
PHP Version : 8.2.18
Disable Function : NONE
Directory :  /lib64/python2.7/site-packages/hgext/inotify/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Current File : //lib64/python2.7/site-packages/hgext/inotify/server.pyc
�
Hq�Qc@s^ddlmZddlmZmZmZmZddlZddlZddl	Z	ddl
Z
ddlZddlZddl
Z
defd��YZdefd��YZd�Zd	�ZejejfZd
�Zdefd��YZd
efd��YZdefd��YZe
jjd�rBddlZne�ej Z d�Z!dS(i����(t_(tcmdutiltposixtosutiltutilNtAlreadyStartedExceptioncBseZRS((t__name__t
__module__(((s:/usr/lib64/python2.7/site-packages/hgext/inotify/server.pyRstTimeoutExceptioncBseZRS((RR(((s:/usr/lib64/python2.7/site-packages/hgext/inotify/server.pyRscCs.|r*|ddkr||S|d|S|S(Ni����t/((tatb((s:/usr/lib64/python2.7/site-packages/hgext/inotify/server.pytjoins
cCs;|jd�}|dkr%d|fS|| ||dfS(NR	i����ti(trfind(tpathtc((s:/usr/lib64/python2.7/site-packages/hgext/inotify/server.pytsplits
cs(���fd���||dk�S(s,Like os.walk, but only yields regular files.c
3sCgg}}y�t�|�}x�tj|�D]�\}}|tjkr�|dkrc|s�dSq�|j|�t||�}�j|�r�q/nxG�|t�D]}|Vq�Wq/|tjtj	fkr/|j|�q/q/W|||fVWnKt
k
r>}	|	jtjkr&|||fVq?|	jt
kr?�q?nXdS(Ns.hg(RRtlistdirtstattS_IFDIRtappendt_ignoretFalsetS_IFREGtS_IFLNKtOSErrorterrnotENOTDIRtwalk_ignored_errors(
troottreporoottfilestdirstfullpathtnametkindRtresultterr(tabsroottdirstatetwalkit(s:/usr/lib64/python2.7/site-packages/hgext/inotify/server.pyR),s,

R
((R(R'R((R'R(R)s:/usr/lib64/python2.7/site-packages/hgext/inotify/server.pytwalk'st	directorycBs8eZdZdd�Zd�Zdd�Zd�ZRS(s[
    Representing a directory

    * path is the relative path from repo root to this directory
    * files is a dict listing the files in this directory
        - keys are file names
        - values are file status
    * dirs is a dict listing the subdirectories
        - key are subdirectories names
        - values are directory objects
    R
cCs||_i|_i|_dS(N(RR R!(tselftrelpath((s:/usr/lib64/python2.7/site-packages/hgext/inotify/server.pyt__init__Ws		cCs�|s
|S|jd�}|}xi|r�|jd�}y|j|}Wq"tk
r�tt|j|��}||j|<|}q"Xq"W|S(s�
        Returns the directory contained at the relative path relpath.
        Creates the intermediate directories if necessary.
        R	i(RtpopR!tKeyErrorR+RR(R,R-tltrettnexttd((s:/usr/lib64/python2.7/site-packages/hgext/inotify/server.pytdir\s	

ccs�xC|jj�D]2\}}||krt|j|�|fVqqWxU|jj�D]D}|dk	r{|j|j�nx|j|�D]}|Vq�WqVWdS(s�
        yield (filename, status) pairs for items in the trees
        that have status in states.
        filenames are relative to the repo root
        N(	R t	iteritemsRRR!t
itervaluestNonetaddR*(R,tstatestvisitedtfiletstR5te((s:/usr/lib64/python2.7/site-packages/hgext/inotify/server.pyR*osccs)|ddkr|d }n|jd�}|j�}|}y"x|D]}|j|}qHWWn"tk
r�|j|j�dSXyI|j|}|j|j�x%|j||�D]\}	}
|	Vq�WWnTtk
r$y/|j||kr|j|j�|VnWq%tk
r q%XnXdS(s�
        yield root-relative filenames that match path, and whose
        status are in states:
        * if path is a file, yield path
        * if path is a directory, yield directory files
        * if path is not tracked, yield nothing
        i����R	N(RR/R!R0R9RR*R (R,R:RR;tpathstlastttreeR5ttargetR<R=((s:/usr/lib64/python2.7/site-packages/hgext/inotify/server.pytlookup~s.






N(RRt__doc__R.R5R8R*RC(((s:/usr/lib64/python2.7/site-packages/hgext/inotify/server.pyR+Ks
	trepowatchercBsweZdZdZd�Zd�Zd�Zd�Zd�Zd�Z	d�Z
d	�Zd
�Zd�Z
d�ZRS(
s 
    Watches inotify events
    salmr!?cCs�||_||_t|d�|_t|j�|_t�|_i|_t	g|j
D]}|t�f^qX�|_|j�|_
d|_dS(NR
(tuiR(Rtwprefixtlent	prefixlenR+RAt	statcachetdictt
statuskeyststatustreest
dirstate_infotds_infoR8t
last_event(R,RFR(Rts((s:/usr/lib64/python2.7/site-packages/hgext/inotify/server.pyR.�s			.cCsdS(N((R,((s:/usr/lib64/python2.7/site-packages/hgext/inotify/server.pythandle_timeout�scCs]y*tj|jd�}|j|jfSWn,tk
rX}|jtjkrT�ndSXdS(Ns.hg/dirstatei(ii(tostlstatRGtst_mtimetst_inoRRtENOENT(R,R=R&((s:/usr/lib64/python2.7/site-packages/hgext/inotify/server.pyRN�sc
Cs�y$|jj|d \}}}}Wntk
r=d}nX|dkr�|\}}}	|dkridS|r�||ks�||Ad@r�dS|t|	�kr�dSdS|dkr�|jj|�r�dS|S(	Nit?tni����R1i@tmti(R(t_mapR0tintt
_dirignore(
R,tfnR=ttype_tmodetsizettimetst_modetst_sizeRU((s:/usr/lib64/python2.7/site-packages/hgext/inotify/server.pyt
filestatus�s $

 cCs |j||j||��dS(s�
        update the file entry of an existing file.

        osstat: (mode, size, time) tuple, as returned by os.lstat(wfn)
        N(t
_updatestatusRf(R,twfntosstat((s:/usr/lib64/python2.7/site-packages/hgext/inotify/server.pyt
updatefile�scCsW|dkrd}n|dkr*d}nd}|jj|d�|j||�dS(s�
        update the entry of a file which has been deleted.

        oldstatus: char in statuskeys, status of the file before deletion
        trtalmnt!N(R8RJR/Rg(R,Rht	oldstatust	newstatus((s:/usr/lib64/python2.7/site-packages/hgext/inotify/server.pyt
deletefile�s		cCs t|�\}}|jj|�}|jj|�}|jjrt||krt|jjtd�|||f�n|r�||j	kr�||kr�|j
|j|�j|=n|dkr�|jj|d�nH||kr||j|<|dkr||j
|j|�j|<qndS(s�
        Update the stored status of a file.

        newstatus: - char in (statuskeys + 'ni'), new status to apply.
                   - or None, to stop tracking wfn
        sstatus: %r %s -> %s
R[RYN(NR[(
RRAR5R tgetRFt	debugflagtnoteRRLRMR8R/(R,RhRoRR_R4Rn((s:/usr/lib64/python2.7/site-packages/hgext/inotify/server.pyRg�s
cCs�g}xC|j|j|�D]+\}}||jkr|j|�qqWxP|D]H}t|�\}}|j|j|�j|=|jj|�j|=qSWdS(N(RMR*R(RRR5R RA(R,tkeytnukeRhtignoreRR_((s:/usr/lib64/python2.7/site-packages/hgext/inotify/server.pyt
check_deleteds#
cCsSd|jjkrOt|jd�|jjtd��|j�|j�ndS(NRs#rescanning due to .hgignore change
(R(t__dict__tdelattrRFRsRRRtscan(R,((s:/usr/lib64/python2.7/site-packages/hgext/inotify/server.pytupdate_hgignore s

cCsfy|j|SWnPtk
ray|j|�SWqbtk
r]}|jtjkr^�q^qbXnXdS(N(RJR0RRRRW(R,twpathR&((s:/usr/lib64/python2.7/site-packages/hgext/inotify/server.pytgetstat1s
cCsvyHtjt|j|��}|j|j|jf}||j|<|SWn'tk
rq|jj	|d��nXdS(N(RSRTRRGRdReRURJRR/R8(R,R|R=R2((s:/usr/lib64/python2.7/site-packages/hgext/inotify/server.pyR;s

(RRRDRLR.RRRNRfRjRpRgRwR{R}R(((s:/usr/lib64/python2.7/site-packages/hgext/inotify/server.pyRE�s												
tsocketlistenercBs2eZdZd�Zd�Zd�Zd�ZRS(s@
    Listens for client queries on unix socket inotify.sock
    cs�||_||_y"tj�fd�d�|_WnJttjfk
r�}|jdt	j
krzttd���n�nX|jj
|_
dS(Ncstjj�d|�S(Ns.hg(RSRR(tp(R(s:/usr/lib64/python2.7/site-packages/hgext/inotify/server.pyt<lambda>Nstinotifyis%cannot start: socket is already bound(RFRERtunixdomainservertsockRtsocketterrortargsRt
EADDRINUSERRtfileno(R,RFRREttimeoutR&((Rs:/usr/lib64/python2.7/site-packages/hgext/inotify/server.pyR.Is		csH|j�jd���j�}|jjtd�|�t���sVd�}n��fd�}g|d|jjd�|d|jjd�|d|jjd�|d|jjd�|d	|jjd	�d
|kr�|d
|jjd
�pggd|kr%|d|jj	�p(g�g	D]}dj
|�^q/S(
Ntsanswering query for %r
css)x"|j|�D]\}}|VqWdS(N(R*(R:RAR_tstate((s:/usr/lib64/python2.7/site-packages/hgext/inotify/server.pyt	genresult`sc3s:x3�D]+}x"|j||��D]}|Vq#WqWdS(N(RC(R:RAR_tf(tnamesR;(s:/usr/lib64/python2.7/site-packages/hgext/inotify/server.pyR�ds
R1RZR
RkRmRXRRY(treadRR/RFRsRtsetRERMRAR(R,tcsR:R�Rk((R�R;s:/usr/lib64/python2.7/site-packages/hgext/inotify/server.pytanswer_stat_queryWs&	$cCsdj|jj��gS(NR�(RREtdebug(R,((s:/usr/lib64/python2.7/site-packages/hgext/inotify/server.pytanswer_dbug_querywsc	Cs�|jj�\}}tj|�}t|jd��}|tjkr�|jjt	d�|�y|j
ttj��Wntj
k
r�nXdS|jd�}|dkr�|j|�}n9|dkr�|j�}n|jjt	d�|�dSyrzZttj�}|j
||tjtj|tt|���|j
dj|��Wd|jtj�XWn2tj
k
r�}|jdtjkr��q�nXdS(	Nis3received query from incompatible client version %d
itSTATtDBUGsunrecognized query type: %s
R
i(R�taccepttcommontrecvcstordR�tversionRFtwarnRtsendalltchrR�R�R�R�tstructtpacktresphdrfmtstmapRHRtshutdowntSHUT_WRR�RtEPIPE(	R,R�taddrR�R�ttypetresultstvR&((s:/usr/lib64/python2.7/site-packages/hgext/inotify/server.pytaccept_connectionzs8(RRRDR.R�R�R�(((s:/usr/lib64/python2.7/site-packages/hgext/inotify/server.pyR~Es
		 	tlinuxc	s\|jd���r(t��d�nd�dtf����fd��Y}dtjkr~tj�dd�g}ntj�tjd}�jdd	�}|d
r�|dk	r�d|kr�|j	d|�n|�}�jdd
�}�j
ddt�}�jddj
|��tj|d|jd|jd|d|d|�dS(Ntidle_timeouti`�tservicecs)eZ����fd�Zd�ZRS(csIyt�����|_Wn&tk
rD}tjd|��nXdS(Nsinotify-server: %s(tmasterRRtAbort(R,tinst(R(RR�RF(s:/usr/lib64/python2.7/site-packages/hgext/inotify/server.pytinit�scSs>z)y|jj�Wntk
r'nXWd|jj�XdS(N(R�trunRR�(R,((s:/usr/lib64/python2.7/site-packages/hgext/inotify/server.pyR��s
(RRR�R�((R(RR�RF(s:/usr/lib64/python2.7/site-packages/hgext/inotify/server.pyR��stinserves-RiR�tpidfiletdaemonspid-files
--pid-file=%stlogt	appendpidsstarting inotify server: %s
t tinitfntrunfntlogfiletrunargs(RqtfloatR8tobjecttsystargvRthgcmdtconfigRt
configboolRR�RRR�R�R�(	RFR(RtoptsR�R�R�R�R�((R(RR�RFs:/usr/lib64/python2.7/site-packages/hgext/inotify/server.pytstart�s"%"	("tmercurial.i18nRt	mercurialRRRRR�RRSR�RR�R�t	ExceptionRRRRRWtENAMETOOLONGRR*R�R+RER~tplatformt
startswithtlinuxservert_servertImportErrorR�R�(((s:/usr/lib64/python2.7/site-packages/hgext/inotify/server.pyt<module>s,"			$\�]	

Anon7 - 2021