# HG changeset patch # User Dirk Olmes # Date 1552354758 -3600 # Node ID 4ca1fac32dde65fe4ada49563bf4bb90393ed373 # Parent 75b81da8d7a581ff3f94d8245a80406b586842de Pull the constant of days to keep feed entries into the abstract class diff -r 75b81da8d7a5 -r 4ca1fac32dde backend/AbstractPreferences.py --- a/backend/AbstractPreferences.py Tue Mar 12 02:38:41 2019 +0100 +++ b/backend/AbstractPreferences.py Tue Mar 12 02:39:18 2019 +0100 @@ -1,6 +1,7 @@ # -*- coding: utf-8 -*- class AbstractPreferences(object): + DAYS_TO_KEEP_FEED_ENTRIES = "daysToKeepFeedEntries" HIDE_READ_FEED_ENTRIES = "hideReadFeedEntries" PROXY_HOST = "proxyHost" SHOW_ONLY_UNREAD_FEEDS = "showOnlyUnreadFeeds" diff -r 75b81da8d7a5 -r 4ca1fac32dde backend/arangodb/Preferences.py --- a/backend/arangodb/Preferences.py Tue Mar 12 02:38:41 2019 +0100 +++ b/backend/arangodb/Preferences.py Tue Mar 12 02:39:18 2019 +0100 @@ -8,6 +8,9 @@ collection = database.get_or_create_collection('preferences') self.doc = collection.fetchAll(limit=1)[0] + def daysToKeepFeedEntries(self): + return int(self.doc[self.DAYS_TO_KEEP_FEED_ENTRIES]) + def hideReadFeedEntries(self): return self.doc[self.HIDE_READ_FEED_ENTRIES] diff -r 75b81da8d7a5 -r 4ca1fac32dde backend/couchdb/Preferences.py --- a/backend/couchdb/Preferences.py Tue Mar 12 02:38:41 2019 +0100 +++ b/backend/couchdb/Preferences.py Tue Mar 12 02:39:18 2019 +0100 @@ -2,7 +2,6 @@ from ..AbstractPreferences import AbstractPreferences import CouchDb -DAYS_TO_KEEP_FEED_ENTRIES = "daysToKeepFeedEntries" PROXY_PORT = "proxyPort" class Preferences(AbstractPreferences): @@ -78,7 +77,7 @@ self._setDocumentValue(self.HIDE_READ_FEED_ENTRIES, flag) def daysToKeepFeedEntries(self): - value = self._documentValue(DAYS_TO_KEEP_FEED_ENTRIES, 90) + value = self._documentValue(self.DAYS_TO_KEEP_FEED_ENTRIES, 90) return int(value) def setDaysToKeepFeedEntries(self, days):