;ò e…ÝFc@sãdZdkZdkZdkZdkZdkZdkZdkZdk Z dk Z dk Tdk l Z dklZdklZdklZeidƒZeideiƒZeid ƒZeid eiƒiZd iƒZd d ddgZd„Zd„Zed„Z ed„Z!ed„Z"ee#ed„Z$eideiƒZ%d„Z&dei'e(dƒdi)fZ*d e+fd„ƒYZ,eidƒi-Z.d„Z/d„Z0d„Z1d „Z2d!„Z3d"„Z4dS(#s#PyPI and direct package downloadingN(s*(slog(sDistutilsError(smd5(s translates^egg=([-A-Za-z0-9_.]+)$shref\s*=\s*['"]?([^'"> ]+)s([^<]+) \s+\(md5\)s([-+.a-z0-9]{2,}):s.tar.gz .tar.bz2 .tar .zip .tgzs PackageIndexsdistros_for_urlsparse_bdist_wininstsinterpret_distro_namecCsŒ|iƒ}ttf\}}|idƒoP|idƒo|d }q~|iddƒo|dd!}|d }q~n||fSdS( s=Return (base,pyversion) or (None,None) for possible .exe names.exes .win32.exeiöÿÿÿs .win32-pyiðÿÿÿiùÿÿÿiüÿÿÿN(snameslowersNonesbasespy_versendswiths startswith(snameslowersbasespy_ver((sX/mnt/gmirror/ports/devel/py-setuptools/work/setuptools-0.6c7/setuptools/package_index.pysparse_bdist_wininsts  cCstti|ƒ\}}}}}}ti |i dƒdƒ}d|jo|i ddƒ\}}n||fSdS(Ns/iÿÿÿÿs#i( surlparsesurlsschemesserverspaths parameterssquerysfragmentsurllib2sunquotessplitsbase(surls parameterssserversfragmentsbasesqueryspathsscheme((sX/mnt/gmirror/ports/devel/py-setuptools/work/setuptools-0.6c7/setuptools/package_index.pysegg_info_for_url*s ! ccsŒt|ƒ\}}xt|||ƒD] }|Vq%W|oNti|ƒ}|o4x1t ||i dƒ|dt ƒD] }|VqrWqˆndS(sEYield egg or source distribution objects that might be found at a URLis precedenceN( segg_info_for_urlsurlsbasesfragmentsdistros_for_locationsmetadatasdists EGG_FRAGMENTsmatchsinterpret_distro_namesgroups CHECKOUT_DIST(surlsmetadatasdistsfragmentsbasesmatch((sX/mnt/gmirror/ports/devel/py-setuptools/work/setuptools-0.6c7/setuptools/package_index.pysdistros_for_url0s"cCsó|idƒo|d }n|idƒo d|joti|||ƒgSn|idƒo@t|ƒ\}}|t j ot ||||t dƒSq¥nxCt D];}|i|ƒo%|t|ƒ }t |||ƒSq¬q¬WgSdS(s:Yield egg or source distribution objects based on basenames.egg.zipiüÿÿÿs.eggs-s.exeswin32N(sbasenamesendswiths Distributions from_locationslocationsmetadatasparse_bdist_wininstswin_basespy_versNonesinterpret_distro_names BINARY_DISTs EXTENSIONSsextslen(slocationsbasenamesmetadatasextswin_basespy_ver((sX/mnt/gmirror/ports/devel/py-setuptools/work/setuptools-0.6c7/setuptools/package_index.pysdistros_for_location<s !cCs&tt|ƒtii|ƒ|ƒSdS(sEYield possible egg or source distribution objects based on a filenameN(sdistros_for_locationsnormalize_pathsfilenamesosspathsbasenamesmetadata(sfilenamesmetadata((sX/mnt/gmirror/ports/devel/py-setuptools/work/setuptools-0.6c7/setuptools/package_index.pysdistros_for_filenameSsc csÎ|idƒ}| oPxMt|dƒD]7\}}t|ƒdjo |idƒodSq(q(Wnx`t dt|ƒdƒD]E}t ||di || ƒdi ||ƒd|d|d |ƒVqWdS( 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! s-iispy2.Nis py_versions precedencesplatform(sbasenamessplitspartss py_versions enumeratesispslens startswithsranges Distributionslocationsmetadatasjoins precedencesplatform( slocationsbasenamesmetadatas py_versions precedencesplatformspsisparts((sX/mnt/gmirror/ports/devel/py-setuptools/work/setuptools-0.6c7/setuptools/package_index.pysinterpret_distro_nameZs  #) s(<([^>]*\srel\s*=\s*['"]?([^'">]+)[^>]*)>ccsx¡ti|ƒD]}|iƒ\}}tti |i ƒi dƒƒ}d|jp d|jo=x:t i|ƒD]%}ti|t|idƒƒƒVqsWqqWxpddfD]b}|i|ƒ}|djo@t i||ƒ}|o#ti|t|idƒƒƒVqq±q±WdS( sEFind rel="homepage" and rel="download" links in `page`, yielding URLss,shomepagesdownloadis Home PagesDownload URLiÿÿÿÿN(sRELsfinditerspagesmatchsgroupsstagsrelsmapsstrsstripslowerssplitsrelssHREFsurlparsesurljoinsurls htmldecodesgroupsfindsposssearch(surlspagesrelspossrelsstagsmatch((sX/mnt/gmirror/ports/devel/py-setuptools/work/setuptools-0.6c7/setuptools/package_index.pysfind_external_linkss !+  sPython-urllib/%s setuptools/%ss setuptoolsicBsLtZdZddfd„Zed„Zed„Zed„Zd„Zd„Z d „Z d „Z e d „Z d „Ze d „Zd„Zd„Zd„Zd„Zd„Zeeed„Zeed„Zd„ZdZd„Zd„Ze 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/simples*cOs}ti|||Ž|d|idƒ |_h|_h|_h|_ t i di t t|ƒƒƒi|_g|_dS(Ns/s|(s Environments__init__sselfsargsskws index_urlsendswiths scanned_urlss fetched_urlss package_pagessrescompilesjoinsmaps translateshostssmatchsallowssto_scan(sselfs index_urlshostssargsskw((sX/mnt/gmirror/ports/devel/py-setuptools/work/setuptools-0.6c7/setuptools/package_index.pys__init__˜s   'c Cs&||ijo| odSnt|i|%siii(smsgroup(sm((sX/mnt/gmirror/ports/devel/py-setuptools/work/setuptools-0.6c7/setuptools/package_index.pysssN(sscansHREFsfinditerspagesmatchsurlparsesurljoinsurls htmldecodesgroupspkgsversfind_external_linkssnew_urlsegg_info_for_urlsbasesfragsendswithsselfsneed_version_infosscan_urlsPYPI_MD5ssub( sselfsurlspagesfragsversscansnew_urlspkgsbasesmatch((sselfsX/mnt/gmirror/ports/devel/py-setuptools/work/setuptools-0.6c7/setuptools/package_index.pys process_index÷s" )cCs|id|ƒdS(NsPPage at %s links to .py file(s) without version info; an index scan is required.(sselfsscan_allsurl(sselfsurl((sX/mnt/gmirror/ports/devel/py-setuptools/work/setuptools-0.6c7/setuptools/package_index.pysneed_version_info s cGsS|i|ijo,|o|i||Œn|idƒn|i|iƒdS(Ns6Scanning index of all packages (this may take a while)(sselfs index_urls fetched_urlssmsgswarnsargssinfosscan_url(sselfsmsgsargs((sX/mnt/gmirror/ports/devel/py-setuptools/work/setuptools-0.6c7/setuptools/package_index.pysscan_all&s cCs³|i|i|idƒ|ii|iƒ o|i|i|idƒn|ii|iƒ o|i |ƒnx3t |ii|ifƒƒD]}|i|ƒq˜WdS(Ns/( sselfsscan_urls index_urls requirements unsafe_names package_pagessgetskeys project_namesnot_found_in_indexslistsurl(sselfs requirementsurl((sX/mnt/gmirror/ports/devel/py-setuptools/work/setuptools-0.6c7/setuptools/package_index.pys find_packages.scCst|iƒ|i|ƒx=||iD].}||jo|Sn|id||ƒq%Wtt|ƒi ||ƒSdS(Ns%s does not match %s( sselfsprescans find_packagess requirementskeysdistsdebugssupers PackageIndexsobtains installer(sselfs requirements installersdist((sX/mnt/gmirror/ports/devel/py-setuptools/work/setuptools-0.6c7/setuptools/package_index.pysobtain=s cCs}tid|ƒof|id|ƒ|iƒ|djo;|i ƒt i |ƒt dt i i|ƒdƒ‚qyndS(Nsmd5=[0-9a-f]{32}$sValidating md5 checksum for %sisMD5 validation failed for s; possible download problem?(sresmatchsinfosselfsdebugsfilenamescss hexdigeststfpsclosesossunlinksDistutilsErrorspathsbasename(sselfscssinfosfilenamestfp((sX/mnt/gmirror/ports/devel/py-setuptools/work/setuptools-0.6c7/setuptools/package_index.pys check_md5Is   cCswxp|D]h}|itjp.t|ƒ p |idƒptt|ƒƒo|i |ƒq|ii |ƒqWdS(s;Add `urls` to the list that will be prescanned for searchessfile:N( surlssurlsselfsto_scansNones URL_SCHEMEs startswithslistsdistros_for_urlsscan_urlsappend(sselfsurlssurl((sX/mnt/gmirror/ports/devel/py-setuptools/work/setuptools-0.6c7/setuptools/package_index.pysadd_find_linksTs AcCs.|iot|i|iƒnt|_dS(s7Scan urls scheduled for prescanning (e.g. --find-links)N(sselfsto_scansmapsscan_urlsNone(sself((sX/mnt/gmirror/ports/devel/py-setuptools/work/setuptools-0.6c7/setuptools/package_index.pysprescancs cCsZ||io|idf\}}n|idf\}}|||iƒ|iƒdS(Ns#Couldn't retrieve index page for %rs3Couldn't find index page for %r (maybe misspelled?)( sselfs requirementskeysinfosmethsmsgswarns unsafe_namesscan_all(sselfs requirementsmsgsmeth((sX/mnt/gmirror/ports/devel/py-setuptools/work/setuptools-0.6c7/setuptools/package_index.pysnot_found_in_indexis cCst|tƒ oÏt|ƒ}|oa|i|idƒ||ƒ}t |ƒ\}}|i dƒo|i|||ƒ}n|Sqàtii|ƒo|Sqàyti|ƒ}Wqàtj otd|fƒ‚qàXnt|i||ƒdtƒSdS(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: %rslocationN(s isinstancesspecs Requirements URL_SCHEMEsschemesselfs _download_urlsgroupstmpdirsfoundsegg_info_for_urlsbasesfragmentsendswiths gen_setupsosspathsexistssparses ValueErrorsDistutilsErrorsgetattrsfetch_distributionsNone(sselfsspecstmpdirsfragmentsbasesfoundsscheme((sX/mnt/gmirror/ports/devel/py-setuptools/work/setuptools-0.6c7/setuptools/package_index.pysdownloadrs  c sÿˆid|ƒh‰‡‡‡‡‡d†}|oˆiƒˆi|ƒn||ƒ}|t jo ˆi t j oˆiƒ||ƒ}n|t jo| oˆi|ƒ||ƒ}n|t jo%ˆi dˆodpd|ƒn|SdS(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¾x·ˆ|iD]¨}|itjoˆ o2|ˆjoˆid|ƒdˆ|Revision \d+:sUnexpected HTML page found at (sopensfilenamesfileslinesstripsressearchsclosesossunlinksselfs _download_svnsurlsDistutilsError(sselfsurlsheaderssfilenamesfilesline((sX/mnt/gmirror/ports/devel/py-setuptools/work/setuptools-0.6c7/setuptools/package_index.pys_download_htmlss       cCsH|iddƒd}|id||ƒtid||fƒ|SdS(Ns#iis'Doing subversion checkout from %s to %sssvn checkout -q %s %s(surlssplitsselfsinfosfilenamesosssystem(sselfsurlsfilename((sX/mnt/gmirror/ports/devel/py-setuptools/work/setuptools-0.6c7/setuptools/package_index.pys _download_svn‚scGsti||ŒdS(N(slogsdebugsmsgsargs(sselfsmsgsargs((sX/mnt/gmirror/ports/devel/py-setuptools/work/setuptools-0.6c7/setuptools/package_index.pysdebugˆscGsti||ŒdS(N(slogsinfosmsgsargs(sselfsmsgsargs((sX/mnt/gmirror/ports/devel/py-setuptools/work/setuptools-0.6c7/setuptools/package_index.pysinfo‹scGsti||ŒdS(N(slogswarnsmsgsargs(sselfsmsgsargs((sX/mnt/gmirror/ports/devel/py-setuptools/work/setuptools-0.6c7/setuptools/package_index.pyswarnŽs($s__name__s __module__s__doc__s__init__sFalses process_urlsprocess_filenamesurl_oksscan_egg_linkss scan_egg_links process_indexsneed_version_infosNonesscan_alls find_packagessobtains check_md5sadd_find_linkssprescansnot_found_in_indexsdownloadsfetch_distributionsfetchs gen_setups dl_blocksizes _download_tos reporthooksopen_urls _download_urlsscan_urls_attempt_downloads_download_htmls _download_svnsdebugsinfoswarn(((sX/mnt/gmirror/ports/devel/py-setuptools/work/setuptools-0.6c7/setuptools/package_index.pys PackageIndex•s@  )   )      )> ) $        s!&(#(\d+|x[\da-fA-F]+)|[\w.:-]+);?cCsBt|tƒ o|Sn|djot|ƒSnt|ƒSdS(Niÿ(s isinstancescsintsunichrschr(sc((sX/mnt/gmirror/ports/devel/py-setuptools/work/setuptools-0.6c7/setuptools/package_index.pysuchr•s  cCs|idƒ}|idƒot|ddƒ}nM|idƒot|dƒ}n)dkl}|i||idƒƒ}t|ƒSdS(Nis#xiis#(sname2codepointi( smatchsgroupswhats startswithsintshtmlentitydefssname2codepointsgetsuchr(smatchswhatsname2codepoint((sX/mnt/gmirror/ports/devel/py-setuptools/work/setuptools-0.6c7/setuptools/package_index.pys decode_entity›s cCstt|ƒSdS(s'Decode HTML entities in the given text.N(s entity_subs decode_entitystext(stext((sX/mnt/gmirror/ports/devel/py-setuptools/work/setuptools-0.6c7/setuptools/package_index.pys htmldecode¦scCsgti|ƒ\}} }}}} |ddfjoti | ƒ\} } nt } | ofdti | ƒidƒiƒ} ti|| |||| fƒ}ti|ƒ}|id| ƒnti|ƒ}|idtƒti|ƒ}| ojti|iƒ\}}}}} }||jo || jo(ti|| ||| |fƒ|_q_n|SdS(s4Open a urllib2 request, handling HTTP authenticationshttpshttpssBasic sbase64s Authorizations User-AgentN(surlparsesurlsschemesnetlocspathsparamssquerysfragsurllib2s splitusersauthshostsNonesunquotesencodesstrips urlunparsesnew_urlsRequestsrequests add_headers user_agentsurlopensfpss2sh2spath2sparam2squery2sfrag2(surlsfpsh2squeryss2snew_urlsparamssschemesparam2sfragsquery2snetlocsauthshostspathspath2srequestsfrag2((sX/mnt/gmirror/ports/devel/py-setuptools/work/setuptools-0.6c7/setuptools/package_index.pysopen_with_authºs$!"!$,cCs|SdS(N(surl(surl((sX/mnt/gmirror/ports/devel/py-setuptools/work/setuptools-0.6c7/setuptools/package_index.pys fix_sf_urlãsc CsŒti|ƒ\} }} }} }ti | ƒ}t ii |ƒoti |ƒSn | idƒot ii|ƒoÎg}x¯t i|ƒD]ƒ}|djo)tt ii||ƒdƒiƒ}Pn1t iit ii||ƒƒo|d7}n|id||fƒqWd|ddi|ƒ}dd f\}} nd d d f\}} }ti||| hd d%ss%ss%ss iÈsOKi”sPath not founds Not founds content-types text/htmlN(surlparsesurlsschemesserverspathsparamsquerysfragsurllib2s url2pathnamesfilenamesossisfilesurlopensendswithsisdirsfilesslistdirsfsopensjoinsreadsbodysappendsstatussmessages HTTPErrors cStringIOsStringIO( surlsfragsfilessfsbodysfilenamesparamsserversstatussqueryspathsmessagesscheme((sX/mnt/gmirror/ports/devel/py-setuptools/work/setuptools-0.6c7/setuptools/package_index.pys local_openæs(!# $"(5s__doc__ssyssos.pathsossresurlparsesurllib2sshutilsrandomssockets cStringIOs pkg_resourcess distutilsslogsdistutils.errorssDistutilsErrorsmd5sfnmatchs translatescompiles EGG_FRAGMENTsIsHREFsPYPI_MD5smatchs URL_SCHEMEssplits EXTENSIONSs__all__sparse_bdist_wininstsegg_info_for_urlsNonesdistros_for_urlsdistros_for_locationsdistros_for_filenames SOURCE_DISTsinterpret_distro_namesRELsfind_external_linkss __version__srequiresversions user_agents Environments PackageIndexssubs entity_subsuchrs decode_entitys htmldecodesopen_with_auths fix_sf_urls local_open($s cStringIOsrandomsHREFsRELsPYPI_MD5sshutilsfind_external_linkssdistros_for_urls EGG_FRAGMENTsuchrslogs__all__sparse_bdist_wininstsegg_info_for_urls decode_entitys entity_subsres EXTENSIONSs translatesdistros_for_locations local_opens PackageIndexs fix_sf_urlsurllib2ssyssdistros_for_filenamesDistutilsErrorsmd5sinterpret_distro_namessockets URL_SCHEMEsurlparses user_agentsopen_with_authsoss htmldecode((sX/mnt/gmirror/ports/devel/py-setuptools/work/setuptools-0.6c7/setuptools/package_index.pys?s<Q         "  ÿÿ   )