![]() |
#1 | |
Guru
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 769
Karma: 1537886
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:
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? |
|
![]() |
![]() |
![]() |
#2 |
creator of calibre
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 45,182
Karma: 27110894
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
Yes, you need the calibre source.
|
![]() |
![]() |
Advert | |
|
![]() |
#3 |
Guru
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 769
Karma: 1537886
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)? |
![]() |
![]() |
![]() |
|
![]() |
||||
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 |