AlkantarClanX12

Your IP : 3.144.29.213


Current Path : /proc/self/root/opt/alt/python39/lib64/python3.9/distutils/__pycache__/
Upload File :
Current File : //proc/self/root/opt/alt/python39/lib64/python3.9/distutils/__pycache__/dist.cpython-39.opt-1.pyc

a

R�f���@s�dZddlZddlZddlZddlmZzddlZWneyJdZYn0ddlTddl	m
Z
mZddlm
Z
mZmZddlmZddlmZe�d	�Zd
d�ZGdd
�d
�ZGdd�d�Zdd�ZdS)z}distutils.dist

Provides the Distribution class, which represents the module distribution
being built/installed/distributed.
�N)�message_from_file)�*)�FancyGetopt�translate_longopt)�
check_environ�	strtobool�
rfc822_escape��log)�DEBUGz^[a-zA-Z]([a-zA-Z0-9_]*)$cCsLt|t�rn<t|t�sHt|�j}d|�d|�d�}t�tj|�t|�}|S)Nz
Warning: 'z' should be a list, got type '�')�
isinstance�str�list�type�__name__r
ZWARN)�valueZ	fieldname�typename�msg�r�3/opt/alt/python39/lib64/python3.9/distutils/dist.py�_ensure_lists


rc@sDeZdZdZgd�ZdZgd�Zdd�eD�ZddiZdId
d�Z	dd
�Z
dJdd�Zdd�ZdKdd�Z
dd�Zdd�Zdd�Zdd�Zddgfdd�Zd d!�Zd"d#�Zd$d%�Zd&d'�Zd(d)�Zd*d+�ZdLd,d-�ZdMd.d/�ZdNd1d2�Zejfd3d4�Zd5d6�Zd7d8�Z d9d:�Z!d;d<�Z"d=d>�Z#d?d@�Z$dAdB�Z%dCdD�Z&dEdF�Z'dGdH�Z(d	S)O�Distributiona�The core of the Distutils.  Most of the work hiding behind 'setup'
    is really done within a Distribution instance, which farms the work out
    to the Distutils commands specified on the command line.

    Setup scripts will almost never instantiate Distribution directly,
    unless the 'setup()' function is totally inadequate to their needs.
    However, it is conceivable that a setup script might wish to subclass
    Distribution for some specialized purpose, and then pass the subclass
    to 'setup()' as the 'distclass' keyword argument.  If so, it is
    necessary to respect the expectations that 'setup' has of Distribution.
    See the code for 'setup()', in core.py, for details.
    ))�verbose�vzrun verbosely (default)�)�quiet�qz!run quietly (turns verbosity off))zdry-run�nzdon't actually do anything)�help�hzshow detailed help message)zno-user-cfgNz-ignore pydistutils.cfg in your home directoryz�Common commands: (see '--help-commands' for more)

  setup.py build      will build the package underneath 'build/'
  setup.py install    will install the package
))z
help-commandsNzlist all available commands)�nameNzprint package name)�version�Vzprint package version)�fullnameNzprint <package name>-<version>)�authorNzprint the author's name)�author-emailNz print the author's email address)�
maintainerNzprint the maintainer's name)zmaintainer-emailNz$print the maintainer's email address)�contactNz7print the maintainer's name if known, else the author's)z
contact-emailNz@print the maintainer's email address if known, else the author's)�urlNzprint the URL for this package)�licenseNz print the license of the package)�licenceNzalias for --license)�descriptionNzprint the package description)zlong-descriptionNz"print the long package description)�	platformsNzprint the list of platforms)�classifiersNzprint the list of classifiers)�keywordsNzprint the list of keywords)�providesNz+print the list of packages/modules provided)�requiresNz+print the list of packages/modules required)�	obsoletesNz0print the list of packages/modules made obsoletecCsg|]}t|d��qS)r�r)�.0�xrrr�
<listcomp>��zDistribution.<listcomp>rrNcCs\d|_d|_d|_|jD]}t||d�qt�|_|jjD] }d|}t||t|j|��q:i|_	d|_
d|_d|_i|_
g|_d|_i|_d|_d|_d|_d|_d|_d|_d|_d|_d|_d|_d|_i|_i|_|�r|�d�}|du�r8|d=|��D]4\}}|� |�}|��D]\}	}
d|
f||	<�q�qd|v�r~|d|d	<|d=d
}t!du�rnt!�"|�nt#j$�%|d�|��D]�\}}
t&|jd|��r�t|jd|�|
�nNt&|j|��r�t|j||
�n0t&||��r�t|||
�nd
t'|�}t!�"|��q�d|_(|jdu�rP|jD].}
|
�)d��s6�qP|
dk�r d|_(�qP�q |�*�dS)a0Construct a new Distribution instance: initialize all the
        attributes of a Distribution, and then use 'attrs' (a dictionary
        mapping attribute names to values) to assign some of those
        attributes their "real" values.  (Any attributes not mentioned in
        'attrs' will be assigned to some null value: 0, None, an empty list
        or dictionary, etc.)  Most importantly, initialize the
        'command_obj' attribute to the empty dictionary; this will be
        filled in with real command objects by 'parse_command_line()'.
        rr�get_N��optionszsetup scriptr+r*z:'licence' distribution option is deprecated; use 'license'�
