changeset 4777:6162b0cd1da8

Groups2009: GroupManager.update_cache and load_cache check if backend has needed method and then execute it.
author Dmitrijs Milajevs <dimazest@gmail.com>
date Tue, 02 Jun 2009 09:11:41 +0200
parents 3f9147c23d9c
children fa449b9cd5ef
files MoinMoin/groups/__init__.py
diffstat 1 files changed, 7 insertions(+), 9 deletions(-) [+]
line wrap: on
line diff
--- a/MoinMoin/groups/__init__.py	Mon Jun 01 20:11:17 2009 +0200
+++ b/MoinMoin/groups/__init__.py	Tue Jun 02 09:11:41 2009 +0200
@@ -131,15 +131,13 @@
 
     def update_cache(self):
         for backend in self._backends:
-            try:
-                backend.update_cache()
-            except AttributeError:
-                pass
+            update_cache = getattr(backend, 'update_cache', None)
+            if callable(update_cache):
+                update_cache()
+
 
     def load_cache(self):
         for backend in self._backends:
-            try:
-                backend.load_cache()
-            except AttributeError:
-                # XXX Log that backend doesn't provide this service.
-                pass
+            load_cache = getattr(backend, 'load_cache', None)
+            if callable(load_cache):
+                load_cache()