Your IP : 216.73.216.196


Current Path : /opt/alt/python27/lib/python2.7/site-packages/webob/
Upload File :
Current File : //opt/alt/python27/lib/python2.7/site-packages/webob/etag.pyc

�
3(Oc@s�dZddlmZmZddlmZddlmZmZddddd	gZ	e
d
�Zd�Zd�Z
d
efd��YZe�Zdefd��YZe�Zdefd��YZdefd��YZdefd��YZdS(sZ
Does parsing of ETag-related headers: If-None-Matches, If-Matches

Also If-Range parsing
i����(t
parse_datetserialize_date(t_rx_etag(theader_docstringtwarn_deprecationtAnyETagtNoETagtETagMatchertIfRanget
etag_propertycsbt�|�}|d7}���fd�}�fd�}�fd�}t|||d|�S(Ns  Converts it as a Etag.cs3|jj��}|s�Stj|d��SdS(Ntstrong(tenvirontgetRtparse(treqtvalue(tdefaulttkeyR
(s;/opt/alt/python27/lib/python2.7/site-packages/webob/etag.pytfgetscs3|dkrd|j�<nt|�|j�<dS(N(tNoneRtstr(Rtval(R(s;/opt/alt/python27/lib/python2.7/site-packages/webob/etag.pytfsetscs|j�=dS(N(R(R(R(s;/opt/alt/python27/lib/python2.7/site-packages/webob/etag.pytfdel"stdoc(Rtproperty(RRtrfc_sectionR
RRRR((RRR
s;/opt/alt/python27/lib/python2.7/site-packages/webob/etag.pyR	s
cCstddd�dS(Nsweak_match is deprecateds1.2i(R(((s;/opt/alt/python27/lib/python2.7/site-packages/webob/etag.pyt_warn_weak_match_deprecated&scOstd��dS(Ns*IfRange.match[_response] API is deprecated(tDeprecationWarning(targstkw((s;/opt/alt/python27/lib/python2.7/site-packages/webob/etag.pyt_warn_if_range_match_deprecated)st_AnyETagcBsAeZdZd�Zd�ZeZd�Zd�Zd�ZRS(sL
    Represents an ETag of *, or a missing ETag when matching is 'safe'
    cCsdS(Ns<ETag *>((tself((s;/opt/alt/python27/lib/python2.7/site-packages/webob/etag.pyt__repr__2scCstS(N(tFalse(R!((s;/opt/alt/python27/lib/python2.7/site-packages/webob/etag.pyt__nonzero__5scCstS(N(tTrue(R!tother((s;/opt/alt/python27/lib/python2.7/site-packages/webob/etag.pyt__contains__:scCst�dS(N(R(R!R&((s;/opt/alt/python27/lib/python2.7/site-packages/webob/etag.pyt
weak_match=scCsdS(Nt*((R!((s;/opt/alt/python27/lib/python2.7/site-packages/webob/etag.pyt__str__@s(	t__name__t
__module__t__doc__R"R$t__bool__R'R(R*(((s;/opt/alt/python27/lib/python2.7/site-packages/webob/etag.pyR -s				t_NoETagcBsAeZdZd�Zd�ZeZd�Zd�Zd�ZRS(s;
    Represents a missing ETag when matching is unsafe
    cCsdS(Ns	<No ETag>((R!((s;/opt/alt/python27/lib/python2.7/site-packages/webob/etag.pyR"JscCstS(N(R#(R!((s;/opt/alt/python27/lib/python2.7/site-packages/webob/etag.pyR$MscCstS(N(R#(R!R&((s;/opt/alt/python27/lib/python2.7/site-packages/webob/etag.pyR'RscCst�dS(N(R(R!R&((s;/opt/alt/python27/lib/python2.7/site-packages/webob/etag.pyR(UscCsdS(Nt((R!((s;/opt/alt/python27/lib/python2.7/site-packages/webob/etag.pyR*Xs(	R+R,R-R"R$R.R'R(R*(((s;/opt/alt/python27/lib/python2.7/site-packages/webob/etag.pyR/Es				cBsGeZd�Zd�Zd�Zd�Zeed��Zd�Z	RS(cCs
||_dS(N(tetags(R!R1((s;/opt/alt/python27/lib/python2.7/site-packages/webob/etag.pyt__init__ascCs
||jkS(N(R1(R!R&((s;/opt/alt/python27/lib/python2.7/site-packages/webob/etag.pyR'dscCst�dS(N(R(R!R&((s;/opt/alt/python27/lib/python2.7/site-packages/webob/etag.pyR(gscCsddj|j�S(Ns	<ETag %s>s or (tjoinR1(R!((s;/opt/alt/python27/lib/python2.7/site-packages/webob/etag.pyR"jscCs�|dkrtS|s |g�Stj|�}|sB||g�S|rq|g|D]\}}|sR|^qR�S|g|D]\}}|^q{�SdS(s0
        Parse this from a header value
        R)N(RRtfindall(tclsRR
tmatchestwtt((s;/opt/alt/python27/lib/python2.7/site-packages/webob/etag.pyR
ms

)cCsdjtdj|j��S(Ns, s"%s"(R3tmapt__mod__R1(R!((s;/opt/alt/python27/lib/python2.7/site-packages/webob/etag.pyR*~s(
R+R,R2R'R(R"tclassmethodR%R
R*(((s;/opt/alt/python27/lib/python2.7/site-packages/webob/etag.pyR`s				cBsTeZd�Zed��Zd�Zd�Zd�Zd�Ze	Z
ZeZRS(cCs
||_dS(N(tetag(R!R<((s;/opt/alt/python27/lib/python2.7/site-packages/webob/etag.pyR2�scCsF|s|t�S|jd�r/tt|��S|tj|��SdS(s1
        Parse this from a header value.
        s GMTN(RtendswithtIfRangeDateRRR
(R5R((s;/opt/alt/python27/lib/python2.7/site-packages/webob/etag.pyR
�s

cCs|j|jkS(s\
        Return True if the If-Range header matches the given etag or last_modified
        (tetag_strongR<(R!tresp((s;/opt/alt/python27/lib/python2.7/site-packages/webob/etag.pyR'�scCs
t|j�S(N(tboolR<(R!((s;/opt/alt/python27/lib/python2.7/site-packages/webob/etag.pyR$�scCsd|jj|jfS(Ns%s(%r)(t	__class__R+R<(R!((s;/opt/alt/python27/lib/python2.7/site-packages/webob/etag.pyR"�s	cCs|jrt|j�SdS(NR0(R<R(R!((s;/opt/alt/python27/lib/python2.7/site-packages/webob/etag.pyR*�s(
R+R,R2R;R
R'R$R"R*Rtmatchtmatch_responseR.(((s;/opt/alt/python27/lib/python2.7/site-packages/webob/etag.pyR�s	
				
R>cBs6eZd�Zd�Zd�Zd�ZeZZRS(cCs
||_dS(N(tdate(R!RE((s;/opt/alt/python27/lib/python2.7/site-packages/webob/etag.pyR2�scCs|j}|o||jkS(N(t
last_modifiedRE(R!R@RF((s;/opt/alt/python27/lib/python2.7/site-packages/webob/etag.pyR'�s	cCsd|jj|jfS(Ns%s(%r)(RBR+RE(R!((s;/opt/alt/python27/lib/python2.7/site-packages/webob/etag.pyR"�s	cCs
t|j�S(N(RRE(R!((s;/opt/alt/python27/lib/python2.7/site-packages/webob/etag.pyR*�s(	R+R,R2R'R"R*RRCRD(((s;/opt/alt/python27/lib/python2.7/site-packages/webob/etag.pyR>�s
				N(R-twebob.datetime_utilsRRtwebob.descriptorsRt
webob.utilRRt__all__R%R	RRtobjectR RR/RRRR>(((s;/opt/alt/python27/lib/python2.7/site-packages/webob/etag.pyt<module>s				"'