Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Software > Calibre > Development

Notices

Reply
 
Thread Tools Search this Thread
Old 05-14-2023, 05:19 AM   #1
otakutyrant
Member
otakutyrant began at the beginning.
 
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?
otakutyrant is offline   Reply With Quote
Old 05-14-2023, 05:41 AM   #2
otakutyrant
Member
otakutyrant began at the beginning.
 
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.
otakutyrant is offline   Reply With Quote
Advert
Old 05-14-2023, 08:14 AM   #3
kovidgoyal
creator of calibre
kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.
 
kovidgoyal's Avatar
 
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.
kovidgoyal is offline   Reply With Quote
Reply


Forum Jump


All times are GMT -4. The time now is 09:43 PM.


MobileRead.com is a privately owned, operated and funded community.