HEX
Server: Apache/2.4.52 (Ubuntu)
System: Linux spn-python 5.15.0-89-generic #99-Ubuntu SMP Mon Oct 30 20:42:41 UTC 2023 x86_64
User: arjun (1000)
PHP: 8.1.2-1ubuntu2.20
Disabled: NONE
Upload Files
File: //usr/share/dh-python/dhpython/build/__pycache__/plugin_flit.cpython-310.pyc
o

O�Ib�@s�ddlmZddlmZddlZddlZddlZddlmZddl	Z	zddl
Z
Wn	ey1Ynwzddlm
Z
WneyEeZ
YnwddlmZmZe�d�ZGdd�de
�ZGd	d
�d
e�ZdS)�)�fnmatch)�PathN)�	Installer)�Base�
shell_command�dhpythonc@seZdZdd�ZdS)�DebianInstallerc	CsV|dd�tjkr|dd�}|j|jd�}t�||�|d<||d|d<tj|ddd�tj|ddd�t�|dt�|jj	��}t�
|�r_t�|�rZt�|�sZt
�|�nt�|�t|jj	�}|jjr|t�d||�t
�||�|�|�nt�d	||�t
�||�|j�|�|jj�d
i�}|r�t�d|d�|�||d�t�d|d�|�|d�t|d��d
�D]}|��q�t|d��d�D]W}t |��}t!�"|�}	t#|	�}
Wd�n1s�wYt |d��*}t!�$|�}|
D]\}}}
|�%|d�}t&|d
��rq�|�'|||
g�q�Wd�n	1�s#wYq�dS)z\Install a module/package into package directory, and create its
           scripts.
        N�)�user�purelib�scriptsT)�exist_okzInstalling package %s -> %szInstalling file %s -> %s�console_scriptszInstalling scripts to %szWriting dist-info %sz*.dist-info/direct_url.jsonz*.dist-info/RECORD�w�)(�os�sep�	_get_dirsr
�osp�join�makedirs�basename�module�path�lexists�isdir�islink�shutil�rmtree�unlink�str�
is_package�log�info�copytree�_record_installed_directory�copy2�installed_files�append�ini_info�entrypoints�get�install_scripts�write_dist_infor�glob�open�csv�reader�list�writer�replacer�writerow)�self�destdir�
installdir�dirs�dst�srcrr�fr1�recordsr3�hash_�size�r@�2/usr/share/dh-python/dhpython/build/plugin_flit.py�install_directly-sX





�
����z DebianInstaller.install_directlyN)�__name__�
__module__�__qualname__rBr@r@r@rAr,srcsreZdZdZddhZdgZiZejdhBZ�fdd�Z	�fdd	�Z
d
d�Zdd
�Zdd�Z
e�fdd��Z�ZS)�BuildSystemzFlit build system�python3zpython{version}�pyproject.toml�buildcs�tturdSt��|�}z.tdd��
}t�|�}Wd�n1s"wY|�di��d�dkr7|d7}nd}WntyEd}Ynt	yOd}Ynw|d	krVd	S|S)
a�Return certainty level that this plugin describes the right build
        system

        This method uses cls.{REQUIRED}_FILES (pyroject.toml) as well as
        checking to see if build-backend is set to flit_core.buildapi.

        Score is 85 if both are present (to allow manually setting distutils to
        score higher if set).

        :return: 0 <= certainty <= 100
        :rtype: int
        rrH�rbNzbuild-systemz
build-backendzflit_core.buildapi�#�d)
r�object�super�detectr/�tomli�loadr+�	NameError�FileNotFoundError)r6�context�resultr<�	pyproject��	__class__r@rArOis*
��
��zBuildSystem.detectcsPt��||�t�|d���r&t�d|d�t�|d�o%t�	|d�dS)N�interpreterz'removing '%s' (and everything under it)�	build_dirr)
rN�cleanr�exists�binaryr"�debugrrr�r6rT�argsrWr@rAr[�s��zBuildSystem.cleancCsdS)Nrr@r_r@r@rA�	configure�szBuildSystem.configurecCs>t|d�}dddd�}tj|dfi|���|dd�dS)	N�dirF�none�r
�symlink�depsrHrZrr�rr�
from_ini_pathrB�r6rTr`�my_dir�install_kwargsr@r@rArI�s��zBuildSystem.buildcCsBt|d�}dddd�}tj|dfi|���|d|d�dS)	NrbFrcrdrHr7�install_dirrrgrir@r@rA�install�s��zBuildSystem.installcst��||�S)N)rN�testr_rWr@rArn�szBuildSystem.test)rCrDrE�DESCRIPTION�SUPPORTED_INTERPRETERS�REQUIRED_FILES�OPTIONAL_FILESr�CLEAN_FILESrOr[rarIrmrrn�
__classcell__r@r@rWrArFbs$		rF)r�pathlibrr0�loggingr�os.pathrrrrP�ModuleNotFoundError�flit.installr�ImportErrorrM�dhpython.build.baserr�	getLoggerr"rrFr@r@r@rA�<module>s*��
6