Mercurial > hg > Feedworm
comparison backend/couchdb/Preferences.py @ 133:9e1e6b96d8b0
implement proxyHost/proxyPort in Preferences
author | Dirk Olmes <dirk@xanthippe.ping.de> |
---|---|
date | Tue, 23 Aug 2011 03:44:08 +0200 |
parents | |
children | 8ec20377bcb0 |
comparison
equal
deleted
inserted
replaced
132:63d6d60d37ff | 133:9e1e6b96d8b0 |
---|---|
1 | |
2 class Preferences(object): | |
3 def __init__(self, database): | |
4 self.database = database | |
5 self.viewResults = self.database.view("feedtest/preference_by_key") | |
6 | |
7 def _valueForKey(self, key): | |
8 try: | |
9 resultsForKey = self.viewResults[key] | |
10 row = iter(resultsForKey).next() | |
11 return row.value["value"] | |
12 except StopIteration: | |
13 return None | |
14 | |
15 def isProxyConfigured(self): | |
16 return self.proxyHost() is not None | |
17 | |
18 def proxyHost(self): | |
19 return self._valueForKey("proxyHost") | |
20 | |
21 def proxyPort(self): | |
22 return self._valueForKey("proxyPort") |