View Single Post
Old 10-14-2017, 10:58 PM   #234
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,490
Karma: 28005164
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
From that error message it looks like this plugin is trying to create its own db objects. It should not be doing that. If it wants access to a db, it should ask for it from calibre. For example with

Code:
from calibre.gui2.ui import get_gui
db = get_gui().current_db
to get the currently opened library or for other libraries

Code:
from calibre.gui2.ui import get_gui
library_broker = get_gui().library_broker
newdb = library_broker.get_library(library_path)
Note that using library_broker requires calibre >= 3.0
kovidgoyal is offline   Reply With Quote