ó Àfc@sedZddlmZddlmZddlmZmZddlmZmZm Z m Z ddl m Z m Z ddlmZmZddlmZdd lmZdd lZdd lZdd lZdd lZdd lZdd lZdd lZdd lZdd lZdd lZdd lZdd l Z dd l!Z!dd l"Z"dd l#Z#dd l$Z$dd l%Z%dd l&m'Z'dd l(m)Z)m*Z*dd l+m,Z,ddl-m.Z.ddl/m0Z0m1Z1ddl2m3Z3ddl4m5Z5ddl6m7Z7ddl8m9Z9m:Z:m;Z;ddl4m<Z<m=Z=ddl>m?Z?ddl@mAZAmBZBmCZCmDZDmEZEmFZFmGZGmHZHmIZImJZJmKZKmLZLmMZMmNZNmOZOdd lPZ@ejQdde@jRƒddddddgZSd„ZTd „ZUe'jVrd!„ZWd"„ZXnd#„ZWd$„ZXd%„ZYde,fd&„ƒYZZd'„Z[d(„Z\d)„Z]d*„Z^d+„Z_deGfd,„ƒYZ`d-e`fd.„ƒYZaejbjcd/d0ƒd1krÀeaZ`nd2„Zdd3„Zed4„Zfd5„Zgehd6„Zid7„Zjd8„Zkd9ejlkrekZmn d:„Zmd;d<„Znd=„Zod>„Zpd?„Zqydd@lmrZsWnetk rzdA„ZsnXdB„ZrdCeufdD„ƒYZvevjwƒZxdEevfdF„ƒYZydGezfdH„ƒYZ{dIe{fdJ„ƒYZ|dKe|fdL„ƒYZ}e{j~Z~e{jZdM„Z€dN„Z�e‚eedO„ZƒdP„Z„dQ„Z…ehdR„Z†e"j‡dS„ƒZˆd S(Ts% Easy Install ------------ A tool for doing automatic download/extract/build of distutils-based Python packages. For detailed documentation, see the accompanying EasyInstall.txt file, or visit the `EasyInstall home page`__. __ https://setuptools.readthedocs.io/en/latest/easy_install.html iÿÿÿÿ(tglob(t get_platform(t convert_patht subst_vars(tDistutilsArgErrortDistutilsOptionErrortDistutilsErrortDistutilsPlatformError(tINSTALL_SCHEMESt SCHEME_KEYS(tlogtdir_util(t first_line_re(tfind_executableN(tsix(t configparsertmap(tCommand(t run_setup(tget_pathtget_config_vars(t rmtree_safe(tsetopt(tunpack_archive(t PackageIndextparse_requirement_argt URL_SCHEME(t bdist_eggtegg_info(tWheel(t yield_linestnormalize_pathtresource_stringtensure_directorytget_distributiontfind_distributionst Environmentt Requirementt Distributiont PathMetadatat EggMetadatat WorkingSettDistributionNotFoundtVersionConflictt DEVELOP_DISTtdefaulttcategorytsamefilet easy_installtPthDistributionstextract_wininst_cfgtmaintget_exe_prefixescCstjdƒdkS(NtPi(tstructtcalcsize(((sC/usr/lib/python2.7/site-packages/setuptools/command/easy_install.pytis_64bitIscCs›tjj|ƒo!tjj|ƒ}ttjdƒo9|}|rUtjj||ƒStjjtjj|ƒƒ}tjjtjj|ƒƒ}||kS(s  Determine if two paths reference the same file. Augments os.path.samefile to work on Windows and suppresses errors if the path doesn't exist. R/(tostpathtexiststhasattrR/tnormpathtnormcase(tp1tp2t both_existt use_samefiletnorm_p1tnorm_p2((sC/usr/lib/python2.7/site-packages/setuptools/command/easy_install.pyR/Ms$cCs|S(N((ts((sC/usr/lib/python2.7/site-packages/setuptools/command/easy_install.pyt _to_ascii_scCs1ytj|dƒtSWntk r,tSXdS(Ntascii(Rt text_typetTruet UnicodeErrortFalse(RE((sC/usr/lib/python2.7/site-packages/setuptools/command/easy_install.pytisasciibs  cCs |jdƒS(NRG(tencode(RE((sC/usr/lib/python2.7/site-packages/setuptools/command/easy_install.pyRFjscCs.y|jdƒtSWntk r)tSXdS(NRG(RMRIRJRK(RE((sC/usr/lib/python2.7/site-packages/setuptools/command/easy_install.pyRLms   cCstj|ƒjƒjddƒS(Ns s; (ttextwraptdedenttstriptreplace(ttext((sC/usr/lib/python2.7/site-packages/setuptools/command/easy_install.pytutcBsreZdZdZeZd�d‚dƒd„d…d†d‡dˆd‰dŠd‹dŒd�dŽd�d�d‘d’d“d”d•gZdddd dd-d0d6d9g Ze j rºd=e j Z ej d>d€e fƒej d>ƒnidd'6ZeZd?„Zd@„ZdA„ZedB„ƒZdC„ZdD„ZdE„ZdF„ZdG„ZdH„ZdI„ZdJ„ZdK„Zej dLƒj!ƒZ"ej dMƒj!ƒZ#ej dNƒj!ƒZ$dO„Z%dP„Z&dQ„Z'dR„Z(dS„Z)dT„Z*e+j,dU„ƒZ-e.dV„Z/e.dW„Z0dX„Z1edY„Z2dZ„Z3d[„Z4d\„Z5d€d]„Z6ed^„ƒZ7d_d–d`„Z8da„Z9db„Z:dc„Z;dd„Z<de„Z=df„Z>ej dgƒj!ƒZ?ej dhƒZ@didj„ZAej dkƒj!ƒZBdl„ZCdm„ZDdn„ZEdo„ZFdp„ZGdq„ZHdr„ZIds„ZJej dtƒj!ƒZKdu„ZLdv„ZMdw„ZNeOdxeOdydzd{d|ƒƒZPeOdyd}d{d~ƒZQd„ZRRS(—s'Manage a download/build/install processs Find/get/install Python packagessprefix=sinstallation prefixszip-oktzsinstall package as a zipfiles multi-versiontms%make apps have to require() a versiontupgradetUs1force upgrade (searches PyPI for latest versions)s install-dir=tdsinstall package to DIRs script-dir=REsinstall scripts to DIRsexclude-scriptstxsDon't install scriptss always-copytas'Copy all needed packages to install dirs index-url=tis base URL of Python Package Indexs find-links=tfs(additional URL(s) to search for packagessbuild-directory=tbs/download/extract/build in DIR; keep the resultss optimize=tOslalso compile with optimization: -O1 for "python -O", -O2 for "python -OO", and -O0 to disable [default: -O0]srecord=s3filename in which to record list of installed filess always-unziptZs*don't install as a zipfile, no matter whats site-dirs=tSs)list of directories where .pth files workteditabletes+Install specified packages in editable formsno-depstNsdon't install dependenciess allow-hosts=tHs$pattern(s) that hostnames must matchslocal-snapshots-oktls(allow building eggs from local checkoutstversions"print version information and exits no-find-linkss9Don't load find-links defined in packages being installeds!install in user site-package '%s'tusercCs¨d|_d|_|_d|_|_|_d|_d|_d|_ d|_ d|_ |_ d|_ |_|_d|_|_|_d|_|_|_d|_d|_d|_d|_d|_d|_d|_d|_d|_tj rtj!|_"tj#|_$nd|_"d|_$d|_%d|_&d|_'|_(d|_)i|_*t+|_,d|_-|j.j/|_/|j.j0||j.j1dƒƒdS(NiR0(2RhtNonetzip_oktlocal_snapshots_okt install_dirt script_dirtexclude_scriptst index_urlt find_linkstbuild_directorytargstoptimizetrecordRWt always_copyt multi_versionRbtno_depst allow_hoststroottprefixt no_reportRgtinstall_purelibtinstall_platlibtinstall_headerst install_libtinstall_scriptst install_datat install_basetinstall_platbasetsitetENABLE_USER_SITEt USER_BASEtinstall_userbaset USER_SITEtinstall_usersitet no_find_linkst package_indextpth_filetalways_copy_fromt site_dirstinstalled_projectsRKtsitepy_installedt_dry_runt distributiontverboset_set_command_optionstget_option_dict(tself((sC/usr/lib/python2.7/site-packages/setuptools/command/easy_install.pytinitialize_options¨sF                         cCs*d„|Dƒ}tt|j|ƒƒdS(Ncss9|]/}tjj|ƒs-tjj|ƒr|VqdS(N(R9R:R;tislink(t.0tfilename((sC/usr/lib/python2.7/site-packages/setuptools/command/easy_install.pys Ús(tlistRt _delete_path(R–tblockerstextant_blockers((sC/usr/lib/python2.7/site-packages/setuptools/command/easy_install.pytdelete_blockersØscCsetjd|ƒ|jrdStjj|ƒo?tjj|ƒ }|rNtntj}||ƒdS(Ns Deleting %s( R tinfotdry_runR9R:tisdirR˜trmtreetunlink(R–R:tis_treetremover((sC/usr/lib/python2.7/site-packages/setuptools/command/easy_install.pyRœßs  %cCs=tjd }tdƒ}d}|jtƒ�GHtƒ‚dS(sT Render the Setuptools version and installation details, then exit. it setuptoolss=setuptools {dist.version} from {dist.location} (Python {ver})N(tsysRgR"tformattlocalst SystemExit(tvertdistttmpl((sC/usr/lib/python2.7/site-packages/setuptools/command/easy_install.pyt_render_versionès   c Csÿ|jo|jƒtjjƒd}tddƒ\}}i |jjƒd6|jjƒd6|jjƒd6|d6|dd!d 6|d|d d 6|d 6|d6|d 6|d6t tddƒd6|_ t j r÷|j |j d<|j|j dt<|j;ƒ|_;d|j;ko†d kns”t=‚nWq¸t=k r´t(d"ƒ‚q¸Xn|j*rÚ|j> rÚt?d#ƒ‚n|j@sòt?d$ƒ‚ng|_AdS()NiRzt exec_prefixt dist_namet dist_versiont dist_fullnamet py_versionitpy_version_shortitpy_version_nodott sys_prefixtsys_exec_prefixtabiflagsRTtuserbasetusersiteRlRmRqRŽRR€tinstallRtt,s"%s (in --site-dirs) does not exists$ (in --site-dirs) is not on sys.pathshttps://pypi.python.org/simplet*t search_paththostsRss--optimize must be 0, 1, or 2s9Must specify a build directory (-b) when using --editables:No urls, filenames, or requirements specified (see --help)(RlRl(RlRm(RtRt(RsRs(BRgR¯R¨tsplitRR’tget_namet get_versiont get_fullnametgetattrt config_varsR„R…R‡R‰t_fix_install_dir_for_user_sitetexpand_basedirst expand_dirst_expandRmRiRlRŠRKtset_undefined_optionsRhR|R€RRR:t get_site_dirst all_site_dirsRŽR9t expanduserRPR¢R twarnRtappendRbtcheck_site_dirRot shadow_pathtinsertRxR‹t create_indexR$t local_indexRpt isinstanceRt string_typesRktscan_egg_linkstadd_find_linksRstintt ValueErrorRqRRrtoutputs( R–R´RzR°R=RERŽRYt path_itemRÀ((sC/usr/lib/python2.7/site-packages/setuptools/command/easy_install.pytfinalize_optionsósª          4    . !        cCsƒ|j stj rdS|jƒ|jdkrFd}t|ƒ‚n|j|_|_t j j ddƒd}|j |ƒdS(s; Fix the install_dir if "--user" was used. Ns$User base directory is not specifiedtposixtunixt_user( RhR„R…tcreate_home_pathR‡RiRR‚RƒR9tnameRQt select_scheme(R–tmsgt scheme_name((sC/usr/lib/python2.7/site-packages/setuptools/command/easy_install.pyRÇms cCsˆx�|D]y}t||ƒ}|dk rtjdksFtjdkr[tjj|ƒ}nt||jƒ}t|||ƒqqWdS(NRßtnt( RÅRiR9RãR:RÎRRÆtsetattr(R–tattrstattrtval((sC/usr/lib/python2.7/site-packages/setuptools/command/easy_install.pyt _expand_attrs|s  cCs|jdddgƒdS(sNCalls `os.path.expanduser` on install_base, install_platbase and root.R‚RƒRyN(Rì(R–((sC/usr/lib/python2.7/site-packages/setuptools/command/easy_install.pyRÈ…scCs)ddddddg}|j|ƒdS(s+Calls `os.path.expanduser` on install dirs.R|R}RR~R€R�N(Rì(R–tdirs((sC/usr/lib/python2.7/site-packages/setuptools/command/easy_install.pyRÉŠs cCs|j|jjkr(tj|jƒnzËx%|jD]}|j||j ƒq5W|jrè|j}|j r¯t |j ƒ}x/t t |ƒƒD]}||||||jr dSx*tjƒj|ƒD]}|j|Œq#WdS(N(Rnt ScriptWritertbesttget_argst write_script(R–R­Rr((sC/usr/lib/python2.7/site-packages/setuptools/command/easy_install.pyR)s cCspt|jƒƒ}t||ƒ}|rS|j|ƒtƒ}tj|ƒ|}n|j|t|ƒdƒdS(s/Generate a legacy script wrapper and install itR^N( R6RRtis_python_scriptt_load_templateRªRat get_headerRdRF(R–R­R*t script_texttdev_pathRöt is_scripttbody((sC/usr/lib/python2.7/site-packages/setuptools/command/easy_install.pyR's cCs=d}|r!|jddƒ}ntd|ƒ}|jdƒS(s‰ There are a couple of template scripts in the package. This function loads one of them and prepares it for use. s script.tmpls.tmpls (dev).tmplR§sutf-8(RQR tdecode(RiRãt raw_bytes((sC/usr/lib/python2.7/site-packages/setuptools/command/easy_install.pyRf&s ttc Csí|jg|D]}tjj|j|ƒ^q ƒtjd||jƒtjj|j|ƒ}|j|ƒ|jrzdSt ƒ}t |ƒtjj |ƒr¯tj |ƒnt |d|ƒ�}|j|ƒWdQXt|d|ƒdS(s1Write an executable file to the scripts directorysInstalling %s script to %sNRiÿ(RŸR9R:RÿRmR R R/R¡t current_umaskR!R;R¤RRtchmod( R–R*R_tmodeR�RZttargettmaskR]((sC/usr/lib/python2.7/site-packages/setuptools/command/easy_install.pyRd5s,    cCsû|jƒjdƒr(|j||ƒgS|jƒjdƒrP|j||ƒgS|jƒjdƒrx|j||ƒgS|}tjj|ƒr¶|jdƒ r¶t|||j ƒn'tjj |ƒrÝtjj |ƒ}n|j |ƒr|j r|dk r|j|||ƒ}ntjj|dƒ}tjj|ƒsÁttjj|ddƒƒ}|sƒtdtjj |ƒƒ‚nt|ƒdkr´td tjj |ƒƒ‚n|d }n|jrçtj|j||ƒƒgS|j||ƒSdS( Ns.eggs.exes.whls.pyssetup.pyR¾s"Couldn't find a setup script in %sisMultiple setup scripts in %si(RRCt install_eggt install_exet install_wheelR9R:tisfileRtunpack_progressR¢tabspatht startswithRqRiR`RÿR;RRRðRbR R treport_editabletbuild_and_install(R–RöR\R7R]t setup_scripttsetups((sC/usr/lib/python2.7/site-packages/setuptools/command/easy_install.pyREIs<"  cCs[tjj|ƒr3t|tjj|dƒƒ}nttj|ƒƒ}tj |d|ƒS(NsEGG-INFOtmetadata( R9R:R¢R'RÿR(t zipimportt zipimporterR&t from_filename(R–tegg_pathR((sC/usr/lib/python2.7/site-packages/setuptools/command/easy_install.pyRFus cCs%tjj|jtjj|ƒƒ}tjj|ƒ}|jsLt|ƒn|j|ƒ}t ||ƒs tjj |ƒr¨tjj |ƒ r¨t j |d|jƒn2tjj|ƒrÚ|jtj|fd|ƒnyt}tjj |ƒr*|j|ƒrtjd}}q‘tjd}}ng|j|ƒrY|j|ƒ|jd}}n8t}|j|ƒr�tjd}}ntjd}}|j|||f|dtjj|ƒtjj|ƒfƒt|d|ƒWq tk rt|dtƒ‚q Xn|j|ƒ|j|ƒS(NR¡s Removing tMovingtCopyingt Extractings %s to %stfix_zipimporter_caches(R9R:RÿRlR!RyR¡R!RFR/R¢R˜R t remove_treeR;RóR¤RKRzRZR[tcopytreeRXtmkpathtunpack_and_compileRItcopy2Rtupdate_dist_cachesRûR/(R–RƒR7t destinationR­tnew_dist_is_zippedR]RV((sC/usr/lib/python2.7/site-packages/setuptools/command/easy_install.pyRt}sT   %      cCst|ƒ}|dkr+td|ƒ‚ntdd|jddƒd|jddƒdtƒƒ}tjj||j ƒdƒ}||_ |d}tjj|d ƒ}tjj|d ƒ}t |ƒt ||ƒ|_ |j||ƒtjj|ƒst|d ƒ} | jd ƒxU|jdƒD]D\} } | d kr*| jd| jddƒjƒ| fƒq*q*W| jƒntjj|dƒ} |jgtj|ƒD]} tjj| | dƒ^qªƒtj||d|jd|jƒ|j||ƒS(Ns(%s is not a valid distutils Windows .exeRDRRãRgtplatforms.eggs.tmpsEGG-INFOsPKG-INFORsMetadata-Version: 1.0 ttarget_versions%s: %s t_t-R$iR“R¡(R2RiRR&tgetRR9R:Rÿtegg_nameR@R!R't _providert exe_to_eggR;RRtitemsRQttitleRRŸRaRcRt make_zipfileR“R¡Rt(R–R\R7tcfgR­Rƒtegg_tmpt _egg_infotpkg_infR]tktvRmRr((sC/usr/lib/python2.7/site-packages/setuptools/command/easy_install.pyRu³s<       0 3c s³t|ƒ‰g‰g‰i‰‡‡‡‡‡fd†}t|ˆ|ƒg}x™ˆD]‘}|jƒjdƒrV|jdƒ}|d}tj|dƒd|d=%(version)s") # this version or higher sõ Note also that the installation directory must be on sys.path at runtime for this to work. (e.g. by being the application's script directory, by being on PYTHONPATH, or by being added to sys.path by your code.) t Installedc Csˆd}|jr\|j r\|d|j7}|jtttjƒkr\|d|j7}q\n|j }|j }|j }d}|t ƒS(s9Helpful installation message for display to package userss %(what)s %(eggloc)s%(extras)ss RT( RvR{t_easy_install__mv_warningRlRRR¨R:t_easy_install__id_warningR@RDRgRª( R–treqR­twhatRåtegglocRãRgtextras((sC/usr/lib/python2.7/site-packages/setuptools/command/easy_install.pyROCs   sR Extracted editable version of %(spec)s to %(dirname)s If it uses setuptools in its setup script, you can activate it in "development" mode by going to that directory and running:: %(python)s setup.py develop See the setuptools documentation for the "develop" command for more info. cCs-tjj|ƒ}tj}d|jtƒS(Ns (R9R:RR¨Rt_easy_install__editable_msgRª(R–RöR}Rtpython((sC/usr/lib/python2.7/site-packages/setuptools/command/easy_install.pyR{\s cCstjjdtƒtjjdtƒt|ƒ}|jdkrid|jd}|jdd|ƒn"|jdkr‹|jddƒn|jr§|jdd ƒnt j d |t |ƒdd j |ƒƒyt ||ƒWn-tk r}td |jdfƒ‚nXdS( Nsdistutils.command.bdist_eggsdistutils.command.egg_infoiR iiR“s-qs-ns Running %s %st sSetup script exited with %s(R¨tmodulest setdefaultRRR›R“RÓR¡R R RðRÿRR«RRr(R–R}R]RrR ((sC/usr/lib/python2.7/site-packages/setuptools/command/easy_install.pyRas   $c Csddg}tjdddtjj|ƒƒ}z¼|jtjj|ƒƒ|j|ƒ|j|||ƒt|gƒ}g}x?|D]7}x.||D]"}|j|j |j |ƒƒq™WqˆW| rç|j rçt j d|ƒn|SWdt|ƒt j|jƒXdS(NRs --dist-dirRzs egg-dist-tmp-tdirs+No eggs found in %s (setup script problem?)(R3R4R9R:Rt_set_fetcher_optionsRÐRR$RtR@R¡R RÏR£RïR“( R–R}R]Rrtdist_dirtall_eggsteggsR1R­((sC/usr/lib/python2.7/site-packages/setuptools/command/easy_install.pyR|us$    $   c Cs¥|jjdƒjƒ}d }i}xF|jƒD]8\}}||krOq1n|d||jdd ƒegg path translations for a given .exe filesPURELIB/RTsPLATLIB/pywin32_system32sPLATLIB/sSCRIPTS/sEGG-INFO/scripts/sDATA/lib/site-packagesR¡iisPKG-INFOis .egg-infois EGG-INFO/s.pths -nspkg.pthtPURELIBtPLATLIBs\Rs%s/%s/N(sPURELIB/RT(sPLATLIB/pywin32_system32RT(sPLATLIB/RT(sSCRIPTS/sEGG-INFO/scripts/(sDATA/lib/site-packagesRT(R+R,(RtZipFiletinfolistRšRÁRðRCRÓRÿtupperRäRtPY3RlRRPRQRzRÐRRtsorttreverse( t exe_filenameR©RUR RãR§R_tpthRZty((sC/usr/lib/python2.7/site-packages/setuptools/command/easy_install.pyR4ýs>  "#" 3 +  cBs\eZdZeZdd„Zd„Zd„Zed„ƒZ d„Z d„Z d„Z RS( s)A .pth file with Distribution paths in itcCsœ||_ttt|ƒƒ|_ttjj|jƒƒ|_|j ƒt j |gddƒx6t |jƒD]%}tt|jt|tƒƒƒqoWdS(N(RšR›RRR R9R:Rtbasedirt_loadR$t__init__RiRRÓRMR#RI(R–RšR R:((sC/usr/lib/python2.7/site-packages/setuptools/command/easy_install.pyR8)s  cCs„g|_t}tj|jƒ}tjj|jƒr3t |jdƒ}xÛ|D]Ó}|j dƒrpt }qOn|j ƒ}|jj |ƒ|jƒ sO|jƒj dƒr´qOnttjj|j|ƒƒ}|jdcCs7yt||dƒWnttfk r.tSXtSdS(s%Is this string a valid Python script?texecN(RSt SyntaxErrort TypeErrorRKRI(RRRš((sC/usr/lib/python2.7/site-packages/setuptools/command/easy_install.pyt is_pythonqs cCsVy1tj|ddƒ�}|jdƒ}WdQXWnttfk rK|SX|dkS(sCDetermine if the specified executable is a .sh (contains a #! line)Râslatin-1iNs#!(RãRRäRR(Rtfptmagic((sC/usr/lib/python2.7/site-packages/setuptools/command/easy_install.pytis_sh{s cCstj|gƒS(s@Quote a command line argument according to Windows parsing rules(t subprocesst list2cmdline(RX((sC/usr/lib/python2.7/site-packages/setuptools/command/easy_install.pyt nt_quote_arg…scCsb|jdƒs|jdƒr"tSt||ƒr5tS|jdƒr^d|jƒdjƒkStS(sMIs this text, as a whole, a Python script? (as opposed to shell/bat/etc. s.pys.pyws#!RÁi(RCRIRvRzt splitlinesRRK(RhRš((sC/usr/lib/python2.7/site-packages/setuptools/command/easy_install.pyReŠs(RpcGsdS(N((Rr((sC/usr/lib/python2.7/site-packages/setuptools/command/easy_install.pyt_chmodœscCsQtjd||ƒyt||ƒWn&tjk rL}tjd|ƒnXdS(Nschanging mode of %s to %oschmod failed: %s(R RÖR~R9terror(R:RqRc((sC/usr/lib/python2.7/site-packages/setuptools/command/easy_install.pyRp s t CommandSpeccBs§eZdZgZeƒZed„ƒZed„ƒZed„ƒZ ed„ƒZ ed„ƒZ d„Z e d„ƒZd„Ze d „ƒZe d „ƒZRS( sm A command spec for a #! header, specified as a list of arguments akin to those passed to Popen. cCs|S(sV Choose the best CommandSpec class based on environmental conditions. ((RL((sC/usr/lib/python2.7/site-packages/setuptools/command/easy_install.pyRb±scCs(tjjtjƒ}tjjd|ƒS(Nt__PYVENV_LAUNCHER__(R9R:R=R¨RRàR”(RLt_default((sC/usr/lib/python2.7/site-packages/setuptools/command/easy_install.pyt_sys_executable¸scCsOt||ƒr|St|tƒr,||ƒS|dkrB|jƒS|j|ƒS(sg Construct a CommandSpec from a parameter to build_scripts, which may be None. N(RÖR›Ritfrom_environmentt from_string(RLtparam((sC/usr/lib/python2.7/site-packages/setuptools/command/easy_install.pyt from_param½s   cCs||jƒgƒS(N(Rƒ(RL((sC/usr/lib/python2.7/site-packages/setuptools/command/easy_install.pyR„ÌscCstj||j�}||ƒS(s} Construct a command spec from a simple string representing a command line parseable by shlex.split. (tshlexRÁt split_args(RLtstringR˜((sC/usr/lib/python2.7/site-packages/setuptools/command/easy_install.pyR…ÐscCsMtj|j|ƒƒ|_tj|ƒ}t|ƒsIdg|jd*ndS(Ns-xi(RˆRÁt_extract_optionstoptionsRzR{RL(R–Rhtcmdline((sC/usr/lib/python2.7/site-packages/setuptools/command/easy_install.pytinstall_optionsÙs cCsQ|djƒd}tƒj|ƒ}|rA|jdƒpDdnd}|jƒS(sH Extract any options from the first line of the script. s iiRT(R}RTtmatchtgroupRP(t orig_scripttfirstR�RŒ((sC/usr/lib/python2.7/site-packages/setuptools/command/easy_install.pyR‹ßs!cCs|j|t|jƒƒS(N(t_renderR›RŒ(R–((sC/usr/lib/python2.7/site-packages/setuptools/command/easy_install.pyt as_headeréscCsDd}x7|D]/}|j|ƒr |j|ƒr |dd!Sq W|S(Ns"'iiÿÿÿÿ(RzRC(titemt_QUOTEStq((sC/usr/lib/python2.7/site-packages/setuptools/command/easy_install.pyt _strip_quotesìs  cCs%tjd„|Dƒƒ}d|dS(Ncss$|]}tj|jƒƒVqdS(N(R€R˜RP(R™R•((sC/usr/lib/python2.7/site-packages/setuptools/command/easy_install.pys ÷ss#!s (RzR{(R˜R�((sC/usr/lib/python2.7/site-packages/setuptools/command/easy_install.pyR“ôs(RïRðRñRŒRËR‰RMRbRƒR‡R„R…RŽRøR‹R”R˜R“(((sC/usr/lib/python2.7/site-packages/setuptools/command/easy_install.pyR€¨s   tWindowsCommandSpeccBseZedeƒZRS(Rß(RïRðRËRKR‰(((sC/usr/lib/python2.7/site-packages/setuptools/command/easy_install.pyR™ÿsRacBs¶eZdZejdƒjƒZeZe d e d„ƒZ e d e d„ƒZ e d d„ƒZed„ƒZe d„ƒZe d„ƒZe d„ƒZe d d d „ƒZRS( s` Encapsulates behavior around writing entry point scripts for console and gui apps. s– # EASY-INSTALL-ENTRY-SCRIPT: %(spec)r,%(group)r,%(name)r __requires__ = %(spec)r import re import sys from pkg_resources import load_entry_point if __name__ == '__main__': sys.argv[0] = re.sub(r'(-script\.pyw?|\.exe)?$', '', sys.argv[0]) sys.exit( load_entry_point(%(spec)r, %(group)r, %(name)r)() ) cCsMtjdtƒ|rtntjƒ}|jd||ƒ}|j||ƒS(Ns Use get_argsRT(twarningsRÏtDeprecationWarningtWindowsScriptWriterRaRbtget_script_headerRc(RLR­Rtwininsttwritertheader((sC/usr/lib/python2.7/site-packages/setuptools/command/easy_install.pytget_script_argsscCsNtjdtƒ|rd}n|jjƒj|ƒ}|j|ƒ|jƒS(NsUse get_headers python.exe(RšRÏR›tcommand_spec_classRbR‡RŽR”(RLRhRRžtcmd((sC/usr/lib/python2.7/site-packages/setuptools/command/easy_install.pyR�!s   c cs½|dkr|jƒ}nt|jƒƒ}x‰dD]�}|d}xn|j|ƒjƒD]W\}}|j|ƒ|jtƒ}|j ||||ƒ} x| D] } | Vq¢WqZWq4WdS(s� Yield write_script() argument tuples for a distribution's console_scripts and gui_scripts entry points. tconsoletguit_scriptsN(R¤R¥( RiRgR6RRt get_entry_mapR˜t_ensure_safe_nameRáRªt_get_script_args( RLR­R Röttype_R�RãtepRhRrR²((sC/usr/lib/python2.7/site-packages/setuptools/command/easy_install.pyRc+s   "  cCs+tjd|ƒ}|r'tdƒ‚ndS(s? Prevent paths in *_scripts entry point names. s[\\/]s+Path separators not allowed in script namesN(RRtsearchRÛ(Rãt has_path_sep((sC/usr/lib/python2.7/site-packages/setuptools/command/easy_install.pyR¨=scCs*tjdtƒ|r tjƒS|jƒS(NsUse best(RšRÏR›RœRb(RLt force_windows((sC/usr/lib/python2.7/site-packages/setuptools/command/easy_install.pyt get_writerFscCs?tjdks-tjdkr7tjdkr7tjƒS|SdS(sD Select the best ScriptWriter for this environment. twin32tjavaRçN(R¨R�R9Rãt_nameRœRb(RL((sC/usr/lib/python2.7/site-packages/setuptools/command/easy_install.pyRbLs- ccs|||fVdS(N((RLRªRãR Rh((sC/usr/lib/python2.7/site-packages/setuptools/command/easy_install.pyR©VsRTcCs/|jjƒj|ƒ}|j|ƒ|jƒS(s;Create a #! line, getting options (if any) from script_text(R¢RbR‡RŽR”(RLRhRR£((sC/usr/lib/python2.7/site-packages/setuptools/command/easy_install.pyRg[s N(RïRðRñRNRORùRáR€R¢RMRiRKR¡R�RcRøR¨R¯RbR©Rg(((sC/usr/lib/python2.7/site-packages/setuptools/command/easy_install.pyRas     RœcBsYeZeZed„ƒZed„ƒZed„ƒZed„ƒZe d„ƒZ RS(cCstjdtƒ|jƒS(NsUse best(RšRÏR›Rb(RL((sC/usr/lib/python2.7/site-packages/setuptools/command/easy_install.pyR¯fscCs2tdtd|ƒ}tjjddƒ}||S(sC Select the best ScriptWriter suitable for Windows RtnaturaltSETUPTOOLS_LAUNCHER(RËtWindowsExecutableLauncherWriterR9RàR”(RLt writer_lookuptlauncher((sC/usr/lib/python2.7/site-packages/setuptools/command/easy_install.pyRbls  c csÔtddddƒ|}|tjdjƒjdƒkr`djtƒ�}tj|t ƒnddd d d dd g}|j |ƒ|j ||ƒ}g|D]}||^q¡} ||||d | fVdS(s For Windows, add a .py extensionR¤s.pyaR¥s.pywtPATHEXTt;sK{ext} not listed in PATHEXT; scripts will not be recognized as executables.s.pys -script.pys.pycs.pyos.exeRnN( RËR9RàRRÁR©RªRšRÏt UserWarningRNt_adjust_header( RLRªRãR RhtextRåR¥RZR�((sC/usr/lib/python2.7/site-packages/setuptools/command/easy_install.pyR©ys"  cCsud}d}|dkr(||}}ntjtj|ƒtjƒ}|jd|d|ƒ}|j|ƒrq|S|S(sŠ Make sure 'pythonw' is used for gui and and 'python' is used for console (regardless of what sys.executable is). s pythonw.exes python.exeR¥RŠtrepl(RRRStescapet IGNORECASEtsubt _use_header(RLRªt orig_headerRQR½t pattern_obt new_header((sC/usr/lib/python2.7/site-packages/setuptools/command/easy_install.pyR»‰s cCs/|dd!jdƒ}tjdkp.t|ƒS(sÝ Should _adjust_header use the replaced header? On non-windows systems, always use. On Windows systems, only use the replaced header if it resolves to an executable on the system. iiÿÿÿÿt"R°(RPR¨R�R (RÄt clean_header((sC/usr/lib/python2.7/site-packages/setuptools/command/easy_install.pyRÁ—s ( RïRðR™R¢RMR¯RbR©R»RøRÁ(((sC/usr/lib/python2.7/site-packages/setuptools/command/easy_install.pyRœcs  RµcBseZed„ƒZRS(c csÍ|dkr$d}d}dg}nd}d}dddg}|j||ƒ}g|D]} || ^qX} ||||d | fV|d t|ƒd fVtƒsÉ|d } | t|ƒd fVnd S(sG For Windows, add a .py extension and an .exe launcher R¥s -script.pyws.pywtclis -script.pys.pys.pycs.pyoRns.exeR^s .exe.manifestN(R»tget_win_launcherR8tload_launcher_manifest( RLRªRãR Rht launcher_typeR¼R¥thdrRZR�tm_name((sC/usr/lib/python2.7/site-packages/setuptools/command/easy_install.pyR©¥s    (RïRðRMR©(((sC/usr/lib/python2.7/site-packages/setuptools/command/easy_install.pyRµ¤scCsGd|}tƒr(|jddƒ}n|jddƒ}td|ƒS(s« Load the Windows launcher (executable) suitable for launching a script. `type` should be either 'cli' or 'gui' Returns the executable as a byte string. s%s.exet.s-64.s-32.R§(R8RQR (ttypet launcher_fn((sC/usr/lib/python2.7/site-packages/setuptools/command/easy_install.pyRÈÈs   cCs>tjtdƒ}tjr&|tƒS|jdƒtƒSdS(Nslauncher manifest.xmlsutf-8(RR RïRtPY2tvarsRl(Rãtmanifest((sC/usr/lib/python2.7/site-packages/setuptools/command/easy_install.pyRÉØs  cCstj|||ƒS(N(RZR£(R:t ignore_errorstonerror((sC/usr/lib/python2.7/site-packages/setuptools/command/easy_install.pyR£àscCs tjdƒ}tj|ƒ|S(Ni(R9tumask(ttmp((sC/usr/lib/python2.7/site-packages/setuptools/command/easy_install.pyRoäs cCsMddl}tjj|jdƒ}|tjd sÂ"                 d           ÿÿÿÿñ  A ) ) 'l   R          T `A