From 4262511f9181c554f5e4dd58c23b570828c3be87 Mon Sep 17 00:00:00 2001 From: mdipierro Date: Thu, 23 Aug 2012 08:42:47 -0500 Subject: [PATCH] restoring Settings backward compatibility, thanks Dominic --- VERSION | 2 +- gluon/storage.py | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/VERSION b/VERSION index 580b29d0..5cdb6dba 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -Version 2.00.0 (2012-08-23 08:37:52) dev +Version 2.00.0 (2012-08-23 08:42:44) dev diff --git a/gluon/storage.py b/gluon/storage.py index b1d36a8c..fa956703 100644 --- a/gluon/storage.py +++ b/gluon/storage.py @@ -35,7 +35,7 @@ class Storage(dict): 2 >>> del o.a - >>> print o.a + >>> print o.a None """ def __getattr__(self, key): @@ -100,7 +100,7 @@ class Storage(dict): def getlast(self,key,default=None): """ - Returns the last or only single value when + Returns the last or only single value when given a request.vars-style key. If the value is a list, the last item will be returned; @@ -155,9 +155,9 @@ def save_storage(storage, filename): class Settings(Storage): def __setattr__(self, key, value): - if key != 'lock_keys' and 'lock_keys' in self and not key in self: + if key != 'lock_keys' and self['lock_keys'] and key not in self: raise SyntaxError, 'setting key \'%s\' does not exist' % key - if key != 'lock_values' and 'lock_values' in self: + if key != 'lock_values' and self['lock_values']: raise SyntaxError, 'setting value cannot be changed: %s' % key self[key] = value