B ŒÛ™\ÑÄã@sÌdZddlZddlZddlZddlmZy ddlZWnek rLdZYnXddlTddl m Z m Z ddl 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 nd?„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)z no-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 -)ÚauthorNzprint the author's name)z 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ú szDistribution.rrNcCsld|_d|_d|_x|jD]}t||dƒqWtƒ|_x,|jjD] }d|}t||t|j|ƒƒq@Wi|_ d|_ d|_ d|_ i|_ g|_d|_i|_d|_d|_d|_d|_d|_d|_d|_d|_d|_d|_d|_i|_i|_|r| d¡}|dk rH|d=xD| ¡D]8\}}|  |¡}x"| ¡D]\} } d| f|| <q(Wq Wd|krŽ|d|d <|d=d } t!dk r~t! "| ¡nt#j$ %| d ¡xŒ| ¡D]€\} } t&|jd | ƒrÈt|jd | ƒ| ƒnNt&|j| ƒræt|j| | ƒn0t&|| ƒrt|| | ƒnd t'| ƒ} t! "| ¡q˜Wd|_(|j dk r`x0|j D]&} |  )d¡sHP| dkr6d|_(Pq6W| *¡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_dataZ package_dirÚ py_modulesÚ librariesÚheadersÚ ext_modulesZ ext_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ÚbasenameZ method_namer6ÚcommandZ cmd_optionsÚopt_dictÚoptÚvalrÚkeyÚargrrrÚ__init__ˆs~                 zDistribution.__init__cCs&|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)rDrN)r[r_ÚdictrrrrP&s zDistribution.get_option_dictr5c CsÐddlm}|dkr"t|j ¡ƒ}|dk r@| ||¡|d}|sV| |d¡dSxt|D]l}|j |¡}|dkrˆ| |d|¡q\| |d|¡||ƒ}x$| d¡D]}| |d|¡q®Wq\WdS)Nr)Úpformatz zno commands known yetzno option dict for '%s' commandzoption dict for '%s' command:r7)ZpprintrgÚsortedrDÚkeysÚannouncerNÚsplit) r[ÚheaderÚcommandsÚindentrgZcmd_namer`ÚoutÚlinerrrÚdump_option_dicts1s&    zDistribution.dump_option_dictscCs¾g}tƒtj tjdj¡}tj |d¡}tj |¡rB|  |¡tj dkrRd}nd}|j rˆ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ÚdirnamerSÚmodulesÚ__file__ÚjoinÚisfileÚappendr rXÚ expanduserr rj)r[ZfilesZsys_dirZsys_fileZ user_filenameZ user_fileZ local_filerrrÚfind_config_filesMs&       zDistribution.find_config_filesc Cs´ddlm}tjtjkr8ddddddd d d d d ddg }ng}t|ƒ}|dkrT| ¡}trb| d¡|ƒ}x˜|D]}tr„| d|¡|  |¡xf|  ¡D]Z}|  |¡}|  |¡}x@|D]8} | dkr¶| |kr¶|  || ¡} |  dd¡} || f|| <q¶Wq˜W| ¡qnWd|jkr°x |jd ¡D]Ž\} \} } |j  | ¡} yF| rRt|| t| ƒ ƒn(| dkrnt|| t| ƒƒn t|| | ƒWn,tk r¨} z t| ƒ‚Wdd} ~ XYnXqWdS)Nr)Ú ConfigParserz install-basezinstall-platbasez install-libzinstall-platlibzinstall-purelibzinstall-headerszinstall-scriptsz install-dataÚprefixz exec-prefixZhomeÚuserÚrootz"Distribution.parse_config_files():z reading %srr8Ú_Úglobal)rr9)Z configparserrrSr€Ú base_prefixÚ frozensetr~r rjÚreadZsectionsr6rPrNÚreplacererDrOÚ negative_optr;rÚ ValueErrorÚDistutilsOptionError)r[Ú filenamesrZignore_optionsÚparserÚfilenameZsectionr6r`rarbÚsrcÚaliasrrrrÚparse_config_files}sJ               zDistribution.parse_config_filescCsÂ| ¡}g|_t||jƒ}| |j¡| ddi¡|j|j|d}|  ¡}t   |j ¡|  |¡rhdSx |rˆ| ||¡}|dkrjdSqjW|jr°|j|t|jƒdk|jddS|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_optionsrmzno commands suppliedT)Ú_get_toplevel_optionsrmrr”Úset_negative_aliasesr‰Z set_aliasesÚgetoptrCZget_option_orderr Z set_verbosityrÚhandle_display_optionsÚ_parse_command_optsrÚ _show_helpÚlenÚDistutilsArgError)r[Ztoplevel_optionsrr’Ú 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•úsz"Distribution._get_toplevel_optionsc Csddlm}|d}t |¡s*td|ƒ‚|j |¡y| |¡}Wn*tk rn}z t |ƒ‚Wdd}~XYnXt ||ƒs†t d|ƒ‚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| jrV|j|d|gd dSt |d ƒrÐt |jtƒrÐd} xP|jD]F\} } } }t | | | ¡ƒr|d } t|ƒr°|ƒnt d || fƒ‚q|W| rÐdS| |¡}x&t| ƒ ¡D]\}}d|f||<qèW|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_optionsrr)r”rmzYinvalid help function %r for help option '%s': must be a callable object (function, etc.)z command line) Ú distutils.cmdr Ú command_reÚmatchÚ SystemExitrmr|Úget_command_classÚDistutilsModuleErrorrœÚ issubclassZDistutilsClassErrorrVr r¡rr‰ÚcopyÚupdater¢Úfix_help_optionsÚset_option_tablerŸr–r—rršZ get_attr_nameÚcallablerPÚvarsrO)r[rr’r r_Z cmd_classrr‰r¢ZoptsZhelp_option_foundZ help_optionZshortZdescÚfuncr`r rrrrr™sb                   z Distribution._parse_command_optscCsTxNdD]F}t|j|ƒ}|dkr qt|tƒrdd„| d¡Dƒ}t|j||ƒqWdS)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)r1Zelmrrrr3jsz1Distribution.finalize_options..ú,)r?r=r r rkr;)r[r]rrrrrZ`s   zDistribution.finalize_optionsrc Cs ddlm}ddlm}|rR|r*| ¡}n|j}| |¡| |jd¡t dƒ|rt| |j ¡| d¡t dƒx„|j D]z}t |t ƒršt||ƒrš|} n | |¡} t| dƒrÒt | jtƒrÒ| | jt| jƒ¡n | | j¡| d| j¡t dƒq|Wt ||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_usage)r z Global options:r5zKInformation 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”rmr rr©r§rVr¢rr¡r¬rrB) r[rrŸr”rmr³r r6r_Úklassrrrršms4           zDistribution._show_helpc CsÒddlm}|jr4| ¡tdƒt||jƒƒdSd}i}x|jD]}d||d<qDWxt|D]l\}}|r^| |¡r^t|ƒ}t |j d|ƒƒ}|dkr¦td  |¡ƒn |dkr¾td   |¡ƒnt|ƒd}q^W|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³r5rr4)r-r+r²)r,r.r/r0r7) r´r³Z help_commandsÚprint_commandsr¶rBr”rNrr?r=rz) r[rr³Zany_display_optionsZis_display_optionÚoptionrarbrrrrr˜Ÿs*  z#Distribution.handle_display_optionsc Csnt|dƒx\|D]T}|j |¡}|s0| |¡}y |j}Wntk rRd}YnXtd|||fƒqWdS)zZPrint a subset of the list of all commands -- used by 'print_commands()'. ú:z(no description available)z %-*s %sN)r¶r@rNr§r*ÚAttributeError)r[rmrlÚ max_lengthÚcmdr·r*rrrÚprint_command_listÇs      zDistribution.print_command_listcCsªddl}|jj}i}x|D] }d||<qWg}x&|j ¡D]}| |¡s:| |¡q:Wd}x$||D]}t|ƒ|krdt|ƒ}qdW| |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.commandr_Ú__all__r@rirNr|r›r¾r¶)r[rrÚ std_commandsÚis_stdr½Úextra_commandsr¼rrrr¸Øs*     zDistribution.print_commandsc Cs¼ddl}|jj}i}x|D] }d||<qWg}x&|j ¡D]}| |¡s:| |¡q:Wg}x\||D]P}|j |¡}|s‚| |¡}y |j}Wnt k r¤d}YnX| ||f¡qdW|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'. rNrz(no description available)) r¿r_rÀr@rirNr|r§r*r») r[rrrÁrÂr½rÃÚrvr·r*rrrÚget_command_listùs(        zDistribution.get_command_listcCsN|j}t|tƒsJ|dkrd}dd„| d¡Dƒ}d|krD| dd¡||_|S)z9Return a list of packages from which commands are loaded.Nr5cSsg|]}|dkr| ¡‘qS)r5)r±)r1Zpkgrrrr3!sz5Distribution.get_command_packages..r²zdistutils.commandr)rAr rrkÚinsert)r[ZpkgsrrrÚget_command_packagess  z!Distribution.get_command_packagesc Cs¶|j |¡}|r|Sx| ¡D]„}d||f}|}yt|ƒtj|}Wntk r^wYnXyt||ƒ}Wn&tk r”t d|||fƒ‚YnX||j|<|SWt 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) r@rNrÇÚ __import__rSrxÚ ImportErrorr?r»r¨)r[r_r·ZpkgnameZ module_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.z1error in %s: command '%s' has no such option '%s')Úget_command_namerPr rjrOZboolean_optionsr»r‰r r r;rrVr‹rŠ) r[rLZ option_dictÚ command_namer¹ÚsourcerZ bool_optsZneg_optZ is_stringrrrrrËhs>           z!Distribution._set_command_optionsrcCs€ddlm}t||ƒs&|}| |¡}n| ¡}|js8|S| ¡d|_d|j|<| |¡|r|x|  ¡D]}|  ||¡qhW|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_optionsrMrËZget_sub_commandsÚreinitialize_command)r[r_Zreinit_subcommandsr rÐÚsubrrrrÒ”s     z!Distribution.reinitialize_commandcCst ||¡dS)N)r )r[rÚlevelrrrrj½szDistribution.announcecCsx|jD]}| |¡qWdS)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)rmÚ 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)rMrNr ÚinforÍZensure_finalizedÚrun)r[r_rÌrrrrÕÊs   zDistribution.run_commandcCst|jp|jpgƒdkS)Nr)r›rErF)r[rrrÚhas_pure_modulesÞszDistribution.has_pure_modulescCs|jot|jƒdkS)Nr)rIr›)r[rrrÚhas_ext_modulesászDistribution.has_ext_modulescCs|jot|jƒdkS)Nr)rGr›)r[rrrÚhas_c_librariesäszDistribution.has_c_librariescCs| ¡p| ¡S)N)rÙrÚ)r[rrrÚ has_modulesçszDistribution.has_modulescCs|jot|jƒdkS)Nr)rHr›)r[rrrÚ has_headersêszDistribution.has_headerscCs|jot|jƒdkS)Nr)rJr›)r[rrrÚ has_scriptsíszDistribution.has_scriptscCs|jot|jƒdkS)Nr)rKr›)r[rrrÚhas_data_filesðszDistribution.has_data_filescCs| ¡o| ¡ o| ¡ S)N)rÙrÚrÛ)r[rrrÚis_pureós zDistribution.is_pure)N)NNr5)N)r)N)r))rÚ __module__Ú __qualname__Ú__doc__rŸrµr”r:r‰rerPrqr~r‘ržr•r™rZršr˜r¾r¸rÅrÇr§rÍrËrÒr ÚINFOrjrÖrÕrÙrÚrÛrÜrÝrÞrßràrrrrr,s|     0 :C [  1(!" &  , ) rc@seZdZdZdZdBdd„Zdd„Zdd „Zd d „Zd d „Z dd„Z dd„Z dd„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!dd?„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_urlr.r/r0NcCs‚|dk r| t|ƒ¡nfd|_d|_d|_d|_d|_d|_d|_d|_ d|_ d|_ d|_ d|_ d|_d|_d|_d|_d|_dS)N)Ú read_pkg_fileÚopenr r!r$rår%rær'r(r*rçr-r+r,rèr.r/r0)r[rvrrrre s&zDistributionMetadata.__init__cst|ƒ‰‡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.csˆ|}|dkrdS|S)NÚUNKNOWNr)r r)rrrÚ _read_field(sz7DistributionMetadata.read_pkg_file.._read_fieldcsˆ |d¡}|gkrdS|S)N)Zget_all)r Úvalues)rrrÚ _read_list.s z6DistributionMetadata.read_pkg_file.._read_listzmetadata-versionr r!Zsummaryr$Nz author-emailz home-pager(z download-urlr*r-r²ÚplatformZ classifierz1.1r/r.r0)rr r!r*r$r%rårær'r(rèrçrkr-r+r,r/r.r0)r[ÚfilerìrîZmetadata_versionr)rrré$s:                 z"DistributionMetadata.read_pkg_filec Cs2ttj |d¡ddd}| |¡WdQRXdS)z7Write the PKG-INFO file into the release tree. zPKG-INFOÚwzUTF-8)ÚencodingN)rêrurvrzÚ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.0z1.1zMetadata-Version: %s z Name: %s z Version: %s z Summary: %s zHome-page: %s z Author: %s zAuthor-email: %s z License: %s zDownload-URL: %s zDescription: %s r²z Keywords: %s ZPlatformZ ClassifierZRequiresZProvidesZ ObsoletesN)r.r/r0r,rèrUÚget_nameÚ get_versionÚget_descriptionÚget_urlÚ get_contactÚget_contact_emailÚ get_licenserÚget_long_descriptionrzÚ get_keywordsÚ _write_listÚ get_platformsÚget_classifiersÚ get_requiresÚ get_providesÚ get_obsoletes)r[rðr!Z long_descr-rrrró_s0  z#DistributionMetadata.write_pkg_filecCs$x|D]}| d||f¡qWdS)Nz%s: %s )rU)r[rðr rírrrrrþs z DistributionMetadata._write_listcCs |jpdS)Nrë)r )r[rrrrõ‡szDistributionMetadata.get_namecCs |jpdS)Nz0.0.0)r!)r[rrrröŠsz DistributionMetadata.get_versioncCsd| ¡| ¡fS)Nz%s-%s)rõrö)r[rrrÚ get_fullnamesz!DistributionMetadata.get_fullnamecCs |jpdS)Nrë)r$)r[rrrÚ get_authorszDistributionMetadata.get_authorcCs |jpdS)Nrë)rå)r[rrrÚget_author_email“sz%DistributionMetadata.get_author_emailcCs |jpdS)Nrë)r%)r[rrrÚget_maintainer–sz#DistributionMetadata.get_maintainercCs |jpdS)Nrë)ræ)r[rrrÚget_maintainer_email™sz)DistributionMetadata.get_maintainer_emailcCs|jp|jpdS)Nrë)r%r$)r[rrrrùœsz DistributionMetadata.get_contactcCs|jp|jpdS)Nrë)rærå)r[rrrrúŸsz&DistributionMetadata.get_contact_emailcCs |jpdS)Nrë)r')r[rrrrø¢szDistributionMetadata.get_urlcCs |jpdS)Nrë)r()r[rrrrû¥sz DistributionMetadata.get_licensecCs |jpdS)Nrë)r*)r[rrrr÷©sz$DistributionMetadata.get_descriptioncCs |jpdS)Nrë)rç)r[rrrrü¬sz)DistributionMetadata.get_long_descriptioncCs |jpgS)N)r-)r[rrrrý¯sz!DistributionMetadata.get_keywordscCst|dƒ|_dS)Nr-)rr-)r[rrrrÚ set_keywords²sz!DistributionMetadata.set_keywordscCs |jp dgS)Nrë)r+)r[rrrrÿµsz"DistributionMetadata.get_platformscCst|dƒ|_dS)Nr+)rr+)r[rrrrÚ set_platforms¸sz"DistributionMetadata.set_platformscCs |jpgS)N)r,)r[rrrr»sz$DistributionMetadata.get_classifierscCst|dƒ|_dS)Nr,)rr,)r[rrrrÚset_classifiers¾sz$DistributionMetadata.set_classifierscCs |jpdS)Nrë)rè)r[rrrÚget_download_urlÁsz%DistributionMetadata.get_download_urlcCs |jpgS)N)r/)r[rrrrÅsz!DistributionMetadata.get_requirescCs0ddl}x|D]}|j |¡qWt|ƒ|_dS)Nr)Údistutils.versionpredicateÚversionpredicateÚVersionPredicaterr/)r[rrrrrrrÚ set_requiresÈs z!DistributionMetadata.set_requirescCs |jpgS)N)r.)r[rrrrÎsz!DistributionMetadata.get_providescCs:dd„|Dƒ}x |D]}ddl}|j |¡qW||_dS)NcSsg|] }| ¡‘qSr)r±)r1rrrrr3Òsz5DistributionMetadata.set_provides..r)r rZsplit_provisionr.)r[rrrrrrrÚ set_providesÑs  z!DistributionMetadata.set_providescCs |jpgS)N)r0)r[rrrrØsz"DistributionMetadata.get_obsoletescCs0ddl}x|D]}|j |¡qWt|ƒ|_dS)Nr)r rrrr0)r[rrrrrrrÚ set_obsoletesÛs z"DistributionMetadata.set_obsoletes)N)%rrárârãr>rerérôrórþrõrörrrrrrùrúrørûZ get_licencer÷rürýr rÿr rr r rrrrrrrrrrr<ÿsD 4"r<cCs(g}x|D]}| |dd…¡q W|S)zConvert a 4-tuple 'help_options' list as found in various command classes to the 3-tuple form required by FancyGetopt. ré)r|)r6Z new_optionsZ help_tuplerrrr¬ás r¬)rãrSruÚreZemailrrQrÉZdistutils.errorsZdistutils.fancy_getoptrrZdistutils.utilrrrrrr Zdistutils.debugr Úcompiler¤rrr<r¬rrrrÚs4      Zc