diff options
Diffstat (limited to 'mutt/goobook/build/lib.linux-x86_64-2.7/goobook/storage.py')
-rw-r--r-- | mutt/goobook/build/lib.linux-x86_64-2.7/goobook/storage.py | 43 |
1 files changed, 0 insertions, 43 deletions
diff --git a/mutt/goobook/build/lib.linux-x86_64-2.7/goobook/storage.py b/mutt/goobook/build/lib.linux-x86_64-2.7/goobook/storage.py deleted file mode 100644 index 3314327..0000000 --- a/mutt/goobook/build/lib.linux-x86_64-2.7/goobook/storage.py +++ /dev/null @@ -1,43 +0,0 @@ -# -*- coding: UTF-8 -*- -# vim: fileencoding=UTF-8 filetype=python ff=unix et ts=4 sw=4 sts=4 tw=120 -# author: Christer Sjöholm -- hcs AT furuvik DOT net - -class Storage(dict): - """ - A Storage object is like a dictionary except `obj.foo` can be used - in addition to `obj['foo']`. - - >>> o = storage(a=1) - >>> o.a - 1 - >>> o['a'] - 1 - >>> o.a = 2 - >>> o['a'] - 2 - >>> del o.a - >>> o.a - Traceback (most recent call last): - ... - AttributeError: 'a' - - Storage comes from web.py (public domain) - """ - def __getattr__(self, key): - try: - return self[key] - except KeyError, k: - raise AttributeError, k - - def __setattr__(self, key, value): - self[key] = value - - def __delattr__(self, key): - try: - del self[key] - except KeyError, k: - raise AttributeError, k - - def __repr__(self): - return '<Storage ' + dict.__repr__(self) + '>' - |