4 '<a href="([^"#]+)">([^<]+)</a>\n\s+\\(<a (?:title="MD5 hash"\n\s+)' 'href="[^?]+\?:action=show_md5&digest=([0-9a-f]{32})">md5</a>\\)')URL_SCHEME =
re.compile(
'([-+.a-z0-9]{2,}):',re.I).matchEXTENSIONS =
".tar.gz .tar.bz2 .tar .zip .tgz".
split()__all__ = [
'PackageIndex',
'distros_for_url',
'parse_bdist_wininst',
'interpret_distro_name',]_SOCKET_TIMEOUT = 15
def parse_bdist_wininst(name):
"""Return (base,pyversion) or (None,None) for possible .exe name""" lower = name.lower() base, py_ver, plat =
None,
None,
None if lower.endswith(
'.exe'):
if lower.endswith(
'.win32.exe'): base = name[:-10] plat =
'win32' elif lower.startswith(
'.win32-py',-16): py_ver = name[-7:-4] base = name[:-16] plat =
'win32' elif lower.endswith(
'.win-amd64.exe'): base = name[:-14] plat =
'win-amd64' elif lower.startswith(
'.win-amd64-py',-20): py_ver = name[-7:-4] base = name[:-20] plat =
'win-amd64' return base,py_ver,platdef egg_info_for_url(url): scheme, server, path, parameters, query, fragment = urlparse(url) base = unquote(path.split(
'/')[-1])
if server==
'sourceforge.net' and base==
'download':