diff backend/couchdb/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 7c719c4f5655
children 4ca1fac32dde
line wrap: on
line diff
--- a/backend/couchdb/Preferences.py	Thu Nov 29 18:46:21 2018 +0100
+++ b/backend/couchdb/Preferences.py	Wed Jan 30 07:11:10 2019 +0100
@@ -1,15 +1,11 @@
 # -*- coding: utf-8 -*-
+from ..AbstractPreferences import AbstractPreferences
 import CouchDb
 
 DAYS_TO_KEEP_FEED_ENTRIES = "daysToKeepFeedEntries"
-HIDE_READ_FEED_ENTRIES = "hideReadFeedEntries"
-PROXY_HOST = "proxyHost"
 PROXY_PORT = "proxyPort"
-SHOW_ONLY_UNREAD_FEEDS = "showOnlyUnreadFeeds"
-START_MAXIMIZED = "startMaximized"
-USE_PROXY = "useProxy"
 
-class Preferences(object):
+class Preferences(AbstractPreferences):
     def __init__(self, database):
         self.database = database
         self._initDocument()
@@ -35,14 +31,11 @@
         self.document[key] = value
         self.documentIsDirty = True
 
-    def isProxyConfigured(self):
-        return self.proxyHost() is not None
-
     def proxyHost(self):
-        return self._documentValue(PROXY_HOST)
+        return self._documentValue(self.PROXY_HOST)
 
     def useProxy(self):
-        return self._documentValue(USE_PROXY, True)
+        return self._documentValue(self.USE_PROXY, True)
 
     def setUseProxy(self, value):
         self._setDocumentValue(USE_PROXY, value)
@@ -67,22 +60,22 @@
             self._setDocumentValue(PROXY_PORT, port)
 
     def showOnlyUnreadFeeds(self):
-        return self._documentValue(SHOW_ONLY_UNREAD_FEEDS, False)
+        return self._documentValue(self.SHOW_ONLY_UNREAD_FEEDS, False)
 
     def setShowOnlyUnreadFeeds(self, flag):
-        self._setDocumentValue(SHOW_ONLY_UNREAD_FEEDS, flag)
+        self._setDocumentValue(self.SHOW_ONLY_UNREAD_FEEDS, flag)
 
     def startMaximized(self):
-        return self._documentValue(START_MAXIMIZED, False)
+        return self._documentValue(self.START_MAXIMIZED, False)
 
     def setStartMaximized(self, flag):
         self._setDocumentValue(START_MAXIMIZED, flag)
 
     def hideReadFeedEntries(self):
-        return self._documentValue(HIDE_READ_FEED_ENTRIES, False)
+        return self._documentValue(self.HIDE_READ_FEED_ENTRIES, False)
 
     def setHideReadFeedEntries(self, flag):
-        self._setDocumentValue(HIDE_READ_FEED_ENTRIES, flag)
+        self._setDocumentValue(self.HIDE_READ_FEED_ENTRIES, flag)
 
     def daysToKeepFeedEntries(self):
         value = self._documentValue(DAYS_TO_KEEP_FEED_ENTRIES, 90)