allura-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From brond...@apache.org
Subject [2/2] git commit: [#6837] Strip trailing question mark from "missing wiki" links
Date Mon, 18 Nov 2013 22:15:15 GMT
[#6837] Strip trailing question mark from "missing wiki" links

Signed-off-by: Cory Johns <cjohns@slashdotmedia.com>


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 <cjohns@slashdotmedia.com>
Authored: Mon Nov 18 21:56:08 2013 +0000
Committer: Cory Johns <cjohns@slashdotmedia.com>
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:<br />
 - main view closes, but "Scan view" is not cleared<br />
 </p>
 <p>
-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.<br />
+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 <a class="missing wiki">TOPPView?</a>.<br />
 </p>
 
               </div>

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)


Mime
View raw message