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 33A7A10208
for ;
Mon, 18 Nov 2013 22:15:15 +0000 (UTC)
Received: (qmail 51999 invoked by uid 500); 18 Nov 2013 22:15:15 -0000
Delivered-To: apmail-incubator-allura-commits-archive@incubator.apache.org
Received: (qmail 51979 invoked by uid 500); 18 Nov 2013 22:15:15 -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 51971 invoked by uid 99); 18 Nov 2013 22:15:15 -0000
Received: from tyr.zones.apache.org (HELO tyr.zones.apache.org)
(140.211.11.114)
by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 18 Nov 2013 22:15:15 +0000
Received: by tyr.zones.apache.org (Postfix, from userid 65534)
id CCC9035F38; Mon, 18 Nov 2013 22:15:14 +0000 (UTC)
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
From: brondsem@apache.org
To: allura-commits@incubator.apache.org
Date: Mon, 18 Nov 2013 22:15:15 -0000
Message-Id: <98bd3a224cc8449f996ec82add057ead@git.apache.org>
In-Reply-To:
References:
X-Mailer: ASF-Git Admin Mailer
Subject: [2/2] git commit: [#6837] Strip trailing question mark from "missing
wiki" links
[#6837] Strip trailing question mark from "missing wiki" links
Signed-off-by: Cory Johns
Project: http://git-wip-us.apache.org/repos/asf/incubator-allura/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-allura/commit/5ecdd28f
Tree: http://git-wip-us.apache.org/repos/asf/incubator-allura/tree/5ecdd28f
Diff: http://git-wip-us.apache.org/repos/asf/incubator-allura/diff/5ecdd28f
Branch: refs/heads/master
Commit: 5ecdd28fccfb85b8b2315e5fc7a12c321eddff27
Parents: 50d8074
Author: Cory Johns
Authored: Mon Nov 18 21:56:08 2013 +0000
Committer: Cory Johns
Committed: Mon Nov 18 21:56:08 2013 +0000
----------------------------------------------------------------------
Allura/allura/scripts/trac_export.py | 5 +++++
ForgeImporters/forgeimporters/trac/tests/data/test-list.html | 2 +-
ForgeImporters/forgeimporters/trac/tests/test_tickets.py | 1 +
3 files changed, 7 insertions(+), 1 deletion(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/5ecdd28f/Allura/allura/scripts/trac_export.py
----------------------------------------------------------------------
diff --git a/Allura/allura/scripts/trac_export.py b/Allura/allura/scripts/trac_export.py
index 9377df3..0ca4b39 100644
--- a/Allura/allura/scripts/trac_export.py
+++ b/Allura/allura/scripts/trac_export.py
@@ -152,6 +152,7 @@ class TracExport(object):
url = self.full_url(self.TICKET_URL % id)
self.log_url(url)
d = BeautifulSoup(urlopen(url))
+ self.clean_missing_wiki_links(d)
desc = d.find('div', 'description').find('div', 'searchable')
ticket['description'] = html2text.html2text(desc.renderContents('utf8').decode('utf8')) if desc else ''
comments = []
@@ -269,6 +270,10 @@ class TracExport(object):
break
return self.get_ticket(id, extra)
+ def clean_missing_wiki_links(self, doc):
+ for link in doc.findAll('a', 'missing wiki'):
+ link.string = link.string.rstrip('?')
+
class DateJSONEncoder(json.JSONEncoder):
def default(self, obj):
http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/5ecdd28f/ForgeImporters/forgeimporters/trac/tests/data/test-list.html
----------------------------------------------------------------------
diff --git a/ForgeImporters/forgeimporters/trac/tests/data/test-list.html b/ForgeImporters/forgeimporters/trac/tests/data/test-list.html
index 9c76868..2e96702 100644
--- a/ForgeImporters/forgeimporters/trac/tests/data/test-list.html
+++ b/ForgeImporters/forgeimporters/trac/tests/data/test-list.html
@@ -209,7 +209,7 @@ To reproduce:
- main view closes, but "Scan view" is not cleared
-By itself, this is not a big problem. However, if the "Identification view" was used before closing the main file, switching from "Scan view" to "Identification view" in the "Views" window will crash TOPPView.
+By itself, this is not a big problem. However, if the "Identification view" was used before closing the main file, switching from "Scan view" to "Identification view" in the "Views" window will crash TOPPView?.
http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/5ecdd28f/ForgeImporters/forgeimporters/trac/tests/test_tickets.py
----------------------------------------------------------------------
diff --git a/ForgeImporters/forgeimporters/trac/tests/test_tickets.py b/ForgeImporters/forgeimporters/trac/tests/test_tickets.py
index c92b028..6d369e8 100644
--- a/ForgeImporters/forgeimporters/trac/tests/test_tickets.py
+++ b/ForgeImporters/forgeimporters/trac/tests/test_tickets.py
@@ -241,3 +241,4 @@ class TestTracImportSupportFunctional(TestRestApiBase, TestCase):
ticket_num=390)
self.assertIn('To reproduce: \n\\- open an mzML file', ticket.description)
self.assertIn('duplicate of: \n\\- [#316](316)', ticket.discussion_thread.find_posts()[0].text)
+ self.assertIn('will crash TOPPView.', ticket.description)