[gedit] Fix python regex, usually it has a , at the end but it may not have it.



commit 6c77932b4a62db6a7f8e1b6612bd7a0f28b707fb
Author: Ignacio Casal Quinteiro <icq gnome org>
Date:   Mon Oct 10 10:07:09 2011 +0200

    Fix python regex, usually it has a , at the end but it may not have it.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=658000

 plugins/externaltools/tools/linkparsing.py      |    2 +-
 plugins/externaltools/tools/linkparsing_test.py |    6 +++---
 2 files changed, 4 insertions(+), 4 deletions(-)
---
diff --git a/plugins/externaltools/tools/linkparsing.py b/plugins/externaltools/tools/linkparsing.py
index ef76cd5..bad3894 100644
--- a/plugins/externaltools/tools/linkparsing.py
+++ b/plugins/externaltools/tools/linkparsing.py
@@ -181,7 +181,7 @@ REGEXP_PYTHON = r"""
     (?P<pth> [^\"]+ )
     \",\sline\s
     (?P<ln> \d+ )
-),"""
+)"""
 
 # python 'test.sh: line 5:'
 REGEXP_BASH = r"""
diff --git a/plugins/externaltools/tools/linkparsing_test.py b/plugins/externaltools/tools/linkparsing_test.py
index 25c866e..0135b95 100644
--- a/plugins/externaltools/tools/linkparsing_test.py
+++ b/plugins/externaltools/tools/linkparsing_test.py
@@ -90,12 +90,12 @@ ValueError: invalid literal for int() with base 10: 'xxx'
         self.assert_link_text(output, lnk, '"test.py", line 4')
 
     def test_parse_python_one_line(self):
-        line = "  File \"test.py\", line 10, in <module>"
+        line = "  File \"test.py\", line 1\n    def a()"
         links = self.p.parse(line)
         self.assert_link_count(links, 1)
         lnk = links[0]
-        self.assert_link(lnk, "test.py", 10)
-        self.assert_link_text(line, lnk, '"test.py", line 10')
+        self.assert_link(lnk, "test.py", 1)
+        self.assert_link_text(line, lnk, '"test.py", line 1')
 
     def test_parse_bash_one_line(self):
         line = "test.sh: line 5: gerp: command not found"



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]