changeset 5168:61ce73eb13a0

action.getHandler(): make it moin 1.8 compatible again
author Thomas Waldmann <tw AT waldmann-edv DOT de>
date Fri, 02 Oct 2009 21:38:18 +0200
parents 27e9ac3fc12b
children 6277639194df
files MoinMoin/action/__init__.py MoinMoin/action/info.py MoinMoin/wsgiapp.py
diffstat 3 files changed, 4 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/MoinMoin/action/__init__.py	Tue Sep 29 11:33:59 2009 +0200
+++ b/MoinMoin/action/__init__.py	Fri Oct 02 21:38:18 2009 +0200
@@ -320,11 +320,12 @@
         config.cache.action_names = actions # remember it
     return config.cache.action_names
 
-def getHandler(cfg, action, identifier="execute"):
+def getHandler(request, action, identifier="execute"):
     """ return a handler function for a given action or None.
 
     TODO: remove request dependency
     """
+    cfg = request.cfg
     # check for excluded actions
     if action in cfg.actions_excluded:
         return None
--- a/MoinMoin/action/info.py	Tue Sep 29 11:33:59 2009 +0200
+++ b/MoinMoin/action/info.py	Fri Oct 02 21:38:18 2009 +0200
@@ -42,7 +42,7 @@
                       f.paragraph(0))
 
         # show attachments (if allowed)
-        attachment_info = action.getHandler(request.cfg, 'AttachFile', 'info')
+        attachment_info = action.getHandler(request, 'AttachFile', 'info')
         if attachment_info:
             request.write(attachment_info(pagename, request))
 
--- a/MoinMoin/wsgiapp.py	Tue Sep 29 11:33:59 2009 +0200
+++ b/MoinMoin/wsgiapp.py	Fri Oct 02 21:38:18 2009 +0200
@@ -164,7 +164,7 @@
     # Try action
     else:
         from MoinMoin import action
-        handler = action.getHandler(cfg, action_name)
+        handler = action.getHandler(context, action_name)
         if handler is None:
             msg = _("You are not allowed to do %(action_name)s on this page.") % {
                     'action_name': wikiutil.escape(action_name), }