easy_install: fix for new Sourceforge download pages
Hi, since Sourceforge did change their download pages, easy_install is no longer able to fetch files there-from. Shame in Sourceforge! For one of my tools I fixed this using the following code: ......8<--------------- def _download_html(self, url, headers, filename): if url.startswith('http://sourceforge.net/projects/'): if self._download_from_sf(url, filename): return return PackageIndex._download_html(self, url, headers, filename) def _download_from_sf(self, url, filename): page = open(filename).read() basename = os.path.basename(filename) for match in HREF.finditer(page): link = urlparse.urljoin(url, htmldecode(match.group(1))) if link.startswith('http://downloads.sourceforge.net/sourceforge/'): path = urlparse.urlparse(url)[2] base = urllib2.unquote(path.split('/')[-1]) if base == basename: os.unlink(filename) self._download_to(link, filename) return True return False ......8<--------------- -- Schönen Gruß - Regards Hartmut Goebel Dipl.-Informatiker (univ.), CISSP, CSSLP Goebel Consult Spezialist für IT-Sicherheit in komplexen Umgebungen http://www.goebel-consult.de
participants (1)
-
Hartmut Goebel