plint

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

commit ca95d4ee292fa231a52b20b06c984e3e4bff573b
parent 457c0c5d25b97e0556fbd47b8727126008a50834
Author: Antoine Amarilli <a3nm@a3nm.net>
Date:   Wed, 14 Mar 2012 02:46:14 +0100

open file for each append

Diffstat:
plint_irc.py | 10+++++-----
1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/plint_irc.py b/plint_irc.py @@ -13,7 +13,9 @@ lbuf = [] def output(l): print(' '.join(l)) + f = open(sys.argv[2], 'a') print(' '.join(l), file=f) + f.close() def leading_cap(text): for c in text: @@ -41,8 +43,9 @@ def manage(line, silent=False): lbuf.append(l) else: if not silent: + f = open(sys.argv[2], 'a') print(' '.join(l), file=f) - f.flush() + f.close() return True if first[0] == '/': return False # ignore other commands @@ -72,7 +75,6 @@ def manage(line, silent=False): for bl in lbuf: output(bl) output(l) - f.flush() lbuf = [] return len(errors) == 0 @@ -96,7 +98,7 @@ for line in f.readlines(): sys.exit(2) f.close() -f = open(sys.argv[2], 'a') +print("ready", file=sys.stderr) def run(): global lbuf @@ -109,5 +111,3 @@ def run(): run() -f.close() -