12-20-2023, 03:18 PM | #1 | |
Grand Sorcerer
Posts: 6,751
Karma: 26974049
Join Date: Apr 2009
Location: USA
Device: iPhone 15PM, Kindle Scribe, iPad mini 6, PocketBook InkPad Color 3
|
Debugging
I have a couple of ideas which I'd like to develop as calibre plugins.
But throughout my software development career (now retired), I've relied on being able to step through code with an IDE of some sort to understand existing code and ensure my code is working as expected. Calibre requires setting up remote debugging, something I never really ever had to do, and have played with only a couple of times, and not recently. My tool of choice is PyCharm Professional. I also use VSCode a bit for python projects. Note that I want to step through both plugin code and calibre code (if this requires different setups, so be it). I found this very brief thread which discusses setting things up for plugin: https://www.mobileread.com/forums/sh...d.php?t=334662 However the screenshots link in the post is dead, so it leaves me with some questions about how to do it, even after reading PyCharm docs. Calibre debugging tips aren't helping me much either apart from saying 'It is possible': Quote:
I've been doing a little bit of exploring with calibre python console, but it is slow-going and I'll never get very far that way, at least with my current brain and available time (I'm a full time caretaker and get interrupted a lot). I need a little more specific detail to get going, ideally from other developers here who are familiar with PyCharm. Thanks! |
|
12-20-2023, 03:32 PM | #2 |
Grand Sorcerer
Posts: 12,029
Karma: 7257323
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
|
First, I am not familiar with PyCharm.
I do all my calibre debugging with print statements. Yes, very old fashioned but it works, often better than stepping with an IDE. Add the print statements, restart calibre, voila. When working on a plugin I use a script to install the plugin (which is the plugin's source) then start calibre in debug mode. This technique also lets you "instrument" base calibre if you are having some trouble with an API, assuming you are running from source. |
Advert | |
|
12-21-2023, 08:59 PM | #3 |
Grand Sorcerer
Posts: 6,751
Karma: 26974049
Join Date: Apr 2009
Location: USA
Device: iPhone 15PM, Kindle Scribe, iPad mini 6, PocketBook InkPad Color 3
|
Thanks. I think something has clicked in my brain (sleep is amazing), and I'll be able to get remote debugging working with a little more investment of time and focus.
|
07-04-2024, 07:27 PM | #4 |
Junior Member
Posts: 4
Karma: 10
Join Date: Jul 2024
Device: kindle paperwhite
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Debugging calibre/plugins | 413Michele | Calibre | 6 | 11-24-2023 02:14 PM |
Debugging the screen | Calenorn | General Discussions | 7 | 04-04-2017 03:56 PM |
Debugging an epub anomaly? | MacEachaidh | ePub | 12 | 05-17-2013 10:17 PM |
Debugging Password | kaitorii | enTourage Archive | 4 | 11-14-2010 10:34 AM |
iLiad Debugging and the iLiad | scotty1024 | iRex Developer's Corner | 2 | 10-23-2006 04:43 PM |