[library-web] [mallard] do not fail on sections without id



commit abb95865a9f5b763fb09da022ba1037c4d83ab59
Author: Frédéric Péters <fpeters 0d be>
Date:   Wed Apr 6 18:30:10 2011 +0530

    [mallard] do not fail on sections without id

 src/modtypes/mallard.py |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)
---
diff --git a/src/modtypes/mallard.py b/src/modtypes/mallard.py
index f3d8907..18104eb 100644
--- a/src/modtypes/mallard.py
+++ b/src/modtypes/mallard.py
@@ -72,6 +72,8 @@ class MallardPage:
                 self.sort_title.attrib['type'] = 'sort'
         for section in tree.findall('{%s}section' % MAL_NS):
             title_tag = section.find('{%s}title' % MAL_NS)
+            if not section.attrib.get('id'):
+                continue
             self.sections.append({'id': section.attrib['id'],
                              'title': dup_node(title_tag),
                              'link_title': dup_node(title_tag),



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