Register Guidelines E-Books Search Today's Posts Mark Forums Read

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

Notices

Reply
 
Thread Tools Search this Thread
Old 11-07-2020, 12:42 PM   #1
harmtemolder
Enthusiast
harmtemolder began at the beginning.
 
Posts: 47
Karma: 10
Join Date: Oct 2020
Device: Kobo Aura
Post How-to: Debug calibre plugin development with PyCharm Pro

I found this post on debugging calibre itself with Eclipse/PyDev, but could not find anything on how to debug plugins or how to do the same with PyCharm. It took me a while, but I figured it out, so I decided to spare you the time:
  1. Create a new project in PyCharm and point it to the directory that hold’s the plugin you’re working on as content root
  2. Add remote debugging with path mappings to the project. Path mappings should be 1-on-1, from an absolute path to a .py file to its calibre_plugins module equivalent
  3. Add the debug server to your plugin according to the documentation. (Use the “Add from the installation directory” approach.)
  4. Build your plugin and start calibre with
    Code:
    calibre-customize -b . && calibre-debug -g
    from within the plugin directory
  5. Ignore the warnings and enjoy stepping through your code

In case you want screenshots, I have those here.
harmtemolder is offline   Reply With Quote
Old 11-08-2020, 08:06 AM   #2
digitalvideo
Junior Member
digitalvideo began at the beginning.
 
Posts: 6
Karma: 10
Join Date: Apr 2017
Device: kobo H20
thx a lot

Do you know how to make the same with vscode ?

regards,
digitalvideo is offline   Reply With Quote
Advert
Old 11-09-2020, 05:18 AM   #3
harmtemolder
Enthusiast
harmtemolder began at the beginning.
 
Posts: 47
Karma: 10
Join Date: Oct 2020
Device: Kobo Aura
Quote:
Originally Posted by digitalvideo View Post
Do you know how to make the same with vscode ?
I use VSCodium, but that should be the same. Tried both attaching to a runnning process and setting up a debugpy server. Neither worked for me on macOS Catalina, but try the debugpy server on your system, it might just work.
harmtemolder is offline   Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Plugin debug output DiapDealer Development 4 12-04-2016 09:12 AM
How to debug a plugin together with the calibre solution in VS2013? esvorontsov Development 2 09-21-2015 08:32 AM
Ctrl-Shft-R Debug vs calibre-debug -g JimmXinu Development 3 11-20-2014 09:57 AM
Getting PyCharm code completion while writing Calibre plugins trying Development 6 03-30-2014 05:47 AM
Calibre plugin development - Newbie problems minstrel Plugins 5 04-12-2009 12:44 PM


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


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