Why Gemfury? Push, build, and install  RubyGems npm packages Python packages Maven artifacts PHP packages Go Modules Debian packages RPM packages NuGet packages

Repository URL to install this package:

Details    
contego / home / tvault / .virtenv / lib / python2.7 / site-packages / webob / cookies.pyc
Size: Mime:
ó
¨‹EYc
@s¤ddlZddlZddlZddlZddlZddlZddlmZmZmZddl	Z	ddl
Z
ddlZddlZddl
mZmZmZmZmZmZddlmZddddd	d
dgZeƒZdejfd
„ƒYZdefd„ƒYZd„Zd„Zd„d„Zd„Z d„Z!defd„ƒYZ"dZ#dZ$de	j%e$ƒZ&dZ'de&Z(dZ)de&Z*de#e'e*fZ+e(e)e+Z,e	j-ee,dƒƒZ.e	j-ed dƒƒZ/er
d!„ne0Z1ed"„e2d#ƒDƒƒZ3e3j4d$„e5e3j6ƒƒDƒƒerde7d%ƒnd%Z8er|e7d&ƒnd&Z9d'„Z:d(„Z;d)Z<e
j=e
j>e<Z?ee?ƒZ@e
j=e
j>d*ZAeeAƒZBe?d+ZCed,„e2d#ƒDƒƒZDeDj4eEeCeCƒƒer;ed-„eDjFƒDƒƒZDneDjGZHdYZIdZZKdZLdA„ZMdB„ZNdC„ZOdD„ZPePZQePZRiidEdF6ePdG6dH6idIdF6eNdG6dJ6idKdF6eQdG6dL6idMdF6eRdG6dN6ZSeTeSƒZUeVeSƒZWeWj4dOdPdQgƒddRdeXeXddS„ZYd	efdT„ƒYZZd
efdU„ƒYZ[defdV„ƒYZ\eƒZ]defdW„ƒYZ^de^fdX„ƒYZ_dS([iÿÿÿÿN(tdatetdatetimet	timedelta(tPY3t	text_typetbytes_ttext_tnative_tstring_types(tstrings_differtCookiet
CookieProfiletSignedCookieProfiletSignedSerializertJSONSerializertBase64Serializertmake_cookietRequestCookiescBsËeZdZd„Zed„ƒZd„Zd„Zd„Zd„Z	dd„Zd„Zd	„Z
d
„Zd„Zesœd„Zd
„Zd„Znd„Zd„Zd„Zd„Zd„ZRS(swebob._parsed_cookiescCs
||_dS(N(t_environ(tselftenviron((sB/home/tvault/.virtenv/lib/python2.7/site-packages/webob/cookies.pyt__init__&scsŽ|j}|jddƒ}|j|jidfƒ\}}||krL|Sd„‰t‡fd†t|ƒDƒƒ}||f||j<|S(NtHTTP_COOKIEtcSs
|jdƒS(Ntutf8(tdecode(tb((sB/home/tvault/.virtenv/lib/python2.7/site-packages/webob/cookies.pyt<lambda>0sc3s-|]#\}}ˆ|ƒˆ|ƒfVqdS(N((t.0tktv(td(sB/home/tvault/.virtenv/lib/python2.7/site-packages/webob/cookies.pys	<genexpr>1s(Rtgett
_cache_keytNonetdicttparse_cookie(Rtenvtheadertcachetcache_header((RsB/home/tvault/.virtenv/lib/python2.7/site-packages/webob/cookies.pyt_cache)s	!	"cCs‹|jjdƒ}|dk	}|p'd}trB|jdƒ}nt|dƒ}|dkrfd}n#tt|dƒƒ}|d|}tj|ƒ}t	}	x±|D]}}
|
j
ƒ\}}|
jdƒ}
|
|kr¥t}	|dkr|| j
dƒ||}n|| |||}Pq¥q¥W|dk	rR|rI|d	|7}qR|}n|rqt|dƒ|jd<n|r‡d|jd<n|	S(
NRRslatin-1tasciisutf-8t=is ;s; (RR R"RtencodeRt_value_quotet
_rx_cookietfinditertFalsetspantgrouptTruetrstripR(RtnametvalueR&t
had_headert
bytes_nametreplacementt	bytes_valtmatchestfoundtmatchtstarttendt
match_name((sB/home/tvault/.virtenv/lib/python2.7/site-packages/webob/cookies.pyt_mutate_header5s<	
	cCs”t|tƒs!t|dƒ‚nt|tƒsBt|dƒ}nyt|dƒ}Wntk
rttdƒ‚nXt|ƒstdƒ‚n|S(Nscookie name must be a stringsutf-8R*s&cookie name must be encodable to asciis/cookie name must be valid according to RFC 6265(t
isinstanceRt	TypeErrorRRRtUnicodeEncodeErrort_valid_cookie_name(RR5tbytes_cookie_name((sB/home/tvault/.virtenv/lib/python2.7/site-packages/webob/cookies.pyRE[s
cCsŒ|j|ƒ}t|tƒs0t|dƒ‚nt|tƒsxyt|dƒ}Wqxtk
rtt|dƒ‚qxXn|j||ƒdS(Nscookie value must be a stringsutf-8s,cookie value must be utf-8 binary or unicode(RERBRt
ValueErrorRRtUnicodeDecodeErrorRA(RR5R6((sB/home/tvault/.virtenv/lib/python2.7/site-packages/webob/cookies.pyt__setitem__hs
cCs|j|S(N(R)(RR5((sB/home/tvault/.virtenv/lib/python2.7/site-packages/webob/cookies.pyt__getitem__tscCs|jj||ƒS(N(R)R (RR5tdefault((sB/home/tvault/.virtenv/lib/python2.7/site-packages/webob/cookies.pyR wscCs:|j|ƒ}|j|dƒ}|s6t|ƒ‚ndS(N(RERAR"tKeyError(RR5R<((sB/home/tvault/.virtenv/lib/python2.7/site-packages/webob/cookies.pyt__delitem__zscCs
|jjƒS(N(R)tkeys(R((sB/home/tvault/.virtenv/lib/python2.7/site-packages/webob/cookies.pyRN€scCs
|jjƒS(N(R)tvalues(R((sB/home/tvault/.virtenv/lib/python2.7/site-packages/webob/cookies.pyROƒscCs
|jjƒS(N(R)titems(R((sB/home/tvault/.virtenv/lib/python2.7/site-packages/webob/cookies.pyRP†scCs
|jjƒS(N(R)titerkeys(R((sB/home/tvault/.virtenv/lib/python2.7/site-packages/webob/cookies.pyRQŠscCs
|jjƒS(N(R)t
itervalues(R((sB/home/tvault/.virtenv/lib/python2.7/site-packages/webob/cookies.pyRRscCs
|jjƒS(N(R)t	iteritems(R((sB/home/tvault/.virtenv/lib/python2.7/site-packages/webob/cookies.pyRSscCs
||jkS(N(R)(RR5((sB/home/tvault/.virtenv/lib/python2.7/site-packages/webob/cookies.pyt__contains__“scCs
|jjƒS(N(R)t__iter__(R((sB/home/tvault/.virtenv/lib/python2.7/site-packages/webob/cookies.pyRU–scCs
t|jƒS(N(tlenR)(R((sB/home/tvault/.virtenv/lib/python2.7/site-packages/webob/cookies.pyt__len__™scCsd|jd<dS(NRR(R(R((sB/home/tvault/.virtenv/lib/python2.7/site-packages/webob/cookies.pytclearœscCsd|jfS(Ns+<RequestCookies (dict-like) with values %r>(R)(R((sB/home/tvault/.virtenv/lib/python2.7/site-packages/webob/cookies.pyt__repr__ŸsN(t__name__t
__module__R!RtpropertyR)RARERIRJR"R RMRNRORPRRQRRRSRTRURWRXRY(((sB/home/tvault/.virtenv/lib/python2.7/site-packages/webob/cookies.pyR"s*		&	
												cBsPeZdd„Zd„Zd„ZeZed„Zd„Z	eZ
d„ZRS(cCs|r|j|ƒndS(N(tload(Rtinput((sB/home/tvault/.virtenv/lib/python2.7/site-packages/webob/cookies.pyR¤scCsXi}xKt|ƒD]=\}}|jƒtkr>|||<q|j||ƒ}qWdS(N(t
_parse_cookietlowert_c_keystadd(Rtdatatmorseltkeytval((sB/home/tvault/.virtenv/lib/python2.7/site-packages/webob/cookies.pyR]¨s

cCsZt|tƒs$|jddƒ}nt|ƒs4iSt||ƒ}tj|||ƒ|S(NR*treplace(RBtbytesR,REtMorselR#RI(RReRftr((sB/home/tvault/.virtenv/lib/python2.7/site-packages/webob/cookies.pyRb°scs#dj‡fd†|jƒDƒƒS(Ns; c3s|]}|jˆƒVqdS(N(t	serialize(Rtm(tfull(sB/home/tvault/.virtenv/lib/python2.7/site-packages/webob/cookies.pys	<genexpr>»s(tjoinRO(RRm((RmsB/home/tvault/.virtenv/lib/python2.7/site-packages/webob/cookies.pyRkºscCs)gt|jƒƒD]\}}|^qS(N(tsortedRP(Rt_Rl((sB/home/tvault/.virtenv/lib/python2.7/site-packages/webob/cookies.pyRO½scCs,d|jjdjtt|jƒƒƒfS(Ns
<%s: [%s]>s, (t	__class__RZRntmaptreprRO(R((sB/home/tvault/.virtenv/lib/python2.7/site-packages/webob/cookies.pyRYÂsN(RZR[R"RR]RbRIR3RkROt__str__RY(((sB/home/tvault/.virtenv/lib/python2.7/site-packages/webob/cookies.pyR
£s			ccsMtr|jdƒ}nx.tj|ƒD]\}}|t|ƒfVq(WdS(Nslatin-1(RR,R.tfindallt_unquote(RcReRf((sB/home/tvault/.virtenv/lib/python2.7/site-packages/webob/cookies.pyR_ÇscCsd„t|ƒDƒS(sA
    Parse cookies ignoring anything except names and values
    css-|]#\}}t|ƒr||fVqdS(N(RE(RRR((sB/home/tvault/.virtenv/lib/python2.7/site-packages/webob/cookies.pys	<genexpr>Ñs(R_(Rc((sB/home/tvault/.virtenv/lib/python2.7/site-packages/webob/cookies.pyR$ÍscCs|S(N((R((sB/home/tvault/.virtenv/lib/python2.7/site-packages/webob/cookies.pyRÔscs(‡‡fd†}t‡fd†|ƒS(Ncsˆ|ƒ|ˆ<dS(N((RR(ReRk(sB/home/tvault/.virtenv/lib/python2.7/site-packages/webob/cookies.pytfsetÕscs|ˆS(N((R(Re(sB/home/tvault/.virtenv/lib/python2.7/site-packages/webob/cookies.pyR×s(R\(ReRkRw((ReRksB/home/tvault/.virtenv/lib/python2.7/site-packages/webob/cookies.pytcookie_propertyÔscCs\t|tƒr4t|j|jdddƒ}nt|tƒrRt|ƒ}nt|ƒS(Nii<(RBRtstrtsecondstdaystintR(R((sB/home/tvault/.virtenv/lib/python2.7/site-packages/webob/cookies.pytserialize_max_ageÙs
%cCsß|dkrdSt|tƒr#|St|tƒr?|jdƒSt|tƒr`td|ƒ}nt|tƒr‚tjƒ|}nt|tt	fƒr¦|j
ƒ}ntjd|ƒ}t
|t|dt|dfdƒS(NR*Rzs%%s, %d-%%s-%Y %H:%M:%S GMTii(R"RBRhRR,R|RRtutcnowRt	timetuplettimetstrftimeRtweekdaystmonths(RRj((sB/home/tvault/.virtenv/lib/python2.7/site-packages/webob/cookies.pytserialize_cookie_dateàs
RicBs›eZd
Zd„ZedƒZedƒZedƒZedeƒZ	ede
ƒZedeƒZ
ed	eƒZd
„Zed„ZeZd„ZRS(R5R6cCs\t|ddƒ|_t|ddƒ|_t|jƒs?t‚|jtjtdƒƒdS(NtencodingR*(
RR5R6REtAssertionErrortupdateR#tfromkeysRaR"(RR5R6((sB/home/tvault/.virtenv/lib/python2.7/site-packages/webob/cookies.pyRòstpathtdomaintcommenttexpiressmax-agethttponlytsecurecCs;t|jƒdƒ}|tkr7tj|||ƒndS(NR*(RR`RaR#RI(RRR((sB/home/tvault/.virtenv/lib/python2.7/site-packages/webob/cookies.pyRIsc
Csóg}|j}||jdt|jƒƒ|rÝxWtD]O}||}|r:t|}|d}|d}||d||ƒƒq:q:W|d}	|	r®|d|	ƒn|jrÄ|dƒn|jrÝ|dƒqÝntdj	|ƒd	ƒS(
NR+R5tquoterRŒsexpires=RŽtHttpOnlys; R*(
tappendR5R-R6t
_c_valkeyst
_c_renamesRŽRRRn(
RRmtresultRbRRtinfoR5RRŒ((sB/home/tvault/.virtenv/lib/python2.7/site-packages/webob/cookies.pyRks&	





	
	cCs)d|jjt|jƒt|jƒfS(Ns<%s: %s=%r>(RqRZRR5R6(R((sB/home/tvault/.virtenv/lib/python2.7/site-packages/webob/cookies.pyRYs(snamesvalue(RZR[t	__slots__RRxR‰RŠR‹R„RŒR}tmax_agetboolRRŽRIR3RkRtRY(((sB/home/tvault/.virtenv/lib/python2.7/site-packages/webob/cookies.pyRiðs		s
"(?:\\"|.)*?"s~!@#$%^&*()_+=-`.?|:/(){}<>'s[\w\d%s]s$\w{3},\s[\w\d-]{9,11}\s[\d:]{8}\sGMTs(%s+?)s\s*=\s*s(?:%s|\\(?:[0-3][0-7][0-7]|.))*s
(%s|%s|%s)R*s\\([0-3][0-7][0-7]|.)cCs
t|gƒS(N(Rh(ti((sB/home/tvault/.virtenv/lib/python2.7/site-packages/webob/cookies.pyR5sccs+|]!}td|ƒt|ƒfVqdS(s%03oN(Rt_bchr(RR™((sB/home/tvault/.virtenv/lib/python2.7/site-packages/webob/cookies.pys	<genexpr>6siccs|]}||fVqdS(N((RR((sB/home/tvault/.virtenv/lib/python2.7/site-packages/webob/cookies.pys	<genexpr>9st$t"cCsJ|r:|d|dko%tknr:|dd!}ntjt|ƒS(Niiÿÿÿÿi(t
_b_quote_markt_rx_unquotetsubt_ch_unquote(R((sB/home/tvault/.virtenv/lib/python2.7/site-packages/webob/cookies.pyRv>s*cCst|jdƒS(Ni(t_ch_unquote_mapR2(Rl((sB/home/tvault/.virtenv/lib/python2.7/site-packages/webob/cookies.pyR Dss!#$%&'()*+-./:<=>?@[]^_`{|}~s!#$%&'*+-.^_`|~t ccs%|]}t|ƒd|fVqdS(s\%03oN(tchr(RR™((sB/home/tvault/.virtenv/lib/python2.7/site-packages/webob/cookies.pys	<genexpr>jsccs0|]&\}}t|ƒt|dƒfVqdS(R*N(tordR(RRR((sB/home/tvault/.virtenv/lib/python2.7/site-packages/webob/cookies.pys	<genexpr>ostMontTuetWedtThutFritSattSuntJantFebtMartAprtMaytJuntJultAugtSeptOcttNovtDeccCs/tr||ƒ‚ntj||ddƒdS(Nt
stackleveli(t
_should_raisetwarningstwarn(ttextt
warn_classtto_raisetraise_reason((sB/home/tvault/.virtenv/lib/python2.7/site-packages/webob/cookies.pyt__warn_or_raise{scCsT|jdtƒ}|rPtd|fttdƒddjtt|ƒƒdS|S(NsqCookie value contains invalid bytes: (%s). Future versions will raise ValueError upon encountering invalid bytes.s"Invalid characters in cookie valueRœR(	t	translateR"t_allowed_cookie_bytesRÀtRuntimeWarningRGRnRrt_escape_char(Rt	leftovers((sB/home/tvault/.virtenv/lib/python2.7/site-packages/webob/cookies.pyR-ƒs
cCsBt|tƒoA|jdtƒp@|dtkp@|jƒtkS(Ni(RBRhRÁR"t_valid_token_bytest_b_dollar_signR`Ra(Re((sB/home/tvault/.virtenv/lib/python2.7/site-packages/webob/cookies.pyRE•scCsdjtt|ƒƒS(NR(RnRrRÄ(R((sB/home/tvault/.virtenv/lib/python2.7/site-packages/webob/cookies.pyt_path_quotestPathR5RR‰tCommentR‹tDomainRŠsMax-Agesmax-ageRŒRŽRt/c
Csg|dkr!d}d}d}nt|tƒrU|jddd|j}|}nK|dk	ršyt|ƒ}Wntk
rtdƒ‚nX|}nd}t||ƒ}	|dk	rÍt|ƒ|	_	n|dk	rët|ƒ|	_
n|rýt|	_n|rt|	_
n|dk	r'||	_n|dk	r?||	_n|dk	r]t|ƒ|	_n|	jƒS(sp Generate a cookie value.  If ``value`` is None, generate a cookie value
    with an expiration date in the pastRisWed, 31-Dec-97 23:59:59 GMTi<isAmax_age should be an integer. Amount of seconds until expiration.N(R"RBRR{RzR|RGRiRRŠR‰R3RRŽR—RŒR‹Rk(
R5R6R—R‰RŠRŽRR‹RŒRd((sB/home/tvault/.virtenv/lib/python2.7/site-packages/webob/cookies.pyR®s<		
	cBs eZdZd„Zd„ZRS(s9 A serializer which uses `json.dumps`` and ``json.loads``cCsttj|ƒddƒS(NR…sutf-8(Rtjsontdumps(Rt	appstruct((sB/home/tvault/.virtenv/lib/python2.7/site-packages/webob/cookies.pyRÎßscCstjt|ddƒƒS(NR…sutf-8(RÍtloadsR(Rtbstruct((sB/home/tvault/.virtenv/lib/python2.7/site-packages/webob/cookies.pyRÐâs(RZR[t__doc__RÎRÐ(((sB/home/tvault/.virtenv/lib/python2.7/site-packages/webob/cookies.pyRÝs	cBs,eZdZdd„Zd„Zd„ZRS(s5 A serializer which uses base64 to encode/decode datacCs%|dkrtƒ}n||_dS(N(R"Rt
serializer(RRÓ((sB/home/tvault/.virtenv/lib/python2.7/site-packages/webob/cookies.pyRêscCs|jj|ƒ}tj|ƒS(se
        Given an ``appstruct``, serialize and sign the data.

        Returns a bytestring.
        (RÓRÎtbase64turlsafe_b64encode(RRÏtcstruct((sB/home/tvault/.virtenv/lib/python2.7/site-packages/webob/cookies.pyRÎðscCsXytjt|ƒƒ}Wn,tjtfk
rG}td|ƒ‚nX|jj|ƒS(s×
        Given a ``bstruct`` (a bytestring), verify the signature and then
        deserialize and return the deserialized value.

        A ``ValueError`` will be raised if the signature fails to validate.
        sBadly formed base64 data: %s(	RÔturlsafe_b64decodeRtbinasciitErrorRCRGRÓRÐ(RRÑRÖte((sB/home/tvault/.virtenv/lib/python2.7/site-packages/webob/cookies.pyRÐùs
N(RZR[RÒR"RRÎRÐ(((sB/home/tvault/.virtenv/lib/python2.7/site-packages/webob/cookies.pyRçs		cBs/eZdZddd„Zd„Zd„ZRS(s+
    A helper to cryptographically sign arbitrary content using HMAC.

    The serializer accepts arbitrary functions for performing the actual
    serialization and deserialization.

    ``secret``
      A string which is used to sign the cookie. The secret should be at
      least as long as the block size of the selected hash algorithm. For
      ``sha512`` this would mean a 128 bit (64 character) secret.

    ``salt``
      A namespace to avoid collisions between different uses of a shared
      secret.

    ``hashalg``
      The HMAC digest algorithm to use for signing. The algorithm must be
      supported by the :mod:`hashlib` library. Default: ``'sha512'``.

    ``serializer``
      An object with two methods: `loads`` and ``dumps``.  The ``loads`` method
      should accept bytes and return a Python object.  The ``dumps`` method
      should accept a Python object and return bytes.  A ``ValueError`` should
      be raised for malformed inputs.  Default: ``None`, which will use a
      derivation of :func:`json.dumps` and ``json.loads``.

    tsha512csÃ|ˆ_|ˆ_|ˆ_y#t|p*dƒt|ƒˆ_Wn6tk
rvt|pZddƒt|dƒˆ_nXd‡fd†ˆ_ˆjƒjˆ_|dkr¶t	ƒ}n|ˆ_
dS(NRsutf-8cstjˆj|ƒS(N(thashlibtnewthashalg(tstring(R(sB/home/tvault/.virtenv/lib/python2.7/site-packages/webob/cookies.pyR5s(tsalttsecretRÞRt
salted_secretRDt	digestmodtdigest_sizeR"RRÓ(RRáRàRÞRÓ((RsB/home/tvault/.virtenv/lib/python2.7/site-packages/webob/cookies.pyR$s			#
)cCsM|jj|ƒ}tj|j||jƒjƒ}tj||ƒj	dƒS(se
        Given an ``appstruct``, serialize and sign the data.

        Returns a bytestring.
        R+(
RÓRÎthmacRÝRâRãtdigestRÔRÕR4(RRÏRÖtsig((sB/home/tvault/.virtenv/lib/python2.7/site-packages/webob/cookies.pyRÎ=s!cCsÐy2dt|ƒd}tjt|ƒ|ƒ}Wn,tjtfk
r`}td|ƒ‚nX||j}||j }t	j
|jt|ƒ|jƒj
ƒ}t||ƒrÀtdƒ‚n|jj|ƒS(s×
        Given a ``bstruct`` (a bytestring), verify the signature and then
        deserialize and return the deserialized value.

        A ``ValueError`` will be raised if the signature fails to validate.
        R+isBadly formed base64 data: %ssInvalid signature(RVRÔR×RRØRÙRCRGRäRåRÝRâRãRæR	RÓRÐ(RRÑt
b64paddingtfstructRÚRÖtexpected_sigRç((sB/home/tvault/.virtenv/lib/python2.7/site-packages/webob/cookies.pyRÐGs

!N(RZR[RÒR"RRÎRÐ(((sB/home/tvault/.virtenv/lib/python2.7/site-packages/webob/cookies.pyR
s
	
cBs}eZdZed	d	dd	d	d„Zd„Zd„Zd„Ze	e	e	e	e	d„Z
e	e	e	e	e	d„Zd„ZRS(
sG
    A helper class that helps bring some sanity to the insanity that is cookie
    handling.

    The helper is capable of generating multiple cookies if necessary to
    support subdomains and parent domains.

    ``cookie_name``
      The name of the cookie used for sessioning. Default: ``'session'``.

    ``max_age``
      The maximum age of the cookie used for sessioning (in seconds).
      Default: ``None`` (browser scope).

    ``secure``
      The 'secure' flag of the session cookie. Default: ``False``.

    ``httponly``
      Hide the cookie from Javascript by setting the 'HttpOnly' flag of the
      session cookie. Default: ``False``.

    ``path``
      The path used for the session cookie. Default: ``'/'``.

    ``domains``
      The domain(s) used for the session cookie. Default: ``None`` (no domain).
      Can be passed an iterable containing multiple domains, this will set
      multiple cookies one for each domain.

    ``serializer``
      An object with two methods: ``loads`` and ``dumps``.  The ``loads`` method
      should accept a bytestring and return a Python object.  The ``dumps``
      method should accept a Python object and return bytes.  A ``ValueError``
      should be raised for malformed inputs.  Default: ``None``, which will use
      a derivation of :func:`json.dumps` and :func:`json.loads`.

    RÌcCsd||_||_||_||_||_||_|dkrNtƒ}n||_d|_	dS(N(
tcookie_nameRŽR—RR‰tdomainsR"RRÓtrequest(RRëRŽR—RR‰RìRÓ((sB/home/tvault/.virtenv/lib/python2.7/site-packages/webob/cookies.pyR‰s								cCs
|j|ƒS(s8 Bind a request to a copy of this instance and return it(tbind(RRí((sB/home/tvault/.virtenv/lib/python2.7/site-packages/webob/cookies.pyt__call__ŸscCs@t|j|j|j|j|j|j|jƒ}||_|S(s8 Bind a request to a copy of this instance and return it(	RRëRŽR—RR‰RìRÓRí(RRítselfish((sB/home/tvault/.virtenv/lib/python2.7/site-packages/webob/cookies.pyRî¤s	cCsr|jstdƒ‚n|jjj|jƒ}|dk	rny|jjt|ƒƒSWqntk
rjdSXndS(s¯ Looks for a cookie by name in the currently bound request, and
        returns its value.  If the cookie profile is not bound to a request,
        this method will raise a :exc:`ValueError`.

        Looks for the cookie in the cookies jar, and if it can find it it will
        attempt to deserialize it.  Returns ``None`` if there is no cookie or
        if the value in the cookie cannot be successfully deserialized.
        s"No request bound to cookie profileN(	RíRGtcookiesR RëR"RÓRÐR(Rtcookie((sB/home/tvault/.virtenv/lib/python2.7/site-packages/webob/cookies.pyt	get_value³s
	
c	CsA|j|d|d|d|d|d|ƒ}|jj|ƒ|S(s Set the cookies on a response.RìR—R‰RŽR(tget_headerst
headerlisttextend(	RtresponseR6RìR—R‰RŽRRñ((sB/home/tvault/.virtenv/lib/python2.7/site-packages/webob/cookies.pytset_cookiesÈs	cCsX|dkrd}d}n|jj|ƒ}|j|d|d|d|d|d|ƒS(sš Retrieve raw headers for setting cookies.

        Returns a list of headers that should be set for the cookies to
        be correctly tracked.
        iRìR—R‰RŽRN(R"RÓRÎt_get_cookies(RR6RìR—R‰RŽRRÑ((sB/home/tvault/.virtenv/lib/python2.7/site-packages/webob/cookies.pyRôÖs	c
CsS|tkr|j}n|tkr0|j}n|tkrH|j}n|tkr`|j}n|tkrx|j}n|d	k	r¯t|ƒdkr¯tdt|ƒƒ‚ng}|sût	|j
|d|d|d|d|ƒ}|jd|fƒnTxQ|D]I}	t	|j
|d|d|	d|d|d|ƒ}|jd|fƒqW|S(
s*Internal function

        This returns a list of cookies that are valid HTTP Headers.

        :environ: The request environment
        :value: The value to store in the cookie
        :domains: The domains, overrides any set in the CookieProfile
        :max_age: The max_age, overrides any set in the CookieProfile
        :path: The path, overrides any set in the CookieProfile
        :secure: Set this cookie to secure, overrides any set in CookieProfile
        :httponly: Set this cookie to HttpOnly, overrides any set in CookieProfile

        iýs,Cookie value is too long to store (%s bytes)R‰R—RRŽs
Set-CookieRŠN(t_defaultRìR—R‰RŽRR"RVRGRRëR‘(
RR6RìR—R‰RŽRRñtcookievalueRŠ((sB/home/tvault/.virtenv/lib/python2.7/site-packages/webob/cookies.pyRùìsF	
	N(
RZR[RÒR0R"RRïRîRóRúRøRôRù(((sB/home/tvault/.virtenv/lib/python2.7/site-packages/webob/cookies.pyRbs%			
cBs5eZdZededdddd„Zd„ZRS(sÂ
    A helper for generating cookies that are signed to prevent tampering.

    By default this will create a single cookie, given a value it will
    serialize it, then use HMAC to cryptographically sign the data. Finally
    the result is base64-encoded for transport. This way a remote user can
    not tamper with the value without uncovering the secret/salt used.

    ``secret``
      A string which is used to sign the cookie. The secret should be at
      least as long as the block size of the selected hash algorithm. For
      ``sha512`` this would mean a 128 bit (64 character) secret.

    ``salt``
      A namespace to avoid collisions between different uses of a shared
      secret.

    ``hashalg``
      The HMAC digest algorithm to use for signing. The algorithm must be
      supported by the :mod:`hashlib` library. Default: ``'sha512'``.

    ``cookie_name``
      The name of the cookie used for sessioning. Default: ``'session'``.

    ``max_age``
      The maximum age of the cookie used for sessioning (in seconds).
      Default: ``None`` (browser scope).

    ``secure``
      The 'secure' flag of the session cookie. Default: ``False``.

    ``httponly``
      Hide the cookie from Javascript by setting the 'HttpOnly' flag of the
      session cookie. Default: ``False``.

    ``path``
      The path used for the session cookie. Default: ``'/'``.

    ``domains``
      The domain(s) used for the session cookie. Default: ``None`` (no domain).
      Can be passed an iterable containing multiple domains, this will set
      multiple cookies one for each domain.

    ``serializer``
      An object with two methods: `loads`` and ``dumps``.  The ``loads`` method
      should accept bytes and return a Python object.  The ``dumps`` method
      should accept a Python object and return bytes.  A ``ValueError`` should
      be raised for malformed inputs.  Default: ``None`, which will use a
      derivation of :func:`json.dumps` and ``json.loads``.
    RÌRÛcCsw||_||_|	|_|
|_t|||	d|jƒ}tj||d|d|d|d|d|d|ƒdS(NRÓRŽR—RR‰Rì(RáRàRÞtoriginal_serializerR
RR(RRáRàRëRŽR—RR‰RìRÞRÓtsigned_serializer((sB/home/tvault/.virtenv/lib/python2.7/site-packages/webob/cookies.pyRbs$				cCsRt|j|j|j|j|j|j|j|j|j	|j
ƒ
}||_|S(s8 Bind a request to a copy of this instance and return it(RRáRàRëRŽR—RR‰RìRÞRüRí(RRíRð((sB/home/tvault/.virtenv/lib/python2.7/site-packages/webob/cookies.pyRî„s	N(RZR[RÒR0R"RRî(((sB/home/tvault/.virtenv/lib/python2.7/site-packages/webob/cookies.pyR/s2(sMonsTuesWedsThusFrisSatsSun(
NsJansFebsMarsAprsMaysJunsJulsAugsSepsOctsNovsDec(`tcollectionsRÔRØRÜRåRÍRRRtreRßR€Rºtwebob.compatRRRRRRt
webob.utilR	t__all__tobjectt_markertMutableMappingRR#R
R_R$RxR}R„Rit
_re_quotedt_legal_special_charstescapet_re_legal_chart_re_expires_valt_re_cookie_str_keyt_re_cookie_str_equalt_re_unquoted_valt_re_cookie_str_valt_re_cookie_strtcompileR.RžR£RštrangeR¡R‡tlistROR¤RÇRRvR t_allowed_special_charst
ascii_letterstdigitst_allowed_cookie_charsRÂt_valid_token_charsRÆt_escape_noop_charst_escape_maptzipRPRJRÄR‚R"RƒR¹RÀR-RERÈt
_domain_quotet_max_age_quoteR“RoR’tsetRaR0RRRR
RúRR(((sB/home/tvault/.virtenv/lib/python2.7/site-packages/webob/cookies.pyt<module>s¤.		$				7

	
	#		


						.
 Y	Í