View Single Post
Old 11-27-2015, 05:19 PM   #212
NullNix
Guru
NullNix ought to be getting tired of karma fortunes by now.NullNix ought to be getting tired of karma fortunes by now.NullNix ought to be getting tired of karma fortunes by now.NullNix ought to be getting tired of karma fortunes by now.NullNix ought to be getting tired of karma fortunes by now.NullNix ought to be getting tired of karma fortunes by now.NullNix ought to be getting tired of karma fortunes by now.NullNix ought to be getting tired of karma fortunes by now.NullNix ought to be getting tired of karma fortunes by now.NullNix ought to be getting tired of karma fortunes by now.NullNix ought to be getting tired of karma fortunes by now.
 
Posts: 929
Karma: 15576314
Join Date: Jan 2013
Location: Ely, Cambridgeshire, UK
Device: Kindle Oasis 3, Kindle Oasis 1
Quote:
Originally Posted by norbusan View Post
Hi everyone,

I am running calibre 2.45 with the latest version of this plugin, and using a Kobo eink reader. Unfortunately, nothing works:
- pressing the annotation button in the menu
- no entry in the conext menu
- no way to get annotations

On the command line I see errors:
Code:
Traceback (most recent call last):
  File "/usr/lib/calibre/calibre/gui2/ui.py", line 227, in initialize
    ac.do_genesis()
  File "/usr/lib/calibre/calibre/gui2/actions/__init__.py", line 143, in do_genesis
    self.genesis()
  File "calibre_plugins.annotations.action", line 365, in genesis
  File "/usr/lib/calibre/calibre/devices/idevice/libimobiledevice.py", line 205, in __init__
    self.load_library()
  File "/usr/lib/calibre/calibre/devices/idevice/libimobiledevice.py", line 443, in load_library
    self.lib = cdll.LoadLibrary('libimobiledevice.so.5')
  File "/usr/lib/python2.7/ctypes/__init__.py", line 443, in LoadLibrary
    return self._dlltype(name)
  File "/usr/lib/python2.7/ctypes/__init__.py", line 365, in __init__
    self._handle = _dlopen(self._name, mode)
OSError: libimobiledevice.so.5: cannot open shared object file: No such file or directory
Traceback (most recent call last):
  File "/usr/lib/calibre/calibre/gui2/ui.py", line 404, in initialize
    ac.initialization_complete()
  File "calibre_plugins.annotations.action", line 729, in initialization_complete
  File "calibre_plugins.annotations.action", line 1073, in rebuild_menus
AttributeError: 'AnnotationsAction' object has no attribute 'menu'
Any hints?

Thanks

Norbert
I can confirm this. Your problem is the first error: AnnotationsAction.genesis() tries to instantiate a libiMobileDevice right before initializing self.menu, so when the exception is thrown you wind up with, well, no menu.

It is definitely incorrect to assume that this class can always be instantiated: it depends on shared libraries that may well not be present.

Fix that works for me attached. (As a zipped diff because mobileread doesn't accept diff attachments: why, mobileread, why?!)
Attached Files
File Type: zip annotations.diff.zip (510 Bytes, 537 views)
NullNix is offline   Reply With Quote