Skip to content

Commit

Permalink
[en] wiktionary.py: add suffixes to called_from in debug messages
Browse files Browse the repository at this point in the history
  • Loading branch information
kristian-clausal committed Oct 28, 2024
1 parent 737a3d2 commit 945ca9e
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/wiktextract/wiktionary.py
Original file line number Diff line number Diff line change
Expand Up @@ -178,8 +178,13 @@ def check_error(
lang: str | None,
pos: str | None,
msg: str,
called_from: str | None = None,
) -> None:
"""Formats and outputs an error message about data format checks."""
if called_from is None:
called_from = "wiktionary/179/20240425"
else:
called_from = "wiktionary/179/20240425" + called_from
msg += ": " + json.dumps(dt, sort_keys=True, ensure_ascii=False)
prefix = word or ""
if lang:
Expand All @@ -198,7 +203,7 @@ def check_error(
"title": word,
"section": lang,
"subsection": pos,
"called_from": "wiktionary/179/20240425",
"called_from": called_from,
"path": tuple(),
}
config.debugs.append(error_data)
Expand Down Expand Up @@ -256,6 +261,7 @@ def check_tags(
lang,
pos,
f"invalid uppercase tag {tag} not in or uppercase_tags",
called_from="uppercase_tags",
)
else:
check_error(
Expand Down

0 comments on commit 945ca9e

Please sign in to comment.