-=[ Mr. Bumblebee ]=-
_Indonesia_

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

ó
Ì\,Tc@sðddlZddlZddlZdZdZdZdZdZdZdZ	d	Z
d
„Zd„ZegZ
defd
„ƒYZdefd„ƒYZd„Zdd„Zdd„Zd„Zd„Zdd„Zd„Zd„ZdS(iÿÿÿÿNiÈi0ii‘i“i”i•iôcCs|dgkp||kS(sÒCheck if username is a member of userlist.

    If userlist has a single '*' member, all users are considered members.
    Can be overridden by extensions to provide more complex authorization
    schemes.
    t*((tuitusernametuserlist((s:/usr/lib/python2.7/dist-packages/mercurial/hgweb/common.pytismembersc
Csá|jjdƒ}|jddƒ}|r[|sIt|jj||ƒr[ttdƒ‚n|jddƒ}|ržt|jj||ƒržttdƒ‚n|dkrÆ|jrÆttdƒ‚n|dksÞ|dkrâdS|jd	d
kr
d}tt
|ƒ‚n|jjdƒ}|jdd
tƒrR|dkrRtt
dƒ‚n|jddƒ}|r›|s‰t|jj||ƒr›ttdƒ‚n|jddƒ}	|	oÈt|jj||	ƒsÝttdƒ‚ndS(sšCheck permission for operation based on request data (including
    authentication info). Return if op allowed, else raise an ErrorResponse
    exception.tREMOTE_USERtwebt	deny_readsread not authorizedt
allow_readtpullspull not authorizedNtREQUEST_METHODtPOSTspush requires POST requestswsgi.url_schemetpush_sslthttpssssl requiredt	deny_pushspush not authorizedt
allow_push(tenvtgett
configlistRtrepoRt
ErrorResponsetHTTP_UNAUTHORIZEDt	allowpulltNonetHTTP_METHOD_NOT_ALLOWEDt
configbooltTruetHTTP_FORBIDDEN(
thgwebtreqtoptuserRRtmsgtschemetdenytallow((s:/usr/lib/python2.7/dist-packages/mercurial/hgweb/common.pyt
checkauthzs.%!%RcBs eZdgd„Zd„ZRS(cCsG|dkrt|ƒ}ntj|ƒ||_||_||_dS(N(Rt_statusmessaget	Exceptiont__init__tcodetmessagetheaders(tselfR(R)R*((s:/usr/lib/python2.7/dist-packages/mercurial/hgweb/common.pyR'Ps
		cCs|jS(N(R)(R+((s:/usr/lib/python2.7/dist-packages/mercurial/hgweb/common.pyt__str__WsN(t__name__t
__module__RR'R,(((s:/usr/lib/python2.7/dist-packages/mercurial/hgweb/common.pyROstcontinuereadercBs&eZd„Zdd„Zd„ZRS(cCs||_||_t|_dS(N(tft_writetFalset	continued(R+R0twrite((s:/usr/lib/python2.7/dist-packages/mercurial/hgweb/common.pyR'[s		iÿÿÿÿcCs2|js"t|_|jdƒn|jj|ƒS(NsHTTP/1.1 100 Continue

(R3RR1R0tread(R+tamt((s:/usr/lib/python2.7/dist-packages/mercurial/hgweb/common.pyR5`s		cCs&|dkrt|j|ƒSt‚dS(Ntclosetreadlinet	readlinest__iter__(sclosesreadlines	readliness__iter__(tgetattrR0tAttributeError(R+tattr((s:/usr/lib/python2.7/dist-packages/mercurial/hgweb/common.pyt__getattr__fs(R-R.R'R5R>(((s:/usr/lib/python2.7/dist-packages/mercurial/hgweb/common.pyR/Zs	cCs-ddlm}|j}|j|dƒdS(Niÿÿÿÿ(tBaseHTTPRequestHandlertErrors
Unknown errori(sErrors
Unknown error(tBaseHTTPServerR?t	responsesR(R(R?RB((s:/usr/lib/python2.7/dist-packages/mercurial/hgweb/common.pyR%ks	cCsd||pt|ƒfS(Ns%d %s(R%(R(R)((s:/usr/lib/python2.7/dist-packages/mercurial/hgweb/common.pyt
statusmessagepss
00changelog.icCsEtjj||ƒ}tjj|ƒr4tj|ƒStj|ƒSdS(s@stat fn (00changelog.i by default) if it exists, spath otherwiseN(tostpathtjointexistststat(tspathtfntcl_path((s:/usr/lib/python2.7/dist-packages/mercurial/hgweb/common.pytget_statss
cCs
t|ƒjS(N(RLtst_mtime(RI((s:/usr/lib/python2.7/dist-packages/mercurial/hgweb/common.pyt	get_mtime{scCs¦|jdƒ}xZ|D]R}|dtjtjfksdtj|ksdtjdk	rtj|krdSqWtjj|Œ}t	|t
ƒr™|g}nx9|D]1}tjj||ƒ}tjj|ƒr Pq q Wyetj|ƒt
j|ƒdpûd}t|dƒ}	|	jƒ}
|	jƒ|jt|d|
ƒWnetk
r\ttdƒ‚nFtk
r¡}|jtjkrŒttƒ‚q¢tt|jƒ‚nXdS(	s+return a file inside directory with guessed Content-Type header

    fname always uses '/' as directory separator and isn't allowed to
    contain unusual path components.
    Content-Type is guessed using the mimetypes module.
    Return an empty string if fname is illegal or file not found.

    t/tNis
text/plaintrbtbodysillegal filename(tsplitRDtcurdirtpardirtseptaltsepRRERFt
isinstancetstrRGRHt	mimetypest
guess_typetopenR5R7trespondtHTTP_OKt	TypeErrorRtHTTP_SERVER_ERRORtOSErrorterrnotENOENTtHTTP_NOT_FOUNDtstrerror(t	directorytfnameRtpartstparttfpathtdREtcttfptdataterr((s:/usr/lib/python2.7/dist-packages/mercurial/hgweb/common.pyt
staticfile~s2	
-



iccs€|r/|r/|||}|||d@}nd}d}x>tr{|V|d7}|r>||kr>d|}d}q>q>WdS(s5count parity of horizontal stripes for easier readingiiN(R(tstripecounttoffsettcounttparity((s:/usr/lib/python2.7/dist-packages/mercurial/hgweb/common.pyt	paritygen¢s	

cCs4|ddƒp3|ddƒp3tjjdƒp3dS(s¾Return repo contact information or empty string.

    web.contact is the primary source, but if that is not set, try
    ui.username or $EMAIL as a fallback to display something useful.
    RtcontactRRtEMAILRP(RDtenvironR(tconfig((s:/usr/lib/python2.7/dist-packages/mercurial/hgweb/common.pytget_contact²scCsPt|jƒ}|jjdƒ|kr6ttƒ‚n|jjd|fƒdS(NtHTTP_IF_NONE_MATCHtETag(RYtmtimeRRRtHTTP_NOT_MODIFIEDR*tappend(RRttag((s:/usr/lib/python2.7/dist-packages/mercurial/hgweb/common.pytcaching¼s(RbRZRDR^R~tHTTP_BAD_REQUESTRRRdRR`RR$t	permhooksR&RtobjectR/R%RRCRLRNRpRuRzR(((s:/usr/lib/python2.7/dist-packages/mercurial/hgweb/common.pyt<module>	s*$			.				$	

Copyright © 2017 || Recoded By Mr.Bumblebee