Commits

John Mulligan  committed 347da89

better behavior when a page has no tags

  • Participants
  • Parent commits d0dd076

Comments (0)

Files changed (2)

File muyhomepage2/page.py

 
     @property
     def tags(self):
-        return [v.strip() for v in (self.headers.get('tags') or '').split(',')]
+        _tags = self.headers.get('tags')
+        if _tags:
+            return [v.strip() for v in _tags.split(',')]
+        else:
+            return []
 
 
 class PseduoPage(object):

File muyhomepage2/util.py

 def encodetitle(title):
     """Create a simplified title string.
     """
+    assert title, "empty title string"
     permitted = string.letters + string.digits + ':'
     eliminate = "'"
     temp = []