lJc@s?dZdZddkZddkZddkZddkZddkTddklZyddkZWne j o e ZnXddk Tddk l Z lZddklZlZlZddklZdd klZeid Zd fd YZd fdYZdZedjoeZdGHndS(s}distutils.dist Provides the Distribution class, which represents the module distribution being built/installed/distributed. s0$Id: dist.py 38697 2005-03-23 18:54:36Z loewis $iN(t*(tcopy(t FancyGetoptttranslate_longopt(t check_environt strtoboolt rfc822_escape(tlog(tDEBUGs^[a-zA-Z]([a-zA-Z0-9_]*)$t DistributioncBseZdZd[d\d]d^gZdZd`dadbdcdddedfdgdhdidjdkdldmdndodpdqdrdsdtgZed:eZhddZ d?Z d_d@ZdAZdBZdCZdDZddgdEZdFZdGZdHZdIZdJZdKZddLZd_dMZdNdOZddPZdQZdRZdSZ dTZ!dUZ"dVZ#dWZ$dXZ%dYZ&dZZ'RS(usThe 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. tverbosetvsrun verbosely (default)itquiettqs!run quietly (turns verbosity off)sdry-runtnsdon't actually do anythingthelpthsshow detailed help messagesCommon commands: (see '--help-commands' for more) setup.py build will build the package underneath 'build/' setup.py install will install the package s help-commandsslist all available commandstnamesprint package nametversiontVsprint package versiontfullnamesprint -tauthorsprint the author's names author-emails print the author's email addresst maintainersprint the maintainer's namesmaintainer-emails$print the maintainer's email addresstcontacts7print the maintainer's name if known, else the author'ss contact-emails@print the maintainer's email address if known, else the author'sturlsprint the URL for this packagetlicenses print the license of the packagetlicencesalias for --licenset descriptionsprint the package descriptionslong-descriptions"print the long package descriptiont platformssprint the list of platformst classifierssprint the list of classifierstkeywordssprint the list of keywordstprovidess+print the list of packages/modules providedtrequiress+print the list of packages/modules requiredt obsoletess0print the list of packages/modules made obsoletecCst|dS(i(R(tx((s!/sys/lib/python/distutils/dist.pyttsc Csd|_d|_d|_x!|iD]}t||dq%Wt|_x:|iiD],}d|}t||t|i|qXWh|_ d |_ d |_ d |_ h|_g|_d |_h|_d |_d |_d |_d |_d |_d |_d |_d |_d |_d |_h|_h|_|o|id}|od|d=xZ|iD]H\}}|i |}x*|iD]\} } d| f|| 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'. iNis(no description available)( RRTRR.R`RCRuRRR( RORkRRRRtrvRR((s!/sys/lib/python/distutils/dist.pyRs.     cCs|i}t|tgpti|pdd}x1tt|D]}ti||||-(sauthorNsprint the author's name(s author-emailNs print the author's email address(s maintainerNsprint the maintainer's name(smaintainer-emailNs$print the maintainer's email address(RNs7print the maintainer's name if known, else the author's(s contact-emailNs@print the maintainer's email address if known, else the author's(surlNsprint the URL for this package(slicenseNs print the license of the package(slicenceNsalias for --license(s descriptionNsprint the package description(slong-descriptionNs"print the long package description(s platformsNsprint the list of platforms(s classifiersNsprint the list of classifiers(skeywordsNsprint the list of keywords(sprovidesNs+print the list of packages/modules provided(srequiresNs+print the list of packages/modules required(s obsoletesNs0print the list of packages/modules made obsolete((Rt __module__t__doc__RRR/RRR(RR[RERjR}RRRRRNRRRRRRRRRRRRRRRRR R R R R (((s!/sys/lib/python/distutils/dist.pyR !s        - 0 K b  5 *  $ # )  ( *         R*cBs eZdZd0ZdZdZdZdZdZdZ dZ dZ dZ dZ dZd Zd!Zd"Zd#ZeZd$Zd%Zd&Zd'Zd(Zd)Zd*Zd+Zd,Zd-Zd.Zd/ZRS(1s]Dummy class to hold the distribution meta-data: name, version, author, and so forth. RRRt author_emailRtmaintainer_emailRRRtlong_descriptionRRRRt contact_emailRt download_urlRR R!cCsd|_d|_d|_d|_d|_d|_d|_d|_d|_ d|_ d|_ d|_ d|_ d|_d|_d|_d|_dS(N(R/RRRRRRRRRRRRRRRR R!(RO((s!/sys/lib/python/distutils/dist.pyR[s"                cCs9ttii|dd}|i||idS(s7Write the PKG-INFO file into the release tree. sPKG-INFOtwN(topenRnRoRstwrite_pkg_filetclose(ROtbase_dirtpkg_info((s!/sys/lib/python/distutils/dist.pytwrite_pkg_info/s cCsd}|ip|ip |io d}n|id||id|i|id|i|id|i|id|i|id|i|id |i |id |i |i o|id |i nt |i }|id |ti|id }|o|id|n|i|d|i|i|d|i|i|d|i|i|d|i|i|d|idS(s9Write the PKG-INFO format data to a file object. s1.0s1.1sMetadata-Version: %s s Name: %s s Version: %s s Summary: %s sHome-page: %s s Author: %s sAuthor-email: %s s License: %s sDownload-URL: %s sDescription: %s Rs Keywords: %s tPlatformt ClassifiertRequirestProvidest ObsoletesN(RR R!RKtget_namet get_versiontget_descriptiontget_urlt get_contacttget_contact_emailt get_licenseRRtget_long_descriptionRbRst get_keywordst _write_listt get_platformstget_classifierst get_requirest get_providest get_obsoletes(ROtfileRt long_descR((s!/sys/lib/python/distutils/dist.pyR:s.  cCs,x%|D]}|id||fqWdS(Ns%s: %s (RK(ROR0RtvaluesR((s!/sys/lib/python/distutils/dist.pyR*[scCs|ipdS(NtUNKNOWN(R(RO((s!/sys/lib/python/distutils/dist.pyR!ascCs|ipdS(Ns0.0.0(R(RO((s!/sys/lib/python/distutils/dist.pyR"dscCsd|i|ifS(Ns%s-%s(R!R"(RO((s!/sys/lib/python/distutils/dist.pyt get_fullnamegscCs|ipdS(NR3(R(RO((s!/sys/lib/python/distutils/dist.pyt get_authorjscCs|ipdS(NR3(R(RO((s!/sys/lib/python/distutils/dist.pytget_author_emailmscCs|ipdS(NR3(R(RO((s!/sys/lib/python/distutils/dist.pytget_maintainerpscCs|ipdS(NR3(R(RO((s!/sys/lib/python/distutils/dist.pytget_maintainer_emailsscCs|ip|ipdS(NR3(RR(RO((s!/sys/lib/python/distutils/dist.pyR%vs  cCs|ip|ipdS(NR3(RR(RO((s!/sys/lib/python/distutils/dist.pyR&{s  cCs|ipdS(NR3(R(RO((s!/sys/lib/python/distutils/dist.pyR$scCs|ipdS(NR3(R(RO((s!/sys/lib/python/distutils/dist.pyR'scCs|ipdS(NR3(R(RO((s!/sys/lib/python/distutils/dist.pyR#scCs|ipdS(NR3(R(RO((s!/sys/lib/python/distutils/dist.pyR(scCs|ipgS(N(R(RO((s!/sys/lib/python/distutils/dist.pyR)scCs|ipdgS(NR3(R(RO((s!/sys/lib/python/distutils/dist.pyR+scCs|ipgS(N(R(RO((s!/sys/lib/python/distutils/dist.pyR,scCs|ipdS(NR3(R(RO((s!/sys/lib/python/distutils/dist.pytget_download_urlscCs|ipgS(N(R (RO((s!/sys/lib/python/distutils/dist.pyR-scCs:ddk}x|D]}|ii|qW||_dS(Ni(tdistutils.versionpredicatetversionpredicatetVersionPredicateR (RORRkR ((s!/sys/lib/python/distutils/dist.pyt set_requiress  cCs|ipgS(N(R(RO((s!/sys/lib/python/distutils/dist.pyR.scCsag}|D]}||iq ~}x*|D]"}ddk}|ii|q.W||_dS(Ni(RR:R;tsplit_provisionR(RORt_[1]R Rk((s!/sys/lib/python/distutils/dist.pyt set_providess ' cCs|ipgS(N(R!(RO((s!/sys/lib/python/distutils/dist.pyR/scCs:ddk}x|D]}|ii|qW||_dS(Ni(R:R;R<R!(RORRkR ((s!/sys/lib/python/distutils/dist.pyt set_obsoletess  (snamesversionsauthors author_emails maintainersmaintainer_emailsurlslicenses descriptionslong_descriptionskeywordss platformssfullnamescontactRslicenses classifierss download_urlsprovidessrequiress obsoletes( RRRR,R[RRR*R!R"R4R5R6R7R8R%R&R$R't get_licenceR#R(R)R+R,R9R-R=R.R@R/RA(((s!/sys/lib/python/distutils/dist.pyR* sH  !                       cCs/g}x"|D]}|i|dd!q W|S(sConvert a 4-tuple 'help_options' list as found in various command classes to the 3-tuple form required by FancyGetopt. ii(Ru(R%t new_optionst help_tuple((s!/sys/lib/python/distutils/dist.pyRs t__main__tok(Rt __revision__RIRnRbtrettypesRRGRR/tdistutils.errorstdistutils.fancy_getoptRRtdistutils.utilRRRRkRtdistutils.debugRtcompileRR R*RRtdist(((s!/sys/lib/python/distutils/dist.pyss.0