Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Software > Calibre

Notices

Reply
 
Thread Tools Search this Thread
Old 11-01-2009, 01:31 PM   #1
mbovenka
Wizard
mbovenka ought to be getting tired of karma fortunes by now.mbovenka ought to be getting tired of karma fortunes by now.mbovenka ought to be getting tired of karma fortunes by now.mbovenka ought to be getting tired of karma fortunes by now.mbovenka ought to be getting tired of karma fortunes by now.mbovenka ought to be getting tired of karma fortunes by now.mbovenka ought to be getting tired of karma fortunes by now.mbovenka ought to be getting tired of karma fortunes by now.mbovenka ought to be getting tired of karma fortunes by now.mbovenka ought to be getting tired of karma fortunes by now.mbovenka ought to be getting tired of karma fortunes by now.
 
Posts: 2,016
Karma: 13471689
Join Date: Oct 2007
Location: Almere, The Netherlands
Device: Kobo Sage
ebook-convert won't work in a batch file since 0.6.17

I often use ebook-convert in a batch file to convert a number of ebooks in one go. Up to 0.6.16 this worked fine, but from .17 onwards it doesn't anymore.

When I have a batch file consisting of a number of ebook-convert commands, the first command that runs exits the entire batch file when it's done. Running the batch file from within a command shell does the same, and starting the batch file again in the same shell just exits the batch file without even (visibly) starting ebook-convert.

This is on WinXP SP3, fully patched.

Kovid, any idea what changed between 0.6.16 & .17 to cause this?
mbovenka is offline   Reply With Quote
Old 11-01-2009, 04:32 PM   #2
JvdW
Zealot
JvdW doesn't litterJvdW doesn't litter
 
Posts: 115
Karma: 150
Join Date: Jul 2008
Location: Netherlands Veenendaal
Device: Palm T5, Sony PRS-505, Nook Color
Quote:
Originally Posted by mbovenka View Post
I often use ebook-convert in a batch file to convert a number of ebooks in one go. Up to 0.6.16 this worked fine, but from .17 onwards it doesn't anymore.

Kovid, any idea what changed between 0.6.16 & .17 to cause this?
I'm guessing that the new way installing Calibre is causing this. My guess is that the shell can't find ebook-convert.exe and therefore exits without doing much.
The latest 0.6.20 installer does have an option to add the location of the installation folder to the PATH of Windows.

To test this theory:
- open a CMD prompt
- just type: ebook-convert.exe
( this should give you the help text of the program)
- if not then:
-- goto the installation folder of Calibre
-- then type: ebook-convert.exe
(now you should get the help)

If I'm not clear then let us know and I'll retry in a different wording, or someone else.

Regards,

Joop
JvdW is offline   Reply With Quote
Advert
Old 11-01-2009, 04:55 PM   #3
mbovenka
Wizard
mbovenka ought to be getting tired of karma fortunes by now.mbovenka ought to be getting tired of karma fortunes by now.mbovenka ought to be getting tired of karma fortunes by now.mbovenka ought to be getting tired of karma fortunes by now.mbovenka ought to be getting tired of karma fortunes by now.mbovenka ought to be getting tired of karma fortunes by now.mbovenka ought to be getting tired of karma fortunes by now.mbovenka ought to be getting tired of karma fortunes by now.mbovenka ought to be getting tired of karma fortunes by now.mbovenka ought to be getting tired of karma fortunes by now.mbovenka ought to be getting tired of karma fortunes by now.
 
Posts: 2,016
Karma: 13471689
Join Date: Oct 2007
Location: Almere, The Netherlands
Device: Kobo Sage
Quote:
Originally Posted by JvdW View Post
If I'm not clear then let us know and I'll retry in a different wording, or someone else.
No, it's clear (I've been working with PCs since way before Windows was a gleam in Bill's eye) but that's not the problem. Ebook-convert starts up fine when I run the batch file, but runs only once. It then exits the entire batch file and running the batch file unchanged a second time exits without any message. It doesn't say 'ebook-convert isn't recognized..blah...'

