commit 52edc174e799ddc33bd0b3fc3a026741be582300
parent 7911d197ba005a8963ddb0a617ff2fe3c95dca31
Author: Antoine Amarilli <a3nm@a3nm.net>
Date: Wed, 30 Jan 2013 22:57:25 +0100
Support for last in plint_web.py
Diffstat:
1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/plint_web.py b/plint_web.py
@@ -85,6 +85,7 @@ def q():
d['poem'] = re.sub(r'<>&', '', d['poem'])
print(d['poem'])
poem = check(d['poem'])
+ poem.append(None)
if not poem:
return env.get_template('error.html').render(**d)
if not re.match("^[a-z_]+$", d['template']):
@@ -108,7 +109,11 @@ def q():
i = 0
for line in poem:
i += 1
- errors = [error.report(short=True) for error in templ.check(line)]
+ last = False
+ if line == None:
+ line = ""
+ last = True
+ errors = [error.report(short=True) for error in templ.check(line, last=last)]
if errors != [] and not firsterror:
firsterror = i
r.append((line, errors))