[gobject-introspection/wip/docs: 3/11] sectionparser: Fix regex matching



commit d590bfc619e26757d195ec85b5545aa5ed503cd1
Author: Jasper St. Pierre <jstpierre mecheye net>
Date:   Wed Mar 27 15:48:50 2013 -0400

    sectionparser: Fix regex matching

 giscanner/sectionparser.py |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)
---
diff --git a/giscanner/sectionparser.py b/giscanner/sectionparser.py
index 042a753..6230b5c 100644
--- a/giscanner/sectionparser.py
+++ b/giscanner/sectionparser.py
@@ -56,17 +56,17 @@ def parse_sections_file(lines):
             current_section = None
             continue
 
-        match = re.match(line, r"<FILE>(?P<contents>.*)</FILE>")
+        match = re.match(r"<FILE>(?P<contents>.*)</FILE>", line)
         if match:
             current_section.file = match.groupdict['contents']
             continue
 
-        match = re.match(line, r"<TITLE>(?P<contents>.*)</TITLE>")
+        match = re.match(r"<TITLE>(?P<contents>.*)</TITLE>", line)
         if match:
             current_section.title = match.groupdict['contents']
             continue
 
-        match = re.match(line, r"<SUBSECTION (?P<name>).*>")
+        match = re.match(r"<SUBSECTION (?P<name>).*>", line)
         if match:
             current_subsection = Subsection(match.groupdict['name'])
             current_section.subsections.append(current_subsection)


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