-=[ Mr. Bumblebee ]=-
_Indonesia_

Path : /usr/lib/python2.7/dist-packages/mercurial/hgweb/
File Upload :
Current File : //usr/lib/python2.7/dist-packages/mercurial/hgweb/hgwebdir_mod.pyc

ó
Ì\,Tc@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((s@/usr/lib/python2.7/dist-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((s@/usr/lib/python2.7/dist-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((s@/usr/lib/python2.7/dist-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((s@/usr/lib/python2.7/dist-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=((s@/usr/lib/python2.7/dist-packages/mercurial/hgweb/hgwebdir_mod.pyt__init__Ts
				cCsi|j|jtjƒkr dS|jr;|jjƒ}n8tjƒ}|jddddƒ|jddddƒt|jt	t
tfƒsDidd6}tj
j|jƒsÏtjtd	ƒ|jƒ‚n|j|jd
|dtƒg}x˜|jdƒD]<\}}x-|jd|ƒD]}|j||fƒq WqWnHt|jt
tfƒrh|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ƒr1|d}n|j)dƒrM|d }n||_*tjƒ|_dS(NRtreport_untrustedtoffR;tnonttyttrueshgweb-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((s@/usr/lib/python2.7/dist-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((s@/usr/lib/python2.7/dist-packages/mercurial/hgweb/hgwebdir_mod.pytrunscCst||ƒ}|j|ƒS(N(Rtrun_wsgi(RBtenvtrespondtreq((s@/usr/lib/python2.7/dist-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((s@/usr/lib/python2.7/dist-packages/mercurial/hgweb/hgwebdir_mod.pytread_allowed›s	cCs zyÒ|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â|
r^|	j|
ƒ}|r2|
|jd<y2tj|j	jƒ|ƒ}t|ƒj|ƒSWq2tk
r}
|
j}t t!|ƒ‚q2t"j#k
r.}
t t!t|
ƒƒ‚q2Xn|
j$dƒ}|d	krQPn|
| }
q}W|d}g|	D]}|j|ƒrp|^qpr´|jt|ƒ|j|||ƒS|jt%|ƒ|d
d|ƒSWn9t k
r}|j||ƒ|dd|j&pdƒSXWdd}XdS(Nt	PATH_INFOR2RtmimetypeRsstatic/tstaticiiRKRut	REPO_NAMEtnotfoundReR('RARoRhRRRt	stringifyR6tformRR]R?R R^RTR7RRtjoinR
RpRt	makeindexRUR*Rt
repositoryRRRRntIOErrortstrerrorRRRt	RepoErrortrfindRtmessage(RBRqtvirtualttmpltctypetfnameR{ttptpR*tvirtualrepotrealRetinsttmsgtuptsubdirtrterr((s@/usr/lib/python2.7/dist-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((s@/usr/lib/python2.7/dist-packages/mercurial/hgweb/hgwebdir_mod.pytarchivelistùs'	R2c;sˆˆjjddtƒ}ˆjjddtƒ}tƒ}tƒ}x?ˆjD]4\}}|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ƒ}
|rQy t|ƒtjƒdf}Wntk
rÕqLnXid
d6d
d6|dd
6|d6|
d6d
d6d
d6|d6|d|dd6gd6td6}|j|ƒ|VqLnˆjjƒ‰y#ˆjtjj	|ddƒƒWn3tk
r¸}ˆjtdƒ||fƒqLnXd‡fd†}ˆjdddtƒréqLnˆjˆˆƒsqLnytjˆj|ƒ}WnXtk
rGˆjtdƒ|ƒqLn.t j!k
rtˆjtdƒ|ƒqLnXy#t|j"ƒtjƒdf}Wntk
r®qLnXt#|ƒ}|ddd
ƒ}|dd
|ƒ}i|pëdd6|j$ƒpþdd6|d
6|d6|
d6|p dd6|j$ƒp3dd6|d6|d|dd6ˆˆd|
ƒd6dd6}|j|ƒ|VqLWdS(NRKtdescendtcollapseRiiRytSCRIPT_NAMEs/+R2tcontacttcontact_sortRt	name_sortR3tdescriptiontdescription_sortt
lastchangetlastchange_sortR¡tisdirectorys.hgthgrcserror reading %s/.hg/hgrc: %s
csˆj|||dtƒS(NRu(R]R!(tsectionRtdefault(R9(s@/usr/lib/python2.7/dist-packages/mercurial/hgweb/hgwebdir_mod.pyRhNsthiddenRus!error accessing repository at %s
tunknownttip(%RRžR!R tsetR*R6R0RR€RotinserttrstriptretsubR	RtmakedatetOSErrortaddRRRZRRt	ExceptiontwarnRR?RxRR‚RƒRR…tspathR
tupper(R“RcR¤R¥t	seenrepostseendirsRRt	directoryt	namepartstrootnamet	discardedtpartsR3tdtrowteRhR”R§Rª(R£RqRB(R9s@/usr/lib/python2.7/dist-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(s@/usr/lib/python2.7/dist-packages/mercurial/hgweb/hgwebdir_mod.pyt<lambda>~streversetparity(tsortedR—RR_(t
sortcolumnt
descendingR“RctrowsRÉRÑ(RËRBtsortdefault(RÎs@/usr/lib/python2.7/dist-packages/mercurial/hgweb/hgwebdir_mod.pytentriesys
%
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Ös@/usr/lib/python2.7/dist-packages/mercurial/hgweb/hgwebdir_mod.pyR÷s,	
u

C
	cs¯‡‡fd†}dt‡fd†‰ˆj|jƒ|jjddƒ}|jdƒsh|d7}ni}|jjddgƒdˆddƒd	f}tj|ˆj	ƒ\}}||dkrÔ||d<n|d
dkrêdpíd}t
j||ƒ}	ˆdd
dƒ}
ˆdddƒ}ˆddƒp<|d}|jdƒs[|d7}ntj|ditjd6|d6|d6|
d
6|d6|d6|	d6|d6ƒ}
|
S(Nc;s/ˆjdk	rˆjVnˆdddƒVdS(NRKR@R2(R@R?(Rc(R]RB(s@/usr/lib/python2.7/dist-packages/mercurial/hgweb/hgwebdir_mod.pyR@žscsˆjj||||ƒS(N(RR](R°RR±Ru(RB(s@/usr/lib/python2.7/dist-packages/mercurial/hgweb/hgwebdir_mod.pyR]¤sR¦R2RRLiRKRMiÿÿÿÿt?t&tlogourlshttp://mercurial.selenic.com/tlogoimgs
hglogo.pngt	staticurlsstatic/tdefaultsRR@R3tsessionvars(
R?R!RÜRoRhRbRRtstylemapR^twebutilRåR(RBRqR@R3tvarststylesRLtmapfiletstartRåRáRâRãR‰((R]RBs@/usr/lib/python2.7/dist-packages/mercurial/hgweb/hgwebdir_mod.pyRœs<
	



cCsS|jdk	rOt|j|dƒ\}}}||d<||d<||d<ndS(NtSERVER_PORTtSERVER_NAMER¦(RaR?R:(RBRoRR5R((s@/usr/lib/python2.7/dist-packages/mercurial/hgweb/hgwebdir_mod.pyRÜËs


N(
t__name__t
__module__RPR?RCRARmRrRxRnRRRÜ(((s@/usr/lib/python2.7/dist-packages/mercurial/hgweb/hgwebdir_mod.pyR;Qs	5				F¥	/(#RR¸RQtmercurial.i18nRt	mercurialRRRRRRRtcommonRR	R
RRR
RRRt	hgweb_modRRtrequestRRçRR/R(R:tobjectR;(((s@/usr/lib/python2.7/dist-packages/mercurial/hgweb/hgwebdir_mod.pyt<module>	s$(@				

Copyright © 2017 || Recoded By Mr.Bumblebee