Your IP : 18.116.88.132


Current Path : /opt/alt/python312/lib/python3.12/site-packages/setuptools/__pycache__/
Upload File :
Current File : //opt/alt/python312/lib/python3.12/site-packages/setuptools/__pycache__/namespaces.cpython-312.pyc

�

t��e��v�ddlZddlmZddlZejj
ZGd�d�ZGd�de�Zy)�N)�logc�V�eZdZdZd�Zd�Zd�Zd�ZdZ	dZ		d�Z
d	�Zd
�Ze
d��Zy)
�	Installerz
-nspkg.pthc�l�|j�}|sy|j�}|jj|�t	j
d|�t
|j|�}|jrt|�yt|d�5}|j|�ddd�y#1swYyxYw)Nz
Installing %s�wt)�_get_all_ns_packages�_get_nspkg_file�outputs�appendr�info�map�_gen_nspkg_line�dry_run�list�open�
writelines)�self�nsp�filename�lines�fs     ��/builddir/build/BUILDROOT/alt-python312-setuptools-69.0.2-1.el8.x86_64/opt/alt/python312/lib/python3.12/site-packages/setuptools/namespaces.py�install_namespaceszInstaller.install_namespacess����'�'�)�����'�'�)�������H�%�����(�+��D�(�(�#�.���<�<���K��
�(�D�
!�	 �Q�
�L�L���	 �	 �	 �s�B*�*B3c��|j�}tjj|�syt	j
d|�tj|�y)NzRemoving %s)r	�os�path�existsrr�remove)rrs  r�uninstall_namespaceszInstaller.uninstall_namespacess=���'�'�)���w�w�~�~�h�'�������)�
�	�	�(��c��tjj|j��\}}||jzS�N)rr�splitext�_get_target�	nspkg_ext)rr�_s   rr	zInstaller._get_nspkg_file$s2���g�g�&�&�t�'7�'7�'9�:���!��$�.�.�(�(r c��|jSr")�target�rs rr$zInstaller._get_target(s���{�{�r )	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)c��y)Nz$sys._getframe(1).f_locals['sitedir']�r)s r�	_get_rootzInstaller._get_rootAs��5r c��t|jd��}|j�}|j}|j	d�\}}}|r||j
z
}dj
|�t�zdzS)N�.�;�
)�tuple�splitr,�_nspkg_tmpl�
rpartition�_nspkg_tmpl_multi�join�locals)r�pkg�pth�root�
tmpl_lines�parent�sep�childs        rrzInstaller._gen_nspkg_lineDsn���C�I�I�c�N�#���~�~����%�%�
� �^�^�C�0����U���$�0�0�0�J��x�x�
�#�f�h�.��5�5r c
��|jjxsg}ttt	t|j|����S)z,Return sorted list of all package namespaces)�distribution�namespace_packages�sorted�set�flattenr
�
_pkg_names)r�pkgss  rrzInstaller._get_all_ns_packagesMs8��� � �3�3�9�r���c�'�#�d�o�o�t�"<�=�>�?�?r c#�K�|jd�}|r'dj|���|j�|r�&yy�w)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)r2r6�pop)r8�partss  rrEzInstaller._pkg_namesRs4�����	�	�#�����(�(�5�/�!��I�I�K��s�9>�>N)�__name__�
__module__�__qualname__r%rrr	r$r3r5r,rr�staticmethodrEr+r rrr	sT���I� �"�)���K�"(�Q��;�6�6�@�
���r rc��eZdZd�Zd�Zy)�DevelopInstallerc�>�tt|j��Sr")�repr�str�egg_pathr)s rr,zDevelopInstaller._get_rootcs���C��
�
�&�'�'r c��|jSr")�egg_linkr)s rr$zDevelopInstaller._get_targetfs���}�}�r N)rJrKrLr,r$r+r rrOrObs��(�r rO)	r�	distutilsr�	itertools�chain�
from_iterablerDrrOr+r r�<module>rZs8��	����/�/�
'�
'��V�V�r�y�r 

?>