View Single Post
Old 11-27-2014, 05:12 AM   #19
Josieb1
Grand Sorcerer
Josieb1 ought to be getting tired of karma fortunes by now.Josieb1 ought to be getting tired of karma fortunes by now.Josieb1 ought to be getting tired of karma fortunes by now.Josieb1 ought to be getting tired of karma fortunes by now.Josieb1 ought to be getting tired of karma fortunes by now.Josieb1 ought to be getting tired of karma fortunes by now.Josieb1 ought to be getting tired of karma fortunes by now.Josieb1 ought to be getting tired of karma fortunes by now.Josieb1 ought to be getting tired of karma fortunes by now.Josieb1 ought to be getting tired of karma fortunes by now.Josieb1 ought to be getting tired of karma fortunes by now.
 
Posts: 5,089
Karma: 18051062
Join Date: Nov 2009
Location: UK
Device: Kindle Scribe, Coloursoft, PW SE, Kindle 6, Kobo Libra 2, Clara BW
I just opened Calibre and I don't have any format for TXT so i guess i did something wrong. In the command prompt I input

calibre-debug.exe C:\Users\Jenny\Documents\Calibre Library\

And the code in the py is (it is inside a box is that an issue)?

def init_cache(library_path):
from calibre.db.backend import DB
from calibre.db.cache import Cache
backend = DB(library_path)
cache = Cache(backend)
cache.init()
return cache

import tempfile
temporary_txt_file = tempfile.NamedTemporaryFile(suffix='txt', delete=False)

cache = init_cache(library_path = 'C:\\Users\\Jenny\\Documents\\Calibre Library\\')


for id in cache.all_book_ids():
cache.add_format(id, 'TXT', temporary_txt_file)

Last edited by Josieb1; 11-27-2014 at 05:15 AM.
Josieb1 is offline   Reply With Quote