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d!6d"d#6d$d%6d&d'6d(d)6d*d+6d,d-6d.d/6d0d16d2d36d4d56d6d76d8d96d:d;6d<d=6d>d?6d@dA6dBdC6dDdE6dFdG6dHdI6dJdK6dLdM6dNdO6dPdQ6dRdS6dTdU6dVdW6dXdY6dZd[6Zed\Zejd]Zejd^Zd_Z d`dadbdcdddedfgZ!ddgdhdidjdkdldmdndodpdqdrg Z#de!e#dsZ$dtefduYZ%dvZ&ejdwe&dxe&dyejZ'dzefd{YZ(d|e(fd}YZ)dS(~uf http.cookies module ported to python-future from Py3.3 Here's a sample session to show how to use this module. At the moment, this is the only documentation. The Basics ---------- Importing is easy... >>> from http import cookies Most of the time you start by creating a cookie. >>> C = cookies.SimpleCookie() Once you've created your Cookie, you can add values just as if it were a dictionary. >>> C = cookies.SimpleCookie() >>> C["fig"] = "newton" >>> C["sugar"] = "wafer" >>> C.output() 'Set-Cookie: fig=newton\r\nSet-Cookie: sugar=wafer' Notice that the printable representation of a Cookie is the appropriate format for a Set-Cookie: header. This is the default behavior. You can change the header and printed attributes by using the .output() function >>> C = cookies.SimpleCookie() >>> C["rocky"] = "road" >>> C["rocky"]["path"] = "/cookie" >>> print(C.output(header="Cookie:")) Cookie: rocky=road; Path=/cookie >>> print(C.output(attrs=[], header="Cookie:")) Cookie: rocky=road The load() method of a Cookie extracts cookies from a string. In a CGI script, you would use this method to extract the cookies from the HTTP_COOKIE environment variable. >>> C = cookies.SimpleCookie() >>> C.load("chips=ahoy; vienna=finger") >>> C.output() 'Set-Cookie: chips=ahoy\r\nSet-Cookie: vienna=finger' The load() method is darn-tootin smart about identifying cookies within a string. Escaped quotation marks, nested semicolons, and other such trickeries do not confuse it. >>> C = cookies.SimpleCookie() >>> C.load('keebler="E=everybody; L=\\"Loves\\"; fudge=\\012;";') >>> print(C) Set-Cookie: keebler="E=everybody; L=\"Loves\"; fudge=\012;" Each element of the Cookie also supports all of the RFC 2109 Cookie attributes. Here's an example which sets the Path attribute. >>> C = cookies.SimpleCookie() >>> C["oreo"] = "doublestuff" >>> C["oreo"]["path"] = "/" >>> print(C) Set-Cookie: oreo=doublestuff; Path=/ Each dictionary element has a 'value' attribute, which gives you back the value associated with the key. >>> C = cookies.SimpleCookie() >>> C["twix"] = "none for you" >>> C["twix"].value 'none for you' The SimpleCookie expects that all values should be standard strings. Just to be sure, SimpleCookie invokes the str() builtin to convert the value to a string, when the values are set dictionary-style. >>> C = cookies.SimpleCookie() >>> C["number"] = 7 >>> C["string"] = "seven" >>> C["number"].value '7' >>> C["string"].value 'seven' >>> C.output() 'Set-Cookie: number=7\r\nSet-Cookie: string=seven' Finis. i(tunicode_literals(tprint_function(tdivision(tabsolute_import(tchrtdicttinttstr(tPY2t as_native_strNu CookieErroru BaseCookieu SimpleCookieuu; u t CookieErrorcB`seZRS((t__name__t __module__(((sN/opt/alt/python27/lib/python2.7/site-packages/future/backports/http/cookies.pyR su!#$%&'*+-.^_`|~:u\000uu\001uu\002uu\003uu\004uu\005uu\006uu\007uu\010uu\011u u\012u u\013u u\014u u\015u u\016uu\017uu\020uu\021uu\022uu\023uu\024uu\025uu\026uu\027uu\030uu\031uu\032uu\033uu\034uu\035uu\036uu\037uu\054u,u\073u;u\"u"u\\u\u\177uu\200u€u\201uu\202u‚u\203uƒu\204u„u\205u…u\206u†u\207u‡u\210uˆu\211u‰u\212uŠu\213u‹u\214uŒu\215uu\216uŽu\217uu\220uu\221u‘u\222u’u\223u“u\224u”u\225u•u\226u–u\227u—u\230u˜u\231u™u\232ušu\233u›u\234uœu\235uu\236užu\237uŸu\240u u\241u¡u\242u¢u\243u£u\244u¤u\245u¥u\246u¦u\247u§u\250u¨u\251u©u\252uªu\253u«u\254u¬u\255u­u\256u®u\257u¯u\260u°u\261u±u\262u²u\263u³u\264u´u\265uµu\266u¶u\267u·u\270u¸u\271u¹u\272uºu\273u»u\274u¼u\275u½u\276u¾u\277u¿u\300uÀu\301uÁu\302uÂu\303uÃu\304uÄu\305uÅu\306uÆu\307uÇu\310uÈu\311uÉu\312uÊu\313uËu\314uÌu\315uÍu\316uÎu\317uÏu\320uÐu\321uÑu\322uÒu\323uÓu\324uÔu\325uÕu\326uÖu\327u×u\330uØu\331uÙu\332uÚu\333uÛu\334uÜu\335uÝu\336uÞu\337ußu\340uàu\341uáu\342uâu\343uãu\344uäu\345uåu\346uæu\347uçu\350uèu\351uéu\352uêu\353uëu\354uìu\355uíu\356uîu\357uïu\360uðu\361uñu\362uòu\363uóu\364uôu\365uõu\366uöu\367u÷u\370uøu\371uùu\372uúu\373uûu\374uüu\375uýu\376uþu\377uÿc`s@tfd|Dr |Sdtd|DdSdS(uQuote a string for use in a cookie header. If the string does not need to be double-quoted, then just return the string. Otherwise, surround the string in doublequotes and quote (with a \) special characters. c3`s|]}|kVqdS(N((t.0tc(t LegalChars(sN/opt/alt/python27/lib/python2.7/site-packages/future/backports/http/cookies.pys su"cs`s!|]}tj||VqdS(N(t _Translatortget(R ts((sN/opt/alt/python27/lib/python2.7/site-packages/future/backports/http/cookies.pys sN(tallt _nulljoin(RR((RsN/opt/alt/python27/lib/python2.7/site-packages/future/backports/http/cookies.pyt_quotesu\\[0-3][0-7][0-7]u[\\].cC`st|dkr|S|ddks6|ddkr:|S|dd!}d}t|}g}x9d|koy|knrtj||}tj||}| r| r|j||Pnd}}|r|jd}n|r|jd}n|rN| s||krN|j|||!|j||d|d}qb|j|||!|jtt||d|d!d|d}qbWt|S(Niiu"iiii( tlent _OctalPatttsearcht _QuotePatttappendtstartRRR(tmystrtitntresto_matchtq_matchtjtk((sN/opt/alt/python27/lib/python2.7/site-packages/future/backports/http/cookies.pyt_unquotes6     +uMonuTueuWeduThuuFriuSatuSunuJanuFebuMaruApruMayuJunuJuluAuguSepuOctuNovuDecc C`soddlm}m}|}|||\ }}}} } } } } }d|| ||||| | | fS(Ni(tgmtimettimeu#%s, %02d %3s %4d %02d:%02d:%02d GMT(R&R%(tfuturet weekdaynamet monthnameR%R&tnowtyeartmonthtdaythhtmmtsstwdtytz((sN/opt/alt/python27/lib/python2.7/site-packages/future/backports/http/cookies.pyt_getdate2s  +tMorselcB`seZdZidd6dd6dd6dd6dd 6d d 6d d 6d d 6Zed d gZdZdZdZe dZdddZ e Z e dZddZddZRS(uA class to hold ONE (key, value) pair. In a cookie, each such pair may have several attributes, so this class is used to keep the attributes associated with the appropriate key,value pair. This class also includes a coded_value attribute, which is used to hold the network representation of the value. This is most useful when Python objects are pickled for network transit. uexpiresuPathupathuCommentucommentuDomainudomainuMax-Ageumax-ageusecureuhttponlyuVersionuversioncC`sBd|_|_|_x$|jD]}tj||dq!WdS(Nu(tNonetkeytvaluet coded_valuet _reservedRt __setitem__(tselfR7((sN/opt/alt/python27/lib/python2.7/site-packages/future/backports/http/cookies.pyt__init__]scC`sE|j}||jkr.td|ntj|||dS(NuInvalid Attribute %s(tlowerR:R RR;(R<tKtV((sN/opt/alt/python27/lib/python2.7/site-packages/future/backports/http/cookies.pyR;es cC`s|j|jkS(N(R>R:(R<R?((sN/opt/alt/python27/lib/python2.7/site-packages/future/backports/http/cookies.pyt isReservedKeyksc`sv|j|jkr(td|ntfd|DrWtd|n||_||_||_dS(Nu!Attempt to set a reserved key: %sc3`s|]}|kVqdS(N((R R(R(sN/opt/alt/python27/lib/python2.7/site-packages/future/backports/http/cookies.pys ssuIllegal key value: %s(R>R:R tanyR7R8R9(R<R7tvalt coded_valR((RsN/opt/alt/python27/lib/python2.7/site-packages/future/backports/http/cookies.pytsetns  u Set-Cookie:cC`sd||j|fS(Nu%s %s(t OutputString(R<tattrstheader((sN/opt/alt/python27/lib/python2.7/site-packages/future/backports/http/cookies.pytoutput{scC`sYtr*t|jtr*t|j}n |j}d|jjt|jt|fS(Nu <%s: %s=%s>( Rt isinstanceR8tunicodeRt __class__R R7trepr(R<RC((sN/opt/alt/python27/lib/python2.7/site-packages/future/backports/http/cookies.pyt__repr__s   cC`sd|j|jddS(Nu u"u\"(RFtreplace(R<RG((sN/opt/alt/python27/lib/python2.7/site-packages/future/backports/http/cookies.pyt js_outputscC`swg}|j}|d|j|jf|dkrA|j}nt|j}x|D]\}}|dkrxqZn||krqZn|dkrt|tr|d|j|t |fqZ|dkrt|tr|d|j||fqZ|dkr(|t |j|qZ|dkrN|t |j|qZ|d|j||fqZWt |S(Nu%s=%suuexpiresumax-ageu%s=%dusecureuhttponly( RR7R9R6R:tsortedtitemsRJRR4Rt_semispacejoin(R<RGtresultRRRR7R8((sN/opt/alt/python27/lib/python2.7/site-packages/future/backports/http/cookies.pyRFs*     $  N(R R t__doc__R:REt_flagsR=R;RAt _LegalCharsR6RIt__str__R RNRPRF(((sN/opt/alt/python27/lib/python2.7/site-packages/future/backports/http/cookies.pyR5:s(      u.[\w\d!#%&'~_`><@,:/\$\*\+\-\.\^\|\)\(\?\}\{\=]u~ (?x) # This is a verbose pattern (?P # Start of group 'key' u+? # Any word of at least one letter ) # End of group 'key' ( # Optional group: there may not be a value. \s*=\s* # Equal Sign (?P # Start of group 'val' "(?:[^\\"]|\\.)*" # Any doublequoted string | # or \w{3},\s[\w\d\s-]{9,11}\s[\d:]{8}\sGMT # Special case for "expires" attr | # or u,* # Any word or empty string ) # End of group 'val' )? # End of optional value group \s* # Any number of spaces. (\s+|;|$) # Ending either at space, semicolon, or EOS. t BaseCookiecB`seZdZdZdZd dZdZdZd dddZ e Z e d Z d d Z d Zed ZRS(u'A container class for a set of Morsels.cC`s ||fS(u real_value, coded_value = value_decode(STRING) Called prior to setting a cookie's value from the network representation. The VALUE is the value read from HTTP header. Override this function to modify the behavior of cookies. ((R<RC((sN/opt/alt/python27/lib/python2.7/site-packages/future/backports/http/cookies.pyt value_decodescC`st|}||fS(ureal_value, coded_value = value_encode(VALUE) Called prior to setting a cookie's value from the dictionary representation. The VALUE is the value being assigned. Override this function to modify the behavior of cookies. (R(R<RCtstrval((sN/opt/alt/python27/lib/python2.7/site-packages/future/backports/http/cookies.pyt value_encodes cC`s|r|j|ndS(N(tload(R<tinput((sN/opt/alt/python27/lib/python2.7/site-packages/future/backports/http/cookies.pyR=scC`s?|j|t}|j|||tj|||dS(u+Private method for setting a cookie's valueN(RR5RERR;(R<R7t real_valueR9tM((sN/opt/alt/python27/lib/python2.7/site-packages/future/backports/http/cookies.pyt__setscC`s,|j|\}}|j|||dS(uDictionary style assignment.N(R\t_BaseCookie__set(R<R7R8trvaltcval((sN/opt/alt/python27/lib/python2.7/site-packages/future/backports/http/cookies.pyR;su Set-Cookie:u cC`sUg}t|j}x-|D]%\}}|j|j||qW|j|S(u"Return a string suitable for HTTP.(RQRRRRItjoin(R<RGRHtsepRTRRR7R8((sN/opt/alt/python27/lib/python2.7/site-packages/future/backports/http/cookies.pyRIs cC`sg}t|j}xj|D]b\}}trUt|jtrUt|j}n |j}|jdt|t|fqWd|j j t |fS(Nu%s=%su<%s: %s>( RQRRRRJR8RKRRRMRLR t _spacejoin(R<tlRRR7R8RC((sN/opt/alt/python27/lib/python2.7/site-packages/future/backports/http/cookies.pyRNs 'cC`sOg}t|j}x*|D]"\}}|j|j|qWt|S(u(Return a string suitable for JavaScript.(RQRRRRPR(R<RGRTRRR7R8((sN/opt/alt/python27/lib/python2.7/site-packages/future/backports/http/cookies.pyRPs cC`sJt|tr|j|n'x$|jD]\}}|||R5R:RVtTrueR$RZRb( R<RtpattRRR`tmatchR7R8RcRd((sN/opt/alt/python27/lib/python2.7/site-packages/future/backports/http/cookies.pyt__parse_string%s,   N(R R RURZR\R6R=RbR;RIRXR RNRPR]t_CookiePatternRi(((sN/opt/alt/python27/lib/python2.7/site-packages/future/backports/http/cookies.pyRYs     t SimpleCookiecB`s eZdZdZdZRS(u SimpleCookie supports strings as cookie values. When setting the value using the dictionary assignment notation, SimpleCookie calls the builtin str() to convert the value to a string. Values received from HTTP are kept as strings. cC`st||fS(N(R$(R<RC((sN/opt/alt/python27/lib/python2.7/site-packages/future/backports/http/cookies.pyRZPscC`st|}|t|fS(N(RR(R<RCR[((sN/opt/alt/python27/lib/python2.7/site-packages/future/backports/http/cookies.pyR\Ss (R R RURZR\(((sN/opt/alt/python27/lib/python2.7/site-packages/future/backports/http/cookies.pyRrIs (*RUt __future__RRRRtfuture.builtinsRRRRt future.utilsRR tretASCIItstringt__all__ReRRSRgt ExceptionR t ascii_letterstdigitsRWRRtcompileRRR$t _weekdaynameR6t _monthnameR4R5t_LegalCharsPattRqRYRr(((sN/opt/alt/python27/lib/python2.7/site-packages/future/backports/http/cookies.pyts"        2 t