e^Sr/SQrSSKrSSKrSSKrSSKrSSKJr SSKJ r \ Rr Sr Sr SrS rS rS rS r\ "S 5r\ "S5r\R*"S\R,\R.-5r\R*"S5r\R*"S5r\R6R8rSrSSjr"SS5r"SS5r "SS\!5r"g)z+Header encoding and decoding functionality.)Header decode_header make_headerN)HeaderParseError)charset   z Nz us-asciizutf-8ai =\? # literal =? (?P[^?]*?) # non-greedy up to the next ? is the charset \? # literal ? (?P[qQbB]) # either a "q" or a "b", case insensitive \? # literal ? (?P.*?) # non-greedy up to the next ?= is the encoded string \?= # literal ?= z[\041-\176]+:$z \n[^ \t]+:c [US5(aJURVVs/sH0up[R"U[ U55[ U54PM2 snn$[ R U5(dUS4/$/nUR5Hn[ RU5nSnU(dM#URS5nU(aUR5nSnU(aURUSS45 U(abURS5R5nURS5R5nURS5n URXU45 U(aMM /n [U5H]upU S:dM U S(dMX;S- S(dM*X;S- SR5(dMIU RU S- 5 M_ [U 5Hn X= M /nUHupnUcURX45 MUS:Xa4[ R"R%U5nURUU45 MWUS :XaU['U5S -nU(a US SS U- - n[ R(R+U5nURUU45 M[3S U-5e /nS=nnUHeunn[5U[5(a [7US5nUcUnUnM0UU:waURUU45 UnUnMOUcU[8U-- nM`UU- nMg URUU45 U$s snnf![,R.a [1S 5ef=f)aDecode a message header value without converting charset. Returns a list of (string, charset) pairs containing each of the decoded parts of the header. Charset is None for non-encoded parts of the header, otherwise a lower-case string containing the name of the character set specified in the encoded string. header may be a string that may or may not contain RFC2047 encoded words, or it may be a Header object. An email.errors.HeaderParseError may be raised when certain decoding error occurs (e.g. a base64 decoding exception). _chunksNTrFqbz===zBase64 decoding errorzUnexpected encoding: zraw-unicode-escape)hasattrr_charset_encodestrecresearch splitlinessplitpoplstripappendlower enumerateisspacereversedemail quoprimime header_decodelen base64mimedecodebinasciiErrorrAssertionError isinstancebytesBSPACE)headerstringrwordslinepartsfirst unencodedencodingencodeddroplistnwd decoded_wordsencoded_stringwordpaderr collapsed last_word last_charsets 2/opt/imh/python3.13/lib/python3.13/email/header.pyrr;s<vy!!+1>>;+9!!&#g,7WF+9; ; ;;v   E!!# 4 e ! I%,,.  it45))A,,,. 99Q<--/))A, g9:e$"H%  Q31Q44EA#JqMMeaCjm.C.C.E.E OOAaC !h  H M-2)'    .!: ; _##11.AD  $ 1 _(1,F% V"44 6''..~>$$dG_5 !88!CD D%.3*I##I & g dC 34D  I"L  $   i6 7I"L  ! $ &I  I'i./ W;d>> @&'>?? @s7L9/L?? Mc[XUS9nUH9upVUb [U[5(d [U5nURXV5 M; U$)aCreate a Header from a sequence of pairs as returned by decode_header() decode_header() takes a header value string and returns a sequence of pairs of the format (decoded_string, charset) where charset is the string name of the character set. This function takes one of those sequence of pairs and returns a Header instance. Optional maxlinelen, header_name, and continuation_ws are as in the Header constructor. ) maxlinelen header_namecontinuation_ws)rr-Charsetr) decoded_seqrFrGrHhsrs rDrrsN *. 0A!   z'7'C'Cg&G  " HcP\rSrSrS SjrSrSrS SjrSrS Sjr S r S r g)rNcUc[nO [U[5(d [U5nX lXPl/UlUbUR XU5 Uc[nX0lUcSUl g[U5S-Ul g)aCreate a MIME-compliant header that can contain many character sets. Optional s is the initial header value. If None, the initial header value is not set. You can later append to the header with .append() method calls. s may be a byte string or a Unicode string, but see the .append() documentation for semantics. Optional charset serves two purposes: it has the same meaning as the charset argument to the .append() method. It also sets the default character set for all subsequent .append() calls that omit the charset argument. If charset is not provided in the constructor, the us-ascii charset is used both as s's initial charset and as the default for subsequent .append() calls. The maximum line length can be specified explicitly via maxlinelen. For splitting the first line to a shorter value (to account for the field header which isn't included in s, e.g. `Subject') pass in the name of the field in header_name. The default maxlinelen is 78 as recommended by RFC 2822. continuation_ws must be RFC 2822 compliant folding whitespace (usually either a space or a hard tab) which will be prepended to continuation lines. errors is passed through to the .append() call. Nrr) USASCIIr-rIr_continuation_wsrr MAXLINELEN _maxlinelen _headerlenr')selfrLrrFrGrHerrorss rD__init__Header.__init__s{: ?GGW--g&G / = KKF +  #J%  DO"+.2DOrMc8UR5 /nSnSnURHupEUnU[R:Xa$UR SS5nUR SS5nU(ajU=(a UR US5nUS;a%US;aU(dUR[5 SnO"US;aU(dUR[5 U=(a UR US5nUnURU5 M [RU5$)z&Return the string value of the header.NasciisurrogateescapereplacerNr ) _normalizerr UNKNOWN8BITencoder) _nonctextrSPACE EMPTYSTRINGjoin) rVuchunkslastcs lastspacer1rnextcsoriginal_byteshasspaces rD__str__Header.__str__s  #||OFF---!'w8I!J'..w B!?dnnVAY&?!33!33Hu-!%#55iNN5)=4>>&*#=IF NN6 "+ ,,((rMcU[U5:H$N)r)rVothers rD__eq__ Header.__eq__sD !!rMcUc URnO [U[5(d [U5n[U[5(dMUR=(d SnU[R :XaUR SS5nOUR XC5nUR=(d SnU[R :waURXS5 URRX45 g![a US:wae[nN6f=f)aAppend a string to the MIME header. Optional charset, if given, should be a Charset instance or the name of a character set (which will be converted to a Charset instance). A value of None (the default) means that the charset given in the constructor is used. s may be a byte string or a Unicode string. If it is a byte string (i.e. isinstance(s, str) is false), then charset is the encoding of that byte string, and a UnicodeError will be raised if the string cannot be decoded with that charset. If s is a Unicode string, then charset is a hint specifying the character set of the characters in the string. In either case, when producing an RFC 2822 compliant header using RFC 2047 rules, the string will be encoded using the output codec of the charset. If the string cannot be encoded to the output codec, a UnicodeError will be raised. Optional `errors' is passed as the errors argument to the decode call if s is a byte string. Nr r\) rr-rIr input_codecrar) output_codecrbUnicodeEncodeErrorUTF8rr)rVrLrrW input_charsetoutput_charsets rDr Header.appends* ?mmGGW--g&G!S!!#//=:M 4 44HHZ):;HH]3!--; X11 1 0 QL) & !:- s=C++DDc:UR5=(d US;$)z=True if string s is not a ctext character of RFC822. )()\)r")rVrLs rDrcHeader._nonctext0syy{3a#333rMcUR5 Uc URnUS:XaSn[URUURU5nSnS=pgUR GHupUb^U=(a UR US5nUS;aU(aU S;aUR5 OU S;aU(dUR5 U=(a UR US5nU nSnUR5n U (aURSU SU 5 OURSSU 5 U SSHn UR5 U Rb0URURS U R5-U 5 MPU R5n U S[U 5[U 5- n URXU 5 M [U 5S:dGMpUR5 GM UR (aUR5 URU5n[R!U5(a[#S R%U55eU$) aEncode a message header into an RFC-compliant format. There are many issues involved in converting a given string for use in an email header. Only certain character sets are readable in most email clients, and as header strings can only contain a subset of 7-bit ASCII, care must be taken to properly convert and encode (with Base64 or quoted-printable) header strings. In addition, there is a 75-character length limit on any given encoded header field, so line-wrapping must be performed, even with double-byte character sets. Optional maxlinelen specifies the maximum length of each generated line, exclusive of the linesep string. Individual lines may be longer than maxlinelen if a folding point cannot be found. The first line will be shorter by the length of the header name plus ": " if a header name was specified at Header construction time. The default value for maxlinelen is determined at header construction time. Optional splitchars is a string containing characters which should be given extra weight by the splitting algorithm during normal header wrapping. This is in very rough support of RFC 2822's `higher level syntactic breaks': split points preceded by a splitchar are preferred during line splitting, with the characters preferred in the order in which they appear in the string. Space and tab may be included in the string to indicate whether preference should be given to one over the other as a split point when other split chars do not appear in the line being split. Splitchars does not affect RFC 2047 encoded lines. Optional linesep is a string to be used to separate the lines of the value. The default value is the most useful for typical Python applications, but it can be set to \r\n to produce RFC-compliant line separators when needed. Nri@Br^r_Fr rr z8header value appears to contain an embedded header: {!r})r`rT_ValueFormatterrUrRrrcadd_transitionrfeednewlineheader_encodingrr'_str_embedded_headerrrformat)rV splitcharsrFlinesep formatterrhrlrir1rlinesr3slinefwsvalues rDrb Header.encode5sB   ))J ? J#DOOZ$($9$9:G ###||OF#!?dnnVAY&?!33#w6H'H!002$66y,,.=4>>&*#=IFH%%'Er58W5r2w/ab !!#**6NN4#8#8# :M#*,!KKME4D #e* 45CNN3w7"5zA~!!#5 ,6 <<  $ $ &w'  " "5 ) )"$++16%=: : rMc,/nSn/nURHKupEXR:XaURU5 MUb&UR[RU5U45 U/nUnMM U(a&UR[RU5U45 Xlgrp)rrrdrf)rVchunksrC last_chunkr1rs rDr`Header._normalizes  #||OF&!!&)+MM5::j#9<"HI$X &  ,  MM5::j1<@ A rM)rrrRrUrT)NNNNr strict)Nr)z;, Nr) __name__ __module__ __qualname____firstlineno__rXrmrrrrcrbr`__static_attributes__rMrDrrs3'+.2-5-3^)@" )*V4 N`rMrcJ\rSrSrSrSrSrSrSrSr Sr S r S r S r g ) ricvX lX0l[U5UlX@l/Ul[ U5Ulgrp)_maxlenrRr'_continuation_ws_len _splitchars_lines _Accumulator _current_line)rV headerlenmaxlenrHrs rDrX_ValueFormatter.__init__s4 /$'$8!% ))4rMcXUR5 URUR5$rp)rrfr)rVrs rDr_ValueFormatter._strs ||DKK((rMc,UR[5$rp)rNLrVs rDrm_ValueFormatter.__str__syy}rMcURR5nUS:waURR"U6 [UR5S:aURR 5(a<UR (a+UR S==[ UR5- ss'O.UR R[ UR55 URR5 g)N)r r rr_) rrpushr' is_onlywsrrrreset)rV end_of_lines rDr_ValueFormatter.newlines((,,. ) #    # #[ 1 t!! "Q &!!++--$++ B3t'9'9#:: ""3t'9'9#:;   "rMc<URRSS5 g)Nr r )rrrs rDr_ValueFormatter.add_transitions R(rMcURcURXUR5 gURX R 55nUR S5nUbURX5 UR 5nUR5 URRURU5 UH+nURRURU-5 M- g![ a gf=f![ a gf=fNr)r _ascii_splitrheader_encode_lines _maxlengthsr IndexError _append_chunkrrrrRrr)rVrr1r encoded_lines first_line last_liner3s rDr_ValueFormatter.feeds  " " *   c4+;+; <  33Fq@!RHAzz||"003A63q62:!#11!A#6q9HxHRL"$4I'!..224 %%33a7LLN"""''2**33A6I KK  s4#5#56 7    $ $Y /9 2rM)rRrrrrrN)rrrrrXrrmrrrrrrrrrMrDrrs05) #)#=J; *,0rMrcp^\rSrSrS U4SjjrSrS SjrU4SjrSrSr S Sjr S r U4S jr S r U=r$)ric.>Xl[TU] 5 grp)rsuperrX)rV initial_size __class__s rDrX_Accumulator.__init__s) rMc(URX45 grp)r)rVrr1s rDr_Accumulator.pushs SM"rMcXSn/XS&U$rpr)rVrpoppeds rDr_Accumulator.pop_from!sbR rMcJ>UR5S:Xag[TU] 5$)Nr)r r )rrrrVrs rDr_Accumulator.pop&s! ?? a w{}rMc<[SU5UR5$)Nc3T# UHup[U5[U5-v M g7frp)r'.0rrs rD '_Accumulator.__len__..,s=93CHSY&s&()sumrrs rD__len___Accumulator.__len__+s ==%%' 'rMc:[RSU55$)Nc3R# UHup[RX45v M g7frprerfrs rDr'_Accumulator.__str__..0s)!715IC"-!1!13+!>!>15s%'rrs rDrm_Accumulator.__str__/s"!715!78 8rMc$Uc/nXSS&SUlgrr)rVstartvals rDr_Accumulator.reset3s  HQrMc|URS:H=(a' U(+=(d [U5R5$r)rrr"rs rDr_Accumulator.is_onlyws9s,!!1$Jd(*Ic$i6G6G6IJrMc >[TU]5$rp)rrrs rDr_Accumulator.part_count<sw  rMr)rrp)rrrrrXrrrrrmrrrr __classcell__)rs@rDrrs6#  '8 K!!rMr)NNr )#__doc____all__rr*email.quoprimimer$email.base64mime email.errorsrrrrIrrdr/SPACE8rerSrrQrxcompileVERBOSE MULTILINErfcrerr% _max_appendrrrrlistrrrMrDrs 2   )%           * w zz zzBLL " zz#$::m,** [|;? # ,ffR}0}0@%!4%!rM