View Single Post
Old 02-02-2015, 01:38 PM   #5
Jellby
frumious Bandersnatch
Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.
 
Jellby's Avatar
 
Posts: 7,543
Karma: 19001583
Join Date: Jan 2008
Location: Spaniard in Sweden
Device: Cybook Orizon, Kobo Aura
Quote:
Originally Posted by kovidgoyal View Post
from calibre.gui2.ui import get_gui

db = get_gui().current_db.new_api
I put these inside the "identify" method of the plugin, and when I call it (using the download metadata button in the GUI) I get:

Code:
Traceback (most recent call last):
  File "site-packages/calibre/ebooks/metadata/sources/identify.py", line 44, in run
  File "calibre_plugins.dummy1.__init__", line 53, in identify
AttributeError: 'NoneType' object has no attribute 'current_db'
and of course "get_gui()" returns "None".
Jellby is offline   Reply With Quote