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

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

Notices

Reply
 
Thread Tools Search this Thread
Old 05-31-2011, 09:59 AM   #1
jens32
Junior Member
jens32 began at the beginning.
 
Posts: 5
Karma: 10
Join Date: May 2011
Device: Kindle 3
Question ebook-convert: access current working directory inside recipe

Hi,
I am a python novice and I wasn't able to figure out a way to access the current working directory inside the recipe. I want to write some log files into the folder. self.output_dir and os.getcwd() are set to the temporary folder.
How do I get the CWD of the folder where the recipe is and the output file is generated by ebook-convert a.recipe ebook.mobi?
jens32 is offline   Reply With Quote
Old 05-31-2011, 10:56 AM   #2
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: 26,155
Karma: 5381911
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
You dont. The recipe is not aware of it. Just write it to os.getcwdu(). When you use the --debug-pipeline option the log file will be copied there.
kovidgoyal is offline   Reply With Quote
 
Enthusiast
Old 06-03-2011, 03:49 AM   #3
jens32
Junior Member
jens32 began at the beginning.
 
Posts: 5
Karma: 10
Join Date: May 2011
Device: Kindle 3
Quote:
Originally Posted by kovidgoyal View Post
You dont. The recipe is not aware of it. Just write it to os.getcwdu(). When you use the --debug-pipeline option the log file will be copied there.
My recipe is writing urls of already read articles in a python shelve and I was hoping to get the script working on different computers without having an absolute path inside the script. So using the debug pipeline would work, but it is not what I was looking for. My first post wasn't precise enough about this.

Thanks for your quick answer, but why did the email with the reply notification take so long? I got the notification 2 hours ago.
jens32 is offline   Reply With Quote
Old 06-03-2011, 10:57 AM   #4
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: 26,155
Karma: 5381911
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
from calibre.utils.config import config_dir

Store your persistent data there.
kovidgoyal 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
Calibre working directory paulfiera Calibre 17 01-02-2011 02:28 AM
How to access the bottom directory in K3? lionfish Kindle Developer's Corner 2 12-07-2010 08:11 AM
ebook-convert recipe "cannot connect to X server" neinsuffolk Calibre 5 09-27-2010 11:49 AM
Use builtin recipe with ebook-convert daksjd Calibre 0 08-29-2009 03:33 PM
2.11 Shell Access is Working Again Adam B. iRex 18 10-01-2007 02:38 AM


All times are GMT -4. The time now is 06:14 PM.


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