Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Software > Calibre > Plugins

Notices

Reply
 
Thread Tools Search this Thread
Old 09-20-2021, 06:55 PM   #1
lsacher
Junior Member
lsacher began at the beginning.
 
Posts: 8
Karma: 10
Join Date: Jul 2017
Device: iPhone 6
SampleExportingApp Not Working Properly

Long time user of Calibre, but now I want to import annotations. I tried your
SampleExportingApp modified to use your highlight example. Using a mockup epub
of the "John Smith" book, I get as far as the Import Annotations pop-up showing
all the correct info including the 3 annotations. But then I get error messages:
Unable to import annotations from SampleExportingApp -and- UnboundLocalError:
local variable 'updated_annorations' referenced before assignment. The console
log shows:

File "calibre_plugins.annotations.annotations", line 165, in to_HTML
TypeError: '<' not supported between instances of 'NoneType' and 'NoneType'
-and-
File "calibre_plugins.annotations.action", line 1057, in present_annotated_books
UnboundLocalError: local variable 'updated_annotations' referenced before
assignment.

I'm using Windows 10 10.0.19041 [64bit] and calibre 5.27 [64bit]

Attached are the my actions, debug console listing and the mockup epub

Thanks
Larry
Attached Files
File Type: txt Console_Listing.txt (4.3 KB, 126 views)
File Type: epub A Book With Some Exported Annot - John Smith.epub (3.9 KB, 146 views)
lsacher is offline   Reply With Quote
Old 09-20-2021, 07:35 PM   #2
lsacher
Junior Member
lsacher began at the beginning.
 
Posts: 8
Karma: 10
Join Date: Jul 2017
Device: iPhone 6
Added: SampleExportingApp.py
Attached Files
File Type: py SampleExportingApp.py (8.9 KB, 128 views)
lsacher is offline   Reply With Quote
Advert
Old 09-20-2021, 11:14 PM   #3
davidfor
Grand Sorcerer
davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.
 
Posts: 24,907
Karma: 47303748
Join Date: Jul 2011
Location: Sydney, Australia
Device: Kobo:Touch,Glo, AuraH2O, GloHD,AuraONE, ClaraHD, Libra H2O; tolinoepos
Looking at your supplied SampleExportingApp.py, you have not added the code to read the annotations from anywhere. This file is a template for reading the annotations from a file produced by an ereader app. It does not actually work as it has no code to actually import anything. If you want to add support for another app, you need to add the code to parse the annotations from that app. You can look at the GoodReader.py for an example of this.
davidfor is offline   Reply With Quote
Old 09-21-2021, 07:43 PM   #4
lsacher
Junior Member
lsacher began at the beginning.
 
Posts: 8
Karma: 10
Join Date: Jul 2017
Device: iPhone 6
Quote:
Originally Posted by davidfor View Post
Looking at your supplied SampleExportingApp.py, you have not added the code to read the annotations from anywhere. This file is a template for reading the annotations from a file produced by an ereader app. It does not actually work as it has no code to actually import anything. If you want to add support for another app, you need to add the code to parse the annotations from that app. You can look at the GoodReader.py for an example of this.
I am aware that this app is not reading anything in, but rather it uses your test data already hardcoded in the app which amounts to 3 items which it pre-process OK. But when it goes to update the info it gets:

File "calibre_plugins.annotations.annotations", line 165, in to_HTML
TypeError: '<' not supported between instances of 'NoneType' and 'NoneType'

At line 165 in "annotations.py" the contents of "self.annotations" contains 3 objects:

[<calibre_plugins.annotations.annotations.Annotatio n object at 0x000001F265FA7CD0>,<calibre_plugins.annotations.a nnotations.Annotation object at 0x000001F265FA7E50>,<calibre_plugins.annotations.a nnotations.Annotation object at 0x000001F265FA7EB0>]

Your DEBUG info in "Console_Listing.txt" shows 3 items and the contents of one:

DEBUG: 65.0 AnnotatedBooksDialog::__init__ book_data= active: True
annotations: 3
author: 'John Smith'
author_sort: None
book_id: 883
cid: 883
confidence: None
genre: ''
last_annotation: None
last_update: 1354627020.0
path: None
reader_app: 'SampleExportingApp'
title: 'A Book With Some Exported Annotations'
title_sort: None
uuid: None

It seems to be getting the data, but not in a format it likes.

Last edited by lsacher; 09-21-2021 at 07:48 PM.
lsacher is offline   Reply With Quote
Old 09-22-2021, 03:43 PM   #5
lsacher
Junior Member
lsacher began at the beginning.
 
Posts: 8
Karma: 10
Join Date: Jul 2017
Device: iPhone 6
Added "Import Annotations" image.
Attached Thumbnails
Click image for larger version

Name:	Import Annotations.png
Views:	127
Size:	14.1 KB
ID:	189356  
lsacher is offline   Reply With Quote
Advert
Old 09-23-2021, 12:45 AM   #6
davidfor
Grand Sorcerer
davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.
 
Posts: 24,907
Karma: 47303748
Join Date: Jul 2011
Location: Sydney, Australia
Device: Kobo:Touch,Glo, AuraH2O, GloHD,AuraONE, ClaraHD, Libra H2O; tolinoepos
OK, I see what you mean now. I've obviously missed updating something in the sample. But, I don't get the error, or the Import Annotations dialog. That's probably something in my test environment. I'll try and look at it over the weekend.

If you look at the Goodreader code, that does work and you can test using an export from app if you want to install it somewhere.
davidfor is offline   Reply With Quote
Reply

Tags
sampleexportingapp


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Spanish recipes not working properly Spyral Recipes 10 11-28-2021 01:47 PM
Arrange into folders not working properly DrChiper Editor 5 03-01-2014 01:10 PM
Links not working properly? dokkeynot Sigil 1 06-27-2012 02:04 PM
Kindle for pc not working properly bodhran Amazon Kindle 4 09-18-2011 01:45 PM
lrf files not working properly munty LRF 4 01-25-2009 05:01 PM


All times are GMT -4. The time now is 10:33 AM.


MobileRead.com is a privately owned, operated and funded community.