관리-도구
편집 파일: scripts.cpython-311.pyc
� �܋f�G � � � d dl mZ d dlZd dlZd dlZd dlZd dlZd dlZd dlm Z ddl mZmZm Z ddlmZ ddlmZmZmZmZmZmZ ej e� � Zd� � � Z ej d � � Zd Zd� ZeZ G d� d e!� � Z"dS )� )�BytesION)�ZipInfo� )� sysconfig�detect_encoding�ZipFile)�finder)�FileOperator�get_export_entry�convert_path�get_executable�get_platform�in_venva� <?xml version="1.0" encoding="UTF-8" standalone="yes"?> <assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0"> <assemblyIdentity version="1.0.0.0" processorArchitecture="X86" name="%s" type="win32"/> <!-- Identify the application security requirements. --> <trustInfo xmlns="urn:schemas-microsoft-com:asm.v3"> <security> <requestedPrivileges> <requestedExecutionLevel level="asInvoker" uiAccess="false"/> </requestedPrivileges> </security> </trustInfo> </assembly>s ^#!.*pythonw?[0-9.]*([ ].*)?$z�# -*- coding: utf-8 -*- import re import sys from %(module)s import %(import_name)s if __name__ == '__main__': sys.argv[0] = re.sub(r'(-script\.pyw|\.exe)?$', '', sys.argv[0]) sys.exit(%(func)s()) c �� � d| v rj| � d� � r;| � dd� � \ }}d|v r|� d� � s|�d|�d�} n| � d� � sd| z } | S )N� z /usr/bin/env r �"z "z"%s")� startswith�split)� executable�env�_executables �`/builddir/build/BUILD/cloudlinux-venv-1.0.6/venv/lib/python3.11/site-packages/distlib/scripts.py�enquote_executabler 5 s� � � �j��� � � ��1�1� 1�)�/�/��Q�7�7��C���k�!�!�+�*@�*@��*E�*E�!�*-�#�#�{�{�{�;� ���(�(��-�-� 1�#�j�0� ��� c �8 � e Zd ZdZeZdZ dd�Zd� Ze j � d� � rd� Zd � Z d � Zdd�Zd � ZeZd� Zd� ZdZd� Zdd�Zd� Zed� � � Zej d� � � Zej dk sej dk rej dk rd� Zdd�Z dd�Z!dS )�ScriptMakerz_ A class to copy or create scripts from source scripts or callable specifications. NTFc � � || _ || _ || _ d| _ d| _ t j dk pt j dk ot j dk | _ t d� � | _ |pt |� � | _ t j dk pt j dk ot j dk | _ t j | _ d S )NF�posix�java)� �X.Y�nt)� source_dir� target_dir� add_launchers�force�clobber�os�name�_name�set_mode�set�variantsr �_fileop�_is_nt�sys�version_info)�selfr# r$ r% �dry_run�fileops r �__init__zScriptMaker.__init__R s� � � %���$���*����� ������G�+� J���F�1B� 2I�57�X��5H� � ��K�(�(�� ��6��g�!6�!6����g��o� @�"�'�V�*;� +?�.0�h�$�.>� ���,����r c �� � |� dd� � r_| j rXt j � |� � \ }}|� dd� � }t j � ||� � }|S )N�guiF�python�pythonw)�getr/ r( �pathr �replace�join)r2 r �options�dn�fns r �_get_alternate_executablez%ScriptMaker._get_alternate_executableg sf � ��;�;�u�e�$�$� .��� .��W�]�]�:�.�.�F�B�����H�i�0�0�B�����b�"�-�-�J��r r c �� � t |� � 5 }|� d� � dk cddd� � S # 1 swxY w Y dS # t t f$ r t � d|� � Y dS w xY w)zl Determine if the specified executable is a script (contains a #! line) � z#!NzFailed to open %sF)�open�read�OSError�IOError�logger�warning)r2 r �fps r � _is_shellzScriptMaker._is_shellp s� � � ��*�%�%� .���7�7�1�:�:��-�.� .� .� .� .� .� .� .� .� .� .� .���� .� .� .� .� .� .���W�%� � � ����2�J�?�?�?��u�u� ���s, �A �7�A �;�A �;�A �,A4�3A4c �� � | � |� � r*dd l}|j j � d� � dk r|S n)|� � � � d� � r|S d|z S )Nr zos.name�Linuxz jython.exez/usr/bin/env %s)rK r �lang�System�getProperty�lower�endswith)r2 r r s r �_fix_jython_executablez"ScriptMaker._fix_jython_executable| s| � ��~�~�j�)�)� "������9�#�/�/� �:�:�g�E�E�%�%� F��!�!�#�#�,�,�\�:�:� "�!�!�$�z�1�1r c �� � t j dk rd}nAt |� � t |� � z dz }t j dk rd}nd}d|vo||k }|rd|z |z d z }nd }|d|z |z dz z }|d z }|S )a Build a shebang line. In the simple case (on Windows, or a shebang line which is not too long or contains spaces) use a simple formulation for the shebang. Otherwise, use /bin/sh as the executable, with a contrived shebang which allows the script to run either under Python or sh, using suitable quoting. Thanks to Harald Nordgren for his input. See also: http://www.in-ulm.de/~mascheck/various/shebang/#length https://hg.mozilla.org/mozilla-central/file/tip/mach r T� �darwini � � s #!� s #!/bin/sh s '''exec' s "$0" "$@" s ' ''')r( r) �lenr0 �platform)r2 r �post_interp�simple_shebang�shebang_length�max_shebang_length�results r �_build_shebangzScriptMaker._build_shebang� s� � � �7�g���!�N�N� !��_�_�s�;�/?�/?�?�!�C�N��|�x�'�'�%(�"�"�%(�"�#�:�5� I�#1�5G�#G� � � ��Z�'�+�5��=�F�F�#�F��l�Z�/�+�=��O�O�F��h��F�� r r c � � d}| j r| j }d}�n,t j � � st � � }�n t � � rHt j � t j d� � dt j d� � z � � }n�t j dk rHt j � t j d� � dt j d� � z � � }n[t j � t j d� � dt j d � � �t j d� � ��� � }|r| � ||� � }t j � d � � r| � |� � }|rt! |� � }|� d� � }t j dk r d |vr d|vr|dz }| � ||� � } |� d� � n # t( $ r t+ d|z � � �w xY w|dk r; |� |� � n$# t( $ r t+ d|�d|�d�� � �w xY w|S )NTF�scriptszpython%s�EXEr"