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/mercurial/hgweb/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Current File : //lib64/python2.7/site-packages/mercurial/hgweb/hgwebdir_mod.pyo
�
Hq�Qc@s"ddlZddlZddlZddlmZddlmZmZmZm	Z	m
Z
ddlmZmZddl
mZmZmZmZmZmZmZmZmZddlmZmZddlmZddlZd�Zd	�Zd
�Zd�Z de!fd
��YZ"dS(i����N(t_(tuithgtscmutiltutilt	templater(terrortencoding(	t
ErrorResponset	get_mtimet
staticfilet	paritygentismembertget_contacttHTTP_OKtHTTP_NOT_FOUNDtHTTP_SERVER_ERROR(thgwebtmakebreadcrumb(twsgirequestcCs5g|D]*\}}tj|�jd�|f^qS(Nt/(Rtpconverttstrip(titemstnametpath((sB/usr/lib64/python2.7/site-packages/mercurial/hgweb/hgwebdir_mod.pyt
cleannamesscCs�g}x�t|�D]�\}}tjj|�\}}yitd6td6|}Wn'tk
r||j||f�qnXtjjtjj	|��}t
j|dtd|�}|jt
|||��qW|S(Nt*s**t	followsymtrecurse(RtosRtsplittFalsetTruetKeyErrortappendtnormpathtabspathRt	walkrepostextendturlrepos(tpathstrepostprefixtroottrootheadtroottailR((sB/usr/lib64/python2.7/site-packages/mercurial/hgweb/hgwebdir_mod.pyt	findreposs
ccs_xX|D]P}tjj|�}|dtj|t|��jd�jd�|fVqWdS(s�yield url paths and filesystem paths from a list of repo paths

    >>> conv = lambda seq: [(v, util.pconvert(p)) for v,p in seq]
    >>> conv(urlrepos('hg', '/opt', ['/opt/r', '/opt/r/r', '/opt']))
    [('hg/r', '/opt/r'), ('hg/r/r', '/opt/r/r'), ('hg', '/opt')]
    >>> conv(urlrepos('', '/opt', ['/opt/r', '/opt/r/r', '/opt']))
    [('r', '/opt/r'), ('r/r', '/opt/r/r'), ('', '/opt')]
    RN(RRR$RRtlentlstripR(R+R-R)R((sB/usr/lib64/python2.7/site-packages/mercurial/hgweb/hgwebdir_mod.pyR((s	
cCsqtj|�}|jpd}|jr3|j}n|jp?d}|jd�s^d|}n|t|�|fS(s�
    Extract CGI variables from baseurl

    >>> geturlcgivars("http://host.org/base", "80")
    ('host.org', '80', '/base')
    >>> geturlcgivars("http://host.org:8000/base", "80")
    ('host.org', '8000', '/base')
    >>> geturlcgivars('/base', 8000)
    ('', '8000', '/base')
    >>> geturlcgivars("base", '8000')
    ('', '8000', '/base')
    >>> geturlcgivars("http://host", '8000')
    ('host', '8000', '/')
    >>> geturlcgivars("http://host/", '8000')
    ('host', '8000', '/')
    tR(RturlthosttportRt
startswithtstr(tbaseurlR5tuRR((sB/usr/lib64/python2.7/site-packages/mercurial/hgweb/hgwebdir_mod.pyt
geturlcgivars6s	
thgwebdircBseeZdZdd�Zd�Zd�Zd�Zd�Zd�Z	dd�Z
d	�Zd
�ZRS(icCs2||_||_d|_d|_|j�dS(Ni(tconftbaseuitlastrefreshtNonetmotdtrefresh(tselfR<R=((sB/usr/lib64/python2.7/site-packages/mercurial/hgweb/hgwebdir_mod.pyt__init__Ts
				cCsc|j|jtj�kr dS|jr;|jj�}n2tj�}|jddd�|jddd�t|jt	t
tf�s>idd6}tj
j|j�s�tjtd�|j��n|j|jd	|d
t�g}x�|jd�D]<\}}x-|jd|�D]}|j||f�qWq�WnHt|jt
tf�rb|j}n$t|jt	�r�|jj�}nt|�}x�|jd�D]�\}}	tj|�}x|tj|	dt�D]e}tj
j|�}
tj|
�}|j|�r|t|�}n|j|jd
�|
f�q�Wq�W||_ ||_|jj!ddt"j"�t"_"|jj!ddd�|_#|jj!ddd�|_%|jj!ddd�|_&|j&r�t'|j&�|_&n|jj!dd�|_(|jj!ddd�}|jd
�r+|d}n|j)d
�rG|d }n||_*tj�|_dS(NRtreport_untrustedtofftnonttyttrueshgweb-pathsR)sconfig file %s not found!tremapttrusttcollectionsRRtwebRtstyletpapert	templateststripesiR8R+R2i����(+R>trefreshintervalttimeR=tcopyRt	setconfigt
isinstanceR<tdicttlistttupleRRtexistsRtAbortRt
readconfigR!tconfigitemst
configlistR#RR/RRR&R$R6R0R1R*tconfigRRLR?ttemplatepathtstripecounttintt_baseurltendswithR+(RBR9tmapR)RtignoredRR*R+R,trepo((sB/usr/lib64/python2.7/site-packages/mercurial/hgweb/hgwebdir_mod.pyRA[s\	
$			

	cCsPtjjdd�jd�s-td��nddljj}|j|�dS(NtGATEWAY_INTERFACER2sCGI/1.sJThis function is only intended to be called while running as a CGI script.i����(	RtenvirontgetR6tRuntimeErrortmercurial.hgweb.wsgicgiRtwsgicgitlaunch(RBRk((sB/usr/lib64/python2.7/site-packages/mercurial/hgweb/hgwebdir_mod.pytrun�scCst||�}|j|�S(N(Rtrun_wsgi(RBtenvtrespondtreq((sB/usr/lib64/python2.7/site-packages/mercurial/hgweb/hgwebdir_mod.pyt__call__�scCs�|jjd�}|jdddt�}|rM|sIt|||�rMtS|jdddt�}|s~t|||�r�tStS(sCheck allow_read and deny_read config options of a repo's ui object
        to determine user permissions.  By default, with neither option set (or
        both empty), allow all users to read the repo.  There are two ways a
        user can be denied read access:  (1) deny_read is not empty, and the
        user is unauthenticated or deny_read contains user (or *), and (2)
        allow_read is not empty and the user is not in allow_read.  Return True
        if user is allowed to read the repo, else return False.tREMOTE_USERRKt	deny_readt	untrustedt
allow_read(RoRhR\R!RR (RBRRqtuserRtRv((sB/usr/lib64/python2.7/site-packages/mercurial/hgweb/hgwebdir_mod.pytread_allowed�s	cCszy�|j�|jjdd�jd�}|j|�}|ddtj�}tj|�}|jd�sd|jkr?|jd�r�|d}n|jdd	}|j	j
d
dddt�}|s+|j
p�tj
�}t|t�r|g}ng|D]}tjj|d�^q}nt|||�gS|se|jt|�|j||�St|j�}	|}
x�|
rX|	j|
�}|r,|
|jd<y,tj|j	|�}t|�j|�SWq,tk
r�}
|
j}tt |��q,t!j"k
r(}
tt t|
���q,Xn|
j#d�}|d	krKPn|
| }
q}W|d}g|	D]}|j|�rj|^qjr�|jt|�|j|||�S|jt$|�|d
d|�SWn9tk
r
}|j||�|dd|j%pd�SXWdd}XdS(Nt	PATH_INFOR2RtmimetypeRsstatic/tstaticiiRKRut	REPO_NAMEtnotfoundReR(&RARoRhRRRt	stringifyR6tformRR]R?R R^RTR7RRtjoinR
RpRt	makeindexRUR*Rt
repositoryRRntIOErrortstrerrorRRRt	RepoErrortrfindRtmessage(RBRqtvirtualttmpltctypetfnameR{ttptpR*tvirtualrepotrealRetinsttmsgtuptsubdirtrterr((sB/usr/lib64/python2.7/site-packages/mercurial/hgweb/hgwebdir_mod.pyRn�sf

	+	
	
(R2c
snd��d���fd��dtf�dtd���fd�}�j�ddddg}�\}}d	�jkr��jd	d
}|jd�}|r�|d}n||kr�d}q�ng|D]9}d
|d|r�||kr�dpd|ff^q�}	�j��j�j�|dd|d|dtd|�j�d|d|t	|	��S(NcSs�|jdddt�}g}x{dddgD]j}|d
|ksd|jdd|d
dt�r.|ji|d
d6|d
d6|d6|d6�q.q.W|S(NRKt
allow_archiveRutzips.ziptgzs.tar.gztbz2s.tar.bz2itallowttypeit	extensiontnodeR3(szips.zip(R�s.tar.gz(sbz2s.tar.bz2(R\R!t
configboolR#(RtnodeidR3tallowedtarchivesti((sB/usr/lib64/python2.7/site-packages/mercurial/hgweb/hgwebdir_mod.pytarchivelist�s'	R2c;sr�jjddt�}�jjddt�}t�}t�}x)�jD]\}}|j|�smqLn|t|�}t}d|kr|s�qLn|jd�}	|	d}
|s�q|
|kr�qLq|
|kr�qt}|
}dj	|	d�}|t|�d }n|g}d�j
krP|jd�j
djd��n�j
drw|jd�j
d�nt
jd	ddj	|�d�}
|rIy t|�tj�df}Wntk
r�qLnXtd
dddd
|dd|d|
ddddd|d|d|ddgdt�}|j|�|VqLn�jj��y#�jtjj	|dd��Wn3tk
r�}�jtd�||f�qLnXd�fd�}�jdddt�r�qLn�j���s�qLnytj�j|�}WnXt k
r?�jtd�|�qLn.t!j"k
rl�jtd�|�qLnXy#t|j#�tj�df}Wntk
r�qLnXt$|�}|ddd�}|dd
|�}td
|p�dd|j%�p�dd
|d|d|
d|pdd|j%�p(dd|d|d|dd��d|
��
}|j|�|VqLWdS(NRKtdescendtcollapseRiiRytSCRIPT_NAMEs/+tcontactR2tcontact_sortRt	name_sortR3tdescriptiontdescription_sortt
lastchangetlastchange_sortR�tisdirectorys.hgthgrcserror reading %s/.hg/hgrc: %s
cs�j|||dt�S(NRu(R]R!(tsectionRtdefault(R9(sB/usr/lib64/python2.7/site-packages/mercurial/hgweb/hgwebdir_mod.pyRhMsthiddenRus!error accessing repository at %s
tunknownttip(&RR�R!R tsetR*R6R0RR�RotinserttrstriptretsubR	RtmakedatetOSErrorRUtaddRRRZRRt	ExceptiontwarnRR?RxRR�R�RR�tspathR
tupper(R�RcR�R�t	seenrepostseendirsRRt	directoryt	namepartstrootnamet	discardedtpartsR3tdtrowteRhR�R�R�(R�RqRB(R9sB/usr/lib64/python2.7/site-packages/mercurial/hgweb/hgwebdir_mod.pyt
rawentriess�		
	#
" 

	
#
#

c;s��d||�}|rX�||fkrXd|�t|d�fd�d|�}nx5t|t�j��D]\}}||d<|VqqWdS(NR�s%s_sorttkeycs|�S(N((tx(tsortkey(sB/usr/lib64/python2.7/site-packages/mercurial/hgweb/hgwebdir_mod.pyt<lambda>{streversetparity(tsortedR�RR_(t
sortcolumnt
descendingR�RctrowsR�R�(R�RBtsortdefault(R�sB/usr/lib64/python2.7/site-packages/mercurial/hgweb/hgwebdir_mod.pytentriesvs
%
RR�R�R�tsortit-issort_%ss%s%stindexR�R�tpathdefRR�R�(
R?R RARR6tupdatereqenvRoRR+RU(
RBRqR�R�R�tsortableR�R�tcolumnR�((R�R�RqRBR�sB/usr/lib64/python2.7/site-packages/mercurial/hgweb/hgwebdir_mod.pyR��s,	
s

C
	c	s��fd�}�fd�}��fd�}dt�fd���j|j�|jjdd�}|jd�s�|d7}ni}|jjddg�d	�d
d�df}tj|�j	�\}}	||d	kr�||d<n|dd
krdpd
}
t
j||
�}�d
dd�}�d
dd�}
�d
d�pZ|d}|jd�sy|d7}ntj|	di|d6|d6|d6|d6|d6|
d6|d6|d6���S(Nc;s�ddtj|�VdS(NtheaderR(R(Rc(R�(sB/usr/lib64/python2.7/site-packages/mercurial/hgweb/hgwebdir_mod.pyR��sc;s�d|�VdS(Ntfooter((Rc(R�(sB/usr/lib64/python2.7/site-packages/mercurial/hgweb/hgwebdir_mod.pyR��sc;s/�jdk	r�jVn�ddd�VdS(NRKR@R2(R@R?(Rc(R]RB(sB/usr/lib64/python2.7/site-packages/mercurial/hgweb/hgwebdir_mod.pyR@�scs�jj||||�S(N(RR](R�RR�Ru(RB(sB/usr/lib64/python2.7/site-packages/mercurial/hgweb/hgwebdir_mod.pyR]�sR�R2RRLiRKRMi����t?t&tlogourlshttp://mercurial.selenic.com/tlogoimgs
hglogo.pngt	staticurlsstatic/tdefaultsR�R�R@R3tsessionvars(R?R!R�RoRhRbRRtstylemapR^twebutilR�(RBRqR�R�R@R3tvarststylesRLtmapfiletstartR�R�R�R�((R]RBR�sB/usr/lib64/python2.7/site-packages/mercurial/hgweb/hgwebdir_mod.pyR�s@
	



cCsS|jdk	rOt|j|d�\}}}||d<||d<||d<ndS(NtSERVER_PORTtSERVER_NAMER�(RaR?R:(RBRoRR5R((sB/usr/lib64/python2.7/site-packages/mercurial/hgweb/hgwebdir_mod.pyR��s


N(
t__name__t
__module__RPR?RCRARmRrRxRnR�RR�(((sB/usr/lib64/python2.7/site-packages/mercurial/hgweb/hgwebdir_mod.pyR;Qs	5				E�	4(#RR�RQtmercurial.i18nRt	mercurialRRRRRRRtcommonRR	R
RRR
RRRt	hgweb_modRRtrequestRR�RR/R(R:tobjectR;(((sB/usr/lib64/python2.7/site-packages/mercurial/hgweb/hgwebdir_mod.pyt<module>	s$(@				

Anon7 - 2021