Files
old-saburly-wagtail-web/env/lib/python3.10/site-packages/packaging/__pycache__/metadata.cpython-310.pyc

171 lines
17 KiB
Plaintext
Raw Normal View History

2024-08-27 20:33:44 +02:00
o
<00><><EFBFBD>f]~<00> @s<>ddlmZddlZddlZddlZddlZddlZddlZddlm Z m
Z
m Z m Z m Z mZddlmZmZmZddlmZe<08>d<07>ZzeWneyXGdd <09>d e<19>ZYnweZGd
d <0B>d e<1A>ZGd d <0A>d e dd<0F>Zhd<10>Zhd<11>ZdhZdRdd<18>Z dSdd<1B>Z!dTd d!<21>Z"id"d"<22>d#d$<24>d%d&<26>d'd'<27>d(d)<29>d*d+<2B>d,d,<2C>d-d.<2E>d/d/<2F>d0d0<64>d1d1<64>d2d3<64>d4d5<64>d6d6<64>d7d7<64>d8d9<64>d:d;<3B>dd<d=d>d?d@dAdBdCdDdEdF<64> <0B>Z#dGdH<64>e#<23>$<24>D<00>Z%dUdJdK<64>Z&e'<27>Z(gdL<64>Z)e dLZ*e+gdM<64><01>Z,GdNdO<64>dOe e<00>Z-GdPdQ<64>dQ<64>Z.dS)V<>)<01> annotationsN)<06>Any<6E>Callable<6C>Generic<69>Literal<61> TypedDict<63>cast<73>)<03> requirements<74>
specifiers<EFBFBD>utils)<01>version<6F>Tc@s6eZdZUdZded<ded<d dd <09>Zdd
d <0B>Zd S)<0F>ExceptionGroupz<70>A minimal implementation of :external:exc:`ExceptionGroup` from Python 3.11.
If :external:exc:`ExceptionGroup` is already defined by Python itself,
that version is used instead.
<20>str<74>message<67>list[Exception]<5D>
exceptions<EFBFBD>return<72>NonecCs||_||_dS<00>N)rr)<03>selfrr<00>r<00>T/home/amir/Desktop/saburlyweb/env/lib/python3.10/site-packages/packaging/metadata.py<70>__init__&s
zExceptionGroup.__init__cCs|jj<01>d|j<02>d|j<03>d<03>S)N<>(z, <20>))<04> __class__<5F>__name__rr)rrrr<00>__repr__*szExceptionGroup.__repr__N)rrrrrr)rr)r<00>
__module__<EFBFBD> __qualname__<5F>__doc__<5F>__annotations__rrrrrrrs

rcs.eZdZUdZded< d <09>fdd<08> Z<05>ZS)
<EFBFBD>InvalidMetadataz'A metadata field contains invalid data.r<00>fieldrrrcs||_t<01><00>|<02>dSr)r%<00>superr)rr%r<00>rrrr7szInvalidMetadata.__init__)r%rrrrr)rr r!r"r#r<00> __classcell__rrr'rr$1s
r$c@s<>eZdZUdZded<ded<ded<ded<ded<ded <ded
<ded <ded <ded <ded<ded<ded<ded<ded<ded<ded<ded<ded<ded<ded<ded<ded<ded<ded<ded<ded<ded <d!S)"<22> RawMetadataa<61>A 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. See :class:`Metadata` whose attributes
match the keys of this dictionary.
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.
r<00>metadata_version<6F>namer <00> list[str]<5D> platforms<6D>summary<72> description<6F>keywords<64> home_page<67>author<6F> author_email<69>license<73>supported_platforms<6D> download_url<72> classifiers<72>requires<65>provides<65> obsoletes<65>
maintainer<EFBFBD>maintainer_email<69> requires_dist<73> provides_dist<73>obsoletes_dist<73>requires_python<6F>requires_external<61>dict[str, str]<5D> project_urls<6C>description_content_type<70>provides_extra<72>dynamicN)rr r!r"r#rrrrr)@s<
  r)F)<01>total>r+r2r4r.r r1r;r/r3r6r@r<r*rD> rFr9r8r:r-r7r>r=r?rErAr5rC<00>datarrr,cCsdd<02>|<00>d<03>D<00>S)zCSplit a string of comma-separate keyboards into a list of keywords.cS<01>g|]}|<01><00><00>qSr<00><01>strip)<02>.0<EFBFBD>krrr<00>
