/usr/lib64/python3.9/email/__pycache__
NameSizeModeActions
base64mime.cpython-39.opt-1.pyc32390644editdlrm
base64mime.cpython-39.opt-2.pyc14620644editdlrm
base64mime.cpython-39.pyc32390644editdlrm
charset.cpython-39.opt-1.pyc114320644editdlrm
charset.cpython-39.opt-2.pyc51030644editdlrm
charset.cpython-39.pyc114530644editdlrm
contentmanager.cpython-39.opt-1.pyc73600644editdlrm
contentmanager.cpython-39.opt-2.pyc73600644editdlrm
contentmanager.cpython-39.pyc73600644editdlrm
encoders.cpython-39.opt-1.pyc16220644editdlrm
encoders.cpython-39.opt-2.pyc12710644editdlrm
encoders.cpython-39.pyc16220644editdlrm
errors.cpython-39.opt-1.pyc60770644editdlrm
errors.cpython-39.opt-2.pyc46110644editdlrm
errors.cpython-39.pyc60770644editdlrm
feedparser.cpython-39.opt-1.pyc104880644editdlrm
feedparser.cpython-39.opt-2.pyc88250644editdlrm
feedparser.cpython-39.pyc106090644editdlrm
generator.cpython-39.opt-1.pyc131840644editdlrm
generator.cpython-39.opt-2.pyc94850644editdlrm
generator.cpython-39.pyc131840644editdlrm
header.cpython-39.opt-1.pyc164320644editdlrm
header.cpython-39.opt-2.pyc108080644editdlrm
header.cpython-39.pyc164320644editdlrm
headerregistry.cpython-39.opt-1.pyc219300644editdlrm
headerregistry.cpython-39.opt-2.pyc161670644editdlrm
headerregistry.cpython-39.pyc219660644editdlrm
iterators.cpython-39.opt-1.pyc19310644editdlrm
iterators.cpython-39.opt-2.pyc13110644editdlrm
iterators.cpython-39.pyc19310644editdlrm
message.cpython-39.opt-1.pyc379070644editdlrm
message.cpython-39.opt-2.pyc213490644editdlrm
message.cpython-39.pyc379070644editdlrm
parser.cpython-39.opt-1.pyc57460644editdlrm
parser.cpython-39.opt-2.pyc27280644editdlrm
parser.cpython-39.pyc57460644editdlrm
policy.cpython-39.opt-1.pyc96390644editdlrm
policy.cpython-39.opt-2.pyc34240644editdlrm
policy.cpython-39.pyc96390644editdlrm
quoprimime.cpython-39.opt-1.pyc76740644editdlrm
quoprimime.cpython-39.opt-2.pyc41990644editdlrm
quoprimime.cpython-39.pyc76740644editdlrm
utils.cpython-39.opt-1.pyc127350644editdlrm
utils.cpython-39.opt-2.pyc89620644editdlrm
utils.cpython-39.pyc127350644editdlrm
_encoded_words.cpython-39.opt-1.pyc57070644editdlrm
_encoded_words.cpython-39.opt-2.pyc38210644editdlrm
_encoded_words.cpython-39.pyc57070644editdlrm
_header_value_parser.cpython-39.opt-1.pyc803130644editdlrm
_header_value_parser.cpython-39.opt-2.pyc633810644editdlrm
_header_value_parser.cpython-39.pyc803450644editdlrm
_parseaddr.cpython-39.opt-1.pyc123930644editdlrm
_parseaddr.cpython-39.opt-2.pyc94330644editdlrm
_parseaddr.cpython-39.pyc123930644editdlrm
_policybase.cpython-39.opt-1.pyc152660644editdlrm
_policybase.cpython-39.opt-2.pyc60130644editdlrm
_policybase.cpython-39.pyc152660644editdlrm
__init__.cpython-39.opt-1.pyc16670644editdlrm
__init__.cpython-39.opt-2.pyc10420644editdlrm
__init__.cpython-39.pyc16670644editdlrm
Edit: /usr/lib64/python3.9/email/__pycache__/headerregistry.cpython-39.opt-1.pyc (21930B)
a ´i”Pã@szdZddlmZddlmZddlmZddlmZGdd„dƒZGdd „d ƒZ Gd d „d e ƒZ d d „Z Gdd„dƒZ Gdd„de ƒZGdd„dƒZGdd„deƒZGdd„dƒZGdd„deƒZGdd„deƒZGdd„deƒZGdd„dƒZGd d!„d!ƒZGd"d#„d#eƒZGd$d%„d%eƒZGd&d'„d'ƒZGd(d)„d)ƒZeeeeeeeeeeeeeeeeeeeed*œZGd+d,„d,ƒZd-S).a;Representing and manipulating email headers via custom objects. This module provides an implementation of the HeaderRegistry API. The implementation is designed to flexibly follow RFC5322 rules. Eventually HeaderRegistry will be a public API, but it isn't yet, and will probably change some before that happens. é)ÚMappingProxyType)Úutils)Úerrors)Ú_header_value_parserc@s^eZdZddd„Zedd„ƒZedd„ƒZed d „ƒZed d „ƒZd d„Z dd„Z dd„Z dS)ÚAddressÚNcCsœd td||||fƒ¡}d|vs(d|vr0tdƒ‚|dur†|s@|rHtdƒ‚t |¡\}}|rjtd ||¡ƒ‚|jrz|jd‚|j}|j }||_ ||_ ||_ dS) a÷Create an object representing a full email address. An address can have a 'display_name', a 'username', and a 'domain'. In addition to specifying the username and domain separately, they may be specified together by using the addr_spec keyword *instead of* the username and domain keywords. If an addr_spec string is specified it must be properly quoted according to RFC 5322 rules; an error will be raised if it is not. An Address object has display_name, username, domain, and addr_spec attributes, all of which are read-only. The addr_spec and the string value of the object are both quoted according to RFC5322 rules, but without any Content Transfer Encoding. rNú Ú z8invalid arguments; address parts cannot contain CR or LFz=addrspec specified when username and/or domain also specifiedz6Invalid addr_spec; only '{}' could be parsed from '{}'r) ÚjoinÚfilterÚ ValueErrorÚ TypeErrorÚparserZ get_addr_specÚformatÚ all_defectsÚ local_partÚdomainÚ _display_nameÚ _usernameÚ_domain)ÚselfÚ display_nameÚusernamerÚ addr_specZinputsZa_sÚrest©rú,/usr/lib64/python3.9/email/headerregistry.pyÚ__init__s$þ zAddress.__init__cCs|jS©N©r©rrrrr<szAddress.display_namecCs|jSr)rr rrrr@szAddress.usernamecCs|jSr)rr rrrrDszAddress.domaincCs<|j}tj |¡st |¡}|jr0|d|jS|s8dS|S)z“The addr_spec (username@domain) portion of the address, quoted according to RFC 5322 rules, but with no Content Transfer Encoding. ú@ú<>)rrZ DOT_ATOM_ENDSÚ isdisjointÚ quote_stringr)rZlprrrrHs  zAddress.addr_speccCsd |jj|j|j|j¡S)Nz1{}(display_name={!r}, username={!r}, domain={!r}))rÚ __class__Ú__name__rrrr rrrÚ__repr__Vs þzAddress.__repr__cCsF|j}tj |¡st |¡}|r@|jdkr.dn|j}d ||¡S|jS)Nr"rz{} <{}>)rrÚSPECIALSr#r$rr)rÚdisprrrrÚ__str__[s   zAddress.__str__cCs2t|tƒstS|j|jko0|j|jko0|j|jkSr)Ú isinstancerÚNotImplementedrrr©rÚotherrrrÚ__eq__ds   ÿ þzAddress.__eq__)rrrN) r&Ú __module__Ú __qualname__rÚpropertyrrrrr'r*r/rrrrrs *     rc@sFeZdZddd„Zedd„ƒZedd„ƒZdd „Zd d „Zd d „Z dS)ÚGroupNcCs||_|rt|ƒntƒ|_dS)aCreate an object representing an address group. An address group consists of a display_name followed by colon and a list of addresses (see Address) terminated by a semi-colon. The Group is created by specifying a display_name and a possibly empty list of Address objects. A Group can also be used to represent a single address that is not in a group, which is convenient when manipulating lists that are a combination of Groups and individual Addresses. In this case the display_name should be set to None. In particular, the string representation of a Group whose display_name is None is the same as the Address object, if there is one and only one Address object in the addresses list. N)rÚtupleÚ _addresses)rrÚ addressesrrrrnszGroup.__init__cCs|jSrrr rrrr€szGroup.display_namecCs|jSr)r5r rrrr6„szGroup.addressescCsd |jj|j|j¡S)Nz${}(display_name={!r}, addresses={!r})rr%r&rr6r rrrr'ˆsþzGroup.__repr__cCs||jdur&t|jƒdkr&t|jdƒS|j}|durJtj |¡sJt |¡}d dd„|jDƒ¡}|rld|n|}d  ||¡S)Nérú, css|]}t|ƒVqdSr©Ústr)Ú.0ÚxrrrÚ “óz Group.__str__..ú z{}:{};) rÚlenr6r:rr(r#r$r r)rr)Zadrstrrrrr*�s z Group.__str__cCs&t|tƒstS|j|jko$|j|jkSr)r+r3r,rr6r-rrrr/—s    ÿz Group.__eq__)NN) r&r0r1rr2rr6r'r*r/rrrrr3ls    r3c@sTeZdZdZdd„Zdd„Zedd„ƒZedd „ƒZd d „Z e d d „ƒZ dd„Z dS)Ú BaseHeadera|Base class for message headers. Implements generic behavior and provides tools for subclasses. A subclass must define a classmethod named 'parse' that takes an unfolded value string and a dictionary as its arguments. The dictionary will contain one key, 'defects', initialized to an empty list. After the call the dictionary must contain two additional keys: parse_tree, set to the parse tree obtained from parsing the header, and 'decoded', set to the string value of the idealized representation of the data from the value. (That is, encoded words are decoded, and values that have canonical representations are so represented.) The defects key is intended to collect parsing defects, which the message parser will subsequently dispose of as appropriate. The parser should not, insofar as practical, raise any errors. Defects should be added to the list instead. The standard header parsers register defects for RFC compliance issues, for obsolete RFC syntax, and for unrecoverable parsing errors. The parse method may add additional keys to the dictionary. In this case the subclass must define an 'init' method, which will be passed the dictionary as its keyword arguments. The method should use (usually by setting them as the value of similarly named attributes) and remove all the extra keys added by its parse method, and then use super to call its parent class with the remaining arguments and keywords. The subclass should also make sure that a 'max_count' attribute is defined that is either None or 1. XXX: need to better define this API. cCs`dgi}| ||¡t |d¡r4t |d¡|d<t ||d¡}|d=|j|fi|¤Ž|S)NÚdefectsÚdecoded)ÚparserZ_has_surrogatesÚ _sanitizer:Ú__new__Úinit)ÚclsÚnameÚvalueÚkwdsrrrrrFÂs zBaseHeader.__new__cCs||_||_||_dSr)Ú_nameÚ _parse_treeÚ_defects)rrIÚ parse_treerBrrrrGÌszBaseHeader.initcCs|jSr)rLr rrrrIÑszBaseHeader.namecCs t|jƒSr)r4rNr rrrrBÕszBaseHeader.defectscCst|jj|jjt|ƒf|jfSr)Ú_reconstruct_headerr%r&Ú __bases__r:Ú__dict__r rrrÚ __reduce__ÙsýùzBaseHeader.__reduce__cCs t ||¡Sr)r:rF)rHrJrrrÚ _reconstructãszBaseHeader._reconstructc Cs`t t t |jd¡t dd¡g¡g¡}|jrH| t t dd¡g¡¡| |j¡|j |d�S)atFold header according to policy. The parsed representation of the header is folded according to RFC5322 rules, as modified by the policy. If the parse tree contains surrogateescaped bytes, the bytes are CTE encoded using the charset 'unknown-8bit". Any non-ASCII characters in the parse tree are CTE encoded using charset utf-8. XXX: make this a policy setting. The returned value is an ASCII-only string possibly containing linesep characters, and ending with a linesep character. The string includes the header name and the ': ' separator. z header-nameú:z header-sepr?Zfws)Úpolicy) rZHeaderZ HeaderLabelZ ValueTerminalrIrMÚappendZCFWSListZWhiteSpaceTerminalÚfold)rrVÚheaderrrrrXçs  þÿÿ zBaseHeader.foldN) r&r0r1Ú__doc__rFrGr2rIrBrSÚ classmethodrTrXrrrrrA s      rAcCst||iƒ |¡Sr)ÚtyperT)Úcls_nameÚbasesrJrrrrPsrPc@s&eZdZdZeejƒZedd„ƒZ dS)ÚUnstructuredHeaderNcCs"| |¡|d<t|dƒ|d<dS)NrOrC)Ú value_parserr:©rHrJrKrrrrD szUnstructuredHeader.parse) r&r0r1Ú max_countÚ staticmethodrÚget_unstructuredr`r[rDrrrrr_s r_c@seZdZdZdS)ÚUniqueUnstructuredHeaderr7N©r&r0r1rbrrrrresrecsFeZdZdZdZeejƒZe dd„ƒZ ‡fdd„Z e dd„ƒZ ‡ZS) Ú DateHeadera‘Header whose value consists of a single timestamp. Provides an additional attribute, datetime, which is either an aware datetime using a timezone, or a naive datetime if the timezone in the input string is -0000. Also accepts a datetime as input. The 'value' attribute is the normalized form of the timestamp, which means it is the output of format_datetime on the datetime. NcCsz|s6|d t ¡¡d|d<d|d<t ¡|d<dSt|tƒrJt |¡}||d<t  |d¡|d<|  |d¡|d<dS)NrBÚdatetimerrCrO) rWrZHeaderMissingRequiredValuerZ TokenListr+r:rZparsedate_to_datetimeZformat_datetimer`rarrrrD(s   zDateHeader.parsecs"| d¡|_tƒj|i|¤ŽdS)Nrh)ÚpopÚ _datetimeÚsuperrG©rÚargsÚkw©r%rrrG6s zDateHeader.initcCs|jSr)rjr rrrrh:szDateHeader.datetime)r&r0r1rZrbrcrrdr`r[rDrGr2rhÚ __classcell__rrrorrgs   rgc@seZdZdZdS)ÚUniqueDateHeaderr7Nrfrrrrrq?srqcsPeZdZdZedd„ƒZedd„ƒZ‡fdd„Ze dd „ƒZ e d d „ƒZ ‡Z S) Ú AddressHeaderNcCst |¡\}}|Sr)rZget_address_list)rJÚ address_listrrrr`HszAddressHeader.value_parsercCs¾t|tƒrV| |¡|d<}g}|jD]"}| t|jdd„|jDƒƒ¡q&t|j ƒ}n"t |dƒsf|g}dd„|Dƒ}g}||d<||d<d  d d„|Dƒ¡|d <d|vrº| |d ¡|d<dS) NrOcSs*g|]"}t|jpd|jpd|jp"dƒ‘qS)r)rrrr)r;ZmbrrrÚ Ws ý þz'AddressHeader.parse..Ú__iter__cSs&g|]}t|dƒstd|gƒn|‘qS)r6N)Úhasattrr3©r;Úitemrrrrt`sþÚgroupsrBr8cSsg|] }t|ƒ‘qSrr9rwrrrrtfr>rC) r+r:r`r6rWr3rZ all_mailboxesÚlistrrvr )rHrJrKrsryÚaddrrBrrrrDNs*   ýÿ  þzAddressHeader.parsecs,t| d¡ƒ|_d|_tƒj|i|¤ŽdS)Nry)r4riÚ_groupsr5rkrGrlrorrrGjszAddressHeader.initcCs|jSr)r|r rrrryoszAddressHeader.groupscCs&|jdur tdd„|jDƒƒ|_|jS)Ncss|]}|jD] }|Vq qdSr)r6)r;ÚgroupÚaddressrrrr=vs ÿz*AddressHeader.addresses..)r5r4r|r rrrr6ss zAddressHeader.addresses) r&r0r1rbrcr`r[rDrGr2ryr6rprrrorrrDs    rrc@seZdZdZdS)ÚUniqueAddressHeaderr7Nrfrrrrr{src@seZdZedd„ƒZdS)ÚSingleAddressHeadercCs(t|jƒdkrtd |j¡ƒ‚|jdS)Nr7z9value of single address header {} is not a single addressr)r@r6r rrIr rrrr~‚s ÿzSingleAddressHeader.addressN)r&r0r1r2r~rrrrr€€sr€c@seZdZdZdS)ÚUniqueSingleAddressHeaderr7Nrfrrrrr�Šsr�csZeZdZdZeejƒZedd„ƒZ ‡fdd„Z e dd„ƒZ e dd „ƒZ e d d „ƒZ‡ZS) ÚMIMEVersionHeaderr7cCs€| |¡|d<}t|ƒ|d<|d |j¡|jdurÄsþ z1ParameterizedMIMEHeader.parse..)r`r:r†rrŒr‡rrrrD»s   þzParameterizedMIMEHeader.parsecs"| d¡|_tƒj|i|¤ŽdS)NrŒ)riÚ_paramsrkrGrlrorrrGÈs zParameterizedMIMEHeader.initcCs t|jƒSr)rr�r rrrrŒÌszParameterizedMIMEHeader.params) r&r0r1rbr[rDrGr2rŒrprrrorr‹´s  r‹csJeZdZeejƒZ‡fdd„Zedd„ƒZ edd„ƒZ edd„ƒZ ‡Z S) ÚContentTypeHeadercs6tƒj|i|¤Žt |jj¡|_t |jj¡|_dSr) rkrGrrErMÚmaintypeÚ _maintypeÚsubtypeÚ_subtyperlrorrrGÕszContentTypeHeader.initcCs|jSr)r’r rrrr‘ÚszContentTypeHeader.maintypecCs|jSr)r”r rrrr“ÞszContentTypeHeader.subtypecCs|jd|jS)Nú/)r‘r“r rrrÚ content_typeâszContentTypeHeader.content_type) r&r0r1rcrZparse_content_type_headerr`rGr2r‘r“r–rprrrorr�Ñs    r�cs2eZdZeejƒZ‡fdd„Zedd„ƒZ ‡Z S)ÚContentDispositionHeadercs6tƒj|i|¤Ž|jj}|dur&|nt |¡|_dSr)rkrGrMÚcontent_dispositionrrEÚ_content_disposition)rrmrnZcdrorrrGëszContentDispositionHeader.initcCs|jSr)r™r rrrr˜ðsz,ContentDispositionHeader.content_disposition) r&r0r1rcrZ parse_content_disposition_headerr`rGr2r˜rprrrorr—çs  r—csBeZdZdZeejƒZedd„ƒZ ‡fdd„Z e dd„ƒZ ‡Z S)ÚContentTransferEncodingHeaderr7cCs2| |¡|d<}t|ƒ|d<|d |j¡dS©NrOrCrB©r`r:r†rr‡rrrrDûs z#ContentTransferEncodingHeader.parsecs&tƒj|i|¤Žt |jj¡|_dSr)rkrGrrErMÚcteÚ_cterlrorrrGsz"ContentTransferEncodingHeader.initcCs|jSr)ržr rrrr�sz!ContentTransferEncodingHeader.cte)r&r0r1rbrcrZ&parse_content_transfer_encoding_headerr`r[rDrGr2r�rprrrorršõs   ršc@s&eZdZdZeejƒZedd„ƒZ dS)ÚMessageIDHeaderr7cCs2| |¡|d<}t|ƒ|d<|d |j¡dSr›rœr‡rrrrDs zMessageIDHeader.parseN) r&r0r1rbrcrZparse_message_idr`r[rDrrrrrŸ s rŸ)ZsubjectÚdatez resent-datez orig-dateZsenderz resent-senderÚtoz resent-toZccz resent-ccZbccz resent-bccÚfromz resent-fromzreply-toz mime-versionz content-typezcontent-dispositionzcontent-transfer-encodingz message-idc@s8eZdZdZeedfdd„Zdd„Zdd„Zd d „Z d S) ÚHeaderRegistryz%A header_factory and header registry.TcCs&i|_||_||_|r"|j t¡dS)aèCreate a header_factory that works with the Policy API. base_class is the class that will be the last class in the created header class's __bases__ list. default_class is the class that will be used if "name" (see __call__) does not appear in the registry. use_default_map controls whether or not the default mapping of names to specialized classes is copied in to the registry when the factory is created. The default is True. N)ÚregistryÚ base_classÚ default_classÚupdateÚ_default_header_map)rr¥r¦Zuse_default_maprrrr3s zHeaderRegistry.__init__cCs||j| ¡<dS)zLRegister cls as the specialized class for handling "name" headers. N)r¤r�©rrIrHrrrÚ map_to_typeEszHeaderRegistry.map_to_typecCs,|j | ¡|j¡}td|j||jfiƒS)NÚ_)r¤Úgetr�r¦r\r&r¥r©rrrÚ __getitem__KszHeaderRegistry.__getitem__cCs||||ƒS)aƒCreate a header instance for header 'name' from 'value'. Creates a header instance by creating a specialized class for parsing and representing the specified header by combining the factory base_class with a specialized class from the registry or the default_class, and passing the name and value to the constructed class's constructor. r)rrIrJrrrÚ__call__Os zHeaderRegistry.__call__N) r&r0r1rZrAr_rrªr­r®rrrrr£/sÿ r£N)rZÚtypesrZemailrrrrrr3r:rArPr_rergrqrrrr€r�r‚r‹r�r—ršrŸr¨r£rrrrÚsX    \4d '7 %ì