Vc\)cs|ddlZddlZddlZddlZddlmZGddZeZddZe dedZ d D]Z e e e [ d Z d D]Ze d eze [d Ze dedZdZdZdZ ddZeee ddZeejje ddZeeefD]Zeee[dS)N) quoprimimecs2eZdZdZdZdZdZdZdZdS)ContentManagercs"i|_i|_dSN) get_handlers set_handlers)self -/usr/lib64/python3.11/email/contentmanager.py__init__zContentManager.__init__ sc||j|<dSr)r)rkeyhandler radd_get_handlerzContentManager.add_get_handler s!(#r cs0|}||jvr|j||g|Ri|S|}||jvr|j||g|Ri|Sd|jvr|jd|g|Ri|St|)N)Zget_content_typerget_content_maintypeKeyError)rmsgargskwZ content_typemaintype r get_contentzContentManager.get_contents++-- 4, , E24$\23DDDDDD D++-- t( ( A.4$X.s@T@@@R@@ @ " " ;(4$R(:t:::r:: :|$$$r cr r)r)rZtypekeyr rradd_set_handlerzContentManager.add_set_handlers%,'"""r cs|dkrtd|||}||||g|Ri|dS)NZ multipartz"set_content not valid on multipart)rZ TypeError_find_set_handlerZ clear_content)rrobjrrr rr set_contentzContentManager.set_contents|  # # % % 4 B@AA A((c22 S&4&&&2&&&&&r csd}t|jD]}||jvr|j|cS|j}t |dd}|rd||fn|}||}||jvr|j|cS||jvr|j|cS|j}||jvr|j|cSd|jvr |jdSt|)N __module__rz.)ZtypeZ__mro__r __qualname__Zgetattrjoin__name__r) rrrZfull_path_for_errortypZqnameZmodnameZ full_pathname rrz ContentManager._find_set_handler's0"99$ / /Cd'' .(----$Ec<44G6=H'5!12225I" 0&/#D-- 4(3333)) 0(////ooTo**GmmIw//G >>'&> 1 11r textcs.|dS)NTr&r*rrrget_non_text_contentr/Gs ??$? ' ''r zaudio image video applicationcs,|dSNrr-r.rrget_message_contentr1Ns ??1  r zrfc822 external-bodyzmessage/csFt|dSr0)bytesr*r.rr%get_and_fixup_unknown_message_contentr3Us ## $ $$r messagecsd||f|d<|rt|dds|jfd|D} |D] }|jr |jd|||j<!dS#t jj$rA}td | |j|d}~wwxYwdS)Nz/z Content-Typerr"csLg|] }j|g!Sr$)Zheader_factoryZheader_source_parse).0headermps rz z _prepare_set..fsC...!)r("*@*@&*J*JK...r zInvalid header: {})policy) rZhasattrr8Zdefectsr"emailr)Z HeaderDefect ValueErrorformatZfold)rrsubtypeheadersr6Zexcr7s @r _prepare_setr>as'((Hg#677C Jwqz6** .B....%,...G J! * *>, .++#)FK   * *|( J J J188 & 3: > >@@AAFI J J J Js #A//C.embedded_bodysW\\%%8%87%BBr cs2d|dzS)Ns rL)rMrr normal_bodyz!_encode_text..normal_bodys5::e#4#4u#<z_encode_text..s(&&1A&&&&&&r r)Zdefault7bit8bitsurrogateescapei zlatin-1base64quoted-printablez$Unknown content transfer encoding {})ZencodeZ splitlinesrNZmaxrJr'ZUnicodeDecodeErrorZcte_typerZ body_encoderGrHrFrKr:r;) stringr(cter8rMrOrPZsniffZsniff_qpZ sniff_base64rIrNs @r _encode_textrXs MM' " " - - / /En##G,,GBBBBB<<< % &&&&& 2 2 2f6L L U {{51188AAAA%    &( U{{51188BSTTTT eCRCj)))%,,y*A*A*0*@BB*511 x==3|,, , %CC$C5zzR %H}$ f} M{5!!((11 M{5!!((2CDD " "M%kk%&8&8&?&? &J&J&,&<>> MmmE22F4JKK?FFsKKLLL 9s3B B B plainutf-8c s.t|d|| t||||j\}} || |dt jj||d||d<t|||||dS)Nr,r(Tr%Content-Transfer-Encoding) r>rXr8 set_payloadr@r9r(ZALIASESZgetrD) rrVr<r(rWrAr?rBrCr=Zpayloads rset_text_contentr^sfgw///cjAALCOOGMM)-'++GW==   (+C#$#{Hc6:::::r rfc822c s||dkrtd|dkr-|dvr"td||dn|}n3|dkr)|dvr"td |d }n|d }t|d ||||g||d <t |||||dS) NZpartialz4message/partial is not supported for Message objectsr_)NrQrRbinaryz*message/rfc822 parts do not support cte={}rRz external-body)NrQz1message/external-body parts do not support cte={}rQr4r\)r:r;r>r]rD) rr4r<rWrAr?rBrCr=r#rset_message_contentras)QOPPP( 6 6 J<CCCHHJJ J,ff O #  n $ QCJJ3OOQQ Q i'222OOWI'*C#$#{Hc6:::::r rTc st|||| |dkrt||jj}nj|dkr.t j|ddd}|d}n6|dkr|d}n|d vr|dd }||||d <t|||||dS) NrT)rJrUFT)Zistextr6Z quotetabsrErQ)rRr`rSr\) r>rKr8rJrGZb2a_qpr'r]rD) rrIrr<rWrAr?rBrCr=s rset_bytes_contentrbsh111 h 7dCJ4NOOO " " 7tE%4PPP{{7## 7{{7## " "7{{7$566OOD'*C#$#{Hc6:::::r r[)rYrZNNNNNN)r_NNNNNN)rTNNNNN)rGZ email.charsetr9Z email.messageZ email.errorsrrZraw_data_managerr+rr/Zsplitrr1r<r3r>rDrKrXr^rZstrrar4ZMessagerbr2Z bytearrayZ memoryviewr!r$r rrcs3,3,3,3,3,3,3,3,l">##2222 )9:::(((/5577EEH$$X/CDDDD %++--NNG$$Z%79LMMMM %%% !FHHHJJJ"&&&*"""$$$NIM:>*. ; ; ; ; &6777=A<@,0;;;;< !68KLLL9A:>*.;;;;& 9j )==C$$S*;<<<<CCr