Mercurial > hg > Feedworm
comparison Preference.py @ 43:12ed8b5fa08c
first system preference: configure app to stat maximized.
author | Dirk Olmes <dirk@xanthippe.ping.de> |
---|---|
date | Fri, 14 May 2010 08:31:46 +0200 |
parents | |
children | be990ac6e478 |
comparison
equal
deleted
inserted
replaced
42:0c0d1760b737 | 43:12ed8b5fa08c |
---|---|
1 | |
2 class Preference(object): | |
3 @staticmethod | |
4 def valueForKey(key, session): | |
5 pref = session.query(Preference).filter(Preference.key == key).first() | |
6 if pref is not None: | |
7 return pref.value | |
8 else: | |
9 return None | |
10 | |
11 def __init__(self, key, value): | |
12 self.key = key | |
13 self.value = value | |
14 | |
15 def __repr__(self): | |
16 return "<Preference %s = %s>" % (self.key, self.value) |