changeset 2203:7f76fff062c8

macro.Action: fixed bug in getValidActions (don't nest lists)
author Reimar Bauer <rb.proj AT googlemail DOT com>
date Mon, 07 May 2007 22:50:51 +0200
parents f1972e32313a
children 6a37ecdd79d5
files MoinMoin/macro/Action.py
diffstat 1 files changed, 9 insertions(+), 13 deletions(-) [+]
line wrap: on
line diff
--- a/MoinMoin/macro/Action.py	Mon May 07 20:55:57 2007 +0200
+++ b/MoinMoin/macro/Action.py	Mon May 07 22:50:51 2007 +0200
@@ -31,23 +31,20 @@
         self.macro = macro
         self.request = macro.request
         self.args = self.getArgs(args)
-        
-    def getValidActions(self):  
+
+    def getValidActions(self):
         """ lists all valid actions """
         from MoinMoin import action
         # builtin
-        actions = action.names
+        actions_builtin = action.names
         # global
-        glob_actions = [x for x in action.modules
-                   if not x in self.macro.request.cfg.actions_excluded]
+        actions_global = ([x for x in action.modules
+                           if not x in self.macro.request.cfg.actions_excluded])
         # local
-        loc_actions = [x for x in wikiutil.wikiPlugins('action', self.macro.cfg)
-                       if not x in self.macro.request.cfg.actions_excluded]
-        if glob_actions:
-            actions.append(glob_actions)
-        if loc_actions:
-            actions.append(loc_actions)
-        return actions
+        actions_local = ([x for x in wikiutil.wikiPlugins('action', self.macro.cfg)
+                          if not x in self.macro.request.cfg.actions_excluded])
+
+        return actions_builtin + actions_global + actions_local
 
     def getArgs(self, argstr):
         """ Temporary function until Oliver Graf args parser is finished
@@ -92,4 +89,3 @@
     """ Temporary glue code to use with moin current macro system """
     return ActionLink(macro, args).renderInText()
 
-