Avoid exception if a post doesn't exists

Avoid duplicating messages in report
This commit is contained in:
Grégory Soutadé 2013-01-31 19:21:58 +01:00
parent 0150b9f6cd
commit e0da2df75f
2 changed files with 2 additions and 0 deletions

View File

@ -47,6 +47,7 @@ class DynastieGenerator:
self.hash_posts_content = hash_posts_content
def addReport(self, string, color=''):
if string in self.report: return
if color != '':
self.report = self.report + '<span style="color:' + color + '">'
self.report = self.report + '<b>' + self.__class__.__name__ + '</b> : '

View File

@ -216,6 +216,7 @@ class Index(DynastieGenerator):
if len(posts) > self.cur_post:
self.cur_post_obj = posts[self.cur_post]
post_elem = self.createPost(posts, dom, post_elem, node)
if post_elem is None: continue
else:
post_elem = self.createElement(dom, '', '<b>No posts yet</b>')
self.cur_post_obj = None