python (3.11.7)
    eF                     p    d Z ddlZddlZddlZddlmZ ddlmZmZm	Z	m
Z
mZ ddlmZ  G d d          Z
dS )ztdistutils.cmd
Provides the Command class, the base class for the command classes
in the distutils.command package.
    N)DistutilsOptionError)utildir_util	file_utilarchive_utildep_utillogc                       e Zd ZdZg Zd Zd Zd Zd Zd Z	d%d	Z
d
 Zd&dZd
 Z
d'dZd'dZd Z	 d'dZd Zd Zd Zd Zd&dZd(dZd Zd Zd Zd)dZd*dZ	 	 d+dZ	 	 d,d Zd&d!Zd-d"Z 	 	 d.d#Z!	 d/d$Z"dS )0Commanda}  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 )zCreate 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 classN)distutils.distr   
isinstance	TypeError	__class__r   RuntimeErrordistributioninitialize_options_dry_runverboseforcehelp	finalized)selfdistr   s      A/BuggyBox/python/3.11.7/bootstrap/lib/python3.11/distutils/cmd.py__init__zCommand.__init__/   s     	0/////$-- 	DBCCC>W$$=>>> !!! 
 | 
 	     c                     |dk    r,t          | d|z             }|t          | j        |          S |S t          |          )Ndry_run_)getattrr   AttributeError)r   attrmyvals      r   __getattr__zCommand.__getattr___   sK    9D#*--E}t0$777 &&&r   c                 J    | j         s|                                  d| _         d S N   )r   finalize_optionsr   s    r   ensure_finalizedzCommand.ensure_finalizedi   s)    ~ 	$!!###r   c                 0    t          d| j        z            )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 %s must overrider   r   r,   s    r   r   zCommand.initialize_options{   #     I!^, - - 	-r   c                 0    t          d| j        z            )a  Set final values for all the options that this command supports.
        This is always called as late as possible, ie.  after any option
        assignments from the command-line or from other commands have been
        done.  Thus, this is the place to code option dependencies: if
        'foo' depends on 'bar', then it is safe to set 'foo' from 'bar' as
        long as 'foo' still has the same value it was assigned in
        'initialize_options()'.
        This method must be implemented by all command classes.
        r/   r0   r,   s    r   r+   zCommand.finalize_options   s#     I!^, - - 	-r   N c                 z   ddl m} |d|                                 z  }|                     ||z   t          j                   |dz   }| j        D ]j\  }}}|                    |          }|d         dk    r
|d d         }t          | |          }|                     ||d|z   t          j                   kd S )	Nr   )
longopt_xlatezcommand options for '%s':)levelz  =z = )	distutils.fancy_getoptr5   get_command_nameannouncer
   INFOuser_options	translater#   )r   headerindentr5   optionr"