3 /fD@sddddgZddlZddlZdZdZdZd d d d d dddddddddddd dddddddgZd d!d"d#d$d%d&gZddddd8d9d:d;dd?d@dAd-Zd.dZ d/d0Z d1dZ d2dZ d3dZ Gd4d5d5ZGd6d7d7eZdS)B mktime_tz parsedate parsedate_tzquoteN z, ZjanZfebZmarZaprZmayZjunZjulZaugsepoctZnovZdecZjanuaryZfebruaryZmarchZaprilZjuneZjulyZaugustZ septemberZoctoberZnovemberZdecemberZmonZtueZwedZthuZfriZsatZsunii,iiXii )ZUTZUTCZGMTZZASTZADTZESTZEDTZCSTZCDTZMSTZMDTZPSTZPDTcCs,t|}|sdS|ddkr$d|d<t|S)N r) _parsedate_tztuple)dataresr(/usr/lib64/python3.6/email/_parseaddr.pyr-s  cCs|sdS|j}|djds.|djtkr6|d=n.|djd}|dkrd|d|dd|d<t|dkr|djd}t|dkr||dd}t|dkr|d}|jd}|dkr|jd}|dkr|d|||dg|dd<n |jdt|d krdS|dd }|\}}}}}|j}|tkrZ||j}}|tkrZdStj |d}|d krz|d 8}|ddkr|dd}|jd }|dkr||}}|ddkr|dd}|dj s||}}|ddkr|dd}|jd }t|d kr$|\} } d } n~t|dkr>|\} } } ndt|dkrd|dkr|djd}t|d kr|\} } d} nt|dkr|\} } } ndSy,t |}t |}t | } t | } t | } Wnt k rdSX|dkr |dkr|d7}n|d7}d} |j }|tkr,t|} n>y t |} Wnt k rNYnX| dkrj|jdrjd} | r| dkrd} | } nd} | | dd| dd} |||| | | ddd| g S)Nr,-+r :0.dDilii<r!r!r!r!r!r!r!r!)splitendswithlower _daynamesrfindlenfindappend _monthnamesindexisdigitint ValueErrorupper _timezones startswith)riZstuffsZddZmmZyyZtmZtzZthhZtmmZtssZtzoffsetZtzsignrrrr 9s     "                       r cCs&t|}t|tr|ddS|SdS)Nr )r isinstancer )rtrrrrs  cCs<|ddkr"tj|dddStj|}||dSdS)Nr rr!)r!)timeZmktimecalendarZtimegm)rr5rrrrs  cCs|jddjddS)N\z\\"z\")replace)strrrrrsc@sxeZdZddZddZddZddZd d Zd d Zd dZ dddZ ddZ ddZ ddZ dddZddZdS) AddrlistClasscCsZd|_d|_d|_d|_|j|j|_|j|j|j|_|jjdd|_||_g|_ dS)Nz ()<>@,:;."[]rz z rr) specialsposLWSZCRFWSatomendsr; phraseendsfield commentlist)selfrDrrr__init__szAddrlistClass.__init__cCsg}x|jt|jkr|j|j|jdkr^|j|jdkrN|j|j|j|jd7_q|j|jdkr|jj|jqPqWtj|S)Nz r() r?r'rDr@r)rE getcomment EMPTYSTRINGjoin)rFZwslistrrrgotonextszAddrlistClass.gotonextcCs>g}x4|jt|jkr8|j}|r,||7}q|jdqW|S)Nr)rr)r?r'rD getaddressr))rFresultZadrrr getaddrlists zAddrlistClass.getaddrlistcCsg|_|j|j}|j}|j}|jg}|jt|jkr\|rXtj|j|dfg}n\|j|jdkr||_||_|j}tj|j|fg}n"|j|jdkrg}t|j}|jd7_x|jt|jkr|j|j|ko|j|jdkr |jd7_P||j }qWn|j|jdkrx|j }|jrftj|ddj|jd |fg}ntj||fg}n@|rtj|j|dfg}n"|j|j|j kr|jd7_|j|jt|jkr|j|jd kr|jd7_|S) Nrz.@rr;)rFZoldposZoldclplistZ returnlistZaddrspecZfieldlenZ routeaddrrrrrMsL &$zAddrlistClass.getaddresscCs|j|jdkrdSd}|jd7_|jd}x|jt|jkr|rV|jd}n~|j|jdkrx|jd7_Pn\|j|jdkr|jd7_d}n8|j|jdkr|jd7_n|j}|jd7_P|jq4W|S) NrQFrr>@Tr)rDr?rLr' getdomainrU)rFZ expectrouteZadlistrrrrV?s. zAddrlistClass.getrouteaddrcCs\g}|jx|jt|jkrd}|j|jdkrj|rL|dj rL|j|jd|jd7_d}nf|j|jdkr|jdt|jn>|j|j|j kr|r|d j r|jPn|j|j |j}|r|r|j|qW|jt|jks|j|jdkrt j |S|jd|jd7_|j|j }|sNt St j ||S) NTrrFr:z"%s"rYr!r!)rLr?r'rDstrippopr)rgetquoterBgetatomrJrKrZ)rFZaslistZ preserve_wsZwsZdomainrrrrU_s: $  zAddrlistClass.getaddrspeccCsg}x|jt|jkr|j|j|jkr8|jd7_q|j|jdkrZ|jj|jq|j|jdkrz|j|jq|j|jdkr|jd7_|jdq|j|jdkrtS|j|j|j krPq|j|j qWtj |S)NrrH[rrY) r?r'rDr@rEr)rIgetdomainliteralrJrBr^rK)rFZsdlistrrrrZs" zAddrlistClass.getdomainTcCs|j|j|krdSdg}d}|jd7_x|jt|jkr|rZ|j|j|jd}np|j|j|kr||jd7_PnN|r|j|jdkr|j|jq.n(|j|jdkrd}n|j|j|j|jd7_q.Wtj|S)NrFrrHr9T)rDr?r'r)rIrJrK)rFZ begincharZendcharsZ allowcommentsZslistrrrr getdelimiteds( zAddrlistClass.getdelimitedcCs|jdddS)Nr:z" F)ra)rFrrrr]szAddrlistClass.getquotecCs|jdddS)NrHz) T)ra)rFrrrrIszAddrlistClass.getcommentcCsd|jdddS)Nz[%s]r_z] F)ra)rFrrrr`szAddrlistClass.getdomainliteralNcCshdg}|dkr|j}xH|jt|jkr\|j|j|kr:Pn|j|j|j|jd7_qWtj|S)Nrr)rBr?r'rDr)rJrK)rFrBZatomlistrrrr^szAddrlistClass.getatomcCsg}x|jt|jkr|j|j|jkr8|jd7_q|j|jdkrX|j|jq|j|jdkrz|jj|jq|j|j|jkrPq|j|j |jqW|S)Nrr:rH) r?r'rDrAr)r]rErIrCr^)rFrWrrrrSszAddrlistClass.getphraselist)T)N)__name__ __module__ __qualname__rGrLrOrMrVrUrZrar]rIr`r^rSrrrrr=s ; & % r=c@sDeZdZddZddZddZddZd d Zd d Zd dZ dS) AddressListcCs&tj|||r|j|_ng|_dS)N)r=rGrO addresslist)rFrDrrrrGs  zAddressList.__init__cCs t|jS)N)r'rf)rFrrr__len__szAddressList.__len__cCsBtd}|jdd|_x$|jD]}||jkr |jj|q W|S)N)rerfr))rFothernewaddrxrrr__add__s   zAddressList.__add__cCs*x$|jD]}||jkr|jj|qW|S)N)rfr))rFrhrjrrr__iadd__ s  zAddressList.__iadd__cCs2td}x$|jD]}||jkr|jj|qW|S)N)rerfr))rFrhrirjrrr__sub__s   zAddressList.__sub__cCs*x$|jD]}||jkr|jj|qW|S)N)rfremove)rFrhrjrrr__isub__s  zAddressList.__isub__cCs |j|S)N)rf)rFr+rrr __getitem__#szAddressList.__getitem__N) rbrcrdrGrgrkrlrmrorprrrrres reipii ipii iDiiiD)__all__r7r8rTrJZ COMMASPACEr*r%r0rr rrrr=rerrrr s6   u   /