add CONSTANTS for config file and ConfigError

This commit is contained in:
Bela 2018-02-16 13:13:15 +01:00
parent 711a74f0da
commit dd8ea4088e

View file

@ -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.