<listcomp><3E><00>z#_parse_keywords.<locals>.<listcomp><3E>,)<01>split)rHrrr<00>_parse_keywords<64>srRrBc Csfi}|D],}dd<02>|<02>dd<04>D<00>}|<03>dgtddt|<03><00><00>|\}}||vr,td<08><01>|||<q|S) z?Parse a list of label/URL string pairings separated by a comma.cSrIrrJ)rL<00>prrrrN<00>rOz'_parse_project_urls.<locals>.<listcomp>rPr <00>r<00>z duplicate labels in project urls)rQ<00>extend<6E>max<61>len<65>KeyError)rH<00>urls<6C>pair<69>parts<74>label<65>urlrrr<00>_parse_project_urls<6C>s
r_<00>msg<73>email.message.Message<67>source<63> bytes | strcCsHt|t<01>r |<00><02>}|S|jdd<02>}z|<03>dd<04>WSty#td<05><01>w)zGet the body of the message.T<><01>decode<64>utf8<66>strictzpayload in an invalid encoding)<06>
isinstancer<00> get_payloadre<00>UnicodeDecodeError<6F>
ValueError)r`rb<00>payload<61>bpayloadrrr<00> _get_payload<61>s
  <02>rnr2z author-emailr3<00>
classifierr7r/zdescription-content-typerDz download-urlr6rFz home-pager1r0r4r;zmaintainer-emailr<<00>metadata-versionr*r+r:zobsoletes-distr?<00>platformr-r9r>rEr8r=rAr@r.r5r ) z project-urlr9z provides-distzprovides-extrar8z requires-distzrequires-externalzrequires-pythonr.zsupported-platformr cCsi|]\}}||<01>qSrr)rL<00>email<69>rawrrr<00>
<dictcomp>srt<00>(tuple[RawMetadata, dict[str, list[str]]]c Cs<>i}i}t|t<01>rtjjtjjd<01><01>|<00>}n tjjtjjd<01><01> |<00>}t
|<03> <0B><00>D]<5D>}|<04> <0C>}|<03> |<04>p4g}g}d}|D]Q}t|tjjtf<02>sHJ<00>t|tjj<0F>r<>g} tj<0E>|<08>D]#\}
} z|
<EFBFBD>dd<04>Wn typd} d}Ynwd} | <09>|
| f<02>qW|<06>ttj<0E>| <09><01><01>q;|<06>|<08>q;|s<>|||<q(t<15>|<04>} | dur<>|||<q(| tvr<>t|<06>dkr<>|d || <q(| tvr<>||| <q(| d
kr<>t|<06>dkr<>t|d <00>|| <q(| d kr<>zt|<06>|| <Wq(ty<>|||<Yq(w|||<q(zt||<00>} Wnt<1E>y|<02>d g<00><02>|j t|t!<21>d <0A><01>Yn.w| <0A>r=d |v<00>r,t"t|<01>#d <0C><01>}|<02>d g<00><02>$|| g<02>nd |v<00>r9|d <00>| <0A>n| |d <t"t%|<01>|fS)a
Parse a distribution's metadata stored as email headers (e.g. from ``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.
)<01>policyTrfrg<00>latin1FNr rr0rCr/rd)&rhrrr<00>parser<65>Parserrv<00>compat32<33>parsestr<74> BytesParser<65>
parsebytes<EFBFBD> frozenset<65>keys<79>lower<65>get_all<6C>header<65>Header<65> decode_headerrerj<00>append<6E> make_header<65>_EMAIL_TO_RAW_MAPPING<4E>get<65>_STRING_FIELDSrX<00> _LIST_FIELDSrRr_rYrnrk<00>
setdefaultri<00>bytesr<00>poprVr))rHrs<00>unparsed<65>parsedr+<00>headers<72>value<75>valid_encoding<6E>h<>chunks<6B>bin<69>encoding<6E>raw_namerl<00>description_headerrrr<00> parse_emails|
 
 <02> 



  <02>
 <08><02>
 <06>
r<>)<06>1.0<EFBFBD>1.1<EFBFBD>1.2<EFBFBD>2.1<EFBFBD>2.2z2.3)r*r+r c@s<>eZdZUdZded<ded<ded<dd<08>d5d d <0C>Zd6dd<10>Zd7dd<15>Z d8d9dd<1C>Zd:dd<1F>Z d;d d!<21>Z
d<d#d$<24>Z d;d%d&<26>Z d;d'd(<28>Z d=d*d+<2B>Zd>d-d.<2E>Zd?d0d1<64>Zd@d3d4<64>ZdS)A<>
_ValidatoravValidate a metadata field.
All _process_*() methods correspond to a core metadata field. The method is
called with the field's raw value. If the raw value is valid it is returned
in its "enriched" form (e.g. ``version.Version`` for the ``Version`` field).
If the raw value is invalid, :exc:`InvalidMetadata` is raised (with a cause
as appropriate).
rr+r<><00>_MetadataVersion<6F>addedr<64><00>r<>rrcCs
||_dSrr<>)rr<>rrrr<00>s
z_Validator.__init__<5F>_owner<65>MetadatacCs||_t||_dSr)r+<00>_RAW_TO_EMAIL_MAPPINGr<47>)rr<>r+rrr<00> __set_name__<5F>sz_Validator.__set_name__<5F>instance<63>type[Metadata]rcCs<>|j}|j<01>|j<03>}|jtvs|dur,z t|d|j<03><00><02>}Wn ty'Ynw||<04>}|||j<z|j|j=Wn tyAYnwtt |<04>S)N<> _process_)
<EFBFBD>__dict__<5F>_rawr<77>r+<00>_REQUIRED_ATTRS<52>getattr<74>AttributeErrorrYrr)rr<>r<><00>cacher<65><00> converterrrr<00>__get__<5F>s  <02>
 <02>
z_Validator.__get__Nr`<00>cause<73>Exception | Noner$cCs&t|j|<01>dt|j<01>i<01><01>}||_|S)Nr%)r$r<><00>
format_map<EFBFBD>repr<70> __cause__)rr`r<><00>excrrr<00>_invalid_metadatas
<04>z_Validator._invalid_metadatar<61>cCs"|tvr |<00>|<01>d<01><02><01>tt|<01>S)Nz is not a valid metadata version)<04>_VALID_METADATA_VERSIONSr<53>rr<><00>rr<>rrr<00>_process_metadata_version s
z$_Validator._process_metadata_versionc
CsR|s|<00>d<01><01>z
tj|dd<03>W|Stjy(}z
|j|<01>d<04>|d<05><02>d}~ww)N<>{field} is a required fieldT<64><01>validate<74> is invalid for {field}<7D>r<>)r<>r <00>canonicalize_name<6D> InvalidName<6D>rr<>r<>rrr<00> _process_names
<10>
<06><08><02>z_Validator._process_name<6D>version_module.Versionc
CsJ|s|<00>d<01><01>zt<01>|<01>WStjy$}z
|j|<01>d<02>|d<03><02>d}~ww)Nr<4E>r<>r<>)r<><00>version_module<6C>parse<73>InvalidVersionr<6E>rrr<00>_process_versions
 
<06><08><02>z_Validator._process_versioncCsd|vr |<00>d<02><01>|S)z%Check the field contains no newlines.<2E>
z{field} must be a single line)r<>r<>rrr<00>_process_summary(s
z_Validator._process_summaryc Cs<>hd<01>}tj<01><02>}||d<|<03><03><00><04>|dj}}||vs#||<01><04>vr0|<00>dt|<02><01>d|<01><02><04><01>|<05>dd<06>}|dkrD|<00>dt|<06><01><00><02><01>dd h}|<05>d
d<08>}|d krc||vrc|<00>d t|<07><01>d|<08><02><04><01>|S) N><00>
text/plain<69>
text/x-rst<73> text/markdownz content-typez{field} must be one of z, not <20>charsetzUTF-8z0{field} can only specify the UTF-8 charset, not <20>GFM<46>
CommonMark<EFBFBD>variantr<74>z(valid Markdown variants for {field} are ) rrr<00> EmailMessage<67>get_content_typer<65><00>paramsr<73><00>listr<74>) rr<><00> content_typesr<00> content_type<70>
parametersr<EFBFBD><00>markdown_variantsr<73>rrr<00>!_process_description_content_type.s0

<06><04>  <04>  <04><04>z,_Validator._process_description_content_typer,cCsRttj|<01>D]}|dvr|<00>|<01>d<02><02><01>|tvr |<00>|<01>d<03><02><01>qtttj|<01><02>S)N>r+r rpz" is not allowed as a dynamic fieldz is not a valid dynamic field)<06>maprr<>r<>r<>r<>)rr<><00> dynamic_fieldrrr<00>_process_dynamicNs<04><02>z_Validator._process_dynamic<69>list[utils.NormalizedName]c
CsXg}z|D] }|<02>tj|dd<02><02>qW|Stjy+}z
|j|<03>d<03>|d<04><02>d}~ww)NTr<54>r<>r<>)r<>r r<>r<>r<>)rr<><00>normalized_namesr+r<>rrr<00>_process_provides_extraXs<02><10>
<06><08><02>z"_Validator._process_provides_extra<72>specifiers.SpecifierSetc
Cs<zt<00>|<01>WStjy}z
|j|<01>d<01>|d<02><02>d}~ww<00>Nr<4E>r<>)r <00> SpecifierSet<65>InvalidSpecifierr<72>r<>rrr<00>_process_requires_pythongs 
<06><08><02>z#_Validator._process_requires_python<6F>list[requirements.Requirement]c
CsTg}z|D]
}|<02>t<01>|<03><01>qW|Stjy)}z
|j|<03>d<01>|d<02><02>d}~wwr<>)r<>r
<00> Requirement<6E>InvalidRequirementr<74>)rr<><00>reqs<71>reqr<71>rrr<00>_process_requires_distos<02><10><08><02>z!_Validator._process_requires_dist)r<>r<>rr)r<>r<>r+rrr)r<>r<>r<>r<>rrr)r`rr<>r<>rr$)r<>rrr<>)r<>rrr)r<>rrr<>)r<>r,rr,)r<>r,rr<>)r<>rrr<>)r<>r,rr<>)rr r!r"r#rr<>r<>r<>r<>r<>r<>r<>r<>r<>r<>r<>r<>rrrrr<><00>s(
 <0E>

 <0C>


