summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorsand <daniel@spatof.org>2013-05-15 21:40:04 (GMT)
committer sand <daniel@spatof.org>2013-05-15 21:40:04 (GMT)
commitcabf2273f447520a81b9fb996467268da6fb8c30 (patch)
tree7e6e1b8c1aa458b4200fd85836586f95ed2be678
parenta07f5fddc298e73a909f801e642d4d6432bd112b (diff)
Case insensitive dict
-rw-r--r--pinolo/utils/__init__.py10
1 files changed, 10 insertions, 0 deletions
diff --git a/pinolo/utils/__init__.py b/pinolo/utils/__init__.py
index e69de29..5c4be18 100644
--- a/pinolo/utils/__init__.py
+++ b/pinolo/utils/__init__.py
@@ -0,0 +1,10 @@
+# -*- coding: utf-8
+
+
+# http://stackoverflow.com/questions/2082152/case-insensitive-dictionary
+class CaseInsensitiveDict(dict):
+ def __setitem__(self, key, value):
+ super(Caseinsensitivedict, self).__setitem__(key.lower(), value)
+
+ def __getitem__(self, key):
+ return super(Caseinsensitivedict, self).__getitem__(key.lower())