[cig-commits] r5990 - cs/merlin/branches/v1/merlin

leif at geodynamics.org leif at geodynamics.org
Thu Feb 8 20:07:12 PST 2007


Author: leif
Date: 2007-02-08 20:07:11 -0800 (Thu, 08 Feb 2007)
New Revision: 5990

Modified:
   cs/merlin/branches/v1/merlin/package_index.py
Log:
Process "<base href=...>" HTML tags, so that Merlin can successfully
download FIAT (another Python dependency of PyLith/trunk).


Modified: cs/merlin/branches/v1/merlin/package_index.py
===================================================================
--- cs/merlin/branches/v1/merlin/package_index.py	2007-02-09 02:54:32 UTC (rev 5989)
+++ cs/merlin/branches/v1/merlin/package_index.py	2007-02-09 04:07:11 UTC (rev 5990)
@@ -10,6 +10,8 @@
 EGG_FRAGMENT = re.compile(r'^egg=([-A-Za-z0-9_.]+)$')
 HREF = re.compile("""href\\s*=\\s*['"]?([^'"> ]+)""", re.I)
 # this is here to fix emacs' cruddy broken syntax highlighting
+BASE_HREF = re.compile("""base href\\s*=\\s*['"]?([^'"> ]+)""", re.I)
+# this is here to fix emacs' cruddy broken syntax highlighting
 PYPI_MD5 = re.compile(
     '<a href="([^"#]+)">([^<]+)</a>\n\s+\\(<a (?:title="MD5 hash"\n\s+)'
     'href="[^?]+\?:action=show_md5&amp;digest=([0-9a-f]{32})">md5</a>\\)'
@@ -213,6 +215,8 @@
         if url.startswith(self.index_url) and getattr(f,'code',None)!=404:
             page = self.process_index(url, page)
 
+        for match in BASE_HREF.finditer(page):
+            base = match.group(1)
         for match in HREF.finditer(page):
             link = urlparse.urljoin(base, match.group(1))
             self.process_url(link)



More information about the cig-commits mailing list