View Single Post
Old 02-18-2022, 10:31 AM   #1003
aik099
Enthusiast
aik099 rocks like Gibraltar!aik099 rocks like Gibraltar!aik099 rocks like Gibraltar!aik099 rocks like Gibraltar!aik099 rocks like Gibraltar!aik099 rocks like Gibraltar!aik099 rocks like Gibraltar!aik099 rocks like Gibraltar!aik099 rocks like Gibraltar!aik099 rocks like Gibraltar!aik099 rocks like Gibraltar!
 
Posts: 33
Karma: 100180
Join Date: Apr 2020
Device: none
Unable to make "SampleFetchingApp.py" class to work

Hi,

I've used https://github.com/davidfor/calibre-...FetchingApp.py and made these change in class declaration:

Code:
# Change the class name to <app_name>ReaderApp, e.g. 'KindleReaderApp'
class Nova3ReaderApp(USBReader):
    """
    Sample USB implementation
    Fetching annotations takes place in two stages:
    1) get_installed_books():
        add the installed books' metadata to the database
    2) get_active_annotations():
        add the annotations for installed books to the database
    """
    # The app name should be the first word from the
    # device's name property, e.g., 'Kindle' or 'SONY'. Drivers are located in
    # calibre.devices.<device>
    # For example, the name declared in the Kindle class
    # is 'Kindle 2/3/4/Touch/PaperWhite Device Interface',
    # so app_name would be the first word, 'Kindle'
    app_name = 'Nova3'

    # Change this to True when developing a new class from this template
    SUPPORTS_FETCHING = True
and of I've registered that class in the "annotations.json" file.

Now I see that class being loaded by the Calibre, however, when I connect my device which has "Nova3" device name (as app_name) the "import annotations from device" (or similarly named) menu entry of the "Annotations" toolbar button is grayed out.

I've also tried adding another class (as done for Kindle reader class), but that had no effect.

Code:
class NovaReaderApp(Nova3ReaderApp):
    """
    Fetching annotations takes place in two stages:
    1) get_installed_books():
        add the installed books' metadata to the database
    2) get_active_annotations():
        add the annotations for installed books to the database
    """
    # The app name should be the first word from the
    # device's name property, e.g., 'Kindle' or 'SONY'. Drivers are located in
    # calibre.devices.<device>
    # For example, the name declared in the Kindle class
    # is 'Kindle 2/3/4/Touch/PaperWhite Device Interface',
    # so app_name would be the first word, 'Kindle'
    app_name = 'Nova'
Any idea, what I'm doing wrong?

Thank you.
aik099 is offline   Reply With Quote