So that's not it.
mbovenka is offline   Reply With Quote
Old 11-01-2009, 05:16 PM   #4
itimpi
Wizard
itimpi ought to be getting tired of karma fortunes by now.itimpi ought to be getting tired of karma fortunes by now.itimpi ought to be getting tired of karma fortunes by now.itimpi ought to be getting tired of karma fortunes by now.itimpi ought to be getting tired of karma fortunes by now.itimpi ought to be getting tired of karma fortunes by now.itimpi ought to be getting tired of karma fortunes by now.itimpi ought to be getting tired of karma fortunes by now.itimpi ought to be getting tired of karma fortunes by now.itimpi ought to be getting tired of karma fortunes by now.itimpi ought to be getting tired of karma fortunes by now.
 
Posts: 4,552
Karma: 950151
Join Date: Nov 2008
Device: Sony PRS-950, iphone/ipad (Marvin/iBooks/QuickReader)
You could always try amending your batch file so that each time the ebook-convert program is run it is under a new shell to see if that solves the issue?
itimpi is offline   Reply With Quote
Old 11-01-2009, 05:59 PM   #5
mbovenka
Wizard
mbovenka ought to be getting tired of karma fortunes by now.mbovenka ought to be getting tired of karma fortunes by now.mbovenka ought to be getting tired of karma fortunes by now.mbovenka ought to be getting tired of karma fortunes by now.mbovenka ought to be getting tired of karma fortunes by now.mbovenka ought to be getting tired of karma fortunes by now.mbovenka ought to be getting tired of karma fortunes by now.mbovenka ought to be getting tired of karma fortunes by now.mbovenka ought to be getting tired of karma fortunes by now.mbovenka ought to be getting tired of karma fortunes by now.mbovenka ought to be getting tired of karma fortunes by now.
 
Posts: 2,016
Karma: 13471689
Join Date: Oct 2007
Location: Almere, The Netherlands
Device: Kobo Sage
Quote:
Originally Posted by itimpi View Post
You could always try amending your batch file so that each time the ebook-convert program is run it is under a new shell to see if that solves the issue?
It doesn't; just tried it. I even tried two levels deep, having 'cmd /c ebook-convert' in the batch file and running the batch file with "cmd /c" itself. No dice; it still does the same.
mbovenka is offline   Reply With Quote
Advert
Old 11-01-2009, 07:22 PM   #6
kovidgoyal
creator of calibre
kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.
 
kovidgoyal's Avatar
 
Posts: 43,842
Karma: 22666666
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
Odd I have no idea what could be causing that. Does ebook-convert exit cleanly after an invocation? WHat's it's exit code.
kovidgoyal is offline   Reply With Quote
Old 11-02-2009, 05:06 AM   #7
mbovenka
Wizard
mbovenka ought to be getting tired of karma fortunes by now.mbovenka ought to be getting tired of karma fortunes by now.mbovenka ought to be getting tired of karma fortunes by now.mbovenka ought to be getting tired of karma fortunes by now.mbovenka ought to be getting tired of karma fortunes by now.mbovenka ought to be getting tired of karma fortunes by now.mbovenka ought to be getting tired of karma fortunes by now.mbovenka ought to be getting tired of karma fortunes by now.mbovenka ought to be getting tired of karma fortunes by now.mbovenka ought to be getting tired of karma fortunes by now.mbovenka ought to be getting tired of karma fortunes by now.
 
Posts: 2,016
Karma: 13471689
Join Date: Oct 2007
Location: Almere, The Netherlands
Device: Kobo Sage
Quote:
Originally Posted by kovidgoyal View Post
Odd I have no idea what could be causing that. Does ebook-convert exit cleanly after an invocation? WHat's it's exit code.
Yes, the first invocation in the batch file runs OK. It doesn't show any errors and the resulting output file is fine as well. It just exits the entire batch file when it's done.

I don't know what the exit code is; I'll try to find out when I'm home this evening.
mbovenka is offline   Reply With Quote
Old 11-02-2009, 08:12 AM   #8
JvdW
Zealot
JvdW doesn't litterJvdW doesn't litter
 
Posts: 115
Karma: 150
Join Date: Jul 2008
Location: Netherlands Veenendaal
Device: Palm T5, Sony PRS-505, Nook Color
Quote:
Originally Posted by mbovenka View Post
Yes, the first invocation in the batch file runs OK. It doesn't show any errors and the resulting output file is fine as well. It just exits the entire batch file when it's done.

I don't know what the exit code is; I'll try to find out when I'm home this evening.
I'm doing some batch work too and noticed the same problem.

