aboutsummaryrefslogtreecommitdiffstats
path: root/setuptools/package_index.py
diff options
context:
space:
mode:
authorDirley Rodrigues <dirleyrls@gmail.com>2013-02-04 11:39:28 -0200
committerDirley Rodrigues <dirleyrls@gmail.com>2013-02-04 11:39:28 -0200
commit116420fe62842f18f2d37de46c2177028231755a (patch)
tree6e4ad16da061a1b793f158acb24826194093937e /setuptools/package_index.py
parente3207bd63bcf365a1f91b7c3e75a4b3354435501 (diff)
downloadexternal_python_setuptools-116420fe62842f18f2d37de46c2177028231755a.tar.gz
external_python_setuptools-116420fe62842f18f2d37de46c2177028231755a.tar.bz2
external_python_setuptools-116420fe62842f18f2d37de46c2177028231755a.zip
avoid naming problems
--HG-- branch : distribute extra : rebase_source : 29eeb99013055b8d27cad7f7e8898d06a865b188
Diffstat (limited to 'setuptools/package_index.py')
-rwxr-xr-xsetuptools/package_index.py14
1 files changed, 7 insertions, 7 deletions
diff --git a/setuptools/package_index.py b/setuptools/package_index.py
index 4393c83a..984feef4 100755
--- a/setuptools/package_index.py
+++ b/setuptools/package_index.py
@@ -139,25 +139,25 @@ REL = re.compile("""<([^>]*\srel\s*=\s*['"]?([^'">]+)[^>]*)>""", re.I)
def find_external_links(url, page):
"""Find rel="homepage" and rel="download" links in `page`, yielding URLs"""
- seen = set()
+ seen_links = set()
for match in REL.finditer(page):
tag, rel = match.groups()
rels = map(str.strip, rel.lower().split(','))
if 'homepage' in rels or 'download' in rels:
for match in HREF.finditer(tag):
- url = urlparse.urljoin(url, htmldecode(match.group(1)))
- if not url in seen:
- yield url
+ link = urlparse.urljoin(url, htmldecode(match.group(1)))
+ if not link in seen_links:
+ yield link
for tag in ("<th>Home Page", "<th>Download URL"):
pos = page.find(tag)
if pos!=-1:
match = HREF.search(page,pos)
if match:
- url = urlparse.urljoin(url, htmldecode(match.group(1)))
- if not url in seen:
- yield url
+ link = urlparse.urljoin(url, htmldecode(match.group(1)))
+ if not link in seen_links:
+ yield link
user_agent = "Python-urllib/%s distribute/%s" % (