diff MoinMoin/action/AttachFile.py @ 5161:d751e9807213

Introduced a new config var "extensions_mapping". You can set up a mapping of attachment extensions to actions. By the drawing syntax these actions are called for the given target.
author Reimar Bauer <rb.proj AT googlemail DOT com>
date Tue, 22 Sep 2009 11:21:51 +0200
parents 6c31e9dfdd99
children 1992db92a230
line wrap: on
line diff
--- a/MoinMoin/action/AttachFile.py	Mon Sep 21 10:59:37 2009 +0200
+++ b/MoinMoin/action/AttachFile.py	Tue Sep 22 11:21:51 2009 +0200
@@ -84,15 +84,6 @@
 
 
 def get_action(request, filename, do):
-    ext_mapping = {
-        # file extension -> do -> action
-        '.tdraw': {
-            'modify': 'twikidraw',
-        },
-        '.adraw': {
-            'modify': 'anywikidraw',
-        },
-    }
     generic_do_mapping = {
         # do -> action
         'get': action_name,
@@ -104,7 +95,7 @@
         'upload_form': action_name,
     }
     basename, ext = os.path.splitext(filename)
-    do_mapping = ext_mapping.get(ext, {})
+    do_mapping = request.cfg.extensions_mapping.get(ext, {})
     action = do_mapping.get(do, None)
     if action is None:
         # we have no special support for this,