Mercurial > hg > Feedworm
comparison backend/couchdb/CouchDbBackend.py @ 139:2cd30af937fa
add the required methods for determining if a feed needs to be updated
author | Dirk Olmes <dirk@xanthippe.ping.de> |
---|---|
date | Tue, 23 Aug 2011 16:02:35 +0200 |
parents | 9e1e6b96d8b0 |
children | 74217db92993 |
comparison
equal
deleted
inserted
replaced
137:5b131f82057d | 139:2cd30af937fa |
---|---|
1 | 1 |
2 from Preferences import Preferences | 2 from Preferences import Preferences |
3 from backend.couchdb.Feed import Feed | |
3 import couchdb | 4 import couchdb |
5 | |
4 | 6 |
5 DATABASE = "feedtest" | 7 DATABASE = "feedtest" |
6 | 8 |
7 class CouchDbBackend(object): | 9 class CouchDbBackend(object): |
8 ''' | 10 ''' |
36 | 38 |
37 def markFeedEntriesAsRead(self, entries): | 39 def markFeedEntriesAsRead(self, entries): |
38 raise Exception("not yet implemented") | 40 raise Exception("not yet implemented") |
39 | 41 |
40 def updateAllFeeds(self): | 42 def updateAllFeeds(self): |
41 raise Exception("not yet implemented") | 43 # TODO use a view instead of iterating all feeds |
44 allFeeds = Feed.all(self.database) | |
45 for feed in allFeeds: | |
46 if feed.needsUpdate(): | |
47 print("feed needs update " + str(feed)) | |
42 | 48 |
43 def expireFeedEntries(self): | 49 def expireFeedEntries(self): |
44 raise Exception("not yet implemented") | 50 print("Expiring feeds is not yet implemented") |
51 # raise Exception("not yet implemented") | |
45 | 52 |
46 def dispose(self): | 53 def dispose(self): |
47 # nothing to do here | 54 # nothing to do here |
48 pass | 55 pass |