changeset 3280:ef1313a4add2

LikePages macro: fix argument count/processing
author Thomas Waldmann <tw AT waldmann-edv DOT de>
date Mon, 17 Mar 2008 01:26:09 +0100
parents 12364c64a49f
children d519735ca765
files MoinMoin/macro/LikePages.py
diffstat 1 files changed, 5 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/MoinMoin/macro/LikePages.py	Mon Mar 17 01:13:19 2008 +0100
+++ b/MoinMoin/macro/LikePages.py	Mon Mar 17 01:26:09 2008 +0100
@@ -10,7 +10,7 @@
 
 from MoinMoin.action import LikePages
 
-def macro_LikePages(macro):
+def macro_LikePages(macro, text=u'(none)'):
     request = macro.request
     # we don't want to spend much CPU for spiders requesting nonexisting pages
     if not request.isSpiderAgent:
@@ -22,6 +22,9 @@
         # Render matches
         if matches and not isinstance(matches, (str, unicode)):
             return request.redirectedOutput(LikePages.showMatches, pagename, request, start, end, matches, False)
-
+        else:
+            # if we did not find any similar pages, we just render the text we got as argument:
+            return request.formatter.text(text)
+    # bots get nothing:
     return ''