From 35f283aa714c845d51f260b490120e3e9fa586cf Mon Sep 17 00:00:00 2001 From: Klaus Thoden Date: Mon, 12 Feb 2018 16:43:42 +0100 Subject: [PATCH] Issue warning when footnotes with paragraphs are found --- eoaconvert.py | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/eoaconvert.py b/eoaconvert.py index 87d54ad..f30d57c 100755 --- a/eoaconvert.py +++ b/eoaconvert.py @@ -1,6 +1,6 @@ #!/usr/bin/env python3 # -*- coding: utf-8; mode: python -*- -# Time-stamp: <2018-02-09 13:22:07 (kthoden)> +# Time-stamp: <2018-02-12 16:42:59 (kthoden)> # license? __version__= "1.0" @@ -1567,6 +1567,15 @@ def cleanup(): # Pickle the 'data' dictionary using the highest protocol available. pickle.dump(data_to_pickle, f, pickle.HIGHEST_PROTOCOL) +grep_command = "grep -A1 -B2 'argument of \\\EOAfn;' %s-tralics.log" % options.filename +grep_command_arguments = shlex.split(grep_command) +grep_result = subprocess.Popen(grep_command_arguments, stdout=subprocess.PIPE) +grep_output = grep_result.stdout.read() +if len(grep_output) > 0: + print("\n===\nFootnotes with paragraphs were found. They have to be replaced by the \EOAfnpar command.\n") + print(grep_output.decode("utf-8")) + print("===\n") + print("Removing temporary files.") cleanup() print("Done!")