plint

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

commit 6da878ea48722a4e4c13f2b1ffc3f31595734f80
parent f583d2fc88b5aac0f5fb7d56077101324d3d50ac
Author: Antoine Amarilli <a3nm@a3nm.net>
Date:   Wed, 14 Mar 2012 02:40:03 +0100

remove useless includes, rename

Diffstat:
plint.py | 26++++++++++++++++++++++++++
poetlint.py | 29-----------------------------
2 files changed, 26 insertions(+), 29 deletions(-)

diff --git a/plint.py b/plint.py @@ -0,0 +1,26 @@ +#!/usr/bin/python3 -uO + +import sys +import template + +if len(sys.argv) != 2: + print("Usage: %s TEMPLATE" % sys.argv[0], file=sys.stderr) + print("Check stdin according to template, report errors on stdout", + file=sys.stderr) + sys.exit(1) + +f = open(sys.argv[1]) +template = template.Template(f) +f.close() + +def run(): + while True: + line = sys.stdin.readline() + if not line: + break + errors = template.check(line) + for error in errors: + print(error.report(), file=sys.stderr) + +run() + diff --git a/poetlint.py b/poetlint.py @@ -1,29 +0,0 @@ -#!/usr/bin/python3 -uO - -import re -import sys -import metric -import template -from pprint import pprint - -if len(sys.argv) != 2: - print("Usage: %s TEMPLATE" % sys.argv[0], file=sys.stderr) - print("Check stdin according to template, report errors on stdout", - file=sys.stderr) - sys.exit(1) - -f = open(sys.argv[1]) -template = template.Template(f) -f.close() - -def run(): - while True: - line = sys.stdin.readline() - if not line: - break - errors = template.check(line) - for error in errors: - print(error.report(), file=sys.stderr) - -run() -