[wiki-lenny/local/parser/Portail.py] modification de syntaxe pour les portails

darcs-hash:20081207190826-bd074-54c538346226023b9795162ac1c1ecf32058cfd9.gz
This commit is contained in:
Antoine Durand-Gasselin 2008-12-07 20:08:26 +01:00
parent 4fb657e4ff
commit d29a380e65
3 changed files with 11 additions and 11 deletions

View file

@ -24,9 +24,9 @@ MoinMoin - Portail parser
CALLING SEQUENCE:
{{{
#!Portail
image1.png | title1 | description 1
image2.png | title2 | description 2
image3.png | title3 | description 3
image1.png @@ title1 @@ description 1
image2.png @@ title2 @@ description 2
image3.png @@ title3 @@ description 3
}}}
Copyright 2008 Antoine Durand-Gasselin <adg@crans.org>
@ -56,7 +56,7 @@ class Parser:
entries = []
for line in quotes:
line=line.strip()
items=line.split('|',2)
items=line.split('@@',2)
if len(items)<3:
# Voir ce qu'on fait
## self.request.write('<!-- error, wrong number of parameters -->')
@ -79,9 +79,6 @@ class Parser:
body = bod_buf.getvalue()
self.request.redirect()
del tit_buf
del bod_buf
# Qu'on rajoute à la liste des entrées
entries += [ (( pic, title, body )) ]

View file

@ -261,6 +261,9 @@ class FormatterBase:
def crans_box(self, title, content, color=None):
raise NotImplementedError
def crans_portal(self, entries):
raise NotImplementedError
# Paragraphs, Lines, Rules ###########################################
def linebreak(self, preformatted=1):

View file

@ -25,9 +25,9 @@ MoinMoin - Portail parser
CALLING SEQUENCE:
{{{
#!Portail
image1.png | title1 | description 1
image2.png | title2 | description 2
image3.png | title3 | description 3
image1.png @@ title1 @@ description 1
image2.png @@ title2 @@ description 2
image3.png @@ title3 @@ description 3
}}}
CREDIT
@ -118,7 +118,7 @@ class Parser:
# on traite les ligne une à une
for line in quotes:
line=line.strip()
items=line.split('|',2)
items=line.split('@@',2)
if items.__len__()<3:
self.request.write('<!-- error, wrong number of parameters -->')
else: