Return-Path: X-Original-To: apmail-incubator-allura-commits-archive@minotaur.apache.org Delivered-To: apmail-incubator-allura-commits-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 2CF4A108B9 for ; Tue, 23 Jul 2013 22:36:18 +0000 (UTC) Received: (qmail 69315 invoked by uid 500); 23 Jul 2013 22:36:18 -0000 Delivered-To: apmail-incubator-allura-commits-archive@incubator.apache.org Received: (qmail 69296 invoked by uid 500); 23 Jul 2013 22:36:18 -0000 Mailing-List: contact allura-commits-help@incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: allura-dev@incubator.apache.org Delivered-To: mailing list allura-commits@incubator.apache.org Received: (qmail 69287 invoked by uid 99); 23 Jul 2013 22:36:18 -0000 Received: from tyr.zones.apache.org (HELO tyr.zones.apache.org) (140.211.11.114) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 23 Jul 2013 22:36:18 +0000 Received: by tyr.zones.apache.org (Postfix, from userid 65534) id EF6B38B2CB6; Tue, 23 Jul 2013 22:36:17 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: johnsca@apache.org To: allura-commits@incubator.apache.org Date: Tue, 23 Jul 2013 22:36:33 -0000 Message-Id: In-Reply-To: <93658d91c1b94fa9b2b08eecb557849c@git.apache.org> References: <93658d91c1b94fa9b2b08eecb557849c@git.apache.org> X-Mailer: ASF-Git Admin Mailer Subject: [17/27] git commit: [#6487] get fully qualified icon url [#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 Authored: Tue Jul 23 19:58:36 2013 +0000 Committer: Tim Van Steenburgh 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())