diff --git a/wiki-lenny/local/macro/Gravatar.py b/wiki-lenny/local/macro/Gravatar.py index c3bc1b13..1014939c 100644 --- a/wiki-lenny/local/macro/Gravatar.py +++ b/wiki-lenny/local/macro/Gravatar.py @@ -9,7 +9,6 @@ def execute(macro, text): import md5 - parseargs = text.split(',') if len(parseargs)<2: return 'MailTo macro must have at least two arguments' @@ -19,4 +18,4 @@ def execute(macro, text): user_id = md5.md5( email.strip() ).hexdigest() url = 'http://www.gravatar.com/avatar.php?gravatar_id=%s&size=80' % user_id html = "\"Gravatar\"" % url - return html + return macro.formatter.rawHTML(html) diff --git a/wiki-lenny/local/macro/PagesPerso.py b/wiki-lenny/local/macro/PagesPerso.py index a66726d6..94494890 100644 --- a/wiki-lenny/local/macro/PagesPerso.py +++ b/wiki-lenny/local/macro/PagesPerso.py @@ -101,4 +101,4 @@ def execute(macro, args): index = makeIndex(letter_list) html = index + html html += u'
' - return html + return macro.formatter.rawHTML(html) diff --git a/wiki-lenny/local/macro/ProgressBar.py b/wiki-lenny/local/macro/ProgressBar.py index 5f39cba2..de5b5970 100644 --- a/wiki-lenny/local/macro/ProgressBar.py +++ b/wiki-lenny/local/macro/ProgressBar.py @@ -110,11 +110,11 @@ def execute (macro, text, args_re=None): try: res = _execute (macro, text) except Exception, msg: - return """ + return macro.formatter.rawHTML("""

Error: macro ProgressBar: %s

- """ % escape ("%s" % msg) - return res + """ % escape ("%s" % msg)) + return macro.formatter.rawHTML(res) def _execute (macro, text): @@ -167,15 +167,15 @@ def _execute (macro, text): if len (fmt): t = "<%s> ||" % fmt else: t = " ||" return txt + t - + # Progress if text.endswith ('%'): # correction du bug des 0% if text == "0%": - for f in [fmt [1]] : + for f in [fmt [1]] : res = cell (res, f) else: - for f in fmt [0] + ' %s' % text, fmt [1] : + for f in fmt [0] + ' %s' % text, fmt [1] : res = cell (res, f) # Current/Steps diff --git a/wiki-lenny/local/macro/RandomIncludeQuote.py b/wiki-lenny/local/macro/RandomIncludeQuote.py index 78efccb2..2f39eb7d 100644 --- a/wiki-lenny/local/macro/RandomIncludeQuote.py +++ b/wiki-lenny/local/macro/RandomIncludeQuote.py @@ -7,7 +7,7 @@ http://purl.net/wiki/moinmaster/HelpOnMacros/Include for detailed docs. - + @copyright: 2000-2004 by Jürgen Hermann @copyright: 2000-2001 by Richard Jones @license: GNU GPL, see COPYING for details. diff --git a/wiki-lenny/local/macro/RandomQuoteNum.py b/wiki-lenny/local/macro/RandomQuoteNum.py index 5b237729..e78f222e 100644 --- a/wiki-lenny/local/macro/RandomQuoteNum.py +++ b/wiki-lenny/local/macro/RandomQuoteNum.py @@ -14,7 +14,7 @@ @copyright: 2002-2004 by Jürgen Hermann @license: GNU GPL, see COPYING for details. - + Originally written by Thomas Waldmann. Gustavo Niemeyer added wiki markup parsing of the quotes. """ @@ -39,12 +39,12 @@ def execute(macro, args): quotes = raw.splitlines() quotes = [quote.strip() for quote in quotes] quotes = [quote[2:] for quote in quotes if quote.startswith('1. ')] - + if not quotes: return (macro.formatter.highlight(1) + _('No quotes on %(pagename)s.') % {'pagename': pagename} + macro.formatter.highlight(0)) - + quote = random.choice(quotes) page.set_raw_body(quote, 1) out = StringIO.StringIO() @@ -52,6 +52,6 @@ def execute(macro, args): page.send_page(macro.request, content_only=1, content_id="RandomQuote_%s" % wikiutil.quoteWikinameFS(page.page_name) ) quote = out.getvalue() macro.request.redirect() - + return quote diff --git a/wiki-lenny/local/macro/SubscribeTo.py b/wiki-lenny/local/macro/SubscribeTo.py index 5f6e6e34..7b41270a 100644 --- a/wiki-lenny/local/macro/SubscribeTo.py +++ b/wiki-lenny/local/macro/SubscribeTo.py @@ -27,6 +27,11 @@ import re def execute (macro, args): _ = macro.request.getText + + # return immediately if getting links for the current page + if request.mode_getpagelinks: + return '' + unknownuname = {} missingemail = {} outofdateversion = 0 diff --git a/wiki-lenny/local/macro/TV.py b/wiki-lenny/local/macro/TV.py index d209885d..675319e6 100644 --- a/wiki-lenny/local/macro/TV.py +++ b/wiki-lenny/local/macro/TV.py @@ -13,7 +13,7 @@ def image_url_for_channel(channel_name, channel_ip, small=0 ): return BASE_IMAGE_URL + str(channel_ip) + IMAGE_SUFFIX else: return BASE_IMAGE_URL + str(channel_ip) + SMALL_IMAGE_SUFFIX - + def get_channel_list(): import urllib # Getsap file from web sever. @@ -21,9 +21,9 @@ def get_channel_list(): # Read it. s = f.read() f.close() - + s = s.split("\n") - + channel_list = [] for a_line in s: try: @@ -39,7 +39,7 @@ def get_channel_list(): except: pass return channel_list - + def execute(macro, args): opt = {"col":4,"cat":False,"ch":False, "width":"10em"} @@ -50,7 +50,7 @@ def execute(macro, args): opt[name] = value except: pass - + IMAGES_PER_LINE = int(opt["col"]) CATHEGORY = opt["cat"] CHANNEL = opt["ch"] @@ -67,7 +67,7 @@ def execute(macro, args): if a_channel["name"].find(CHANNEL)<0: continue if i == 0: - text+= macro.formatter.table_row(1) + text+= macro.formatter.table_row(1) text+= macro.formatter.table_cell(1, {'style':'text-align:center;'}) text+= macro.formatter.strong( 1 ) text+= macro.formatter.text( a_channel["name"] ) @@ -89,5 +89,3 @@ def execute(macro, args): i += 1 text+= macro.formatter.table(0) return text - - diff --git a/wiki-lenny/local/macro/YouTube.py b/wiki-lenny/local/macro/YouTube.py index 2858941e..0dd5b543 100644 --- a/wiki-lenny/local/macro/YouTube.py +++ b/wiki-lenny/local/macro/YouTube.py @@ -24,4 +24,4 @@ def execute(macro, text): ''' % {"youtubelink": url} - return html + return macro.formatter.rawHTML(html)