incubator-allura-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From john...@apache.org
Subject [17/27] git commit: [#6487] get fully qualified icon url
Date Tue, 23 Jul 2013 22:36:33 GMT
[#6487] get fully qualified icon url


Project: http://git-wip-us.apache.org/repos/asf/incubator-allura/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-allura/commit/f7c351d1
Tree: http://git-wip-us.apache.org/repos/asf/incubator-allura/tree/f7c351d1
Diff: http://git-wip-us.apache.org/repos/asf/incubator-allura/diff/f7c351d1

Branch: refs/heads/cj/6456
Commit: f7c351d1703b8bd6885e071d8bc97690db0bdc73
Parents: 0475acc
Author: Dave Brondsema <dbrondsema@slashdotmedia.com>
Authored: Tue Jul 23 19:58:36 2013 +0000
Committer: Tim Van Steenburgh <tvansteenburgh@gmail.com>
Committed: Tue Jul 23 20:49:58 2013 +0000

----------------------------------------------------------------------
 ForgeImporters/forgeimporters/google/__init__.py | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/f7c351d1/ForgeImporters/forgeimporters/google/__init__.py
----------------------------------------------------------------------
diff --git a/ForgeImporters/forgeimporters/google/__init__.py b/ForgeImporters/forgeimporters/google/__init__.py
index 49aa907..d7e341c 100644
--- a/ForgeImporters/forgeimporters/google/__init__.py
+++ b/ForgeImporters/forgeimporters/google/__init__.py
@@ -18,18 +18,21 @@
 import re
 import urllib
 import urllib2
-from urlparse import urlparse
+from urlparse import urlparse, urljoin
 from collections import defaultdict
 try:
     from cStringIO import StringIO
 except ImportError:
     from StringIO import StringIO
+import logging
 
 from BeautifulSoup import BeautifulSoup
 
 from allura import model as M
 
 
+log = logging.getLogger(__name__)
+
 class GoogleCodeProjectExtractor(object):
     RE_REPO_TYPE = re.compile(r'(svn|hg|git)')
 
@@ -61,7 +64,8 @@ class GoogleCodeProjectExtractor(object):
         self.project.short_description = self.page.find(itemprop='description').string.strip()
 
     def get_icon(self):
-        icon_url = self.page.find(itemprop='image').attrMap['src']
+        icon_url = urljoin(self.url, self.page.find(itemprop='image').attrMap['src'])
+        log.info(icon_url)
         icon_name = urllib.unquote(urlparse(icon_url).path).split('/')[-1]
         fp_ish = urllib2.urlopen(icon_url)
         fp = StringIO(fp_ish.read())


Mime
View raw message