diff MoinMoin/events/__init__.py @ 2073:afa784d8d58d

Handle PluginErrors while loading event handlers gracefully.
author Karol 'grzywacz' Nowak <grzywacz@sul.uni.lodz.pl>
date Fri, 01 Jun 2007 01:42:38 +0200
parents 5cc8f6714297
children 0128bbaf0172
line wrap: on
line diff
--- a/MoinMoin/events/__init__.py	Fri Jun 01 01:41:27 2007 +0200
+++ b/MoinMoin/events/__init__.py	Fri Jun 01 01:42:38 2007 +0200
@@ -11,6 +11,7 @@
 
 from MoinMoin import wikiutil
 from MoinMoin.util import pysupport
+from MoinMoin.wikiutil import PluginAttributeError
 
 # A list of available event handlers
 event_handlers = None
@@ -68,7 +69,11 @@
     names = wikiutil.getPlugins("events", cfg)
 
     for name in names:
-        handler = wikiutil.importPlugin(cfg, "events", name, "handle")
+        try:
+            handler = wikiutil.importPlugin(cfg, "events", name, "handle")
+        except PluginAttributeError:
+            handler = None
+            pass
         
         if handler is not None:
             event_handlers.append(handler)