Skip to content
This repository has been archived by the owner on Nov 30, 2023. It is now read-only.

Improvements to eliminate deprecated API usages and the logged warnings for them #216

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

PisoMojado
Copy link

When debugging this add on for #215 I noticed that there is a lot of output about deprecated APIs. I made these changes to address those warnings.

@@ -75,24 +75,24 @@ def load_menu():
)

add_menu('Chinese::Bulk Fill')
add_menu_item('Chinese::Bulk Fill', _('Hanzi'), bulk_fill_hanzi)
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For these removals of the usage of _(), please note this change in Anki
You will see that the function does nothing, and simply triggers a print to stdout to warn about its deprecation, so the removal should have no effect.

Copy link
Contributor

@3ter 3ter left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't understand why the underscores have been used in the first place but your research seems solid.

@@ -10,7 +10,7 @@

import re
from anki import hooks
from anki.utils import stripHTML
from anki.utils import strip_html as stripHTML
Copy link
Contributor

@3ter 3ter Nov 6, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good work on tackling the deprecations!

I suggest here to use the default provided by the ankitects (strip_html) and change the function calls inside the code accordingly.
It's best not to confuse and another dev might think: Why, there is a deprecation let's fix it... ah, they just kept the old name, figures.

By the way. Could it be that @luoliyan or @joeminicucci need more collaborators to check the PRs and all? I would volunteer having been using this addon for a long time and also am collaborating to other Anki addons (namely https://github.com/zjosua/anki-mc/issues, which is much simpler admittedly 🙂).

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants