[wiki] on arrete de balancer du HTML

Ces macros sont appel'ees par getpagelinks. Si elles balancent n'importe
quoi lorsqu'on cherche a obtenir leurs liens, CategoriePagePublique
n'apparait pas...

darcs-hash:20090427142002-bd074-46977e63783af21b013023b46ee7e289020f28a7.gz
This commit is contained in:
Antoine Durand-Gasselin 2009-04-27 16:20:02 +02:00
parent d91a411300
commit 6b0022645d
8 changed files with 25 additions and 23 deletions

View file

@ -9,7 +9,6 @@
def execute(macro, text):
import md5
parseargs = text.split(',')
if len(parseargs)<2:
return '<small><strong class="error">MailTo macro must have at least two arguments</strong></small>'
@ -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 = "<img src=\"%s\" alt=\"Gravatar\" />" % url
return html
return macro.formatter.rawHTML(html)

View file

@ -101,4 +101,4 @@ def execute(macro, args):
index = makeIndex(letter_list)
html = index + html
html += u'<br style="clear: both">'
return html
return macro.formatter.rawHTML(html)

View file

@ -110,11 +110,11 @@ def execute (macro, text, args_re=None):
try: res = _execute (macro, text)
except Exception, msg:
return """
return macro.formatter.rawHTML("""
<p><strong class="error">
Error: macro ProgressBar: %s</strong> </p>
""" % 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

View file

@ -7,7 +7,7 @@
http://purl.net/wiki/moinmaster/HelpOnMacros/Include
for detailed docs.
@copyright: 2000-2004 by Jürgen Hermann <jh@web.de>
@copyright: 2000-2001 by Richard Jones <richard@bizarsoftware.com.au>
@license: GNU GPL, see COPYING for details.

View file

@ -14,7 +14,7 @@
@copyright: 2002-2004 by Jürgen Hermann <jh@web.de>
@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

View file

@ -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

View file

@ -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

View file

@ -24,4 +24,4 @@ def execute(macro, text):
<embed src="%(youtubelink)s" type="application/x-shockwave-flash" wmode="transparent" width="425" height="350"></embed>
</object>
''' % {"youtubelink": url}
return html
return macro.formatter.rawHTML(html)