diff 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
line wrap: on
line diff
--- a/backend/AbstractBackend.py	Fri Sep 09 17:17:39 2011 +0200
+++ b/backend/AbstractBackend.py	Fri Sep 09 17:19:16 2011 +0200
@@ -1,3 +1,5 @@
+
+from datetime import datetime, timedelta
 
 class AbstractBackend(object):
     def __init__(self):
@@ -24,6 +26,12 @@
             self.feedEntries = self._retrieveEntriesForSelectedFeed(hideReadEntries)
         return self.feedEntries
 
+    def _calculateExpireDate(self):
+        now = datetime.now()
+        daysToKeepFeedEntries = self.preferences().daysToKeepFeedEntries()
+        delta = timedelta(days=daysToKeepFeedEntries)
+        return now - delta
+
     #
     # handling of the selected feed entry
     #