관리-도구
편집 파일: cmd.cpython-311.pyc
� �܋f�E � �x � d Z ddlZddlZddlZddlZddlmZmZmZm Z m Z ddlmZ ddl mZ G d� d� � ZdS ) ztdistutils.cmd Provides the Command class, the base class for the command classes in the distutils.command package. � N� )� _modified�archive_util�dir_util� file_util�util��log)�DistutilsOptionErrorc � � e Zd ZdZg Zd� Zd� Zd� Zd� Zd� Z d&d �Z d � Zej fd�Zd� Zd'd �Zd'd�Zd� Zd'd�Zd� Zd� Zd� Zd� Zd(d�Zd)d�Zd� Zd� Zd� Zd*d�Zd+d�Z d,d �Z d-d!�Z d.d"�Z!d/d#�Z" d0d$�Z# d1d%�Z$dS )2�Commanda} Abstract base class for defining command classes, the "worker bees" of the Distutils. A useful analogy for command classes is to think of them as subroutines with local variables called "options". The options are "declared" in 'initialize_options()' and "defined" (given their final values, aka "finalized") in 'finalize_options()', both of which must be defined by every command class. The distinction between the two is necessary because option values might come from the outside world (command line, config file, ...), and any options dependent on other options must be computed *after* these outside influences have been processed -- hence 'finalize_options()'. The "body" of the subroutine, where it does all its work based on the values of its options, is the 'run()' method, which must also be implemented by every command class. c � � ddl m} t ||� � st d� � �| j t u rt d� � �|| _ | � � � d| _ |j | _ d| _ d| _ d| _ dS )z�Create and initialize a new Command object. Most importantly, invokes the 'initialize_options()' method, which is the real initializer and depends on the actual command being instantiated. r )�Distributionz$dist must be a Distribution instancezCommand is an abstract classNF)�distutils.distr � isinstance� TypeError� __class__r �RuntimeError�distribution�initialize_options�_dry_run�verbose�force�help� finalized)�self�distr s �P/opt/cloudlinux/venv/lib64/python3.11/site-packages/setuptools/_distutils/cmd.py�__init__zCommand.__init__3 s� � � 0�/�/�/�/�/��$��-�-� D��B�C�C�C��>�W�$�$��=�>�>�>� ������!�!�!� �� � �|��� �� � �� � ����� c � � |dk r,t | d|z � � }|�t | j |� � S |S t |� � �)N�dry_run�_)�getattrr �AttributeError)r �attr�myvals r �__getattr__zCommand.__getattr__c sK � ��9����D�#��*�-�-�E��}��t�0�$�7�7�7��� ��&�&�&r c �J � | j s| � � � d| _ d S )NT)r �finalize_options�r s r �ensure_finalizedzCommand.ensure_finalizedm s) � ��~� $��!�!�#�#�#�����r c �2 � t d| j � d�� � �)a� Set default values for all the options that this command supports. Note that these defaults may be overridden by other commands, by the setup script, by config files, or by the command-line. Thus, this is not the place to code dependencies between options; generally, 'initialize_options()' implementations are just a bunch of "self.foo = None" assignments. This method must be implemented by all command classes. �abstract method -- subclass � must override�r r r+ s r r zCommand.initialize_options �&