
    df4
                         d dl mZ d dlmc mZ d dlmZ d dlZd dl	Z	d dl
mZmZ ddlmZ  G d dej                        Zy)	    )logN)DistutilsModuleError)DistributionPathMetadata   )ensure_directoryc                   $    e Zd ZdZd Zd ZddZy)install_scriptsz;Do normal script install, plus any egg_info wrapper scriptsc                 P    t         j                  j                  |        d| _        y )NF)origr
   initialize_optionsno_ep)selfs    [/home/api-vastappli/venv/lib/python3.12/site-packages/setuptools/command/install_scripts.pyr   z"install_scripts.initialize_options   s    //5
    c                 h   dd l mc m} | j                  d       | j                  j
                  r t        j                  j                  |        ng | _	        | j                  ry | j                  d      }t        |j                  t        |j                  |j                        |j                   |j"                        }| j                  d      }t%        |dd       }	 | j                  d      }t%        |dd      }|j*                  }|rd}|j,                  }|t.        j0                  k(  r|g}|j3                         }|j4                  j3                         j7                  |      }	|j9                  ||	j;                               D ]  }
 | j<                  |
   y # t&        t(        f$ r d}Y w xY w)	Nr   egg_infobuild_scripts
executablebdist_wininst_is_runningFz
python.exe)setuptools.command.easy_installcommandeasy_installrun_commanddistributionscriptsr   r
   runoutfilesr   get_finalized_commandr   egg_baser   r   egg_nameegg_versiongetattrImportErrorr   ScriptWriterWindowsScriptWritersysr   bestcommand_spec_class
from_paramget_args	as_headerwrite_script)r   eiei_cmddistbs_cmd
exec_parambw_cmd
is_wininstwritercmdargss              r   r   zinstall_scripts.run   sw   44$$$  $$T*DM::++J7OO\&//6??KOOV//
 ++O<V\48
	//@F >J %J++F' %J'',,.99*EOOD#--/: 	%DDt$	% 12 	J	s   F F10F1c                    ddl m}m} t        j                  d|| j
                         t        j                  j                  | j
                  |      }| j                  j                  |        |       }| j                  sHt        |       t        |d|z         }	|	j                  |       |	j                           ||d|z
         yy)z1Write an executable file to the scripts directoryr   )chmodcurrent_umaskzInstalling %s script to %swi  N)r   r:   r;   r   infoinstall_dirospathjoinr   appenddry_runr   openwriteclose)
r   script_namecontentsmodeignoredr:   r;   targetmaskfs
             r   r.   zinstall_scripts.write_script8   s    H-{D<L<LMd..<V$||V$VS4Z(AGGHGGI&%$,' r   N)t)__name__
__module____qualname____doc__r   r   r.    r   r   r
   r
      s    E$%L(r   r
   )	distutilsr   !distutils.command.install_scriptsr   r
   r   distutils.errorsr   r?   r(   pkg_resourcesr   r   _pathr   rS   r   r   <module>rY      s/     0 0 1 	 
 4 $;(d** ;(r   