![]() |
#1 | |
Junior Member
![]() Posts: 3
Karma: 10
Join Date: Mar 2015
Device: Kindle Paper White 2
|
How to setup Python debug environment for Calibre Recipes
I am trying to develop a recipe. I want to setup a Python debug environment for Calibre Recipes (in Windows 8.1).
Firstly, I include Calibre lib to Python IDLE but still failed. Does anyone know to do that? Quote:
|
|
![]() |
![]() |
![]() |
#2 |
Ex-Helpdesk Junkie
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 19,421
Karma: 85400180
Join Date: Nov 2012
Location: The Beaten Path, USA, Roundworld, This Side of Infinity
Device: Kindle Touch fw5.3.7 (Wifi only)
|
Just run calibre via "calibre-debug -g" to get debug output.
Alternatively, run "calibre-debug" to get an interactive python console that can access calibre's code. You cannot simply add the calibre source code, you need it to be properly installed ![]() On linux, you can do a source install (for instance the repo packages) -- that would allow you to run bog-standard python debugging tools which can call on all of calibre's code. |
![]() |
![]() |
Advert | |
|
![]() |
#3 | |
Junior Member
![]() Posts: 3
Karma: 10
Join Date: Mar 2015
Device: Kindle Paper White 2
|
Quote:
|
|
![]() |
![]() |
![]() |
#4 |
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 1,166
Karma: 1410083
Join Date: Nov 2010
Location: Germany
Device: Sony PRS-650
|
Take a look on the sticky posts at the top of this forum and calibre help for adding news: http://manual.calibre-ebook.com/news.html. There is an additional section at the end of this help called API documentation for recipes. Very useful. At least it is maybe a good idea to take a look to the command line interface help: http://manual.calibre-ebook.com/gene...cli-index.html
I use for recipe development two simple batch files in a working directory like "Your_Recipe" what runs the recipe via command line: Your_Recipe.bat: Code:
call Delete_Your_Recipe.bat ebook-convert Your_Recipe.recipe .epub -vvv --debug-pipeline debug > Your_Recipe.log Code:
rmdir debug. /s /q del Your_Recipe.epub del Your_Recipe.log -vvv defines the level of verbosity The second batch simply delete all created directories and files (debug- and log files) |
![]() |
![]() |
![]() |
#5 |
Ex-Helpdesk Junkie
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 19,421
Karma: 85400180
Join Date: Nov 2012
Location: The Beaten Path, USA, Roundworld, This Side of Infinity
Device: Kindle Touch fw5.3.7 (Wifi only)
|
Kovid mentions on the development page in the user manual, his preferred debugging tool is liberal use of print statements in the source code. Why not try that?
|
![]() |
![]() |
Advert | |
|
![]() |
#6 |
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 6,609
Karma: 12595249
Join Date: Jun 2009
Location: Madrid, Spain
Device: Kobo Clara/Aura One/Forma,XiaoMI 5, iPad, Huawei MediaPad, YotaPhone 2
|
|
![]() |
![]() |
![]() |
#7 |
Junior Member
![]() Posts: 3
Karma: 10
Join Date: Mar 2015
Device: Kindle Paper White 2
|
|
![]() |
![]() |
![]() |
#8 |
Ex-Helpdesk Junkie
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 19,421
Karma: 85400180
Join Date: Nov 2012
Location: The Beaten Path, USA, Roundworld, This Side of Infinity
Device: Kindle Touch fw5.3.7 (Wifi only)
|
They aren't a big secret... anyway, what exactly do you want to see in the IDE that you cannot do with print statements? Considering recipes need to be run through ebook-convert anyway...
|
![]() |
![]() |
![]() |
#9 |
Member
![]() Posts: 11
Karma: 10
Join Date: Jan 2016
Device: no
|
Hi,
I tried to follow https://manual.calibre-ebook.com/develop.html. But at some point I failed to test the recipe from the ide. Using the ebook-convert command is a pain. Thank you for the comments "Why don't you use print statements". It would be nice to have an answer to the original question for those who do not want to use print statements. Bests, Daniel Last edited by DanielBonnery; 03-03-2016 at 02:33 PM. |
![]() |
![]() |
![]() |
#10 |
Member
![]() Posts: 11
Karma: 10
Join Date: Jan 2016
Device: no
|
I found this:
http://jb-blog.readthedocs.org/en/la...-your-IDE.html I followed the links but I could not have icu properly working... I gave up at the end. The print statements solution is really annoying, a button to test the recipe directly in the editor would be great. Now each time I test, I save and close the editor, run the fetch all news button, open the tasks windows, select the task, click to show log, close, reopen the editor ... Last edited by DanielBonnery; 03-03-2016 at 08:39 PM. |
![]() |
![]() |
![]() |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
Ctrl-Shft-R Debug vs calibre-debug -g | JimmXinu | Development | 3 | 11-20-2014 09:57 AM |
OSX Python environment | DiapDealer | Development | 1 | 08-03-2014 11:10 PM |
Running python recipes standonlone on hosted webserver | oecherprinte | Calibre | 6 | 08-03-2011 04:30 PM |
Windows batch file to test, debug and develop recipes | euleralves | Recipes | 8 | 04-01-2011 04:22 PM |
setup development environment | JeffElkins | Calibre | 21 | 10-22-2008 03:25 PM |