[wiki/macro] retour à une ancienne version de WikiNinjas.py et ajout de la liste des pages dans les arguments
This commit is contained in:
parent
eca424500e
commit
6c54abcbf6
1 changed files with 6 additions and 9 deletions
|
@ -9,20 +9,17 @@
|
||||||
import random
|
import random
|
||||||
random.seed()
|
random.seed()
|
||||||
|
|
||||||
from MoinMoin.Page import wikiutil
|
|
||||||
|
|
||||||
Dependencies = ["time"]
|
Dependencies = ["time"]
|
||||||
|
|
||||||
def macro_WikiNinjas(macro, args):
|
def macro_WikiNinjas(macro, args):
|
||||||
"""On sort un wiki-lien vers la page d'un des trois WikiNinjas choisi aléatoirement"""
|
"""On sort un wiki-lien vers la page d'un des trois WikiNinjas choisi aléatoirement"""
|
||||||
request = macro.request
|
all_pages = args.split(',')
|
||||||
|
|
||||||
# all WikiNinja pages
|
|
||||||
all_pages = ["WikiCandy", "MargotAbord", "Stophe"]
|
|
||||||
|
|
||||||
# select random page
|
# select random page
|
||||||
page = random.choice(all_pages)
|
page = random.choice(all_pages)
|
||||||
|
|
||||||
macro.request.http_redirect("%s/%s?action=show&redirect=WikiNinja" % (macro.request.script_root, page))
|
f = macro.formatter
|
||||||
|
# return a single page link
|
||||||
return
|
return (f.pagelink(1, page, generated=1) +
|
||||||
|
f.text(page) +
|
||||||
|
f.pagelink(0, page))
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue