OwlCyberSecurity - MANAGER
Edit File: dist.cpython-38.pyc
U ����e5d������������������������@���s����d�Z�ddlZddlZddlZddlmZ�zddlZW�n�ek rL���dZY�nX�ddlT�ddl m Z mZ�ddlm Z mZmZ�ddlmZ�ddlmZ�e�d �Zd d��ZG�dd ��d �ZG�dd��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_]*)$c�����������������C���sL���t�|�t�rn<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����&/usr/lib64/python3.8/distutils/dist.py�_ensure_list���s���� r���c�������������������@���sp��e�Zd�ZdZdddddgZdZdd d ddd dddddddddddddddgZdd��eD��Zdd iZdad"d#�Z d$d%��Z dbd'd(�Zd)d*��Zdcd+d,�Z d-d.��Zd/d0��Zd1d2��Zd3d4��Zd5d5g�fd6d7�Zd8d9��Zd:d;��Zd<d=��Zd>d?��Zd@dA��ZdBdC��ZdddDdE�ZdedFdG�ZdfdIdJ�ZejfdKdL�ZdMdN��ZdOdP��Z dQdR��Z!dSdT��Z"dUdV��Z#dWdX��Z$dYdZ��Z%d[d\��Z&d]d^��Z'd_d`��Z(d!S�)g�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 obsoletec�����������������C���s���g�|�]}t�|d����qS�)r����r���)�.0�xr���r���r���� <listcomp>����s�����zDistribution.<listcomp>r���r���Nc�����������������C���s\��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�}|dk �r8|d=�|���D�]4\}}|�� |�}|���D�]\} } d| f|| <��q�qd|k�r~|d�|d <�|d=�d }t!dk �rnt!�"|��nt#j$�%|d���|���D�]�\}} t&|�jd|���r�t|�jd|��| ��nNt&|�j|��r�t|�j|| ��n0t&|�|��r�t|�|| ��nd t'|��}t!�"|���q�d|�_(|�jdk �rP|�jD�].} | �)d��s6��qP| dk�r d|�_(��qP�q |��*���dS�)a0��Construct 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()'. r���r����get_N���optionszsetup 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�packagesZpackage_dataZpackage_dir� py_modules� libraries�headers�ext_modulesZext_packageZinclude_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_namer9����commandZcmd_options�opt_dict�opt�valr����key�argr���r���r����__init__����s~���� zDistribution.__init__c�����������������C���s&���|�j��|�}|dkr"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)rG���rQ���)r^���rb����dictr���r���r���rS���&��s����zDistribution.get_option_dictr8���c����������� ������C���s����ddl�m}�|d�kr"t|�j����}|d�k r@|��||���|d�}|sV|��|d���d�S�|D�]h}|�j�|�}|d�kr�|��|d|����qZ|��|d|����||�}|�d�D�]}|��|d�|���q�qZd�S�)Nr���)�pformatz zno commands known yetzno option dict for '%s' commandzoption dict for '%s' command:r:���)Zpprintrj����sortedrG����keys�announcerQ����split) r^����header�commands�indentrj���Zcmd_namerc����out�liner���r���r����dump_option_dicts1��s*������zDistribution.dump_option_dictsc�����������������C���s����g�}t����tj�tjd�j�}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�dirnamerV����modules�__file__�join�isfile�appendr!���r[���� expanduserr���rm���)r^����filesZsys_dirZsys_fileZ user_filenameZ user_fileZ local_filer���r���r����find_config_filesM��s&���� zDistribution.find_config_filesc�������������� ���C���s���ddl�m}�tjtjkr8ddddddd d ddd ddg }ng�}t|�}|d�krT|����}trb|��d��|��}|D�]�}tr�|��d|���|� |��|� ��D�]V}|�|�}|��|�}|D�]8} | dkr�| |kr�|� || �} | �dd�} || f|| <�q�q�|����qld|�jk�r�|�jd����D�]�\} \}} |�j� | �}zF|�rDt|�|t| ����n(| dk�r`t|�| t| ���nt|�| | ��W�n,�tk �r��} �zt| ��W�5�d�} ~ X�Y�nX��qd�S�)Nr���)�ConfigParserzinstall-basezinstall-platbasezinstall-libzinstall-platlibzinstall-purelibzinstall-headerszinstall-scriptszinstall-data�prefixzexec-prefix�home�user�rootz"Distribution.parse_config_files():z reading %sr���r;����_�global)r���r<���)Zconfigparserr����rV���r�����base_prefix� frozensetr����r���rm����readZsectionsr9���rS���rQ����replacerh���rG���rR����negative_optr>���r���� ValueError�DistutilsOptionError)r^���� filenamesr����Zignore_options�parser�filenameZsectionr9���rc���rd���re����src�aliasr���r���r���r����parse_config_files}��s^�������������� zDistribution.parse_config_filesc�����������������C���s����|�����}g�|�_t||�j��}|�|�j��|�ddi��|j|�j|�d�}|� ��}t �|�j��|�� |�rhdS�|r�|��||�}|dkrhdS�qh|�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_optionsrp���zno commands suppliedT)�_get_toplevel_optionsrp���r���r�����set_negative_aliasesr����Zset_aliases�getoptrF���Zget_option_orderr ���Z set_verbosityr����handle_display_options�_parse_command_optsr���� _show_help�len�DistutilsArgError)r^���Ztoplevel_optionsr����r�����option_orderr���r���r����parse_command_line���s.���� �zDistribution.parse_command_linec�����������������C���s���|�j�dg�S�)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^���r���r���r���r�������s�����z"Distribution._get_toplevel_optionsc�������������� ���C���s���ddl�m}�|d�}t�|�s*td|���|�j�|��z|��|�}W�n*�tk rn�}�zt |��W�5�d}~X�Y�nX�t ||�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��rV| j�rV|�j|d|gd��dS�t|d ��r�t |jt��r�d} |jD�]F\}}} }t| |�|���rzd } t|��r�|���ntd ||f����qz| �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_optionsr���r���r����zYinvalid help function %r for help option '%s': must be a callable object (function, etc.)zcommand line) � distutils.cmdr����� command_re�match� SystemExitrp���r����get_command_class�DistutilsModuleErrorr����� issubclassZDistutilsClassErrorrY���r ���r����r���r�����copy�updater�����fix_help_options�set_option_tabler����r����r����r���r����Z get_attr_name�callablerS����varsrR���)r^���r����r����r����rb���Z cmd_classr���r����r����ZoptsZhelp_option_foundZhelp_optionZshortZdesc�funcrc���r!���r���r���r���r���r������sr���� � � ��� � �� z Distribution._parse_command_optsc�����������������C���sP���dD�]F}t�|�j|�}|dkrqt|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-���Nc�����������������S���s���g�|�]}|�����qS�r�����strip)r4���Zelmr���r���r���r6���j��s�����z1Distribution.finalize_options.<locals>.<listcomp>�,)rB���r@���r ���r���rn���r>���)r^���r`���r���r���r���r���r]���`��s���� zDistribution.finalize_optionsr���c����������� ������C���s��ddl�m}�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�) ab��Show 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:r8���zKInformation 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����rp���r ���r���r����r����rY���r����r���r����r����r���rE���) r^���r����r����r����rp���r����r����r9���rb����klassr���r���r���r����m��s:���� � �� zDistribution._show_helpc����������� ������C���s����ddl�m}�|�jr4|�����td��t||�j���dS�d}i�}|�jD�]}d||d�<�qB|D�]l\}}|rX|�|�rXt|�}t |�j d|����}|dkr�td�|���n |dkr�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. r���r����r8���r���r7���r����r����)r.���r0���r1���r2���r:���)r����r����Z help_commands�print_commandsr����rE���r����rQ���r���rB���r@���r}���) r^���r����r����Zany_display_optionsZis_display_option�optionrd���re���r���r���r���r���r�������s*���� z#Distribution.handle_display_optionsc�������������� ���C���sj���t�|d���|D�]T}|�j�|�}|s.|��|�}z |j}W�n�tk rP���d}Y�nX�t�d|||f���qdS�)zZPrint a subset of the list of all commands -- used by 'print_commands()'. �:�(no description available)z %-*s %sN)r����rC���rQ���r����r,����AttributeError)r^���rp���ro���� max_length�cmdr����r,���r���r���r����print_command_list���s���� zDistribution.print_command_listc�����������������C���s����ddl�}|jj}i�}|D�]}d||<�qg�}|�j���D�]}|�|�s4|�|��q4d}||�D�]}t|�|krZt|�}qZ|��|d|��|r�t ���|��|d|��dS�)an��Print 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'. r���Nr���zStandard commandszExtra commands) �distutils.commandrb����__all__rC���rl���rQ���r���r����r����r����)r^���ru����std_commands�is_stdr�����extra_commandsr����r���r���r���r�������s.���� ��zDistribution.print_commandsc����������� ��� ���C���s����ddl�}|jj}i�}|D�]}d||<�qg�}|�j���D�]}|�|�s4|�|��q4g�}||�D�]P}|�j�|�}|sx|��|�}z |j}W�n�t k r����d}Y�nX�|�||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'. r���Nr���r����) r����rb���r����rC���rl���rQ���r���r����r,���r����) r^���ru���r����r����r����r�����rvr����r,���r���r���r����get_command_list���s(���� zDistribution.get_command_listc�����������������C���sN���|�j�}t|t�sJ|dkrd}dd��|�d�D��}d|krD|�dd��||�_�|S�)z9Return a list of packages from which commands are loaded.Nr8���c�����������������S���s���g�|�]}|d�kr|�����qS�)r8���r����)r4���Zpkgr���r���r���r6���!��s������z5Distribution.get_command_packages.<locals>.<listcomp>r����zdistutils.commandr���)rD���r ���r���rn����insert)r^���Zpkgsr���r���r����get_command_packages��s���� z!Distribution.get_command_packagesc�������������� ���C���s����|�j��|�}|r|S�|����D�]�}d||f�}|}zt|��tj|�}W�n�tk r^���Y�qY�nX�zt||�}W�n&�tk r����t d|||f���Y�nX�||�j�|<�|��S�t d|���dS�)ao��Return 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) rC���rQ���r����� __import__rV���r{����ImportErrorrB���r����r����)r^���rb���r����ZpkgnameZmodule_nameZ klass_name�moduler���r���r���r����'��s,���� �� zDistribution.get_command_classc�����������������C���sl���|�j��|�}|sh|rhtr&|��d|���|��|�}||���}|�j�|<�d|�j|<�|�j�|�}|rh|��||��|S�)a��Return 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���)rO���rQ���r���rm���r����rP���rG����_set_command_options)r^���rb���Zcreate�cmd_objr����r9���r���r���r����get_command_objM��s����� zDistribution.get_command_objc�����������������C���s\��|����}|dkr|��|�}tr,|��d|���|���D��] \}\}}trZ|��d|||f���zdd��|jD��}W�n�tk r����g�}Y�nX�z |j}W�n�tk r����i�}Y�nX�z|t|t �} ||kr�| r�t |||�t|����nJ||kr�| r�t ||t|���n,t||��rt |||��nt d|||f���W�q4�tk �rT�} �zt | ��W�5�d} ~ X�Y�q4X�q4dS�)ay��Set 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)c�����������������S���s���g�|�]}t�|��qS�r���r3���)r4����or���r���r���r6���|��s����z5Distribution._set_command_options.<locals>.<listcomp>z1error in %s: command '%s' has no such option '%s')�get_command_namerS���r���rm���rR���Zboolean_optionsr����r����r ���r���r>���r���rY���r����r����)r^���rO���Zoption_dict�command_namer�����sourcer���Z bool_optsZneg_optZ is_stringr���r���r���r���r����h��sF���� �� ��z!Distribution._set_command_optionsr���c�����������������C���s|���ddl�m}�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. r���r����)r����r����r ���r����r����Z finalizedZinitialize_optionsrP���r����Zget_sub_commands�reinitialize_command)r^���rb���Zreinit_subcommandsr����r�����subr���r���r���r�������s���� z!Distribution.reinitialize_commandc�����������������C���s���t���||��d�S��Nr ���)r^���r����levelr���r���r���rm������s����zDistribution.announcec�����������������C���s���|�j�D�]}|��|��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)rp����run_command)r^���r����r���r���r����run_commands���s���� zDistribution.run_commandsc�����������������C���sD���|�j��|�rdS�t�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���)rP���rQ���r ����infor����Zensure_finalized�run)r^���rb���r����r���r���r���r�������s���� zDistribution.run_commandc�����������������C���s���t�|�jp|�jpg��dkS��Nr���)r����rH���rI���r����r���r���r����has_pure_modules���s����zDistribution.has_pure_modulesc�����������������C���s���|�j�ot|�j��dkS�r����)rL���r����r����r���r���r����has_ext_modules���s����zDistribution.has_ext_modulesc�����������������C���s���|�j�ot|�j��dkS�r����)rJ���r����r����r���r���r����has_c_libraries���s����zDistribution.has_c_librariesc�����������������C���s���|�����p|����S�r����)r����r����r����r���r���r����has_modules���s����zDistribution.has_modulesc�����������������C���s���|�j�ot|�j��dkS�r����)rK���r����r����r���r���r����has_headers���s����zDistribution.has_headersc�����������������C���s���|�j�ot|�j��dkS�r����)rM���r����r����r���r���r����has_scripts���s����zDistribution.has_scriptsc�����������������C���s���|�j�ot|�j��dkS�r����)rN���r����r����r���r���r����has_data_files���s����zDistribution.has_data_filesc�����������������C���s���|�����o|�����o|�����S�r����)r����r����r����r����r���r���r����is_pure���s ������zDistribution.is_pure)N)NNr8���)N)r���)N)r���))r���� __module__�__qualname__�__doc__r����r����r����r=���r����rh���rS���rt���r����r����r����r����r����r]���r����r����r����r����r����r����r����r����r����r����r ����INFOrm���r����r����r����r����r����r����r����r����r����r����r���r���r���r���r���,���s����� �, � 0 :C[ � 2(!"& , ) r���c�������������������@���s��e�Zd�ZdZdZdBdd�Zdd��Zdd ��Zd d��Zdd ��Z dd��Z dd��Zdd��Zdd��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_urlr0���r1���r2���Nc�����������������C���s����|d�k r|���t|���nfd�|�_d�|�_d�|�_d�|�_d�|�_d�|�_d�|�_d�|�_ d�|�_ d�|�_d�|�_d�|�_ d�|�_d�|�_d�|�_d�|�_d�|�_d�S�r����)� read_pkg_file�openr!���r"���r%���r����r'���r����r)���r*���r,���r����r/���r-���r.���r����r0���r1���r2���)r^���ry���r���r���r���rh��� ��s&����zDistributionMetadata.__init__c��������������������s��t�|�����fdd�}��fdd�}��d�}|d�|�_|d�|�_|d�|�_|d �|�_d |�_|d�|�_d |�_|d�|�_|d �|�_ d��kr�|d�|�_ nd |�_ |d�|�_|d�|�_d��kr�|d��d�|�_ |d�|�_|d�|�_|dkr�|d�|�_|d�|�_|d�|�_nd |�_d |�_d |�_d S�)z-Reads the metadata values from a file object.c��������������������s�����|��}|dkrd�S�|S��NZUNKNOWNr���)r!���r����r���r���r����_read_field(��s����z7DistributionMetadata.read_pkg_file.<locals>._read_fieldc��������������������s�������|�d��}|g�krd�S�|S�r����)Zget_all)r!����valuesr����r���r���� _read_list.��s����z6DistributionMetadata.read_pkg_file.<locals>._read_listzmetadata-versionr!���r"���Zsummaryr%���Nr&���z home-pager*���zdownload-urlr,���r/���r�����platformZ classifier�1.1r1���r0���r2���)r���r!���r"���r,���r%���r'���r����r����r)���r*���r����r����rn���r/���r-���r.���r1���r0���r2���)r^����filer����r����Zmetadata_versionr���r����r���r����$��s:���� z"DistributionMetadata.read_pkg_filec�������������� ���C���s2���t�tj�|d�ddd��}|��|��W�5�Q�R�X�dS�)z7Write the PKG-INFO file into the release tree. zPKG-INFO�wzUTF-8)�encodingN)r����rx���ry���r}����write_pkg_file)r^���Zbase_dirZpkg_infor���r���r����write_pkg_infoX��s �����z#DistributionMetadata.write_pkg_infoc�����������������C���sb��d}|�j�s"|�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.0r����zMetadata-Version: %s z Name: %s zVersion: %s zSummary: %s zHome-page: %s zAuthor: %s zAuthor-email: %s zLicense: %s zDownload-URL: %s zDescription: %s r����z Keywords: %s ZPlatformZ ClassifierZRequiresZProvidesZ ObsoletesN)r0���r1���r2���r.���r����rX����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^���r���r"���Z long_descr/���r���r���r���r��_��s6������z#DistributionMetadata.write_pkg_filec�����������������C���s ���|D�]}|��d||f���qd�S�)Nz%s: %s )rX���)r^���r���r!���r����r���r���r���r���r�����s����z DistributionMetadata._write_listc�����������������C���s ���|�j�pdS�r����)r!���r����r���r���r���r�����s����zDistributionMetadata.get_namec�����������������C���s ���|�j�pdS�)Nz0.0.0)r"���r����r���r���r���r�����s����z DistributionMetadata.get_versionc�����������������C���s���d|�����|����f�S�)Nz%s-%s)r��r��r����r���r���r����get_fullname���s����z!DistributionMetadata.get_fullnamec�����������������C���s ���|�j�pdS�r����)r%���r����r���r���r���� get_author���s����zDistributionMetadata.get_authorc�����������������C���s ���|�j�pdS�r����)r����r����r���r���r����get_author_email���s����z%DistributionMetadata.get_author_emailc�����������������C���s ���|�j�pdS�r����)r'���r����r���r���r����get_maintainer���s����z#DistributionMetadata.get_maintainerc�����������������C���s ���|�j�pdS�r����)r����r����r���r���r����get_maintainer_email���s����z)DistributionMetadata.get_maintainer_emailc�����������������C���s���|�j�p|�jpdS�r����)r'���r%���r����r���r���r���r �����s����z DistributionMetadata.get_contactc�����������������C���s���|�j�p|�jpdS�r����)r����r����r����r���r���r���r �����s����z&DistributionMetadata.get_contact_emailc�����������������C���s ���|�j�pdS�r����)r)���r����r���r���r���r�����s����zDistributionMetadata.get_urlc�����������������C���s ���|�j�pdS�r����)r*���r����r���r���r���r�����s����z DistributionMetadata.get_licensec�����������������C���s ���|�j�pdS�r����)r,���r����r���r���r���r�����s����z$DistributionMetadata.get_descriptionc�����������������C���s ���|�j�pdS�r����)r����r����r���r���r���r�����s����z)DistributionMetadata.get_long_descriptionc�����������������C���s ���|�j�pg�S�r����)r/���r����r���r���r���r �����s����z!DistributionMetadata.get_keywordsc�����������������C���s���t�|d�|�_d�S�)Nr/���)r���r/����r^���r���r���r���r����set_keywords���s����z!DistributionMetadata.set_keywordsc�����������������C���s���|�j�p dgS�r����)r-���r����r���r���r���r�����s����z"DistributionMetadata.get_platformsc�����������������C���s���t�|d�|�_d�S�)Nr-���)r���r-���r��r���r���r���� set_platforms���s����z"DistributionMetadata.set_platformsc�����������������C���s ���|�j�pg�S�r����)r.���r����r���r���r���r�����s����z$DistributionMetadata.get_classifiersc�����������������C���s���t�|d�|�_d�S�)Nr.���)r���r.���r��r���r���r����set_classifiers���s����z$DistributionMetadata.set_classifiersc�����������������C���s ���|�j�pdS�r����)r����r����r���r���r����get_download_url���s����z%DistributionMetadata.get_download_urlc�����������������C���s ���|�j�pg�S�r����)r1���r����r���r���r���r�����s����z!DistributionMetadata.get_requiresc�����������������C���s,���dd�l�}|D�]}|j�|��qt|�|�_d�S�r����)�distutils.versionpredicate�versionpredicate�VersionPredicater���r1����r^���r���ru���r���r���r���r����set_requires���s����z!DistributionMetadata.set_requiresc�����������������C���s ���|�j�pg�S�r����)r0���r����r���r���r���r�����s����z!DistributionMetadata.get_providesc�����������������C���s6���dd��|D��}|D�]}dd�l�}|j�|��q||�_d�S�)Nc�����������������S���s���g�|�]}|�����qS�r���r����)r4���r���r���r���r���r6������s�����z5DistributionMetadata.set_provides.<locals>.<listcomp>r���)r��r��Zsplit_provisionr0���)r^���r���r���ru���r���r���r����set_provides���s ����z!DistributionMetadata.set_providesc�����������������C���s ���|�j�pg�S�r����)r2���r����r���r���r���r�����s����z"DistributionMetadata.get_obsoletesc�����������������C���s,���dd�l�}|D�]}|j�|��qt|�|�_d�S�r����)r��r��r ��r���r2���r!��r���r���r���� set_obsoletes���s����z"DistributionMetadata.set_obsoletes)N)%r���r����r����r����rA���rh���r����r��r��r��r��r��r��r��r��r��r��r ��r ��r��r��Zget_licencer��r��r ��r��r��r��r��r��r��r��r"��r��r#��r��r$��r���r���r���r���r?������sD��� 4"r?���c�����������������C���s$���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���)r9���Znew_optionsZ help_tupler���r���r���r�������s����r����)r����rV���rx����reZemailr���rT���r����Zdistutils.errorsZdistutils.fancy_getoptr���r���Zdistutils.utilr���r���r���ru���r ���Zdistutils.debugr����compiler����r���r���r?���r����r���r���r���r����<module>���s4��� �������Z�c