Zset_zUnknown distribution option: %sT�-z
--no-user-cfgF)+r�dry_runr�display_option_names�setattr�DistributionMetadata�metadata�_METHOD_BASENAMES�getattr�cmdclass�command_packages�script_name�script_args�command_optionsZ
dist_files�packagesZpackage_dataZpackage_dir�
py_modules�	libraries�headers�ext_modulesZext_packageZinclude_dirsZ
extra_path�scripts�
data_filesZpassword�command_obj�have_run�get�items�get_option_dict�warnings�warn�sys�stderr�write�hasattr�repr�
want_user_cfg�
startswith�finalize_options)�self�attrs�attr�basenameZmethod_namer:�commandZcmd_options�opt_dict�opt�valr�key�argrrr�__init__�s~








zDistribution.__init__cCs&|j�|�}|dur"i}|j|<|S)z�Get the option dictionary for a given command.  If that
        command's option dictionary hasn't been created yet, then create it
        and return the new dictionary; otherwise, return the existing
        option dictionary.
        N)rHrR)r_rc�dictrrrrT&szDistribution.get_option_dictr9c	Cs�ddlm}|dur"t|j���}|dur@|�||�|d}|sV|�|d�dS|D]h}|j�|�}|dur�|�|d|�qZ|�|d|�||�}|�d�D]}|�|d|�q�qZdS)Nr)�pformatz  zno commands known yetzno option dict for '%s' commandzoption dict for '%s' command:r;)Zpprintrk�sortedrH�keys�announcerR�split)	r_�header�commands�indentrkZcmd_namerd�out�linerrr�dump_option_dicts1s*��zDistribution.dump_option_dictscCs�g}t�tj�tjdj�}tj�|d�}tj�|�rB|�	|�tj
dkrRd}nd}|jr�tj�tj�d�|�}tj�|�r�|�	|�d}tj�|�r�|�	|�t
r�|�dd	�|��|S)
a�Find as many configuration files as should be processed for this
        platform, and return a list of filenames in the order in which they
        should be parsed.  The filenames returned are guaranteed to exist
        (modulo nasty race conditions).

        There are three possible config files: distutils.cfg in the
        Distutils installation directory (ie. where the top-level
        Distutils __inst__.py file lives), a file in the user's home
        directory named .pydistutils.cfg on Unix and pydistutils.cfg
        on Windows/Mac; and setup.cfg in the current directory.

        The file in the user's home directory can be disabled with the
        --no-user-cfg option.
        �	distutilsz
