Mercurial > hg > Feedworm
annotate backend/couchdb/CouchDbBackend.py @ 222:fe6a2dad6e29
ignore hg reverted files
author | Dirk Olmes <dirk@xanthippe.ping.de> |
---|---|
date | Thu, 22 May 2014 05:11:35 +0200 |
parents | 699d8f1cebd4 |
children | e34c53a3e407 |
rev | line source |
---|---|
217
bb3c851b18b1
add source file endcoding header
Dirk Olmes <dirk@xanthippe.ping.de>
parents:
214
diff
changeset
|
1 # -*- coding: utf-8 -*- |
218
699d8f1cebd4
unify imports, especially Qt imports. Use consistent super syntax
Dirk Olmes <dirk@xanthippe.ping.de>
parents:
217
diff
changeset
|
2 import couchdb |
699d8f1cebd4
unify imports, especially Qt imports. Use consistent super syntax
Dirk Olmes <dirk@xanthippe.ping.de>
parents:
217
diff
changeset
|
3 import logging |
144
74217db92993
updating feeds on the couchdb backend works now
Dirk Olmes <dirk@xanthippe.ping.de>
parents:
139
diff
changeset
|
4 from FeedUpdater import FeedUpdater |
133
9e1e6b96d8b0
implement proxyHost/proxyPort in Preferences
Dirk Olmes <dirk@xanthippe.ping.de>
parents:
132
diff
changeset
|
5 from Preferences import Preferences |
155
a05719a6175e
move common functionality into an abstract backend class, have both backends inherit from it. Implement enough of the couchdb backend that reading feeds (and marking feed entries as read) is possible
Dirk Olmes <dirk@xanthippe.ping.de>
parents:
148
diff
changeset
|
6 from backend.AbstractBackend import AbstractBackend |
174 | 7 from backend.couchdb import CouchDb |
139
2cd30af937fa
add the required methods for determining if a feed needs to be updated
Dirk Olmes <dirk@xanthippe.ping.de>
parents:
133
diff
changeset
|
8 from backend.couchdb.Feed import Feed |
146
8ec20377bcb0
move getting the entries for a feed to the backend so that the couchdb backend can use a custom view for feed entries
Dirk Olmes <dirk@xanthippe.ping.de>
parents:
144
diff
changeset
|
9 from backend.couchdb.FeedEntry import FeedEntry |
133
9e1e6b96d8b0
implement proxyHost/proxyPort in Preferences
Dirk Olmes <dirk@xanthippe.ping.de>
parents:
132
diff
changeset
|
10 |
155
a05719a6175e
move common functionality into an abstract backend class, have both backends inherit from it. Implement enough of the couchdb backend that reading feeds (and marking feed entries as read) is possible
Dirk Olmes <dirk@xanthippe.ping.de>
parents:
148
diff
changeset
|
11 class CouchDbBackend(AbstractBackend): |
132
63d6d60d37ff
new backend for using CouchDB as persistence mechanism ... currently all methods are unimplemented
Dirk Olmes <dirk@xanthippe.ping.de>
parents:
diff
changeset
|
12 ''' |
63d6d60d37ff
new backend for using CouchDB as persistence mechanism ... currently all methods are unimplemented
Dirk Olmes <dirk@xanthippe.ping.de>
parents:
diff
changeset
|
13 Backend that uses CouchDB for persistence |
63d6d60d37ff
new backend for using CouchDB as persistence mechanism ... currently all methods are unimplemented
Dirk Olmes <dirk@xanthippe.ping.de>
parents:
diff
changeset
|
14 ''' |
63d6d60d37ff
new backend for using CouchDB as persistence mechanism ... currently all methods are unimplemented
Dirk Olmes <dirk@xanthippe.ping.de>
parents:
diff
changeset
|
15 |
63d6d60d37ff
new backend for using CouchDB as persistence mechanism ... currently all methods are unimplemented
Dirk Olmes <dirk@xanthippe.ping.de>
parents:
diff
changeset
|
16 def __init__(self): |
218
699d8f1cebd4
unify imports, especially Qt imports. Use consistent super syntax
Dirk Olmes <dirk@xanthippe.ping.de>
parents:
217
diff
changeset
|
17 super(CouchDbBackend, self).__init__() |
169
91a24f499318
introdue an abstraction for the name of the database so it can be changed via commandline parameter
dirk
parents:
166
diff
changeset
|
18 CouchDb.init() |
180
a4832a180c69
allow setting the URL to the database via command line
dirk
parents:
176
diff
changeset
|
19 server = self._initServer() |
169
91a24f499318
introdue an abstraction for the name of the database so it can be changed via commandline parameter
dirk
parents:
166
diff
changeset
|
20 self.database = server[CouchDb.database] |
158
e8bb107a74e1
all preferences are stored in a single JSON document in the couchdb backend. PreferencesDialog converts QString to a proper Python datatybe before sending it to the backend.
dirk
parents:
155
diff
changeset
|
21 self.prefs = None |
132
63d6d60d37ff
new backend for using CouchDB as persistence mechanism ... currently all methods are unimplemented
Dirk Olmes <dirk@xanthippe.ping.de>
parents:
diff
changeset
|
22 |
180
a4832a180c69
allow setting the URL to the database via command line
dirk
parents:
176
diff
changeset
|
23 def _initServer(self): |
a4832a180c69
allow setting the URL to the database via command line
dirk
parents:
176
diff
changeset
|
24 if CouchDb.database_url is not None: |
a4832a180c69
allow setting the URL to the database via command line
dirk
parents:
176
diff
changeset
|
25 return couchdb.Server(CouchDb.database_url) |
a4832a180c69
allow setting the URL to the database via command line
dirk
parents:
176
diff
changeset
|
26 else: |
a4832a180c69
allow setting the URL to the database via command line
dirk
parents:
176
diff
changeset
|
27 return couchdb.Server() |
a4832a180c69
allow setting the URL to the database via command line
dirk
parents:
176
diff
changeset
|
28 |
132
63d6d60d37ff
new backend for using CouchDB as persistence mechanism ... currently all methods are unimplemented
Dirk Olmes <dirk@xanthippe.ping.de>
parents:
diff
changeset
|
29 def preferences(self): |
158
e8bb107a74e1
all preferences are stored in a single JSON document in the couchdb backend. PreferencesDialog converts QString to a proper Python datatybe before sending it to the backend.
dirk
parents:
155
diff
changeset
|
30 if self.prefs is None: |
e8bb107a74e1
all preferences are stored in a single JSON document in the couchdb backend. PreferencesDialog converts QString to a proper Python datatybe before sending it to the backend.
dirk
parents:
155
diff
changeset
|
31 self.prefs = Preferences(self.database) |
e8bb107a74e1
all preferences are stored in a single JSON document in the couchdb backend. PreferencesDialog converts QString to a proper Python datatybe before sending it to the backend.
dirk
parents:
155
diff
changeset
|
32 return self.prefs |
132
63d6d60d37ff
new backend for using CouchDB as persistence mechanism ... currently all methods are unimplemented
Dirk Olmes <dirk@xanthippe.ping.de>
parents:
diff
changeset
|
33 |
155
a05719a6175e
move common functionality into an abstract backend class, have both backends inherit from it. Implement enough of the couchdb backend that reading feeds (and marking feed entries as read) is possible
Dirk Olmes <dirk@xanthippe.ping.de>
parents:
148
diff
changeset
|
34 # |
a05719a6175e
move common functionality into an abstract backend class, have both backends inherit from it. Implement enough of the couchdb backend that reading feeds (and marking feed entries as read) is possible
Dirk Olmes <dirk@xanthippe.ping.de>
parents:
148
diff
changeset
|
35 # handling of feeds |
a05719a6175e
move common functionality into an abstract backend class, have both backends inherit from it. Implement enough of the couchdb backend that reading feeds (and marking feed entries as read) is possible
Dirk Olmes <dirk@xanthippe.ping.de>
parents:
148
diff
changeset
|
36 # |
a05719a6175e
move common functionality into an abstract backend class, have both backends inherit from it. Implement enough of the couchdb backend that reading feeds (and marking feed entries as read) is possible
Dirk Olmes <dirk@xanthippe.ping.de>
parents:
148
diff
changeset
|
37 |
132
63d6d60d37ff
new backend for using CouchDB as persistence mechanism ... currently all methods are unimplemented
Dirk Olmes <dirk@xanthippe.ping.de>
parents:
diff
changeset
|
38 def getFeeds(self): |
146
8ec20377bcb0
move getting the entries for a feed to the backend so that the couchdb backend can use a custom view for feed entries
Dirk Olmes <dirk@xanthippe.ping.de>
parents:
144
diff
changeset
|
39 if self.preferences().showOnlyUnreadFeeds(): |
155
a05719a6175e
move common functionality into an abstract backend class, have both backends inherit from it. Implement enough of the couchdb backend that reading feeds (and marking feed entries as read) is possible
Dirk Olmes <dirk@xanthippe.ping.de>
parents:
148
diff
changeset
|
40 self.feeds = self._getUnreadFeeds() |
146
8ec20377bcb0
move getting the entries for a feed to the backend so that the couchdb backend can use a custom view for feed entries
Dirk Olmes <dirk@xanthippe.ping.de>
parents:
144
diff
changeset
|
41 else: |
148
c5a427d46703
displaying entries for a feed works now with the couchdb backend
Dirk Olmes <dirk@xanthippe.ping.de>
parents:
146
diff
changeset
|
42 # make sure that the results are actually fetched into memory, otherwise we'll pass |
c5a427d46703
displaying entries for a feed works now with the couchdb backend
Dirk Olmes <dirk@xanthippe.ping.de>
parents:
146
diff
changeset
|
43 # a ViewResults instance around which is not what we want |
155
a05719a6175e
move common functionality into an abstract backend class, have both backends inherit from it. Implement enough of the couchdb backend that reading feeds (and marking feed entries as read) is possible
Dirk Olmes <dirk@xanthippe.ping.de>
parents:
148
diff
changeset
|
44 self.feeds = list(Feed.all(self.database)) |
a05719a6175e
move common functionality into an abstract backend class, have both backends inherit from it. Implement enough of the couchdb backend that reading feeds (and marking feed entries as read) is possible
Dirk Olmes <dirk@xanthippe.ping.de>
parents:
148
diff
changeset
|
45 return self.feeds |
146
8ec20377bcb0
move getting the entries for a feed to the backend so that the couchdb backend can use a custom view for feed entries
Dirk Olmes <dirk@xanthippe.ping.de>
parents:
144
diff
changeset
|
46 |
8ec20377bcb0
move getting the entries for a feed to the backend so that the couchdb backend can use a custom view for feed entries
Dirk Olmes <dirk@xanthippe.ping.de>
parents:
144
diff
changeset
|
47 def _getUnreadFeeds(self): |
175
57e324fa4350
implement getting a list of feeds that have unread entries
dirk
parents:
174
diff
changeset
|
48 viewResults = self.database.view(CouchDb.feedsWithUnreadEntries(), group=True) |
176 | 49 feedsWithUnreadEntries = [] |
175
57e324fa4350
implement getting a list of feeds that have unread entries
dirk
parents:
174
diff
changeset
|
50 for row in viewResults: |
176 | 51 feed = Feed.load(self.database, row["key"]) |
204
4cb22b47b659
Due to a bug in CouchDB it's possible that a view still references deleted documents. Detect this case and don't add NoneType objects into the list of feeds.
dirk
parents:
201
diff
changeset
|
52 # see https://issues.apache.org/jira/browse/COUCHDB-1279 |
4cb22b47b659
Due to a bug in CouchDB it's possible that a view still references deleted documents. Detect this case and don't add NoneType objects into the list of feeds.
dirk
parents:
201
diff
changeset
|
53 # it's possible that the view references documents that have already been deleted |
4cb22b47b659
Due to a bug in CouchDB it's possible that a view still references deleted documents. Detect this case and don't add NoneType objects into the list of feeds.
dirk
parents:
201
diff
changeset
|
54 if feed is not None: |
4cb22b47b659
Due to a bug in CouchDB it's possible that a view still references deleted documents. Detect this case and don't add NoneType objects into the list of feeds.
dirk
parents:
201
diff
changeset
|
55 feedsWithUnreadEntries.append(feed) |
176 | 56 return feedsWithUnreadEntries |
132
63d6d60d37ff
new backend for using CouchDB as persistence mechanism ... currently all methods are unimplemented
Dirk Olmes <dirk@xanthippe.ping.de>
parents:
diff
changeset
|
57 |
155
a05719a6175e
move common functionality into an abstract backend class, have both backends inherit from it. Implement enough of the couchdb backend that reading feeds (and marking feed entries as read) is possible
Dirk Olmes <dirk@xanthippe.ping.de>
parents:
148
diff
changeset
|
58 def _retrieveEntriesForSelectedFeed(self, hideReadEntries): |
183 | 59 viewResults = FeedEntry.entriesForFeed(self.selectedFeed, self.database) |
182 | 60 if hideReadEntries: |
183 | 61 filterFunc = lambda feedEntry: feedEntry.read == False |
62 viewResults = filter(filterFunc, viewResults) | |
181 | 63 return viewResults |
155
a05719a6175e
move common functionality into an abstract backend class, have both backends inherit from it. Implement enough of the couchdb backend that reading feeds (and marking feed entries as read) is possible
Dirk Olmes <dirk@xanthippe.ping.de>
parents:
148
diff
changeset
|
64 |
a05719a6175e
move common functionality into an abstract backend class, have both backends inherit from it. Implement enough of the couchdb backend that reading feeds (and marking feed entries as read) is possible
Dirk Olmes <dirk@xanthippe.ping.de>
parents:
148
diff
changeset
|
65 def markSelectedFeedAsRead(self): |
a05719a6175e
move common functionality into an abstract backend class, have both backends inherit from it. Implement enough of the couchdb backend that reading feeds (and marking feed entries as read) is possible
Dirk Olmes <dirk@xanthippe.ping.de>
parents:
148
diff
changeset
|
66 for feedEntry in self.entriesForSelectedFeed(): |
a05719a6175e
move common functionality into an abstract backend class, have both backends inherit from it. Implement enough of the couchdb backend that reading feeds (and marking feed entries as read) is possible
Dirk Olmes <dirk@xanthippe.ping.de>
parents:
148
diff
changeset
|
67 feedEntry.markRead(self.database) |
a05719a6175e
move common functionality into an abstract backend class, have both backends inherit from it. Implement enough of the couchdb backend that reading feeds (and marking feed entries as read) is possible
Dirk Olmes <dirk@xanthippe.ping.de>
parents:
148
diff
changeset
|
68 |
a05719a6175e
move common functionality into an abstract backend class, have both backends inherit from it. Implement enough of the couchdb backend that reading feeds (and marking feed entries as read) is possible
Dirk Olmes <dirk@xanthippe.ping.de>
parents:
148
diff
changeset
|
69 # |
a05719a6175e
move common functionality into an abstract backend class, have both backends inherit from it. Implement enough of the couchdb backend that reading feeds (and marking feed entries as read) is possible
Dirk Olmes <dirk@xanthippe.ping.de>
parents:
148
diff
changeset
|
70 # handling of the selected feed entry |
a05719a6175e
move common functionality into an abstract backend class, have both backends inherit from it. Implement enough of the couchdb backend that reading feeds (and marking feed entries as read) is possible
Dirk Olmes <dirk@xanthippe.ping.de>
parents:
148
diff
changeset
|
71 # |
a05719a6175e
move common functionality into an abstract backend class, have both backends inherit from it. Implement enough of the couchdb backend that reading feeds (and marking feed entries as read) is possible
Dirk Olmes <dirk@xanthippe.ping.de>
parents:
148
diff
changeset
|
72 |
a05719a6175e
move common functionality into an abstract backend class, have both backends inherit from it. Implement enough of the couchdb backend that reading feeds (and marking feed entries as read) is possible
Dirk Olmes <dirk@xanthippe.ping.de>
parents:
148
diff
changeset
|
73 def _markSelectedFeedEntryRead(self): |
a05719a6175e
move common functionality into an abstract backend class, have both backends inherit from it. Implement enough of the couchdb backend that reading feeds (and marking feed entries as read) is possible
Dirk Olmes <dirk@xanthippe.ping.de>
parents:
148
diff
changeset
|
74 self.selectedFeedEntry.markRead(self.database) |
a05719a6175e
move common functionality into an abstract backend class, have both backends inherit from it. Implement enough of the couchdb backend that reading feeds (and marking feed entries as read) is possible
Dirk Olmes <dirk@xanthippe.ping.de>
parents:
148
diff
changeset
|
75 |
a05719a6175e
move common functionality into an abstract backend class, have both backends inherit from it. Implement enough of the couchdb backend that reading feeds (and marking feed entries as read) is possible
Dirk Olmes <dirk@xanthippe.ping.de>
parents:
148
diff
changeset
|
76 def toggleSelectedFeedEntryRead(self): |
a05719a6175e
move common functionality into an abstract backend class, have both backends inherit from it. Implement enough of the couchdb backend that reading feeds (and marking feed entries as read) is possible
Dirk Olmes <dirk@xanthippe.ping.de>
parents:
148
diff
changeset
|
77 self.selectedFeedEntry.toggleRead(self.database) |
a05719a6175e
move common functionality into an abstract backend class, have both backends inherit from it. Implement enough of the couchdb backend that reading feeds (and marking feed entries as read) is possible
Dirk Olmes <dirk@xanthippe.ping.de>
parents:
148
diff
changeset
|
78 |
a05719a6175e
move common functionality into an abstract backend class, have both backends inherit from it. Implement enough of the couchdb backend that reading feeds (and marking feed entries as read) is possible
Dirk Olmes <dirk@xanthippe.ping.de>
parents:
148
diff
changeset
|
79 |
132
63d6d60d37ff
new backend for using CouchDB as persistence mechanism ... currently all methods are unimplemented
Dirk Olmes <dirk@xanthippe.ping.de>
parents:
diff
changeset
|
80 def createFeed(self, url): |
166
04c3b9796b89
feedparser uses the proxy now if one is configured. To implement this the FeedUpdater had to change a bit - sqlalchemy backend is not yet refactored.
dirk
parents:
164
diff
changeset
|
81 feed = Feed.create(url) |
04c3b9796b89
feedparser uses the proxy now if one is configured. To implement this the FeedUpdater had to change a bit - sqlalchemy backend is not yet refactored.
dirk
parents:
164
diff
changeset
|
82 feed.store(self.database) |
04c3b9796b89
feedparser uses the proxy now if one is configured. To implement this the FeedUpdater had to change a bit - sqlalchemy backend is not yet refactored.
dirk
parents:
164
diff
changeset
|
83 FeedUpdater(self.database, self.preferences()).update(feed) |
132
63d6d60d37ff
new backend for using CouchDB as persistence mechanism ... currently all methods are unimplemented
Dirk Olmes <dirk@xanthippe.ping.de>
parents:
diff
changeset
|
84 |
63d6d60d37ff
new backend for using CouchDB as persistence mechanism ... currently all methods are unimplemented
Dirk Olmes <dirk@xanthippe.ping.de>
parents:
diff
changeset
|
85 def updateFeed(self, feed, changes): |
162 | 86 for key in changes.keys(): |
87 feed[key] = changes[key] | |
88 feed.store(self.database) | |
132
63d6d60d37ff
new backend for using CouchDB as persistence mechanism ... currently all methods are unimplemented
Dirk Olmes <dirk@xanthippe.ping.de>
parents:
diff
changeset
|
89 |
164 | 90 def deleteSelectedFeed(self): |
169
91a24f499318
introdue an abstraction for the name of the database so it can be changed via commandline parameter
dirk
parents:
166
diff
changeset
|
91 viewResults = self.database.view(CouchDb.feedEntriesByFeed(), key=self.selectedFeed.id) |
164 | 92 for row in viewResults: |
93 del self.database[row.id] | |
94 del self.database[self.selectedFeed.id] | |
132
63d6d60d37ff
new backend for using CouchDB as persistence mechanism ... currently all methods are unimplemented
Dirk Olmes <dirk@xanthippe.ping.de>
parents:
diff
changeset
|
95 |
146
8ec20377bcb0
move getting the entries for a feed to the backend so that the couchdb backend can use a custom view for feed entries
Dirk Olmes <dirk@xanthippe.ping.de>
parents:
144
diff
changeset
|
96 def entriesForFeed(self, feed, hideReadEntries): |
169
91a24f499318
introdue an abstraction for the name of the database so it can be changed via commandline parameter
dirk
parents:
166
diff
changeset
|
97 viewName = CouchDb.feedEntriesByFeed() |
146
8ec20377bcb0
move getting the entries for a feed to the backend so that the couchdb backend can use a custom view for feed entries
Dirk Olmes <dirk@xanthippe.ping.de>
parents:
144
diff
changeset
|
98 if hideReadEntries: |
169
91a24f499318
introdue an abstraction for the name of the database so it can be changed via commandline parameter
dirk
parents:
166
diff
changeset
|
99 viewName = CouchDb.unreadFeedEntriesByFeed() |
148
c5a427d46703
displaying entries for a feed works now with the couchdb backend
Dirk Olmes <dirk@xanthippe.ping.de>
parents:
146
diff
changeset
|
100 return list(FeedEntry.view(self.database, viewName)) |
146
8ec20377bcb0
move getting the entries for a feed to the backend so that the couchdb backend can use a custom view for feed entries
Dirk Olmes <dirk@xanthippe.ping.de>
parents:
144
diff
changeset
|
101 |
155
a05719a6175e
move common functionality into an abstract backend class, have both backends inherit from it. Implement enough of the couchdb backend that reading feeds (and marking feed entries as read) is possible
Dirk Olmes <dirk@xanthippe.ping.de>
parents:
148
diff
changeset
|
102 def markFeedEntriesAsRead(self, indices): |
a05719a6175e
move common functionality into an abstract backend class, have both backends inherit from it. Implement enough of the couchdb backend that reading feeds (and marking feed entries as read) is possible
Dirk Olmes <dirk@xanthippe.ping.de>
parents:
148
diff
changeset
|
103 for index in indices: |
a05719a6175e
move common functionality into an abstract backend class, have both backends inherit from it. Implement enough of the couchdb backend that reading feeds (and marking feed entries as read) is possible
Dirk Olmes <dirk@xanthippe.ping.de>
parents:
148
diff
changeset
|
104 feedEntry = self.entriesForSelectedFeed()[index] |
a05719a6175e
move common functionality into an abstract backend class, have both backends inherit from it. Implement enough of the couchdb backend that reading feeds (and marking feed entries as read) is possible
Dirk Olmes <dirk@xanthippe.ping.de>
parents:
148
diff
changeset
|
105 feedEntry.markRead(self.database) |
132
63d6d60d37ff
new backend for using CouchDB as persistence mechanism ... currently all methods are unimplemented
Dirk Olmes <dirk@xanthippe.ping.de>
parents:
diff
changeset
|
106 |
63d6d60d37ff
new backend for using CouchDB as persistence mechanism ... currently all methods are unimplemented
Dirk Olmes <dirk@xanthippe.ping.de>
parents:
diff
changeset
|
107 def updateAllFeeds(self): |
213
524cbf9e413c
use correct TODO tags so they show up in the tasks view in Eclipse
dirk
parents:
204
diff
changeset
|
108 # TODO: use a view instead of iterating all feeds |
139
2cd30af937fa
add the required methods for determining if a feed needs to be updated
Dirk Olmes <dirk@xanthippe.ping.de>
parents:
133
diff
changeset
|
109 allFeeds = Feed.all(self.database) |
2cd30af937fa
add the required methods for determining if a feed needs to be updated
Dirk Olmes <dirk@xanthippe.ping.de>
parents:
133
diff
changeset
|
110 for feed in allFeeds: |
2cd30af937fa
add the required methods for determining if a feed needs to be updated
Dirk Olmes <dirk@xanthippe.ping.de>
parents:
133
diff
changeset
|
111 if feed.needsUpdate(): |
211
1ac0b8e2feae
wrap the individual feed update with an exception handler so that a sinlge broken feed doesn't halt the entire update process
Dirk Olmes <dirk@xanthippe.ping.de>
parents:
204
diff
changeset
|
112 try: |
1ac0b8e2feae
wrap the individual feed update with an exception handler so that a sinlge broken feed doesn't halt the entire update process
Dirk Olmes <dirk@xanthippe.ping.de>
parents:
204
diff
changeset
|
113 FeedUpdater(self.database, self.preferences()).update(feed) |
1ac0b8e2feae
wrap the individual feed update with an exception handler so that a sinlge broken feed doesn't halt the entire update process
Dirk Olmes <dirk@xanthippe.ping.de>
parents:
204
diff
changeset
|
114 except Exception as ex: |
1ac0b8e2feae
wrap the individual feed update with an exception handler so that a sinlge broken feed doesn't halt the entire update process
Dirk Olmes <dirk@xanthippe.ping.de>
parents:
204
diff
changeset
|
115 logging.getLogger("FeedUpdate").error("Exception during fetch: " + str(ex)) |
132
63d6d60d37ff
new backend for using CouchDB as persistence mechanism ... currently all methods are unimplemented
Dirk Olmes <dirk@xanthippe.ping.de>
parents:
diff
changeset
|
116 |
63d6d60d37ff
new backend for using CouchDB as persistence mechanism ... currently all methods are unimplemented
Dirk Olmes <dirk@xanthippe.ping.de>
parents:
diff
changeset
|
117 def expireFeedEntries(self): |
201 | 118 expireDate = self._calculateExpireDate() |
174 | 119 logger = logging.getLogger("expiry") |
120 logger.info("expiring entries older than " + str(expireDate)) | |
121 for entry in FeedEntry.getReadFeedEntriesOlderThan(expireDate, self.database): | |
122 del self.database[entry.id] |