bgydZddlZddlZddlZddlZddlZddlZddlZddlm Z ddl m Z ddl m Z mZddlmZddlmZdd lmZmZmZmZdd lmZmZdd lmZmZmZejd Z d Z!GddZ"GddZ#dZ$dS)z}distutils.dist Provides the Distribution class, which represents the module distribution being built/installed/distributed. N)Iterable)message_from_file)canonicalize_namecanonicalize_versionlog)DEBUG)DistutilsArgErrorDistutilsClassErrorDistutilsModuleErrorDistutilsOptionError) FancyGetopttranslate_longopt) check_environ rfc822_escape strtoboolz^[a-zA-Z]([a-zA-Z0-9_]*)$ct|trngt|tsRt|j}d}|jdit }tj|t|}|S)Nz>Warning: '{fieldname}' should be a list, got type '{typename}') isinstancestrlisttype__name__formatlocalsr warning)value fieldnametypenamemsgs Q/opt/cloudlinux/venv/lib64/python3.11/site-packages/setuptools/_distutils/dist.py _ensure_listr#%sy%  t $ $;;'Ncj$$688$$ CU  Lc$eZdZdZgdZdZgdZdeDZddiZd-d Z d Z d.d Z d Z dZ d-dZdZdZdZdZ d/defdZdZdZdZdZdZdZd0dZd-dZd1d!Zejfd"Z d#Z!d$Z"d%Z#d&Z$d'Z%d(Z&d)Z'd*Z(d+Z)d,Z*dS)2 DistributionaThe 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. ))verbosevzrun verbosely (default)r)quietqz!run quietly (turns verbosity off))zdry-runnzdon't actually do anything)helphzshow detailed help message)z no-user-cfgNz-ignore pydistutils.cfg in your home directoryzCommon 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)versionVzprint package version)fullnameNzprint -)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 obsoletec8g|]}t|dS)rr).0xs r" zDistribution.ws%MMM-ad33MMMr$r)r'Nc fd|_d|_d|_|jD]}t ||dt |_|jjD]+}d|z}t ||t|j|,i|_ d|_ d|_ d|_ i|_ g|_d|_i|_d|_d|_d|_d|_d|_d|_d|_d|_d|_d|_d|_i|_i|_|rM|d}|S|d=|D];\}}| |}|D] \} } d| f|| < >(G[#33G<>S)7(= >E!!#(#3i )$R c""""KKMM ' 'S4=&3,77'8GDM6C<88====T]C00'DM34444T3'''D#s++++A#AACM#&&&&"   ''  ~~c**E/))).D&E* r$cV|j|}| ix}|j|<|S)zGet 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. )rVrg)rprudicts r"rizDistribution.get_option_dicts6 #''00 <35 5D4'0 r$rGcddlm}|&t|j}||||z|dz}|s||dzdS|D]}|j|}|||d|dz;||d|dz||}|d D]}||dz|zdS) Nr)pformatz zno commands known yetzno option dict for 'z ' commandzoption dict for ' ' command: )pprintrsortedrVkeysannouncergsplit) rpheadercommandsindentrcmd_namerwoutlines r"dump_option_dictszDistribution.dump_option_dicts$sI""""""  d27799::H   MM&6/ * * *d]F  MM&#:: ; ; ; F  8 8H+//99H f'Qh'Q'Q'QQRRRR f'O8'O'O'OOPPPgh''IIdOO88DMM&4-$"677778 8 8r$ctd|D}tr;|dd||S)aFind 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 multiple possible config files: - distutils.cfg in the Distutils installation directory (i.e. 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; may be disabled with the ``--no-user-cfg`` option - setup.cfg in the current directory - a file named by an environment variable cjg|]0}tj|!t|1Sr)ospathisfiler)rBrs r"rDz2Distribution.find_config_files..Ns1QQQtBGNN4se QQt'8'8QQQ  M MM299$))E:J:JKK L L L r$c#JKtjtjdjj}|dz Vdt jdkz}|dz}|jr\tj t5tjd |z Vdddn #1swxYwYtjdVtj t5tjt jdVddddS#1swxYwYdS) N distutilsz distutils.cfg.posixzpydistutils.cfg~z setup.cfgDIST_EXTRA_CONFIG)pathlibPathsysmodules__file__parentrr.rm contextlibsuppress RuntimeError expanduser TypeErrorgetenv)rpsys_dirprefixfilenames r"rzDistribution._gen_pathsUs,s{;7@AAH''''7*+--   @$\22 @ @l3''2244x???? @ @ @ @ @ @ @ @ @ @ @ @ @ @ @l;'''''  + + ? ?,ry)<==>> > > > ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?s$0,B((B,/B,")DDDcddlm}tjtjkrgd}ng}t |}||}tr|d|}|D]}tr|d|| |d| D]n}| |}| |}|D]?} | dkr7| |vr3| || } | d d } || f|| <@o|d |jvr|jd D]\} \} } |j | } | r t'|| t)|  n4| d vrt'|| t)| nt'|| | z#t*$r} t-| d} ~ wwxYwdSdS) Nr) ConfigParser) z install-basezinstall-platbasez install-libzinstall-platlibzinstall-purelibzinstall-headerszinstall-scriptsz install-datarz exec-prefixhomeuserrootz"Distribution.parse_config_files():z reading zutf-8encodingrrJ_global)r'rK) configparserrrr base_prefix frozensetrr rreadsectionsrHrirgreplacer|rVrh negative_optrMr ValueErrorr)rp filenamesrignore_optionsparserrsectionrHrwrxry_srcaliasr!s r"parse_config_fileszDistribution.parse_config_fileshsw------ : ( (NN  N">22  ..00I  @ MM> ? ? ?!  H 7 5855666 KK7K 3 3 3!??,, 8 8 ..11//88"88Cj((S-F-F$jj#66!kk#s33)13 8 OO     t+ + +$($8$B$H$H$J$J 4 4 [dC)--c2240e3-?@@@@ 666c9S>>::::c3///!444.s3334 , + 4 4sAG'' H1HHc|}g|_t||jz}||j|ddi||j|}| }tj tj d|jzz ||rdS|r|||}|dS||jr5||t'|jdk|jdS|jst)dd S) aParse 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). r8r7)argsobject Nrdisplay_optionsrzno commands suppliedT)_get_toplevel_optionsrrrset_negative_aliasesr set_aliasesgetoptrUget_option_orderlogging getLoggersetLevelWARNr'handle_display_options_parse_command_optsr, _show_helplenr )rptoplevel_optionsrr option_orders r"parse_command_linezDistribution.parse_command_lineso. 5577 -0DDEE##D$5666Iy1222}}$"24}@@..00 $$W\B4E%EFFF  & &| 4 4  F ++FD99D|  9  OODM(:(:a(?$-     F} <#$:;; ;tr$c|jdgzS)zReturn 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_optionsrps r"rz"Distribution._get_toplevel_optionss " &   r$cddlm}|d}t|st d|d|j| ||}n!#t$r}t|d}~wwxYwt||std|dt|drt|jtsd }t||z|j}t|d r.|}||jt|d r/t|jtrt)|j}ng}||j|jz|z||||d d\}} t| d r"| jr||d|gdSt|d rt|jtrjd} |jD]\\} } } }t| || r2d } t9|r |Ftd|d| d]| rdS||}t=| D] \}}d|f||< |S)aParse 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. rCommandzinvalid command name ''Nzcommand class z must subclass Command user_optionszIcommand class %s must provide 'user_options' attribute (a list of tuples)r help_optionsrr,Frzinvalid help function z for help option 'z-': must be a callable object (function, etc.)z command line) distutils.cmdr command_rematch SystemExitrappendget_command_classr r issubclassr rlrrrrcopyupdaterfix_help_optionsset_option_tablerrrr,r get_attr_namecallablerivarsrh)rprrrru cmd_classr!rroptshelp_option_found help_option_short_descfuncrwr.rs r"rz Distribution._parse_command_optssz *)))))q'(( B@g@@@AA A W%%%  )..w77II# ) ) )#C(( ( ) )W-- %BBBB  I~ . . 791488 7 > &cIo66 6( 9n - - 8',,..L    6 7 7 7 9n - - *  "D3 3  ,I,BCCLLL   )"8 8< G    ##L111}}T!""X.. t 4  TY  OOFEYKO P P P F 9n - - *  "D3 3  !" 4=4J  0 VUD4!5!5k!B!BCC()%~~1ITII{III ! ''00::++-- 5 5KD%,e4HTNN sA-- B 7BB cdD]d}t|j|}|t|tr5d|dD}t |j||edS)zSet final values for all the options on the Distribution instance, analogous to the .finalize_options() method of Command objects. r<r:Nc6g|]}|Srstrip)rBelms r"rDz1Distribution.finalize_options..is AAAAAAr$,)rQrOrrrrM)rprrrs r"rozDistribution.finalize_options_s| . 4 4DDM400E}%%% 4AA C0@0@AAA tU333  4 4r$TrrcZddlm}ddlm}|r^|r|}n|j}||||jdzt|r=||j |dt|D]}t|trt||r|} n||} t| drJt| jt"r0|| jt'| jzn|| j|d| jdtt||jd 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'. rr gen_usagez Global options:zKInformation display options (just display information, ignore any commands)rz Options for 'rN)rrdistutils.corerrrr print_help common_usageprintrrrrrrlrrrrrrT) rprrrrrrrHruklasss r"rzDistribution._show_helpls *))))),,,,,,   .4466-  # #G , , ,   d/2EE F F F GGG    # #D$8 9 9 9   ]    GGG  G'4(( 8Z-I-I 8..w77un-- <*U=OQU2V2V <''&)9%:L)M)MM''(:;;;   HenHHH I I I GGGG ii())*****r$cDddlm}|jrA|t t ||jdSd}t }|jD]}||d|D]\}}|r||vrt|}t|j d|z}|dvr#t d |n6|dvr#t d |nt |d}|S) zIf 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. rrrrFrr)r;r=r>r?r) rr help_commandsprint_commandsrrTsetraddrrQrOr) rprrany_display_optionsis_display_optionoptionrxryrs r"rz#Distribution.handle_display_optionssU -,,,,,       ! ! ! GGG ))D,-- . . .1  EE* - -F  ! !&) , , , ,$ ( (HC (s///',,< v|<<>>333#((5//****PPP$))E**++++%LLL&'#""r$ct|dz|D]c}|j|}|s||} |j}n#t $rd}YnwxYwtd|||fzddS)zZPrint a subset of the list of all commands -- used by 'print_commands()'. :(no description available)z %-*s %sN)rrRrgrr9AttributeError)rprr max_lengthcmdrr9s r"print_command_listzDistribution.print_command_lists fsl A ACM%%c**E 4..s33 ;#/ ! ; ; ;:  ; ,*c;!?? @ @ @ @ A As A A A chddl}|jj}t|fd|jD}d}||zD]$}t ||krt |}%||d||r't||d|dSdS)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'. rNcg|]}|v| SrrrBris_stds r"rDz/Distribution.print_commands..#SSS#FARAR#ARARARr$zStandard commandszExtra commands) distutils.commandru__all__r rRrrrr)rpr std_commandsextra_commandsrrrs @r"r zDistribution.print_commandss !    (0 \""SSSS););)=)=SSS .0 & &C3xx*$$ XX   .A:NNN  R GGG  # #N4Dj Q Q Q Q Q R Rr$cjddl}|jj}t|fd|jD}g}||zD]e}|j|}|s||} |j}n#t$rd}YnwxYw| ||ff|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'. rNcg|]}|v| Srrrs r"rDz1Distribution.get_command_list..rr$r) rrurr rRrrgrr9rr) rprrrrvrrr9rs @r"get_command_listzDistribution.get_command_lists !    (0 \""SSSS););)=)=SSS .0 * *CM%%c**E 4..s33 ;#/ ! ; ; ;:  ; IIsK( ) ) ) ) sB  BBc|j}t|tsD|d}d|dD}d|vr|dd||_|S)z9Return a list of packages from which commands are loaded.NrGcBg|]}|dk|S)rGr)rBpkgs r"rDz5Distribution.get_command_packages..s%HHHCcRiiCIIKKiiir$rzdistutils.commandr)rSrrrinsert)rppkgss r"get_command_packagesz!Distribution.get_command_packagessp$$%% )|HH4::c??HHHD"$.. A2333$(D ! r$c |j|}|r|S|D]}|d|}|} t|tj|}n#t $rY:wxYw t||}n'#t$rtd|d|d|dwxYw||j|<|cStd|d)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. rzinvalid command 'z ' (no class 'z ' in module 'z')r) rRrgr) __import__rr ImportErrorrQrr )rprurpkgname module_name klass_namemodules r"rzDistribution.get_command_classs- !!'**  L0022  G$00w00K J ;'''[1      33!   *fffjffWbfff  &+DM' "LLL"#Aw#A#A#ABBBs!A!! A.-A.2B$B'cN|j|}|s|rtr|d|d||}||x}|j|<d|j|<|j|}|r||||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 'z' command objectF)rergr rrrfrV_set_command_options)rprucreatecmd_objrrHs r"get_command_objzDistribution.get_command_obj@s "&&w// <6 <  ;!(;;; **733E27%++ =Gd&w/%*DM' "*..w77G <))'7;;;r$c ,|}|||}tr|d|d|D]2\}\}}tr|d|d|d|d d|jD}n#t $rg}YnwxYw |j}n#t $ri}YnwxYw t|t} ||vr(| r&t|||t| n`||vr!| rt||t|n;t||rt|||ntd |d |d |d #t$r} t| d} ~ wwxYwdS) 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 'rz z = z (from )c,g|]}t|SrrA)rBos r"rDz5Distribution._set_command_options..ps!WWWa.q11WWWr$z error in z : command 'z' has no such option 'r)get_command_namerir rrhboolean_optionsrrrrrMrrlrr) rpre option_dict command_namersourcer bool_optsneg_opt is_stringr!s r"r2z!Distribution._set_command_options]s+#3355  ..|<N>N:NOOOOy((Y(K51A1ABBBB[&11K7777.dFdd|dd[addd 0 0 0*3/// 01 0 0s=B"" B10B15B== C  C B!E33 F=F  FFcnddlm}t||s|}||}n|}|js|S|d|_d|j|<|||r-| D]}| |||S)aReinitializes 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. rrF) rrrr5r: finalizedinitialize_optionsrfr2get_sub_commandsreinitialize_command)rprureinit_subcommandsrr=subs r"rFz!Distribution.reinitialize_commands& *)))))'7++ 6"L**<88GG"3355L  N""$$$!&+ l# !!'***  C//11 C C))#/ABBBBr$c0tj||dSNr)rpr!levels r"rzDistribution.announces sr$cD|jD]}||dS)zRun 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)r run_command)rprs r" run_commandszDistribution.run_commandss6 = " "C   S ! ! ! ! " "r$c|j|rdStjd|||}||d|j|<dS)aDo 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 %sT)rfrgr infor5ensure_finalizedrun)rprur4s r"rMzDistribution.run_commandsw =  W % %  F w'''&&w//  """ !% gr$cDt|jp|jpgdkSNr)rrXr[rs r"has_pure_moduleszDistribution.has_pure_moduless#4=9DO9r::Q>>r$c@|jot|jdkSrT)r^rrs r"has_ext_moduleszDistribution.has_ext_moduless =C(8$9$9A$==r$c@|jot|jdkSrT)r\rrs r"has_c_librarieszDistribution.has_c_librariess~9#dn"5"5"99r$cR|p|SrJ)rUrWrs r" has_moduleszDistribution.has_moduless%$$&&@$*>*>*@*@@r$c@|jot|jdkSrT)r]rrs r" has_headerszDistribution.has_headers|5DL 1 1A 55r$c@|jot|jdkSrT)rbrrs r" has_scriptszDistribution.has_scriptsr^r$c@|jot|jdkSrT)rcrrs r"has_data_fileszDistribution.has_data_filess;3t#7#7!#;;r$c~|o)| o| SrJ)rUrWrYrs r"is_purezDistribution.is_puresD  ! ! # # +((*** +((*** r$rJ)NNrG)TTr)T)F)+r __module__ __qualname____doc__rrrrLrr|rirrrrrrrrorrrrr r#r)rr5r2rFrINFOrrNrMrUrWrYr[r]r`rbrdrr$r"r&r&4s  *NLO6NM_MMMY'LY Y Y Y v   88884.???&@4@4@4@4HAAAF    ```D 4 4 4WY1+1+KS1+1+1+1+f%#%#%#NAAA"RRR2<   $C$C$CL:(0(0(0(0T&&&&T#*,"""&&&(???>>>:::AAA666666<<<     r$r&ceZdZdZdZd'dZdZdZdZdZ d Z d Z d Z e d ed edefdZdZdZdZdZdZdZdZdZeZdZdZdZdZdZdZdZdZ d Z!d!Z"d"Z#d#Z$d$Z%d%Z&d&Z'dS)(rNz]Dummy class to hold the distribution meta-data: name, version, author, and so forth. )r.r/r2 author_emailr4maintainer_emailr6r7r9long_descriptionr<r:r1r5 contact_emailr; download_urlr=r>r?Nc@|$|t|dSd|_d|_d|_d|_d|_d|_d|_d|_ d|_ d|_ d|_ d|_ d|_d|_d|_d|_d|_dSrJ) read_pkg_fileopenr.r/r2rjr4rkr6r7r9rlr<r:r;rnr=r>r?)rprs r"r|zDistributionMetadata.__init__s     tDzz * * * * *DIDLDK $D "DO$(D !DHDL#D $(D ! DM!DN#D  $D  DM DM!DNNNr$ct|fd}fd}d}|d|_|d|_|d|_|d|_d|_|d |_d|_|d |_|d |_ d vr|d |_ nd|_ |d |_ |d|_dvr#|d d|_ |d|_|d|_|dkr2|d|_|d|_|d|_dSd|_d|_d|_dS)z-Reads the metadata values from a file object.c0|}|r|dkr|SdSdSNUNKNOWNr)r.rr!s r" _read_fieldz7DistributionMetadata.read_pkg_file.._read_field.s3IE )++   ++r$cD|d}|gkrdS|SrJ)get_all)r.valuesr!s r" _read_listz6DistributionMetadata.read_pkg_file.._read_list3s)[[t,,F||tMr$zmetadata-versionr.r/summaryr2Nr3z home-pager7z download-urlr9r<rplatform classifier1.1r>r=r?)rr.r/r9r2r4rjrkr6r7rnrlrr<r:r;r>r=r?)rpfilervrzmetadata_versionr!s @r"rpz"DistributionMetadata.read_pkg_file*s%%            12K'' "{9-- &;y11!k(++ 'K77 $;{++"{9-- S + N ; ;D   $D  + M : :&;y11   'K 3399#>>DM#J//%:l33 u $ $&Jz22DM&Jz22DM'Z 44DNNN DM DM!DNNNr$cttj|ddd5}||ddddS#1swxYwYdS)z.Write the PKG-INFO file into the release tree.zPKG-INFOwzUTF-8rN)rqrrrwrite_pkg_file)rpbase_dirpkg_infos r"write_pkg_infoz#DistributionMetadata.write_pkg_info]s  GLL: . .g    *     ) ) ) * * * * * * * * * * * * * * * * * *sAAAcd}|js|js|js|js|jrd}d|dd|dd|dfd}|d||d | |d | |d | |d | |d |j|dt|pd|dd||d||d||d||d||d|dS)z0Write the PKG-INFO format data to a file object.z1.0r~zMetadata-Version: rzName: z Version: cF|r|d|ddSdSNz: rwrite)rryrs r" maybe_writez8DistributionMetadata.write_pkg_file..maybe_writeus> 1 f/////00000 1 1r$Summaryz Home-pageAuthorz Author-emailLicensez Download-URL DescriptionrGKeywordsrPlatform ClassifierRequiresProvides ObsoletesN)r=r>r?r;rnrget_name get_versionget_descriptionget_url get_contactget_contact_email get_licenserget_long_descriptionr get_keywords _write_list get_platformsget_classifiers get_requires get_provides get_obsoletes)rprr/rs ` r"rz#DistributionMetadata.write_pkg_fileds M } ~      G 3333444 /DMMOO///000 5t//11555666 1 1 1 1 1  It3355666 K000 Hd..00111 ND$:$:$<$<=== It//11222 ND$5666 M=1J1J1L1L1RPR#S#STTT J):):)<)< = =>>> z4+=+=+?+?@@@ |T-A-A-C-CDDD z4+<+<+>+>??? z4+<+<+>+>??? {D,>,>,@,@AAAAAr$cN|pg}|D]}||d|ddSrr)rprr.ryrs r"rz DistributionMetadata._write_listsJ2 - -E JJ$++%+++ , , , , - -r$c|jpdSrt)r.rs r"rzDistributionMetadata.get_namesy%I%r$c|jpdS)Nz0.0.0)r/rs r"rz DistributionMetadata.get_versions|&w&r$cv|||SrJ) _fullnamerrrs r" get_fullnamez!DistributionMetadata.get_fullnames*~~dmmoot/?/?/A/ABBBr$r.r/returncdt|ddt|dS)a  >>> DistributionMetadata._fullname('setup.tools', '1.0-2') 'setup_tools-1.0.post2' >>> DistributionMetadata._fullname('setup-tools', '1.2post2') 'setup_tools-1.2.post2' >>> DistributionMetadata._fullname('setup-tools', '1.0-r2') 'setup_tools-1.0.post2' >>> DistributionMetadata._fullname('setup.tools', '1.0.post') 'setup_tools-1.0.post0' >>> DistributionMetadata._fullname('setup.tools', '1.0+ubuntu-1') 'setup_tools-1.0+ubuntu.1' z{}-{}rJrF)strip_trailing_zero)rrrr)r.r/s r"rzDistributionMetadata._fullnamesE~~ d # # + +C 5 5 e D D D   r$c|jSrJ)r2rs r" get_authorzDistributionMetadata.get_authors {r$c|jSrJ)rjrs r"get_author_emailz%DistributionMetadata.get_author_email   r$c|jSrJ)r4rs r"get_maintainerz#DistributionMetadata.get_maintainers r$c|jSrJ)rkrs r"get_maintainer_emailz)DistributionMetadata.get_maintainer_email $$r$c|jp|jSrJ)r4r2rs r"rz DistributionMetadata.get_contacts-$+-r$c|jp|jSrJ)rkrjrs r"rz&DistributionMetadata.get_contact_emails$9(99r$c|jSrJ)r6rs r"rzDistributionMetadata.get_urls xr$c|jSrJ)r7rs r"rz DistributionMetadata.get_licenses |r$c|jSrJ)r9rs r"rz$DistributionMetadata.get_descriptions r$c|jSrJ)rlrs r"rz)DistributionMetadata.get_long_descriptionrr$c|jpgSrJ)r<rs r"rz!DistributionMetadata.get_keywords}""r$c0t|d|_dS)Nr<)r#r<rprs r" set_keywordsz!DistributionMetadata.set_keywordss$UJ77 r$c|jSrJ)r:rs r"rz"DistributionMetadata.get_platformss ~r$c0t|d|_dS)Nr:)r#r:rs r" set_platformsz"DistributionMetadata.set_platformss%e[99r$c|jpgSrJ)r;rs r"rz$DistributionMetadata.get_classifierss%2%r$c0t|d|_dS)Nr;)r#r;rs r"set_classifiersz$DistributionMetadata.set_classifierss'}==r$c|jSrJ)rnrs r"get_download_urlz%DistributionMetadata.get_download_urlrr$c|jpgSrJ)r>rs r"rz!DistributionMetadata.get_requiresrr$ctddl}|D]}|j|t||_dSrT)distutils.versionpredicateversionpredicateVersionPredicaterr>rprrr(s r" set_requiresz!DistributionMetadata.set_requiressH)))) ; ;A  & 7 7 : : : :U  r$c|jpgSrJ)r=rs r"rz!DistributionMetadata.get_providesrr$crd|D}|D] }ddl}|j|!||_dS)Nc6g|]}|Srr)rBr(s r"rDz5DistributionMetadata.set_provides..s ***q***r$r)rrsplit_provisionr=)rprr(rs r" set_providesz!DistributionMetadata.set_providessU**E*** : :A - - - -  & 6 6q 9 9 9 9 r$c|jpgSrJ)r?rs r"rz"DistributionMetadata.get_obsoletess~##r$ctddl}|D]}|j|t||_dSrT)rrrrr?rs r" set_obsoletesz"DistributionMetadata.set_obsoletessH)))) ; ;A  & 7 7 : : : :er$rJ)(rrerfrgrPr|rprrrrrr staticmethodrrrrrrrrrr get_licencerrrrrrrrrrrrrrrrr$r"rNrNs@0"""".1"1"1"f***%B%B%BN---&&&'''CCC  c c   \ $!!!%%%...:::K   %%%###888:::&&&>>>!!!###$$$###$$$%%%%%r$rNcd|DS)zConvert a 4-tuple 'help_options' list as found in various command classes to the 3-tuple form required by FancyGetopt. c"g|] }|dd S)rr)rBrxs r"rDz$fix_help_options..s ( ( (C!H ( ( (r$r)rHs r"rrs ) ( ( ( ((r$)%rgrrrrrerrjcollections.abcremailrpackaging.utilsrr_logr debugr errorsr r r r fancy_getoptrrutilrrrcompilerr#r&rNrrr$r"rs   $$$$$$######CCCCCCCC 988888889999999999 RZ4 5 5    x x x x x x x x DK%K%K%K%K%K%K%K%\)))))r$