U e5d:@sddlZddlmZddlmZddlmZdddgZGdd d Zd d Z d d Z Gdddeej dZ e Gddde Z e ZdS)N)header)charset)_has_surrogatesPolicyCompat32compat32cs<eZdZfddZddZddZddZd d ZZS) _PolicyBasec sH|D]:\}}t||r.tt|||qtd||jjqdSNz*{!r} is an invalid keyword argument for {}) itemshasattrsuperr __setattr__ TypeErrorformat __class____name__)selfkwnamevaluer)/usr/lib64/python3.8/email/_policybase.py__init__)s z_PolicyBase.__init__cCs*dd|jD}d|jjd|S)NcSsg|]\}}d||qS)z{}={!r})r).0rrrrr 8sz(_PolicyBase.__repr__..z{}({})z, )__dict__r rrrjoin)rargsrrr__repr__7sz_PolicyBase.__repr__cKsr|j|j}|jD]\}}t|||q|D]4\}}t||s^td||jj t|||q8|Sr ) r__new__rr objectr r rrr)rrZ newpolicyattrrrrrclone<s z_PolicyBase.clonecCs,t||rd}nd}t||jj|dS)Nz'{!r} object attribute {!r} is read-onlyz!{!r} object has no attribute {!r})r AttributeErrorrrr)rrrmsgrrrr Ns z_PolicyBase.__setattr__cCs|jf|jSN)r#r)rotherrrr__add__Usz_PolicyBase.__add__) r __module__ __qualname__rrr#r r( __classcell__rrrrrs  rcCs,|ddd}|ddd}|d|S)N r)rsplitsplit)docZ added_docrrr _append_doc^sr1cCs|jr(|jdr(t|jdj|j|_|jD]V\}}|jr2|jdr2dd|jDD]*}tt||d}|r\t||j|_q2q\q2|S)N+rcss |]}|D] }|VqqdSr&)mro)rbasecrrr hs z%_extend_docstrings..__doc__)r7 startswithr1 __bases__rr getattr)clsrr"r5r0rrr_extend_docstringscsr<c@seZdZdZdZdZdZdZdZddZ dd Z d d Z e j d d Ze j ddZe j ddZe j ddZe j ddZdS)rFr,Z8bitNNcCs|jr ||||dSr&)raise_on_defectregister_defectrobjZdefectrrr handle_defectszPolicy.handle_defectcCs|j|dSr&)Zdefectsappendr@rrrr?s zPolicy.register_defectcCsdSr&r)rrrrrheader_max_countszPolicy.header_max_countcCstdSr&NotImplementedError)r sourcelinesrrrheader_source_parseszPolicy.header_source_parsecCstdSr&rErrrrrrheader_store_parseszPolicy.header_store_parsecCstdSr&rErIrrrheader_fetch_parses zPolicy.header_fetch_parsecCstdSr&rErIrrrfolds z Policy.foldcCstdSr&rErIrrr fold_binaryszPolicy.fold_binary)rr)r*r>linesepcte_typemax_line_length mangle_from_Zmessage_factoryrBr?rDabcabstractmethodrHrJrKrLrMrrrrrps&2     ) metaclassc@sHeZdZdZddZddZddZdd Zd d Zd d Z ddZ dS)rTcCs0t|ts|St|r(tj|tj|dS|SdS)Nr header_name) isinstancestrrrHeader_charset UNKNOWN8BITrIrrr_sanitize_headers  zCompat32._sanitize_headercCs>|ddd\}}|dd|dd}||dfS)Nr:r-z z )r/lstriprrstrip)rrGrrrrrrH%szCompat32.header_source_parsecCs||fSr&rrIrrrrJ1szCompat32.header_store_parsecCs |||Sr&)r\rIrrrrK7szCompat32.header_fetch_parsecCs|j||ddS)NTsanitize)_foldrIrrrrL>sz Compat32.foldcCs"|j|||jdkd}|ddS)NZ7bitraasciisurrogateescape)rcrOencode)rrrZfoldedrrrrMHs zCompat32.fold_binarycCsg}|d|t|tr\t|rL|rs   L  f