summaryrefslogtreecommitdiff
path: root/rapid/prefs.py
diff options
context:
space:
mode:
authorJulien Valroff <julien@kirya.net>2010-06-01 20:31:41 +0200
committerJulien Valroff <julien@kirya.net>2010-06-01 20:31:41 +0200
commitf49f82b74596eda33ee5e2fc14e51fd67351b9ec (patch)
tree2f51420987e62598195b7c506affc7c9bf82d65f /rapid/prefs.py
parent8da29fc89cbcfb22cfff90d7f045552514e4f92b (diff)
Imported Upstream version 0.2.0upstream/0.2.0
Diffstat (limited to 'rapid/prefs.py')
-rw-r--r--rapid/prefs.py10
1 files changed, 10 insertions, 0 deletions
diff --git a/rapid/prefs.py b/rapid/prefs.py
index 6912138..2f7d771 100644
--- a/rapid/prefs.py
+++ b/rapid/prefs.py
@@ -15,6 +15,7 @@
### Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
### Modified August 2007 by Damon Lynch to allow use of list value preferences
+### Modified May 2010 by Damon Lynch to allow preferences to be reset
"""Module to help implement 'instant-apply' preferences.
@@ -179,4 +180,13 @@ class Preferences(object):
"""
for k,v in self._prefs.items():
print k, v.type, v.current
+
+ def reset(self):
+ """
+ reset all preferences to defaults
+ """
+
+ for key in self._prefs:
+ self.__setattr__(key, self.get_default(key))
+