� �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�RRRR9R:Rtbasedirt_loadR$t__init__RiRR�RMR#RI(R�R�RR:((sC/usr/lib/python2.7/site-packages/setuptools/command/easy_install.pyR:)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(RUt 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(RZ((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(RCRIRxRzt 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. ((RN((sC/usr/lib/python2.7/site-packages/setuptools/command/easy_install.pyRb�scCs(tjjtj�}tjjd|�S(Nt__PYVENV_LAUNCHER__(R9R:R=R�RR�R�(RNt_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(RNtparam((sC/usr/lib/python2.7/site-packages/setuptools/command/easy_install.pyt from_param�s   cCs||j�g�S(N(R�(RN((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(RNtstringR�((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_optionstoptionsR|R}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(RRVtmatchtgroupRP(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 (R|R}(R�R�((sC/usr/lib/python2.7/site-packages/setuptools/command/easy_install.pyR��s(R�R�R�R�R�R�RORbR�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(RNR�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�(RNRhRR�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( RNR�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(RTtsearchR�(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(RNt 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(RN((sC/usr/lib/python2.7/site-packages/setuptools/command/easy_install.pyRbLs- ccs|||fVdS(N((RNR�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�(RNRhRR�((sC/usr/lib/python2.7/site-packages/setuptools/command/easy_install.pyRg[s N(R�R�R�RNROR�R�R�R�RORiRKR�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(RN((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�(RNt 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( RNR�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(RTRUtescapet IGNORECASEtsubt _use_header(RNR�t orig_headerRSR�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�ROR�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( RNR�R�R�Rht launcher_typeR�R�thdrRZR�tm_name((sC/usr/lib/python2.7/site-packages/setuptools/command/easy_install.pyR��s    (R�R�ROR�(((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