Running, it looks like, any calibre executable inside a batchfile wrecks havoc on all commands following it. For example the following demonstrates this.
- open a command prompt where you have test.bat download
- run test.bat from the command prompt, calibredb should be in your PATH
- notice that the 'pause' is never executed!
- even stranger, restart the test.bat without closing the command prompt
- notice what happens or the lack thereof


Regards,

Joop
Attached Files
File Type: bat test.bat (23 Bytes, 325 views)

Last edited by JvdW; 11-02-2009 at 08:15 AM. Reason: typos
JvdW is offline   Reply With Quote
Old 11-02-2009, 09:04 AM   #9
kovidgoyal
creator of calibre
kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.
 
kovidgoyal's Avatar
 
Posts: 43,842
Karma: 22666666
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
OK opena ticket, I'll take a look the next time I run my windows VM
kovidgoyal is offline   Reply With Quote
Old 11-02-2009, 01:18 PM   #10
mbovenka
Wizard
mbovenka ought to be getting tired of karma fortunes by now.mbovenka ought to be getting tired of karma fortunes by now.mbovenka ought to be getting tired of karma fortunes by now.mbovenka ought to be getting tired of karma fortunes by now.mbovenka ought to be getting tired of karma fortunes by now.mbovenka ought to be getting tired of karma fortunes by now.mbovenka ought to be getting tired of karma fortunes by now.mbovenka ought to be getting tired of karma fortunes by now.mbovenka ought to be getting tired of karma fortunes by now.mbovenka ought to be getting tired of karma fortunes by now.mbovenka ought to be getting tired of karma fortunes by now.
 
Posts: 2,016
Karma: 13471689
Join Date: Oct 2007
Location: Almere, The Netherlands
Device: Kobo Sage
Quote:
Originally Posted by kovidgoyal View Post
OK opena ticket, I'll take a look the next time I run my windows VM
Done. Ticket 3923.
mbovenka is offline   Reply With Quote
Old 11-05-2009, 07:20 PM   #11
mbovenka
Wizard
mbovenka ought to be getting tired of karma fortunes by now.mbovenka ought to be getting tired of karma fortunes by now.mbovenka ought to be getting tired of karma fortunes by now.mbovenka ought to be getting tired of karma fortunes by now.mbovenka ought to be getting tired of karma fortunes by now.mbovenka ought to be getting tired of karma fortunes by now.mbovenka ought to be getting tired of karma fortunes by now.mbovenka ought to be getting tired of karma fortunes by now.mbovenka ought to be getting tired of karma fortunes by now.mbovenka ought to be getting tired of karma fortunes by now.mbovenka ought to be getting tired of karma fortunes by now.
 
Posts: 2,016
Karma: 13471689
Join Date: Oct 2007
Location: Almere, The Netherlands
Device: Kobo Sage
Quote:
Originally Posted by JvdW View Post
I'm doing some batch work too and noticed the same problem.
Joop, Kovid gave me the hint to try PowerShell instead of CMD. Just running the batch file under PS didn't work any better than under CMD, but what *did* work was feeding the batchfile as standard input to PS, like this:

PowerShell -command - < batchfile.bat

Don't ask me why that works, but it does. Perhaps Kovid will figure it out :-). The same trick doesn't work for CMD, though.
mbovenka is offline   Reply With Quote
Old 06-21-2010, 09:59 AM   #12
JvdW
Zealot
JvdW doesn't litterJvdW doesn't litter
 
Posts: 115
Karma: 150
Join Date: Jul 2008
Location: Netherlands Veenendaal
Device: Palm T5, Sony PRS-505, Nook Color
Thumbs up Problem Solved

Hello All,

Sorry to resurrect an old problem but I think its solved in versions of Calibre greater or equal to 0.7

Regards,

Joop
JvdW is offline   Reply With Quote
Old 07-06-2010, 11:14 AM   #13
karunaji
Evangelist
karunaji ought to be getting tired of karma fortunes by now.karunaji ought to be getting tired of karma fortunes by now.karunaji ought to be getting tired of karma fortunes by now.karunaji ought to be getting tired of karma fortunes by now.karunaji ought to be getting tired of karma fortunes by now.karunaji ought to be getting tired of karma fortunes by now.karunaji ought to be getting tired of karma fortunes by now.karunaji ought to be getting tired of karma fortunes by now.karunaji ought to be getting tired of karma fortunes by now.karunaji ought to be getting tired of karma fortunes by now.karunaji ought to be getting tired of karma fortunes by now.
 