distutils.cfg�posixz.pydistutils.cfgzpydistutils.cfg�~z	setup.cfgzusing config files: %sz, )r�os�path�dirnamerW�modules�__file__�join�isfile�appendr!r\�
expanduserrrn)r_�filesZsys_dirZsys_fileZ
user_filenameZ	user_fileZ
local_filerrr�find_config_filesMs&



zDistribution.find_config_filescCs�ddlm}tjtjkr"gd�}ng}t|�}|dur>|��}trL|�d�|�}|D]�}trl|�d|�|�	|�|�
�D]V}|�|�}|�|�}|D]8}	|	dkr�|	|vr�|�
||	�}
|	�dd�}	||
f||	<q�q~|��qVd	|jv�r�|jd	��D]�\}	\}}
|j�
|	�}zF|�r.t||t|
��n(|	d
v�rJt||	t|
��nt||	|
�Wq�t�y�}
zt|
��WYd}
~
q�d}
~
00q�dS)Nr)�ConfigParser)
zinstall-basezinstall-platbasezinstall-libzinstall-platlibzinstall-purelibzinstall-headerszinstall-scriptszinstall-data�prefixzexec-prefix�home�user�rootz"Distribution.parse_config_files():z  reading %srr<�_�global)rr=)Zconfigparserr�rWr��base_prefix�	frozensetr�rrn�readZsectionsr:rTrR�replacerirHrS�negative_optr?r�
ValueError�DistutilsOptionError)r_�	filenamesr�Zignore_options�parser�filenameZsectionr:rdrerf�src�aliasrrrr�parse_config_files}sD






zDistribution.parse_config_filescCs�|��}g|_t||j�}|�|j�|�ddi�|j|j|d�}|�	�}t
�|j�|�
|�rhdS|r�|�||�}|durhdSqh|jr�|j|t|j�dk|jd�dS|js�td��dS)	a�Parse the setup script's command line, taken from the
        'script_args' instance attribute (which defaults to 'sys.argv[1:]'
        -- see 'setup()' in core.py).  This list is first processed for
        "global options" -- options that set attributes of the Distribution
        instance.  Then, it is alternately scanned for Distutils commands
        and options for that command.  Each new command terminates the
        options for the previous command.  The allowed options for a
        command are determined by the 'user_options' attribute of the
        command class -- thus, we have to be able to load command classes
        in order to parse the command line.  Any error in that 'options'
        attribute raises DistutilsGetoptError; any error on the
        command-line raises DistutilsArgError.  If no Distutils commands
        were found on the command line, raises DistutilsArgError.  Return
        true if command-line was successfully parsed and we should carry
        on with executing commands; false if no errors but we shouldn't
        execute commands (currently, this only happens if user asks for
        help).
        r+r*)�args�objectNr��display_optionsrqzno commands suppliedT)�_get_toplevel_optionsrqrr��set_negative_aliasesr�Zset_aliases�getoptrGZget_option_orderr
Z
set_verbosityr�handle_display_options�_parse_command_optsr�
_show_help�len�DistutilsArgError)r_Ztoplevel_optionsr�r��option_orderrrr�parse_command_line�s.	
�zDistribution.parse_command_linecCs|jdgS)z�Return the non-display options recognized at the top level.

        This includes options that are recognized *only* at the top
        level as well as options recognized for commands.
        )zcommand-packages=Nz0list of packages that provide distutils commands)�global_options�r_rrrr��s�z"Distribution._get_toplevel_optionsc
