def refresh(self): Dialog.refresh(self) # must be called *before* if not BLOG.posts: self.headlines = [ (LABELS.loc.pt_info_empty, LABELS.loc.pt_info_updt_pst_lst) ] else: self.headlines = [] for p in BLOG.posts: status = u"" (y, mo, d, h, m, s) = parse_iso8601(p['dateCreated'].value) if BLOG.post_is_only_local(p): status = u"[@] " elif BLOG.post_is_local(p): status = u"[*] " elif p.has_key('post_status'): if p['post_status'] != 'publish': status = u"[#]" line1 = status + u"%02d/%s/%02d %02d:%02d " % (d,MONTHS[mo-1],y,h,m) line2 = utf8_to_unicode(p['title']) self.headlines.append((line1 , line2)) self.last_idx = min(self.last_idx, len(self.headlines)-1) # avoiding problems after removing self.body.set_list(self.headlines, self.last_idx)