view backend/arangodb/Preferences.py @ 258:4ca1fac32dde

Pull the constant of days to keep feed entries into the abstract class
author Dirk Olmes <dirk@xanthippe.ping.de>
date Tue, 12 Mar 2019 02:39:18 +0100
parents f79be01821c4
children
line wrap: on
line source

# -*- coding: utf-8 -*-

from ..AbstractPreferences import AbstractPreferences

class Preferences(AbstractPreferences):
    def __init__(self, database):
        super(Preferences, self).__init__()
        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]

    def proxyHost(self):
        return self.doc[self.PROXY_HOST]

    def showOnlyUnreadFeeds(self):
        return self.doc[self.SHOW_ONLY_UNREAD_FEEDS]

    def startMaximized(self):
        return self.doc[self.START_MAXIMIZED]

    def useProxy(self):
        return self.doc[self.USE_PROXY]