[gobject-introspection/wip/docs: 5/11] sectionparser: Allow subsections with no name



commit 6360fc5aea8bafe948473234113e3b353651a3d5
Author: Jasper St. Pierre <jstpierre mecheye net>
Date:   Wed Mar 27 15:49:58 2013 -0400

    sectionparser: Allow subsections with no name

 giscanner/sectionparser.py |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
---
diff --git a/giscanner/sectionparser.py b/giscanner/sectionparser.py
index 273cdeb..f66d46a 100644
--- a/giscanner/sectionparser.py
+++ b/giscanner/sectionparser.py
@@ -66,9 +66,9 @@ def parse_sections_file(lines):
             current_section.title = match.groupdict['contents']
             continue
 
-        match = re.match(r"<SUBSECTION (?P<name>.*)>", line)
+        match = re.match(r"<SUBSECTION(?: (?P<name>.*))?>", line)
         if match:
-            current_subsection = Subsection(match.groupdict['name'])
+            current_subsection = Subsection(match.groupdict.get('name', None))
             current_section.subsections.append(current_subsection)
             continue
 


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