finch/libgnt/pygnt/example/rss/gntrss.py

changeset 19233
50476028f83f
parent 19195
f1aaa37a842a
child 19814
05ce6c570b47
child 19859
71d37b57eff2
equal deleted inserted replaced
19232:8d10d094b7aa 19233:50476028f83f
53 self.date_parsed = item['date_parsed'] 53 self.date_parsed = item['date_parsed']
54 except: 54 except:
55 item['date'] = self.date = time.ctime() 55 item['date'] = self.date = time.ctime()
56 self.date_parsed = feedparser._parse_date(self.date) 56 self.date_parsed = feedparser._parse_date(self.date)
57 57
58 self.title = item['title'] 58 self.title = item['title'].encode('utf8')
59 sum = item['summary']
60 self.summary = item['summary'].encode('utf8') 59 self.summary = item['summary'].encode('utf8')
61 self.link = item['link'] 60 self.link = item['link']
62 self.parent = parent 61 self.parent = parent
63 self.unread = True 62 self.unread = True
64 63
77 self.set_property('unread', unread) 76 self.set_property('unread', unread)
78 77
79 gobject.type_register(FeedItem) 78 gobject.type_register(FeedItem)
80 79
81 def item_hash(item): 80 def item_hash(item):
82 return str(item['date'] + item['title']) 81 return str(item['title'])
83 82
84 """ 83 """
85 The Feed class. It will update the 'link', 'title', 'desc' and 'items' 84 The Feed class. It will update the 'link', 'title', 'desc' and 'items'
86 attributes if/when they are updated (triggering 'notify::<attr>' signal) 85 attributes if/when they are updated (triggering 'notify::<attr>' signal)
87 86
169 168
170 if unread != self.unread: 169 if unread != self.unread:
171 self.set_property('unread', unread) 170 self.set_property('unread', unread)
172 171
173 for hv in tmp: 172 for hv in tmp:
173 self.items.remove(tmp[hv])
174 tmp[hv].remove() 174 tmp[hv].remove()
175 "Also notify the UI about the count change" 175 "Also notify the UI about the count change"
176 176
177 self.pending = False 177 self.pending = False
178 return False 178 return False

mercurial