a oe @@sddlZddlZddlZddlZddlZddlZddlZddlmZm Z m Z m Z m Z m Z ejdkrpddlmZnFejrddlmZn2zddlmZWn eyGdddZYn0Gddded d Zhd Zhd Zee ed ddZe eeeefd ddZejje eefedddZdddddddddddd d!d"d#d$d%d&d'd(d)d*d+d,d-d.d/d0d1Ze eefe eeee effd d2d3ZdS)4N)DictListOptionalTupleUnioncast)) TypedDictc@seZdZddZdS)r cOsdS)N)_args_kwargsr r IC:\Program Files\Certbot\pkgs\pkg_resources\_vendor\packaging\metadata.py__init_subclass__szTypedDict.__init_subclass__N)__name__ __module__ __qualname__rr r r rr sr c@s.eZdZUdZeed<eed<eed<eeed<eed<eed<eeed<eed <eed <eed <eed <eeed <eed<eeed<eeed<eeed<eeed<eed<eed<eeed<eeed<eeed<eed<eeed<eeefed<eed<eeed<eeed<dS) RawMetadataaqA dictionary of raw core metadata. Each field in core metadata maps to a key of this dictionary (when data is provided). The key is lower-case and underscores are used instead of dashes compared to the equivalent core metadata field. Any core metadata field that can be specified multiple times or can hold multiple values in a single field have a key with a plural name. Core metadata fields that can be specified multiple times are stored as a list or dict depending on which is appropriate for the field. Any fields which hold multiple values in a single field are stored as a list. metadata_versionnameversion platformssummary descriptionkeywords home_pageauthor author_emaillicensesupported_platforms download_url classifiersrequiresprovides obsoletes maintainermaintainer_email requires_dist provides_distobsoletes_distrequires_pythonrequires_external project_urlsdescription_content_typeprovides_extradynamicN)rrr__doc__str__annotations__rrr r r rrs:              rF)total>r&rrrrrrrr*rr%rr-r > r/r!rr$r'r+r(r)r#r.r"r)datareturncCsdd|dDS)zCSplit a string of comma-separate keyboards into a list of keywords.cSsg|] }|qSr strip).0kr r r z#_parse_keywords..,)split)r4r r r_parse_keywordssr>c Csfi}|D]X}dd|ddD}|dgtddt||\}}||vrXtd|||<q|S) z?Parse a list of label/URL string pairings separated by a comma.cSsg|] }|qSr r6)r8pr r rr:r;z'_parse_project_urls..r<rz duplicate labels in project urls)r=extendmaxlenKeyError)r4ZurlsZpairpartsZlabelurlr r r_parse_project_urlss rI)msgsourcer5cCsPt|tr|}|S|jdd}z|ddWStyJtdYn0dS)zGet the body of the message.Tdecodeutf8strictzpayload in an invalid encodingN) isinstancer1 get_payloadrMUnicodeDecodeError ValueError)rJrKpayloadZbpayloadr r r _get_payloads   rUrrr!rr-r r/rrrr%r&rrr$r)rr,r#r(r.r"r'r+r*rrr)rz author-emailZ classifierrzdescription-content-typez download-urlr/z home-pagerrr%zmaintainer-emailzmetadata-versionrr$zobsoletes-distplatformz project-urlr#z provides-distzprovides-extrar"z requires-distzrequires-externalzrequires-pythonrzsupported-platformrc Csi}i}t|tr,tjjtjjd|}ntjjtjjd |}t | D]}| }| |}g}d}|D]}t|tjjtfsJt|tjjrg} tj|D]F\} } z| ddWntyd} d}Yn0d} | | | fq|ttj| qt||qt|s*|||<qPt|} | durH|||<qP| tvrnt|dkrn|d || <qP| tvr||| <qP| d krt|dkrt|d || <qP| d krzt||| <Wnty|||<Yn0qP|||<qPzt||} Wn4ty2|d g|j t|t!d Yn\0| rd |vrlt"t|#d }|d g$|| gn"d |vr|d | n| |d <t"t%||fS)aParse a distribution's metadata. This function returns a two-item tuple of dicts. The first dict is of recognized fields from the core metadata specification. Fields that can be parsed and translated into Python's built-in types are converted appropriately. All other fields are left as-is. Fields that are allowed to appear multiple times are stored as lists. The second dict contains all other fields from the metadata. This includes any unrecognized fields. It also includes any fields which are expected to be parsed into a built-in type but were not formatted appropriately. Finally, any fields that are expected to appear only once but are repeated are included in this dict. )policyTrNrOlatin1FNr@rrr,rrL)&rPr1emailparserZParserrWZcompat32ZparsestrZ BytesParserZ parsebytes frozensetkeyslowerZget_allheaderZHeaderZ decode_headerrMrRappendZ make_header_EMAIL_TO_RAW_MAPPINGget_STRING_FIELDSrE_LIST_STRING_FIELDSr>rIrFrUrS setdefaultrQbytesrpoprCr)r4rawZunparsedparsedrZheadersvalueZvalid_encodinghchunksbinencodingZraw_namerTZdescription_headerr r r parse_emailsv                  rn)Zemail.feedparserrYZ email.headerZ email.messageZ email.parserZ email.policysystypingrrrrrr version_infor TYPE_CHECKINGZtyping_extensions ImportErrorrrbrcr1r>rImessageZMessagererUr`rnr r r rsf    C(