diff options
author | Philip Sargent <philip.sargent@gmail.com> | 2023-08-04 16:08:07 +0300 |
---|---|---|
committer | Philip Sargent <philip.sargent@gmail.com> | 2023-08-04 16:08:07 +0300 |
commit | c8430d1ff7ba2308866c134e95dde83b6d49126d (patch) | |
tree | aea4f45ea498b448e639979bcbd0b1a07195b542 | |
parent | 3b9a2b990d869c4b5a30c6d92bb4b4f59a815168 (diff) | |
download | troggle-c8430d1ff7ba2308866c134e95dde83b6d49126d.tar.gz troggle-c8430d1ff7ba2308866c134e95dde83b6d49126d.tar.bz2 troggle-c8430d1ff7ba2308866c134e95dde83b6d49126d.zip |
more correct error message
-rw-r--r-- | parsers/caves.py | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/parsers/caves.py b/parsers/caves.py index 9740d1f..8e2abaf 100644 --- a/parsers/caves.py +++ b/parsers/caves.py @@ -310,13 +310,13 @@ def getXML(text, itemname, minItems=1, maxItems=None, context=""): Should throw exception rather than producing error message here, then handle exception in calling routine where it has the context. - This always succeeds, but it produices error message on the terminal and in the - DatIssues log. + This always succeeds, but it produces error message on the terminal and in the + DataIssues log. """ items = re.findall("<%(itemname)s>(.*?)</%(itemname)s>" % {"itemname": itemname}, text, re.S) if len(items) < minItems: message = ( - " ! %(count)i x %(itemname)s found, at least %(min)i expected. Load ABORT. " + " ! %(count)i x %(itemname)s found, at least %(min)i expected. Load may ABORT. " % {"count": len(items), "itemname": itemname, "min": minItems} + " in file " + context @@ -326,7 +326,7 @@ def getXML(text, itemname, minItems=1, maxItems=None, context=""): if maxItems is not None and len(items) > maxItems: message = ( - " ! %(count)i x %(itemname)s found, no more than %(max)i expected in this XML unit. Load ABORT. " + " ! %(count)i x %(itemname)s found, no more than %(max)i expected in this XML unit. Load may ABORT. " % {"count": len(items), "itemname": itemname, "max": maxItems} + " in file " + context |