Csddlm}|d}t�|�s*td|��|j�|�z|�|�}Wn,typ}zt	|��WYd}~n
d}~00t
||�s�td|��t|d�r�t
|jt�s�d}t||��|j}t|d�r�|��}|�|j�t|d	�r�t
|jt�r�t|j�}ng}|�|j|j|�|�|�|�|d
d��\}}	t|	d��rX|	j�rX|j|d|gd�dSt|d	��r�t
|jt��r�d}
|jD]F\}}}
}t|	|�|���r|d
}
t|��r�|�ntd
||f���q||
�r�dS|�|�}t|	���D]\}}d|f||<�q�|S)a�Parse the command-line options for a single command.
        'parser' must be a FancyGetopt instance; 'args' must be the list
        of arguments, starting with the current command (whose options
        we are about to parse).  Returns a new version of 'args' with
        the next command at the front of the list; will be the empty
        list if there are no more commands on the command line.  Returns
        None if the user asked for help on this command.
        r��Commandzinvalid command name '%s'Nz&command class %s must subclass Command�user_optionszIcommand class %s must provide 'user_options' attribute (a list of tuples)r��help_optionsrrr�zYinvalid help function %r for help option '%s': must be a callable object (function, etc.)zcommand line) �
distutils.cmdr��
command_re�match�
SystemExitrqr��get_command_class�DistutilsModuleErrorr��
issubclassZDistutilsClassErrorrZr
r�rr��copy�updater��fix_help_options�set_option_tabler�r�r�rr�Z
get_attr_name�callablerT�varsrS)r_r�r�r�rcZ	cmd_classrr�r�ZoptsZhelp_option_foundZhelp_optionZshortZdesc�funcrdr!rrrrr�sr


�

�


���

�
��
z Distribution._parse_command_optscCsPdD]F}t|j|�}|durqt|t�rdd�|�d�D�}t|j||�qdS)z�Set final values for all the options on the Distribution
        instance, analogous to the .finalize_options() method of Command
        objects.
        �r/r-NcSsg|]}|���qSr��strip)r4Zelmrrrr6jr7z1Distribution.finalize_options.<locals>.<listcomp>�,)rCrAr
