|
You really should not be doing that. It is unsupported and quite likely to break in future versions, but if you really, really want to:
from calibre.gui2.ui import get_gui
db = get_gui().current_db.new_api
Of course, this will break in horrible ways if someone runs the fetch-ebook-metadata command line tool to download metadata without a GUI
|