view backend/arangodb/Preferences.py @ 259:304917762618 default tip

implementation of feed updates
author Dirk Olmes <dirk@xanthippe.ping.de>
date Tue, 12 Mar 2019 02:41:22 +0100
parents 4ca1fac32dde
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]