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 03-17-2023, 10:07 PM   #1
enuddleyarbl
Guru
enuddleyarbl ought to be getting tired of karma fortunes by now.enuddleyarbl ought to be getting tired of karma fortunes by now.enuddleyarbl ought to be getting tired of karma fortunes by now.enuddleyarbl ought to be getting tired of karma fortunes by now.enuddleyarbl ought to be getting tired of karma fortunes by now.enuddleyarbl ought to be getting tired of karma fortunes by now.enuddleyarbl ought to be getting tired of karma fortunes by now.enuddleyarbl ought to be getting tired of karma fortunes by now.enuddleyarbl ought to be getting tired of karma fortunes by now.enuddleyarbl ought to be getting tired of karma fortunes by now.enuddleyarbl ought to be getting tired of karma fortunes by now.
 
enuddleyarbl's Avatar
 
Posts: 734
Karma: 1077122
Join Date: Sep 2013
Device: Kobo Forma
Absolute Beginner: Import Calibre Source for Plugin Use?

I'm an absolute beginner to all aspects of editing an existing plugin in Calibre. So, I'm not even smart enough to search for an answer. I'm trying to look at an existing Calibre plugin in an IDE (VS Code). Looking at even the _init_.py module, I see that the IDE can't resolve the very first "from" line:
Code:
# The class that all Interface Action plugin wrappers must inherit from
from calibre.customize import InterfaceActionBase
Quote:
Import "calibre.customize" could not be resolved
Does that mean I have to grab the Calibre source as described:
https://manual.calibre-ebook.com/dev...tting-the-code
and then set up a Windows development environment:
https://manual.calibre-ebook.com/dev...nt-environment
?

Or, is that just for modifying Calibre, itself?

If I do have to grab that source code, do I need to worry about my regular use of Calibre?
enuddleyarbl is offline   Reply With Quote
Old 03-17-2023, 10:55 PM   #2
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,864
Karma: 22666666
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
Yes, you need the calibre source.
kovidgoyal is offline   Reply With Quote
Old 03-18-2023, 06:05 PM   #3
enuddleyarbl
Guru
enuddleyarbl ought to be getting tired of karma fortunes by now.enuddleyarbl ought to be getting tired of karma fortunes by now.enuddleyarbl ought to be getting tired of karma fortunes by now.enuddleyarbl ought to be getting tired of karma fortunes by now.enuddleyarbl ought to be getting tired of karma fortunes by now.enuddleyarbl ought to be getting tired of karma fortunes by now.enuddleyarbl ought to be getting tired of karma fortunes by now.enuddleyarbl ought to be getting tired of karma fortunes by now.enuddleyarbl ought to be getting tired of karma fortunes by now.enuddleyarbl ought to be getting tired of karma fortunes by now.enuddleyarbl ought to be getting tired of karma fortunes by now.
 
enuddleyarbl's Avatar
 
Posts: 734
Karma: 1077122
Join Date: Sep 2013
Device: Kobo Forma
I did a git clone on the Calibre repository and got the source code ok. But, then I couldn't figure out how to point the plugin's code in my IDE (VS Code) at the Calibre source. I finally found a reference in the Calibre manual to doing that with PYTHONPATH in the IDE:

https://manual.calibre-ebook.com/dev...ite-python-ide

Which I couldn't figure out how to do. Finally, I just created a Windows environment variable (just like I did with CALIBRE_DEVELOP_FROM) and most of the references resolved (the remaining ones are for the actual plugin's configuration file and for "from PyQt5.Qt import QApplication" -- which I'm working on).

But, as a suggestion, could you add a sentence to either the Getting the Code or the Windows Development Environment sections of the manual to set up that PYTHONPATH Windows environment variable at the same time as setting up the CALIBRE_DEVELOP_FROM one (assuming I did the right thing)?
enuddleyarbl is offline   Reply With Quote
Reply


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Plugin to import Highlight information from external source fmagin Development 5 06-01-2023 10:41 PM
Absolute beginner confused Help! LivingLegend Kindle Developer's Corner 9 12-29-2021 10:03 AM
Kindlets development: Absolute beginner's guide Alexander Turcic Amazon Kindle 0 08-09-2013 03:43 AM
Kindlet writing guide for the absolute beginner [PW] Hotrootsoup Kindle Developer's Corner 5 08-08-2013 07:37 PM
Import source calibre feliciam Development 2 03-26-2013 03:59 AM


All times are GMT -4. The time now is 05:16 AM.


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