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 A2875106A8 for ; Fri, 13 Dec 2013 05:08:19 +0000 (UTC) Received: (qmail 17540 invoked by uid 500); 13 Dec 2013 05:08:01 -0000 Delivered-To: apmail-incubator-allura-commits-archive@incubator.apache.org Received: (qmail 17208 invoked by uid 500); 13 Dec 2013 05:07:55 -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 17021 invoked by uid 99); 13 Dec 2013 05:07:53 -0000 Received: from tyr.zones.apache.org (HELO tyr.zones.apache.org) (140.211.11.114) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 13 Dec 2013 05:07:53 +0000 Received: by tyr.zones.apache.org (Postfix, from userid 65534) id 360678B7790; Fri, 13 Dec 2013 05:07:50 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: tvansteenburgh@apache.org To: allura-commits@incubator.apache.org Date: Fri, 13 Dec 2013 05:07:55 -0000 Message-Id: In-Reply-To: <1cdc7114086b40318396842283419515@git.apache.org> References: <1cdc7114086b40318396842283419515@git.apache.org> X-Mailer: ASF-Git Admin Mailer Subject: [09/45] git commit: [#6960] deal with google code bogus Content-Type header [#6960] deal with google code bogus Content-Type header Project: http://git-wip-us.apache.org/repos/asf/incubator-allura/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-allura/commit/23741763 Tree: http://git-wip-us.apache.org/repos/asf/incubator-allura/tree/23741763 Diff: http://git-wip-us.apache.org/repos/asf/incubator-allura/diff/23741763 Branch: refs/heads/tv/6942 Commit: 2374176399a84cdd2d70ca8d42cec5308aa23edc Parents: 4062227 Author: Dave Brondsema Authored: Fri Dec 6 17:41:54 2013 +0000 Committer: Dave Brondsema Committed: Fri Dec 6 17:41:54 2013 +0000 ---------------------------------------------------------------------- ForgeImporters/forgeimporters/google/__init__.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/23741763/ForgeImporters/forgeimporters/google/__init__.py ---------------------------------------------------------------------- diff --git a/ForgeImporters/forgeimporters/google/__init__.py b/ForgeImporters/forgeimporters/google/__init__.py index c4b9a99..87990d0 100644 --- a/ForgeImporters/forgeimporters/google/__init__.py +++ b/ForgeImporters/forgeimporters/google/__init__.py @@ -159,8 +159,12 @@ class GoogleCodeProjectExtractor(ProjectExtractor): return icon_name = urllib.unquote(urlparse(icon_url).path).split('/')[-1] icon = File(icon_url, icon_name) + filetype = icon.type + # work around Google Code giving us bogus file type + if filetype.startswith('text/html'): + filetype = 'image/png' M.ProjectFile.save_image( - icon_name, icon.file, icon.type, + icon_name, icon.file, filetype, square=True, thumbnail_size=(48,48), thumbnail_meta={'project_id': project._id, 'category': 'icon'})