a
DOg>I @ s d dl Z d dlZd dlZd dlZd dlZd dlZd dlZd dlZd dlZd dl Z d dl
Z
d dlZd dlZd dl
Z
d dlmZ d dlmZ d dlmZ d dlmZ d dlmZ g dZG dd d eZG d
d de
dd
ZG dd dejZG dd dZG dd dZG dd deZ G dd dZ!G dd dZ"G dd de Z#G dd deZ$dd Z%d d! Z&d"d# Z'd$d% Z(d&d' Z)d(d) Z*d*d+ Z+dS ), N)ConfigParser)suppress)
import_module)MetaPathFinder)starmap)
DistributionDistributionFinderPackageNotFoundErrordistribution
distributionsentry_pointsfilesmetadatarequiresversionc @ s e Zd ZdZdS )r zThe package was not found.N)__name__
__module____qualname____doc__ r r 7/opt/alt/python39/lib64/python3.9/importlib/metadata.pyr % s r c @ sn e Zd ZdZedZdd Zedd Z edd Z
ed d
Zedd Z
ed
d Zdd Zdd ZdS )
EntryPointa An entry point as defined by Python packaging conventions.
See `the packaging docs on entry points
`_
for more information.
>>> ep = EntryPoint(
... name=None, group=None, value='package.module:attr [extra1, extra2]')
>>> ep.module
'package.module'
>>> ep.attr
'attr'
>>> ep.extras
['extra1', 'extra2']
zH(?P[\w.]+)\s*(:\s*(?P[\w.]+)\s*)?((?P\[.*\])\s*)?$c C sD | j | j}t|d}td|dp,dd}tt ||S )zLoad the entry point from its definition. If only a module
is indicated by the value, return that module. Otherwise,
return the named object.
moduleNattr .)
patternmatchvaluer groupfiltersplit functoolsreducegetattr)selfr r attrsr r r loadP s zEntryPoint.loadc C s | j | j}|dS )Nr r r r r r% r r r r r Z s zEntryPoint.modulec C s | j | j}|dS )Nr r( r) r r r r _ s zEntryPoint.attrc C s$ | j | j}td|dp dS )Nz\w+extrasr )r r r refindallr r) r r r r* d s zEntryPoint.extrasc s fdd D S )Nc s, g | ]$} |D ]\}} |||qqS r items).0r namer clsconfigr r
k s z+EntryPoint._from_config..)sectionsr1 r r1 r _from_configi s zEntryPoint._from_configc C sL t dd}t|_z|| W n" ty@ |t| Y n0 t |S )N=)Z
delimiters)
r strZoptionxformZread_stringAttributeErrorZreadfpioStringIOr r6 )r2 textr3 r r r
_from_textq s
zEntryPoint._from_textc C s t | j| fS )zO
Supply iter so one may construct dicts of EntryPoints easily.
)iterr0 r% r r r __iter__} s zEntryPoint.__iter__c C s | j | j| j| jffS N) __class__r0 r r r? r r r
__reduce__ s zEntryPoint.__reduce__N)r r r r r+ compiler r' propertyr r r* classmethodr6 r= r@ rC r r r r r ) s"
r ZEntryPointBasezname value groupc @ s* e Zd ZdZd
ddZdd Zdd Zd S )PackagePathz"A reference to a path in a packageutf-8c C s<