Commits

Tim Freund  committed 3cb36d1

Make the PylonsSettingsProxy behave more like a dictionary to account for changes in Celery

  • Participants
  • Parent commits b4fe673

Comments (0)

Files changed (1)

File celerypylons/loader.py

         except KeyError:
             raise AttributeError(pylons_key)
     
+    def get(self, key):
+        try:
+            return self.__getattr__(key)
+        except AttributeError:
+            return None
+
+    def __getitem__(self, key):
+        try:
+            return self.__getattr__(key)
+        except AttributeError:
+            raise KeyError()
+
     def __setattr__(self, key, value):
         pylons_key = to_pylons(key)
         config[pylons_key] = value
-        
+
+    def __setitem__(self, key, value):
+        self.__setattr__(key, value)
 
 class PylonsLoader(BaseLoader):
     """Pylons celery loader