incubator-allura-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tvansteenbu...@apache.org
Subject [4/5] git commit: [#6487] don't use google code's default icon
Date Tue, 23 Jul 2013 20:50:26 GMT
[#6487] don't use google code's default icon


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

Branch: refs/heads/master
Commit: 3e8ba0f1ca9b7a03062c7257ee271c62b873b550
Parents: 775dfc1
Author: Dave Brondsema <dbrondsema@slashdotmedia.com>
Authored: Tue Jul 23 20:15:47 2013 +0000
Committer: Tim Van Steenburgh <tvansteenburgh@gmail.com>
Committed: Tue Jul 23 20:49:59 2013 +0000

----------------------------------------------------------------------
 ForgeImporters/forgeimporters/google/__init__.py | 4 ++++
 1 file changed, 4 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/3e8ba0f1/ForgeImporters/forgeimporters/google/__init__.py
----------------------------------------------------------------------
diff --git a/ForgeImporters/forgeimporters/google/__init__.py b/ForgeImporters/forgeimporters/google/__init__.py
index f4a7b7a..17d724f 100644
--- a/ForgeImporters/forgeimporters/google/__init__.py
+++ b/ForgeImporters/forgeimporters/google/__init__.py
@@ -54,6 +54,8 @@ class GoogleCodeProjectExtractor(object):
             'Other Open Source': 'Other/Proprietary License',
         })
 
+    DEFAULT_ICON = 'http://www.gstatic.com/codesite/ph/images/defaultlogo.png'
+
     def __init__(self, project, page='project_info'):
         gc_project_name = project.get_tool_data('google-code', 'project_name')
         self.url = self.PAGE_MAP[page] % urllib.quote(gc_project_name)
@@ -65,6 +67,8 @@ class GoogleCodeProjectExtractor(object):
 
     def get_icon(self):
         icon_url = urljoin(self.url, self.page.find(itemprop='image').attrMap['src'])
+        if icon_url == self.DEFAULT_ICON:
+            return
         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