karunaji's Avatar
 
Posts: 421
Karma: 1033566
Join Date: Mar 2010
Location: Latvia
Device: Kindle 3 Wifi, Bookeen Opus
For me it still doesn't work but for another reason. Windows XP command line batch processing stops after setting the code page to unicode (chcp 65001). No idea why it is so but it looks that it is a documented feature.

For this reason is there any other way to pass parameters for ebook-convert.exe except for command line? I am experimenting with the conversion from html to epub I need to run a batch file often. I need to use unicode for metadata and it is inconvenient to include all this information in the command line.
karunaji is offline   Reply With Quote
Old 07-07-2010, 03:15 AM   #14
JvdW
Zealot
JvdW doesn't litterJvdW doesn't litter
 
Posts: 115
Karma: 150
Join Date: Jul 2008
Location: Netherlands Veenendaal
Device: Palm T5, Sony PRS-505, Nook Color
Quote:
Originally Posted by karunaji View Post
For me it still doesn't work but for another reason. Windows XP command line batch processing stops after setting the code page to unicode (chcp 65001). No idea why it is so but it looks that it is a documented feature.
Sorry for not posting it but I also found out that it doesn't work yet on XP. It does work now on Win7

This is what I came up with to circumvent the problem on XP. Its not elegant and it might not work for you depending on what you want accomplished.
The following is part of a script which I use to download the latest NRC epub
Code:
REM Add News as tag, and date as comment
start /wait ebook-meta -c %TODAY% --tags=News %TEMP%\nrc-%TODAY%.epub

REM Add to Calibre database
start /wait calibredb add %TEMP%\nrc-%TODAY%.epub

REM Find database ID by looking for comment
REM for /f "tokens=1,2" %%a in ('calibredb list -s comments:%TODAY%') do if %%b==NRC set id=%%a
start /wait c1.bat
for /f %%a in ('type %TEMP%\test.env') do set id=%%a

REM Mark ePaper to be auto-uploaded to reader
start /wait calibre-debug -c "from calibre.gui2 import dynamic; ids = dynamic.get('news_to_be_synced', set([])); ids.add(%id%); dynamic.set('news_to_be_synced', ids)"
As you can see I use 'start /wait ...' to launch the Calibre programs. In that way they don't mess up the original command prompt.

Hope this helps you with your problem

Regards,

Joop
JvdW is offline   Reply With Quote
Old 07-07-2010, 03:43 AM   #15
Terisa de morgan
Grand Sorcerer
Terisa de morgan ought to be getting tired of karma fortunes by now.Terisa de morgan ought to be getting tired of karma fortunes by now.Terisa de morgan ought to be getting tired of karma fortunes by now.Terisa de morgan ought to be getting tired of karma fortunes by now.Terisa de morgan ought to be getting tired of karma fortunes by now.Terisa de morgan ought to be getting tired of karma fortunes by now.Terisa de morgan ought to be getting tired of karma fortunes by now.Terisa de morgan ought to be getting tired of karma fortunes by now.Terisa de morgan ought to be getting tired of karma fortunes by now.Terisa de morgan ought to be getting tired of karma fortunes by now.Terisa de morgan ought to be getting tired of karma fortunes by now.
 
Terisa de morgan's Avatar
 
Posts: 6,227
Karma: 11768331
Join Date: Jun 2009
Location: Madrid, Spain
Device: Kobo Clara/Aura One/Forma,XiaoMI 5, iPad, Huawei MediaPad, YotaPhone 2
Thanks, I had the same problem yesterday when I updated calibre in my Windows XP. I'll give a try.
Terisa de morgan is offline   Reply With Quote
Reply


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
ebook-convert don't work in ubuntu 9.10 vakya Calibre 2 10-26-2009 04:36 PM
Batch convert error Dopedangel Calibre 2 09-07-2009 03:46 AM
Word Documents - batch convert title property from file name tomliversidge Workshop 4 11-07-2008 11:20 AM
Batch-convert Rocket Ebook format for GEB2150? Fauve Fictionwise eBookwise 1 04-28-2007 05:12 PM
Batch convert to plucker .pdb file. khaoohs Workshop 2 04-28-2006 11:23 PM


All times are GMT -4. The time now is 07:02 AM.


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