§ \�dn4ãó€—dZgd¢ZddlZddlZddlZddlZddlZddlZddlZ ddl m Z ddl m Z ddl mZddl mZmZmZddlmZd Zd Zd Zd Zd Zejd ¦«Zejd¦«Zd„Zd„Zd%d„Zd„Zd„Z d&d„Z!d'd„Z"d(d„Z#d„Z$d„Z%d„Z&d„Z'd(d„Z(ejdej)¦«Z*d„Z+ d)d"„Z,d*d$„Z-dS)+zMiscellaneous utilities.)Úcollapse_rfc2231_valueÚ decode_paramsÚdecode_rfc2231Úencode_rfc2231Ú formataddrÚ formatdateÚformat_datetimeÚ getaddressesÚ make_msgidÚ mktime_tzÚ parseaddrÚ parsedateÚ parsedate_tzÚparsedate_to_datetimeÚunquoteéN)Úquote)Ú AddressList)r )r rÚ _parsedate_tz)ÚCharsetz, Úz ú'z[][\\()<>@,:;".]z[\\"]cóR— | ¦«dS#t$rYdSwxYw)z8Return True if s contains surrogate-escaped binary data.FT)ÚencodeÚUnicodeEncodeError)Úss ú..\python\lib\email\utils.pyÚ_has_surrogatesr3s;€ð Ø �Љ Œ ˆ ؈uøÝ ððð؈tˆtðøøøs ‚˜ &¥&cóZ—| dd¦«}| dd¦«S)Núutf-8ÚsurrogateescapeÚreplace)rÚdecode)ÚstringÚoriginal_bytess rÚ _sanitizer%@s.€ð —]’] 7Ð,=Ñ>Ô>€NØ × Ò  ¨)Ñ 4Ô 4Ð4órcó–—|\}}| d¦«|r¬ | d¦«d}t |¦«rd}t d|¦«}|›|›|›d|›d�S#t $rDt |t¦«rt|¦«}|  |¦«}|›d|›d�cYSwxYw|S)aúThe 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. The optional charset 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'. Úasciirú"z\\\g<0>z <ú>) rÚ specialsreÚsearchÚ escapesreÚsubrÚ isinstanceÚstrrÚ header_encode)ÚpairÚcharsetÚnameÚaddressÚquotesÚ encoded_names rrrLsÿ€ð�M€Dˆ'à ‡N‚N�7ÑÔÐØ ð Cð CØ �KŠK˜Ñ Ô Ð ðˆFÝ× Ò  Ñ&Ô&ð Ø�Ý—=’= ¨TÑ2Ô2ˆDØ$* F¨D¨D°&°&°&¸'¸'¸'ÐBÐ Bøõ"ð 7ð 7ð 7ݘ'¥3Ñ'Ô'ð +Ý! 'Ñ*Ô*�Ø"×0Ò0°Ñ6Ô6ˆLØ ,    ¨g¨g¨gÐ6Ð 6Ð 6Ð 6ð  7øøøð €NsžA8Á8A CÃCcóv—t d„|D¦«¦«}t|¦«}|jS)z7Return a list of (REALNAME, EMAIL) for each fieldvalue.c3ó4K—|]}t|¦«V—ŒdS)N©r0)Ú.0Úvs rú zgetaddresses..ps(èè€Ð6Ð6 Q�#˜a™&œ&Ð6Ð6Ð6Ð6Ð6Ð6r&)Ú COMMASPACEÚjoinÚ _AddressListÚ addresslist)Ú fieldvaluesÚallÚas rr r ns7€å �/Š/Ð6Ð6¨+Ð6Ñ6Ô6Ñ 6Ô 6€CÝ�SÑÔ€AØ Œ=Ðr&c ó–—dgd¢|d|dgd¢|ddz |d|d|d |d |fzS) Nz"%s, %02d %s %04d %02d:%02d:%02d %s)ÚMonÚTueÚWedÚThuÚFriÚSatÚSunéé) ÚJanÚFebÚMarÚAprÚMayÚJunÚJulÚAugÚSepÚOctÚNovÚDecérééé©)Ú timetupleÚzones rÚ_format_timetuple_and_zonerbusj€Ø /Ø9Ð9Ð9¸)ÀA¼,ÔGØ�!Œ ð 3ð 3ð 3Ø3<¸Q´<À!Ñ3Cô Eà�!Œ �i ”l I¨a¤L°)¸A´,Ø ð 3ñ ðr&Fcó"—|€tj¦«}|s|r0tj |tjj¦«}ntj |¦«}|r| ¦«}d}t||¦«S)aƒReturns 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. NF)ÚtimeÚdatetimeÚ fromtimestampÚtimezoneÚutcÚutcfromtimestampÚ astimezoner)ÚtimevalÚ localtimeÚusegmtÚdts rrr~sƒ€ð$€Ý”)‘+”+ˆØð9�Fð9Ý Ô × ,Ò ,¨WµhÔ6GÔ6KÑ LÔ Lˆˆå Ô × /Ò /°Ñ 8Ô 8ˆØðØ �]Š]‰_Œ_ˆØˆÝ ˜2˜vÑ &Ô &Ð&r&cóò—| ¦«}|r3|j�|jtjjkrt d¦«‚d}n|j€d}n| d¦«}t||¦«S)a$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. Nz%usegmt option requires a UTC datetimeÚGMTz-0000z%z)r`ÚtzinforergrhÚ ValueErrorÚstrftimerb)rnrmÚnowras rrr›sy€ð �,Š,‰.Œ.€CØ ð!Ø Œ9Ð  ¤ ­XÔ->Ô-BÒ BÐ BÝÐDÑEÔEÐ E؈ˆØ ŒÐ ؈ˆà�{Š{˜4Ñ Ô ˆÝ % c¨4Ñ 0Ô 0Ð0r&cóì—ttj¦«dz¦«}tj¦«}t jd¦«}|€d}nd|z}|€t j¦«}d|||||fz}|S)a{Returns a string suitable for RFC 2822 compliant Message-ID, e.g: <142480216486.20800.16526388040877946887@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. édé@Nrú.z<%d.%d.%d%s@%s>)ÚintrdÚosÚgetpidÚrandomÚ getrandbitsÚsocketÚgetfqdn)ÚidstringÚdomainrkÚpidÚrandintÚmsgids rr r ®sx€õ•$”)‘+”+˜c‘/Ñ"Ô"€GÝ Œ)‰+Œ+€CÝÔ  Ñ$Ô$€GØÐ؈ˆà˜‘>ˆØ €~Ý”Ñ!Ô!ˆØ  ¨#¨w¸À&Ð IÑ I€EØ €Lr&c ó—t|¦«}|€tdt|¦«z¦«‚|�^}}|€tj|dd…ŽStj|dd…dtjtj|¬¦«¦«iŽS)Nz!Invalid date value or format "%s"rMrq©Úseconds)rrrr0rergÚ timedelta)ÚdataÚparsed_date_tzÚdtupleÚtzs rrrÅs—€Ý" 4Ñ(Ô(€NØÐÝÐ<½sÀ4¹y¼yÑHÑIÔIÐIØ �K€VˆRØ €zÝÔ  &¨¨!¨¤*Ð-Ð-Ý Ô ˜f R a Rœjð FÝÔ$¥XÔ%7ÀÐ%CÑ%CÔ%CÑDÔDð Fð FðFr&cóB—t|¦«j}|sdS|dS)zÆ Parse addr into its constituent realname and email address parts. Return a tuple of realname and email address, unless the parse fails, in which case return a 2-tuple of ('', ''). )rrr)r@rA)ÚaddrÚaddrss rr r Ðs*€õ ˜Ñ Ô Ô *€EØ ð؈vØ �Œ8€Or&cóL—t|¦«dkr�| d¦«rG| d¦«r2|dd… dd¦« dd¦«S| d¦«r| d¦«r |dd…S|S) zRemove quotes from a string.r[r)éÿÿÿÿz\\ú\z\"úŠ>˜#Ñ Ô ð G 3§<¢<°Ñ#4Ô#4ð GØ�q˜�t”9×$Ò$ V¨TÑ2Ô2×:Ò:¸5À#ÑFÔFÐ FØ �>Š>˜#Ñ Ô ð  3§<¢<°Ñ#4Ô#4ð Ø�q˜�t”9Ð Ø €Jr&cól—| td¦«}t|¦«dkrdd|fS|S)z#Decode string according to RFC 2231rNN)ÚsplitÚTICKr”)rÚpartss rrrês5€à �GŠG•D˜!Ñ Ô €EÝ ˆ5�z„z�Q‚€Ø�T˜1ˆ}ÐØ €Lr&cór—tj |d|pd¬¦«}|€|€|S|€d}|›d|›d|›�S)zÜEncode 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. rr()ÚsafeÚencodingNr)ÚurllibÚparser)rr3Úlanguages rrròsV€õ Œ ×Ò˜1 2°Ð0B¸7ÐÑCÔC€AØ€˜8Ð+؈ØÐØˆØ ˜˜ ( ( (¨A¨AÐ .Ð.r&z&^(?P\w+)\*((?P[0-9]+)\*?)?$cóŽ—|dg}i}|dd…D]Ã\}}| d¦«}t|¦«}t |¦«}|rW| dd¦«\}}|�t |¦«}| |g¦« |||f¦«Œœ| |dt|¦«zf¦«ŒÄ|ré|  ¦«D]Ô\}}g}d} |  ¦«|D]@\}} }|r#tj  | d ¬ ¦«} d } | | ¦«ŒAtt |¦«¦«}| r1t|¦«\} } }| || | d|zff¦«Œº| |d|zf¦«ŒÕ|S) zDecode parameters list according to RFC 2231. params is a sequence of 2-tuples containing (param name, string value). rr[NÚ*r4Únumz"%s"Fzlatin-1)r�T)r–rÚrfc2231_continuationÚmatchÚgroupryÚ setdefaultÚappendrÚitemsÚsortržrŸÚ EMPTYSTRINGr?r) ÚparamsÚ new_paramsÚrfc2231_paramsr4ÚvalueÚencodedÚmor£Ú continuationsÚextendedrr3r s rrrsý€ð ˜”)�€Jð€Nؘa˜b˜b”zð =ð =‰ ˆˆeØ—-’- Ñ$Ô$ˆÝ˜‘”ˆÝ !× 'Ò '¨Ñ -Ô -ˆØ ð =ØŸš ¨Ñ/Ô/‰IˆD�#؈ݘ#‘h”h�Ø × %Ò % d¨BÑ /Ô /× 6Ò 6¸¸UÀGÐ7LÑ MÔ MÐ MÐ Mà × Ò ˜t V­e°E©l¬lÑ%:Ð;Ñ <Ô <Ð <Ð <Øð:Ø#1×#7Ò#7Ñ#9Ô#9ð :ð :Ñ ˆD�-؈E؈Hà × Ò Ñ Ô Ð ð $1ð ð ‘��Q˜Øð$õœ ×,Ò,¨Q¸Ð,ÑCÔC�AØ#�HØ— ’ ˜Q‘”��Ý�+×*Ò*¨5Ñ1Ô1Ñ2Ô2ˆEØð :Ý+9¸%Ñ+@Ô+@Ñ(�˜ 5Ø×!Ò! 4¨'°8¸VÀe¹^Ð)LÐ"MÑNÔNÐNÐNà×!Ò! 4¨°%©Ð"8Ñ9Ô9Ð9Ð9Ø Ðr&r!úus-asciicó—t|t¦«rt|¦«dkrt|¦«S|\}}}|€|}t |d¦«} t |||¦«S#t $rt|¦«cYSwxYw)Nr\zraw-unicode-escape)r/Útupler”rÚbytesr0Ú LookupError)r¯ÚerrorsÚfallback_charsetr3r ÚtextÚrawbytess rrr4sœ€å �e�UÑ #Ô #ð¥s¨5¡z¤z°Q¢ Ý�u‰~Œ~Ðð$Ñ€GˆX�tØ€ð#ˆÝ�TÐ/Ñ0Ô0€HðÝ�8˜W fÑ-Ô-Ð-øÝ ðððå�t‰}Œ}ÐÐÐðøøøsÁA$Á$BÁ?Br‘cód—|€@tj tjj¦« ¦«S|j�| ¦«S| ¦«dd…|fz}tj|¦«}tj |¦«} tj |j ¬¦«}tj||j ¦«}nÀ#t$r³|tjtj|¦«dd…Žz }tjo |jdk}|r tjn tj }|tj |¬¦«kr&tj|tj|¦«}ntj|¦«}YnwxYw| |¬¦«S)aÅReturn 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. Nr‘r†rMr)rq)rertrgrhrjrqr`rdÚmktimerlrˆÚ tm_gmtoffÚtm_zoneÚAttributeErrorÚgmtimeÚdaylightÚtm_isdstÚaltzoneÚtznamer!) rnÚisdstÚtmr‡ÚlocaltmÚdeltarŒÚdstÚgmtoffs rrlrlNs{€ð €zÝÔ ×$Ò$¥XÔ%6Ô%:Ñ;Ô;×FÒFÑHÔHÐHØ „yÐØ�}Š}‰ŒÐð �ЉŒ˜˜˜Ô  ˜xÑ '€BÝŒk˜"‰oŒo€GÝŒn˜WÑ%Ô%€Gð *ÝÔ"¨7Ô+<Ð=Ñ=Ô=ˆÝ Ô ˜u g¤oÑ 6Ô 6ˆˆøÝ ð *ð *ð *ð•XÔ&­¬ °GÑ(<Ô(<¸R¸a¸RÔ(@ÐAÑAˆÝŒmÐ4 Ô 0°1Ò 4ˆØ#&Ð9•4”<�<­D¬MÐ:ˆØ •HÔ&¨vÐ6Ñ6Ô6Ò 6Ð 6ÝÔ" 5­$¬+°cÔ*:Ñ;Ô;ˆBˆBåÔ" 5Ñ)Ô)ˆBøøð *øøøð �:Š:˜Rˆ:Ñ Ô Ð sÂ'4CÃB:FÆF)r)NFF)F)NN)r!r´)Nr‘).Ú__doc__Ú__all__rzÚrerdr|r~reÚ urllib.parseržÚemail._parseaddrrrr@r r rrÚ email.charsetrr>r«Ú UEMPTYSTRINGÚCRLFr™Úcompiler+r-rr%rr rbrrr rr rrrÚASCIIr¤rrrlr_r&rúr×sNðð Ðð ð ð €ð$ € € € Ø € € € Ø € € € Ø € € € Ø € € € Ø€€€ØÐÐÐà"Ð"Ð"Ð"Ð"Ð"Ø8Ð8Ð8Ð8Ð8Ð8Ø&Ð&Ð&Ð&Ð&Ð&àCÐCÐCÐCÐCÐCÐCÐCÐCÐCð"Ð!Ð!Ð!Ð!Ð!à € Ø€ Ø€ Ø €Ø €à ˆRŒZÐ+Ñ ,Ô ,€ Ø ˆBŒJ�xÑ Ô € ð ð ð ð5ð5ð5ðððððDðððððð'ð'ð'ð'ð:1ð1ð1ð1ð&ðððð.FðFðFð ð ð ððððððð /ð /ð /ð /ð"�r”zÐ"KØ„HñôÐð.ð.ð.ð`*3Ø,6ððððð4%!ð%!ð%!ð%!ð%!ð%!r&