plint

French poetry validator (local mirror of https://gitlab.com/a3nm/plint)
git clone https://a3nm.net/git/plint/
Log | Files | Refs | README

commit 3ed814b15a572a33330465dddaf3955f51666562
parent 227fee0b661409571cfab627bba8fdd6acef9cc2
Author: Antoine Amarilli <a3nm@a3nm.net>
Date:   Tue,  2 Aug 2011 14:09:35 -0400

fix field counting woes

Diffstat:
boilint.py | 8++++----
1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/boilint.py b/boilint.py @@ -21,10 +21,10 @@ def manage(line, silent=False): global lbuf usebuf = False l = line.rstrip().split(' ') - text = ' '.join(l[2:]) + text = ' '.join(l[1:]) if normalize(text.strip()) == '': return True # no text - first = [a for a in line.split(' ')[2:] if a != ''][0] + first = [a for a in l[1:] if a != ''][0] # TODO ignore leading symbols except '...' and '/me' if first[-1] == ':' or first[0].upper() != first[0]: return True # ignore non-poem lines @@ -34,7 +34,7 @@ def manage(line, silent=False): lbuf.append(l) else: if not silent: - print(' '.join(l[1:]), file=f) + print(' '.join(l), file=f) f.flush() return True if first[0] == '/': @@ -91,7 +91,7 @@ def run(): line = sys.stdin.readline() if not line: break - manage(line) + manage(' '.join(line.split(' ')[1:])) run()