03-30-2011, 07:51 PM | #1 |
Junior Member
Posts: 9
Karma: 10
Join Date: Mar 2011
Device: Kindle 3, PW2
|
Windows batch file to test, debug and develop recipes
Drag a recipe file to this Windows batch and you can debug the output of recipe.
This help you to build your recipes. Code:
@echo off if not exist "%~dp1%~n1" md "%~dp1%~n1" if exist "%~dp1%~n1\%~n1.recipe" del /q "%~dp1%~n1\%~n1.recipe" copy %1 "%~dp1%~n1\%~n1.recipe" start "Calibre RSS" /wait /b "%ProgramFiles%\Calibre2\ebook-convert.exe" "%~dp1%~n1\%~n1.recipe" "%~dp1%~n1" --test -vv echo Wait a while even after the message to press enter. The Caliber will start. pause |
03-31-2011, 01:56 PM | #2 |
Wizard
Posts: 4,004
Karma: 177841
Join Date: Dec 2009
Device: WinMo: IPAQ; Android: HTC HD2, Archos 7o; Java:Gravity T
|
|
03-31-2011, 02:11 PM | #3 |
Well trained by Cats
Posts: 29,802
Karma: 54830978
Join Date: Aug 2009
Location: The Central Coast of California
Device: Kobo Libra2,Kobo Aura2v1, K4NT(Fixed: New Bat.), Galaxy Tab A
|
|
03-31-2011, 03:33 PM | #4 | |
Wizard
Posts: 4,004
Karma: 177841
Join Date: Dec 2009
Device: WinMo: IPAQ; Android: HTC HD2, Archos 7o; Java:Gravity T
|
Quote:
print 'The tag, variable or whatever being tracked is: ', variable_name I search for all occurrences of the string "is: " to find critical junction points in the recipe. I often have the recipe print the entire "soup" of each article page, sometimes multiple times as it is processed, so my output has short messages tracking variables and errors, which are buried in the source code of multiple other pages. Finding the critical messages is hard enough without digging through older junk. Last edited by Starson17; 03-31-2011 at 03:35 PM. |
|
04-01-2011, 02:44 PM | #5 |
Connoisseur
Posts: 57
Karma: 10
Join Date: Feb 2010
Device: Kindle Paperwhite 1
|
good effort, but hardly usable. the recipe I'm trying to modify used login / password. Tried to use the batch file and it stumbled at the first step, since it had to be entered manually.
|
04-01-2011, 02:54 PM | #6 |
Wizard
Posts: 4,004
Karma: 177841
Join Date: Dec 2009
Device: WinMo: IPAQ; Android: HTC HD2, Archos 7o; Java:Gravity T
|
All recipes that use login/passwords have to add the password manually or hardcode it into the recipe being tested. I don't think it's fair to call his batch file "hardly usable" just because it won't handle the special case of recipes that require logging in.
|
04-01-2011, 03:55 PM | #7 |
Connoisseur
Posts: 57
Karma: 10
Join Date: Feb 2010
Device: Kindle Paperwhite 1
|
but correct me if I'm wrong: using command line implies that you'd use extra properties extensively. Login / password are just two of them. Since there is no interface for changing it in the command line, i can't see how it can by applied. It's helpful only if you have a basic recipe, which requires only internal editing of the recipe, like stylesheets, fonts, etc.
|
04-01-2011, 04:13 PM | #8 | |
Wizard
Posts: 4,004
Karma: 177841
Join Date: Dec 2009
Device: WinMo: IPAQ; Android: HTC HD2, Archos 7o; Java:Gravity T
|
Quote:
It's true that you can provide some other parameters to the recipe on the command line, but for general purpose testing, the only two I ever use are the same two he's hard-coded into the batch file "-vv" to get the verbose output and "--test" to limit the number of feeds and articles retrieved from each feed. Basically, his batch file is identical to the one I use on every recipe I test except that he didn't send error output to a file. I use that same batch file even for recipes that need user/password, but I modify the recipe internally during the testing stage with a hardcoded user/password, then remove it before sending it to Kovid. His batch file essentially replicates the recommendation in the user manual here: http://calibre-ebook.com/user_manual...ght=recipe#id9 |
|
04-01-2011, 04:22 PM | #9 | |
creator of calibre
Posts: 43,858
Karma: 22666666
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
Quote:
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Calibre debug file | meme | Calibre | 7 | 02-01-2011 04:45 PM |
Console test recipes that require subscription | TonytheBookworm | Recipes | 2 | 10-03-2010 04:28 PM |
What happened to calibre-debug "--develop-from" option? | macr0t0r | Calibre | 6 | 12-03-2009 07:22 PM |
Crash while batch converting epubs under windows | AprilHare | Calibre | 3 | 04-26-2009 03:46 AM |
New Windows debug tools released | TadW | Lounge | 0 | 01-11-2006 03:16 AM |