chore: tiny patch to remove now useless code #2544
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
It also comes with those small optimizations & changes:
definitions_to_ignorewas alreay working, so nothing done on this side.templates_ignoredis now taken properly into account, and all templates were tested/cleaned-up.KeyError, allowing to catch missed templates easily.--check-word[s]are goneuser_functions.pyis gone (the 3 functions still in use were moved to files where there are in use (two inutils.py, and one inget_word.py).da-langs.pysince we cannot use a Python module to guess all language names directly (lang codes with 3 letters, for instance, are only available from the Wiktionary Lua module; and maybe using the Lua moduel directly would be the best!).The new tree is sober, and cleaner:
variant_handlers.pycontains everything needed.template_overrides.pycontains everything needed. Ideally, this file should be small, and even better: not existant. But for FR, for instance, we need to change the output of two templates since they create a full HTML tree with sections, tables, titles, etc. And we are only interested in one sentence in all of that.template_adapters.pycontains everything needed. This will do database changes only once, then it will be a no-op until no new changes are added. This is useful to remove code that we would need to clean-up afterward like "see also" stuff, ot langs names not useful to show, or even fix etymologies rendering for PT.Note: all tests pass locally (modulo you have all locale databases). That's important or the future to know that it actually works, and nothing is broken. We will be able to iterate to unlock GitHub CI runs at some point (not in my priority list to be honest).
Related to #2520.