comparison finch/libgnt/pygnt/example/rss/gntrss.py @ 18722:8b5082d54c1d

Make the rss-reader look and behave nicer.
author Sadrul Habib Chowdhury <imadil@gmail.com>
date Sun, 29 Jul 2007 19:00:14 +0000
parents 64a7b13d3b8d
children 1aeda1e812a8
comparison
equal deleted inserted replaced
18721:7389b597a812 18722:8b5082d54c1d
61 61
62 def do_set_property(self, property, value): 62 def do_set_property(self, property, value):
63 if property.name == 'unread': 63 if property.name == 'unread':
64 self.unread = value 64 self.unread = value
65 65
66 def mark_unread(self, unread):
67 if self.unread == unread:
68 return
69 self.set_property('unread', unread)
70
66 gobject.type_register(FeedItem) 71 gobject.type_register(FeedItem)
67 72
68 def item_hash(item): 73 def item_hash(item):
69 return str(item['date'] + item['title']) 74 return str(item['date'] + item['title'])
70 75
71 ## 76 """
72 # The Feed class. It will update the 'link', 'title', 'desc' and 'items' 77 The Feed class. It will update the 'link', 'title', 'desc' and 'items'
73 # attributes if/when they are updated (triggering 'notify::<attr>' signal) 78 attributes if/when they are updated (triggering 'notify::<attr>' signal)
74 ## 79
80 TODO:
81 - Add a 'count' attribute
82 - Each feed will have a 'uidata', which will be its display window
83 - Look into 'category'. Is it something that feed defines, or the user?
84 - Have separate refresh times for each feed.
85 - Have 'priority' for each feed. (somewhat like category, perhaps?)
86 """
75 class Feed(gobject.GObject): 87 class Feed(gobject.GObject):
76 __gproperties__ = { 88 __gproperties__ = {
77 'link' : (gobject.TYPE_STRING, 'link', 89 'link' : (gobject.TYPE_STRING, 'link',
78 'The web page this feed is associated with.', 90 'The web page this feed is associated with.',
79 '...', gobject.PARAM_READWRITE), 91 '...', gobject.PARAM_READWRITE),
181 sys.stderr.write(str(time.ctime()) + " DONE!!!\n\n\n") 193 sys.stderr.write(str(time.ctime()) + " DONE!!!\n\n\n")
182 194
183 feeds = [] 195 feeds = []
184 urls = ("http://rss.slashdot.org/Slashdot/slashdot", 196 urls = ("http://rss.slashdot.org/Slashdot/slashdot",
185 "http://www.python.org/channews.rdf", 197 "http://www.python.org/channews.rdf",
186 "http://pidgin.im/rss.php" 198 "http://pidgin.im/rss.php",
199 "http://kerneltrap.org/node/feed"
187 ) 200 )
188 201
189 for url in urls: 202 for url in urls:
190 feed = Feed(url) 203 feed = Feed(url)
191 feeds.append(feed) 204 feeds.append(feed)