r<>c@sDeZdZUdZded<edd<05>d:d
d <0B><06>Zedd<05>d;d d<0E><06>Ze<08>Z ded< e<08>Z
ded< e<08>Z ded< edd<16>Z ded< e<08>Z ded< edd<16>Zded< e<08>Zded< e<08>Zded< edd<16>Zded < e<08>Zded!< e<08>Zded"< edd<16>Zded#< e<08>Zded$< e<08>Zded%< ed&d<16>Zded'< ed&d<16>Zded(< e<08>Zded)< edd<16>Zded*< ed&d<16>Zd+ed,< ed&d<16>Zd-ed.< ed&d<16>Zded/< ed&d<16>Zd0ed1< edd<16>Zd2ed3< ed&d<16>Z ded4< ed&d<16>Z!ded5< edd<16>Z"ded6< edd<16>Z#ded7< edd<16>Z$ded8<d9S)<r<>aJRepresentation of distribution metadata.
Compared to :class:`RawMetadata`, this class provides objects representing
metadata fields instead of only using built-in types. Any invalid metadata
will cause :exc:`InvalidMetadata` to be raised (with a
:py:attr:`~BaseException.__cause__` attribute as appropriate).
r)r<>Tr<54>rHr<><00>boolrc CsF|<00>}|<01><00>|_|r<>g}z
|j}t<03>|<05>}Wnty/}z |<04>|<07>d}WYd}~nd}~wwt|j<01>tB}|dh8}|D][} zB|r|z|j | j
}
Wnt ybt| d| <09><02><02>} |<04>| <0B>YWq>wt<03>|
<EFBFBD>} | |kr|t | } t| d<04>} |<04>| <0B>Wq>t || <09>Wq>ty<>} z |<04>| <0B>WYd} ~ q>d} ~ ww|r<>td|<04><02>|S)z<>Create an instance from :class:`RawMetadata`.
If *validate* is true, all metadata will be validated. All exceptions
related to validation will be gathered and raised as an :class:`ExceptionGroup`.
Nr*<00>unrecognized field: zW{field} introduced in metadata version {field_metadata_version}, not {metadata_version}zinvalid metadata)<0F>copyr<79>r*r<><00>indexr$r<>r~r<>r<>r<>rYr<>r<>r)<0E>clsrHr<><00>insrr*<00> metadata_age<67>metadata_version_exc<78>fields_to_check<63>key<65>field_metadata_versionr<6E><00> field_ager%rrr<00>from_raw<61>sV

