05-14-2023, 05:19 AM | #1 |
Member
Posts: 13
Karma: 10
Join Date: May 2023
Device: Kindle
|
Where does load_translations come from?
The [tutorial](https://manual.calibre-ebook.com/cre...to-your-plugin) advises developer add `load_translations` this function. However, my linter always complains that this and `_` are undefined names. Maybe I can import it explicitly to solve this issue?
|
05-14-2023, 05:41 AM | #2 |
Member
Posts: 13
Karma: 10
Join Date: May 2023
Device: Kindle
|
It seems that Calibre handles this function through zipplugin.py. I decide to use `# noqa: F821` to ignore the F821 error.
|
Advert | |
|
05-14-2023, 08:14 AM | #3 |
creator of calibre
Posts: 43,867
Karma: 22666666
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
yes, they are global functions defined by the calibre environmnet. Most decent python linters allow you to specify a list of global functions to exclude from linting.
|