mò &U²Ic@s_dZdkZdZdZdZddddd d d d d dddddddd dddddddgZddddd d!d"gZhd#d$<d%d$<d&d$<d'd$<d(d)<d*d+<d,d-<d.d)<d/d0<d1d-<d2d3<d4d0<d5d6<d7d3e fd?„ƒYZ dS(@scEmail address parsing code. Lifted directly from rfc822.py. This should eventually be rewritten. Nt ts, tjantfebtmartaprtmaytjuntjultaugtseptocttnovtdectjanuarytfebruarytmarchtapriltjunetjulytaugustt septembertoctobertnovembertdecembertmonttuetwedtthutfritsattsuntUTitUTCtGMTtZtASTipþÿÿtADTiÔþÿÿtESTi þÿÿtEDTtCSTi¨ýÿÿtCDTtMSTiDýÿÿtMDTtPSTiàüÿÿtPDTc Cs|iƒ}|didƒp|diƒtjo |d=n;|didƒ}|djo|d|d|d@,:;."[]is s t.RN( tselftspecialstpostLWStCRtatomendsR^t phraseendstfieldt commentlist(RbRi((RRt__init__žs     cCsˆx|it|iƒjog|i|i|idjo|id7_q|i|idjo|ii|iƒƒqPqWdS(s*Parse up to the start of the next address.s it(N(RbRdR:RiReRjR>t getcomment(Rb((RRtgotonext°scCsYg}xL|it|iƒjo2|iƒ}|o||7}q |idƒq W|S(sVParse all addresses. Returns a list containing all of the addresses. RN(RR(tresultRbRdR:Rit getaddresstadR>(RbRoRq((RRt getaddrlistºs cCs¶g|_|iƒ|i}|i}|iƒ}|iƒg}|it |i ƒjo.|o#t i |iƒ|dfg}qenÞ|i |idjo=||_||_|i ƒ}t i |iƒ|fg}nŠ|i |idjožg}t |i ƒ}|id7_xK|it |i ƒjoY|iƒ|i|jo+|i |idjo|id7_Pn||iƒ}qWnÕ|i |idjof|iƒ}|io4t i |ƒddi |iƒd |fg}qet i |ƒ|fg}nX|o#t i |iƒ|dfg}n.|i |i|ijo|id7_n|iƒ|it |i ƒjo*|i |id jo|id7_n|S( sParse the next address.is.@R1it;tt@R1( RbRiRdtFalset expectrouteRntadlistR:t getdomaintTrueR}(RbR†R…((RRR€s2     cCsTg}|iƒxÃ|it|iƒjo©|i|idjo |idƒ|id7_ne|i|idjo|id|iƒƒn3|i|i|ijoPn|i|i ƒƒ|iƒqW|it|iƒjp|i|idjot i |ƒSn|idƒ|id7_|iƒt i |ƒ|i ƒS(sParse an RFC 2822 addr-spec.RaiR\s"%s"RƒN( taslistRbRnRdR:RiR>tgetquoteRgtgetatomt EMPTYSTRINGR|R‡(RbR‰((RRR}#s(  0  cCs)g}x|it|iƒjoù|i|i|ijo|id7_q |i|idjo|ii|iƒƒq |i|idjo|i|i ƒƒq |i|idjo |id7_|idƒq |i|i|i joPq |i|i ƒƒq Wt i |ƒS(s-Get the complete domain name from an address.iRlt[RaN(tsdlistRbRdR:RiReRjR>RmtgetdomainliteralRgR‹RŒR|(RbRŽ((RRR‡<s"cCs=|i|i|jodSndg}t}|id7_xð|it|iƒjoÖ|o!|i|i|iƒt}nœ|i|i|jo|id7_Pnq|o1|i|idjo|i|i ƒƒq@n9|i|idjo t }n|i|i|iƒ|id7_q@Wt i|ƒS(sæParse a header fragment delimited by special characters. `beginchar' is the start character for the fragment. If self is not looking at an instance of `beginchar' then getdelimited returns the empty string. `endchars' is a sequence of allowable end-delimiting characters. Parsing stops when one of these is encountered. If `allowcomments' is non-zero, embedded RFC 2822 comments are allowed within the parsed fragment. RiRls\N(RbRiRdt beginchartslistR„R_R:R>tendcharst allowcommentsRmRˆRŒR|(RbRR’R“R‘R_((RRt getdelimitedOs,    cCs|iddtƒS(s1Get a quote-delimited fragment from self's field.R\s" N(RbR”R„(Rb((RRRŠtscCs|iddtƒS(s7Get a parenthesis-delimited fragment from self's field.Rls) N(RbR”Rˆ(Rb((RRRmxscCsd|iddtƒS(s!Parse an RFC 2822 domain-literal.s[%s]Rs] N(RbR”R„(Rb((RRR|scCs“dg}|djo |i}nx`|it|iƒjoF|i|i|joPn|i|i|iƒ|id7_q&Wti |ƒS(sParse an RFC 2822 atom. Optional atomends specifies a different set of end token delimiters (the default is to use self.atomends). This is used e.g. in getphraselist() since phrase endings must not include the `.' (which is legal in phrases).RiN( tatomlistRgR?RbRdR:RiR>RŒR|(RbRgR•((RRR‹€s   cCsïg}xâ|it|iƒjoÈ|i|i|ijo|id7_q |i|idjo|i|iƒƒq |i|idjo|ii|i ƒƒq |i|i|i joPq |i|i |i ƒƒq W|S(sýParse a sequence of RFC 2822 phrases. A phrase is a sequence of words, which are in turn either RFC 2822 atoms or quoted-strings. Phrases are canonicalized by squeezing all runs of continuous whitespace into one space. iR\RlN( RyRbRdR:RiReR>RŠRjRmRhR‹(RbRy((RRRx”s(t__name__t __module__t__doc__RkRnRrRpR€R}R‡RˆR”RŠRmRR?R‹Rx(((RRR`”s    ;   %    t AddressListcBsMtZdZd„Zd„Zd„Zd„Zd„Zd„Zd„Z RS(s@An AddressList encapsulates a list of parsed RFC 2822 addresses.cCs7ti||ƒ|o|iƒ|_n g|_dS(N(R`RkRbRiRrt addresslist(RbRi((RRRk­scCs t|iƒS(N(R:RbRš(Rb((RRt__len__´scCsUtdƒ}|i|_x5|iD]*}||ijo|ii|ƒq#q#W|S(N(R™R?tnewaddrRbRštothertxR>(RbRRœRž((RRt__add__·s   cCs<x5|iD]*}||ijo|ii|ƒq q W|S(N(RRšRžRbR>(RbRRž((RRt__iadd__Às  cCsHtdƒ}x5|iD]*}||ijo|ii|ƒqqW|S(N(R™R?RœRbRšRžRR>(RbRRœRž((RRt__sub__Çs   cCs<x5|iD]*}||ijo|ii|ƒq q W|S(N(RRšRžRbtremove(RbRRž((RRt__isub__Ïs  cCs |i|S(N(RbRšRF(RbRF((RRt __getitem__Ös( R–R—R˜RkR›RŸR R¡R£R¤(((RRR™«s      (R˜RXR{RŒt COMMASPACERER7RORSRWR[R_R`R™( RWR™R`R{R_R7RŒRORERXR[RSR¥((RRt?s N„ V ÿ