From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) by finch.gentoo.org (Postfix) with ESMTP id 12CE4138010 for ; Tue, 2 Oct 2012 19:29:13 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id D2E7A21C00D; Tue, 2 Oct 2012 19:29:05 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) by pigeon.gentoo.org (Postfix) with ESMTP id 9FFE021C00D for ; Tue, 2 Oct 2012 19:29:05 +0000 (UTC) Received: from flycatcher.gentoo.org (flycatcher.gentoo.org [81.93.255.6]) (using TLSv1 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id B23DA33C2E1 for ; Tue, 2 Oct 2012 19:29:04 +0000 (UTC) Received: from localhost.localdomain (localhost [127.0.0.1]) by flycatcher.gentoo.org (Postfix) with ESMTP id 7471220E47 for ; Tue, 2 Oct 2012 19:29:03 +0000 (UTC) From: "Alec Warner" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Alec Warner" Message-ID: <1349206105.03dd7f592879ead302d3b12ff91b4ea3ef95ce53.antarus@gentoo> Subject: [gentoo-commits] packages:master commit in: web/lib/ X-VCS-Repository: packages X-VCS-Files: web/lib/changelog_formatter.py X-VCS-Directories: web/lib/ X-VCS-Committer: antarus X-VCS-Committer-Name: Alec Warner X-VCS-Revision: 03dd7f592879ead302d3b12ff91b4ea3ef95ce53 X-VCS-Branch: master Date: Tue, 2 Oct 2012 19:29:03 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org X-Archives-Salt: 7e43ef49-2a40-4408-b6d7-c8e17aa94aa4 X-Archives-Hash: d83568ae0de5d03535a40dd9224e4dac commit: 03dd7f592879ead302d3b12ff91b4ea3ef95ce53 Author: Alec Warner gentoo org> AuthorDate: Tue Oct 2 19:28:25 2012 +0000 Commit: Alec Warner gentoo org> CommitDate: Tue Oct 2 19:28:25 2012 +0000 URL: http://sources.gentoo.org/gitweb/?p=packages.git;a=commit;h=03dd7f59 Don't prefix urls with a scheme if they already have a scheme. --- web/lib/changelog_formatter.py | 8 +++++++- 1 files changed, 7 insertions(+), 1 deletions(-) diff --git a/web/lib/changelog_formatter.py b/web/lib/changelog_formatter.py index 35dc5d7..536b0b0 100644 --- a/web/lib/changelog_formatter.py +++ b/web/lib/changelog_formatter.py @@ -1,4 +1,5 @@ import re +import urlparse from cherrypy.lib.tidy import html_break from web.lib.links import viewcvs_link, \ @@ -160,7 +161,12 @@ def _pretty_changelog_pass6(changelog): """Convert any URL markup to real links""" def markup(m): - url = 'http://'+m.group(1) + group = m.group(1) + url = urlparse.urlparse(group) + if not url.scheme: + url = 'http://' + m.group(1) + else: + url = group return '%s' % (url, url) changelog = _single_pass_re_loop(re_m_url, markup, changelog) return changelog