Your IP : 3.148.108.174


Current Path : /opt/alt/python310/lib/python3.10/site-packages/setuptools/__pycache__/
Upload File :
Current File : //opt/alt/python310/lib/python3.10/site-packages/setuptools/__pycache__/namespaces.cpython-310.pyc

o

~�Re�@sFddlZddlmZddlZejjZGdd�d�ZGdd�de�ZdS)�N)�logc@sXeZdZdZdd�Zdd�Zdd�ZdZ	d	Z	d
d�Z	dd
�Z
dd�Zedd��Z
dS)�	Installerz
-nspkg.pthcCs�|��}|sdStj�|���\}}||j7}|j�|�t�	d|�t
|j|�}|jr2t
|�dSt|d��}|�|�Wd�dS1sHwYdS)Nz
Installing %s�wt)�_get_all_ns_packages�os�path�splitext�_get_target�	nspkg_ext�outputs�appendr�info�map�_gen_nspkg_line�dry_run�list�open�
writelines)�self�nsp�filename�ext�lines�f�r��/builddir/build/BUILDROOT/alt-python310-setuptools-58.3.0-2.el8.x86_64/opt/alt/python310/lib/python3.10/site-packages/setuptools/namespaces.py�install_namespaces
s
"�zInstaller.install_namespacescCsHtj�|���\}}||j7}tj�|�sdSt�d|�t�|�dS)NzRemoving %s)	rrrr	r
�existsrr
�remove)rrrrrr�uninstall_namespacess
zInstaller.uninstall_namespacescC�|jS�N)�target�rrrrr	'�zInstaller._get_target)	zimport sys, types, osz#has_mfs = sys.version_info > (3, 5)z$p = os.path.join(%(root)s, *%(pth)r)z4importlib = has_mfs and __import__('importlib.util')z-has_mfs and __import__('importlib.machinery')z�m = has_mfs and sys.modules.setdefault(%(pkg)r, importlib.util.module_from_spec(importlib.machinery.PathFinder.find_spec(%(pkg)r, [os.path.dirname(p)])))zCm = m or sys.modules.setdefault(%(pkg)r, types.ModuleType(%(pkg)r))z7mp = (m or []) and m.__dict__.setdefault('__path__',[])z(p not in mp) and mp.append(p))z4m and setattr(sys.modules[%(parent)r], %(child)r, m)cCsdS)Nz$sys._getframe(1).f_locals['sitedir']rr#rrr�	_get_rootEszInstaller._get_rootcCsNt|�d��}|��}|j}|�d�\}}}|r||j7}d�|�t�dS)N�.�;�
)�tuple�splitr%�_nspkg_tmpl�
rpartition�_nspkg_tmpl_multi�join�locals)r�pkg�pth�rootZ
tmpl_lines�parent�sep�childrrrrHs
zInstaller._gen_nspkg_linecCs |jjpg}ttt|j|���S)z,Return sorted list of all package namespaces)�distributionZnamespace_packages�sorted�flattenr�
_pkg_names)r�pkgsrrrrQszInstaller._get_all_ns_packagesccs0�|�d�}|rd�|�V|��|sdSdS)z�
        Given a namespace package, yield the components of that
        package.

        >>> names = Installer._pkg_names('a.b.c')
        >>> set(names) == set(['a', 'a.b', 'a.b.c'])
        True
        r&N)r*r.�pop)r0�partsrrrr9Vs�

�zInstaller._pkg_namesN)�__name__�
__module__�__qualname__r
rrr	r+r-r%rr�staticmethodr9rrrrr	s	rc@seZdZdd�Zdd�ZdS)�DevelopInstallercCstt|j��Sr!)�repr�strZegg_pathr#rrrr%gszDevelopInstaller._get_rootcCr r!)�egg_linkr#rrrr	jr$zDevelopInstaller._get_targetN)r=r>r?r%r	rrrrrAfsrA)	r�	distutilsr�	itertools�chain�
from_iterabler8rrArrrr�<module>s]

?>