ÿØÿàJFIFÿþ ÿÛC       ÿÛC ÿÀÿÄÿÄ"#QrÿÄÿÄ&1!A"2qQaáÿÚ ?Øy,æ/3JæÝ¹È߲؋5êXw²±ÉyˆR”¾I0ó2—PI¾IÌÚiMö¯–þrìN&"KgX:Šíµ•nTJnLK„…@!‰-ý ùúmë;ºgµŒ&ó±hw’¯Õ@”Ü— 9ñ-ë.²1<yà‚¹ïQÐU„ہ?.’¦èûbß±©Ö«Âw*VŒ) `$‰bØÔŸ’ëXÖ-ËTÜíGÚ3ð«g Ÿ§¯—Jx„–’U/ÂÅv_s(Hÿ@TñJÑãõçn­‚!ÈgfbÓc­:él[ðQe 9ÀPLbÃãCµm[5¿ç'ªjglå‡Ûí_§Úõl-;"PkÞÞÁQâ¼_Ñ^¢SŸx?"¸¦ùY騐ÒOÈ q’`~~ÚtËU¹CڒêV  I1Áß_ÿÙ A[c@`sdZddlmZddlmZddlmZddlmZddlmZm Z m Z ddd d d d d ddddddddgZ ddl Z ddl Z ejrde _nddlZddlZddlZddlZddlmZddlmZmZddlZddlmZddlmZddlmZ ddlm!Z!ddlm"Z"m#Z#m$Z$ddl%m&Z'ddl(m)Z)m*Z*dd l+m,Z,d!Z-d"Z.d"Z/d#Z0d$Z1e j2d%Z3e j2d&Z4e j2d'j5Z6d(Z7d)d*Z8d+Z9e j2d,e j:e j;BZ<d-Z=de?e?d.Z@e?d/ZAddd0ZBd1ZCd2ZDd3Zd4ZEddd5ZFe j2d6e jZGd7ZHd8d9d:ZIdd;d<ZJdS(=uMiscellaneous utilities.i(tunicode_literals(tdivision(tabsolute_import(tutils(tbytestinttstrucollapse_rfc2231_valueu decode_paramsudecode_rfc2231uencode_rfc2231u formataddru formatdateuformat_datetimeu getaddressesu make_msgidu mktime_tzu parseaddru parsedateu parsedate_tzuparsedate_to_datetimeuunquoteN(tdatetime(tquotetunquote(tStringIO(R(t AddressList(t mktime_tz(t parsedatet parsedate_tzt _parsedate_tz(t decodestring(t_bencodet_qencode(tCharsetu, uu u'u[][\\()<>@,:;".]u[\\"]u'([^-]|\A)[-]([^-]|\Z)cC`s"|jdd}|jddS(Nuasciiusurrogateescapeureplace(tencodetdecode(tstringtoriginal_bytes((sM/opt/alt/python27/lib/python2.7/site-packages/future/backports/email/utils.pyt _sanitizeHsuutf-8cC`s|\}}|jd|ry|jdWnItk r{t|tr^t|}n|j|}d||fSXd}tj|rd}ntj d|}d||||fSn|S(uThe inverse of parseaddr(), this takes a 2-tuple of the form (realname, email_address) and returns the string value suitable for an RFC 2822 From, To or Cc header. If the first element of pair is false, then the second element is returned unmodified. Optional charset if given is the character set that is used to encode realname in case realname is not ASCII safe. Can be an instance of str or a Charset-like object which has a header_encode method. Default is 'utf-8'. uasciiu%s <%s>uu"u\\\g<0>u %s%s%s <%s>( RtUnicodeEncodeErrort isinstanceRRt header_encodet specialsretsearcht escapesretsub(tpairtcharsettnametaddresst encoded_nametquotes((sM/opt/alt/python27/lib/python2.7/site-packages/future/backports/email/utils.pyt formataddrPs    cC`s"tj|}t|}|jS(u7Return a list of (REALNAME, EMAIL) for each fieldvalue.(t COMMASPACEtjoint _AddressListt addresslist(t fieldvaluestallta((sM/opt/alt/python27/lib/python2.7/site-packages/future/backports/email/utils.pyt getaddressesrs u_ =\? # literal =? (?P[^?]*?) # non-greedy up to the next ? is the charset \? # literal ? (?P[qb]) # either a "q" or a "b", case insensitive \? # literal ? (?P.*?) # non-greedy up to the next ?= is the atom \?= # literal ?= cC`sddddddddg|d |d d d d dddddddddg |dd|d|d|d|d|fS(Nu"%s, %02d %s %04d %02d:%02d:%02d %suMonuTueuWeduThuuFriuSatuSuniiuJanuFebuMaruApruMayuJunuJuluAuguSepuOctuNovuDeciiiii((t timetupletzone((sM/opt/alt/python27/lib/python2.7/site-packages/future/backports/email/utils.pyt_format_timetuple_and_zones !c C`s|d krtj}n|rtj|}tjrO|drOtj}n tj}tt|d\}}|dkrd}nd}d|||df}n$tj|}|rd}nd }t ||S( uReturns a date string as specified by RFC 2822, e.g.: Fri, 09 Nov 2001 01:08:47 -0000 Optional timeval if given is a floating point time value as accepted by gmtime() and localtime(), otherwise the current time is used. Optional localtime is a flag that when True, interprets timeval, and returns a date relative to the local timezone instead of UTC, properly taking daylight savings time into account. Optional argument usegmt means that the timezone is written out as an ascii string, not numeric one (so "GMT" instead of "+0000"). This is needed for HTTP, and is only used when localtime==False. iiiu-u+u %s%02d%02di<uGMTu-0000N( tNonettimet localtimetdaylighttaltzonettimezonetdivmodtabstgmtimeR1( ttimevalR4tusegmttnowtoffsetthourstminutestsignR0((sM/opt/alt/python27/lib/python2.7/site-packages/future/backports/email/utils.pyt formatdates"      cC`s|j}|rN|jdks6|jtjjkrEtdnd}n'|jdkrfd}n|jd}t||S(u$Turn a datetime into a date string as specified in RFC 2822. If usegmt is True, dt must be an aware datetime with an offset of zero. In this case 'GMT' will be rendered instead of the normal +0000 required by RFC2822. This is to support HTTP headers involving date stamps. u%usegmt option requires a UTC datetimeuGMTu-0000u%zN( R/ttzinfoR2RR7tutct ValueErrortstrftimeR1(tdtR<R=R0((sM/opt/alt/python27/lib/python2.7/site-packages/future/backports/email/utils.pytformat_datetimes $  cC`stj}tjdtj|}tj}tjd}|dkrWd}n d|}|dkr|tj }nd|||||f}|S(unReturns a string suitable for RFC 2822 compliant Message-ID, e.g: <20020201195627.33539.96671@nightshade.la.mastaler.com> Optional idstring if given is a string used to strengthen the uniqueness of the message id. Optional domain if given provides the portion of the message id after the '@'. It defaults to the locally defined hostname. u %Y%m%d%H%M%Siuu.u<%s.%s.%s%s@%s>N( R3RFR:tostgetpidtrandomt randrangeR2tsockettgetfqdn(tidstringtdomainR;tutcdatetpidtrandinttmsgid((sM/opt/alt/python27/lib/python2.7/site-packages/future/backports/email/utils.pyt make_msgids      cC`svtt|}|d g|d\}}|dkrJtj|d Stjdtjtjd||d S(NiiRCtseconds(tlistRR2RR7t timedelta(tdatat _3to2listtdtuplettz((sM/opt/alt/python27/lib/python2.7/site-packages/future/backports/email/utils.pytparsedate_to_datetimes   cC`s!t|j}|sdS|dS(Nui(uu(R)R*(taddrtaddrs((sM/opt/alt/python27/lib/python2.7/site-packages/future/backports/email/utils.pyt parseaddrscC`st|dkr|jdrS|jdrS|dd!jddjddS|jdr|jdr|dd!Sn|S( uRemove quotes from a string.iu"iu\\u\u\"u(tlent startswithtendswithtreplace(R((sM/opt/alt/python27/lib/python2.7/site-packages/future/backports/email/utils.pyR s #cC`s5|jtd}t|dkr1dd|fS|S(u#Decode string according to RFC 2231iN(tsplittTICKRaR2(tstparts((sM/opt/alt/python27/lib/python2.7/site-packages/future/backports/email/utils.pytdecode_rfc2231s cC`s`t|ddd|pd}|dkr:|dkr:|S|dkrOd}nd|||fS(uEncode string according to RFC 2231. If neither charset nor language is given, then s is returned as-is. If charset is given but not language, the string is encoded using the empty string for language. tsafeutencodinguasciiu%s'%s'%sN(t url_quoteR2(RgR!tlanguage((sM/opt/alt/python27/lib/python2.7/site-packages/future/backports/email/utils.pytencode_rfc2231 s   u&^(?P\w+)\*((?P[0-9]+)\*?)?$c C`s|}g}i}|jd\}}|j||fx|r|jd\}}|jdrqt}nt}t|}tj|}|r|jdd\}}|dk rt |}n|j |gj|||fq>|j|dt |fq>W|rx|j D]\}}g}t} |jxE|D]=\}} }|r}t| dd} t} n|j| qMWt tj|}| rt|\} } }|j|| | d|ffq$|j|d|fq$Wn|S( uDecode parameters list according to RFC 2231. params is a sequence of 2-tuples containing (param name, string value). iu*unameunumu"%s"Rkulatin-1N(tpoptappendRctTruetFalseR trfc2231_continuationtmatchtgroupR2Rt setdefaultRtitemstsortt url_unquotet EMPTYSTRINGR(Ri( tparamst new_paramstrfc2231_paramsR"tvaluetencodedtmotnumt continuationstextendedRgR!Rm((sM/opt/alt/python27/lib/python2.7/site-packages/future/backports/email/utils.pyt decode_paramssD    %!  #ureplaceuus-asciicC`s}t|t s"t|dkr,t|S|\}}}t|d}yt|||SWntk rxt|SXdS(Niuraw-unicode-escape(RttupleRaR RRt LookupError(R~terrorstfallback_charsetR!Rmttexttrawbytes((sM/opt/alt/python27/lib/python2.7/site-packages/future/backports/email/utils.pytcollapse_rfc2231_valueUs"  ic C`s\|dkr(tjjtjjjS|jdk rA|jS|jd |f}tj |}tj |}y.tj d|j }tj||j }Wntk rK|tjtj|d }tjo|jdk}|rtjntj }|tj d|kr9tj|tj|}qLtj|}nX|jd|S(uReturn local time as an aware datetime object. If called without arguments, return current time. Otherwise *dt* argument should be a datetime instance, and it is converted to the local time zone according to the system time zone database. If *dt* is naive (that is, dt.tzinfo is None), it is assumed to be in local time. In this case, a positive or zero value for *isdst* causes localtime to presume initially that summer time (for example, Daylight Saving Time) is or is not (respectively) in effect for the specified time. A negative value for *isdst* causes the localtime() function to attempt to divine whether summer time is in effect for the specified time. iRViiRCN(R2RR=R7RDt astimezoneRCR/R3tmktimeR4RXt tm_gmtoffttm_zonetAttributeErrorR:R5ttm_isdstR6ttznameRd( RGtisdstttmRVtlocaltmtdeltaR\tdsttgmtoff((sM/opt/alt/python27/lib/python2.7/site-packages/future/backports/email/utils.pyR4ks$    (Kt__doc__t __future__RRRtfutureRtfuture.builtinsRRRt__all__RItretPY2tASCIIR3tbase64RKRMtfuture.backportsRtfuture.backports.urllib.parseRRlR RytwarningstioR t!future.backports.email._parseaddrR R)R R RRtquopriRt_qdecodetfuture.backports.email.encodersRRtfuture.backports.email.charsetRR'Rzt UEMPTYSTRINGtCRLFRftcompileRRRt_has_surrogatesRR&R.tVERBOSEt IGNORECASEtecreR1R2RrRBRHRUR]R`RiRnRsRRR4(((sM/opt/alt/python27/lib/python2.7/site-packages/future/backports/email/utils.pyts             "  -      8