Ńņ QÜjZc@sGdZddkZddkZddkZddkZddkZddkZddkZddk Z ddk Z ddk Z ddk Tddk lZddklZyddklZWn#ej oddklZnXddklZeidƒZeid eiƒZeid ƒZeid eiƒiZd iƒZd dddgZd„Z d„Z!e"d„Z#e"d„Z$e"d„Z%e"e&e"d„Z'eideiƒZ(d„Z)dei*d e+dƒdi*fZ,d e-fd„ƒYZ.eidƒi/Z0d„Z1d „Z2d!„Z3d"„Z4d#„Z5d$„Z6dS(%s#PyPI and direct package downloadingi’’’’N(t*(tlog(tDistutilsError(tmd5(t translates^egg=([-A-Za-z0-9_.]+)$shref\s*=\s*['"]?([^'"> ]+)s([^<]+) \s+\(md5\)s([-+.a-z0-9]{2,}):s.tar.gz .tar.bz2 .tar .zip .tgzt PackageIndextdistros_for_urltparse_bdist_wininsttinterpret_distro_namecCs‚|iƒ}d \}}|idƒoP|idƒo|d }qx|iddƒo|dd!}|d }qxn||fS( s=Return (base,pyversion) or (None,None) for possible .exe names.exes .win32.exeiö’’’s .win32-pyiš’’’ił’’’iü’’’N(NN(tlowertNonetendswitht startswith(tnameR tbasetpy_ver((s</usr/lib/python2.6/site-packages/setuptools/package_index.pyRs   cCspti|ƒ\}}}}}}ti|idƒdƒ}d|jo|iddƒ\}}n||fS(Nt/i’’’’t#i(turlparseturllib2tunquotetsplit(turltschemetservertpatht parameterstquerytfragmentR((s</usr/lib/python2.6/site-packages/setuptools/package_index.pytegg_info_for_url+s ! ccsŽt|ƒ\}}xt|||ƒD] }|Vq%W|oOti|ƒ}|o5x2t||idƒ|dtƒD] }|VqsWqŠndS(sEYield egg or source distribution objects that might be found at a URLit precedenceN(Rtdistros_for_locationt EGG_FRAGMENTtmatchRtgroupt CHECKOUT_DIST(RtmetadataRRtdistR!((s</usr/lib/python2.6/site-packages/setuptools/package_index.pyR1s cCsę|idƒo|d }n|idƒo$d|joti|||ƒgS|idƒo=t|ƒ\}}|dj ot||||tdƒSnx@tD]8}|i|ƒo"|t|ƒ }t|||ƒSq¦WgS(s:Yield egg or source distribution objects based on basenames.egg.zipiü’’’s.eggt-s.exetwin32N( R t Distributiont from_locationRR Rt BINARY_DISTt EXTENSIONStlen(tlocationtbasenameR$twin_baseRtext((s</usr/lib/python2.6/site-packages/setuptools/package_index.pyR=s cCs"tt|ƒtii|ƒ|ƒS(sEYield possible egg or source distribution objects based on a filename(Rtnormalize_pathtosRR.(tfilenameR$((s</usr/lib/python2.6/site-packages/setuptools/package_index.pytdistros_for_filenameTsc csĖ|idƒ}|pMxJt|dƒD]4\}}t|ƒdjo|idƒodSq'Wnxatdt|ƒdƒD]F}t||di|| ƒdi||ƒd|d|d |ƒVq}WdS( sŲGenerate alternative interpretations of a source distro name Note: if `location` is a filesystem filename, you should call ``pkg_resources.normalize_path()`` on it before passing it to this routine! R&iispy2.Nit py_versionRtplatform(Rt enumerateR,R trangeR(tjoin( R-R.R$R5RR6tpartstitp((s</usr/lib/python2.6/site-packages/setuptools/package_index.pyR[s # ) s(<([^>]*\srel\s*=\s*['"]?([^'">]+)[^>]*)>ccsx¢ti|ƒD]‘}|iƒ\}}tti|iƒidƒƒ}d|jp d|jo>x;ti|ƒD]&}t i |t |i dƒƒƒVqsWqqWxkd D]c}|i |ƒ}|djoAti||ƒ}|o$t i |t |i dƒƒƒVqq¬q¬WdS( sEFind rel="homepage" and rel="download" links in `page`, yielding URLst,thomepagetdownloadis Home PagesDownload URLi’’’’N(s Home PagesDownload URL(tRELtfinditertgroupstmaptstrtstripR RtHREFRturljoint htmldecodeR"tfindtsearch(RtpageR!ttagtreltrelstpos((s</usr/lib/python2.6/site-packages/setuptools/package_index.pytfind_external_links€s!, sPython-urllib/%s distribute/%sit distributeicBsLeZdZdd"d„Zed„Zed„Zed„Zd„Zd„Z d „Z d „Z d#d „Z d „Zd#d „Zd„Zd„Zd„Zd„Zd„Zeeed#d„Zeed„Zd„ZdZd„Zd„Zd#d„Zd„Zd„Zd„Zd„Zd„Z d„Z!d „Z"d!„Z#RS($s;A distribution index that scans web pages for download URLsshttp://pypi.python.org/simpleRcOs}ti|||Ž|d|idƒ |_h|_h|_h|_tidi t t |ƒƒƒi |_ g|_dS(NRt|(t Environmentt__init__R t index_urlt scanned_urlst fetched_urlst package_pagestretcompileR9RCRR!tallowstto_scan(tselfRUthoststargstkw((s</usr/lib/python2.6/site-packages/setuptools/package_index.pyRT™s   'c CsM||ijo | odSt|i|%siii(R"(tm((s</usr/lib/python2.6/site-packages/setuptools/package_index.pytsRbN( RFRARRGRHR"RPRR tneed_version_infotscan_urltPYPI_MD5tsub( R]RRKR™R!R—R˜tnew_urlRtfrag((R]s</usr/lib/python2.6/site-packages/setuptools/package_index.pyRxūs")cCs|id|ƒdS(NsPPage at %s links to .py file(s) without version info; an index scan is required.(tscan_all(R]R((s</usr/lib/python2.6/site-packages/setuptools/package_index.pyRœ$scGsS|i|ijo,|o|i||Œn|idƒn|i|iƒdS(Ns6Scanning index of all packages (this may take a while)(RURWRRmR(R]R‰R_((s</usr/lib/python2.6/site-packages/setuptools/package_index.pyR¢*s  cCs±|i|i|idƒ|ii|iƒp|i|i|idƒn|ii|iƒp|i|ƒnx3t|ii|idƒƒD]}|i|ƒq–WdS(NR(( RRUt unsafe_nameRXRptkeyt project_nametnot_found_in_indexRi(R]t requirementR((s</usr/lib/python2.6/site-packages/setuptools/package_index.pyt find_packages2scCsm|iƒ|i|ƒx:||iD]+}||jo|S|id||ƒq%Wtt|ƒi||ƒS(Ns%s does not match %s(tprescanRØR¤RktsuperRtobtain(R]R§t installerR%((s</usr/lib/python2.6/site-packages/setuptools/package_index.pyR«As  cCs}tid|ƒof|id|ƒ|iƒ|djo;|iƒti|ƒtdtii |ƒdƒ‚qyndS(Nsmd5=[0-9a-f]{32}$sValidating md5 checksum for %sisMD5 validation failed for s; possible download problem?( RYR!Rkt hexdigestRqR2tunlinkRRR.(R]tcsRmR3ttfp((s</usr/lib/python2.6/site-packages/setuptools/package_index.pyt check_md5Ms  cCswxp|D]h}|idjp1t|ƒ p#|idƒptt|ƒƒo|i|ƒq|ii|ƒqWdS(s;Add `urls` to the list that will be prescanned for searchessfile:N(R\R RgR RiRRtappend(R]turlsR((s</usr/lib/python2.6/site-packages/setuptools/package_index.pytadd_find_linksXscCs.|iot|i|iƒnd|_dS(s7Scan urls scheduled for prescanning (e.g. --find-links)N(R\RCRR (R]((s</usr/lib/python2.6/site-packages/setuptools/package_index.pyR©gs cCsP||io|id}}n|id}}|||iƒ|iƒdS(Ns#Couldn't retrieve index page for %rs3Couldn't find index page for %r (maybe misspelled?)(R¤RmRR£R¢(R]R§tmethR‰((s</usr/lib/python2.6/site-packages/setuptools/package_index.pyR¦ms  cCsõt|tƒpÉt|ƒ}|o^|i|idƒ||ƒ}t|ƒ\}}|idƒo|i|||ƒ}n|Sti i |ƒo|Syti |ƒ}WqŁt j ot d|fƒ‚qŁXnt|i||ƒddƒS(sLocate and/or download `spec` to `tmpdir`, returning a local path `spec` may be a ``Requirement`` object, or a string containing a URL, an existing local filename, or a project/version requirement spec (i.e. the string form of a ``Requirement`` object). If it is the URL of a .py file with an unambiguous ``#egg=name-version`` tag (i.e., one that escapes ``-`` as ``_`` throughout), a trivial ``setup.py`` is automatically created alongside the downloaded file. If `spec` is a ``Requirement`` object or a string containing a project/version requirement spec, this method returns the location of a matching distribution (possibly after downloading it to `tmpdir`). If `spec` is a locally existing file or directory name, it is simply returned unchanged. If `spec` is a URL, it is downloaded to a subpath of `tmpdir`, and the local filename is returned. Various errors may be raised if a problem occurs during downloading. is.pys1Not a URL, existing file, or requirement spec: %rR-N(t isinstancet RequirementRgt _download_urlR"RR t gen_setupR2RR~tparset ValueErrorRRwtfetch_distributionR (R]tspecttmpdirRtfoundRR((s</usr/lib/python2.6/site-packages/setuptools/package_index.pyR?vs" c s.ˆid|ƒh‰d}d‡‡‡‡‡fd†}|o'ˆiƒˆi|ƒ||ƒ}n|dj o|p |||ƒ}n|djo*ˆidj oˆiƒ||ƒ}n|djo%| oˆi|ƒ||ƒ}n|djo%ˆidˆodpd|ƒn|S(s|Obtain a distribution suitable for fulfilling `requirement` `requirement` must be a ``pkg_resources.Requirement`` instance. If necessary, or if the `force_scan` flag is set, the requirement is searched for in the (online) package index as well as the locally installed packages. If a distribution matching `requirement` is found, the returned distribution's ``location`` is the value you would have gotten from calling the ``download()`` method with the matching distribution's URL or filename. If no matching distribution is found, ``None`` is returned. If the `source` flag is set, only source distributions and source checkout links will be considered. Unless the `develop_ok` flag is set, development and system eggs (i.e., those using the ``.egg-info`` format) will be ignored. sSearching for %scsŅ|djo ˆ}nx“||iD]„}|itjo:ˆ o2|ˆjoˆid|ƒdˆ| i c CsĀ|id|ƒd \}}}zqd|jo|iddƒ\}}n|i|ƒ}t|tiƒo#td||i|i fƒ‚nt ƒ}|iƒ}d}|i } d} d|jo-t |dƒ} |i |||| | ƒnt|d ƒ}xdto\|i| ƒ} | oA|i| ƒ|i| ƒ|d7}|i |||| | ƒqPqW|o|i||||ƒn|SWd|o|iƒn|o|iƒnXdS( NsDownloading %sRisCan't download %s: %s %sii’’’’scontent-lengthsContent-Lengthtwb(NNN(RmR RRnR¶Rt HTTPErrorRReR‰Rt dl_blocksizetintt reporthookRRfRrtupdateRŃR±Rq( R]RR3tfpR°RmRÆRotblocknumtbstsizetblock((s</usr/lib/python2.6/site-packages/setuptools/package_index.pyt _download_to"sD         cCsdS(N((R]RR3RŻtblksizeRß((s</usr/lib/python2.6/site-packages/setuptools/package_index.pyRŚFscCs®|idƒo t|ƒSyt|ƒSWn~ttifj om}dig}|iD]}|t|ƒqY~ƒ}|o|i ||ƒqŖt d||fƒ‚nžt i j o }|St i j o@}|o|i ||iƒqŖt d||ifƒ‚n˜tij o@}|o|i ||iƒqŖt d||ifƒ‚nJtij o:}|o|i ||ƒqŖt d||fƒ‚nXdS(Nsfile:t s%s %ssDownload error for %s: %ss;%s returned a bad status line. The server might be down, %s(R t local_opentopen_with_authR»thttplibt InvalidURLR9R_RDRRRR×tURLErrortreasont BadStatusLinetlinet HTTPException(R]RtwarningtvRÓtargR‰((s</usr/lib/python2.6/site-packages/setuptools/package_index.pyRnJs4 3cCs tdti|ƒdidƒƒ}|oA|d}x:d|jo"|iddƒiddƒ}q9Wnd}|id ƒo|d }ntii||ƒ}|d jp|i d ƒo|i ||ƒS|d jot i ti|ƒdƒS|i |tƒ|i||ƒSdS(NiRi’’’’s..t.s\t_t__downloaded__s.egg.zipiü’’’tsvnssvn+R†(RŽR RRtreplaceR R2RR9R t _download_svnRt url2pathnameRjRft_attempt_download(R]RRR¾R R3((s</usr/lib/python2.6/site-packages/setuptools/package_index.pyRøks %  ' cCs|i|tƒdS(N(RyRf(R]R((s</usr/lib/python2.6/site-packages/setuptools/package_index.pyR‡scCsM|i||ƒ}d|iddƒiƒjo|i|||ƒS|SdS(NRas content-typeRb(RįRpR t_download_html(R]RR3Ro((s</usr/lib/python2.6/site-packages/setuptools/package_index.pyR÷‹scCs•t|ƒ}x[|D]S}|iƒo@tid|ƒo(|iƒti|ƒ|i||ƒSPqqW|iƒti|ƒtd|ƒ‚dS(Ns ([^- ]+ - )?Revision \d+:s���Unexpected HTML page found at ( ���R���RE���RY���RJ���Rq���R2���R®���Rõ���R���(���R]���R���Ro���R3���R†���Rė���(����(����s<���/usr/lib/python2.6/site-packages/setuptools/package_index.pyRų���’��s���� �      c���������C���sD���|�i��d�d�ƒ�d�}�|��i�d�|�|�ƒ�t�i�d�|�|�f�ƒ�|�S(���NR���i���i����s'���Doing subversion checkout from %s to %ss���svn checkout -q %s %s(���R���Rm���R2���t���system(���R]���R���R3���(����(����s<���/usr/lib/python2.6/site-packages/setuptools/package_index.pyRõ���”��s����c���������G���s���t��i�|�|�Œ�d��S(���N(���R���Rk���(���R]���R‰���R_���(����(����s<���/usr/lib/python2.6/site-packages/setuptools/package_index.pyRk���§��s����c���������G���s���t��i�|�|�Œ�d��S(���N(���R���Rm���(���R]���R‰���R_���(����(����s<���/usr/lib/python2.6/site-packages/setuptools/package_index.pyRm���Ŗ��s����c���������G���s���t��i�|�|�Œ�d��S(���N(���R���R���(���R]���R‰���R_���(����(����s<���/usr/lib/python2.6/site-packages/setuptools/package_index.pyR���­��s����(���R����N($���t���__name__t ���__module__t���__doc__RT���t���FalseRy���Rh���Rj���R���RŠ���Rx���Rœ���R ���R¢���RØ���R«���R±���R“���R©���R¦���R?���R¼���RÉ���R¹���RŲ���Rį���RŚ���Rn���Rø���R���R÷���Rų���Rõ���Rk���Rm���R���(����(����(����s<���/usr/lib/python2.6/site-packages/setuptools/package_index.pyR���–���sB��� ,    )      *  C ) $  !       s!���&(#(\d+|x[\da-fA-F]+)|[\w.:-]+);?c���������C���s7���t��|��t�ƒ�p�|��S|��d�j�o �t�|��ƒ�St�|��ƒ�S(���Ni’���(���R¶���RŁ���t���unichrt���chr(���t���c(����(����s<���/usr/lib/python2.6/site-packages/setuptools/package_index.pyt���uchr“��s ���� � c���������C���s���|��i��d�ƒ�}�|�i�d�ƒ�o�t�|�d�d�ƒ�}�nP�|�i�d�ƒ�o�t�|�d�ƒ�}�n,�d�d�k�l�}�|�i�|�|��i��d�ƒ�ƒ�}�t�|�ƒ�S( ���Ni���s���#xi���i���R���i’’’’(���t���name2codepointi����(���R"���R ���RŁ���t���htmlentitydefsR��Rp���R��(���R!���t���whatR��(����(����s<���/usr/lib/python2.6/site-packages/setuptools/package_index.pyt ���decode_entityŗ��s����c���������C���s ���t��t�|��ƒ�S(���s'���Decode HTML entities in the given text.(���t ���entity_subR��(���t���text(����(����s<���/usr/lib/python2.6/site-packages/setuptools/package_index.pyRH���Å��s����c���������C���s]��t��i��|��ƒ�\�}�}�}�}�}�}�|�d�j�o�t�i�|�ƒ�\�}�}�n�d�}�|�of�d�t�i�|�ƒ�i�d�ƒ�i�ƒ��}�t��i�|�|�|�|�|�|�f�ƒ�} �t�i�| �ƒ�} �| �i �d�|�ƒ�n�t�i�|��ƒ�} �| �i �d�t �ƒ�t�i �| �ƒ�} �|�oj�t��i��| �i �ƒ�\�} �} �}�}�}�}�| �|�j�o5�| �|�j�o(�t��i�| �|�|�|�|�|�f�ƒ�| �_ �qYn�| �S( ���s4���Open a urllib2 request, handling HTTP authenticationt���httpt���httpss���Basic t���base64t ���Authorizations ���User-Agent(���R��R ��N( ���R���R���t ���splituserR ���R���t���encodeRE���t ���urlunparset���Requestt ���add_headert ���user_agentt���urlopenR���(���R���R���t���netlocR���t���paramsR���R”���t���autht���hostR ���t���requestRÜ���t���s2t���h2t���path2t���param2t���query2t���frag2(����(����s<���/usr/lib/python2.6/site-packages/setuptools/package_index.pyRå���Ł��s"����! "!$,c���������C���s���|��S(���N(����(���R���(����(����s<���/usr/lib/python2.6/site-packages/setuptools/package_index.pyt ���fix_sf_url��s����c������ ���C���s„��t��i��|��ƒ�\�}�}�}�}�}�}�t�i�|�ƒ�}�t�i�i�|�ƒ�o�t�i�|��ƒ�S|�i�d�ƒ�oė�t�i�i�|�ƒ�oŲ�g��}�xæ�t�i �|�ƒ�D]“�} �| �d�j�o9�t �t�i�i �|�| �ƒ�d�ƒ�} �| �i �ƒ��} �| �i �ƒ��Pn1�t�i�i�t�i�i �|�| �ƒ�ƒ�o�| �d�7} �n�|�i�d�| �| �f�ƒ�qŠ�Wd�|��d�d�i �|�ƒ�} �d�\�} �} �n�d�\�} �} �} �t�i�|��| �| �h�d �d�6t�i�| �ƒ�ƒ�S(���s7���Read a local path, with special support for directoriesR���s ���index.htmlt���rbs���<a href=%r>%s</a>s���<html><head><title>%ss%ss iČtOKi”sPath not founds Not founds text/htmls content-type(iČR (i”sPath not founds Not found(RRRöR2RtisfileRR R€R‚RR9RrRqR²R×t cStringIOtStringIO(RRRRtparamRR”R3tfilesR|RÜtbodytstatustmessage((s</usr/lib/python2.6/site-packages/setuptools/package_index.pyRäs,!#   "(7RüRstos.pathR2RYRRRĻtrandomtsocketR"Ręt pkg_resourcest distutilsRtdistutils.errorsRthashlibRt ImportErrortfnmatchRRZR tIRFRžR!RgRR+t__all__RRR RRR4R‘RR@RPRĢtrequireRRSRRŸRRRRHRåRRä(((s</usr/lib/python2.6/site-packages/setuptools/package_index.pytsLl          ! !’’   )