rror?)r_rarrrrr^`s
zDistribution.finalize_optionsrc
Csddlm}ddlm}|rR|r*|��}n|j}|�|�|�|jd�t	d�|rt|�|j
�|�d�t	d�|jD]z}t|t
�r�t||�r�|}	n
|�|�}	t|	d�r�t|	jt�r�|�|	jt|	j��n|�|	j�|�d|	j�t	d�qzt	||j��d	S)
abShow help for the setup script command-line in the form of
        several lists of command-line options.  'parser' should be a
        FancyGetopt instance; do not expect it to be returned in the
        same state, as its option table will be reset to make it
        generate the correct help text.

        If 'global_options' is true, lists the global options:
        --verbose, --dry-run, etc.  If 'display_options' is true, lists
        the "display-only" options: --name, --version, etc.  Finally,
        lists per-command help for every command name or command class
        in 'commands'.
        r��	gen_usager�z
Global options:r9zKInformation display options (just display information, ignore any commands)r�zOptions for '%s' command:N)�distutils.corer�r�r�r�r�r�Z
print_help�common_usage�printr�rqr
rr�r�rZr�rr�r�rrF)
r_r�r�r�rqr�r�r:rc�klassrrrr�ms:

�



��
zDistribution._show_helpc	Cs�ddlm}|jr4|��td�t||j��dSd}i}|jD]}d||d<qB|D]l\}}|rX|�|�rXt|�}t	|j
d|��}|dvr�td�|��n |dvr�td	�|��nt|�d}qX|S)
z�If there were any non-global "display-only" options
        (--help-commands or the metadata display options) on the command
        line, display the requested info and return true; else return
        false.
        rr�r9rr8r�r�)r.r0r1r2r;)r�r�Z
help_commands�print_commandsr�rFr�rRrrCrAr~)	r_r�r�Zany_display_optionsZis_display_option�optionrerfrrrrr��s*
z#Distribution.handle_display_optionsc	Csht|d�|D]R}|j�|�}|s.|�|�}z
|j}WntyNd}Yn0td|||f�qdS)zZPrint a subset of the list of all commands -- used by
        'print_commands()'.
        �:�(no description available)z
  %-*s  %sN)r�rDrRr�r,�AttributeError)r_rqrp�
max_length�cmdr�r,rrr�print_command_list�s


zDistribution.print_command_listcCs�ddl}|jj}i}|D]}d||<qg}|j��D]}|�|�s4|�|�q4d}||D]}t|�|krZt|�}qZ|�|d|�|r�t	�|�|d|�dS)anPrint out a help message listing all available commands with a
        description of each.  The list is divided into "standard commands"
        (listed in distutils.command.__all__) and "extra commands"
        (mentioned in self.cmdclass, but not a standard command).  The
        descriptions come from the command class attribute
        'description'.
        rNrzStandard commandszExtra commands)
�distutils.commandrc�__all__rDrmrRr�r�r�r�)r_rv�std_commands�is_stdr��extra_commandsr�rrrr��s.


��zDistribution.print_commandsc		Cs�ddl}|jj}i}|D]}d||<qg}|j��D]}|�|�s4|�|�q4g}||D]N}|j�|�}|sx|�|�}z
|j}Wnt	y�d}Yn0|�||f�qZ|S)a>Get a list of (command, description) tuples.
        The list is divided into "standard commands" (listed in
        distutils.command.__all__) and "extra commands" (mentioned in
        self.cmdclass, but not a standard command).  The descriptions come
        from the command class attribute 'description'.
        rNrr�)
r�rcr�rDrmrRr�r�r,r�)	r_rvr�r�r�r��rvr�r,rrr�get_command_list�s(	




zDistribution.get_command_listcCsN|j}t|t�sJ|durd}dd�|�d�D�}d|vrD|�dd�||_|S)z9Return a list of packages from which commands are loaded.Nr9cSsg|]}|dkr|���qS)r9r�)r4Zpkgrrrr6!r7z5Distribution.get_command_packages.<locals>.<listcomp>r�zdistutils.commandr)rEr
rro�insert)r_Zpkgsrrr�get_command_packagess
z!Distribution.get_command_packagesc	Cs�|j�|�}|r|S|��D]�}d||f}|}zt|�tj|}Wnty\YqYn0zt||�}Wn$ty�t	d|||f��Yn0||j|<|St	d|��dS)aoReturn the class that implements the Distutils command named by
        'command'.  First we check the 'cmdclass' dictionary; if the
        command is mentioned there, we fetch the class object from the
        dictionary and return it.  Otherwise we load the command module
        ("distutils.command." + command) and fetch the command class from
        the module.  The loaded class is also stored in 'cmdclass'
        to speed future calls to 'get_command_class()'.

        Raises DistutilsModuleError if the expected module could not be
        found, or if that module does not define the expected class.
        z%s.%sz3invalid command '%s' (no class '%s' in module '%s')zinvalid command '%s'N)
rDrRr��
__import__rWr|�ImportErrorrCr�r�)r_rcr�ZpkgnameZmodule_nameZ
klass_name�modulerrrr�'s,
��

zDistribution.get_command_classcCsl|j�|�}|sh|rhtr&|�d|�|�|�}||�}|j|<d|j|<|j�|�}|rh|�||�|S)aReturn the command object for 'command'.  Normally this object
        is cached on a previous call to 'get_command_obj()'; if no command
        object for 'command' is in the cache, then we either create and
        return it (if 'create' is true) or return None.
        z<Distribution.get_command_obj(): creating '%s' command objectr)rPrRrrnr�rQrH�_set_command_options)r_rcZcreate�cmd_objr�r:rrr�get_command_objMs�

zDistribution.get_command_objcCsZ|��}|dur|�|�}tr,|�d|�|��D�]\}\}}trZ|�d|||f�zdd�|jD�}Wnty�g}Yn0z
|j}Wnty�i}Yn0z|t|t	�}	||vr�|	r�t
|||t|��nJ||vr�|	r�t
||t|��n,t||��rt
|||�nt
d|||f��Wq4t�yR}
zt
|
��WYd}
~
q4d}
~
00q4dS)aySet the options for 'command_obj' from 'option_dict'.  Basically
        this means copying elements of a dictionary ('option_dict') to
        attributes of an instance ('command').

        'command_obj' must be a Command instance.  If 'option_dict' is not
        supplied, uses the standard option dictionary for this command
        (from 'self.command_options').
        Nz#  setting options for '%s' command:z    %s = %s (from %s)cSsg|]}t|��qSrr3)r4�orrrr6|s�z5Distribution._set_command_options.<locals>.<listcomp>z1error in %s: command '%s' has no such option '%s')�get_command_namerTrrnrSZboolean_optionsr�r�r
rr?rrZr�r�)r_rPZoption_dict�command_namer��sourcerZ	bool_optsZneg_optZ	is_stringrrrrr�hsF	

��




��z!Distribution._set_command_optionsrcCs|ddlm}t||�s&|}|�|�}n|��}|js8|S|��d|_d|j|<|�|�|rx|�	�D]}|�
||�qf|S)a�Reinitializes a command to the state it was in when first
        returned by 'get_command_obj()': ie., initialized but not yet
        finalized.  This provides the opportunity to sneak option
        values in programmatically, overriding or supplementing
        user-supplied values from the config files and command line.
        You'll have to re-finalize the command object (by calling
        'finalize_options()' or 'ensure_finalized()') before using it for
        real.

        'command' should be a command name (string) or command object.  If
        'reinit_subcommands' is true, also reinitializes the command's
        sub-commands, as declared by the 'sub_commands' class attribute (if
        it has one).  See the "install" command for an example.  Only
        reinitializes the sub-commands that actually matter, ie. those
        whose test predicates return true.

        Returns the reinitialized command object.
        rr�)r�r�r
r�r�Z	finalizedZinitialize_optionsrQr�Zget_sub_commands�reinitialize_command)r_rcZreinit_subcommandsr�r��subrrrr��s


z!Distribution.reinitialize_commandcCst�||�dS�Nr	)r_r�levelrrrrn�szDistribution.announcecCs|jD]}|�|�qdS)z�Run each command that was seen on the setup script command line.
        Uses the list of commands found and cache of command objects
        created by 'get_command_obj()'.
        N)rq�run_command)r_r�rrr�run_commands�s
zDistribution.run_commandscCsD|j�|�rdSt�d|�|�|�}|��|��d|j|<dS)a�Do whatever it takes to run a command (including nothing at all,
        if the command has already been run).  Specifically: if we have
        already created and run the command named by 'command', return
        silently without doing anything.  If the command named by 'command'
        doesn't even have a command object yet, create one.  Then invoke
        'run()' on that command object (or an existing one).
        Nz
running %sr)rQrRr
�infor�Zensure_finalized�run)r_rcr�rrrr��s	
zDistribution.run_commandcCst|jp|jpg�dkS�Nr)r�rIrJr�rrr�has_pure_modules�szDistribution.has_pure_modulescCs|jot|j�dkSr�)rMr�r�rrr�has_ext_modules�szDistribution.has_ext_modulescCs|jot|j�dkSr�)rKr�r�rrr�has_c_libraries�szDistribution.has_c_librariescCs|��p|��Sr�)r�r�r�rrr�has_modules�szDistribution.has_modulescCs|jot|j�dkSr�)rLr�r�rrr�has_headers�szDistribution.has_headerscCs|jot|j�dkSr�)rNr�r�rrr�has_scripts�szDistribution.has_scriptscCs|jot|j�dkSr�)rOr�r�rrr�has_data_files�szDistribution.has_data_filescCs|��o|��o|��Sr�)r�r�r�r�rrr�is_pure�s
��zDistribution.is_pure)N)NNr9)N)r)N)r))r�
__module__�__qualname__�__doc__r�r�r�r>r�rirTrur�r�r�r�r�r^r�r�r�r�r�r�r�r�r�r�r
�INFOrnr�r�r�r�r�r�r�r�r�r�rrrrr,sN,

0
:C[
�
2(!"&

,
)
rc@seZdZdZdZdBdd�Zdd�Zdd	�Zd
d�Zdd
�Z	dd�Z
dd�Zdd�Zdd�Z
dd�Zdd�Zdd�Zdd�Zdd�Zd d!�Zd"d#�ZeZd$d%�Zd&d'�Zd(d)�Zd*d+�Zd,d-�Zd.d/�Zd0d1�Zd2d3�Zd4d5�Zd6d7�Zd8d9�Z d:d;�Z!d<d=�Z"d>d?�Z#d@dA�Z$dS)Cr@z]Dummy class to hold the distribution meta-data: name, version,
    author, and so forth.
    )r!r"r%�author_emailr'�maintainer_emailr)r*r,�long_descriptionr/r-r$r(Z
contact_emailr.�download_urlr0r1r2NcCs�|dur|�t|��nfd|_d|_d|_d|_d|_d|_d|_d|_	d|_
d|_d|_d|_
d|_d|_d|_d|_d|_dSr�)�
read_pkg_file�openr!r"r%r�r'r�r)r*r,r�r/r-r.r�r0r1r2)r_rzrrrri
s&zDistributionMetadata.__init__cst|���fdd�}�fdd�}�d}|d�|_|d�|_|d�|_|d	�|_d
|_|d�|_d
|_|d�|_|d
�|_	d�vr�|d�|_
nd
|_
|d�|_|d�|_d�vr�|d��d�|_
|d�|_|d�|_|dkr�|d�|_|d�|_|d�|_nd
|_d
|_d
|_d
S)z-Reads the metadata values from a file object.cs�|}|dkrdS|S�NZUNKNOWNr)r!r�rrr�_read_field(sz7DistributionMetadata.read_pkg_file.<locals>._read_fieldcs��|d�}|gkrdS|Sr�)Zget_all)r!�valuesr�rr�
_read_list.sz6DistributionMetadata.read_pkg_file.<locals>._read_listzmetadata-versionr!r"Zsummaryr%Nr&z	home-pager*zdownload-urlr,r/r��platformZ
classifier�1.1r1r0r2)rr!r"r,r%r'r�r�r)r*r�r�ror/r-r.r1r0r2)r_�filer�r�Zmetadata_versionrr�rr�$s:












z"DistributionMetadata.read_pkg_filecCsFttj�|d�ddd��}|�|�Wd�n1s80YdS)z7Write the PKG-INFO file into the release tree.
        zPKG-INFO�wzUTF-8)�encodingN)r�ryrzr~�write_pkg_file)r_Zbase_dirZpkg_inforrr�write_pkg_infoXs
�z#DistributionMetadata.write_pkg_infocCsbd}|js"|js"|js"|js"|jr&d}|�d|�|�d|���|�d|���|�d|���|�d|�	��|�d|�
��|�d	|���|�d
|���|jr�|�d|j�t
|���}|�d|�d
�|���}|�r|�d|�|�|d|���|�|d|���|�|d|���|�|d|���|�|d|���dS)z9Write the PKG-INFO format data to a file object.
        z1.0rzMetadata-Version: %s
z	Name: %s
zVersion: %s
zSummary: %s
zHome-page: %s
zAuthor: %s
zAuthor-email: %s
zLicense: %s
zDownload-URL: %s
zDescription: %s
r�z
Keywords: %s
ZPlatformZ
ClassifierZRequiresZProvidesZ	ObsoletesN)r0r1r2r.r�rY�get_name�get_version�get_description�get_url�get_contact�get_contact_email�get_licenser�get_long_descriptionr~�get_keywords�_write_list�
get_platforms�get_classifiers�get_requires�get_provides�
get_obsoletes)r_rr"Z	long_descr/rrrr_s6��z#DistributionMetadata.write_pkg_filecCs |D]}|�d||f�qdS)Nz%s: %s
)rY)r_rr!r�rrrrr�sz DistributionMetadata._write_listcCs
|jpdSr�)r!r�rrrr�szDistributionMetadata.get_namecCs
|jpdS)Nz0.0.0)r"r�rrrr�sz DistributionMetadata.get_versioncCsd|��|��fS)Nz%s-%s)rrr�rrr�get_fullname�sz!DistributionMetadata.get_fullnamecCs
|jpdSr�)r%r�rrr�
get_author�szDistributionMetadata.get_authorcCs
|jpdSr�)r�r�rrr�get_author_email�sz%DistributionMetadata.get_author_emailcCs
|jpdSr�)r'r�rrr�get_maintainer�sz#DistributionMetadata.get_maintainercCs
|jpdSr�)r�r�rrr�get_maintainer_email�sz)DistributionMetadata.get_maintainer_emailcCs|jp|jpdSr�)r'r%r�rrrr
�sz DistributionMetadata.get_contactcCs|jp|jpdSr�)r�r�r�rrrr�sz&DistributionMetadata.get_contact_emailcCs
|jpdSr�)r)r�rrrr	�szDistributionMetadata.get_urlcCs
|jpdSr�)r*r�rrrr�sz DistributionMetadata.get_licensecCs
|jpdSr�)r,r�rrrr�sz$DistributionMetadata.get_descriptioncCs
|jpdSr�)r�r�rrrr
�sz)DistributionMetadata.get_long_descriptioncCs
|jpgSr�)r/r�rrrr�sz!DistributionMetadata.get_keywordscCst|d�|_dS)Nr/)rr/�r_rrrr�set_keywords�sz!DistributionMetadata.set_keywordscCs|jp
dgSr�)r-r�rrrr�sz"DistributionMetadata.get_platformscCst|d�|_dS)Nr-)rr-rrrr�
set_platforms�sz"DistributionMetadata.set_platformscCs
|jpgSr�)r.r�rrrr�sz$DistributionMetadata.get_classifierscCst|d�|_dS)Nr.)rr.rrrr�set_classifiers�sz$DistributionMetadata.set_classifierscCs
|jpdSr�)r�r�rrr�get_download_url�sz%DistributionMetadata.get_download_urlcCs
|jpgSr�)r1r�rrrr�sz!DistributionMetadata.get_requirescCs,ddl}|D]}|j�|�qt|�|_dSr�)�distutils.versionpredicate�versionpredicate�VersionPredicaterr1�r_rrvrrrr�set_requires�sz!DistributionMetadata.set_requirescCs
|jpgSr�)r0r�rrrr�sz!DistributionMetadata.get_providescCs6dd�|D�}|D]}ddl}|j�|�q||_dS)NcSsg|]}|���qSrr�)r4rrrrr6�r7z5DistributionMetadata.set_provides.<locals>.<listcomp>r)rr Zsplit_provisionr0)r_rrrvrrr�set_provides�s
z!DistributionMetadata.set_providescCs
|jpgSr�)r2r�rrrr�sz"DistributionMetadata.get_obsoletescCs,ddl}|D]}|j�|�qt|�|_dSr�)rr r!rr2r"rrr�
set_obsoletes�sz"DistributionMetadata.set_obsoletes)N)%rr�r�r�rBrir�rrrrrrrrrrr
rr	rZget_licencerr
rrrrrrrrr#rr$rr%rrrrr@�sD	
4"r@cCs$g}|D]}|�|dd��q|S)zConvert a 4-tuple 'help_options' list as found in various command
    classes to the 3-tuple form required by FancyGetopt.
    r�)r�)r:Znew_optionsZ
help_tuplerrrr��sr�)r�rWry�reZemailrrUr�Zdistutils.errorsZdistutils.fancy_getoptrrZdistutils.utilrrrrvr
Zdistutils.debugr�compiler�rrr@r�rrrr�<module>s4

Zc