summaryrefslogtreecommitdiff
path: root/src/leap/mx/util/storage.py
diff options
context:
space:
mode:
authorTomas Touceda <chiiph@leap.se>2013-04-24 16:47:07 -0300
committerTomas Touceda <chiiph@leap.se>2013-04-24 16:47:07 -0300
commitf56d043854cb4281c81e2ee6a6b99ff9d03ad9d6 (patch)
tree6ef945980b6a61db3d38ea0e6e123b35775f1c32 /src/leap/mx/util/storage.py
parent046ef8b23c04333007276b560670f69d9011fb40 (diff)
Improve the rest and start everything from start_mx
Diffstat (limited to 'src/leap/mx/util/storage.py')
-rw-r--r--src/leap/mx/util/storage.py42
1 files changed, 0 insertions, 42 deletions
diff --git a/src/leap/mx/util/storage.py b/src/leap/mx/util/storage.py
deleted file mode 100644
index c4c797a..0000000
--- a/src/leap/mx/util/storage.py
+++ /dev/null
@@ -1,42 +0,0 @@
-
-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
- None
- """
- def __getattr__(self, key):
- try:
- return self[key]
- except KeyError, k:
- return None
-
- 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) + '>'
-
- def __getstate__(self):
- return dict(self)
-
- def __setstate__(self, value):
- for (k, v) in value.items():
- self[k] = v