View Single Post
Old 11-07-2014, 10:19 PM   #3
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: 45,400
Karma: 27756918
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
1. You store persistent data, just like any other settings, in the config directory, they are not touched by install/uninstalls of plugins. See http://manual.calibre-ebook.com/crea...of-your-plugin

You wont store it as a .txt file, instead it will be stored as a string in a JSON file.

2. Dont store book specific data as a file. Store it in the database. Using db.new_api.add_custom_data and db.new_api.get_custom_data

Naturally this will only work in a user interface pugin, which has access ot the db

3. Use two plugins. You can technically get fancy and have your user interface plugin install the file type plugin on initialization, but that is a hack and likely to break in the future.
kovidgoyal is offline   Reply With Quote