Explorar o código

Adds celery.conf.add_Defaults

Ask Solem %!s(int64=13) %!d(string=hai) anos
pai
achega
cca920e5be
Modificáronse 1 ficheiros con 4 adicións e 0 borrados
  1. 4 0
      celery/datastructures.py

+ 4 - 0
celery/datastructures.py

@@ -302,6 +302,10 @@ class ConfigurationView(AttributeDictMixin):
         self.__dict__.update(changes=changes, defaults=defaults,
                              _order=[changes] + defaults)
 
+    def add_defaults(self, d):
+        self.defaults.insert(0, d)
+        self._order.insert(1, d)
+
     def __getitem__(self, key):
         for d in self._order:
             try: