From c5b56f88132d45481137645b03ac0d3321fb9ce4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ren=C3=A9=20=27Necoro=27=20Neumann?= Date: Mon, 24 Nov 2008 21:11:08 +0100 Subject: Allow session stuff being stored in the config --- portato/gui/utils.py | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'portato/gui/utils.py') diff --git a/portato/gui/utils.py b/portato/gui/utils.py index 3e46361..d8af545 100644 --- a/portato/gui/utils.py +++ b/portato/gui/utils.py @@ -76,6 +76,9 @@ class Config (ConfigParser): # local configs self.local = {} + # session configs + self.session = {} + def modify_flags_config (self): """Sets the internal config of the L{flags}-module. @see: L{flags.set_config()}""" @@ -140,6 +143,15 @@ class Config (ConfigParser): return self.local[cpv][name] + def set_session (self, name, cat, val): + self.session[(cat, name)] = val + + def get_session (self, name, cat): + v = self.session.get((cat, name), None) + + if v == "": v = None + return v + def write(self): """Writes to the config file and modify any external configs.""" ConfigParser.write(self) -- cgit v1.2.3