Mercurial > hg > Feedworm
annotate Preference.py @ 71:228da10cc98b
MainWindow relies on FeedList to get the feeds to display now. FeedList has two inner/private classes: one for returning all known feeds and one to return only feeds with unread entries.
author | Dirk Olmes <dirk@xanthippe.ping.de> |
---|---|
date | Wed, 11 Aug 2010 03:10:32 +0200 |
parents | be990ac6e478 |
children |
rev | line source |
---|---|
43
12ed8b5fa08c
first system preference: configure app to stat maximized.
Dirk Olmes <dirk@xanthippe.ping.de>
parents:
diff
changeset
|
1 |
12ed8b5fa08c
first system preference: configure app to stat maximized.
Dirk Olmes <dirk@xanthippe.ping.de>
parents:
diff
changeset
|
2 class Preference(object): |
12ed8b5fa08c
first system preference: configure app to stat maximized.
Dirk Olmes <dirk@xanthippe.ping.de>
parents:
diff
changeset
|
3 @staticmethod |
44
be990ac6e478
saving the preference "start maximized" from GUI implemented
Dirk Olmes <dirk@xanthippe.ping.de>
parents:
43
diff
changeset
|
4 def forKey(key, session): |
be990ac6e478
saving the preference "start maximized" from GUI implemented
Dirk Olmes <dirk@xanthippe.ping.de>
parents:
43
diff
changeset
|
5 return session.query(Preference).filter(Preference.key == key).first() |
43
12ed8b5fa08c
first system preference: configure app to stat maximized.
Dirk Olmes <dirk@xanthippe.ping.de>
parents:
diff
changeset
|
6 |
12ed8b5fa08c
first system preference: configure app to stat maximized.
Dirk Olmes <dirk@xanthippe.ping.de>
parents:
diff
changeset
|
7 def __init__(self, key, value): |
12ed8b5fa08c
first system preference: configure app to stat maximized.
Dirk Olmes <dirk@xanthippe.ping.de>
parents:
diff
changeset
|
8 self.key = key |
12ed8b5fa08c
first system preference: configure app to stat maximized.
Dirk Olmes <dirk@xanthippe.ping.de>
parents:
diff
changeset
|
9 self.value = value |
12ed8b5fa08c
first system preference: configure app to stat maximized.
Dirk Olmes <dirk@xanthippe.ping.de>
parents:
diff
changeset
|
10 |
12ed8b5fa08c
first system preference: configure app to stat maximized.
Dirk Olmes <dirk@xanthippe.ping.de>
parents:
diff
changeset
|
11 def __repr__(self): |
12ed8b5fa08c
first system preference: configure app to stat maximized.
Dirk Olmes <dirk@xanthippe.ping.de>
parents:
diff
changeset
|
12 return "<Preference %s = %s>" % (self.key, self.value) |