Hacked By AnonymousFox
�Re � @ sq d d l Z d d l m Z d d l Z d d l m Z e j j Z Gd d � d � Z Gd d � d e � Z
d S)� N)�log)�mapc @ s| e Z d Z d Z d d � Z d d � Z d d � Z d Z d Z d d � Z d d � Z
d d � Z e d d � � Z
d S)� Installerz
-nspkg.pthc C s� | j � } | s d St j j | j � � \ } } | | j 7} | j j | � t j d | � t
| j | � } | j r� t
| � d St | d � � } | j | � Wd QRXd S)Nz
Installing %s�wt)�_get_all_ns_packages�os�path�splitext�_get_target� nspkg_ext�outputs�appendr �infor �_gen_nspkg_line�dry_run�list�open�
writelines)�self�nsp�filename�ext�lines�f� r ��/builddir/build/BUILDROOT/alt-python35-setuptools-36.3.0-4.el8.x86_64/opt/alt/python35/lib/python3.5/site-packages/setuptools/namespaces.py�install_namespaces s
zInstaller.install_namespacesc C sb t j j | j � � \ } } | | j 7} t j j | � sA d St j d | � t j | � d S)NzRemoving %s) r r r r
r �existsr r �remove)r r r r r r �uninstall_namespaces! s
zInstaller.uninstall_namespacesc C s | j S)N)�target)r r r r r
) s zInstaller._get_target�import sys, types, os�#has_mfs = sys.version_info > (3, 5)�$p = os.path.join(%(root)s, *%(pth)r)�4importlib = has_mfs and __import__('importlib.util')�-has_mfs and __import__('importlib.machinery')��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)])))�Cm = m or sys.modules.setdefault(%(pkg)r, types.ModuleType(%(pkg)r))�7mp = (m or []) and m.__dict__.setdefault('__path__',[])�(p not in mp) and mp.append(p)�4m and setattr(sys.modules[%(parent)r], %(child)r, m)c C s d S)Nz$sys._getframe(1).f_locals['sitedir']r )r r r r � _get_rootC s zInstaller._get_rootc C sy t | � } t | j d � � } | j � } | j } | j d � \ } } } | ra | | j 7} d j | � t � d S)N�.�;�
) �str�tuple�splitr+ �_nspkg_tmpl�
rpartition�_nspkg_tmpl_multi�join�locals)r �pkg�pth�rootZ
tmpl_lines�parent�sep�childr r r r F s
zInstaller._gen_nspkg_linec C s. | j j p g } t t t | j | � � � S)z,Return sorted list of all package namespaces)�distributionZnamespace_packages�sorted�flattenr �
_pkg_names)r �pkgsr r r r Q s zInstaller._get_all_ns_packagesc c s8 | j d � } x"