[library-web] do not fail on missing title in mallard page



commit 5b42d84158e1653690ec7c7ec57668c3cf6110de
Author: Frédéric Péters <fpeters 0d be>
Date:   Tue Mar 8 09:16:17 2011 +0100

    do not fail on missing title in mallard page
    
    (gedit-plugins-insert-date-time in gedit 2.91.8)

 src/modtypes/mallard.py |    9 ++++++---
 1 files changed, 6 insertions(+), 3 deletions(-)
---
diff --git a/src/modtypes/mallard.py b/src/modtypes/mallard.py
index 90a0d5d..2037a7f 100644
--- a/src/modtypes/mallard.py
+++ b/src/modtypes/mallard.py
@@ -100,9 +100,12 @@ class MallardPage:
         info = ET.SubElement(e, '{%s}info' % MAL_NS)
         for node in self.info_nodes:
             info.append(node)
-        info.append(self.link_title)
-        info.append(self.sort_title)
-        e.append(dup_node(self.title_tag))
+        if self.link_title is not None:
+            info.append(self.link_title)
+        if self.sort_title is not None:
+            info.append(self.sort_title)
+        if self.title_tag:
+            e.append(dup_node(self.title_tag))
         return e
 
 



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