<08><02>
 
<02><04><04>
<08><02>
zMetadata.from_rawrcc
Cs<>t|<01>\}}|r-g}|D]}|tvr|<06>d<01>}nd|<06><02>}|<05>t||<07><02>q |r-td|<05><02>z|j||d<04>WStyH}ztd|j<06>d<06>d}~ww)z<>Parse metadata from email headers.
If *validate* is true, the metadata will be validated. All exceptions
related to validation will be gathered and raised as an :class:`ExceptionGroup`.
z has invalid datar<61>r<>r<>zinvalid or unparsed metadataN)r<>r<>r<>r$rr<>r) r<>rHr<>rsr<>r<00> unparsed_keyr<00> exc_grouprrr<00>
from_email<EFBFBD>s(  

<02><02><08><02>zMetadata.from_emailz_Validator[_MetadataVersion]r*z_Validator[str]r+z"_Validator[version_module.Version]r r<>r<>z_Validator[list[str] | None]rFr-r<>r5z_Validator[str | None]r.r/r<>rDr0r1r6r2r3r<>r;r<r4r7z1_Validator[list[requirements.Requirement] | None]r=z*_Validator[specifiers.SpecifierSet | None]r@rAz!_Validator[dict[str, str] | None]rCz-_Validator[list[utils.NormalizedName] | None]rEr>r?r8r9r:N)rHr)r<>r<>rr<>)rHrcr<>r<>rr<>)%rr r!r"r#<00> classmethodr<64>r<>r<>r*r+r rFr-r5r.r/rDr0r1r6r2r3r;r<r4r7r=r@rArCrEr>r?r8r9r:rrrrr<>}s<>
8<0E><0E><0E><0E>r<>)rHrrr,)rHr,rrB)r`rarbrcrr)rHrcrru)/<2F>
__future__r<00>email.feedparserrr<00> email.header<65> email.message<67> email.parser<65> email.policy<63>typingrrrrrrrTr
r r r r<><00>TypeVarrr<00> NameError<6F> Exceptionrkr$r)r<>r<><00> _DICT_FIELDSrRr_rnr<><00>itemsr<73>r<><00>object<63>
_NOT_FOUNDr<EFBFBD>r<>r~r<>r<>r<>rrrr<00><module>s<>   
 <02>D<04>


(<02><02><02><02><02><02><02><02> <02>
<02> <02> <02> <02><02><02><02><02><08>
1 0