view backend/arangodb/Preferences.py @ 256:f79be01821c4

Arangodb backend, first version which barely works for reading
author Dirk Olmes <dirk@xanthippe.ping.de>
date Wed, 30 Jan 2019 07:11:10 +0100
parents
children 4ca1fac32dde
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 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]