Mercurial > hg > Feedworm
comparison backend/AbstractBackend.py @ 173:3bcf39181f6e
pull the calculation of the epxire date up into AbstractBackend
author | dirk |
---|---|
date | Fri, 09 Sep 2011 17:19:16 +0200 |
parents | a05719a6175e |
children | f74fe7cb5091 |
comparison
equal
deleted
inserted
replaced
172:214addba1f93 | 173:3bcf39181f6e |
---|---|
1 | |
2 from datetime import datetime, timedelta | |
1 | 3 |
2 class AbstractBackend(object): | 4 class AbstractBackend(object): |
3 def __init__(self): | 5 def __init__(self): |
4 self.feeds = [] | 6 self.feeds = [] |
5 self.selectedFeed = None | 7 self.selectedFeed = None |
22 if self.feedEntries is None: | 24 if self.feedEntries is None: |
23 hideReadEntries = self.preferences().hideReadFeedEntries() | 25 hideReadEntries = self.preferences().hideReadFeedEntries() |
24 self.feedEntries = self._retrieveEntriesForSelectedFeed(hideReadEntries) | 26 self.feedEntries = self._retrieveEntriesForSelectedFeed(hideReadEntries) |
25 return self.feedEntries | 27 return self.feedEntries |
26 | 28 |
29 def _calculateExpireDate(self): | |
30 now = datetime.now() | |
31 daysToKeepFeedEntries = self.preferences().daysToKeepFeedEntries() | |
32 delta = timedelta(days=daysToKeepFeedEntries) | |
33 return now - delta | |
34 | |
27 # | 35 # |
28 # handling of the selected feed entry | 36 # handling of the selected feed entry |
29 # | 37 # |
30 | 38 |
31 def selectFeedEntry(self, index): | 39 def selectFeedEntry(self, index): |