U e5d(@sddlZddlZddlmZmZmZmZddlmZddl m Z ddl m Z ddl mZddd d d d d dgZedZeGdd d eZeZe`ejddZejddZejdddZejddZdS)N)PolicyCompat32compat32_extend_docstrings)_has_surrogates)HeaderRegistry)raw_data_manager) EmailMessagerrr EmailPolicydefaultstrictSMTPHTTPz\n|\rcsleZdZeZdZdZeZe Z fddZ ddZ ddZ d d Zd d Zd dZddZdddZZS)r Flongc s*d|krt|dttjf|dS)Nheader_factory)object __setattr__rsuper__init__)selfkw __class__$/usr/lib64/python3.8/email/policy.pyr]szEmailPolicy.__init__cCs |j|jSN)rZ max_count)rnamerrrheader_max_countdszEmailPolicy.header_max_countcCs>|ddd\}}|dd|dd}||dfS)Nr:z  )splitlstripjoinrstrip)rZ sourcelinesrvaluerrrheader_source_parsevs zEmailPolicy.header_source_parsecCsVt|dr$|j|kr$||fSt|trFt|dkrFtd||||fS)NrrzDHeader values may not contain linefeed or carriage return characters) hasattrrlower isinstancestrlen splitlines ValueErrorrrrr&rrrheader_store_parses zEmailPolicy.header_store_parsecCs*t|dr|Sdt|}|||S)Nrr )r(r$linesep_splitterr"rr/rrrheader_fetch_parses zEmailPolicy.header_fetch_parsecCs|j||ddS)NT refold_binary)_foldr/rrrfoldszEmailPolicy.foldcCs0|j|||jdkd}|jr dnd}||dS)NZ7bitr3utf8asciisurrogateescape)r5Zcte_typer7encode)rrr&Zfoldedcharsetrrr fold_binaryszEmailPolicy.fold_binarycst|dr|j|dS|jr"|jntj|}|jdkp|jdko|rdt|dt|dkptfdd|d dD}|s|rt |r| |d |j|dS|d |j ||j S) Nr)Zpolicyallrrc3s|]}t|kVqdSr)r,).0xmaxlenrr sz$EmailPolicy._fold..rr z: ) r(r6max_line_lengthsysmaxsizer- refold_sourcer,anyrrr$linesep)rrr&r4linesZrefoldrrArr5s     zEmailPolicy._fold)F)__name__ __module__ __qualname__r Zmessage_factoryr7rGrrrZcontent_managerrrr'r0r2r6r<r5 __classcell__rrrrr s=  T)Zraise_on_defectr!)rI)rIrD)r7)rerEZemail._policybaserrrrZ email.utilsrZemail.headerregistryrZemail.contentmanagerrZ email.messager __all__compiler1r r rZcloner r rZSMTPUTF8rrrrs2     @