Skip to content

Commit

Permalink
[en] Disable stray debug print; learned a new Python trick
Browse files Browse the repository at this point in the history
https://stackoverflow.com/q/10742501

This is very helpful for hunting down forgotten prints.

I first tried to use pbd and `break print` to make a
breakpoint on `print()` calls, but that doesn't
work for builtins, but the above Stackoverflow question
had a suggestion that worked out. Just add the class
and the code into wiktwords and reassign `sys.stdout`
in `main()`, and it will at least tell you the
function that is generating the print.
  • Loading branch information
kristian-clausal committed Jan 8, 2025
1 parent 8d84da3 commit c2b5b80
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/wiktextract/extractor/en/page.py
Original file line number Diff line number Diff line change
Expand Up @@ -1565,7 +1565,7 @@ def process_gloss_header(
# of templates in headers that you want to squash and apply as
# tags, you can add them to WORD_LEVEL_HEAD_TEMPLATES
for templ_data in term_label_templates:
print(templ_data)
# print(templ_data)
expan = templ_data.get("expansion", "").strip("().,; ")
if not expan:
continue
Expand Down

0 comments on commit c2b5b80

Please sign in to comment.