gtg team mailing list archive
-
gtg team
-
Mailing list archive
-
Message #03579
[Merge] lp:~izidor/gtg/bug1023555 into lp:gtg
Izidor Matušov has proposed merging lp:~izidor/gtg/bug1023555 into lp:gtg.
Requested reviews:
Gtg developers (gtg)
Related bugs:
Bug #1023555 in Getting Things GNOME!: "Ampersands in URL fragment segments are not treated as part of the URL"
https://bugs.launchpad.net/gtg/+bug/1023555
For more details, see:
https://code.launchpad.net/~izidor/gtg/bug1023555/+merge/114648
Fix for bug #1023555 and creatign a test case for it.
--
https://code.launchpad.net/~izidor/gtg/bug1023555/+merge/114648
Your team Gtg developers is requested to review the proposed merge of lp:~izidor/gtg/bug1023555 into lp:gtg.
=== added file 'GTG/tests/test_urlregex.py'
--- GTG/tests/test_urlregex.py 1970-01-01 00:00:00 +0000
+++ GTG/tests/test_urlregex.py 2012-07-12 14:10:46 +0000
@@ -0,0 +1,36 @@
+# -*- coding: utf-8 -*-
+# -----------------------------------------------------------------------------
+# Gettings Things Gnome! - a personal organizer for the GNOME desktop
+# Copyright (c) 2008-2012 - Lionel Dricot & Bertrand Rousseau
+#
+# This program is free software: you can redistribute it and/or modify it under
+# the terms of the GNU General Public License as published by the Free Software
+# Foundation, either version 3 of the License, or (at your option) any later
+# version.
+#
+# This program is distributed in the hope that it will be useful, but WITHOUT
+# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+# FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
+# details.
+#
+# You should have received a copy of the GNU General Public License along with
+# this program. If not, see <http://www.gnu.org/licenses/>.
+# -----------------------------------------------------------------------------
+
+""" Tests for URL regex """
+
+import unittest
+from GTG.tools.urlregex import match
+
+
+class TestURLRegex(unittest.TestCase):
+ """ Test extractor of URL from text """
+
+ def test_anchor_amperstand(self):
+ """ Reproducer for bug #1023555 """
+ url = "http://test.com/#hi&there"
+ self.assertEqual(match(url).group(0), url)
+
+
+def test_suite():
+ return unittest.TestLoader().loadTestsFromName(__name__)
=== modified file 'GTG/tools/urlregex.py'
--- GTG/tools/urlregex.py 2012-03-05 15:23:05 +0000
+++ GTG/tools/urlregex.py 2012-07-12 14:10:46 +0000
@@ -1,7 +1,7 @@
# -*- coding: utf-8 -*-
# -----------------------------------------------------------------------------
# Gettings Things Gnome! - a personal organizer for the GNOME desktop
-# Copyright (c) 2008-2009 - Lionel Dricot & Bertrand Rousseau
+# Copyright (c) 2008-2012 - Lionel Dricot & Bertrand Rousseau
#
# This program is free software: you can redistribute it and/or modify it under
# the terms of the GNU General Public License as published by the Free Software
@@ -31,7 +31,7 @@
SUBST_DICT = {
"pre": ur'(?:[^/"\':!=]|^|\:)',
"domain": ur'([\.-]|[^\s_\!\.\/])+\.[a-z]{2,}(?::[0-9]+)?',
- "path":ur'(?:[\.,]?[%s!\*\'\(\);:=\+\$/%s#\[\]\-_,~@])' % (UTF_CHARS, '%'),
+ "path":ur'(?:[\.,]?[%s!\*\'\(\);:&=\+\$/%s#\[\]\-_,~@])' % (UTF_CHARS, '%'),
"query": ur'[a-z0-9!\*\'\(\);:&=\+\$/%#\[\]\-_\.,~]',
# Valid end-of-path characters (so /foo. does not gobble the period).
"path_end": r'[%s\)=#/]' % UTF_CHARS,
Follow ups