From dd8ea4088e96d1ddfb8b6489d6dcd0726e2dda97 Mon Sep 17 00:00:00 2001 From: Bela Date: Fri, 16 Feb 2018 13:13:15 +0100 Subject: [PATCH] add CONSTANTS for config file and ConfigError --- readformdata.py | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/readformdata.py b/readformdata.py index 5587377..54e97ae 100644 --- a/readformdata.py +++ b/readformdata.py @@ -3,7 +3,10 @@ """Functions for getting data from files. Constants: - COMMENT_SYMBOL = "#" + COMMENT_SYMBOL = "#": + symbol to indicate a comment line + SUBINFO_SEP = "-": + symbol to separate subinformation, e.g. for commands TODO: part with FormField.LISTINFOS feels like hardcoded hack. @@ -14,6 +17,21 @@ import argparse from formfield import FormField COMMENT_SYMBOL = "#" +SUBINFO_SEP = "-" +VARIABLE_BEGIN_SEP = "{" +VARIABLE_END_SEP = "}" +VARIABLE_PARTS_SEP = "|" + + +class ConfigError(Exception): + """There are a lot of mistakes one can make in writing config files. + + This Error indicates that some information is missing or some line is + malformed. + + No __init__ supplied because the standard __init__ of Exception does + a good job. + """ def listFields(fields, newfile): # NOQA """Use pdftk dump_data_fields output to add to a list of data fields.